From 09b50b6eded45d0337634f7ecf244d5c5c33d316 Mon Sep 17 00:00:00 2001 From: nym21 Date: Tue, 11 Aug 2026 18:15:26 +0200 Subject: [PATCH] global: massive columnar rework part 2 --- crates/brk_client/src/lib.rs | 16181 ++++++++++++++-- crates/brk_cohort/src/addr.rs | 82 - crates/brk_cohort/src/age_range.rs | 57 +- crates/brk_cohort/src/amount.rs | 106 + crates/brk_cohort/src/amount_bucket.rs | 47 + crates/brk_cohort/src/amount_range.rs | 102 +- crates/brk_cohort/src/by_age.rs | 105 + crates/brk_cohort/src/by_entry.rs | 10 +- crates/brk_cohort/src/by_epoch.rs | 13 +- crates/brk_cohort/src/by_term.rs | 10 +- crates/brk_cohort/src/class.rs | 26 +- crates/brk_cohort/src/column_id.rs | 157 + crates/brk_cohort/src/lib.rs | 19 +- crates/brk_cohort/src/loss.rs | 21 +- crates/brk_cohort/src/over_age.rs | 28 +- crates/brk_cohort/src/over_amount.rs | 21 +- crates/brk_cohort/src/profit.rs | 26 +- crates/brk_cohort/src/profitability.rs | 229 +- crates/brk_cohort/src/profitability_range.rs | 49 +- crates/brk_cohort/src/spendable_type.rs | 93 +- crates/brk_cohort/src/under_age.rs | 28 +- crates/brk_cohort/src/under_amount.rs | 21 +- crates/brk_cohort/src/utxo.rs | 157 +- crates/brk_cohort/src/utxo_aggregate.rs | 98 + crates/brk_cohort/src/utxo_all_and_sth.rs | 36 + .../src/utxo_groups_without_amount.rs | 110 + .../src/utxo_groups_without_amount_or_type.rs | 105 + .../addr/activity/block_counts.rs | 21 + .../src/distribution/addr/activity/by_type.rs | 56 + .../src/distribution/addr/activity/mod.rs | 7 + .../addr/{activity.rs => activity/vecs.rs} | 129 +- .../{metrics/supply => addr}/avg_amount.rs | 91 +- .../addr/{delta.rs => count/delta_vecs.rs} | 7 +- .../distribution/addr/count/funded_vecs.rs | 83 + .../src/distribution/addr/count/mod.rs | 8 + .../{new_addr_count.rs => count/new_vecs.rs} | 0 .../total_vecs.rs} | 0 .../src/distribution/addr/indexes/any.rs | 4 +- .../brk_computer/src/distribution/addr/mod.rs | 15 +- .../distribution/addr/reused/events/vecs.rs | 67 +- .../src/distribution/addr/state.rs | 180 - .../src/distribution/addr/state/metrics.rs | 112 + .../src/distribution/addr/state/mod.rs | 7 + .../src/distribution/addr/state/receive.rs | 30 + .../src/distribution/addr/state/send.rs | 26 + .../src/distribution/addr/vecs.rs | 88 + .../src/distribution/all_chain_cache.rs | 15 +- .../src/distribution/block/cache/addr.rs | 6 +- .../src/distribution/block/cohort/received.rs | 20 +- .../src/distribution/block/cohort/sent.rs | 14 +- .../block/cohort/transfer_address_cache.rs | 4 +- .../distribution/block/cohort/with_source.rs | 6 +- .../src/distribution/cohorts/addr/groups.rs | 177 - .../src/distribution/cohorts/addr/metrics.rs | 103 - .../src/distribution/cohorts/addr/mod.rs | 5 - .../src/distribution/cohorts/addr/vecs.rs | 211 - .../src/distribution/cohorts/mod.rs | 7 - .../src/distribution/cohorts/traits.rs | 60 - .../src/distribution/cohorts/utxo/groups.rs | 1002 - .../src/distribution/cohorts/utxo/mod.rs | 12 - .../distribution/cohorts/utxo/percentiles.rs | 285 - .../distribution/cohorts/utxo/vecs/core.rs | 78 - .../distribution/cohorts/utxo/vecs/minimal.rs | 71 - .../src/distribution/cohorts/utxo/vecs/mod.rs | 209 - .../distribution/cohorts/utxo/vecs/type.rs | 77 - .../src/distribution/compute/block_loop.rs | 120 +- .../src/distribution/compute/context.rs | 105 +- .../src/distribution/compute/mod.rs | 8 +- .../distribution/compute/price_range_max.rs | 93 + .../src/distribution/compute/readers.rs | 264 - .../src/distribution/compute/readers/addr.rs | 73 + .../compute/readers/index_to_tx_index.rs | 43 + .../src/distribution/compute/readers/mod.rs | 11 + .../src/distribution/compute/readers/tx_in.rs | 81 + .../distribution/compute/readers/tx_out.rs | 63 + .../compute/readers/tx_out_data.rs | 9 + .../src/distribution/compute/recover.rs | 207 +- .../src/distribution/compute/write.rs | 11 +- .../src/distribution/metrics/activity/core.rs | 108 - .../src/distribution/metrics/activity/full.rs | 117 - .../distribution/metrics/activity/minimal.rs | 78 - .../src/distribution/metrics/activity/mod.rs | 106 +- .../activity/vecs/coindays_destroyed.rs | 52 + .../metrics/activity/vecs/collection.rs | 226 + .../activity/vecs/core_cumulative_value.rs | 67 + .../metrics/activity/vecs/cumulative_value.rs | 98 + .../distribution/metrics/activity/vecs/mod.rs | 11 + .../metrics/activity/vecs/sources.rs | 6 + .../metrics/additive/aggregate/fiat.rs | 84 + .../metrics/additive/aggregate/mod.rs | 3 + .../src/distribution/metrics/additive/mod.rs | 7 + .../distribution/metrics/additive/utxo_raw.rs | 45 + .../metrics/aggregate/cumulative_fiat.rs | 99 + .../distribution/metrics/aggregate/fiat.rs | 69 + .../src/distribution/metrics/aggregate/mod.rs | 11 + .../distribution/metrics/aggregate/percent.rs | 74 + .../distribution/metrics/aggregate/price.rs | 68 + .../src/distribution/metrics/cohort/all.rs | 151 - .../src/distribution/metrics/cohort/basic.rs | 76 - .../src/distribution/metrics/cohort/core.rs | 146 - .../distribution/metrics/cohort/extended.rs | 133 - .../metrics/cohort/extended_adjusted.rs | 103 - .../distribution/metrics/cohort/minimal.rs | 127 - .../src/distribution/metrics/cohort/mod.rs | 15 - .../src/distribution/metrics/cohort/type.rs | 89 - .../src/distribution/metrics/cohorts.rs | 524 + .../metrics/columnar/additive/mod.rs | 7 + .../columnar/additive/with_amount_and_type.rs | 186 + .../columnar/additive/without_amount.rs | 129 + .../additive/without_amount_or_type.rs | 242 + .../distribution/metrics/columnar/amount.rs | 109 + .../metrics/columnar/amount_value.rs | 74 + .../metrics/columnar/cumulative/mod.rs | 9 + .../cumulative/value_with_amount_and_type.rs | 187 + .../value_without_amount_or_type.rs | 196 + .../cumulative/with_amount_and_type.rs | 52 + .../cumulative/without_amount_or_type.rs | 52 + .../distribution/metrics/columnar/exact.rs | 168 + .../src/distribution/metrics/columnar/mod.rs | 29 + .../metrics/columnar/rows/aggregate.rs | 22 + .../metrics/columnar/rows/direct.rs | 105 + .../distribution/metrics/columnar/rows/mod.rs | 5 + .../src/distribution/metrics/config.rs | 177 - .../distribution/metrics/cost_basis/base.rs | 18 + .../metrics/cost_basis/block_data.rs | 12 + .../distribution/metrics/cost_basis/mod.rs | 230 +- .../distribution/metrics/cost_basis/side.rs | 11 + .../distribution/metrics/cost_basis/vecs.rs | 351 + .../src/distribution/metrics/mod.rs | 350 +- .../src/distribution/metrics/outputs/base.rs | 117 - .../src/distribution/metrics/outputs/mod.rs | 4 +- .../metrics/outputs/vecs/collection.rs | 63 + .../distribution/metrics/outputs/vecs/mod.rs | 7 + .../metrics/outputs/vecs/spent.rs | 52 + .../metrics/outputs/vecs/unspent.rs | 75 + .../src/distribution/metrics/percentiles.rs | 66 + .../src/distribution/metrics/profitability.rs | 446 - .../metrics/profitability/column_id.rs | 164 + .../metrics/profitability/compute.rs | 134 + .../distribution/metrics/profitability/mod.rs | 7 + .../metrics/profitability/vecs.rs | 198 + .../distribution/metrics/realized/adjusted.rs | 247 +- .../realized/adjusted_sopr_compute_source.rs | 6 + .../metrics/realized/aggregate_sources.rs | 6 + .../metrics/realized/aggregate_state.rs | 37 + .../metrics/realized/block_data.rs | 24 + .../src/distribution/metrics/realized/core.rs | 177 - .../src/distribution/metrics/realized/full.rs | 352 - .../distribution/metrics/realized/minimal.rs | 167 - .../src/distribution/metrics/realized/mod.rs | 100 +- .../distribution/metrics/realized/neg_loss.rs | 12 + .../metrics/realized/sopr_24h_input.rs | 22 + .../metrics/realized/sopr_vecs.rs | 385 + .../distribution/metrics/realized/totals.rs | 51 + .../distribution/metrics/realized/vecs/cap.rs | 45 + .../metrics/realized/vecs/collection.rs | 619 + .../metrics/realized/vecs/cumulative.rs | 53 + .../metrics/realized/vecs/cumulative_net.rs | 60 + .../distribution/metrics/realized/vecs/mod.rs | 15 + .../metrics/realized/vecs/price.rs | 44 + .../metrics/realized/vecs/sources.rs | 19 + .../metrics/realized/vecs/value_destroyed.rs | 53 + .../relative/extended_own_market_cap.rs | 61 - .../metrics/relative/extended_own_pnl.rs | 63 - .../distribution/metrics/relative/for_all.rs | 59 - .../src/distribution/metrics/relative/full.rs | 104 - .../metrics/relative/gross_pnl_composition.rs | 191 + .../metrics/relative/invested_capital.rs | 53 - .../src/distribution/metrics/relative/mod.rs | 20 +- .../distribution/metrics/relative/source.rs | 16 + .../relative/supply_profitability_shares.rs | 163 + .../src/distribution/metrics/relative/vecs.rs | 266 + .../metrics/relative/with_extended.rs | 72 - .../distribution/metrics/supply/age_range.rs | 176 - .../src/distribution/metrics/supply/base.rs | 203 +- .../distribution/metrics/supply/by_cohort.rs | 60 + .../src/distribution/metrics/supply/cache.rs | 17 +- .../src/distribution/metrics/supply/core.rs | 195 - .../src/distribution/metrics/supply/mod.rs | 16 +- .../distribution/metrics/supply/sources.rs | 7 + .../src/distribution/metrics/supply/total.rs | 95 + .../src/distribution/metrics/supply/vecs.rs | 198 + .../metrics/unrealized/aggregate_sources.rs | 10 + .../distribution/metrics/unrealized/basic.rs | 82 - .../distribution/metrics/unrealized/core.rs | 77 - .../distribution/metrics/unrealized/full.rs | 227 - .../distribution/metrics/unrealized/mod.rs | 94 +- .../{minimal.rs => mvrv_to_nupl.rs} | 28 +- .../metrics/unrealized/vecs/by_cohort.rs | 50 + .../metrics/unrealized/vecs/collection.rs | 277 + .../metrics/unrealized/vecs/mod.rs | 9 + .../metrics/unrealized/vecs/net_by_cohort.rs | 42 + .../metrics/unrealized/vecs/sources.rs | 9 + crates/brk_computer/src/distribution/mod.rs | 4 +- .../state/{cohort/addr.rs => addr/cohort.rs} | 3 +- .../src/distribution/state/addr/collection.rs | 117 + .../src/distribution/state/addr/mod.rs | 5 + .../state/{cohort/base.rs => cohort.rs} | 54 +- .../src/distribution/state/cohort/mod.rs | 7 - .../src/distribution/state/cohort/utxo.rs | 30 - .../state/cost_basis/core_realized_state.rs | 139 + .../src/distribution/state/cost_basis/data.rs | 248 +- .../cost_basis/minimal_realized_state.rs | 125 + .../src/distribution/state/cost_basis/mod.rs | 13 +- .../src/distribution/state/cost_basis/ops.rs | 30 + .../src/distribution/state/cost_basis/raw.rs | 213 + .../distribution/state/cost_basis/realized.rs | 405 +- .../state/cost_basis/realized_state.rs | 121 + .../state/cost_basis/unrealized.rs | 316 - .../state/cost_basis/unrealized/accumulate.rs | 42 + .../state/cost_basis/unrealized/cache.rs | 167 + .../state/cost_basis/unrealized/mod.rs | 13 + .../state/cost_basis/unrealized/state.rs | 36 + .../cost_basis/unrealized/with_capital.rs | 59 + .../cost_basis/unrealized/without_capital.rs | 54 + .../src/distribution/state/mod.rs | 4 + .../src/distribution/state/pending.rs | 26 - .../src/distribution/state/pending/cap.rs | 13 + .../state/pending/capitalized_cap.rs | 7 + .../src/distribution/state/pending/delta.rs | 7 + .../src/distribution/state/pending/mod.rs | 7 + .../src/distribution/state/utxo/cohort.rs | 83 + .../src/distribution/state/utxo/collection.rs | 287 + .../{cohorts => state}/utxo/fenwick.rs | 79 +- .../src/distribution/state/utxo/mod.rs | 22 + .../state/utxo/percentile_result.rs | 11 + .../state/utxo/profitability_range_result.rs | 35 + .../{cohorts => state}/utxo/receive.rs | 41 +- .../{cohorts => state}/utxo/send.rs | 62 +- .../state/utxo/send_precomputed.rs | 44 + .../{cohorts => state}/utxo/tick_tock.rs | 20 +- .../src/distribution/state/utxo/transient.rs | 11 + .../src/distribution/state/utxo/urpd.rs | 169 + crates/brk_computer/src/distribution/vecs.rs | 292 +- .../src/frameworks/coinflow/compute.rs | 190 +- .../src/frameworks/coinflow/horizon.rs | 124 + .../src/frameworks/coinflow/import.rs | 263 +- .../src/frameworks/coinflow/mod.rs | 8 +- .../src/frameworks/coinflow/vecs.rs | 162 - .../src/frameworks/coinflow/vecs/age_range.rs | 22 + .../frameworks/coinflow/vecs/aggregate/mod.rs | 22 + .../coinflow/vecs/aggregate/sources.rs | 17 + .../frameworks/coinflow/vecs/collection.rs | 14 + .../src/frameworks/coinflow/vecs/horizon.rs | 10 + .../src/frameworks/coinflow/vecs/mobility.rs | 7 + .../frameworks/coinflow/vecs/mobility_id.rs | 25 + .../src/frameworks/coinflow/vecs/mod.rs | 15 + .../coinflow/vecs/spending_exposure.rs | 15 + .../frameworks/cointime/activity/compute.rs | 3 +- .../activity/{vecs.rs => vecs/collection.rs} | 9 +- .../cointime/activity/vecs/derived.rs | 12 + .../frameworks/cointime/activity/vecs/mod.rs | 5 + .../frameworks/cointime/age_range/compute.rs | 60 +- .../age_range/vecs/activity_series.rs | 12 + .../age_range/{vecs.rs => vecs/collection.rs} | 17 +- .../frameworks/cointime/age_range/vecs/mod.rs | 7 + .../cointime/age_range/vecs/supply.rs | 7 + .../frameworks/cointime/aggregate/compute.rs | 124 +- .../frameworks/cointime/aggregate/import.rs | 251 +- .../src/frameworks/cointime/aggregate/mod.rs | 2 +- .../src/frameworks/cointime/aggregate/vecs.rs | 50 - .../cointime/aggregate/vecs/awake.rs | 15 + .../cointime/aggregate/vecs/cohort.rs | 9 + .../cointime/aggregate/vecs/collection.rs | 13 + .../cointime/aggregate/vecs/dormant.rs | 8 + .../frameworks/cointime/aggregate/vecs/mod.rs | 11 + .../cointime/aggregate/vecs/sources.rs | 13 + .../src/frameworks/cointime/cap/compute.rs | 5 +- .../src/frameworks/cointime/prices/compute.rs | 3 +- .../supply/{vecs.rs => vecs/collection.rs} | 8 +- .../cointime/supply/vecs/lazy_base.rs | 9 + .../frameworks/cointime/supply/vecs/mod.rs | 5 + .../src/frameworks/cointime/value/compute.rs | 5 +- crates/brk_computer/src/frameworks/mod.rs | 141 +- .../weighted/cohort_contribution.rs | 8 + .../src/frameworks/weighted/cohort_state.rs | 102 + .../src/frameworks/weighted/mod.rs | 7 + .../src/frameworks/weighted/ratio.rs | 32 + crates/brk_computer/src/indicators/compute.rs | 37 +- crates/brk_computer/src/indicators/gini.rs | 19 +- crates/brk_computer/src/indicators/import.rs | 8 +- .../src/inputs/by_type/with_input_types.rs | 31 +- .../src/internal/containers/mod.rs | 2 - .../src/internal/containers/window_24h.rs | 7 - .../per_block/computed/columnar/base.rs | 20 +- .../computed/columnar/cumulative_rolling.rs | 64 +- .../computed/lazy_cumulative_rolling.rs | 19 +- .../per_block/computed/resolutions.rs | 9 + .../per_block/computed/with_deltas.rs | 31 +- .../internal/per_block/fiat/cumulative_sum.rs | 124 - .../src/internal/per_block/fiat/lazy.rs | 26 +- .../src/internal/per_block/fiat/lazy_block.rs | 9 +- .../per_block/fiat/lazy_cumulative_sum.rs | 50 + ....rs => lazy_cumulative_sum_with_deltas.rs} | 36 +- .../per_block/fiat/lazy_with_deltas.rs | 59 + .../src/internal/per_block/fiat/mod.rs | 12 +- .../internal/per_block/fiat/with_deltas.rs | 55 - .../src/internal/per_block/lazy/base.rs | 26 + .../src/internal/per_block/percent/lazy.rs | 25 - .../percent/lazy_cumulative_rolling.rs | 38 - .../per_block/percent/lazy_windows.rs | 30 - .../internal/per_block/ratio/lazy_price.rs | 42 +- .../src/internal/per_block/rolling/windows.rs | 25 +- .../src/internal/per_block/value/columnar.rs | 239 - .../value/columnar_cumulative_rolling.rs | 261 + .../value/{spot.rs => columnar_spot.rs} | 45 +- .../internal/per_block/value/cumulative.rs | 17 - .../per_block/value/cumulative_rolling.rs | 14 +- .../src/internal/per_block/value/lazy.rs | 10 +- .../per_block/value/lazy_cumulative.rs | 12 + .../value/lazy_cumulative_rolling.rs | 86 + .../value/lazy_derived_resolutions.rs | 74 +- .../per_block/value/lazy_rolling_avg.rs | 13 +- .../value/lazy_rolling_avg_amount.rs | 12 + .../per_block/value/lazy_rolling_sum.rs | 14 +- .../value/lazy_rolling_sum_amount.rs | 12 + .../src/internal/per_block/value/lazy_spot.rs | 91 +- .../per_block/value/lazy_spot_with_deltas.rs | 43 + .../src/internal/per_block/value/mod.rs | 18 +- .../src/internal/transform/currency.rs | 43 +- .../src/internal/transform/mod.rs | 6 +- crates/brk_computer/src/internal/value.rs | 18 +- crates/brk_computer/src/lib.rs | 9 +- .../src/models/bedrock/compute.rs | 115 +- .../brk_computer/src/models/bedrock/levels.rs | 16 + crates/brk_computer/src/models/bedrock/mod.rs | 25 +- .../src/models/bedrock/mode_vecs.rs | 26 + .../brk_computer/src/models/bedrock/modes.rs | 13 + .../src/models/bedrock/percentiles.rs | 12 + .../src/models/bedrock/price_bands.rs | 11 + .../brk_computer/src/models/bedrock/vecs.rs | 285 +- .../src/models/bedrock/weighted/mod.rs | 3 + .../src/models/bedrock/weighted/modes.rs | 14 + .../src/models/capital_sentiment/compute.rs | 27 +- crates/brk_computer/src/models/compute.rs | 10 +- .../src/models/rarity_meter/components.rs | 72 +- .../src/models/rarity_meter/mod.rs | 14 +- crates/brk_computer/src/supply/import.rs | 15 +- crates/brk_traversable_derive/src/lib.rs | 12 + crates/vecdb/src/traits/printable.rs | 26 +- crates/vecdb/src/variants/columnar/column.rs | 32 + crates/vecdb/src/variants/columnar/lazy.rs | 2 +- crates/vecdb/src/variants/columnar/mod.rs | 70 +- .../vecdb/src/variants/columnar/read_only.rs | 34 + crates/vecdb/src/variants/columnar/schema.rs | 9 + crates/vecdb/src/variants/columnar/sum.rs | 7 +- crates/vecdb/src/variants/columnar/traits.rs | 4 +- crates/vecdb/src/version/add.rs | 12 +- crates/vecdb/src/version/mod.rs | 17 + crates/vecdb/tests/columnar.rs | 38 +- experiments/brk/index.html | 2668 +++ modules/brk-client/index.js | 14107 ++++++++++++-- packages/brk_client/brk_client/__init__.py | 7772 +++++++- website/llms-full.txt | 2 +- website/llms.txt | 2 +- website/scripts/options/distribution/data.js | 22 +- website_next/learn/data/address-count.js | 2 +- website_next/learn/data/capitalization.js | 8 +- website_next/learn/data/supply.js | 4 +- website_next/llms-full.txt | 2 +- website_next/llms.txt | 2 +- 361 files changed, 50653 insertions(+), 16467 deletions(-) delete mode 100644 crates/brk_cohort/src/addr.rs create mode 100644 crates/brk_cohort/src/amount.rs create mode 100644 crates/brk_cohort/src/amount_bucket.rs create mode 100644 crates/brk_cohort/src/by_age.rs create mode 100644 crates/brk_cohort/src/column_id.rs create mode 100644 crates/brk_cohort/src/utxo_aggregate.rs create mode 100644 crates/brk_cohort/src/utxo_all_and_sth.rs create mode 100644 crates/brk_cohort/src/utxo_groups_without_amount.rs create mode 100644 crates/brk_cohort/src/utxo_groups_without_amount_or_type.rs create mode 100644 crates/brk_computer/src/distribution/addr/activity/block_counts.rs create mode 100644 crates/brk_computer/src/distribution/addr/activity/by_type.rs create mode 100644 crates/brk_computer/src/distribution/addr/activity/mod.rs rename crates/brk_computer/src/distribution/addr/{activity.rs => activity/vecs.rs} (59%) rename crates/brk_computer/src/distribution/{metrics/supply => addr}/avg_amount.rs (66%) rename crates/brk_computer/src/distribution/addr/{delta.rs => count/delta_vecs.rs} (87%) create mode 100644 crates/brk_computer/src/distribution/addr/count/funded_vecs.rs rename crates/brk_computer/src/distribution/addr/{new_addr_count.rs => count/new_vecs.rs} (100%) rename crates/brk_computer/src/distribution/addr/{total_addr_count.rs => count/total_vecs.rs} (100%) delete mode 100644 crates/brk_computer/src/distribution/addr/state.rs create mode 100644 crates/brk_computer/src/distribution/addr/state/metrics.rs create mode 100644 crates/brk_computer/src/distribution/addr/state/mod.rs create mode 100644 crates/brk_computer/src/distribution/addr/state/receive.rs create mode 100644 crates/brk_computer/src/distribution/addr/state/send.rs create mode 100644 crates/brk_computer/src/distribution/addr/vecs.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/addr/groups.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/addr/metrics.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/addr/mod.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/addr/vecs.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/mod.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/traits.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/utxo/groups.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/utxo/mod.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/utxo/vecs/core.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/utxo/vecs/minimal.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/utxo/vecs/mod.rs delete mode 100644 crates/brk_computer/src/distribution/cohorts/utxo/vecs/type.rs create mode 100644 crates/brk_computer/src/distribution/compute/price_range_max.rs delete mode 100644 crates/brk_computer/src/distribution/compute/readers.rs create mode 100644 crates/brk_computer/src/distribution/compute/readers/addr.rs create mode 100644 crates/brk_computer/src/distribution/compute/readers/index_to_tx_index.rs create mode 100644 crates/brk_computer/src/distribution/compute/readers/mod.rs create mode 100644 crates/brk_computer/src/distribution/compute/readers/tx_in.rs create mode 100644 crates/brk_computer/src/distribution/compute/readers/tx_out.rs create mode 100644 crates/brk_computer/src/distribution/compute/readers/tx_out_data.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/activity/core.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/activity/full.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/activity/minimal.rs create mode 100644 crates/brk_computer/src/distribution/metrics/activity/vecs/coindays_destroyed.rs create mode 100644 crates/brk_computer/src/distribution/metrics/activity/vecs/collection.rs create mode 100644 crates/brk_computer/src/distribution/metrics/activity/vecs/core_cumulative_value.rs create mode 100644 crates/brk_computer/src/distribution/metrics/activity/vecs/cumulative_value.rs create mode 100644 crates/brk_computer/src/distribution/metrics/activity/vecs/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/activity/vecs/sources.rs create mode 100644 crates/brk_computer/src/distribution/metrics/additive/aggregate/fiat.rs create mode 100644 crates/brk_computer/src/distribution/metrics/additive/aggregate/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/additive/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/additive/utxo_raw.rs create mode 100644 crates/brk_computer/src/distribution/metrics/aggregate/cumulative_fiat.rs create mode 100644 crates/brk_computer/src/distribution/metrics/aggregate/fiat.rs create mode 100644 crates/brk_computer/src/distribution/metrics/aggregate/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/aggregate/percent.rs create mode 100644 crates/brk_computer/src/distribution/metrics/aggregate/price.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/cohort/all.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/cohort/basic.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/cohort/core.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/cohort/extended.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/cohort/extended_adjusted.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/cohort/minimal.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/cohort/mod.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/cohort/type.rs create mode 100644 crates/brk_computer/src/distribution/metrics/cohorts.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/additive/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/additive/with_amount_and_type.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/additive/without_amount.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/additive/without_amount_or_type.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/amount.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/amount_value.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/cumulative/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/cumulative/value_with_amount_and_type.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/cumulative/value_without_amount_or_type.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/cumulative/with_amount_and_type.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/cumulative/without_amount_or_type.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/exact.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/rows/aggregate.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/rows/direct.rs create mode 100644 crates/brk_computer/src/distribution/metrics/columnar/rows/mod.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/config.rs create mode 100644 crates/brk_computer/src/distribution/metrics/cost_basis/base.rs create mode 100644 crates/brk_computer/src/distribution/metrics/cost_basis/block_data.rs create mode 100644 crates/brk_computer/src/distribution/metrics/cost_basis/side.rs create mode 100644 crates/brk_computer/src/distribution/metrics/cost_basis/vecs.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/outputs/base.rs create mode 100644 crates/brk_computer/src/distribution/metrics/outputs/vecs/collection.rs create mode 100644 crates/brk_computer/src/distribution/metrics/outputs/vecs/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/outputs/vecs/spent.rs create mode 100644 crates/brk_computer/src/distribution/metrics/outputs/vecs/unspent.rs create mode 100644 crates/brk_computer/src/distribution/metrics/percentiles.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/profitability.rs create mode 100644 crates/brk_computer/src/distribution/metrics/profitability/column_id.rs create mode 100644 crates/brk_computer/src/distribution/metrics/profitability/compute.rs create mode 100644 crates/brk_computer/src/distribution/metrics/profitability/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/profitability/vecs.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/adjusted_sopr_compute_source.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/aggregate_sources.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/aggregate_state.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/block_data.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/realized/core.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/realized/full.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/realized/minimal.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/neg_loss.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/sopr_24h_input.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/sopr_vecs.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/totals.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/vecs/cap.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/vecs/collection.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/vecs/cumulative.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/vecs/cumulative_net.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/vecs/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/vecs/price.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/vecs/sources.rs create mode 100644 crates/brk_computer/src/distribution/metrics/realized/vecs/value_destroyed.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/relative/extended_own_market_cap.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/relative/extended_own_pnl.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/relative/for_all.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/relative/full.rs create mode 100644 crates/brk_computer/src/distribution/metrics/relative/gross_pnl_composition.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/relative/invested_capital.rs create mode 100644 crates/brk_computer/src/distribution/metrics/relative/source.rs create mode 100644 crates/brk_computer/src/distribution/metrics/relative/supply_profitability_shares.rs create mode 100644 crates/brk_computer/src/distribution/metrics/relative/vecs.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/relative/with_extended.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/supply/age_range.rs create mode 100644 crates/brk_computer/src/distribution/metrics/supply/by_cohort.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/supply/core.rs create mode 100644 crates/brk_computer/src/distribution/metrics/supply/sources.rs create mode 100644 crates/brk_computer/src/distribution/metrics/supply/total.rs create mode 100644 crates/brk_computer/src/distribution/metrics/supply/vecs.rs create mode 100644 crates/brk_computer/src/distribution/metrics/unrealized/aggregate_sources.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/unrealized/basic.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/unrealized/core.rs delete mode 100644 crates/brk_computer/src/distribution/metrics/unrealized/full.rs rename crates/brk_computer/src/distribution/metrics/unrealized/{minimal.rs => mvrv_to_nupl.rs} (50%) create mode 100644 crates/brk_computer/src/distribution/metrics/unrealized/vecs/by_cohort.rs create mode 100644 crates/brk_computer/src/distribution/metrics/unrealized/vecs/collection.rs create mode 100644 crates/brk_computer/src/distribution/metrics/unrealized/vecs/mod.rs create mode 100644 crates/brk_computer/src/distribution/metrics/unrealized/vecs/net_by_cohort.rs create mode 100644 crates/brk_computer/src/distribution/metrics/unrealized/vecs/sources.rs rename crates/brk_computer/src/distribution/state/{cohort/addr.rs => addr/cohort.rs} (98%) create mode 100644 crates/brk_computer/src/distribution/state/addr/collection.rs create mode 100644 crates/brk_computer/src/distribution/state/addr/mod.rs rename crates/brk_computer/src/distribution/state/{cohort/base.rs => cohort.rs} (81%) delete mode 100644 crates/brk_computer/src/distribution/state/cohort/mod.rs delete mode 100644 crates/brk_computer/src/distribution/state/cohort/utxo.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/core_realized_state.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/minimal_realized_state.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/ops.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/raw.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/realized_state.rs delete mode 100644 crates/brk_computer/src/distribution/state/cost_basis/unrealized.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/unrealized/accumulate.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/unrealized/cache.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/unrealized/mod.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/unrealized/state.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/unrealized/with_capital.rs create mode 100644 crates/brk_computer/src/distribution/state/cost_basis/unrealized/without_capital.rs delete mode 100644 crates/brk_computer/src/distribution/state/pending.rs create mode 100644 crates/brk_computer/src/distribution/state/pending/cap.rs create mode 100644 crates/brk_computer/src/distribution/state/pending/capitalized_cap.rs create mode 100644 crates/brk_computer/src/distribution/state/pending/delta.rs create mode 100644 crates/brk_computer/src/distribution/state/pending/mod.rs create mode 100644 crates/brk_computer/src/distribution/state/utxo/cohort.rs create mode 100644 crates/brk_computer/src/distribution/state/utxo/collection.rs rename crates/brk_computer/src/distribution/{cohorts => state}/utxo/fenwick.rs (84%) create mode 100644 crates/brk_computer/src/distribution/state/utxo/mod.rs create mode 100644 crates/brk_computer/src/distribution/state/utxo/percentile_result.rs create mode 100644 crates/brk_computer/src/distribution/state/utxo/profitability_range_result.rs rename crates/brk_computer/src/distribution/{cohorts => state}/utxo/receive.rs (68%) rename crates/brk_computer/src/distribution/{cohorts => state}/utxo/send.rs (69%) create mode 100644 crates/brk_computer/src/distribution/state/utxo/send_precomputed.rs rename crates/brk_computer/src/distribution/{cohorts => state}/utxo/tick_tock.rs (88%) create mode 100644 crates/brk_computer/src/distribution/state/utxo/transient.rs create mode 100644 crates/brk_computer/src/distribution/state/utxo/urpd.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/horizon.rs delete mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs/age_range.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs/aggregate/mod.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs/aggregate/sources.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs/collection.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs/horizon.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs/mobility.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs/mobility_id.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs/mod.rs create mode 100644 crates/brk_computer/src/frameworks/coinflow/vecs/spending_exposure.rs rename crates/brk_computer/src/frameworks/cointime/activity/{vecs.rs => vecs/collection.rs} (61%) create mode 100644 crates/brk_computer/src/frameworks/cointime/activity/vecs/derived.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/activity/vecs/mod.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/age_range/vecs/activity_series.rs rename crates/brk_computer/src/frameworks/cointime/age_range/{vecs.rs => vecs/collection.rs} (71%) create mode 100644 crates/brk_computer/src/frameworks/cointime/age_range/vecs/mod.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/age_range/vecs/supply.rs delete mode 100644 crates/brk_computer/src/frameworks/cointime/aggregate/vecs.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/aggregate/vecs/awake.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/aggregate/vecs/cohort.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/aggregate/vecs/collection.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/aggregate/vecs/dormant.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/aggregate/vecs/mod.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/aggregate/vecs/sources.rs rename crates/brk_computer/src/frameworks/cointime/supply/{vecs.rs => vecs/collection.rs} (68%) create mode 100644 crates/brk_computer/src/frameworks/cointime/supply/vecs/lazy_base.rs create mode 100644 crates/brk_computer/src/frameworks/cointime/supply/vecs/mod.rs create mode 100644 crates/brk_computer/src/frameworks/weighted/cohort_contribution.rs create mode 100644 crates/brk_computer/src/frameworks/weighted/cohort_state.rs create mode 100644 crates/brk_computer/src/frameworks/weighted/mod.rs create mode 100644 crates/brk_computer/src/frameworks/weighted/ratio.rs delete mode 100644 crates/brk_computer/src/internal/containers/window_24h.rs delete mode 100644 crates/brk_computer/src/internal/per_block/fiat/cumulative_sum.rs create mode 100644 crates/brk_computer/src/internal/per_block/fiat/lazy_cumulative_sum.rs rename crates/brk_computer/src/internal/per_block/fiat/{cumulative_sum_with_deltas.rs => lazy_cumulative_sum_with_deltas.rs} (56%) create mode 100644 crates/brk_computer/src/internal/per_block/fiat/lazy_with_deltas.rs delete mode 100644 crates/brk_computer/src/internal/per_block/fiat/with_deltas.rs delete mode 100644 crates/brk_computer/src/internal/per_block/value/columnar.rs create mode 100644 crates/brk_computer/src/internal/per_block/value/columnar_cumulative_rolling.rs rename crates/brk_computer/src/internal/per_block/value/{spot.rs => columnar_spot.rs} (60%) create mode 100644 crates/brk_computer/src/internal/per_block/value/lazy_cumulative.rs create mode 100644 crates/brk_computer/src/internal/per_block/value/lazy_cumulative_rolling.rs create mode 100644 crates/brk_computer/src/internal/per_block/value/lazy_rolling_avg_amount.rs create mode 100644 crates/brk_computer/src/internal/per_block/value/lazy_rolling_sum_amount.rs create mode 100644 crates/brk_computer/src/internal/per_block/value/lazy_spot_with_deltas.rs create mode 100644 crates/brk_computer/src/models/bedrock/levels.rs create mode 100644 crates/brk_computer/src/models/bedrock/mode_vecs.rs create mode 100644 crates/brk_computer/src/models/bedrock/modes.rs create mode 100644 crates/brk_computer/src/models/bedrock/percentiles.rs create mode 100644 crates/brk_computer/src/models/bedrock/price_bands.rs create mode 100644 crates/brk_computer/src/models/bedrock/weighted/mod.rs create mode 100644 crates/brk_computer/src/models/bedrock/weighted/modes.rs create mode 100644 crates/vecdb/src/variants/columnar/column.rs create mode 100644 crates/vecdb/src/variants/columnar/read_only.rs create mode 100644 experiments/brk/index.html diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 04df17320..3da8fa6de 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -1069,6 +1069,35 @@ impl SeriesPattern for SeriesPattern35 { fn get(&self // Reusable pattern structs +/// Pattern struct for repeated tree structure. +pub struct _0pct100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctOverPattern2 { + pub _0pct_to_10pct_in_loss: AllLthSthPattern, + pub _0pct_to_10pct_in_profit: AllLthSthPattern, + pub _100pct_to_200pct_in_profit: AllLthSthPattern, + pub _10pct_to_20pct_in_loss: AllLthSthPattern, + pub _10pct_to_20pct_in_profit: AllLthSthPattern, + pub _200pct_to_300pct_in_profit: AllLthSthPattern, + pub _20pct_to_30pct_in_loss: AllLthSthPattern, + pub _20pct_to_30pct_in_profit: AllLthSthPattern, + pub _300pct_to_500pct_in_profit: AllLthSthPattern, + pub _30pct_to_40pct_in_loss: AllLthSthPattern, + pub _30pct_to_40pct_in_profit: AllLthSthPattern, + pub _40pct_to_50pct_in_loss: AllLthSthPattern, + pub _40pct_to_50pct_in_profit: AllLthSthPattern, + pub _500pct_to_1000pct_in_profit: AllLthSthPattern, + pub _50pct_to_60pct_in_loss: AllLthSthPattern, + pub _50pct_to_60pct_in_profit: AllLthSthPattern, + pub _60pct_to_70pct_in_loss: AllLthSthPattern, + pub _60pct_to_70pct_in_profit: AllLthSthPattern, + pub _70pct_to_80pct_in_loss: AllLthSthPattern, + pub _70pct_to_80pct_in_profit: AllLthSthPattern, + pub _80pct_to_90pct_in_loss: AllLthSthPattern, + pub _80pct_to_90pct_in_profit: AllLthSthPattern, + pub _90pct_to_100pct_in_loss: AllLthSthPattern, + pub _90pct_to_100pct_in_profit: AllLthSthPattern, + pub over_1000pct_in_profit: AllLthSthPattern, +} + /// Pattern struct for repeated tree structure. pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mCumulativeOverUnderPattern { pub _10y_to_12y: AverageBlockCumulativeSumPattern, @@ -1092,7 +1121,7 @@ pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mCumulativeOverUnderPatt pub _7y_to_8y: AverageBlockCumulativeSumPattern, pub _8y_to_10y: AverageBlockCumulativeSumPattern, pub _9m_to_1y: AverageBlockCumulativeSumPattern, - pub cumulative: SeriesPattern18<[StoredF64; 23]>, + pub cumulative: SeriesPattern18, pub over_15y: AverageBlockCumulativeSumPattern, pub under_1h: AverageBlockCumulativeSumPattern, } @@ -1120,11 +1149,39 @@ pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mHeightOverUnderPattern2 pub _7y_to_8y: BtcCentsSatsUsdPattern, pub _8y_to_10y: BtcCentsSatsUsdPattern, pub _9m_to_1y: BtcCentsSatsUsdPattern, - pub height: SeriesPattern18<[Sats; 23]>, + pub height: SeriesPattern18, pub over_15y: BtcCentsSatsUsdPattern, pub under_1h: BtcCentsSatsUsdPattern, } +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mHeightOverUnderPattern { + pub _10y_to_12y: SeriesPattern1, + pub _12y_to_15y: SeriesPattern1, + pub _18m_to_2y: SeriesPattern1, + pub _1d_to_1w: SeriesPattern1, + pub _1h_to_1d: SeriesPattern1, + pub _1m_to_2m: SeriesPattern1, + pub _1w_to_1m: SeriesPattern1, + pub _1y_to_18m: SeriesPattern1, + pub _2m_to_3m: SeriesPattern1, + pub _2y_to_3y: SeriesPattern1, + pub _3m_to_4m: SeriesPattern1, + pub _3y_to_4y: SeriesPattern1, + pub _4m_to_5m: SeriesPattern1, + pub _4y_to_5y: SeriesPattern1, + pub _5m_to_6m: SeriesPattern1, + pub _5y_to_6y: SeriesPattern1, + pub _6m_to_9m: SeriesPattern1, + pub _6y_to_7y: SeriesPattern1, + pub _7y_to_8y: SeriesPattern1, + pub _8y_to_10y: SeriesPattern1, + pub _9m_to_1y: SeriesPattern1, + pub height: SeriesPattern18, + pub over_15y: SeriesPattern1, + pub under_1h: SeriesPattern1, +} + /// Pattern struct for repeated tree structure. pub struct AscribeBareBitproofBlockstackCoinColuCumulativeDocproofEmptyEpobcEternityFactomKomodoMemoOmniOpenPoetRunesStacksStamperyTextUnknownVeriPattern3 { pub ascribe: AverageBlockCumulativeSumPattern, @@ -1154,30 +1211,196 @@ pub struct AscribeBareBitproofBlockstackCoinColuCumulativeDocproofEmptyEpobcEter } /// Pattern struct for repeated tree structure. -pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern3 { - pub _10y_to_12y: SeriesPattern1, - pub _12y_to_15y: SeriesPattern1, - pub _18m_to_2y: SeriesPattern1, - pub _1d_to_1w: SeriesPattern1, - pub _1h_to_1d: SeriesPattern1, - pub _1m_to_2m: SeriesPattern1, - pub _1w_to_1m: SeriesPattern1, - pub _1y_to_18m: SeriesPattern1, - pub _2m_to_3m: SeriesPattern1, - pub _2y_to_3y: SeriesPattern1, - pub _3m_to_4m: SeriesPattern1, - pub _3y_to_4y: SeriesPattern1, - pub _4m_to_5m: SeriesPattern1, - pub _4y_to_5y: SeriesPattern1, - pub _5m_to_6m: SeriesPattern1, - pub _5y_to_6y: SeriesPattern1, - pub _6m_to_9m: SeriesPattern1, - pub _6y_to_7y: SeriesPattern1, - pub _7y_to_8y: SeriesPattern1, - pub _8y_to_10y: SeriesPattern1, - pub _9m_to_1y: SeriesPattern1, - pub over_15y: SeriesPattern1, - pub under_1h: SeriesPattern1, +pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern { + pub _10y_to_12y: AverageBlockCumulativeSumPattern, + pub _12y_to_15y: AverageBlockCumulativeSumPattern, + pub _18m_to_2y: AverageBlockCumulativeSumPattern, + pub _1d_to_1w: AverageBlockCumulativeSumPattern, + pub _1h_to_1d: AverageBlockCumulativeSumPattern, + pub _1m_to_2m: AverageBlockCumulativeSumPattern, + pub _1w_to_1m: AverageBlockCumulativeSumPattern, + pub _1y_to_18m: AverageBlockCumulativeSumPattern, + pub _2m_to_3m: AverageBlockCumulativeSumPattern, + pub _2y_to_3y: AverageBlockCumulativeSumPattern, + pub _3m_to_4m: AverageBlockCumulativeSumPattern, + pub _3y_to_4y: AverageBlockCumulativeSumPattern, + pub _4m_to_5m: AverageBlockCumulativeSumPattern, + pub _4y_to_5y: AverageBlockCumulativeSumPattern, + pub _5m_to_6m: AverageBlockCumulativeSumPattern, + pub _5y_to_6y: AverageBlockCumulativeSumPattern, + pub _6m_to_9m: AverageBlockCumulativeSumPattern, + pub _6y_to_7y: AverageBlockCumulativeSumPattern, + pub _7y_to_8y: AverageBlockCumulativeSumPattern, + pub _8y_to_10y: AverageBlockCumulativeSumPattern, + pub _9m_to_1y: AverageBlockCumulativeSumPattern, + pub over_15y: AverageBlockCumulativeSumPattern, + pub under_1h: AverageBlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2 { + pub _10y_to_12y: AverageBlockCumulativeSumPattern2, + pub _12y_to_15y: AverageBlockCumulativeSumPattern2, + pub _18m_to_2y: AverageBlockCumulativeSumPattern2, + pub _1d_to_1w: AverageBlockCumulativeSumPattern2, + pub _1h_to_1d: AverageBlockCumulativeSumPattern2, + pub _1m_to_2m: AverageBlockCumulativeSumPattern2, + pub _1w_to_1m: AverageBlockCumulativeSumPattern2, + pub _1y_to_18m: AverageBlockCumulativeSumPattern2, + pub _2m_to_3m: AverageBlockCumulativeSumPattern2, + pub _2y_to_3y: AverageBlockCumulativeSumPattern2, + pub _3m_to_4m: AverageBlockCumulativeSumPattern2, + pub _3y_to_4y: AverageBlockCumulativeSumPattern2, + pub _4m_to_5m: AverageBlockCumulativeSumPattern2, + pub _4y_to_5y: AverageBlockCumulativeSumPattern2, + pub _5m_to_6m: AverageBlockCumulativeSumPattern2, + pub _5y_to_6y: AverageBlockCumulativeSumPattern2, + pub _6m_to_9m: AverageBlockCumulativeSumPattern2, + pub _6y_to_7y: AverageBlockCumulativeSumPattern2, + pub _7y_to_8y: AverageBlockCumulativeSumPattern2, + pub _8y_to_10y: AverageBlockCumulativeSumPattern2, + pub _9m_to_1y: AverageBlockCumulativeSumPattern2, + pub over_15y: AverageBlockCumulativeSumPattern2, + pub under_1h: AverageBlockCumulativeSumPattern2, +} + +impl _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String, disc: String) -> Self { + Self { + _10y_to_12y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("10y_to_12y_old_transfer_volume{disc}", disc=disc))), + _12y_to_15y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("12y_to_15y_old_transfer_volume{disc}", disc=disc))), + _18m_to_2y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("18m_to_2y_old_transfer_volume{disc}", disc=disc))), + _1d_to_1w: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1d_to_1w_old_transfer_volume{disc}", disc=disc))), + _1h_to_1d: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1h_to_1d_old_transfer_volume{disc}", disc=disc))), + _1m_to_2m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1m_to_2m_old_transfer_volume{disc}", disc=disc))), + _1w_to_1m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1w_to_1m_old_transfer_volume{disc}", disc=disc))), + _1y_to_18m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1y_to_18m_old_transfer_volume{disc}", disc=disc))), + _2m_to_3m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2m_to_3m_old_transfer_volume{disc}", disc=disc))), + _2y_to_3y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2y_to_3y_old_transfer_volume{disc}", disc=disc))), + _3m_to_4m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("3m_to_4m_old_transfer_volume{disc}", disc=disc))), + _3y_to_4y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("3y_to_4y_old_transfer_volume{disc}", disc=disc))), + _4m_to_5m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("4m_to_5m_old_transfer_volume{disc}", disc=disc))), + _4y_to_5y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("4y_to_5y_old_transfer_volume{disc}", disc=disc))), + _5m_to_6m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("5m_to_6m_old_transfer_volume{disc}", disc=disc))), + _5y_to_6y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("5y_to_6y_old_transfer_volume{disc}", disc=disc))), + _6m_to_9m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("6m_to_9m_old_transfer_volume{disc}", disc=disc))), + _6y_to_7y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("6y_to_7y_old_transfer_volume{disc}", disc=disc))), + _7y_to_8y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("7y_to_8y_old_transfer_volume{disc}", disc=disc))), + _8y_to_10y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("8y_to_10y_old_transfer_volume{disc}", disc=disc))), + _9m_to_1y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("9m_to_1y_old_transfer_volume{disc}", disc=disc))), + over_15y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("over_15y_old_transfer_volume{disc}", disc=disc))), + under_1h: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("under_1h_old_transfer_volume{disc}", disc=disc))), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern5 { + pub _10y_to_12y: BlockCumulativeSumPattern, + pub _12y_to_15y: BlockCumulativeSumPattern, + pub _18m_to_2y: BlockCumulativeSumPattern, + pub _1d_to_1w: BlockCumulativeSumPattern, + pub _1h_to_1d: BlockCumulativeSumPattern, + pub _1m_to_2m: BlockCumulativeSumPattern, + pub _1w_to_1m: BlockCumulativeSumPattern, + pub _1y_to_18m: BlockCumulativeSumPattern, + pub _2m_to_3m: BlockCumulativeSumPattern, + pub _2y_to_3y: BlockCumulativeSumPattern, + pub _3m_to_4m: BlockCumulativeSumPattern, + pub _3y_to_4y: BlockCumulativeSumPattern, + pub _4m_to_5m: BlockCumulativeSumPattern, + pub _4y_to_5y: BlockCumulativeSumPattern, + pub _5m_to_6m: BlockCumulativeSumPattern, + pub _5y_to_6y: BlockCumulativeSumPattern, + pub _6m_to_9m: BlockCumulativeSumPattern, + pub _6y_to_7y: BlockCumulativeSumPattern, + pub _7y_to_8y: BlockCumulativeSumPattern, + pub _8y_to_10y: BlockCumulativeSumPattern, + pub _9m_to_1y: BlockCumulativeSumPattern, + pub over_15y: BlockCumulativeSumPattern, + pub under_1h: BlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern12 { + pub _10y_to_12y: BtcCentsSatsUsdPattern, + pub _12y_to_15y: BtcCentsSatsUsdPattern, + pub _18m_to_2y: BtcCentsSatsUsdPattern, + pub _1d_to_1w: BtcCentsSatsUsdPattern, + pub _1h_to_1d: BtcCentsSatsUsdPattern, + pub _1m_to_2m: BtcCentsSatsUsdPattern, + pub _1w_to_1m: BtcCentsSatsUsdPattern, + pub _1y_to_18m: BtcCentsSatsUsdPattern, + pub _2m_to_3m: BtcCentsSatsUsdPattern, + pub _2y_to_3y: BtcCentsSatsUsdPattern, + pub _3m_to_4m: BtcCentsSatsUsdPattern, + pub _3y_to_4y: BtcCentsSatsUsdPattern, + pub _4m_to_5m: BtcCentsSatsUsdPattern, + pub _4y_to_5y: BtcCentsSatsUsdPattern, + pub _5m_to_6m: BtcCentsSatsUsdPattern, + pub _5y_to_6y: BtcCentsSatsUsdPattern, + pub _6m_to_9m: BtcCentsSatsUsdPattern, + pub _6y_to_7y: BtcCentsSatsUsdPattern, + pub _7y_to_8y: BtcCentsSatsUsdPattern, + pub _8y_to_10y: BtcCentsSatsUsdPattern, + pub _9m_to_1y: BtcCentsSatsUsdPattern, + pub over_15y: BtcCentsSatsUsdPattern, + pub under_1h: BtcCentsSatsUsdPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern13 { + pub _10y_to_12y: CentsUsdPattern3, + pub _12y_to_15y: CentsUsdPattern3, + pub _18m_to_2y: CentsUsdPattern3, + pub _1d_to_1w: CentsUsdPattern3, + pub _1h_to_1d: CentsUsdPattern3, + pub _1m_to_2m: CentsUsdPattern3, + pub _1w_to_1m: CentsUsdPattern3, + pub _1y_to_18m: CentsUsdPattern3, + pub _2m_to_3m: CentsUsdPattern3, + pub _2y_to_3y: CentsUsdPattern3, + pub _3m_to_4m: CentsUsdPattern3, + pub _3y_to_4y: CentsUsdPattern3, + pub _4m_to_5m: CentsUsdPattern3, + pub _4y_to_5y: CentsUsdPattern3, + pub _5m_to_6m: CentsUsdPattern3, + pub _5y_to_6y: CentsUsdPattern3, + pub _6m_to_9m: CentsUsdPattern3, + pub _6y_to_7y: CentsUsdPattern3, + pub _7y_to_8y: CentsUsdPattern3, + pub _8y_to_10y: CentsUsdPattern3, + pub _9m_to_1y: CentsUsdPattern3, + pub over_15y: CentsUsdPattern3, + pub under_1h: CentsUsdPattern3, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern7 { + pub _10y_to_12y: SeriesPattern1, + pub _12y_to_15y: SeriesPattern1, + pub _18m_to_2y: SeriesPattern1, + pub _1d_to_1w: SeriesPattern1, + pub _1h_to_1d: SeriesPattern1, + pub _1m_to_2m: SeriesPattern1, + pub _1w_to_1m: SeriesPattern1, + pub _1y_to_18m: SeriesPattern1, + pub _2m_to_3m: SeriesPattern1, + pub _2y_to_3y: SeriesPattern1, + pub _3m_to_4m: SeriesPattern1, + pub _3y_to_4y: SeriesPattern1, + pub _4m_to_5m: SeriesPattern1, + pub _4y_to_5y: SeriesPattern1, + pub _5m_to_6m: SeriesPattern1, + pub _5y_to_6y: SeriesPattern1, + pub _6m_to_9m: SeriesPattern1, + pub _6y_to_7y: SeriesPattern1, + pub _7y_to_8y: SeriesPattern1, + pub _8y_to_10y: SeriesPattern1, + pub _9m_to_1y: SeriesPattern1, + pub over_15y: SeriesPattern1, + pub under_1h: SeriesPattern1, } /// Pattern struct for repeated tree structure. @@ -1237,57 +1460,301 @@ impl HeightIndexPct0Pct1Pct10Pct2Pct20Pct30Pct40Pct5Pct50Pct60Pct70Pct80Pct90Pct } /// Pattern struct for repeated tree structure. -pub struct HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern { - pub height: SeriesPattern18<[Cents; 19]>, - pub pct05: CentsSatsUsdPattern, - pub pct10: CentsSatsUsdPattern, - pub pct15: CentsSatsUsdPattern, - pub pct20: CentsSatsUsdPattern, - pub pct25: CentsSatsUsdPattern, - pub pct30: CentsSatsUsdPattern, - pub pct35: CentsSatsUsdPattern, - pub pct40: CentsSatsUsdPattern, - pub pct45: CentsSatsUsdPattern, - pub pct50: CentsSatsUsdPattern, - pub pct55: CentsSatsUsdPattern, - pub pct60: CentsSatsUsdPattern, - pub pct65: CentsSatsUsdPattern, - pub pct70: CentsSatsUsdPattern, - pub pct75: CentsSatsUsdPattern, - pub pct80: CentsSatsUsdPattern, - pub pct85: CentsSatsUsdPattern, - pub pct90: CentsSatsUsdPattern, - pub pct95: CentsSatsUsdPattern, +pub struct _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern { + pub _10y: AverageBlockCumulativeSumPattern, + pub _12y: AverageBlockCumulativeSumPattern, + pub _15y: AverageBlockCumulativeSumPattern, + pub _18m: AverageBlockCumulativeSumPattern, + pub _1m: AverageBlockCumulativeSumPattern, + pub _1w: AverageBlockCumulativeSumPattern, + pub _1y: AverageBlockCumulativeSumPattern, + pub _2m: AverageBlockCumulativeSumPattern, + pub _2y: AverageBlockCumulativeSumPattern, + pub _3m: AverageBlockCumulativeSumPattern, + pub _3y: AverageBlockCumulativeSumPattern, + pub _4m: AverageBlockCumulativeSumPattern, + pub _4y: AverageBlockCumulativeSumPattern, + pub _5m: AverageBlockCumulativeSumPattern, + pub _5y: AverageBlockCumulativeSumPattern, + pub _6m: AverageBlockCumulativeSumPattern, + pub _6y: AverageBlockCumulativeSumPattern, + pub _7y: AverageBlockCumulativeSumPattern, + pub _8y: AverageBlockCumulativeSumPattern, + pub _9m: AverageBlockCumulativeSumPattern, } -impl HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern { +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern { + pub _10y: AverageBlockCumulativeSumPattern, + pub _12y: AverageBlockCumulativeSumPattern, + pub _18m: AverageBlockCumulativeSumPattern, + pub _1d: AverageBlockCumulativeSumPattern, + pub _1m: AverageBlockCumulativeSumPattern, + pub _1w: AverageBlockCumulativeSumPattern, + pub _1y: AverageBlockCumulativeSumPattern, + pub _2m: AverageBlockCumulativeSumPattern, + pub _2y: AverageBlockCumulativeSumPattern, + pub _3m: AverageBlockCumulativeSumPattern, + pub _3y: AverageBlockCumulativeSumPattern, + pub _4m: AverageBlockCumulativeSumPattern, + pub _4y: AverageBlockCumulativeSumPattern, + pub _5m: AverageBlockCumulativeSumPattern, + pub _5y: AverageBlockCumulativeSumPattern, + pub _6m: AverageBlockCumulativeSumPattern, + pub _6y: AverageBlockCumulativeSumPattern, + pub _7y: AverageBlockCumulativeSumPattern, + pub _8y: AverageBlockCumulativeSumPattern, + pub _9m: AverageBlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 { + pub _10y: AverageBlockCumulativeSumPattern2, + pub _12y: AverageBlockCumulativeSumPattern2, + pub _15y: AverageBlockCumulativeSumPattern2, + pub _18m: AverageBlockCumulativeSumPattern2, + pub _1m: AverageBlockCumulativeSumPattern2, + pub _1w: AverageBlockCumulativeSumPattern2, + pub _1y: AverageBlockCumulativeSumPattern2, + pub _2m: AverageBlockCumulativeSumPattern2, + pub _2y: AverageBlockCumulativeSumPattern2, + pub _3m: AverageBlockCumulativeSumPattern2, + pub _3y: AverageBlockCumulativeSumPattern2, + pub _4m: AverageBlockCumulativeSumPattern2, + pub _4y: AverageBlockCumulativeSumPattern2, + pub _5m: AverageBlockCumulativeSumPattern2, + pub _5y: AverageBlockCumulativeSumPattern2, + pub _6m: AverageBlockCumulativeSumPattern2, + pub _6y: AverageBlockCumulativeSumPattern2, + pub _7y: AverageBlockCumulativeSumPattern2, + pub _8y: AverageBlockCumulativeSumPattern2, + pub _9m: AverageBlockCumulativeSumPattern2, +} + +impl _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 { /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { + pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { - height: SeriesPattern18::new(client.clone(), _m(&acc, "cents")), - pct05: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct05")), - pct10: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct10")), - pct15: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct15")), - pct20: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct20")), - pct25: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct25")), - pct30: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct30")), - pct35: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct35")), - pct40: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct40")), - pct45: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct45")), - pct50: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct50")), - pct55: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct55")), - pct60: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct60")), - pct65: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct65")), - pct70: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct70")), - pct75: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct75")), - pct80: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct80")), - pct85: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct85")), - pct90: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct90")), - pct95: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct95")), + _10y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("10y_old_transfer_volume{disc}", disc=disc))), + _12y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("12y_old_transfer_volume{disc}", disc=disc))), + _15y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("15y_old_transfer_volume{disc}", disc=disc))), + _18m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("18m_old_transfer_volume{disc}", disc=disc))), + _1m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1m_old_transfer_volume{disc}", disc=disc))), + _1w: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1w_old_transfer_volume{disc}", disc=disc))), + _1y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1y_old_transfer_volume{disc}", disc=disc))), + _2m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2m_old_transfer_volume{disc}", disc=disc))), + _2y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2y_old_transfer_volume{disc}", disc=disc))), + _3m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("3m_old_transfer_volume{disc}", disc=disc))), + _3y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("3y_old_transfer_volume{disc}", disc=disc))), + _4m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("4m_old_transfer_volume{disc}", disc=disc))), + _4y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("4y_old_transfer_volume{disc}", disc=disc))), + _5m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("5m_old_transfer_volume{disc}", disc=disc))), + _5y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("5y_old_transfer_volume{disc}", disc=disc))), + _6m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("6m_old_transfer_volume{disc}", disc=disc))), + _6y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("6y_old_transfer_volume{disc}", disc=disc))), + _7y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("7y_old_transfer_volume{disc}", disc=disc))), + _8y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("8y_old_transfer_volume{disc}", disc=disc))), + _9m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("9m_old_transfer_volume{disc}", disc=disc))), } } } +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 { + pub _10y: AverageBlockCumulativeSumPattern2, + pub _12y: AverageBlockCumulativeSumPattern2, + pub _18m: AverageBlockCumulativeSumPattern2, + pub _1d: AverageBlockCumulativeSumPattern2, + pub _1m: AverageBlockCumulativeSumPattern2, + pub _1w: AverageBlockCumulativeSumPattern2, + pub _1y: AverageBlockCumulativeSumPattern2, + pub _2m: AverageBlockCumulativeSumPattern2, + pub _2y: AverageBlockCumulativeSumPattern2, + pub _3m: AverageBlockCumulativeSumPattern2, + pub _3y: AverageBlockCumulativeSumPattern2, + pub _4m: AverageBlockCumulativeSumPattern2, + pub _4y: AverageBlockCumulativeSumPattern2, + pub _5m: AverageBlockCumulativeSumPattern2, + pub _5y: AverageBlockCumulativeSumPattern2, + pub _6m: AverageBlockCumulativeSumPattern2, + pub _6y: AverageBlockCumulativeSumPattern2, + pub _7y: AverageBlockCumulativeSumPattern2, + pub _8y: AverageBlockCumulativeSumPattern2, + pub _9m: AverageBlockCumulativeSumPattern2, +} + +impl _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String, disc: String) -> Self { + Self { + _10y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("10y_old_transfer_volume{disc}", disc=disc))), + _12y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("12y_old_transfer_volume{disc}", disc=disc))), + _18m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("18m_old_transfer_volume{disc}", disc=disc))), + _1d: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1d_old_transfer_volume{disc}", disc=disc))), + _1m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1m_old_transfer_volume{disc}", disc=disc))), + _1w: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1w_old_transfer_volume{disc}", disc=disc))), + _1y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1y_old_transfer_volume{disc}", disc=disc))), + _2m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2m_old_transfer_volume{disc}", disc=disc))), + _2y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2y_old_transfer_volume{disc}", disc=disc))), + _3m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("3m_old_transfer_volume{disc}", disc=disc))), + _3y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("3y_old_transfer_volume{disc}", disc=disc))), + _4m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("4m_old_transfer_volume{disc}", disc=disc))), + _4y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("4y_old_transfer_volume{disc}", disc=disc))), + _5m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("5m_old_transfer_volume{disc}", disc=disc))), + _5y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("5y_old_transfer_volume{disc}", disc=disc))), + _6m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("6m_old_transfer_volume{disc}", disc=disc))), + _6y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("6y_old_transfer_volume{disc}", disc=disc))), + _7y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("7y_old_transfer_volume{disc}", disc=disc))), + _8y: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("8y_old_transfer_volume{disc}", disc=disc))), + _9m: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("9m_old_transfer_volume{disc}", disc=disc))), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5 { + pub _10y: BlockCumulativeSumPattern, + pub _12y: BlockCumulativeSumPattern, + pub _15y: BlockCumulativeSumPattern, + pub _18m: BlockCumulativeSumPattern, + pub _1m: BlockCumulativeSumPattern, + pub _1w: BlockCumulativeSumPattern, + pub _1y: BlockCumulativeSumPattern, + pub _2m: BlockCumulativeSumPattern, + pub _2y: BlockCumulativeSumPattern, + pub _3m: BlockCumulativeSumPattern, + pub _3y: BlockCumulativeSumPattern, + pub _4m: BlockCumulativeSumPattern, + pub _4y: BlockCumulativeSumPattern, + pub _5m: BlockCumulativeSumPattern, + pub _5y: BlockCumulativeSumPattern, + pub _6m: BlockCumulativeSumPattern, + pub _6y: BlockCumulativeSumPattern, + pub _7y: BlockCumulativeSumPattern, + pub _8y: BlockCumulativeSumPattern, + pub _9m: BlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5 { + pub _10y: BlockCumulativeSumPattern, + pub _12y: BlockCumulativeSumPattern, + pub _18m: BlockCumulativeSumPattern, + pub _1d: BlockCumulativeSumPattern, + pub _1m: BlockCumulativeSumPattern, + pub _1w: BlockCumulativeSumPattern, + pub _1y: BlockCumulativeSumPattern, + pub _2m: BlockCumulativeSumPattern, + pub _2y: BlockCumulativeSumPattern, + pub _3m: BlockCumulativeSumPattern, + pub _3y: BlockCumulativeSumPattern, + pub _4m: BlockCumulativeSumPattern, + pub _4y: BlockCumulativeSumPattern, + pub _5m: BlockCumulativeSumPattern, + pub _5y: BlockCumulativeSumPattern, + pub _6m: BlockCumulativeSumPattern, + pub _6y: BlockCumulativeSumPattern, + pub _7y: BlockCumulativeSumPattern, + pub _8y: BlockCumulativeSumPattern, + pub _9m: BlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12 { + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, + pub _15y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _1w: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12 { + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _1d: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _1w: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13 { + pub _10y: CentsUsdPattern3, + pub _12y: CentsUsdPattern3, + pub _15y: CentsUsdPattern3, + pub _18m: CentsUsdPattern3, + pub _1m: CentsUsdPattern3, + pub _1w: CentsUsdPattern3, + pub _1y: CentsUsdPattern3, + pub _2m: CentsUsdPattern3, + pub _2y: CentsUsdPattern3, + pub _3m: CentsUsdPattern3, + pub _3y: CentsUsdPattern3, + pub _4m: CentsUsdPattern3, + pub _4y: CentsUsdPattern3, + pub _5m: CentsUsdPattern3, + pub _5y: CentsUsdPattern3, + pub _6m: CentsUsdPattern3, + pub _6y: CentsUsdPattern3, + pub _7y: CentsUsdPattern3, + pub _8y: CentsUsdPattern3, + pub _9m: CentsUsdPattern3, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13 { + pub _10y: CentsUsdPattern3, + pub _12y: CentsUsdPattern3, + pub _18m: CentsUsdPattern3, + pub _1d: CentsUsdPattern3, + pub _1m: CentsUsdPattern3, + pub _1w: CentsUsdPattern3, + pub _1y: CentsUsdPattern3, + pub _2m: CentsUsdPattern3, + pub _2y: CentsUsdPattern3, + pub _3m: CentsUsdPattern3, + pub _3y: CentsUsdPattern3, + pub _4m: CentsUsdPattern3, + pub _4y: CentsUsdPattern3, + pub _5m: CentsUsdPattern3, + pub _5y: CentsUsdPattern3, + pub _6m: CentsUsdPattern3, + pub _6y: CentsUsdPattern3, + pub _7y: CentsUsdPattern3, + pub _8y: CentsUsdPattern3, + pub _9m: CentsUsdPattern3, +} + /// Pattern struct for repeated tree structure. pub struct Pct0Pct1Pct10Pct2Pct20Pct30Pct40Pct5Pct50Pct60Pct70Pct80Pct90Pct95Pct98Pct99RatiosPattern { pub pct0_1: PpmPriceRatioPattern, @@ -1340,6 +1807,976 @@ impl Pct0Pct1Pct10Pct2Pct20Pct30Pct40Pct5Pct50Pct60Pct70Pct80Pct90Pct95Pct98Pct9 } } +/// Pattern struct for repeated tree structure. +pub struct _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7 { + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, + pub _15y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _1w: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _9m: SeriesPattern1, +} + +/// Pattern struct for repeated tree structure. +pub struct _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7 { + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _1d: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _1w: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _9m: SeriesPattern1, +} + +/// Pattern struct for repeated tree structure. +pub struct Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern { + pub pct05: CentsSatsUsdPattern, + pub pct10: CentsSatsUsdPattern, + pub pct15: CentsSatsUsdPattern, + pub pct20: CentsSatsUsdPattern, + pub pct25: CentsSatsUsdPattern, + pub pct30: CentsSatsUsdPattern, + pub pct35: CentsSatsUsdPattern, + pub pct40: CentsSatsUsdPattern, + pub pct45: CentsSatsUsdPattern, + pub pct50: CentsSatsUsdPattern, + pub pct55: CentsSatsUsdPattern, + pub pct60: CentsSatsUsdPattern, + pub pct65: CentsSatsUsdPattern, + pub pct70: CentsSatsUsdPattern, + pub pct75: CentsSatsUsdPattern, + pub pct80: CentsSatsUsdPattern, + pub pct85: CentsSatsUsdPattern, + pub pct90: CentsSatsUsdPattern, + pub pct95: CentsSatsUsdPattern, +} + +impl Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + pct05: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct05")), + pct10: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct10")), + pct15: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct15")), + pct20: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct20")), + pct25: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct25")), + pct30: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct30")), + pct35: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct35")), + pct40: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct40")), + pct45: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct45")), + pct50: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct50")), + pct55: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct55")), + pct60: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct60")), + pct65: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct65")), + pct70: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct70")), + pct75: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct75")), + pct80: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct80")), + pct85: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct85")), + pct90: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct90")), + pct95: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct95")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _200920102011201220132014201520162017201820192020202120222023202420252026Pattern { + pub _2009: AverageBlockCumulativeSumPattern, + pub _2010: AverageBlockCumulativeSumPattern, + pub _2011: AverageBlockCumulativeSumPattern, + pub _2012: AverageBlockCumulativeSumPattern, + pub _2013: AverageBlockCumulativeSumPattern, + pub _2014: AverageBlockCumulativeSumPattern, + pub _2015: AverageBlockCumulativeSumPattern, + pub _2016: AverageBlockCumulativeSumPattern, + pub _2017: AverageBlockCumulativeSumPattern, + pub _2018: AverageBlockCumulativeSumPattern, + pub _2019: AverageBlockCumulativeSumPattern, + pub _2020: AverageBlockCumulativeSumPattern, + pub _2021: AverageBlockCumulativeSumPattern, + pub _2022: AverageBlockCumulativeSumPattern, + pub _2023: AverageBlockCumulativeSumPattern, + pub _2024: AverageBlockCumulativeSumPattern, + pub _2025: AverageBlockCumulativeSumPattern, + pub _2026: AverageBlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2 { + pub _2009: AverageBlockCumulativeSumPattern2, + pub _2010: AverageBlockCumulativeSumPattern2, + pub _2011: AverageBlockCumulativeSumPattern2, + pub _2012: AverageBlockCumulativeSumPattern2, + pub _2013: AverageBlockCumulativeSumPattern2, + pub _2014: AverageBlockCumulativeSumPattern2, + pub _2015: AverageBlockCumulativeSumPattern2, + pub _2016: AverageBlockCumulativeSumPattern2, + pub _2017: AverageBlockCumulativeSumPattern2, + pub _2018: AverageBlockCumulativeSumPattern2, + pub _2019: AverageBlockCumulativeSumPattern2, + pub _2020: AverageBlockCumulativeSumPattern2, + pub _2021: AverageBlockCumulativeSumPattern2, + pub _2022: AverageBlockCumulativeSumPattern2, + pub _2023: AverageBlockCumulativeSumPattern2, + pub _2024: AverageBlockCumulativeSumPattern2, + pub _2025: AverageBlockCumulativeSumPattern2, + pub _2026: AverageBlockCumulativeSumPattern2, +} + +impl _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String, disc: String) -> Self { + Self { + _2009: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2009_transfer_volume{disc}", disc=disc))), + _2010: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2010_transfer_volume{disc}", disc=disc))), + _2011: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2011_transfer_volume{disc}", disc=disc))), + _2012: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2012_transfer_volume{disc}", disc=disc))), + _2013: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2013_transfer_volume{disc}", disc=disc))), + _2014: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2014_transfer_volume{disc}", disc=disc))), + _2015: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2015_transfer_volume{disc}", disc=disc))), + _2016: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2016_transfer_volume{disc}", disc=disc))), + _2017: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2017_transfer_volume{disc}", disc=disc))), + _2018: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2018_transfer_volume{disc}", disc=disc))), + _2019: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2019_transfer_volume{disc}", disc=disc))), + _2020: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2020_transfer_volume{disc}", disc=disc))), + _2021: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2021_transfer_volume{disc}", disc=disc))), + _2022: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2022_transfer_volume{disc}", disc=disc))), + _2023: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2023_transfer_volume{disc}", disc=disc))), + _2024: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2024_transfer_volume{disc}", disc=disc))), + _2025: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2025_transfer_volume{disc}", disc=disc))), + _2026: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2026_transfer_volume{disc}", disc=disc))), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _200920102011201220132014201520162017201820192020202120222023202420252026Pattern5 { + pub _2009: BlockCumulativeSumPattern, + pub _2010: BlockCumulativeSumPattern, + pub _2011: BlockCumulativeSumPattern, + pub _2012: BlockCumulativeSumPattern, + pub _2013: BlockCumulativeSumPattern, + pub _2014: BlockCumulativeSumPattern, + pub _2015: BlockCumulativeSumPattern, + pub _2016: BlockCumulativeSumPattern, + pub _2017: BlockCumulativeSumPattern, + pub _2018: BlockCumulativeSumPattern, + pub _2019: BlockCumulativeSumPattern, + pub _2020: BlockCumulativeSumPattern, + pub _2021: BlockCumulativeSumPattern, + pub _2022: BlockCumulativeSumPattern, + pub _2023: BlockCumulativeSumPattern, + pub _2024: BlockCumulativeSumPattern, + pub _2025: BlockCumulativeSumPattern, + pub _2026: BlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _200920102011201220132014201520162017201820192020202120222023202420252026Pattern12 { + pub _2009: BtcCentsSatsUsdPattern, + pub _2010: BtcCentsSatsUsdPattern, + pub _2011: BtcCentsSatsUsdPattern, + pub _2012: BtcCentsSatsUsdPattern, + pub _2013: BtcCentsSatsUsdPattern, + pub _2014: BtcCentsSatsUsdPattern, + pub _2015: BtcCentsSatsUsdPattern, + pub _2016: BtcCentsSatsUsdPattern, + pub _2017: BtcCentsSatsUsdPattern, + pub _2018: BtcCentsSatsUsdPattern, + pub _2019: BtcCentsSatsUsdPattern, + pub _2020: BtcCentsSatsUsdPattern, + pub _2021: BtcCentsSatsUsdPattern, + pub _2022: BtcCentsSatsUsdPattern, + pub _2023: BtcCentsSatsUsdPattern, + pub _2024: BtcCentsSatsUsdPattern, + pub _2025: BtcCentsSatsUsdPattern, + pub _2026: BtcCentsSatsUsdPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _200920102011201220132014201520162017201820192020202120222023202420252026Pattern13 { + pub _2009: CentsUsdPattern3, + pub _2010: CentsUsdPattern3, + pub _2011: CentsUsdPattern3, + pub _2012: CentsUsdPattern3, + pub _2013: CentsUsdPattern3, + pub _2014: CentsUsdPattern3, + pub _2015: CentsUsdPattern3, + pub _2016: CentsUsdPattern3, + pub _2017: CentsUsdPattern3, + pub _2018: CentsUsdPattern3, + pub _2019: CentsUsdPattern3, + pub _2020: CentsUsdPattern3, + pub _2021: CentsUsdPattern3, + pub _2022: CentsUsdPattern3, + pub _2023: CentsUsdPattern3, + pub _2024: CentsUsdPattern3, + pub _2025: CentsUsdPattern3, + pub _2026: CentsUsdPattern3, +} + +/// Pattern struct for repeated tree structure. +pub struct _200920102011201220132014201520162017201820192020202120222023202420252026Pattern7 { + pub _2009: SeriesPattern1, + pub _2010: SeriesPattern1, + pub _2011: SeriesPattern1, + pub _2012: SeriesPattern1, + pub _2013: SeriesPattern1, + pub _2014: SeriesPattern1, + pub _2015: SeriesPattern1, + pub _2016: SeriesPattern1, + pub _2017: SeriesPattern1, + pub _2018: SeriesPattern1, + pub _2019: SeriesPattern1, + pub _2020: SeriesPattern1, + pub _2021: SeriesPattern1, + pub _2022: SeriesPattern1, + pub _2023: SeriesPattern1, + pub _2024: SeriesPattern1, + pub _2025: SeriesPattern1, + pub _2026: SeriesPattern1, +} + +/// Pattern struct for repeated tree structure. +pub struct _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8 { + pub _0sats: AbsoluteRatePattern2, + pub _100btc_to_1k_btc: AbsoluteRatePattern2, + pub _100k_sats_to_1m_sats: AbsoluteRatePattern2, + pub _100sats_to_1k_sats: AbsoluteRatePattern2, + pub _10btc_to_100btc: AbsoluteRatePattern2, + pub _10k_btc_to_100k_btc: AbsoluteRatePattern2, + pub _10k_sats_to_100k_sats: AbsoluteRatePattern2, + pub _10m_sats_to_1btc: AbsoluteRatePattern2, + pub _10sats_to_100sats: AbsoluteRatePattern2, + pub _1btc_to_10btc: AbsoluteRatePattern2, + pub _1k_btc_to_10k_btc: AbsoluteRatePattern2, + pub _1k_sats_to_10k_sats: AbsoluteRatePattern2, + pub _1m_sats_to_10m_sats: AbsoluteRatePattern2, + pub _1sat_to_10sats: AbsoluteRatePattern2, + pub over_100k_btc: AbsoluteRatePattern2, +} + +impl _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _0sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "0sats_supply_delta")), + _100btc_to_1k_btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100btc_to_1k_btc_supply_delta")), + _100k_sats_to_1m_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100k_sats_to_1m_sats_supply_delta")), + _100sats_to_1k_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100sats_to_1k_sats_supply_delta")), + _10btc_to_100btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10btc_to_100btc_supply_delta")), + _10k_btc_to_100k_btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10k_btc_to_100k_btc_supply_delta")), + _10k_sats_to_100k_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10k_sats_to_100k_sats_supply_delta")), + _10m_sats_to_1btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10m_sats_to_1btc_supply_delta")), + _10sats_to_100sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10sats_to_100sats_supply_delta")), + _1btc_to_10btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1btc_to_10btc_supply_delta")), + _1k_btc_to_10k_btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1k_btc_to_10k_btc_supply_delta")), + _1k_sats_to_10k_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1k_sats_to_10k_sats_supply_delta")), + _1m_sats_to_10m_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1m_sats_to_10m_sats_supply_delta")), + _1sat_to_10sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1sat_to_10sats_supply_delta")), + over_100k_btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "over_100k_btc_supply_delta")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2 { + pub _0sats: AverageBlockCumulativeSumPattern2, + pub _100btc_to_1k_btc: AverageBlockCumulativeSumPattern2, + pub _100k_sats_to_1m_sats: AverageBlockCumulativeSumPattern2, + pub _100sats_to_1k_sats: AverageBlockCumulativeSumPattern2, + pub _10btc_to_100btc: AverageBlockCumulativeSumPattern2, + pub _10k_btc_to_100k_btc: AverageBlockCumulativeSumPattern2, + pub _10k_sats_to_100k_sats: AverageBlockCumulativeSumPattern2, + pub _10m_sats_to_1btc: AverageBlockCumulativeSumPattern2, + pub _10sats_to_100sats: AverageBlockCumulativeSumPattern2, + pub _1btc_to_10btc: AverageBlockCumulativeSumPattern2, + pub _1k_btc_to_10k_btc: AverageBlockCumulativeSumPattern2, + pub _1k_sats_to_10k_sats: AverageBlockCumulativeSumPattern2, + pub _1m_sats_to_10m_sats: AverageBlockCumulativeSumPattern2, + pub _1sat_to_10sats: AverageBlockCumulativeSumPattern2, + pub over_100k_btc: AverageBlockCumulativeSumPattern2, +} + +impl _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _0sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "0sats_transfer_volume")), + _100btc_to_1k_btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100btc_to_1k_btc_transfer_volume")), + _100k_sats_to_1m_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100k_sats_to_1m_sats_transfer_volume")), + _100sats_to_1k_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100sats_to_1k_sats_transfer_volume")), + _10btc_to_100btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10btc_to_100btc_transfer_volume")), + _10k_btc_to_100k_btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10k_btc_to_100k_btc_transfer_volume")), + _10k_sats_to_100k_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10k_sats_to_100k_sats_transfer_volume")), + _10m_sats_to_1btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10m_sats_to_1btc_transfer_volume")), + _10sats_to_100sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10sats_to_100sats_transfer_volume")), + _1btc_to_10btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1btc_to_10btc_transfer_volume")), + _1k_btc_to_10k_btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1k_btc_to_10k_btc_transfer_volume")), + _1k_sats_to_10k_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1k_sats_to_10k_sats_transfer_volume")), + _1m_sats_to_10m_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1m_sats_to_10m_sats_transfer_volume")), + _1sat_to_10sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1sat_to_10sats_transfer_volume")), + over_100k_btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "over_100k_btc_transfer_volume")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern { + pub _0sats: BaseDeltaPattern, + pub _100btc_to_1k_btc: BaseDeltaPattern, + pub _100k_sats_to_1m_sats: BaseDeltaPattern, + pub _100sats_to_1k_sats: BaseDeltaPattern, + pub _10btc_to_100btc: BaseDeltaPattern, + pub _10k_btc_to_100k_btc: BaseDeltaPattern, + pub _10k_sats_to_100k_sats: BaseDeltaPattern, + pub _10m_sats_to_1btc: BaseDeltaPattern, + pub _10sats_to_100sats: BaseDeltaPattern, + pub _1btc_to_10btc: BaseDeltaPattern, + pub _1k_btc_to_10k_btc: BaseDeltaPattern, + pub _1k_sats_to_10k_sats: BaseDeltaPattern, + pub _1m_sats_to_10m_sats: BaseDeltaPattern, + pub _1sat_to_10sats: BaseDeltaPattern, + pub over_100k_btc: BaseDeltaPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern5 { + pub _0sats: BlockCumulativeSumPattern, + pub _100btc_to_1k_btc: BlockCumulativeSumPattern, + pub _100k_sats_to_1m_sats: BlockCumulativeSumPattern, + pub _100sats_to_1k_sats: BlockCumulativeSumPattern, + pub _10btc_to_100btc: BlockCumulativeSumPattern, + pub _10k_btc_to_100k_btc: BlockCumulativeSumPattern, + pub _10k_sats_to_100k_sats: BlockCumulativeSumPattern, + pub _10m_sats_to_1btc: BlockCumulativeSumPattern, + pub _10sats_to_100sats: BlockCumulativeSumPattern, + pub _1btc_to_10btc: BlockCumulativeSumPattern, + pub _1k_btc_to_10k_btc: BlockCumulativeSumPattern, + pub _1k_sats_to_10k_sats: BlockCumulativeSumPattern, + pub _1m_sats_to_10m_sats: BlockCumulativeSumPattern, + pub _1sat_to_10sats: BlockCumulativeSumPattern, + pub over_100k_btc: BlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10 { + pub _0sats: BtcCentsSatsUsdPattern, + pub _100btc_to_1k_btc: BtcCentsSatsUsdPattern, + pub _100k_sats_to_1m_sats: BtcCentsSatsUsdPattern, + pub _100sats_to_1k_sats: BtcCentsSatsUsdPattern, + pub _10btc_to_100btc: BtcCentsSatsUsdPattern, + pub _10k_btc_to_100k_btc: BtcCentsSatsUsdPattern, + pub _10k_sats_to_100k_sats: BtcCentsSatsUsdPattern, + pub _10m_sats_to_1btc: BtcCentsSatsUsdPattern, + pub _10sats_to_100sats: BtcCentsSatsUsdPattern, + pub _1btc_to_10btc: BtcCentsSatsUsdPattern, + pub _1k_btc_to_10k_btc: BtcCentsSatsUsdPattern, + pub _1k_sats_to_10k_sats: BtcCentsSatsUsdPattern, + pub _1m_sats_to_10m_sats: BtcCentsSatsUsdPattern, + pub _1sat_to_10sats: BtcCentsSatsUsdPattern, + pub over_100k_btc: BtcCentsSatsUsdPattern, +} + +impl _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _0sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "0sats_supply")), + _100btc_to_1k_btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100btc_to_1k_btc_supply")), + _100k_sats_to_1m_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100k_sats_to_1m_sats_supply")), + _100sats_to_1k_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100sats_to_1k_sats_supply")), + _10btc_to_100btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10btc_to_100btc_supply")), + _10k_btc_to_100k_btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10k_btc_to_100k_btc_supply")), + _10k_sats_to_100k_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10k_sats_to_100k_sats_supply")), + _10m_sats_to_1btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10m_sats_to_1btc_supply")), + _10sats_to_100sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10sats_to_100sats_supply")), + _1btc_to_10btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1btc_to_10btc_supply")), + _1k_btc_to_10k_btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1k_btc_to_10k_btc_supply")), + _1k_sats_to_10k_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1k_sats_to_10k_sats_supply")), + _1m_sats_to_10m_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1m_sats_to_10m_sats_supply")), + _1sat_to_10sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1sat_to_10sats_supply")), + over_100k_btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "over_100k_btc_supply")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4 { + pub _0sats: CentsDeltaUsdPattern, + pub _100btc_to_1k_btc: CentsDeltaUsdPattern, + pub _100k_sats_to_1m_sats: CentsDeltaUsdPattern, + pub _100sats_to_1k_sats: CentsDeltaUsdPattern, + pub _10btc_to_100btc: CentsDeltaUsdPattern, + pub _10k_btc_to_100k_btc: CentsDeltaUsdPattern, + pub _10k_sats_to_100k_sats: CentsDeltaUsdPattern, + pub _10m_sats_to_1btc: CentsDeltaUsdPattern, + pub _10sats_to_100sats: CentsDeltaUsdPattern, + pub _1btc_to_10btc: CentsDeltaUsdPattern, + pub _1k_btc_to_10k_btc: CentsDeltaUsdPattern, + pub _1k_sats_to_10k_sats: CentsDeltaUsdPattern, + pub _1m_sats_to_10m_sats: CentsDeltaUsdPattern, + pub _1sat_to_10sats: CentsDeltaUsdPattern, + pub over_100k_btc: CentsDeltaUsdPattern, +} + +impl _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _0sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "0sats_realized_cap")), + _100btc_to_1k_btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100btc_to_1k_btc_realized_cap")), + _100k_sats_to_1m_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100k_sats_to_1m_sats_realized_cap")), + _100sats_to_1k_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100sats_to_1k_sats_realized_cap")), + _10btc_to_100btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10btc_to_100btc_realized_cap")), + _10k_btc_to_100k_btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10k_btc_to_100k_btc_realized_cap")), + _10k_sats_to_100k_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10k_sats_to_100k_sats_realized_cap")), + _10m_sats_to_1btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10m_sats_to_1btc_realized_cap")), + _10sats_to_100sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10sats_to_100sats_realized_cap")), + _1btc_to_10btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1btc_to_10btc_realized_cap")), + _1k_btc_to_10k_btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1k_btc_to_10k_btc_realized_cap")), + _1k_sats_to_10k_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1k_sats_to_10k_sats_realized_cap")), + _1m_sats_to_10m_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1m_sats_to_10m_sats_realized_cap")), + _1sat_to_10sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1sat_to_10sats_realized_cap")), + over_100k_btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "over_100k_btc_realized_cap")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9 { + pub _0sats: PercentPpmRatioPattern2, + pub _100btc_to_1k_btc: PercentPpmRatioPattern2, + pub _100k_sats_to_1m_sats: PercentPpmRatioPattern2, + pub _100sats_to_1k_sats: PercentPpmRatioPattern2, + pub _10btc_to_100btc: PercentPpmRatioPattern2, + pub _10k_btc_to_100k_btc: PercentPpmRatioPattern2, + pub _10k_sats_to_100k_sats: PercentPpmRatioPattern2, + pub _10m_sats_to_1btc: PercentPpmRatioPattern2, + pub _10sats_to_100sats: PercentPpmRatioPattern2, + pub _1btc_to_10btc: PercentPpmRatioPattern2, + pub _1k_btc_to_10k_btc: PercentPpmRatioPattern2, + pub _1k_sats_to_10k_sats: PercentPpmRatioPattern2, + pub _1m_sats_to_10m_sats: PercentPpmRatioPattern2, + pub _1sat_to_10sats: PercentPpmRatioPattern2, + pub over_100k_btc: PercentPpmRatioPattern2, +} + +impl _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _0sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "0sats_supply_dominance")), + _100btc_to_1k_btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100btc_to_1k_btc_supply_dominance")), + _100k_sats_to_1m_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100k_sats_to_1m_sats_supply_dominance")), + _100sats_to_1k_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100sats_to_1k_sats_supply_dominance")), + _10btc_to_100btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10btc_to_100btc_supply_dominance")), + _10k_btc_to_100k_btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10k_btc_to_100k_btc_supply_dominance")), + _10k_sats_to_100k_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10k_sats_to_100k_sats_supply_dominance")), + _10m_sats_to_1btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10m_sats_to_1btc_supply_dominance")), + _10sats_to_100sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10sats_to_100sats_supply_dominance")), + _1btc_to_10btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1btc_to_10btc_supply_dominance")), + _1k_btc_to_10k_btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1k_btc_to_10k_btc_supply_dominance")), + _1k_sats_to_10k_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1k_sats_to_10k_sats_supply_dominance")), + _1m_sats_to_10m_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1m_sats_to_10m_sats_supply_dominance")), + _1sat_to_10sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1sat_to_10sats_supply_dominance")), + over_100k_btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "over_100k_btc_supply_dominance")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctAllPattern2 { + pub _100pct: AllLthSthPattern, + pub _10pct: AllLthSthPattern, + pub _200pct: AllLthSthPattern, + pub _20pct: AllLthSthPattern, + pub _300pct: AllLthSthPattern, + pub _30pct: AllLthSthPattern, + pub _40pct: AllLthSthPattern, + pub _500pct: AllLthSthPattern, + pub _50pct: AllLthSthPattern, + pub _60pct: AllLthSthPattern, + pub _70pct: AllLthSthPattern, + pub _80pct: AllLthSthPattern, + pub _90pct: AllLthSthPattern, + pub all: AllLthSthPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1mPattern8 { + pub _100btc: AbsoluteRatePattern2, + pub _100k_btc: AbsoluteRatePattern2, + pub _100k_sats: AbsoluteRatePattern2, + pub _100sats: AbsoluteRatePattern2, + pub _10btc: AbsoluteRatePattern2, + pub _10k_btc: AbsoluteRatePattern2, + pub _10k_sats: AbsoluteRatePattern2, + pub _10m_sats: AbsoluteRatePattern2, + pub _10sats: AbsoluteRatePattern2, + pub _1btc: AbsoluteRatePattern2, + pub _1k_btc: AbsoluteRatePattern2, + pub _1k_sats: AbsoluteRatePattern2, + pub _1m_sats: AbsoluteRatePattern2, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1mPattern8 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100btc_supply_delta")), + _100k_btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100k_btc_supply_delta")), + _100k_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100k_sats_supply_delta")), + _100sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100sats_supply_delta")), + _10btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10btc_supply_delta")), + _10k_btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10k_btc_supply_delta")), + _10k_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10k_sats_supply_delta")), + _10m_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10m_sats_supply_delta")), + _10sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10sats_supply_delta")), + _1btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1btc_supply_delta")), + _1k_btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1k_btc_supply_delta")), + _1k_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1k_sats_supply_delta")), + _1m_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1m_sats_supply_delta")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8 { + pub _100btc: AbsoluteRatePattern2, + pub _100k_sats: AbsoluteRatePattern2, + pub _100sats: AbsoluteRatePattern2, + pub _10btc: AbsoluteRatePattern2, + pub _10k_btc: AbsoluteRatePattern2, + pub _10k_sats: AbsoluteRatePattern2, + pub _10m_sats: AbsoluteRatePattern2, + pub _10sats: AbsoluteRatePattern2, + pub _1btc: AbsoluteRatePattern2, + pub _1k_btc: AbsoluteRatePattern2, + pub _1k_sats: AbsoluteRatePattern2, + pub _1m_sats: AbsoluteRatePattern2, + pub _1sat: AbsoluteRatePattern2, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100btc_supply_delta")), + _100k_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100k_sats_supply_delta")), + _100sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "100sats_supply_delta")), + _10btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10btc_supply_delta")), + _10k_btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10k_btc_supply_delta")), + _10k_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10k_sats_supply_delta")), + _10m_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10m_sats_supply_delta")), + _10sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "10sats_supply_delta")), + _1btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1btc_supply_delta")), + _1k_btc: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1k_btc_supply_delta")), + _1k_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1k_sats_supply_delta")), + _1m_sats: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1m_sats_supply_delta")), + _1sat: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "1sat_supply_delta")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2 { + pub _100btc: AverageBlockCumulativeSumPattern2, + pub _100k_btc: AverageBlockCumulativeSumPattern2, + pub _100k_sats: AverageBlockCumulativeSumPattern2, + pub _100sats: AverageBlockCumulativeSumPattern2, + pub _10btc: AverageBlockCumulativeSumPattern2, + pub _10k_btc: AverageBlockCumulativeSumPattern2, + pub _10k_sats: AverageBlockCumulativeSumPattern2, + pub _10m_sats: AverageBlockCumulativeSumPattern2, + pub _10sats: AverageBlockCumulativeSumPattern2, + pub _1btc: AverageBlockCumulativeSumPattern2, + pub _1k_btc: AverageBlockCumulativeSumPattern2, + pub _1k_sats: AverageBlockCumulativeSumPattern2, + pub _1m_sats: AverageBlockCumulativeSumPattern2, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100btc_transfer_volume")), + _100k_btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100k_btc_transfer_volume")), + _100k_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100k_sats_transfer_volume")), + _100sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100sats_transfer_volume")), + _10btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10btc_transfer_volume")), + _10k_btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10k_btc_transfer_volume")), + _10k_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10k_sats_transfer_volume")), + _10m_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10m_sats_transfer_volume")), + _10sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10sats_transfer_volume")), + _1btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1btc_transfer_volume")), + _1k_btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1k_btc_transfer_volume")), + _1k_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1k_sats_transfer_volume")), + _1m_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1m_sats_transfer_volume")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2 { + pub _100btc: AverageBlockCumulativeSumPattern2, + pub _100k_sats: AverageBlockCumulativeSumPattern2, + pub _100sats: AverageBlockCumulativeSumPattern2, + pub _10btc: AverageBlockCumulativeSumPattern2, + pub _10k_btc: AverageBlockCumulativeSumPattern2, + pub _10k_sats: AverageBlockCumulativeSumPattern2, + pub _10m_sats: AverageBlockCumulativeSumPattern2, + pub _10sats: AverageBlockCumulativeSumPattern2, + pub _1btc: AverageBlockCumulativeSumPattern2, + pub _1k_btc: AverageBlockCumulativeSumPattern2, + pub _1k_sats: AverageBlockCumulativeSumPattern2, + pub _1m_sats: AverageBlockCumulativeSumPattern2, + pub _1sat: AverageBlockCumulativeSumPattern2, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100btc_transfer_volume")), + _100k_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100k_sats_transfer_volume")), + _100sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "100sats_transfer_volume")), + _10btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10btc_transfer_volume")), + _10k_btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10k_btc_transfer_volume")), + _10k_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10k_sats_transfer_volume")), + _10m_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10m_sats_transfer_volume")), + _10sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "10sats_transfer_volume")), + _1btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1btc_transfer_volume")), + _1k_btc: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1k_btc_transfer_volume")), + _1k_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1k_sats_transfer_volume")), + _1m_sats: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1m_sats_transfer_volume")), + _1sat: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "1sat_transfer_volume")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1mPattern { + pub _100btc: BaseDeltaPattern, + pub _100k_btc: BaseDeltaPattern, + pub _100k_sats: BaseDeltaPattern, + pub _100sats: BaseDeltaPattern, + pub _10btc: BaseDeltaPattern, + pub _10k_btc: BaseDeltaPattern, + pub _10k_sats: BaseDeltaPattern, + pub _10m_sats: BaseDeltaPattern, + pub _10sats: BaseDeltaPattern, + pub _1btc: BaseDeltaPattern, + pub _1k_btc: BaseDeltaPattern, + pub _1k_sats: BaseDeltaPattern, + pub _1m_sats: BaseDeltaPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern { + pub _100btc: BaseDeltaPattern, + pub _100k_sats: BaseDeltaPattern, + pub _100sats: BaseDeltaPattern, + pub _10btc: BaseDeltaPattern, + pub _10k_btc: BaseDeltaPattern, + pub _10k_sats: BaseDeltaPattern, + pub _10m_sats: BaseDeltaPattern, + pub _10sats: BaseDeltaPattern, + pub _1btc: BaseDeltaPattern, + pub _1k_btc: BaseDeltaPattern, + pub _1k_sats: BaseDeltaPattern, + pub _1m_sats: BaseDeltaPattern, + pub _1sat: BaseDeltaPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1mPattern5 { + pub _100btc: BlockCumulativeSumPattern, + pub _100k_btc: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _10sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern5 { + pub _100btc: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _10sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, + pub _1sat: BlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10 { + pub _100btc: BtcCentsSatsUsdPattern, + pub _100k_btc: BtcCentsSatsUsdPattern, + pub _100k_sats: BtcCentsSatsUsdPattern, + pub _100sats: BtcCentsSatsUsdPattern, + pub _10btc: BtcCentsSatsUsdPattern, + pub _10k_btc: BtcCentsSatsUsdPattern, + pub _10k_sats: BtcCentsSatsUsdPattern, + pub _10m_sats: BtcCentsSatsUsdPattern, + pub _10sats: BtcCentsSatsUsdPattern, + pub _1btc: BtcCentsSatsUsdPattern, + pub _1k_btc: BtcCentsSatsUsdPattern, + pub _1k_sats: BtcCentsSatsUsdPattern, + pub _1m_sats: BtcCentsSatsUsdPattern, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100btc_supply")), + _100k_btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100k_btc_supply")), + _100k_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100k_sats_supply")), + _100sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100sats_supply")), + _10btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10btc_supply")), + _10k_btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10k_btc_supply")), + _10k_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10k_sats_supply")), + _10m_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10m_sats_supply")), + _10sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10sats_supply")), + _1btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1btc_supply")), + _1k_btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1k_btc_supply")), + _1k_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1k_sats_supply")), + _1m_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1m_sats_supply")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10 { + pub _100btc: BtcCentsSatsUsdPattern, + pub _100k_sats: BtcCentsSatsUsdPattern, + pub _100sats: BtcCentsSatsUsdPattern, + pub _10btc: BtcCentsSatsUsdPattern, + pub _10k_btc: BtcCentsSatsUsdPattern, + pub _10k_sats: BtcCentsSatsUsdPattern, + pub _10m_sats: BtcCentsSatsUsdPattern, + pub _10sats: BtcCentsSatsUsdPattern, + pub _1btc: BtcCentsSatsUsdPattern, + pub _1k_btc: BtcCentsSatsUsdPattern, + pub _1k_sats: BtcCentsSatsUsdPattern, + pub _1m_sats: BtcCentsSatsUsdPattern, + pub _1sat: BtcCentsSatsUsdPattern, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100btc_supply")), + _100k_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100k_sats_supply")), + _100sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "100sats_supply")), + _10btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10btc_supply")), + _10k_btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10k_btc_supply")), + _10k_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10k_sats_supply")), + _10m_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10m_sats_supply")), + _10sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10sats_supply")), + _1btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1btc_supply")), + _1k_btc: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1k_btc_supply")), + _1k_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1k_sats_supply")), + _1m_sats: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1m_sats_supply")), + _1sat: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1sat_supply")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4 { + pub _100btc: CentsDeltaUsdPattern, + pub _100k_btc: CentsDeltaUsdPattern, + pub _100k_sats: CentsDeltaUsdPattern, + pub _100sats: CentsDeltaUsdPattern, + pub _10btc: CentsDeltaUsdPattern, + pub _10k_btc: CentsDeltaUsdPattern, + pub _10k_sats: CentsDeltaUsdPattern, + pub _10m_sats: CentsDeltaUsdPattern, + pub _10sats: CentsDeltaUsdPattern, + pub _1btc: CentsDeltaUsdPattern, + pub _1k_btc: CentsDeltaUsdPattern, + pub _1k_sats: CentsDeltaUsdPattern, + pub _1m_sats: CentsDeltaUsdPattern, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100btc_realized_cap")), + _100k_btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100k_btc_realized_cap")), + _100k_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100k_sats_realized_cap")), + _100sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100sats_realized_cap")), + _10btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10btc_realized_cap")), + _10k_btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10k_btc_realized_cap")), + _10k_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10k_sats_realized_cap")), + _10m_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10m_sats_realized_cap")), + _10sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10sats_realized_cap")), + _1btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1btc_realized_cap")), + _1k_btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1k_btc_realized_cap")), + _1k_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1k_sats_realized_cap")), + _1m_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1m_sats_realized_cap")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4 { + pub _100btc: CentsDeltaUsdPattern, + pub _100k_sats: CentsDeltaUsdPattern, + pub _100sats: CentsDeltaUsdPattern, + pub _10btc: CentsDeltaUsdPattern, + pub _10k_btc: CentsDeltaUsdPattern, + pub _10k_sats: CentsDeltaUsdPattern, + pub _10m_sats: CentsDeltaUsdPattern, + pub _10sats: CentsDeltaUsdPattern, + pub _1btc: CentsDeltaUsdPattern, + pub _1k_btc: CentsDeltaUsdPattern, + pub _1k_sats: CentsDeltaUsdPattern, + pub _1m_sats: CentsDeltaUsdPattern, + pub _1sat: CentsDeltaUsdPattern, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100btc_realized_cap")), + _100k_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100k_sats_realized_cap")), + _100sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "100sats_realized_cap")), + _10btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10btc_realized_cap")), + _10k_btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10k_btc_realized_cap")), + _10k_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10k_sats_realized_cap")), + _10m_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10m_sats_realized_cap")), + _10sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "10sats_realized_cap")), + _1btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1btc_realized_cap")), + _1k_btc: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1k_btc_realized_cap")), + _1k_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1k_sats_realized_cap")), + _1m_sats: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1m_sats_realized_cap")), + _1sat: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "1sat_realized_cap")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1mPattern9 { + pub _100btc: PercentPpmRatioPattern2, + pub _100k_btc: PercentPpmRatioPattern2, + pub _100k_sats: PercentPpmRatioPattern2, + pub _100sats: PercentPpmRatioPattern2, + pub _10btc: PercentPpmRatioPattern2, + pub _10k_btc: PercentPpmRatioPattern2, + pub _10k_sats: PercentPpmRatioPattern2, + pub _10m_sats: PercentPpmRatioPattern2, + pub _10sats: PercentPpmRatioPattern2, + pub _1btc: PercentPpmRatioPattern2, + pub _1k_btc: PercentPpmRatioPattern2, + pub _1k_sats: PercentPpmRatioPattern2, + pub _1m_sats: PercentPpmRatioPattern2, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1mPattern9 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100btc_supply_dominance")), + _100k_btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100k_btc_supply_dominance")), + _100k_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100k_sats_supply_dominance")), + _100sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100sats_supply_dominance")), + _10btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10btc_supply_dominance")), + _10k_btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10k_btc_supply_dominance")), + _10k_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10k_sats_supply_dominance")), + _10m_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10m_sats_supply_dominance")), + _10sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10sats_supply_dominance")), + _1btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1btc_supply_dominance")), + _1k_btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1k_btc_supply_dominance")), + _1k_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1k_sats_supply_dominance")), + _1m_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1m_sats_supply_dominance")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9 { + pub _100btc: PercentPpmRatioPattern2, + pub _100k_sats: PercentPpmRatioPattern2, + pub _100sats: PercentPpmRatioPattern2, + pub _10btc: PercentPpmRatioPattern2, + pub _10k_btc: PercentPpmRatioPattern2, + pub _10k_sats: PercentPpmRatioPattern2, + pub _10m_sats: PercentPpmRatioPattern2, + pub _10sats: PercentPpmRatioPattern2, + pub _1btc: PercentPpmRatioPattern2, + pub _1k_btc: PercentPpmRatioPattern2, + pub _1k_sats: PercentPpmRatioPattern2, + pub _1m_sats: PercentPpmRatioPattern2, + pub _1sat: PercentPpmRatioPattern2, +} + +impl _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _100btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100btc_supply_dominance")), + _100k_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100k_sats_supply_dominance")), + _100sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "100sats_supply_dominance")), + _10btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10btc_supply_dominance")), + _10k_btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10k_btc_supply_dominance")), + _10k_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10k_sats_supply_dominance")), + _10m_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10m_sats_supply_dominance")), + _10sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "10sats_supply_dominance")), + _1btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1btc_supply_dominance")), + _1k_btc: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1k_btc_supply_dominance")), + _1k_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1k_sats_supply_dominance")), + _1m_sats: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1m_sats_supply_dominance")), + _1sat: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "1sat_supply_dominance")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 { pub _10y: BtcCentsSatsUsdPattern, @@ -1413,39 +2850,19 @@ impl _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 { } /// Pattern struct for repeated tree structure. -pub struct CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern { - pub cap: CentsDeltaToUsdPattern, - pub capitalized: PricePattern, - pub gross_pnl: BlockCumulativeSumPattern, - pub loss: BlockCumulativeNegativeSumPattern, - pub mvrv: SeriesPattern1, - pub net_pnl: BlockChangeCumulativeDeltaSumPattern, - pub peak_regret: BlockCumulativeSumPattern, - pub price: CentsPpmRatioSatsUsdPattern, - pub profit: BlockCumulativeSumPattern, - pub profit_to_loss_ratio: _1m1w1y24hHeightPattern2, - pub sell_side_risk_ratio: _1m1w1y24hHeightPattern3, - pub sopr: AdjustedRatioValuePattern, -} - -impl CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cap: CentsDeltaToUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), - capitalized: PricePattern::new(client.clone(), _m(&acc, "capitalized_price")), - gross_pnl: BlockCumulativeSumPattern::new(client.clone(), _m(&acc, "realized_gross_pnl")), - loss: BlockCumulativeNegativeSumPattern::new(client.clone(), _m(&acc, "realized_loss")), - mvrv: SeriesPattern1::new(client.clone(), _m(&acc, "mvrv")), - net_pnl: BlockChangeCumulativeDeltaSumPattern::new(client.clone(), _m(&acc, "net")), - peak_regret: BlockCumulativeSumPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), - price: CentsPpmRatioSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - profit: BlockCumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit")), - profit_to_loss_ratio: _1m1w1y24hHeightPattern2::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), - sell_side_risk_ratio: _1m1w1y24hHeightPattern3::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sopr: AdjustedRatioValuePattern::new(client.clone(), acc.clone()), - } - } +pub struct AgeAllClassEntryEpochTermTypePattern2 { + pub age: OverRangeUnderPattern21, + pub age_range_matrix: SeriesPattern18, + pub all: BtcCentsSatsUsdPattern, + pub class: _200920102011201220132014201520162017201820192020202120222023202420252026Pattern12, + pub class_matrix: SeriesPattern18, + pub entry: DiscountPremiumPattern12, + pub entry_matrix: SeriesPattern18, + pub epoch: _01234Pattern12, + pub epoch_matrix: SeriesPattern18, + pub term: LongShortPattern13, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10, + pub type_matrix: SeriesPattern18, } /// Pattern struct for repeated tree structure. @@ -1534,7 +2951,109 @@ impl AverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern { } /// Pattern struct for repeated tree structure. -pub struct EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 { +pub struct EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5 { + pub empty: BlockCumulativeSumPattern, + pub p2a: BlockCumulativeSumPattern, + pub p2ms: BlockCumulativeSumPattern, + pub p2pk33: BlockCumulativeSumPattern, + pub p2pk65: BlockCumulativeSumPattern, + pub p2pkh: BlockCumulativeSumPattern, + pub p2sh: BlockCumulativeSumPattern, + pub p2tr: BlockCumulativeSumPattern, + pub p2wpkh: BlockCumulativeSumPattern, + pub p2wsh: BlockCumulativeSumPattern, + pub unknown: BlockCumulativeSumPattern, +} + +impl EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + empty: BlockCumulativeSumPattern::new(client.clone(), _p("empty_outputs", &acc)), + p2a: BlockCumulativeSumPattern::new(client.clone(), _p("p2a", &acc)), + p2ms: BlockCumulativeSumPattern::new(client.clone(), _p("p2ms", &acc)), + p2pk33: BlockCumulativeSumPattern::new(client.clone(), _p("p2pk33", &acc)), + p2pk65: BlockCumulativeSumPattern::new(client.clone(), _p("p2pk65", &acc)), + p2pkh: BlockCumulativeSumPattern::new(client.clone(), _p("p2pkh", &acc)), + p2sh: BlockCumulativeSumPattern::new(client.clone(), _p("p2sh", &acc)), + p2tr: BlockCumulativeSumPattern::new(client.clone(), _p("p2tr", &acc)), + p2wpkh: BlockCumulativeSumPattern::new(client.clone(), _p("p2wpkh", &acc)), + p2wsh: BlockCumulativeSumPattern::new(client.clone(), _p("p2wsh", &acc)), + unknown: BlockCumulativeSumPattern::new(client.clone(), _p("unknown_outputs", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10 { + pub empty: BtcCentsSatsUsdPattern, + pub p2a: BtcCentsSatsUsdPattern, + pub p2ms: BtcCentsSatsUsdPattern, + pub p2pk33: BtcCentsSatsUsdPattern, + pub p2pk65: BtcCentsSatsUsdPattern, + pub p2pkh: BtcCentsSatsUsdPattern, + pub p2sh: BtcCentsSatsUsdPattern, + pub p2tr: BtcCentsSatsUsdPattern, + pub p2wpkh: BtcCentsSatsUsdPattern, + pub p2wsh: BtcCentsSatsUsdPattern, + pub unknown: BtcCentsSatsUsdPattern, +} + +impl EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + empty: BtcCentsSatsUsdPattern::new(client.clone(), _p("empty_outputs", &acc)), + p2a: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2a", &acc)), + p2ms: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2ms", &acc)), + p2pk33: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2pk33", &acc)), + p2pk65: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2pk65", &acc)), + p2pkh: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2pkh", &acc)), + p2sh: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2sh", &acc)), + p2tr: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2tr", &acc)), + p2wpkh: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2wpkh", &acc)), + p2wsh: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2wsh", &acc)), + unknown: BtcCentsSatsUsdPattern::new(client.clone(), _p("unknown_outputs", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11 { + pub empty: CentsUsdPattern3, + pub p2a: CentsUsdPattern3, + pub p2ms: CentsUsdPattern3, + pub p2pk33: CentsUsdPattern3, + pub p2pk65: CentsUsdPattern3, + pub p2pkh: CentsUsdPattern3, + pub p2sh: CentsUsdPattern3, + pub p2tr: CentsUsdPattern3, + pub p2wpkh: CentsUsdPattern3, + pub p2wsh: CentsUsdPattern3, + pub unknown: CentsUsdPattern3, +} + +impl EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + empty: CentsUsdPattern3::new(client.clone(), _p("empty_outputs", &acc)), + p2a: CentsUsdPattern3::new(client.clone(), _p("p2a", &acc)), + p2ms: CentsUsdPattern3::new(client.clone(), _p("p2ms", &acc)), + p2pk33: CentsUsdPattern3::new(client.clone(), _p("p2pk33", &acc)), + p2pk65: CentsUsdPattern3::new(client.clone(), _p("p2pk65", &acc)), + p2pkh: CentsUsdPattern3::new(client.clone(), _p("p2pkh", &acc)), + p2sh: CentsUsdPattern3::new(client.clone(), _p("p2sh", &acc)), + p2tr: CentsUsdPattern3::new(client.clone(), _p("p2tr", &acc)), + p2wpkh: CentsUsdPattern3::new(client.clone(), _p("p2wpkh", &acc)), + p2wsh: CentsUsdPattern3::new(client.clone(), _p("p2wsh", &acc)), + unknown: CentsUsdPattern3::new(client.clone(), _p("unknown_outputs", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13 { pub empty: _1m1w1y24hPercentPpmRatioPattern, pub p2a: _1m1w1y24hPercentPpmRatioPattern, pub p2ms: _1m1w1y24hPercentPpmRatioPattern, @@ -1548,7 +3067,7 @@ pub struct EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 { pub unknown: _1m1w1y24hPercentPpmRatioPattern, } -impl EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 { +impl EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -1601,6 +3120,40 @@ impl AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90S } } +/// Pattern struct for repeated tree structure. +pub struct EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6 { + pub empty: SeriesPattern1, + pub p2a: SeriesPattern1, + pub p2ms: SeriesPattern1, + pub p2pk33: SeriesPattern1, + pub p2pk65: SeriesPattern1, + pub p2pkh: SeriesPattern1, + pub p2sh: SeriesPattern1, + pub p2tr: SeriesPattern1, + pub p2wpkh: SeriesPattern1, + pub p2wsh: SeriesPattern1, + pub unknown: SeriesPattern1, +} + +impl EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + empty: SeriesPattern1::new(client.clone(), _p("empty_outputs", &acc)), + p2a: SeriesPattern1::new(client.clone(), _p("p2a", &acc)), + p2ms: SeriesPattern1::new(client.clone(), _p("p2ms", &acc)), + p2pk33: SeriesPattern1::new(client.clone(), _p("p2pk33", &acc)), + p2pk65: SeriesPattern1::new(client.clone(), _p("p2pk65", &acc)), + p2pkh: SeriesPattern1::new(client.clone(), _p("p2pkh", &acc)), + p2sh: SeriesPattern1::new(client.clone(), _p("p2sh", &acc)), + p2tr: SeriesPattern1::new(client.clone(), _p("p2tr", &acc)), + p2wpkh: SeriesPattern1::new(client.clone(), _p("p2wpkh", &acc)), + p2wsh: SeriesPattern1::new(client.clone(), _p("p2wsh", &acc)), + unknown: SeriesPattern1::new(client.clone(), _p("unknown_outputs", &acc)), + } + } +} + /// Pattern struct for repeated tree structure. pub struct AllCumulativeP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern { pub all: AverageBlockCumulativeSumPattern, @@ -1629,6 +3182,49 @@ pub struct AllHeightP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern { pub p2wsh: SeriesPattern1, } +/// Pattern struct for repeated tree structure. +pub struct _10pct20pct30pct40pct50pct60pct70pct80pctAllPattern2 { + pub _10pct: AllLthSthPattern, + pub _20pct: AllLthSthPattern, + pub _30pct: AllLthSthPattern, + pub _40pct: AllLthSthPattern, + pub _50pct: AllLthSthPattern, + pub _60pct: AllLthSthPattern, + pub _70pct: AllLthSthPattern, + pub _80pct: AllLthSthPattern, + pub all: AllLthSthPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2 { + pub all: BtcCentsSatsUsdPattern, + pub p2a: BtcCentsSatsUsdPattern, + pub p2pk33: BtcCentsSatsUsdPattern, + pub p2pk65: BtcCentsSatsUsdPattern, + pub p2pkh: BtcCentsSatsUsdPattern, + pub p2sh: BtcCentsSatsUsdPattern, + pub p2tr: BtcCentsSatsUsdPattern, + pub p2wpkh: BtcCentsSatsUsdPattern, + pub p2wsh: BtcCentsSatsUsdPattern, +} + +impl AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + all: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), + p2a: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2a", &acc)), + p2pk33: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2pk33", &acc)), + p2pk65: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2pk65", &acc)), + p2pkh: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2pkh", &acc)), + p2sh: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2sh", &acc)), + p2tr: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2tr", &acc)), + p2wpkh: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2wpkh", &acc)), + p2wsh: BtcCentsSatsUsdPattern::new(client.clone(), _p("p2wsh", &acc)), + } + } +} + /// Pattern struct for repeated tree structure. pub struct AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4 { pub all: PercentPpmRatioPattern2, @@ -1659,6 +3255,36 @@ impl AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4 { } } +/// Pattern struct for repeated tree structure. +pub struct AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern { + pub all: _1m1w1y24hBlockPattern, + pub p2a: _1m1w1y24hBlockPattern, + pub p2pk33: _1m1w1y24hBlockPattern, + pub p2pk65: _1m1w1y24hBlockPattern, + pub p2pkh: _1m1w1y24hBlockPattern, + pub p2sh: _1m1w1y24hBlockPattern, + pub p2tr: _1m1w1y24hBlockPattern, + pub p2wpkh: _1m1w1y24hBlockPattern, + pub p2wsh: _1m1w1y24hBlockPattern, +} + +impl AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + all: _1m1w1y24hBlockPattern::new(client.clone(), acc.clone()), + p2a: _1m1w1y24hBlockPattern::new(client.clone(), _p("p2a", &acc)), + p2pk33: _1m1w1y24hBlockPattern::new(client.clone(), _p("p2pk33", &acc)), + p2pk65: _1m1w1y24hBlockPattern::new(client.clone(), _p("p2pk65", &acc)), + p2pkh: _1m1w1y24hBlockPattern::new(client.clone(), _p("p2pkh", &acc)), + p2sh: _1m1w1y24hBlockPattern::new(client.clone(), _p("p2sh", &acc)), + p2tr: _1m1w1y24hBlockPattern::new(client.clone(), _p("p2tr", &acc)), + p2wpkh: _1m1w1y24hBlockPattern::new(client.clone(), _p("p2wpkh", &acc)), + p2wsh: _1m1w1y24hBlockPattern::new(client.clone(), _p("p2wsh", &acc)), + } + } +} + /// Pattern struct for repeated tree structure. pub struct AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6 { pub all: _1m1w1y24hPercentPpmRatioPattern, @@ -1719,36 +3345,6 @@ impl AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern { } } -/// Pattern struct for repeated tree structure. -pub struct CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2 { - pub capitalized_cap_in_loss_raw: SeriesPattern18, - pub capitalized_cap_in_profit_raw: SeriesPattern18, - pub gross_pnl: CentsUsdPattern3, - pub invested_capital: InPattern2, - pub loss: CentsNegativeToUsdPattern2, - pub net_pnl: CentsToUsdPattern3, - pub nupl: PpmRatioPattern, - pub profit: CentsToUsdPattern4, - pub sentiment: GreedNetPainPattern, -} - -impl CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2 { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - capitalized_cap_in_loss_raw: SeriesPattern18::new(client.clone(), _m(&acc, "capitalized_cap_in_loss_raw")), - capitalized_cap_in_profit_raw: SeriesPattern18::new(client.clone(), _m(&acc, "capitalized_cap_in_profit_raw")), - gross_pnl: CentsUsdPattern3::new(client.clone(), _m(&acc, "unrealized_gross_pnl")), - invested_capital: InPattern2::new(client.clone(), _m(&acc, "invested_capital_in")), - loss: CentsNegativeToUsdPattern2::new(client.clone(), _m(&acc, "unrealized_loss")), - net_pnl: CentsToUsdPattern3::new(client.clone(), _m(&acc, "net_unrealized_pnl")), - nupl: PpmRatioPattern::new(client.clone(), _m(&acc, "nupl")), - profit: CentsToUsdPattern4::new(client.clone(), _m(&acc, "unrealized_profit")), - sentiment: GreedNetPainPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct Pct10Pct20Pct30Pct40Pct50Pct60Pct70Pct80Pct90Pattern { pub pct10: CentsSatsUsdPattern, @@ -1832,7 +3428,7 @@ impl _1m1w1y24hPercentPpmRatioPattern { } /// Pattern struct for repeated tree structure. -pub struct _1m1y2y3m4y6m8yPattern { +pub struct _1m1y2y3m4y6m8yPattern2 { pub _1m: SupplyPattern, pub _1y: SupplyPattern, pub _2y: SupplyPattern, @@ -1842,7 +3438,7 @@ pub struct _1m1y2y3m4y6m8yPattern { pub _8y: SupplyPattern, } -impl _1m1y2y3m4y6m8yPattern { +impl _1m1y2y3m4y6m8yPattern2 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -1869,29 +3465,14 @@ pub struct ActiveInputOutputSpendablePattern { } /// Pattern struct for repeated tree structure. -pub struct CapLossMvrvNetPriceProfitSoprPattern { - pub cap: CentsDeltaUsdPattern, - pub loss: BlockCumulativeNegativeSumPattern, - pub mvrv: SeriesPattern1, - pub net_pnl: BlockCumulativeDeltaSumPattern, - pub price: CentsPpmRatioSatsUsdPattern, - pub profit: BlockCumulativeSumPattern, - pub sopr: RatioValuePattern, -} - -impl CapLossMvrvNetPriceProfitSoprPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cap: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), - loss: BlockCumulativeNegativeSumPattern::new(client.clone(), _m(&acc, "realized_loss")), - mvrv: SeriesPattern1::new(client.clone(), _m(&acc, "mvrv")), - net_pnl: BlockCumulativeDeltaSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - price: CentsPpmRatioSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - profit: BlockCumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit")), - sopr: RatioValuePattern::new(client.clone(), acc.clone()), - } - } +pub struct AgeAllClassCumulativeEntryEpochTermPattern { + pub age: OverRangeUnderPattern2, + pub all: AverageBlockCumulativeSumPattern2, + pub class: _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2, + pub cumulative: AgeClassEntryEpochPattern, + pub entry: DiscountPremiumPattern2, + pub epoch: _01234Pattern2, + pub term: LongShortPattern2, } /// Pattern struct for repeated tree structure. @@ -1900,8 +3481,8 @@ pub struct InMaxMinPerSupplyPattern { pub in_profit: PerPattern, pub max: CentsSatsUsdPattern, pub min: CentsSatsUsdPattern, - pub per_coin: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, - pub per_dollar: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, + pub per_coin: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, + pub per_dollar: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, pub supply_density: PercentPpmRatioPattern2, } @@ -1913,8 +3494,8 @@ impl InMaxMinPerSupplyPattern { in_profit: PerPattern::new(client.clone(), _m(&acc, "cost_basis_in_profit_per")), max: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "cost_basis_max")), min: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "cost_basis_min")), - per_coin: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern::new(client.clone(), _m(&acc, "cost_basis_per_coin")), - per_dollar: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern::new(client.clone(), _m(&acc, "cost_basis_per_dollar")), + per_coin: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern::new(client.clone(), _m(&acc, "cost_basis_per_coin")), + per_dollar: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern::new(client.clone(), _m(&acc, "cost_basis_per_dollar")), supply_density: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "supply_density")), } } @@ -1996,102 +3577,6 @@ impl AverageBlockChainCumulativeDataSumPattern { } } -/// Pattern struct for repeated tree structure. -pub struct AverageBlockCumulativeInSumPattern { - pub average: _1m1w1y24hPattern3, - pub block: BtcCentsSatsUsdPattern3, - pub cumulative: BtcCentsSatsUsdPattern, - pub in_loss: AverageBlockCumulativeSumPattern2, - pub in_profit: AverageBlockCumulativeSumPattern2, - pub sum: _1m1w1y24hPattern4, -} - -impl AverageBlockCumulativeInSumPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - average: _1m1w1y24hPattern3::new(client.clone(), _m(&acc, "average")), - block: BtcCentsSatsUsdPattern3::new(client.clone(), acc.clone()), - cumulative: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "cumulative")), - in_loss: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "in_loss")), - in_profit: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, "in_profit")), - sum: _1m1w1y24hPattern4::new(client.clone(), _m(&acc, "sum")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CentsNegativeToUsdPattern2 { - pub cents: SeriesPattern1, - pub negative: SeriesPattern1, - pub to_mcap: PercentPpmRatioPattern2, - pub to_own_gross_pnl: PercentPpmRatioPattern2, - pub to_own_mcap: PercentPpmRatioPattern2, - pub usd: SeriesPattern1, -} - -impl CentsNegativeToUsdPattern2 { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), - negative: SeriesPattern1::new(client.clone(), _m(&acc, "neg")), - to_mcap: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "to_mcap")), - to_own_gross_pnl: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "to_own_gross_pnl")), - to_own_mcap: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "to_own_mcap")), - usd: SeriesPattern1::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct DeltaDominanceHalfInTotalPattern2 { - pub delta: AbsoluteRatePattern3, - pub dominance: PercentPpmRatioPattern2, - pub half: BtcCentsSatsUsdPattern, - pub in_loss: BtcCentsSatsShareUsdPattern, - pub in_profit: BtcCentsSatsShareUsdPattern, - pub total: BtcCentsSatsUsdPattern, -} - -impl DeltaDominanceHalfInTotalPattern2 { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - delta: AbsoluteRatePattern3::new(client.clone(), _m(&acc, "delta")), - dominance: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "dominance")), - half: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "half")), - in_loss: BtcCentsSatsShareUsdPattern::new(client.clone(), _m(&acc, "in_loss")), - in_profit: BtcCentsSatsShareUsdPattern::new(client.clone(), _m(&acc, "in_profit")), - total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct DeltaDominanceHalfInTotalPattern { - pub delta: AbsoluteRatePattern3, - pub dominance: PercentPpmRatioPattern2, - pub half: BtcCentsSatsUsdPattern, - pub in_loss: BtcCentsSatsUsdPattern, - pub in_profit: BtcCentsSatsUsdPattern, - pub total: BtcCentsSatsUsdPattern, -} - -impl DeltaDominanceHalfInTotalPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - delta: AbsoluteRatePattern3::new(client.clone(), _m(&acc, "delta")), - dominance: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "dominance")), - half: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "half")), - in_loss: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "in_loss")), - in_profit: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "in_profit")), - total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct HeightRankTailThresholdPattern { pub height: SeriesPattern18<[Dollars; 3]>, @@ -2116,6 +3601,64 @@ impl HeightRankTailThresholdPattern { } } +/// Pattern struct for repeated tree structure. +pub struct _01234Pattern { + pub _0: AverageBlockCumulativeSumPattern, + pub _1: AverageBlockCumulativeSumPattern, + pub _2: AverageBlockCumulativeSumPattern, + pub _3: AverageBlockCumulativeSumPattern, + pub _4: AverageBlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _01234Pattern2 { + pub _0: AverageBlockCumulativeSumPattern2, + pub _1: AverageBlockCumulativeSumPattern2, + pub _2: AverageBlockCumulativeSumPattern2, + pub _3: AverageBlockCumulativeSumPattern2, + pub _4: AverageBlockCumulativeSumPattern2, +} + +impl _01234Pattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String, disc: String) -> Self { + Self { + _0: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("0_transfer_volume{disc}", disc=disc))), + _1: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("1_transfer_volume{disc}", disc=disc))), + _2: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("2_transfer_volume{disc}", disc=disc))), + _3: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("3_transfer_volume{disc}", disc=disc))), + _4: AverageBlockCumulativeSumPattern2::new(client.clone(), _m(&acc, &format!("4_transfer_volume{disc}", disc=disc))), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _01234Pattern5 { + pub _0: BlockCumulativeSumPattern, + pub _1: BlockCumulativeSumPattern, + pub _2: BlockCumulativeSumPattern, + pub _3: BlockCumulativeSumPattern, + pub _4: BlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _01234Pattern12 { + pub _0: BtcCentsSatsUsdPattern, + pub _1: BtcCentsSatsUsdPattern, + pub _2: BtcCentsSatsUsdPattern, + pub _3: BtcCentsSatsUsdPattern, + pub _4: BtcCentsSatsUsdPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct _01234Pattern13 { + pub _0: CentsUsdPattern3, + pub _1: CentsUsdPattern3, + pub _2: CentsUsdPattern3, + pub _3: CentsUsdPattern3, + pub _4: CentsUsdPattern3, +} + /// Pattern struct for repeated tree structure. pub struct _1m1w1y24hHeightPattern3 { pub _1m: PercentPpmRatioPattern2, @@ -2204,28 +3747,6 @@ impl _1m1w1y24hHeightPattern { } } -/// Pattern struct for repeated tree structure. -pub struct _1m1w1y24hHeightPattern4 { - pub _1m: SeriesPattern1, - pub _1w: SeriesPattern1, - pub _1y: SeriesPattern1, - pub _24h: SeriesPattern1, - pub height: SeriesPattern18<[StoredF64; 3]>, -} - -impl _1m1w1y24hHeightPattern4 { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - _1m: SeriesPattern1::new(client.clone(), _m(&acc, "1m")), - _1w: SeriesPattern1::new(client.clone(), _m(&acc, "1w")), - _1y: SeriesPattern1::new(client.clone(), _m(&acc, "1y")), - _24h: SeriesPattern1::new(client.clone(), _m(&acc, "24h")), - height: SeriesPattern18::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct _1m1w1y24hHeightPattern2 { pub _1m: SeriesPattern1, @@ -2248,116 +3769,6 @@ impl _1m1w1y24hHeightPattern2 { } } -/// Pattern struct for repeated tree structure. -pub struct ActiveBidirectionalReactivatedReceivingSendingPattern { - pub active: _1m1w1y24hBlockPattern, - pub bidirectional: _1m1w1y24hBlockPattern, - pub reactivated: _1m1w1y24hBlockPattern, - pub receiving: _1m1w1y24hBlockPattern, - pub sending: _1m1w1y24hBlockPattern, -} - -impl ActiveBidirectionalReactivatedReceivingSendingPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - active: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "active_addrs")), - bidirectional: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "bidirectional_addrs")), - reactivated: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "reactivated_addrs")), - receiving: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "receiving_addrs")), - sending: _1m1w1y24hBlockPattern::new(client.clone(), _m(&acc, "sending_addrs")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct ActivityOutputsRealizedSupplyUnrealizedPattern { - pub activity: CoindaysTransferPattern, - pub outputs: SpentUnspentPattern, - pub realized: CapLossMvrvNetPriceProfitSoprPattern, - pub supply: DeltaDominanceHalfInTotalPattern, - pub unrealized: LossNetNuplProfitPattern, -} - -impl ActivityOutputsRealizedSupplyUnrealizedPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: CoindaysTransferPattern::new(client.clone(), acc.clone()), - outputs: SpentUnspentPattern::new(client.clone(), acc.clone()), - realized: CapLossMvrvNetPriceProfitSoprPattern::new(client.clone(), acc.clone()), - supply: DeltaDominanceHalfInTotalPattern::new(client.clone(), _m(&acc, "supply")), - unrealized: LossNetNuplProfitPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct ActivityAddrOutputsRealizedSupplyPattern { - pub activity: TransferPattern, - pub addr_count: BaseDeltaPattern, - pub outputs: UnspentPattern, - pub realized: CapLossProfitPattern, - pub supply: DeltaDominanceTotalPattern, -} - -impl ActivityAddrOutputsRealizedSupplyPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: TransferPattern::new(client.clone(), _m(&acc, "transfer_volume")), - addr_count: BaseDeltaPattern::new(client.clone(), _m(&acc, "addr_count")), - outputs: UnspentPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: CapLossProfitPattern::new(client.clone(), _m(&acc, "realized")), - supply: DeltaDominanceTotalPattern::new(client.clone(), _m(&acc, "supply")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct ActivityOutputsRealizedSupplyUnrealizedPattern3 { - pub activity: TransferPattern, - pub outputs: SpentUnspentPattern, - pub realized: CapLossMvrvPriceProfitPattern, - pub supply: DeltaDominanceHalfInTotalPattern, - pub unrealized: LossNuplProfitPattern, -} - -impl ActivityOutputsRealizedSupplyUnrealizedPattern3 { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: TransferPattern::new(client.clone(), _m(&acc, "transfer_volume")), - outputs: SpentUnspentPattern::new(client.clone(), acc.clone()), - realized: CapLossMvrvPriceProfitPattern::new(client.clone(), acc.clone()), - supply: DeltaDominanceHalfInTotalPattern::new(client.clone(), _m(&acc, "supply")), - unrealized: LossNuplProfitPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct ActivityOutputsRealizedSupplyUnrealizedPattern2 { - pub activity: TransferPattern, - pub outputs: SpentUnspentPattern, - pub realized: CapLossMvrvPriceProfitPattern, - pub supply: DeltaDominanceTotalPattern, - pub unrealized: NuplPattern, -} - -impl ActivityOutputsRealizedSupplyUnrealizedPattern2 { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: TransferPattern::new(client.clone(), _m(&acc, "transfer_volume")), - outputs: SpentUnspentPattern::new(client.clone(), acc.clone()), - realized: CapLossMvrvPriceProfitPattern::new(client.clone(), acc.clone()), - supply: DeltaDominanceTotalPattern::new(client.clone(), _m(&acc, "supply")), - unrealized: NuplPattern::new(client.clone(), _m(&acc, "nupl")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct AverageBlockCumulativeFeeSumPattern { pub average: _1m1w1y24hPattern, @@ -2380,33 +3791,11 @@ impl AverageBlockCumulativeFeeSumPattern { } } -/// Pattern struct for repeated tree structure. -pub struct BlockChangeCumulativeDeltaSumPattern { - pub block: CentsUsdPattern4, - pub change_1m: ToPattern, - pub cumulative: CentsUsdPattern, - pub delta: AbsoluteRatePattern2, - pub sum: _1m1w1y24hPattern5, -} - -impl BlockChangeCumulativeDeltaSumPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - block: CentsUsdPattern4::new(client.clone(), _m(&acc, "realized_pnl")), - change_1m: ToPattern::new(client.clone(), _m(&acc, "pnl_change_1m_to")), - cumulative: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_pnl_cumulative")), - delta: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "realized_pnl_delta")), - sum: _1m1w1y24hPattern5::new(client.clone(), _m(&acc, "realized_pnl_sum")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct BtcCentsDeltaSatsUsdPattern { pub btc: SeriesPattern1, pub cents: SeriesPattern1, - pub delta: AbsoluteRatePattern3, + pub delta: AbsoluteRatePattern2, pub sats: SeriesPattern1, pub usd: SeriesPattern1, } @@ -2417,7 +3806,7 @@ impl BtcCentsDeltaSatsUsdPattern { Self { btc: SeriesPattern1::new(client.clone(), acc.clone()), cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), - delta: AbsoluteRatePattern3::new(client.clone(), _m(&acc, "delta")), + delta: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "delta")), sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), usd: SeriesPattern1::new(client.clone(), _m(&acc, "usd")), } @@ -2428,55 +3817,11 @@ impl BtcCentsDeltaSatsUsdPattern { pub struct BtcCentsInSatsUsdPattern { pub btc: SeriesPattern1, pub cents: SeriesPattern1, - pub in_loss: SharePattern2, + pub in_loss: SharePattern3, pub sats: SeriesPattern1, pub usd: SeriesPattern1, } -/// Pattern struct for repeated tree structure. -pub struct BtcCentsSatsShareUsdPattern { - pub btc: SeriesPattern1, - pub cents: SeriesPattern1, - pub sats: SeriesPattern1, - pub share: PercentPpmRatioPattern2, - pub usd: SeriesPattern1, -} - -impl BtcCentsSatsShareUsdPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - btc: SeriesPattern1::new(client.clone(), acc.clone()), - cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), - sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), - share: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "share")), - usd: SeriesPattern1::new(client.clone(), _m(&acc, "usd")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CapLossMvrvPriceProfitPattern { - pub cap: CentsDeltaUsdPattern, - pub loss: BlockCumulativeSumPattern, - pub mvrv: SeriesPattern1, - pub price: CentsPpmRatioSatsUsdPattern, - pub profit: BlockCumulativeSumPattern, -} - -impl CapLossMvrvPriceProfitPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cap: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), - loss: BlockCumulativeSumPattern::new(client.clone(), _m(&acc, "realized_loss")), - mvrv: SeriesPattern1::new(client.clone(), _m(&acc, "mvrv")), - price: CentsPpmRatioSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - profit: BlockCumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct CentsPpmRatioSatsUsdPattern { pub cents: SeriesPattern1, @@ -2499,28 +3844,6 @@ impl CentsPpmRatioSatsUsdPattern { } } -/// Pattern struct for repeated tree structure. -pub struct CentsToUsdPattern4 { - pub cents: SeriesPattern1, - pub to_mcap: PercentPpmRatioPattern2, - pub to_own_gross_pnl: PercentPpmRatioPattern2, - pub to_own_mcap: PercentPpmRatioPattern2, - pub usd: SeriesPattern1, -} - -impl CentsToUsdPattern4 { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), - to_mcap: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "to_mcap")), - to_own_gross_pnl: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "to_own_gross_pnl")), - to_own_mcap: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "to_own_mcap")), - usd: SeriesPattern1::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct EmaHistogramLineSignalPattern { pub ema_fast: SeriesPattern1, @@ -2596,6 +3919,15 @@ impl PhsReboundThsPattern { } } +/// Pattern struct for repeated tree structure. +pub struct _01234Pattern7 { + pub _0: SeriesPattern1, + pub _1: SeriesPattern1, + pub _2: SeriesPattern1, + pub _3: SeriesPattern1, + pub _4: SeriesPattern1, +} + /// Pattern struct for repeated tree structure. pub struct CumulativeMultipleOversizedPrePattern3 { pub cumulative: SeriesPattern18, @@ -2646,14 +3978,14 @@ impl _1m1w1y24hPattern3 { } /// Pattern struct for repeated tree structure. -pub struct _1m1w1y24hPattern7 { +pub struct _1m1w1y24hPattern5 { pub _1m: BtcSatsPattern, pub _1w: BtcSatsPattern, pub _1y: BtcSatsPattern, pub _24h: BtcSatsPattern, } -impl _1m1w1y24hPattern7 { +impl _1m1w1y24hPattern5 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2686,14 +4018,14 @@ impl _1m1w1y2wPattern { } /// Pattern struct for repeated tree structure. -pub struct _1m1w1y24hPattern5 { +pub struct _1m1w1y24hPattern6 { pub _1m: CentsUsdPattern, pub _1w: CentsUsdPattern, pub _1y: CentsUsdPattern, pub _24h: CentsUsdPattern, } -impl _1m1w1y24hPattern5 { +impl _1m1w1y24hPattern6 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2706,14 +4038,14 @@ impl _1m1w1y24hPattern5 { } /// Pattern struct for repeated tree structure. -pub struct _1m1w1y24hPattern6 { +pub struct _1m1w1y24hPattern7 { pub _1m: CentsUsdPattern3, pub _1w: CentsUsdPattern3, pub _1y: CentsUsdPattern3, pub _24h: CentsUsdPattern3, } -impl _1m1w1y24hPattern6 { +impl _1m1w1y24hPattern7 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2745,6 +4077,50 @@ impl _1m1w1y24hPattern2 { } } +/// Pattern struct for repeated tree structure. +pub struct _1m1w1yHeightPattern { + pub _1m: SeriesPattern1, + pub _1w: SeriesPattern1, + pub _1y: SeriesPattern1, + pub height: SeriesPattern18<[StoredF64; 3]>, +} + +impl _1m1w1yHeightPattern { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _1m: SeriesPattern1::new(client.clone(), _m(&acc, "1m")), + _1w: SeriesPattern1::new(client.clone(), _m(&acc, "1w")), + _1y: SeriesPattern1::new(client.clone(), _m(&acc, "1y")), + height: SeriesPattern18::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct AgeClassEntryEpochPattern { + pub age_range: CentsSatsPattern, + pub class: CentsSatsPattern, + pub entry: CentsSatsPattern, + pub epoch: CentsSatsPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct AllCumulativeLthSthPattern { + pub all: BlockCumulativeSumPattern, + pub cumulative: SeriesPattern18, + pub lth: BlockCumulativeSumPattern, + pub sth: BlockCumulativeSumPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct AllHeightLthSthPattern4 { + pub all: PercentPpmRatioPattern2, + pub height: SeriesPattern18, + pub lth: PercentPpmRatioPattern2, + pub sth: PercentPpmRatioPattern2, +} + /// Pattern struct for repeated tree structure. pub struct AverageBlockCumulativeSumPattern2 { pub average: _1m1w1y24hPattern3, @@ -2765,32 +4141,12 @@ impl AverageBlockCumulativeSumPattern2 { } } -/// Pattern struct for repeated tree structure. -pub struct BlockCumulativeNegativeSumPattern { - pub block: CentsUsdPattern2, - pub cumulative: CentsUsdPattern3, - pub negative: BaseSumPattern, - pub sum: _1m1w1y24hPattern6, -} - -impl BlockCumulativeNegativeSumPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - block: CentsUsdPattern2::new(client.clone(), acc.clone()), - cumulative: CentsUsdPattern3::new(client.clone(), _m(&acc, "cumulative")), - negative: BaseSumPattern::new(client.clone(), _m(&acc, "neg")), - sum: _1m1w1y24hPattern6::new(client.clone(), _m(&acc, "sum")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct BlockCumulativeDeltaSumPattern { pub block: CentsUsdPattern4, pub cumulative: CentsUsdPattern, - pub delta: AbsoluteRatePattern2, - pub sum: _1m1w1y24hPattern5, + pub delta: AbsoluteRatePattern3, + pub sum: _1m1w1y24hPattern6, } impl BlockCumulativeDeltaSumPattern { @@ -2799,8 +4155,8 @@ impl BlockCumulativeDeltaSumPattern { Self { block: CentsUsdPattern4::new(client.clone(), acc.clone()), cumulative: CentsUsdPattern::new(client.clone(), _m(&acc, "cumulative")), - delta: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "delta")), - sum: _1m1w1y24hPattern5::new(client.clone(), _m(&acc, "sum")), + delta: AbsoluteRatePattern3::new(client.clone(), _m(&acc, "delta")), + sum: _1m1w1y24hPattern6::new(client.clone(), _m(&acc, "sum")), } } } @@ -2866,111 +4222,35 @@ impl BtcCentsSatsUsdPattern3 { } /// Pattern struct for repeated tree structure. -pub struct CapHorizonPriceSupplyPattern { +pub struct CapHorizonPriceSupplyPattern2 { pub cap: CentsUsdPattern3, - pub horizon: _1m1y2y3m4y6m8yPattern, + pub horizon: _1m1y2y3m4y6m8yPattern2, pub price: CentsPpmRatioSatsUsdPattern, - pub supply: ImmobileMobilePattern2, + pub supply: ImmobileMobilePattern3, } /// Pattern struct for repeated tree structure. -pub struct CentsDeltaToUsdPattern { - pub cents: SeriesPattern1, - pub delta: AbsoluteRatePattern2, - pub to_own_mcap: PercentPpmRatioPattern2, - pub usd: SeriesPattern1, -} - -impl CentsDeltaToUsdPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), - delta: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "delta")), - to_own_mcap: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "to_own_mcap")), - usd: SeriesPattern1::new(client.clone(), acc.clone()), - } - } +pub struct HeightLossProfitRangePattern2 { + pub height: SeriesPattern18, + pub loss: _10pct20pct30pct40pct50pct60pct70pct80pctAllPattern2, + pub profit: _100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctAllPattern2, + pub range: _0pct100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctOverPattern2, } /// Pattern struct for repeated tree structure. -pub struct CentsToUsdPattern3 { - pub cents: SeriesPattern1, - pub to_own_gross_pnl: PercentPpmRatioPattern3, - pub to_own_mcap: PercentPpmRatioPattern3, - pub usd: SeriesPattern1, -} - -impl CentsToUsdPattern3 { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), - to_own_gross_pnl: PercentPpmRatioPattern3::new(client.clone(), _m(&acc, "to_own_gross_pnl")), - to_own_mcap: PercentPpmRatioPattern3::new(client.clone(), _m(&acc, "to_own_mcap")), - usd: SeriesPattern1::new(client.clone(), acc.clone()), - } - } +pub struct MatrixOverRangeUnderPattern3 { + pub matrix: SeriesPattern18, + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern5, + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern5, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern5, } /// Pattern struct for repeated tree structure. -pub struct CoindaysCoinyearsDormancyTransferPattern { - pub coindays_destroyed: AverageBlockCumulativeSumPattern, - pub coinyears_destroyed: SeriesPattern1, - pub dormancy: _1m1w1y24hHeightPattern, - pub transfer_volume: AverageBlockCumulativeInSumPattern, -} - -impl CoindaysCoinyearsDormancyTransferPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - coindays_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "coindays_destroyed")), - coinyears_destroyed: SeriesPattern1::new(client.clone(), _m(&acc, "coinyears_destroyed")), - dormancy: _1m1w1y24hHeightPattern::new(client.clone(), _m(&acc, "dormancy")), - transfer_volume: AverageBlockCumulativeInSumPattern::new(client.clone(), _m(&acc, "transfer_volume")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct LossNetNuplProfitPattern { - pub loss: CentsNegativeUsdPattern, - pub net_pnl: CentsUsdPattern, - pub nupl: PpmRatioPattern, - pub profit: CentsUsdPattern3, -} - -impl LossNetNuplProfitPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - loss: CentsNegativeUsdPattern::new(client.clone(), _m(&acc, "unrealized_loss")), - net_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "net_unrealized_pnl")), - nupl: PpmRatioPattern::new(client.clone(), _m(&acc, "nupl")), - profit: CentsUsdPattern3::new(client.clone(), _m(&acc, "unrealized_profit")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct NuplRealizedSupplyUnrealizedPattern { - pub nupl: PpmRatioPattern, - pub realized_cap: AllSthPattern, - pub supply: AllSthPattern2, - pub unrealized_pnl: AllSthPattern, -} - -impl NuplRealizedSupplyUnrealizedPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - nupl: PpmRatioPattern::new(client.clone(), _m(&acc, "nupl")), - realized_cap: AllSthPattern::new(client.clone(), acc.clone(), "realized_cap".to_string()), - supply: AllSthPattern2::new(client.clone(), acc.clone()), - unrealized_pnl: AllSthPattern::new(client.clone(), acc.clone(), "unrealized_pnl".to_string()), - } - } +pub struct MatrixOverRangeUnderPattern { + pub matrix: SeriesPattern18, + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern, + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern, } /// Pattern struct for repeated tree structure. @@ -2993,6 +4273,14 @@ impl _1m1w1y24hPattern { } } +/// Pattern struct for repeated tree structure. +pub struct AllHeightLthSthPattern5 { + pub all: CentsUsdPattern3, + pub height: SeriesPattern18, + pub lth: CentsUsdPattern3, + pub sth: CentsUsdPattern3, +} + /// Pattern struct for repeated tree structure. pub struct AverageBlockCumulativeSumPattern { pub average: _1m1w1y24hPattern, @@ -3014,19 +4302,44 @@ impl AverageBlockCumulativeSumPattern { } /// Pattern struct for repeated tree structure. -pub struct AdjustedRatioValuePattern { - pub adjusted: RatioTransferValuePattern, - pub ratio: _1m1w1y24hHeightPattern4, - pub value_destroyed: AverageBlockCumulativeSumPattern, +pub struct AllCumulativeSthPattern { + pub all: AverageBlockCumulativeSumPattern, + pub cumulative: SeriesPattern18, + pub sth: AverageBlockCumulativeSumPattern, } -impl AdjustedRatioValuePattern { +/// Pattern struct for repeated tree structure. +pub struct AllLthSthPattern4 { + pub all: BtcCentsDeltaSatsUsdPattern, + pub lth: BtcCentsDeltaSatsUsdPattern, + pub sth: BtcCentsDeltaSatsUsdPattern, +} + +impl AllLthSthPattern4 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - adjusted: RatioTransferValuePattern::new(client.clone(), acc.clone()), - ratio: _1m1w1y24hHeightPattern4::new(client.clone(), _m(&acc, "sopr")), - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "value_destroyed")), + all: BtcCentsDeltaSatsUsdPattern::new(client.clone(), _m(&acc, "supply")), + lth: BtcCentsDeltaSatsUsdPattern::new(client.clone(), _m(&acc, "lth_supply")), + sth: BtcCentsDeltaSatsUsdPattern::new(client.clone(), _m(&acc, "sth_supply")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct AllLthSthPattern5 { + pub all: PercentPpmRatioPattern2, + pub lth: PercentPpmRatioPattern2, + pub sth: PercentPpmRatioPattern2, +} + +impl AllLthSthPattern5 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + all: PercentPpmRatioPattern2::new(client.clone(), _p("all", &acc)), + lth: PercentPpmRatioPattern2::new(client.clone(), _p("lth", &acc)), + sth: PercentPpmRatioPattern2::new(client.clone(), _p("sth", &acc)), } } } @@ -3035,7 +4348,7 @@ impl AdjustedRatioValuePattern { pub struct BlockCumulativeSumPattern { pub block: CentsUsdPattern2, pub cumulative: CentsUsdPattern3, - pub sum: _1m1w1y24hPattern6, + pub sum: _1m1w1y24hPattern7, } impl BlockCumulativeSumPattern { @@ -3044,7 +4357,7 @@ impl BlockCumulativeSumPattern { Self { block: CentsUsdPattern2::new(client.clone(), acc.clone()), cumulative: CentsUsdPattern3::new(client.clone(), _m(&acc, "cumulative")), - sum: _1m1w1y24hPattern6::new(client.clone(), _m(&acc, "sum")), + sum: _1m1w1y24hPattern7::new(client.clone(), _m(&acc, "sum")), } } } @@ -3085,24 +4398,6 @@ impl BlocksDominanceRewardsPattern { } } -/// Pattern struct for repeated tree structure. -pub struct CapLossProfitPattern { - pub cap: CentsDeltaUsdPattern, - pub loss: BlockCumulativeSumPattern, - pub profit: BlockCumulativeSumPattern, -} - -impl CapLossProfitPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cap: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "cap")), - loss: BlockCumulativeSumPattern::new(client.clone(), _m(&acc, "loss")), - profit: BlockCumulativeSumPattern::new(client.clone(), _m(&acc, "profit")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct CapPriceSupplyPattern { pub cap: CentsUsdPattern3, @@ -3131,7 +4426,7 @@ impl CentsSatsUsdPattern3 { /// Pattern struct for repeated tree structure. pub struct CentsDeltaUsdPattern { pub cents: SeriesPattern1, - pub delta: AbsoluteRatePattern2, + pub delta: AbsoluteRatePattern3, pub usd: SeriesPattern1, } @@ -3140,25 +4435,7 @@ impl CentsDeltaUsdPattern { pub fn new(client: Arc, acc: String) -> Self { Self { cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), - delta: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "delta")), - usd: SeriesPattern1::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CentsNegativeUsdPattern { - pub cents: SeriesPattern1, - pub negative: SeriesPattern1, - pub usd: SeriesPattern1, -} - -impl CentsNegativeUsdPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), - negative: SeriesPattern1::new(client.clone(), _m(&acc, "neg")), + delta: AbsoluteRatePattern3::new(client.clone(), _m(&acc, "delta")), usd: SeriesPattern1::new(client.clone(), acc.clone()), } } @@ -3207,24 +4484,6 @@ impl CumulativeRollingSumPattern { } } -/// Pattern struct for repeated tree structure. -pub struct DeltaDominanceTotalPattern { - pub delta: AbsoluteRatePattern3, - pub dominance: PercentPpmRatioPattern2, - pub total: BtcCentsSatsUsdPattern, -} - -impl DeltaDominanceTotalPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - delta: AbsoluteRatePattern3::new(client.clone(), _m(&acc, "delta")), - dominance: PercentPpmRatioPattern2::new(client.clone(), _m(&acc, "dominance")), - total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct FloorLevelLossPattern { pub floor: Pct95Pct98Pct99Pattern, @@ -3244,41 +4503,108 @@ impl FloorLevelLossPattern { } /// Pattern struct for repeated tree structure. -pub struct GreedNetPainPattern { - pub greed_index: CentsUsdPattern3, - pub net: CentsUsdPattern, - pub pain_index: CentsUsdPattern3, +pub struct HeightLongShortPattern { + pub height: SeriesPattern18, + pub long: PercentPpmRatioPattern2, + pub short: PercentPpmRatioPattern2, } -impl GreedNetPainPattern { +/// Pattern struct for repeated tree structure. +pub struct OverRangeUnderPattern11 { + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern5, + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern5, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern5, +} + +/// Pattern struct for repeated tree structure. +pub struct OverRangeUnderPattern17 { + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8, + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern8, +} + +impl OverRangeUnderPattern17 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - greed_index: CentsUsdPattern3::new(client.clone(), _m(&acc, "greed_index")), - net: CentsUsdPattern::new(client.clone(), _m(&acc, "net_sentiment")), - pain_index: CentsUsdPattern3::new(client.clone(), _m(&acc, "pain_index")), + over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8::new(client.clone(), _m(&acc, "over")), + range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8::new(client.clone(), acc.clone()), + under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern8::new(client.clone(), _m(&acc, "under")), } } } /// Pattern struct for repeated tree structure. -pub struct LossNuplProfitPattern { - pub loss: CentsNegativeUsdPattern, - pub nupl: PpmRatioPattern, - pub profit: CentsUsdPattern3, +pub struct OverRangeUnderPattern19 { + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9, + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern9, } -impl LossNuplProfitPattern { +impl OverRangeUnderPattern19 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - loss: CentsNegativeUsdPattern::new(client.clone(), _m(&acc, "unrealized_loss")), - nupl: PpmRatioPattern::new(client.clone(), _m(&acc, "nupl")), - profit: CentsUsdPattern3::new(client.clone(), _m(&acc, "unrealized_profit")), + over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9::new(client.clone(), _m(&acc, "over")), + range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9::new(client.clone(), acc.clone()), + under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern9::new(client.clone(), _m(&acc, "under")), } } } +/// Pattern struct for repeated tree structure. +pub struct OverRangeUnderPattern { + pub over: _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern, + pub range: _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern, + pub under: _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern, +} + +/// Pattern struct for repeated tree structure. +pub struct OverRangeUnderPattern21 { + pub over: _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12, + pub range: _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern12, + pub under: _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12, +} + +/// Pattern struct for repeated tree structure. +pub struct OverRangeUnderPattern23 { + pub over: _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13, + pub range: _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern13, + pub under: _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13, +} + +/// Pattern struct for repeated tree structure. +pub struct OverRangeUnderPattern2 { + pub over: _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2, + pub range: _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2, + pub under: _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2, +} + +impl OverRangeUnderPattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + over: _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2::new(client.clone(), acc.clone(), "over".to_string()), + range: _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2::new(client.clone(), acc.clone(), String::new()), + under: _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2::new(client.clone(), acc.clone(), "under".to_string()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct OverRangeUnderPattern9 { + pub over: _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5, + pub range: _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern5, + pub under: _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5, +} + +/// Pattern struct for repeated tree structure. +pub struct OverRangeUnderPattern12 { + pub over: _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7, + pub range: _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern7, + pub under: _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7, +} + /// Pattern struct for repeated tree structure. pub struct PercentPpmRatioPattern2 { pub percent: SeriesPattern1, @@ -3369,24 +4695,6 @@ impl PpmPriceRatioPattern { } } -/// Pattern struct for repeated tree structure. -pub struct RatioTransferValuePattern { - pub ratio: _1m1w1y24hHeightPattern2, - pub transfer_volume: AverageBlockCumulativeSumPattern, - pub value_destroyed: AverageBlockCumulativeSumPattern, -} - -impl RatioTransferValuePattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - ratio: _1m1w1y24hHeightPattern2::new(client.clone(), _m(&acc, "asopr")), - transfer_volume: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "adj_value_created")), - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "adj_value_destroyed")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct RsiStochPattern { pub rsi: PercentPpmRatioPattern2, @@ -3405,6 +4713,13 @@ impl RsiStochPattern { } } +/// Pattern struct for repeated tree structure. +pub struct ToPattern2 { + pub to_mcap: AllLthSthPattern5, + pub to_own_gross_pnl: AllLthSthPattern5, + pub to_own_mcap: HeightLongShortPattern, +} + /// Pattern struct for repeated tree structure. pub struct _6bBlockTxPattern { pub _6b: MaxMedianMinPct10Pct25Pct75Pct90Pattern, @@ -3423,6 +4738,13 @@ impl _6bBlockTxPattern { } } +/// Pattern struct for repeated tree structure. +pub struct AllLthSthPattern { + pub all: SeriesPattern1, + pub lth: SeriesPattern1, + pub sth: SeriesPattern1, +} + /// Pattern struct for repeated tree structure. pub struct AbsoluteRatePattern { pub absolute: _1m1w1y24hPattern, @@ -3457,7 +4779,7 @@ impl AbsoluteRatePattern2 { /// Pattern struct for repeated tree structure. pub struct AbsoluteRatePattern3 { - pub absolute: _1m1w1y24hPattern7, + pub absolute: _1m1w1y24hPattern6, pub rate: _1m1w1y24hPattern2, } @@ -3465,60 +4787,12 @@ impl AbsoluteRatePattern3 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - absolute: _1m1w1y24hPattern7::new(client.clone(), acc.clone()), + absolute: _1m1w1y24hPattern6::new(client.clone(), acc.clone()), rate: _1m1w1y24hPattern2::new(client.clone(), acc.clone()), } } } -/// Pattern struct for repeated tree structure. -pub struct AddrUtxoPattern { - pub addr: BtcCentsSatsUsdPattern, - pub utxo: BtcCentsSatsUsdPattern, -} - -impl AddrUtxoPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - addr: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "addr_amount")), - utxo: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "utxo_amount")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct AllSthPattern2 { - pub all: BtcCentsDeltaSatsUsdPattern, - pub sth: BtcCentsSatsUsdPattern, -} - -impl AllSthPattern2 { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - all: BtcCentsDeltaSatsUsdPattern::new(client.clone(), _m(&acc, "supply")), - sth: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sth_supply")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct AllSthPattern { - pub all: SeriesPattern1, - pub sth: SeriesPattern1, -} - -impl AllSthPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String, disc: String) -> Self { - Self { - all: SeriesPattern1::new(client.clone(), _m(&acc, &disc)), - sth: SeriesPattern1::new(client.clone(), _m(&acc, &format!("sth_{disc}", disc=disc))), - } - } -} - /// Pattern struct for repeated tree structure. pub struct AwakeDormantPattern2 { pub awake: CapPriceSupplyPattern, @@ -3670,17 +4944,97 @@ impl CentsUsdPattern4 { } /// Pattern struct for repeated tree structure. -pub struct CoindaysTransferPattern { - pub coindays_destroyed: AverageBlockCumulativeSumPattern, - pub transfer_volume: AverageBlockCumulativeInSumPattern, +pub struct CentsSatsPattern { + pub cents: CumulativePattern, + pub sats: CumulativePattern, } -impl CoindaysTransferPattern { +impl CentsSatsPattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - coindays_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "coindays_destroyed")), - transfer_volume: AverageBlockCumulativeInSumPattern::new(client.clone(), _m(&acc, "transfer_volume")), + cents: CumulativePattern::new(client.clone(), _m(&acc, "cents")), + sats: CumulativePattern::new(client.clone(), _m(&acc, "sats")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct DiscountPremiumPattern { + pub discount: AverageBlockCumulativeSumPattern, + pub premium: AverageBlockCumulativeSumPattern, +} + +impl DiscountPremiumPattern { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + discount: AverageBlockCumulativeSumPattern::new(client.clone(), _p("veteran", &acc)), + premium: AverageBlockCumulativeSumPattern::new(client.clone(), _p("rookie", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct DiscountPremiumPattern2 { + pub discount: AverageBlockCumulativeSumPattern2, + pub premium: AverageBlockCumulativeSumPattern2, +} + +impl DiscountPremiumPattern2 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + discount: AverageBlockCumulativeSumPattern2::new(client.clone(), _p("veteran", &acc)), + premium: AverageBlockCumulativeSumPattern2::new(client.clone(), _p("rookie", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct DiscountPremiumPattern5 { + pub discount: BlockCumulativeSumPattern, + pub premium: BlockCumulativeSumPattern, +} + +impl DiscountPremiumPattern5 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + discount: BlockCumulativeSumPattern::new(client.clone(), _p("veteran", &acc)), + premium: BlockCumulativeSumPattern::new(client.clone(), _p("rookie", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct DiscountPremiumPattern12 { + pub discount: BtcCentsSatsUsdPattern, + pub premium: BtcCentsSatsUsdPattern, +} + +impl DiscountPremiumPattern12 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + discount: BtcCentsSatsUsdPattern::new(client.clone(), _p("veteran", &acc)), + premium: BtcCentsSatsUsdPattern::new(client.clone(), _p("rookie", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct DiscountPremiumPattern13 { + pub discount: CentsUsdPattern3, + pub premium: CentsUsdPattern3, +} + +impl DiscountPremiumPattern13 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + discount: CentsUsdPattern3::new(client.clone(), _p("veteran", &acc)), + premium: CentsUsdPattern3::new(client.clone(), _p("rookie", &acc)), } } } @@ -3692,39 +5046,87 @@ pub struct FundedTotalPattern { } /// Pattern struct for repeated tree structure. -pub struct ImmobileMobilePattern2 { +pub struct ImmobileMobilePattern3 { pub immobile: BtcCentsSatsUsdPattern, pub mobile: BtcCentsInSatsUsdPattern, } /// Pattern struct for repeated tree structure. -pub struct InPattern2 { - pub in_loss: CentsUsdPattern3, - pub in_profit: CentsUsdPattern3, +pub struct LongShortPattern { + pub long: AverageBlockCumulativeSumPattern, + pub short: AverageBlockCumulativeSumPattern, } -impl InPattern2 { +impl LongShortPattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - in_loss: CentsUsdPattern3::new(client.clone(), _m(&acc, "loss")), - in_profit: CentsUsdPattern3::new(client.clone(), _m(&acc, "profit")), + long: AverageBlockCumulativeSumPattern::new(client.clone(), _p("lth", &acc)), + short: AverageBlockCumulativeSumPattern::new(client.clone(), _p("sth", &acc)), } } } /// Pattern struct for repeated tree structure. -pub struct InPattern { - pub in_loss: SharePattern, - pub in_profit: SharePattern, +pub struct LongShortPattern2 { + pub long: AverageBlockCumulativeSumPattern2, + pub short: AverageBlockCumulativeSumPattern2, } -impl InPattern { +impl LongShortPattern2 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - in_loss: SharePattern::new(client.clone(), _m(&acc, "loss_share")), - in_profit: SharePattern::new(client.clone(), _m(&acc, "profit_share")), + long: AverageBlockCumulativeSumPattern2::new(client.clone(), _p("lth", &acc)), + short: AverageBlockCumulativeSumPattern2::new(client.clone(), _p("sth", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct LongShortPattern6 { + pub long: BlockCumulativeSumPattern, + pub short: BlockCumulativeSumPattern, +} + +impl LongShortPattern6 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + long: BlockCumulativeSumPattern::new(client.clone(), _p("lth", &acc)), + short: BlockCumulativeSumPattern::new(client.clone(), _p("sth", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct LongShortPattern13 { + pub long: BtcCentsSatsUsdPattern, + pub short: BtcCentsSatsUsdPattern, +} + +impl LongShortPattern13 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + long: BtcCentsSatsUsdPattern::new(client.clone(), _p("lth", &acc)), + short: BtcCentsSatsUsdPattern::new(client.clone(), _p("sth", &acc)), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct LongShortPattern14 { + pub long: CentsUsdPattern3, + pub short: CentsUsdPattern3, +} + +impl LongShortPattern14 { + /// Create a new pattern node with accumulated series name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + long: CentsUsdPattern3::new(client.clone(), _p("lth", &acc)), + short: CentsUsdPattern3::new(client.clone(), _p("sth", &acc)), } } } @@ -3793,22 +5195,6 @@ impl PpmRatioPattern { } } -/// Pattern struct for repeated tree structure. -pub struct RatioValuePattern { - pub ratio: _24hPattern, - pub value_destroyed: AverageBlockCumulativeSumPattern, -} - -impl RatioValuePattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - ratio: _24hPattern::new(client.clone(), _m(&acc, "sopr_24h")), - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "value_destroyed")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct SdSmaPattern { pub sd: SeriesPattern1, @@ -3816,113 +5202,76 @@ pub struct SdSmaPattern { } /// Pattern struct for repeated tree structure. -pub struct SpentUnspentPattern { - pub spent_count: AverageBlockCumulativeSumPattern, - pub unspent_count: BaseDeltaPattern, +pub struct DiscountPremiumPattern7 { + pub discount: SeriesPattern1, + pub premium: SeriesPattern1, } -impl SpentUnspentPattern { +impl DiscountPremiumPattern7 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - spent_count: AverageBlockCumulativeSumPattern::new(client.clone(), _m(&acc, "spent_utxo_count")), - unspent_count: BaseDeltaPattern::new(client.clone(), _m(&acc, "utxo_count")), + discount: SeriesPattern1::new(client.clone(), _p("veteran", &acc)), + premium: SeriesPattern1::new(client.clone(), _p("rookie", &acc)), } } } /// Pattern struct for repeated tree structure. -pub struct ToPattern { - pub to_mcap: PercentPpmRatioPattern, - pub to_rcap: PercentPpmRatioPattern, +pub struct LongShortPattern7 { + pub long: SeriesPattern1, + pub short: SeriesPattern1, } -impl ToPattern { +impl LongShortPattern7 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - to_mcap: PercentPpmRatioPattern::new(client.clone(), _m(&acc, "mcap")), - to_rcap: PercentPpmRatioPattern::new(client.clone(), _m(&acc, "rcap")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct _24hPattern { - pub _24h: SeriesPattern1, -} - -impl _24hPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - _24h: SeriesPattern1::new(client.clone(), acc.clone()), + long: SeriesPattern1::new(client.clone(), _p("lth", &acc)), + short: SeriesPattern1::new(client.clone(), _p("sth", &acc)), } } } /// Pattern struct for repeated tree structure. pub struct InPattern3 { - pub in_loss: SharePattern2, + pub in_loss: SharePattern3, } impl InPattern3 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - in_loss: SharePattern2::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct NuplPattern { - pub nupl: PpmRatioPattern, -} - -impl NuplPattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - nupl: PpmRatioPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct PricePattern { - pub price: CentsPpmRatioSatsUsdPattern, -} - -impl PricePattern { - /// Create a new pattern node with accumulated series name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - price: CentsPpmRatioSatsUsdPattern::new(client.clone(), acc.clone()), + in_loss: SharePattern3::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct SharePattern { - pub share: PercentPpmRatioPattern2, + pub share: AllHeightLthSthPattern4, } -impl SharePattern { +/// Pattern struct for repeated tree structure. +pub struct SharePattern2 { + pub share: AllLthSthPattern5, +} + +impl SharePattern2 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - share: PercentPpmRatioPattern2::new(client.clone(), acc.clone()), + share: AllLthSthPattern5::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. -pub struct SharePattern2 { +pub struct SharePattern3 { pub share: SeriesPattern1, } -impl SharePattern2 { +impl SharePattern3 { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -3960,29 +5309,29 @@ impl SupplyPattern { } /// Pattern struct for repeated tree structure. -pub struct TransferPattern { - pub transfer_volume: AverageBlockCumulativeSumPattern2, +pub struct CumulativePattern { + pub cumulative: SeriesPattern18, } -impl TransferPattern { +impl CumulativePattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - transfer_volume: AverageBlockCumulativeSumPattern2::new(client.clone(), acc.clone()), + cumulative: SeriesPattern18::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. -pub struct UnspentPattern { - pub unspent_count: BaseDeltaPattern, +pub struct MatrixPattern { + pub matrix: SeriesPattern18, } -impl UnspentPattern { +impl MatrixPattern { /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - unspent_count: BaseDeltaPattern::new(client.clone(), acc.clone()), + matrix: SeriesPattern18::new(client.clone(), acc.clone()), } } } @@ -4763,7 +6112,7 @@ pub struct SeriesTree_Inputs_ByType { pub input_count: SeriesTree_Inputs_ByType_InputCount, pub input_share: SeriesTree_Inputs_ByType_InputShare, pub tx_count: SeriesTree_Inputs_ByType_TxCount, - pub tx_share: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2, + pub tx_share: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13, } impl SeriesTree_Inputs_ByType { @@ -4772,7 +6121,7 @@ impl SeriesTree_Inputs_ByType { input_count: SeriesTree_Inputs_ByType_InputCount::new(client.clone(), format!("{base_path}_input_count")), input_share: SeriesTree_Inputs_ByType_InputShare::new(client.clone(), format!("{base_path}_input_share")), tx_count: SeriesTree_Inputs_ByType_TxCount::new(client.clone(), format!("{base_path}_tx_count")), - tx_share: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2::new(client.clone(), "tx_share_with".to_string()), + tx_share: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13::new(client.clone(), "tx_share_with".to_string()), } } } @@ -4791,7 +6140,7 @@ pub struct SeriesTree_Inputs_ByType_InputCount { pub p2a: AverageBlockCumulativeSumPattern, pub unknown: AverageBlockCumulativeSumPattern, pub empty: AverageBlockCumulativeSumPattern, - pub height: SeriesPattern18<[StoredU16; 11]>, + pub height: SeriesPattern18, } impl SeriesTree_Inputs_ByType_InputCount { @@ -4861,7 +6210,7 @@ pub struct SeriesTree_Inputs_ByType_TxCount { pub p2a: AverageBlockCumulativeSumPattern, pub unknown: AverageBlockCumulativeSumPattern, pub empty: AverageBlockCumulativeSumPattern, - pub cumulative: SeriesPattern18<[StoredU64; 11]>, + pub cumulative: SeriesPattern18, } impl SeriesTree_Inputs_ByType_TxCount { @@ -5356,6 +6705,7 @@ pub struct SeriesTree_Addrs_Funded { pub p2tr: SeriesPattern1, pub p2a: SeriesPattern1, pub height: SeriesPattern18<[StoredU64; 8]>, + pub balance: SeriesTree_Addrs_Funded_Balance, } impl SeriesTree_Addrs_Funded { @@ -5371,6 +6721,141 @@ impl SeriesTree_Addrs_Funded { p2tr: SeriesPattern1::new(client.clone(), "p2tr_addr_count".to_string()), p2a: SeriesPattern1::new(client.clone(), "p2a_addr_count".to_string()), height: SeriesPattern18::new(client.clone(), "addr_count_by_type".to_string()), + balance: SeriesTree_Addrs_Funded_Balance::new(client.clone(), format!("{base_path}_balance")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Addrs_Funded_Balance { + pub range: SeriesTree_Addrs_Funded_Balance_Range, + pub under: SeriesTree_Addrs_Funded_Balance_Under, + pub over: SeriesTree_Addrs_Funded_Balance_Over, + pub matrix: SeriesPattern18, +} + +impl SeriesTree_Addrs_Funded_Balance { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Addrs_Funded_Balance_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Addrs_Funded_Balance_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Addrs_Funded_Balance_Over::new(client.clone(), format!("{base_path}_over")), + matrix: SeriesPattern18::new(client.clone(), "addrs_addr_count_by_balance_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Addrs_Funded_Balance_Range { + pub _0sats: BaseDeltaPattern, + pub _1sat_to_10sats: BaseDeltaPattern, + pub _10sats_to_100sats: BaseDeltaPattern, + pub _100sats_to_1k_sats: BaseDeltaPattern, + pub _1k_sats_to_10k_sats: BaseDeltaPattern, + pub _10k_sats_to_100k_sats: BaseDeltaPattern, + pub _100k_sats_to_1m_sats: BaseDeltaPattern, + pub _1m_sats_to_10m_sats: BaseDeltaPattern, + pub _10m_sats_to_1btc: BaseDeltaPattern, + pub _1btc_to_10btc: BaseDeltaPattern, + pub _10btc_to_100btc: BaseDeltaPattern, + pub _100btc_to_1k_btc: BaseDeltaPattern, + pub _1k_btc_to_10k_btc: BaseDeltaPattern, + pub _10k_btc_to_100k_btc: BaseDeltaPattern, + pub over_100k_btc: BaseDeltaPattern, +} + +impl SeriesTree_Addrs_Funded_Balance_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: BaseDeltaPattern::new(client.clone(), "addrs_0sats_addr_count".to_string()), + _1sat_to_10sats: BaseDeltaPattern::new(client.clone(), "addrs_1sat_to_10sats_addr_count".to_string()), + _10sats_to_100sats: BaseDeltaPattern::new(client.clone(), "addrs_10sats_to_100sats_addr_count".to_string()), + _100sats_to_1k_sats: BaseDeltaPattern::new(client.clone(), "addrs_100sats_to_1k_sats_addr_count".to_string()), + _1k_sats_to_10k_sats: BaseDeltaPattern::new(client.clone(), "addrs_1k_sats_to_10k_sats_addr_count".to_string()), + _10k_sats_to_100k_sats: BaseDeltaPattern::new(client.clone(), "addrs_10k_sats_to_100k_sats_addr_count".to_string()), + _100k_sats_to_1m_sats: BaseDeltaPattern::new(client.clone(), "addrs_100k_sats_to_1m_sats_addr_count".to_string()), + _1m_sats_to_10m_sats: BaseDeltaPattern::new(client.clone(), "addrs_1m_sats_to_10m_sats_addr_count".to_string()), + _10m_sats_to_1btc: BaseDeltaPattern::new(client.clone(), "addrs_10m_sats_to_1btc_addr_count".to_string()), + _1btc_to_10btc: BaseDeltaPattern::new(client.clone(), "addrs_1btc_to_10btc_addr_count".to_string()), + _10btc_to_100btc: BaseDeltaPattern::new(client.clone(), "addrs_10btc_to_100btc_addr_count".to_string()), + _100btc_to_1k_btc: BaseDeltaPattern::new(client.clone(), "addrs_100btc_to_1k_btc_addr_count".to_string()), + _1k_btc_to_10k_btc: BaseDeltaPattern::new(client.clone(), "addrs_1k_btc_to_10k_btc_addr_count".to_string()), + _10k_btc_to_100k_btc: BaseDeltaPattern::new(client.clone(), "addrs_10k_btc_to_100k_btc_addr_count".to_string()), + over_100k_btc: BaseDeltaPattern::new(client.clone(), "addrs_over_100k_btc_addr_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Addrs_Funded_Balance_Under { + pub _10sats: BaseDeltaPattern, + pub _100sats: BaseDeltaPattern, + pub _1k_sats: BaseDeltaPattern, + pub _10k_sats: BaseDeltaPattern, + pub _100k_sats: BaseDeltaPattern, + pub _1m_sats: BaseDeltaPattern, + pub _10m_sats: BaseDeltaPattern, + pub _1btc: BaseDeltaPattern, + pub _10btc: BaseDeltaPattern, + pub _100btc: BaseDeltaPattern, + pub _1k_btc: BaseDeltaPattern, + pub _10k_btc: BaseDeltaPattern, + pub _100k_btc: BaseDeltaPattern, +} + +impl SeriesTree_Addrs_Funded_Balance_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: BaseDeltaPattern::new(client.clone(), "addrs_under_10sats_addr_count".to_string()), + _100sats: BaseDeltaPattern::new(client.clone(), "addrs_under_100sats_addr_count".to_string()), + _1k_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_1k_sats_addr_count".to_string()), + _10k_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_10k_sats_addr_count".to_string()), + _100k_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_100k_sats_addr_count".to_string()), + _1m_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_1m_sats_addr_count".to_string()), + _10m_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_10m_sats_addr_count".to_string()), + _1btc: BaseDeltaPattern::new(client.clone(), "addrs_under_1btc_addr_count".to_string()), + _10btc: BaseDeltaPattern::new(client.clone(), "addrs_under_10btc_addr_count".to_string()), + _100btc: BaseDeltaPattern::new(client.clone(), "addrs_under_100btc_addr_count".to_string()), + _1k_btc: BaseDeltaPattern::new(client.clone(), "addrs_under_1k_btc_addr_count".to_string()), + _10k_btc: BaseDeltaPattern::new(client.clone(), "addrs_under_10k_btc_addr_count".to_string()), + _100k_btc: BaseDeltaPattern::new(client.clone(), "addrs_under_100k_btc_addr_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Addrs_Funded_Balance_Over { + pub _1sat: BaseDeltaPattern, + pub _10sats: BaseDeltaPattern, + pub _100sats: BaseDeltaPattern, + pub _1k_sats: BaseDeltaPattern, + pub _10k_sats: BaseDeltaPattern, + pub _100k_sats: BaseDeltaPattern, + pub _1m_sats: BaseDeltaPattern, + pub _10m_sats: BaseDeltaPattern, + pub _1btc: BaseDeltaPattern, + pub _10btc: BaseDeltaPattern, + pub _100btc: BaseDeltaPattern, + pub _1k_btc: BaseDeltaPattern, + pub _10k_btc: BaseDeltaPattern, +} + +impl SeriesTree_Addrs_Funded_Balance_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: BaseDeltaPattern::new(client.clone(), "addrs_over_1sat_addr_count".to_string()), + _10sats: BaseDeltaPattern::new(client.clone(), "addrs_over_10sats_addr_count".to_string()), + _100sats: BaseDeltaPattern::new(client.clone(), "addrs_over_100sats_addr_count".to_string()), + _1k_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_1k_sats_addr_count".to_string()), + _10k_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_10k_sats_addr_count".to_string()), + _100k_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_100k_sats_addr_count".to_string()), + _1m_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_1m_sats_addr_count".to_string()), + _10m_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_10m_sats_addr_count".to_string()), + _1btc: BaseDeltaPattern::new(client.clone(), "addrs_over_1btc_addr_count".to_string()), + _10btc: BaseDeltaPattern::new(client.clone(), "addrs_over_10btc_addr_count".to_string()), + _100btc: BaseDeltaPattern::new(client.clone(), "addrs_over_100btc_addr_count".to_string()), + _1k_btc: BaseDeltaPattern::new(client.clone(), "addrs_over_1k_btc_addr_count".to_string()), + _10k_btc: BaseDeltaPattern::new(client.clone(), "addrs_over_10k_btc_addr_count".to_string()), } } } @@ -5408,50 +6893,21 @@ impl SeriesTree_Addrs_Empty { /// Series tree node. pub struct SeriesTree_Addrs_Activity { - pub all: SeriesTree_Addrs_Activity_All, - pub p2pk65: ActiveBidirectionalReactivatedReceivingSendingPattern, - pub p2pk33: ActiveBidirectionalReactivatedReceivingSendingPattern, - pub p2pkh: ActiveBidirectionalReactivatedReceivingSendingPattern, - pub p2sh: ActiveBidirectionalReactivatedReceivingSendingPattern, - pub p2wpkh: ActiveBidirectionalReactivatedReceivingSendingPattern, - pub p2wsh: ActiveBidirectionalReactivatedReceivingSendingPattern, - pub p2tr: ActiveBidirectionalReactivatedReceivingSendingPattern, - pub p2a: ActiveBidirectionalReactivatedReceivingSendingPattern, + pub reactivated: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern, + pub sending: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern, + pub receiving: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern, + pub bidirectional: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern, + pub active: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern, } impl SeriesTree_Addrs_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: SeriesTree_Addrs_Activity_All::new(client.clone(), format!("{base_path}_all")), - p2pk65: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2pk65".to_string()), - p2pk33: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2pk33".to_string()), - p2pkh: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2pkh".to_string()), - p2sh: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2sh".to_string()), - p2wpkh: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2wpkh".to_string()), - p2wsh: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2wsh".to_string()), - p2tr: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2tr".to_string()), - p2a: ActiveBidirectionalReactivatedReceivingSendingPattern::new(client.clone(), "p2a".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Addrs_Activity_All { - pub reactivated: _1m1w1y24hBlockPattern, - pub sending: _1m1w1y24hBlockPattern, - pub receiving: _1m1w1y24hBlockPattern, - pub bidirectional: _1m1w1y24hBlockPattern, - pub active: _1m1w1y24hBlockPattern, -} - -impl SeriesTree_Addrs_Activity_All { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - reactivated: _1m1w1y24hBlockPattern::new(client.clone(), "reactivated_addrs".to_string()), - sending: _1m1w1y24hBlockPattern::new(client.clone(), "sending_addrs".to_string()), - receiving: _1m1w1y24hBlockPattern::new(client.clone(), "receiving_addrs".to_string()), - bidirectional: _1m1w1y24hBlockPattern::new(client.clone(), "bidirectional_addrs".to_string()), - active: _1m1w1y24hBlockPattern::new(client.clone(), "active_addrs".to_string()), + reactivated: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern::new(client.clone(), "reactivated_addrs".to_string()), + sending: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern::new(client.clone(), "sending_addrs".to_string()), + receiving: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern::new(client.clone(), "receiving_addrs".to_string()), + bidirectional: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern::new(client.clone(), "bidirectional_addrs".to_string()), + active: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern::new(client.clone(), "active_addrs".to_string()), } } } @@ -6100,29 +7556,15 @@ impl SeriesTree_Addrs_Delta { /// Series tree node. pub struct SeriesTree_Addrs_AvgAmount { - pub all: AddrUtxoPattern, - pub p2pk65: AddrUtxoPattern, - pub p2pk33: AddrUtxoPattern, - pub p2pkh: AddrUtxoPattern, - pub p2sh: AddrUtxoPattern, - pub p2wpkh: AddrUtxoPattern, - pub p2wsh: AddrUtxoPattern, - pub p2tr: AddrUtxoPattern, - pub p2a: AddrUtxoPattern, + pub utxo: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2, + pub addr: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2, } impl SeriesTree_Addrs_AvgAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: AddrUtxoPattern::new(client.clone(), "avg".to_string()), - p2pk65: AddrUtxoPattern::new(client.clone(), "p2pk65_avg".to_string()), - p2pk33: AddrUtxoPattern::new(client.clone(), "p2pk33_avg".to_string()), - p2pkh: AddrUtxoPattern::new(client.clone(), "p2pkh_avg".to_string()), - p2sh: AddrUtxoPattern::new(client.clone(), "p2sh_avg".to_string()), - p2wpkh: AddrUtxoPattern::new(client.clone(), "p2wpkh_avg".to_string()), - p2wsh: AddrUtxoPattern::new(client.clone(), "p2wsh_avg".to_string()), - p2tr: AddrUtxoPattern::new(client.clone(), "p2tr_avg".to_string()), - p2a: AddrUtxoPattern::new(client.clone(), "p2a_avg".to_string()), + utxo: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2::new(client.clone(), "avg_utxo_amount".to_string()), + addr: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2::new(client.clone(), "avg_addr_amount".to_string()), } } } @@ -6900,6 +8342,7 @@ pub struct SeriesTree_Frameworks_Cointime { pub dormant: SupplyPattern2, pub sth: SeriesTree_Frameworks_Cointime_Sth, pub lth: SeriesTree_Frameworks_Cointime_Lth, + pub sources: SeriesTree_Frameworks_Cointime_Sources, pub supply: SeriesTree_Frameworks_Cointime_Supply, pub value: SeriesTree_Frameworks_Cointime_Value, pub cap: SeriesTree_Frameworks_Cointime_Cap, @@ -6914,9 +8357,10 @@ impl SeriesTree_Frameworks_Cointime { activity: SeriesTree_Frameworks_Cointime_Activity::new(client.clone(), format!("{base_path}_activity")), age_range: SeriesTree_Frameworks_Cointime_AgeRange::new(client.clone(), format!("{base_path}_age_range")), awake: SeriesTree_Frameworks_Cointime_Awake::new(client.clone(), format!("{base_path}_awake")), - dormant: SupplyPattern2::new(client.clone(), "dormant_supply".to_string()), + dormant: SupplyPattern2::new(client.clone(), "all_dormant_supply".to_string()), sth: SeriesTree_Frameworks_Cointime_Sth::new(client.clone(), format!("{base_path}_sth")), lth: SeriesTree_Frameworks_Cointime_Lth::new(client.clone(), format!("{base_path}_lth")), + sources: SeriesTree_Frameworks_Cointime_Sources::new(client.clone(), format!("{base_path}_sources")), supply: SeriesTree_Frameworks_Cointime_Supply::new(client.clone(), format!("{base_path}_supply")), value: SeriesTree_Frameworks_Cointime_Value::new(client.clone(), format!("{base_path}_value")), cap: SeriesTree_Frameworks_Cointime_Cap::new(client.clone(), format!("{base_path}_cap")), @@ -6994,7 +8438,7 @@ pub struct SeriesTree_Frameworks_Cointime_AgeRange_CoindaysCreated { pub _10y_to_12y: AverageBlockCumulativeSumPattern, pub _12y_to_15y: AverageBlockCumulativeSumPattern, pub over_15y: AverageBlockCumulativeSumPattern, - pub cumulative: SeriesPattern18<[StoredF64; 23]>, + pub cumulative: SeriesPattern18, } impl SeriesTree_Frameworks_Cointime_AgeRange_CoindaysCreated { @@ -7053,7 +8497,7 @@ pub struct SeriesTree_Frameworks_Cointime_AgeRange_CoindaysConsumed { pub _10y_to_12y: AverageBlockCumulativeSumPattern, pub _12y_to_15y: AverageBlockCumulativeSumPattern, pub over_15y: AverageBlockCumulativeSumPattern, - pub cumulative: SeriesPattern18<[StoredF64; 23]>, + pub cumulative: SeriesPattern18, } impl SeriesTree_Frameworks_Cointime_AgeRange_CoindaysConsumed { @@ -7112,7 +8556,7 @@ pub struct SeriesTree_Frameworks_Cointime_AgeRange_CoindaysStored { pub _10y_to_12y: AverageBlockCumulativeSumPattern, pub _12y_to_15y: AverageBlockCumulativeSumPattern, pub over_15y: AverageBlockCumulativeSumPattern, - pub cumulative: SeriesPattern18<[StoredF64; 23]>, + pub cumulative: SeriesPattern18, } impl SeriesTree_Frameworks_Cointime_AgeRange_CoindaysStored { @@ -7151,7 +8595,7 @@ pub struct SeriesTree_Frameworks_Cointime_AgeRange_Activity { pub wakefulness: SeriesTree_Frameworks_Cointime_AgeRange_Activity_Wakefulness, pub dormancy: SeriesTree_Frameworks_Cointime_AgeRange_Activity_Dormancy, pub wakefulness_to_dormancy: SeriesTree_Frameworks_Cointime_AgeRange_Activity_WakefulnessToDormancy, - pub height: SeriesPattern18<[StoredF64; 23]>, + pub height: SeriesPattern18, } impl SeriesTree_Frameworks_Cointime_AgeRange_Activity { @@ -7376,7 +8820,7 @@ pub struct SeriesTree_Frameworks_Cointime_AgeRange_Supply_Awake { pub _10y_to_12y: BtcCentsSatsUsdPattern, pub _12y_to_15y: BtcCentsSatsUsdPattern, pub over_15y: BtcCentsSatsUsdPattern, - pub height: SeriesPattern18<[Sats; 23]>, + pub height: SeriesPattern18, } impl SeriesTree_Frameworks_Cointime_AgeRange_Supply_Awake { @@ -7435,7 +8879,7 @@ pub struct SeriesTree_Frameworks_Cointime_AgeRange_Supply_Dormant { pub _10y_to_12y: BtcCentsSatsUsdPattern, pub _12y_to_15y: BtcCentsSatsUsdPattern, pub over_15y: BtcCentsSatsUsdPattern, - pub height: SeriesPattern18<[Sats; 23]>, + pub height: SeriesPattern18, } impl SeriesTree_Frameworks_Cointime_AgeRange_Supply_Dormant { @@ -7480,8 +8924,8 @@ impl SeriesTree_Frameworks_Cointime_Awake { pub fn new(client: Arc, base_path: String) -> Self { Self { supply: SeriesTree_Frameworks_Cointime_Awake_Supply::new(client.clone(), format!("{base_path}_supply")), - cap: CentsUsdPattern3::new(client.clone(), "awake_cap".to_string()), - price: CentsPpmRatioSatsUsdPattern::new(client.clone(), "awake_price".to_string()), + cap: CentsUsdPattern3::new(client.clone(), "all_awake_cap".to_string()), + price: CentsPpmRatioSatsUsdPattern::new(client.clone(), "all_awake_price".to_string()), } } } @@ -7492,17 +8936,17 @@ pub struct SeriesTree_Frameworks_Cointime_Awake_Supply { pub sats: SeriesPattern1, pub usd: SeriesPattern1, pub cents: SeriesPattern1, - pub in_loss: SharePattern2, + pub in_loss: SharePattern3, } impl SeriesTree_Frameworks_Cointime_Awake_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { - btc: SeriesPattern1::new(client.clone(), "awake_supply".to_string()), - sats: SeriesPattern1::new(client.clone(), "awake_supply_sats".to_string()), - usd: SeriesPattern1::new(client.clone(), "awake_supply_usd".to_string()), - cents: SeriesPattern1::new(client.clone(), "awake_supply_cents".to_string()), - in_loss: SharePattern2::new(client.clone(), "awake_supply_in_loss_share".to_string()), + btc: SeriesPattern1::new(client.clone(), "all_awake_supply".to_string()), + sats: SeriesPattern1::new(client.clone(), "all_awake_supply_sats".to_string()), + usd: SeriesPattern1::new(client.clone(), "all_awake_supply_usd".to_string()), + cents: SeriesPattern1::new(client.clone(), "all_awake_supply_cents".to_string()), + in_loss: SharePattern3::new(client.clone(), "all_awake_supply_in_loss_share".to_string()), } } } @@ -7545,7 +8989,7 @@ pub struct SeriesTree_Frameworks_Cointime_Sth_Awake_Supply { pub sats: SeriesPattern1, pub usd: SeriesPattern1, pub cents: SeriesPattern1, - pub in_loss: SharePattern2, + pub in_loss: SharePattern3, } impl SeriesTree_Frameworks_Cointime_Sth_Awake_Supply { @@ -7555,7 +8999,7 @@ impl SeriesTree_Frameworks_Cointime_Sth_Awake_Supply { sats: SeriesPattern1::new(client.clone(), "sth_awake_supply_sats".to_string()), usd: SeriesPattern1::new(client.clone(), "sth_awake_supply_usd".to_string()), cents: SeriesPattern1::new(client.clone(), "sth_awake_supply_cents".to_string()), - in_loss: SharePattern2::new(client.clone(), "sth_awake_supply_in_loss_share".to_string()), + in_loss: SharePattern3::new(client.clone(), "sth_awake_supply_in_loss_share".to_string()), } } } @@ -7598,7 +9042,7 @@ pub struct SeriesTree_Frameworks_Cointime_Lth_Awake_Supply { pub sats: SeriesPattern1, pub usd: SeriesPattern1, pub cents: SeriesPattern1, - pub in_loss: SharePattern2, + pub in_loss: SharePattern3, } impl SeriesTree_Frameworks_Cointime_Lth_Awake_Supply { @@ -7608,7 +9052,28 @@ impl SeriesTree_Frameworks_Cointime_Lth_Awake_Supply { sats: SeriesPattern1::new(client.clone(), "lth_awake_supply_sats".to_string()), usd: SeriesPattern1::new(client.clone(), "lth_awake_supply_usd".to_string()), cents: SeriesPattern1::new(client.clone(), "lth_awake_supply_cents".to_string()), - in_loss: SharePattern2::new(client.clone(), "lth_awake_supply_in_loss_share".to_string()), + in_loss: SharePattern3::new(client.clone(), "lth_awake_supply_in_loss_share".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Frameworks_Cointime_Sources { + pub awake_supply: SeriesPattern18, + pub dormant_supply: SeriesPattern18, + pub awake_cap: SeriesPattern18, + pub awake_price: SeriesPattern18, + pub supply_in_loss_share: SeriesPattern18, +} + +impl SeriesTree_Frameworks_Cointime_Sources { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + awake_supply: SeriesPattern18::new(client.clone(), "cointime_awake_supply_sats_by_term".to_string()), + dormant_supply: SeriesPattern18::new(client.clone(), "cointime_dormant_supply_sats_by_term".to_string()), + awake_cap: SeriesPattern18::new(client.clone(), "cointime_awake_cap_cents_by_term".to_string()), + awake_price: SeriesPattern18::new(client.clone(), "cointime_awake_price_cents_by_aggregate".to_string()), + supply_in_loss_share: SeriesPattern18::new(client.clone(), "cointime_awake_supply_in_loss_share_by_term".to_string()), } } } @@ -7634,7 +9099,7 @@ pub struct SeriesTree_Frameworks_Cointime_Supply_Active { pub sats: SeriesPattern1, pub usd: SeriesPattern1, pub cents: SeriesPattern1, - pub in_loss: SharePattern2, + pub in_loss: SharePattern3, } impl SeriesTree_Frameworks_Cointime_Supply_Active { @@ -7644,7 +9109,7 @@ impl SeriesTree_Frameworks_Cointime_Supply_Active { sats: SeriesPattern1::new(client.clone(), "active_supply_sats".to_string()), usd: SeriesPattern1::new(client.clone(), "active_supply_usd".to_string()), cents: SeriesPattern1::new(client.clone(), "active_supply_cents".to_string()), - in_loss: SharePattern2::new(client.clone(), "cointime_supply_in_loss_share".to_string()), + in_loss: SharePattern3::new(client.clone(), "cointime_supply_in_loss_share".to_string()), } } } @@ -7748,11 +9213,12 @@ impl SeriesTree_Frameworks_Cointime_ReserveRisk { pub struct SeriesTree_Frameworks_Coinflow { pub age_range: SeriesTree_Frameworks_Coinflow_AgeRange, pub supply: SeriesTree_Frameworks_Coinflow_Supply, - pub horizon: _1m1y2y3m4y6m8yPattern, + pub horizon: _1m1y2y3m4y6m8yPattern2, pub cap: CentsUsdPattern3, pub price: CentsPpmRatioSatsUsdPattern, pub sth: SeriesTree_Frameworks_Coinflow_Sth, pub lth: SeriesTree_Frameworks_Coinflow_Lth, + pub aggregate_sources: SeriesTree_Frameworks_Coinflow_AggregateSources, } impl SeriesTree_Frameworks_Coinflow { @@ -7760,11 +9226,12 @@ impl SeriesTree_Frameworks_Coinflow { Self { age_range: SeriesTree_Frameworks_Coinflow_AgeRange::new(client.clone(), format!("{base_path}_age_range")), supply: SeriesTree_Frameworks_Coinflow_Supply::new(client.clone(), format!("{base_path}_supply")), - horizon: _1m1y2y3m4y6m8yPattern::new(client.clone(), "coinflow".to_string()), - cap: CentsUsdPattern3::new(client.clone(), "coinflow_cap".to_string()), - price: CentsPpmRatioSatsUsdPattern::new(client.clone(), "coinflow_price".to_string()), + horizon: _1m1y2y3m4y6m8yPattern2::new(client.clone(), "all_coinflow".to_string()), + cap: CentsUsdPattern3::new(client.clone(), "all_coinflow_cap".to_string()), + price: CentsPpmRatioSatsUsdPattern::new(client.clone(), "all_coinflow_price".to_string()), sth: SeriesTree_Frameworks_Coinflow_Sth::new(client.clone(), format!("{base_path}_sth")), lth: SeriesTree_Frameworks_Coinflow_Lth::new(client.clone(), format!("{base_path}_lth")), + aggregate_sources: SeriesTree_Frameworks_Coinflow_AggregateSources::new(client.clone(), format!("{base_path}_aggregate_sources")), } } } @@ -7811,7 +9278,7 @@ pub struct SeriesTree_Frameworks_Coinflow_AgeRange_SpendingRate { pub _10y_to_12y: SeriesPattern1, pub _12y_to_15y: SeriesPattern1, pub over_15y: SeriesPattern1, - pub height: SeriesPattern18<[StoredF64; 23]>, + pub height: SeriesPattern18, } impl SeriesTree_Frameworks_Coinflow_AgeRange_SpendingRate { @@ -7871,7 +9338,7 @@ pub struct SeriesTree_Frameworks_Coinflow_AgeRange_SpendingExposure { pub _12y_to_15y: SeriesPattern1, pub over_15y: SeriesPattern1, pub mobility: SeriesTree_Frameworks_Coinflow_AgeRange_SpendingExposure_Mobility, - pub height: SeriesPattern18<[StoredF64; 23]>, + pub height: SeriesPattern18, } impl SeriesTree_Frameworks_Coinflow_AgeRange_SpendingExposure { @@ -8003,7 +9470,7 @@ pub struct SeriesTree_Frameworks_Coinflow_AgeRange_Supply_Mobile { pub _10y_to_12y: BtcCentsSatsUsdPattern, pub _12y_to_15y: BtcCentsSatsUsdPattern, pub over_15y: BtcCentsSatsUsdPattern, - pub height: SeriesPattern18<[Sats; 23]>, + pub height: SeriesPattern18, } impl SeriesTree_Frameworks_Coinflow_AgeRange_Supply_Mobile { @@ -8062,7 +9529,7 @@ pub struct SeriesTree_Frameworks_Coinflow_AgeRange_Supply_Immobile { pub _10y_to_12y: BtcCentsSatsUsdPattern, pub _12y_to_15y: BtcCentsSatsUsdPattern, pub over_15y: BtcCentsSatsUsdPattern, - pub height: SeriesPattern18<[Sats; 23]>, + pub height: SeriesPattern18, } impl SeriesTree_Frameworks_Coinflow_AgeRange_Supply_Immobile { @@ -8106,7 +9573,7 @@ impl SeriesTree_Frameworks_Coinflow_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { mobile: SeriesTree_Frameworks_Coinflow_Supply_Mobile::new(client.clone(), format!("{base_path}_mobile")), - immobile: BtcCentsSatsUsdPattern::new(client.clone(), "immobile_supply".to_string()), + immobile: BtcCentsSatsUsdPattern::new(client.clone(), "all_immobile_supply".to_string()), } } } @@ -8117,17 +9584,17 @@ pub struct SeriesTree_Frameworks_Coinflow_Supply_Mobile { pub sats: SeriesPattern1, pub usd: SeriesPattern1, pub cents: SeriesPattern1, - pub in_loss: SharePattern2, + pub in_loss: SharePattern3, } impl SeriesTree_Frameworks_Coinflow_Supply_Mobile { pub fn new(client: Arc, base_path: String) -> Self { Self { - btc: SeriesPattern1::new(client.clone(), "mobile_supply".to_string()), - sats: SeriesPattern1::new(client.clone(), "mobile_supply_sats".to_string()), - usd: SeriesPattern1::new(client.clone(), "mobile_supply_usd".to_string()), - cents: SeriesPattern1::new(client.clone(), "mobile_supply_cents".to_string()), - in_loss: SharePattern2::new(client.clone(), "coinflow_supply_in_loss_share".to_string()), + btc: SeriesPattern1::new(client.clone(), "all_mobile_supply".to_string()), + sats: SeriesPattern1::new(client.clone(), "all_mobile_supply_sats".to_string()), + usd: SeriesPattern1::new(client.clone(), "all_mobile_supply_usd".to_string()), + cents: SeriesPattern1::new(client.clone(), "all_mobile_supply_cents".to_string()), + in_loss: SharePattern3::new(client.clone(), "all_coinflow_supply_in_loss_share".to_string()), } } } @@ -8135,7 +9602,7 @@ impl SeriesTree_Frameworks_Coinflow_Supply_Mobile { /// Series tree node. pub struct SeriesTree_Frameworks_Coinflow_Sth { pub supply: SeriesTree_Frameworks_Coinflow_Sth_Supply, - pub horizon: _1m1y2y3m4y6m8yPattern, + pub horizon: _1m1y2y3m4y6m8yPattern2, pub cap: CentsUsdPattern3, pub price: CentsPpmRatioSatsUsdPattern, } @@ -8144,7 +9611,7 @@ impl SeriesTree_Frameworks_Coinflow_Sth { pub fn new(client: Arc, base_path: String) -> Self { Self { supply: SeriesTree_Frameworks_Coinflow_Sth_Supply::new(client.clone(), format!("{base_path}_supply")), - horizon: _1m1y2y3m4y6m8yPattern::new(client.clone(), "sth_coinflow".to_string()), + horizon: _1m1y2y3m4y6m8yPattern2::new(client.clone(), "sth_coinflow".to_string()), cap: CentsUsdPattern3::new(client.clone(), "sth_coinflow_cap".to_string()), price: CentsPpmRatioSatsUsdPattern::new(client.clone(), "sth_coinflow_price".to_string()), } @@ -8172,7 +9639,7 @@ pub struct SeriesTree_Frameworks_Coinflow_Sth_Supply_Mobile { pub sats: SeriesPattern1, pub usd: SeriesPattern1, pub cents: SeriesPattern1, - pub in_loss: SharePattern2, + pub in_loss: SharePattern3, } impl SeriesTree_Frameworks_Coinflow_Sth_Supply_Mobile { @@ -8182,7 +9649,7 @@ impl SeriesTree_Frameworks_Coinflow_Sth_Supply_Mobile { sats: SeriesPattern1::new(client.clone(), "sth_mobile_supply_sats".to_string()), usd: SeriesPattern1::new(client.clone(), "sth_mobile_supply_usd".to_string()), cents: SeriesPattern1::new(client.clone(), "sth_mobile_supply_cents".to_string()), - in_loss: SharePattern2::new(client.clone(), "sth_coinflow_supply_in_loss_share".to_string()), + in_loss: SharePattern3::new(client.clone(), "sth_coinflow_supply_in_loss_share".to_string()), } } } @@ -8190,7 +9657,7 @@ impl SeriesTree_Frameworks_Coinflow_Sth_Supply_Mobile { /// Series tree node. pub struct SeriesTree_Frameworks_Coinflow_Lth { pub supply: SeriesTree_Frameworks_Coinflow_Lth_Supply, - pub horizon: _1m1y2y3m4y6m8yPattern, + pub horizon: _1m1y2y3m4y6m8yPattern2, pub cap: CentsUsdPattern3, pub price: CentsPpmRatioSatsUsdPattern, } @@ -8199,7 +9666,7 @@ impl SeriesTree_Frameworks_Coinflow_Lth { pub fn new(client: Arc, base_path: String) -> Self { Self { supply: SeriesTree_Frameworks_Coinflow_Lth_Supply::new(client.clone(), format!("{base_path}_supply")), - horizon: _1m1y2y3m4y6m8yPattern::new(client.clone(), "lth_coinflow".to_string()), + horizon: _1m1y2y3m4y6m8yPattern2::new(client.clone(), "lth_coinflow".to_string()), cap: CentsUsdPattern3::new(client.clone(), "lth_coinflow_cap".to_string()), price: CentsPpmRatioSatsUsdPattern::new(client.clone(), "lth_coinflow_price".to_string()), } @@ -8227,7 +9694,7 @@ pub struct SeriesTree_Frameworks_Coinflow_Lth_Supply_Mobile { pub sats: SeriesPattern1, pub usd: SeriesPattern1, pub cents: SeriesPattern1, - pub in_loss: SharePattern2, + pub in_loss: SharePattern3, } impl SeriesTree_Frameworks_Coinflow_Lth_Supply_Mobile { @@ -8237,7 +9704,68 @@ impl SeriesTree_Frameworks_Coinflow_Lth_Supply_Mobile { sats: SeriesPattern1::new(client.clone(), "lth_mobile_supply_sats".to_string()), usd: SeriesPattern1::new(client.clone(), "lth_mobile_supply_usd".to_string()), cents: SeriesPattern1::new(client.clone(), "lth_mobile_supply_cents".to_string()), - in_loss: SharePattern2::new(client.clone(), "lth_coinflow_supply_in_loss_share".to_string()), + in_loss: SharePattern3::new(client.clone(), "lth_coinflow_supply_in_loss_share".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Frameworks_Coinflow_AggregateSources { + pub supply: SeriesTree_Frameworks_Coinflow_AggregateSources_Supply, + pub supply_in_loss_share: SeriesPattern18, + pub horizon: SeriesTree_Frameworks_Coinflow_AggregateSources_Horizon, + pub cap: SeriesPattern18, + pub price: SeriesPattern18, +} + +impl SeriesTree_Frameworks_Coinflow_AggregateSources { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + supply: SeriesTree_Frameworks_Coinflow_AggregateSources_Supply::new(client.clone(), format!("{base_path}_supply")), + supply_in_loss_share: SeriesPattern18::new(client.clone(), "coinflow_supply_in_loss_share_by_aggregate".to_string()), + horizon: SeriesTree_Frameworks_Coinflow_AggregateSources_Horizon::new(client.clone(), format!("{base_path}_horizon")), + cap: SeriesPattern18::new(client.clone(), "coinflow_cap_cents_by_term".to_string()), + price: SeriesPattern18::new(client.clone(), "coinflow_price_cents_by_aggregate".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Frameworks_Coinflow_AggregateSources_Supply { + pub mobile: SeriesPattern18, + pub immobile: SeriesPattern18, +} + +impl SeriesTree_Frameworks_Coinflow_AggregateSources_Supply { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + mobile: SeriesPattern18::new(client.clone(), "coinflow_mobile_supply_sats_by_term".to_string()), + immobile: SeriesPattern18::new(client.clone(), "coinflow_immobile_supply_sats_by_term".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Frameworks_Coinflow_AggregateSources_Horizon { + pub _8y: SeriesPattern18, + pub _4y: SeriesPattern18, + pub _2y: SeriesPattern18, + pub _1y: SeriesPattern18, + pub _6m: SeriesPattern18, + pub _3m: SeriesPattern18, + pub _1m: SeriesPattern18, +} + +impl SeriesTree_Frameworks_Coinflow_AggregateSources_Horizon { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _8y: SeriesPattern18::new(client.clone(), "coinflow_8y_supply_in_loss_share_by_aggregate".to_string()), + _4y: SeriesPattern18::new(client.clone(), "coinflow_4y_supply_in_loss_share_by_aggregate".to_string()), + _2y: SeriesPattern18::new(client.clone(), "coinflow_2y_supply_in_loss_share_by_aggregate".to_string()), + _1y: SeriesPattern18::new(client.clone(), "coinflow_1y_supply_in_loss_share_by_aggregate".to_string()), + _6m: SeriesPattern18::new(client.clone(), "coinflow_6m_supply_in_loss_share_by_aggregate".to_string()), + _3m: SeriesPattern18::new(client.clone(), "coinflow_3m_supply_in_loss_share_by_aggregate".to_string()), + _1m: SeriesPattern18::new(client.clone(), "coinflow_1m_supply_in_loss_share_by_aggregate".to_string()), } } } @@ -10289,972 +11817,392 @@ impl SeriesTree_Supply_Velocity { /// Series tree node. pub struct SeriesTree_Cohorts { - pub utxo: SeriesTree_Cohorts_Utxo, - pub addr: SeriesTree_Cohorts_Addr, + pub cohorts: SeriesTree_Cohorts_Cohorts, } impl SeriesTree_Cohorts { pub fn new(client: Arc, base_path: String) -> Self { Self { - utxo: SeriesTree_Cohorts_Utxo::new(client.clone(), format!("{base_path}_utxo")), - addr: SeriesTree_Cohorts_Addr::new(client.clone(), format!("{base_path}_addr")), + cohorts: SeriesTree_Cohorts_Cohorts::new(client.clone(), format!("{base_path}_cohorts")), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo { - pub all: SeriesTree_Cohorts_Utxo_All, - pub sth: SeriesTree_Cohorts_Utxo_Sth, - pub lth: SeriesTree_Cohorts_Utxo_Lth, - pub age_range: SeriesTree_Cohorts_Utxo_AgeRange, - pub under_age: SeriesTree_Cohorts_Utxo_UnderAge, - pub over_age: SeriesTree_Cohorts_Utxo_OverAge, - pub epoch: SeriesTree_Cohorts_Utxo_Epoch, - pub class: SeriesTree_Cohorts_Utxo_Class, - pub entry: SeriesTree_Cohorts_Utxo_Entry, - pub over_amount: SeriesTree_Cohorts_Utxo_OverAmount, - pub amount_range: SeriesTree_Cohorts_Utxo_AmountRange, - pub under_amount: SeriesTree_Cohorts_Utxo_UnderAmount, - pub type_: SeriesTree_Cohorts_Utxo_Type, - pub profitability: SeriesTree_Cohorts_Utxo_Profitability, - pub matured: SeriesTree_Cohorts_Utxo_Matured, - pub cumulative_matured_sats: SeriesPattern18<[Sats; 23]>, - pub cumulative_matured_cents: SeriesPattern18<[Cents; 23]>, +pub struct SeriesTree_Cohorts_Cohorts { + pub supply: SeriesTree_Cohorts_Cohorts_Supply, + pub outputs: SeriesTree_Cohorts_Cohorts_Outputs, + pub activity: SeriesTree_Cohorts_Cohorts_Activity, + pub realized: SeriesTree_Cohorts_Cohorts_Realized, + pub unrealized: SeriesTree_Cohorts_Cohorts_Unrealized, + pub cost_basis: SeriesTree_Cohorts_Cohorts_CostBasis, + pub relative: SeriesTree_Cohorts_Cohorts_Relative, + pub profitability: SeriesTree_Cohorts_Cohorts_Profitability, } -impl SeriesTree_Cohorts_Utxo { +impl SeriesTree_Cohorts_Cohorts { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: SeriesTree_Cohorts_Utxo_All::new(client.clone(), format!("{base_path}_all")), - sth: SeriesTree_Cohorts_Utxo_Sth::new(client.clone(), format!("{base_path}_sth")), - lth: SeriesTree_Cohorts_Utxo_Lth::new(client.clone(), format!("{base_path}_lth")), - age_range: SeriesTree_Cohorts_Utxo_AgeRange::new(client.clone(), format!("{base_path}_age_range")), - under_age: SeriesTree_Cohorts_Utxo_UnderAge::new(client.clone(), format!("{base_path}_under_age")), - over_age: SeriesTree_Cohorts_Utxo_OverAge::new(client.clone(), format!("{base_path}_over_age")), - epoch: SeriesTree_Cohorts_Utxo_Epoch::new(client.clone(), format!("{base_path}_epoch")), - class: SeriesTree_Cohorts_Utxo_Class::new(client.clone(), format!("{base_path}_class")), - entry: SeriesTree_Cohorts_Utxo_Entry::new(client.clone(), format!("{base_path}_entry")), - over_amount: SeriesTree_Cohorts_Utxo_OverAmount::new(client.clone(), format!("{base_path}_over_amount")), - amount_range: SeriesTree_Cohorts_Utxo_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), - under_amount: SeriesTree_Cohorts_Utxo_UnderAmount::new(client.clone(), format!("{base_path}_under_amount")), - type_: SeriesTree_Cohorts_Utxo_Type::new(client.clone(), format!("{base_path}_type")), - profitability: SeriesTree_Cohorts_Utxo_Profitability::new(client.clone(), format!("{base_path}_profitability")), - matured: SeriesTree_Cohorts_Utxo_Matured::new(client.clone(), format!("{base_path}_matured")), - cumulative_matured_sats: SeriesPattern18::new(client.clone(), "utxos_age_range_matured_supply_cumulative_sats".to_string()), - cumulative_matured_cents: SeriesPattern18::new(client.clone(), "utxos_age_range_matured_supply_cumulative_cents".to_string()), + supply: SeriesTree_Cohorts_Cohorts_Supply::new(client.clone(), format!("{base_path}_supply")), + outputs: SeriesTree_Cohorts_Cohorts_Outputs::new(client.clone(), format!("{base_path}_outputs")), + activity: SeriesTree_Cohorts_Cohorts_Activity::new(client.clone(), format!("{base_path}_activity")), + realized: SeriesTree_Cohorts_Cohorts_Realized::new(client.clone(), format!("{base_path}_realized")), + unrealized: SeriesTree_Cohorts_Cohorts_Unrealized::new(client.clone(), format!("{base_path}_unrealized")), + cost_basis: SeriesTree_Cohorts_Cohorts_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), + relative: SeriesTree_Cohorts_Cohorts_Relative::new(client.clone(), format!("{base_path}_relative")), + profitability: SeriesTree_Cohorts_Cohorts_Profitability::new(client.clone(), format!("{base_path}_profitability")), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All { - pub supply: DeltaDominanceHalfInTotalPattern2, - pub outputs: SeriesTree_Cohorts_Utxo_All_Outputs, - pub activity: SeriesTree_Cohorts_Utxo_All_Activity, - pub realized: SeriesTree_Cohorts_Utxo_All_Realized, - pub cost_basis: SeriesTree_Cohorts_Utxo_All_CostBasis, - pub unrealized: SeriesTree_Cohorts_Utxo_All_Unrealized, - pub invested_capital: InPattern, +pub struct SeriesTree_Cohorts_Cohorts_Supply { + pub total: SeriesTree_Cohorts_Cohorts_Supply_Total, + pub matured: SeriesTree_Cohorts_Cohorts_Supply_Matured, + pub half: SeriesTree_Cohorts_Cohorts_Supply_Half, + pub in_profit: SeriesTree_Cohorts_Cohorts_Supply_InProfit, + pub in_loss: SeriesTree_Cohorts_Cohorts_Supply_InLoss, + pub delta: SeriesTree_Cohorts_Cohorts_Supply_Delta, + pub dominance: SeriesTree_Cohorts_Cohorts_Supply_Dominance, } -impl SeriesTree_Cohorts_Utxo_All { +impl SeriesTree_Cohorts_Cohorts_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { - supply: DeltaDominanceHalfInTotalPattern2::new(client.clone(), "supply".to_string()), - outputs: SeriesTree_Cohorts_Utxo_All_Outputs::new(client.clone(), format!("{base_path}_outputs")), - activity: SeriesTree_Cohorts_Utxo_All_Activity::new(client.clone(), format!("{base_path}_activity")), - realized: SeriesTree_Cohorts_Utxo_All_Realized::new(client.clone(), format!("{base_path}_realized")), - cost_basis: SeriesTree_Cohorts_Utxo_All_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), - unrealized: SeriesTree_Cohorts_Utxo_All_Unrealized::new(client.clone(), format!("{base_path}_unrealized")), - invested_capital: InPattern::new(client.clone(), "invested_capital_in".to_string()), + total: SeriesTree_Cohorts_Cohorts_Supply_Total::new(client.clone(), format!("{base_path}_total")), + matured: SeriesTree_Cohorts_Cohorts_Supply_Matured::new(client.clone(), format!("{base_path}_matured")), + half: SeriesTree_Cohorts_Cohorts_Supply_Half::new(client.clone(), format!("{base_path}_half")), + in_profit: SeriesTree_Cohorts_Cohorts_Supply_InProfit::new(client.clone(), format!("{base_path}_in_profit")), + in_loss: SeriesTree_Cohorts_Cohorts_Supply_InLoss::new(client.clone(), format!("{base_path}_in_loss")), + delta: SeriesTree_Cohorts_Cohorts_Supply_Delta::new(client.clone(), format!("{base_path}_delta")), + dominance: SeriesTree_Cohorts_Cohorts_Supply_Dominance::new(client.clone(), format!("{base_path}_dominance")), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Outputs { - pub unspent_count: BaseDeltaPattern, - pub spent_count: AverageBlockCumulativeSumPattern, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Total { + pub all: BtcCentsSatsUsdPattern, + pub age: SeriesTree_Cohorts_Cohorts_Supply_Total_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Supply_Total_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Supply_Total_Class, + pub entry: DiscountPremiumPattern12, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Supply_Total_UtxoAmount, + pub term: LongShortPattern13, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, + pub amount_range_matrix: SeriesPattern18, + pub addr_balance: SeriesTree_Cohorts_Cohorts_Supply_Total_AddrBalance, } -impl SeriesTree_Cohorts_Utxo_All_Outputs { +impl SeriesTree_Cohorts_Cohorts_Supply_Total { pub fn new(client: Arc, base_path: String) -> Self { Self { - unspent_count: BaseDeltaPattern::new(client.clone(), "utxo_count".to_string()), - spent_count: AverageBlockCumulativeSumPattern::new(client.clone(), "spent_utxo_count".to_string()), + all: BtcCentsSatsUsdPattern::new(client.clone(), "supply".to_string()), + age: SeriesTree_Cohorts_Cohorts_Supply_Total_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Supply_Total_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Supply_Total_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern12::new(client.clone(), "supply".to_string()), + utxo_amount: SeriesTree_Cohorts_Cohorts_Supply_Total_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: LongShortPattern13::new(client.clone(), "supply".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10::new(client.clone(), "supply".to_string()), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_supply_sats_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "supply_sats_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "supply_sats_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "supply_sats_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "supply_sats_by_type".to_string()), + amount_range_matrix: SeriesPattern18::new(client.clone(), "utxos_supply_sats_by_amount_range".to_string()), + addr_balance: SeriesTree_Cohorts_Cohorts_Supply_Total_AddrBalance::new(client.clone(), format!("{base_path}_addr_balance")), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Activity { - pub transfer_volume: AverageBlockCumulativeInSumPattern, - pub coindays_destroyed: AverageBlockCumulativeSumPattern, - pub coinyears_destroyed: SeriesPattern1, - pub dormancy: _1m1w1y24hHeightPattern, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Total_Age { + pub range: SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Over, } -impl SeriesTree_Cohorts_Utxo_All_Activity { +impl SeriesTree_Cohorts_Cohorts_Supply_Total_Age { pub fn new(client: Arc, base_path: String) -> Self { Self { - transfer_volume: AverageBlockCumulativeInSumPattern::new(client.clone(), "transfer_volume".to_string()), - coindays_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "coindays_destroyed".to_string()), - coinyears_destroyed: SeriesPattern1::new(client.clone(), "coinyears_destroyed".to_string()), - dormancy: _1m1w1y24hHeightPattern::new(client.clone(), "dormancy".to_string()), + range: SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Over::new(client.clone(), format!("{base_path}_over")), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Realized { - pub cap: CentsDeltaToUsdPattern, - pub profit: BlockCumulativeSumPattern, - pub loss: BlockCumulativeNegativeSumPattern, - pub price: CentsPpmRatioSatsUsdPattern, - pub mvrv: SeriesPattern1, - pub net_pnl: BlockChangeCumulativeDeltaSumPattern, - pub sopr: SeriesTree_Cohorts_Utxo_All_Realized_Sopr, - pub gross_pnl: BlockCumulativeSumPattern, - pub sell_side_risk_ratio: _1m1w1y24hHeightPattern3, - pub peak_regret: BlockCumulativeSumPattern, - pub capitalized: PricePattern, - pub profit_to_loss_ratio: _1m1w1y24hHeightPattern2, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Range { + pub under_1h: BtcCentsSatsUsdPattern, + pub _1h_to_1d: BtcCentsSatsUsdPattern, + pub _1d_to_1w: BtcCentsSatsUsdPattern, + pub _1w_to_1m: BtcCentsSatsUsdPattern, + pub _1m_to_2m: BtcCentsSatsUsdPattern, + pub _2m_to_3m: BtcCentsSatsUsdPattern, + pub _3m_to_4m: BtcCentsSatsUsdPattern, + pub _4m_to_5m: BtcCentsSatsUsdPattern, + pub _5m_to_6m: BtcCentsSatsUsdPattern, + pub _6m_to_9m: BtcCentsSatsUsdPattern, + pub _9m_to_1y: BtcCentsSatsUsdPattern, + pub _1y_to_18m: BtcCentsSatsUsdPattern, + pub _18m_to_2y: BtcCentsSatsUsdPattern, + pub _2y_to_3y: BtcCentsSatsUsdPattern, + pub _3y_to_4y: BtcCentsSatsUsdPattern, + pub _4y_to_5y: BtcCentsSatsUsdPattern, + pub _5y_to_6y: BtcCentsSatsUsdPattern, + pub _6y_to_7y: BtcCentsSatsUsdPattern, + pub _7y_to_8y: BtcCentsSatsUsdPattern, + pub _8y_to_10y: BtcCentsSatsUsdPattern, + pub _10y_to_12y: BtcCentsSatsUsdPattern, + pub _12y_to_15y: BtcCentsSatsUsdPattern, + pub over_15y: BtcCentsSatsUsdPattern, } -impl SeriesTree_Cohorts_Utxo_All_Realized { +impl SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Range { pub fn new(client: Arc, base_path: String) -> Self { Self { - cap: CentsDeltaToUsdPattern::new(client.clone(), "realized_cap".to_string()), - profit: BlockCumulativeSumPattern::new(client.clone(), "realized_profit".to_string()), - loss: BlockCumulativeNegativeSumPattern::new(client.clone(), "realized_loss".to_string()), - price: CentsPpmRatioSatsUsdPattern::new(client.clone(), "realized_price".to_string()), - mvrv: SeriesPattern1::new(client.clone(), "mvrv".to_string()), - net_pnl: BlockChangeCumulativeDeltaSumPattern::new(client.clone(), "net".to_string()), - sopr: SeriesTree_Cohorts_Utxo_All_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), - gross_pnl: BlockCumulativeSumPattern::new(client.clone(), "realized_gross_pnl".to_string()), - sell_side_risk_ratio: _1m1w1y24hHeightPattern3::new(client.clone(), "sell_side_risk_ratio".to_string()), - peak_regret: BlockCumulativeSumPattern::new(client.clone(), "realized_peak_regret".to_string()), - capitalized: PricePattern::new(client.clone(), "capitalized_price".to_string()), - profit_to_loss_ratio: _1m1w1y24hHeightPattern2::new(client.clone(), "realized_profit_to_loss_ratio".to_string()), + under_1h: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1h_old_supply".to_string()), + _1h_to_1d: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1h_to_1d_old_supply".to_string()), + _1d_to_1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1d_to_1w_old_supply".to_string()), + _1w_to_1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1w_to_1m_old_supply".to_string()), + _1m_to_2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1m_to_2m_old_supply".to_string()), + _2m_to_3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_2m_to_3m_old_supply".to_string()), + _3m_to_4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_3m_to_4m_old_supply".to_string()), + _4m_to_5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_4m_to_5m_old_supply".to_string()), + _5m_to_6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_5m_to_6m_old_supply".to_string()), + _6m_to_9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_6m_to_9m_old_supply".to_string()), + _9m_to_1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_9m_to_1y_old_supply".to_string()), + _1y_to_18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1y_to_18m_old_supply".to_string()), + _18m_to_2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_18m_to_2y_old_supply".to_string()), + _2y_to_3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_2y_to_3y_old_supply".to_string()), + _3y_to_4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_3y_to_4y_old_supply".to_string()), + _4y_to_5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_4y_to_5y_old_supply".to_string()), + _5y_to_6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_5y_to_6y_old_supply".to_string()), + _6y_to_7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_6y_to_7y_old_supply".to_string()), + _7y_to_8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_7y_to_8y_old_supply".to_string()), + _8y_to_10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_8y_to_10y_old_supply".to_string()), + _10y_to_12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_10y_to_12y_old_supply".to_string()), + _12y_to_15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_12y_to_15y_old_supply".to_string()), + over_15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_15y_old_supply".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Realized_Sopr { - pub value_destroyed: AverageBlockCumulativeSumPattern, - pub ratio: _1m1w1y24hHeightPattern4, - pub adjusted: SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Under { + pub _1w: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, + pub _15y: BtcCentsSatsUsdPattern, } -impl SeriesTree_Cohorts_Utxo_All_Realized_Sopr { +impl SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Under { pub fn new(client: Arc, base_path: String) -> Self { Self { - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "value_destroyed".to_string()), - ratio: _1m1w1y24hHeightPattern4::new(client.clone(), "sopr".to_string()), - adjusted: SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted::new(client.clone(), format!("{base_path}_adjusted")), + _1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1w_old_supply".to_string()), + _1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1m_old_supply".to_string()), + _2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_2m_old_supply".to_string()), + _3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_3m_old_supply".to_string()), + _4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_4m_old_supply".to_string()), + _5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_5m_old_supply".to_string()), + _6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_6m_old_supply".to_string()), + _9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_9m_old_supply".to_string()), + _1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1y_old_supply".to_string()), + _18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_18m_old_supply".to_string()), + _2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_2y_old_supply".to_string()), + _3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_3y_old_supply".to_string()), + _4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_4y_old_supply".to_string()), + _5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_5y_old_supply".to_string()), + _6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_6y_old_supply".to_string()), + _7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_7y_old_supply".to_string()), + _8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_8y_old_supply".to_string()), + _10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_10y_old_supply".to_string()), + _12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_12y_old_supply".to_string()), + _15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_15y_old_supply".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted { - pub ratio: _1m1w1y24hHeightPattern2, - pub transfer_volume: AverageBlockCumulativeSumPattern, - pub value_destroyed: AverageBlockCumulativeSumPattern, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Over { + pub _1d: BtcCentsSatsUsdPattern, + pub _1w: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, } -impl SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted { +impl SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Over { pub fn new(client: Arc, base_path: String) -> Self { Self { - ratio: _1m1w1y24hHeightPattern2::new(client.clone(), "asopr".to_string()), - transfer_volume: AverageBlockCumulativeSumPattern::new(client.clone(), "adj_value_created".to_string()), - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "adj_value_destroyed".to_string()), + _1d: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1d_old_supply".to_string()), + _1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1w_old_supply".to_string()), + _1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1m_old_supply".to_string()), + _2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_2m_old_supply".to_string()), + _3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_3m_old_supply".to_string()), + _4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_4m_old_supply".to_string()), + _5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_5m_old_supply".to_string()), + _6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_6m_old_supply".to_string()), + _9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_9m_old_supply".to_string()), + _1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1y_old_supply".to_string()), + _18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_18m_old_supply".to_string()), + _2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_2y_old_supply".to_string()), + _3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_3y_old_supply".to_string()), + _4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_4y_old_supply".to_string()), + _5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_5y_old_supply".to_string()), + _6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_6y_old_supply".to_string()), + _7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_7y_old_supply".to_string()), + _8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_8y_old_supply".to_string()), + _10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_10y_old_supply".to_string()), + _12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_12y_old_supply".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_CostBasis { - pub in_profit: PerPattern, - pub in_loss: PerPattern, - pub min: CentsSatsUsdPattern, - pub max: CentsSatsUsdPattern, - pub per_coin: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, - pub per_dollar: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, - pub supply_density: PercentPpmRatioPattern2, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Total_Epoch { + pub _0: BtcCentsSatsUsdPattern, + pub _1: BtcCentsSatsUsdPattern, + pub _2: BtcCentsSatsUsdPattern, + pub _3: BtcCentsSatsUsdPattern, + pub _4: BtcCentsSatsUsdPattern, } -impl SeriesTree_Cohorts_Utxo_All_CostBasis { +impl SeriesTree_Cohorts_Cohorts_Supply_Total_Epoch { pub fn new(client: Arc, base_path: String) -> Self { Self { - in_profit: PerPattern::new(client.clone(), "cost_basis_in_profit_per".to_string()), - in_loss: PerPattern::new(client.clone(), "cost_basis_in_loss_per".to_string()), - min: CentsSatsUsdPattern::new(client.clone(), "cost_basis_min".to_string()), - max: CentsSatsUsdPattern::new(client.clone(), "cost_basis_max".to_string()), - per_coin: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern::new(client.clone(), "cost_basis_per_coin".to_string()), - per_dollar: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern::new(client.clone(), "cost_basis_per_dollar".to_string()), - supply_density: PercentPpmRatioPattern2::new(client.clone(), "supply_density".to_string()), + _0: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_0_supply".to_string()), + _1: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_1_supply".to_string()), + _2: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_2_supply".to_string()), + _3: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_3_supply".to_string()), + _4: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_4_supply".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Unrealized { - pub nupl: PpmRatioPattern, - pub profit: SeriesTree_Cohorts_Utxo_All_Unrealized_Profit, - pub loss: SeriesTree_Cohorts_Utxo_All_Unrealized_Loss, - pub net_pnl: SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl, - pub gross_pnl: CentsUsdPattern3, - pub invested_capital: InPattern2, - pub capitalized_cap_in_profit_raw: SeriesPattern18, - pub capitalized_cap_in_loss_raw: SeriesPattern18, - pub sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Total_Class { + pub _2009: BtcCentsSatsUsdPattern, + pub _2010: BtcCentsSatsUsdPattern, + pub _2011: BtcCentsSatsUsdPattern, + pub _2012: BtcCentsSatsUsdPattern, + pub _2013: BtcCentsSatsUsdPattern, + pub _2014: BtcCentsSatsUsdPattern, + pub _2015: BtcCentsSatsUsdPattern, + pub _2016: BtcCentsSatsUsdPattern, + pub _2017: BtcCentsSatsUsdPattern, + pub _2018: BtcCentsSatsUsdPattern, + pub _2019: BtcCentsSatsUsdPattern, + pub _2020: BtcCentsSatsUsdPattern, + pub _2021: BtcCentsSatsUsdPattern, + pub _2022: BtcCentsSatsUsdPattern, + pub _2023: BtcCentsSatsUsdPattern, + pub _2024: BtcCentsSatsUsdPattern, + pub _2025: BtcCentsSatsUsdPattern, + pub _2026: BtcCentsSatsUsdPattern, } -impl SeriesTree_Cohorts_Utxo_All_Unrealized { +impl SeriesTree_Cohorts_Cohorts_Supply_Total_Class { pub fn new(client: Arc, base_path: String) -> Self { Self { - nupl: PpmRatioPattern::new(client.clone(), "nupl".to_string()), - profit: SeriesTree_Cohorts_Utxo_All_Unrealized_Profit::new(client.clone(), format!("{base_path}_profit")), - loss: SeriesTree_Cohorts_Utxo_All_Unrealized_Loss::new(client.clone(), format!("{base_path}_loss")), - net_pnl: SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl::new(client.clone(), format!("{base_path}_net_pnl")), - gross_pnl: CentsUsdPattern3::new(client.clone(), "unrealized_gross_pnl".to_string()), - invested_capital: InPattern2::new(client.clone(), "invested_capital_in".to_string()), - capitalized_cap_in_profit_raw: SeriesPattern18::new(client.clone(), "capitalized_cap_in_profit_raw".to_string()), - capitalized_cap_in_loss_raw: SeriesPattern18::new(client.clone(), "capitalized_cap_in_loss_raw".to_string()), - sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment::new(client.clone(), format!("{base_path}_sentiment")), + _2009: BtcCentsSatsUsdPattern::new(client.clone(), "class_2009_supply".to_string()), + _2010: BtcCentsSatsUsdPattern::new(client.clone(), "class_2010_supply".to_string()), + _2011: BtcCentsSatsUsdPattern::new(client.clone(), "class_2011_supply".to_string()), + _2012: BtcCentsSatsUsdPattern::new(client.clone(), "class_2012_supply".to_string()), + _2013: BtcCentsSatsUsdPattern::new(client.clone(), "class_2013_supply".to_string()), + _2014: BtcCentsSatsUsdPattern::new(client.clone(), "class_2014_supply".to_string()), + _2015: BtcCentsSatsUsdPattern::new(client.clone(), "class_2015_supply".to_string()), + _2016: BtcCentsSatsUsdPattern::new(client.clone(), "class_2016_supply".to_string()), + _2017: BtcCentsSatsUsdPattern::new(client.clone(), "class_2017_supply".to_string()), + _2018: BtcCentsSatsUsdPattern::new(client.clone(), "class_2018_supply".to_string()), + _2019: BtcCentsSatsUsdPattern::new(client.clone(), "class_2019_supply".to_string()), + _2020: BtcCentsSatsUsdPattern::new(client.clone(), "class_2020_supply".to_string()), + _2021: BtcCentsSatsUsdPattern::new(client.clone(), "class_2021_supply".to_string()), + _2022: BtcCentsSatsUsdPattern::new(client.clone(), "class_2022_supply".to_string()), + _2023: BtcCentsSatsUsdPattern::new(client.clone(), "class_2023_supply".to_string()), + _2024: BtcCentsSatsUsdPattern::new(client.clone(), "class_2024_supply".to_string()), + _2025: BtcCentsSatsUsdPattern::new(client.clone(), "class_2025_supply".to_string()), + _2026: BtcCentsSatsUsdPattern::new(client.clone(), "class_2026_supply".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Unrealized_Profit { - pub usd: SeriesPattern1, - pub cents: SeriesPattern1, - pub to_mcap: PercentPpmRatioPattern2, - pub to_own_gross_pnl: PercentPpmRatioPattern2, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Total_UtxoAmount { + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10, + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10, } -impl SeriesTree_Cohorts_Utxo_All_Unrealized_Profit { +impl SeriesTree_Cohorts_Cohorts_Supply_Total_UtxoAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: SeriesPattern1::new(client.clone(), "unrealized_profit".to_string()), - cents: SeriesPattern1::new(client.clone(), "unrealized_profit_cents".to_string()), - to_mcap: PercentPpmRatioPattern2::new(client.clone(), "unrealized_profit_to_mcap".to_string()), - to_own_gross_pnl: PercentPpmRatioPattern2::new(client.clone(), "unrealized_profit_to_own_gross_pnl".to_string()), + range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10::new(client.clone(), "utxos".to_string()), + under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10::new(client.clone(), "utxos_under".to_string()), + over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10::new(client.clone(), "utxos_over".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Unrealized_Loss { - pub usd: SeriesPattern1, - pub cents: SeriesPattern1, - pub negative: SeriesPattern1, - pub to_mcap: PercentPpmRatioPattern2, - pub to_own_gross_pnl: PercentPpmRatioPattern2, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Total_AddrBalance { + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10, + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10, + pub matrix: SeriesPattern18, } -impl SeriesTree_Cohorts_Utxo_All_Unrealized_Loss { +impl SeriesTree_Cohorts_Cohorts_Supply_Total_AddrBalance { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: SeriesPattern1::new(client.clone(), "unrealized_loss".to_string()), - cents: SeriesPattern1::new(client.clone(), "unrealized_loss_cents".to_string()), - negative: SeriesPattern1::new(client.clone(), "unrealized_loss_neg".to_string()), - to_mcap: PercentPpmRatioPattern2::new(client.clone(), "unrealized_loss_to_mcap".to_string()), - to_own_gross_pnl: PercentPpmRatioPattern2::new(client.clone(), "unrealized_loss_to_own_gross_pnl".to_string()), + range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10::new(client.clone(), "addrs".to_string()), + under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10::new(client.clone(), "addrs_under".to_string()), + over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10::new(client.clone(), "addrs_over".to_string()), + matrix: SeriesPattern18::new(client.clone(), "addrs_supply_sats_by_balance_range".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl { - pub usd: SeriesPattern1, - pub cents: SeriesPattern1, - pub to_own_gross_pnl: PercentPpmRatioPattern3, -} - -impl SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - usd: SeriesPattern1::new(client.clone(), "net_unrealized_pnl".to_string()), - cents: SeriesPattern1::new(client.clone(), "net_unrealized_pnl_cents".to_string()), - to_own_gross_pnl: PercentPpmRatioPattern3::new(client.clone(), "net_unrealized_pnl_to_own_gross_pnl".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment { - pub pain_index: CentsUsdPattern3, - pub greed_index: CentsUsdPattern3, - pub net: CentsUsdPattern, -} - -impl SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - pain_index: CentsUsdPattern3::new(client.clone(), "pain_index".to_string()), - greed_index: CentsUsdPattern3::new(client.clone(), "greed_index".to_string()), - net: CentsUsdPattern::new(client.clone(), "net_sentiment".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Sth { - pub supply: DeltaDominanceHalfInTotalPattern2, - pub outputs: SpentUnspentPattern, - pub activity: CoindaysCoinyearsDormancyTransferPattern, - pub realized: CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern, - pub cost_basis: InMaxMinPerSupplyPattern, - pub unrealized: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2, - pub invested_capital: InPattern, -} - -impl SeriesTree_Cohorts_Utxo_Sth { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - supply: DeltaDominanceHalfInTotalPattern2::new(client.clone(), "sth_supply".to_string()), - outputs: SpentUnspentPattern::new(client.clone(), "sth".to_string()), - activity: CoindaysCoinyearsDormancyTransferPattern::new(client.clone(), "sth".to_string()), - realized: CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern::new(client.clone(), "sth".to_string()), - cost_basis: InMaxMinPerSupplyPattern::new(client.clone(), "sth".to_string()), - unrealized: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2::new(client.clone(), "sth".to_string()), - invested_capital: InPattern::new(client.clone(), "sth_invested_capital_in".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Lth { - pub supply: DeltaDominanceHalfInTotalPattern2, - pub outputs: SpentUnspentPattern, - pub activity: CoindaysCoinyearsDormancyTransferPattern, - pub realized: SeriesTree_Cohorts_Utxo_Lth_Realized, - pub cost_basis: InMaxMinPerSupplyPattern, - pub unrealized: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2, - pub invested_capital: InPattern, -} - -impl SeriesTree_Cohorts_Utxo_Lth { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - supply: DeltaDominanceHalfInTotalPattern2::new(client.clone(), "lth_supply".to_string()), - outputs: SpentUnspentPattern::new(client.clone(), "lth".to_string()), - activity: CoindaysCoinyearsDormancyTransferPattern::new(client.clone(), "lth".to_string()), - realized: SeriesTree_Cohorts_Utxo_Lth_Realized::new(client.clone(), format!("{base_path}_realized")), - cost_basis: InMaxMinPerSupplyPattern::new(client.clone(), "lth".to_string()), - unrealized: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2::new(client.clone(), "lth".to_string()), - invested_capital: InPattern::new(client.clone(), "lth_invested_capital_in".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Lth_Realized { - pub cap: CentsDeltaToUsdPattern, - pub profit: BlockCumulativeSumPattern, - pub loss: BlockCumulativeNegativeSumPattern, - pub price: CentsPpmRatioSatsUsdPattern, - pub mvrv: SeriesPattern1, - pub net_pnl: BlockChangeCumulativeDeltaSumPattern, - pub sopr: SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr, - pub gross_pnl: BlockCumulativeSumPattern, - pub sell_side_risk_ratio: _1m1w1y24hHeightPattern3, - pub peak_regret: BlockCumulativeSumPattern, - pub capitalized: PricePattern, - pub profit_to_loss_ratio: _1m1w1y24hHeightPattern2, -} - -impl SeriesTree_Cohorts_Utxo_Lth_Realized { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - cap: CentsDeltaToUsdPattern::new(client.clone(), "lth_realized_cap".to_string()), - profit: BlockCumulativeSumPattern::new(client.clone(), "lth_realized_profit".to_string()), - loss: BlockCumulativeNegativeSumPattern::new(client.clone(), "lth_realized_loss".to_string()), - price: CentsPpmRatioSatsUsdPattern::new(client.clone(), "lth_realized_price".to_string()), - mvrv: SeriesPattern1::new(client.clone(), "lth_mvrv".to_string()), - net_pnl: BlockChangeCumulativeDeltaSumPattern::new(client.clone(), "lth_net".to_string()), - sopr: SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), - gross_pnl: BlockCumulativeSumPattern::new(client.clone(), "lth_realized_gross_pnl".to_string()), - sell_side_risk_ratio: _1m1w1y24hHeightPattern3::new(client.clone(), "lth_sell_side_risk_ratio".to_string()), - peak_regret: BlockCumulativeSumPattern::new(client.clone(), "lth_realized_peak_regret".to_string()), - capitalized: PricePattern::new(client.clone(), "lth_capitalized_price".to_string()), - profit_to_loss_ratio: _1m1w1y24hHeightPattern2::new(client.clone(), "lth_realized_profit_to_loss_ratio".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr { - pub value_destroyed: AverageBlockCumulativeSumPattern, - pub ratio: _1m1w1y24hHeightPattern4, -} - -impl SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - value_destroyed: AverageBlockCumulativeSumPattern::new(client.clone(), "lth_value_destroyed".to_string()), - ratio: _1m1w1y24hHeightPattern4::new(client.clone(), "lth_sopr".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_AgeRange { - pub under_1h: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1h_to_1d: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1d_to_1w: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1w_to_1m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1m_to_2m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2m_to_3m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _3m_to_4m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _4m_to_5m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _5m_to_6m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _6m_to_9m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _9m_to_1y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1y_to_18m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _18m_to_2y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2y_to_3y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _3y_to_4y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _4y_to_5y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _5y_to_6y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _6y_to_7y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _7y_to_8y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _8y_to_10y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _10y_to_12y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _12y_to_15y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub over_15y: ActivityOutputsRealizedSupplyUnrealizedPattern, -} - -impl SeriesTree_Cohorts_Utxo_AgeRange { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - under_1h: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1h_old".to_string()), - _1h_to_1d: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1h_to_1d_old".to_string()), - _1d_to_1w: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1d_to_1w_old".to_string()), - _1w_to_1m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1w_to_1m_old".to_string()), - _1m_to_2m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1m_to_2m_old".to_string()), - _2m_to_3m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_2m_to_3m_old".to_string()), - _3m_to_4m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_3m_to_4m_old".to_string()), - _4m_to_5m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_4m_to_5m_old".to_string()), - _5m_to_6m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_5m_to_6m_old".to_string()), - _6m_to_9m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_6m_to_9m_old".to_string()), - _9m_to_1y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_9m_to_1y_old".to_string()), - _1y_to_18m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_1y_to_18m_old".to_string()), - _18m_to_2y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_18m_to_2y_old".to_string()), - _2y_to_3y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_2y_to_3y_old".to_string()), - _3y_to_4y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_3y_to_4y_old".to_string()), - _4y_to_5y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_4y_to_5y_old".to_string()), - _5y_to_6y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_5y_to_6y_old".to_string()), - _6y_to_7y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_6y_to_7y_old".to_string()), - _7y_to_8y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_7y_to_8y_old".to_string()), - _8y_to_10y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_8y_to_10y_old".to_string()), - _10y_to_12y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_10y_to_12y_old".to_string()), - _12y_to_15y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_12y_to_15y_old".to_string()), - over_15y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_15y_old".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_UnderAge { - pub _1w: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _3m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _4m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _5m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _6m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _9m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _18m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _3y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _4y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _5y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _6y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _7y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _8y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _10y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _12y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _15y: ActivityOutputsRealizedSupplyUnrealizedPattern, -} - -impl SeriesTree_Cohorts_Utxo_UnderAge { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _1w: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1w_old".to_string()), - _1m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1m_old".to_string()), - _2m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_2m_old".to_string()), - _3m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_3m_old".to_string()), - _4m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_4m_old".to_string()), - _5m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_5m_old".to_string()), - _6m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_6m_old".to_string()), - _9m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_9m_old".to_string()), - _1y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1y_old".to_string()), - _18m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_18m_old".to_string()), - _2y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_2y_old".to_string()), - _3y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_3y_old".to_string()), - _4y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_4y_old".to_string()), - _5y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_5y_old".to_string()), - _6y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_6y_old".to_string()), - _7y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_7y_old".to_string()), - _8y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_8y_old".to_string()), - _10y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_10y_old".to_string()), - _12y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_12y_old".to_string()), - _15y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_15y_old".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_OverAge { - pub _1d: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1w: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _3m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _4m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _5m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _6m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _9m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _18m: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _3y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _4y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _5y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _6y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _7y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _8y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _10y: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _12y: ActivityOutputsRealizedSupplyUnrealizedPattern, -} - -impl SeriesTree_Cohorts_Utxo_OverAge { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _1d: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1d_old".to_string()), - _1w: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1w_old".to_string()), - _1m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1m_old".to_string()), - _2m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_2m_old".to_string()), - _3m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_3m_old".to_string()), - _4m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_4m_old".to_string()), - _5m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_5m_old".to_string()), - _6m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_6m_old".to_string()), - _9m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_9m_old".to_string()), - _1y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1y_old".to_string()), - _18m: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_18m_old".to_string()), - _2y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_2y_old".to_string()), - _3y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_3y_old".to_string()), - _4y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_4y_old".to_string()), - _5y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_5y_old".to_string()), - _6y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_6y_old".to_string()), - _7y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_7y_old".to_string()), - _8y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_8y_old".to_string()), - _10y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10y_old".to_string()), - _12y: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_12y_old".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Epoch { - pub _0: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _1: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _3: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _4: ActivityOutputsRealizedSupplyUnrealizedPattern, -} - -impl SeriesTree_Cohorts_Utxo_Epoch { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _0: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_0".to_string()), - _1: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_1".to_string()), - _2: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_2".to_string()), - _3: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_3".to_string()), - _4: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_4".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Class { - pub _2009: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2010: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2011: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2012: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2013: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2014: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2015: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2016: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2017: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2018: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2019: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2020: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2021: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2022: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2023: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2024: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2025: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub _2026: ActivityOutputsRealizedSupplyUnrealizedPattern, -} - -impl SeriesTree_Cohorts_Utxo_Class { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _2009: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2009".to_string()), - _2010: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2010".to_string()), - _2011: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2011".to_string()), - _2012: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2012".to_string()), - _2013: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2013".to_string()), - _2014: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2014".to_string()), - _2015: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2015".to_string()), - _2016: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2016".to_string()), - _2017: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2017".to_string()), - _2018: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2018".to_string()), - _2019: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2019".to_string()), - _2020: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2020".to_string()), - _2021: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2021".to_string()), - _2022: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2022".to_string()), - _2023: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2023".to_string()), - _2024: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2024".to_string()), - _2025: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2025".to_string()), - _2026: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2026".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Entry { - pub discount: ActivityOutputsRealizedSupplyUnrealizedPattern, - pub premium: ActivityOutputsRealizedSupplyUnrealizedPattern, -} - -impl SeriesTree_Cohorts_Utxo_Entry { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - discount: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "veteran".to_string()), - premium: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "rookie".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_OverAmount { - pub _1sat: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, -} - -impl SeriesTree_Cohorts_Utxo_OverAmount { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _1sat: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1sat".to_string()), - _10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10sats".to_string()), - _100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_100sats".to_string()), - _1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1k_sats".to_string()), - _10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10k_sats".to_string()), - _100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_100k_sats".to_string()), - _1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1m_sats".to_string()), - _10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10m_sats".to_string()), - _1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1btc".to_string()), - _10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10btc".to_string()), - _100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_100btc".to_string()), - _1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_1k_btc".to_string()), - _10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_10k_btc".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_AmountRange { - pub _0sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1sat_to_10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10sats_to_100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100sats_to_1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1k_sats_to_10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10k_sats_to_100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100k_sats_to_1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1m_sats_to_10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10m_sats_to_1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1btc_to_10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10btc_to_100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100btc_to_1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1k_btc_to_10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10k_btc_to_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub over_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, -} - -impl SeriesTree_Cohorts_Utxo_AmountRange { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _0sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_0sats".to_string()), - _1sat_to_10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1sat_to_10sats".to_string()), - _10sats_to_100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10sats_to_100sats".to_string()), - _100sats_to_1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_100sats_to_1k_sats".to_string()), - _1k_sats_to_10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1k_sats_to_10k_sats".to_string()), - _10k_sats_to_100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10k_sats_to_100k_sats".to_string()), - _100k_sats_to_1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_100k_sats_to_1m_sats".to_string()), - _1m_sats_to_10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1m_sats_to_10m_sats".to_string()), - _10m_sats_to_1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10m_sats_to_1btc".to_string()), - _1btc_to_10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1btc_to_10btc".to_string()), - _10btc_to_100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10btc_to_100btc".to_string()), - _100btc_to_1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_100btc_to_1k_btc".to_string()), - _1k_btc_to_10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_1k_btc_to_10k_btc".to_string()), - _10k_btc_to_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_10k_btc_to_100k_btc".to_string()), - over_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_over_100k_btc".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_UnderAmount { - pub _10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, - pub _100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2, -} - -impl SeriesTree_Cohorts_Utxo_UnderAmount { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10sats".to_string()), - _100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_100sats".to_string()), - _1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_1k_sats".to_string()), - _10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10k_sats".to_string()), - _100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_100k_sats".to_string()), - _1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_1m_sats".to_string()), - _10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10m_sats".to_string()), - _1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_1btc".to_string()), - _10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10btc".to_string()), - _100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_100btc".to_string()), - _1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_1k_btc".to_string()), - _10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_10k_btc".to_string()), - _100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "utxos_under_100k_btc".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Type { - pub p2pk65: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub p2pk33: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub p2pkh: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub p2ms: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub p2sh: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub p2wpkh: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub p2wsh: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub p2tr: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub p2a: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub unknown: ActivityOutputsRealizedSupplyUnrealizedPattern3, - pub empty: ActivityOutputsRealizedSupplyUnrealizedPattern3, -} - -impl SeriesTree_Cohorts_Utxo_Type { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - p2pk65: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2pk65".to_string()), - p2pk33: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2pk33".to_string()), - p2pkh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2pkh".to_string()), - p2ms: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2ms".to_string()), - p2sh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2sh".to_string()), - p2wpkh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2wpkh".to_string()), - p2wsh: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2wsh".to_string()), - p2tr: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2tr".to_string()), - p2a: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "p2a".to_string()), - unknown: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "unknown_outputs".to_string()), - empty: ActivityOutputsRealizedSupplyUnrealizedPattern3::new(client.clone(), "empty_outputs".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Profitability { - pub range: SeriesTree_Cohorts_Utxo_Profitability_Range, - pub profit: SeriesTree_Cohorts_Utxo_Profitability_Profit, - pub loss: SeriesTree_Cohorts_Utxo_Profitability_Loss, - pub all_supply_sats: SeriesPattern18, - pub sth_supply_sats: SeriesPattern18, - pub all_realized_cap: SeriesPattern18, - pub sth_realized_cap: SeriesPattern18, - pub all_unrealized_pnl: SeriesPattern18, - pub sth_unrealized_pnl: SeriesPattern18, - pub nupl: SeriesPattern18, -} - -impl SeriesTree_Cohorts_Utxo_Profitability { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - range: SeriesTree_Cohorts_Utxo_Profitability_Range::new(client.clone(), format!("{base_path}_range")), - profit: SeriesTree_Cohorts_Utxo_Profitability_Profit::new(client.clone(), format!("{base_path}_profit")), - loss: SeriesTree_Cohorts_Utxo_Profitability_Loss::new(client.clone(), format!("{base_path}_loss")), - all_supply_sats: SeriesPattern18::new(client.clone(), "profitability_all_supply_sats".to_string()), - sth_supply_sats: SeriesPattern18::new(client.clone(), "profitability_sth_supply_sats".to_string()), - all_realized_cap: SeriesPattern18::new(client.clone(), "profitability_all_realized_cap".to_string()), - sth_realized_cap: SeriesPattern18::new(client.clone(), "profitability_sth_realized_cap".to_string()), - all_unrealized_pnl: SeriesPattern18::new(client.clone(), "profitability_all_unrealized_pnl".to_string()), - sth_unrealized_pnl: SeriesPattern18::new(client.clone(), "profitability_sth_unrealized_pnl".to_string()), - nupl: SeriesPattern18::new(client.clone(), "profitability_nupl_ppm".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Profitability_Range { - pub over_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _500pct_to_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _300pct_to_500pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _200pct_to_300pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _100pct_to_200pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _90pct_to_100pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _80pct_to_90pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _70pct_to_80pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _60pct_to_70pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _50pct_to_60pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _40pct_to_50pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _30pct_to_40pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _20pct_to_30pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _10pct_to_20pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _0pct_to_10pct_in_profit: NuplRealizedSupplyUnrealizedPattern, - pub _0pct_to_10pct_in_loss: NuplRealizedSupplyUnrealizedPattern, - pub _10pct_to_20pct_in_loss: NuplRealizedSupplyUnrealizedPattern, - pub _20pct_to_30pct_in_loss: NuplRealizedSupplyUnrealizedPattern, - pub _30pct_to_40pct_in_loss: NuplRealizedSupplyUnrealizedPattern, - pub _40pct_to_50pct_in_loss: NuplRealizedSupplyUnrealizedPattern, - pub _50pct_to_60pct_in_loss: NuplRealizedSupplyUnrealizedPattern, - pub _60pct_to_70pct_in_loss: NuplRealizedSupplyUnrealizedPattern, - pub _70pct_to_80pct_in_loss: NuplRealizedSupplyUnrealizedPattern, - pub _80pct_to_90pct_in_loss: NuplRealizedSupplyUnrealizedPattern, - pub _90pct_to_100pct_in_loss: NuplRealizedSupplyUnrealizedPattern, -} - -impl SeriesTree_Cohorts_Utxo_Profitability_Range { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - over_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1000pct_in_profit".to_string()), - _500pct_to_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_500pct_to_1000pct_in_profit".to_string()), - _300pct_to_500pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_300pct_to_500pct_in_profit".to_string()), - _200pct_to_300pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_200pct_to_300pct_in_profit".to_string()), - _100pct_to_200pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_100pct_to_200pct_in_profit".to_string()), - _90pct_to_100pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_90pct_to_100pct_in_profit".to_string()), - _80pct_to_90pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_80pct_to_90pct_in_profit".to_string()), - _70pct_to_80pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_70pct_to_80pct_in_profit".to_string()), - _60pct_to_70pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_60pct_to_70pct_in_profit".to_string()), - _50pct_to_60pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_50pct_to_60pct_in_profit".to_string()), - _40pct_to_50pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_40pct_to_50pct_in_profit".to_string()), - _30pct_to_40pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_30pct_to_40pct_in_profit".to_string()), - _20pct_to_30pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_20pct_to_30pct_in_profit".to_string()), - _10pct_to_20pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_10pct_to_20pct_in_profit".to_string()), - _0pct_to_10pct_in_profit: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_0pct_to_10pct_in_profit".to_string()), - _0pct_to_10pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_0pct_to_10pct_in_loss".to_string()), - _10pct_to_20pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_10pct_to_20pct_in_loss".to_string()), - _20pct_to_30pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_20pct_to_30pct_in_loss".to_string()), - _30pct_to_40pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_30pct_to_40pct_in_loss".to_string()), - _40pct_to_50pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_40pct_to_50pct_in_loss".to_string()), - _50pct_to_60pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_50pct_to_60pct_in_loss".to_string()), - _60pct_to_70pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_60pct_to_70pct_in_loss".to_string()), - _70pct_to_80pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_70pct_to_80pct_in_loss".to_string()), - _80pct_to_90pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_80pct_to_90pct_in_loss".to_string()), - _90pct_to_100pct_in_loss: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_90pct_to_100pct_in_loss".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Profitability_Profit { - pub all: NuplRealizedSupplyUnrealizedPattern, - pub _10pct: NuplRealizedSupplyUnrealizedPattern, - pub _20pct: NuplRealizedSupplyUnrealizedPattern, - pub _30pct: NuplRealizedSupplyUnrealizedPattern, - pub _40pct: NuplRealizedSupplyUnrealizedPattern, - pub _50pct: NuplRealizedSupplyUnrealizedPattern, - pub _60pct: NuplRealizedSupplyUnrealizedPattern, - pub _70pct: NuplRealizedSupplyUnrealizedPattern, - pub _80pct: NuplRealizedSupplyUnrealizedPattern, - pub _90pct: NuplRealizedSupplyUnrealizedPattern, - pub _100pct: NuplRealizedSupplyUnrealizedPattern, - pub _200pct: NuplRealizedSupplyUnrealizedPattern, - pub _300pct: NuplRealizedSupplyUnrealizedPattern, - pub _500pct: NuplRealizedSupplyUnrealizedPattern, -} - -impl SeriesTree_Cohorts_Utxo_Profitability_Profit { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - all: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_in_profit".to_string()), - _10pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10pct_in_profit".to_string()), - _20pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_20pct_in_profit".to_string()), - _30pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_30pct_in_profit".to_string()), - _40pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_40pct_in_profit".to_string()), - _50pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_50pct_in_profit".to_string()), - _60pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_60pct_in_profit".to_string()), - _70pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_70pct_in_profit".to_string()), - _80pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_80pct_in_profit".to_string()), - _90pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_90pct_in_profit".to_string()), - _100pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_100pct_in_profit".to_string()), - _200pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_200pct_in_profit".to_string()), - _300pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_300pct_in_profit".to_string()), - _500pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_500pct_in_profit".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Profitability_Loss { - pub all: NuplRealizedSupplyUnrealizedPattern, - pub _10pct: NuplRealizedSupplyUnrealizedPattern, - pub _20pct: NuplRealizedSupplyUnrealizedPattern, - pub _30pct: NuplRealizedSupplyUnrealizedPattern, - pub _40pct: NuplRealizedSupplyUnrealizedPattern, - pub _50pct: NuplRealizedSupplyUnrealizedPattern, - pub _60pct: NuplRealizedSupplyUnrealizedPattern, - pub _70pct: NuplRealizedSupplyUnrealizedPattern, - pub _80pct: NuplRealizedSupplyUnrealizedPattern, -} - -impl SeriesTree_Cohorts_Utxo_Profitability_Loss { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - all: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_in_loss".to_string()), - _10pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10pct_in_loss".to_string()), - _20pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_20pct_in_loss".to_string()), - _30pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_30pct_in_loss".to_string()), - _40pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_40pct_in_loss".to_string()), - _50pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_50pct_in_loss".to_string()), - _60pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_60pct_in_loss".to_string()), - _70pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_70pct_in_loss".to_string()), - _80pct: NuplRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_80pct_in_loss".to_string()), - } - } -} - -/// Series tree node. -pub struct SeriesTree_Cohorts_Utxo_Matured { +pub struct SeriesTree_Cohorts_Cohorts_Supply_Matured { pub under_1h: AverageBlockCumulativeSumPattern2, pub _1h_to_1d: AverageBlockCumulativeSumPattern2, pub _1d_to_1w: AverageBlockCumulativeSumPattern2, @@ -11278,9 +12226,11 @@ pub struct SeriesTree_Cohorts_Utxo_Matured { pub _10y_to_12y: AverageBlockCumulativeSumPattern2, pub _12y_to_15y: AverageBlockCumulativeSumPattern2, pub over_15y: AverageBlockCumulativeSumPattern2, + pub sats: CumulativePattern, + pub cents: CumulativePattern, } -impl SeriesTree_Cohorts_Utxo_Matured { +impl SeriesTree_Cohorts_Cohorts_Supply_Matured { pub fn new(client: Arc, base_path: String) -> Self { Self { under_1h: AverageBlockCumulativeSumPattern2::new(client.clone(), "utxos_under_1h_old_matured_supply".to_string()), @@ -11306,138 +12256,11531 @@ impl SeriesTree_Cohorts_Utxo_Matured { _10y_to_12y: AverageBlockCumulativeSumPattern2::new(client.clone(), "utxos_10y_to_12y_old_matured_supply".to_string()), _12y_to_15y: AverageBlockCumulativeSumPattern2::new(client.clone(), "utxos_12y_to_15y_old_matured_supply".to_string()), over_15y: AverageBlockCumulativeSumPattern2::new(client.clone(), "utxos_over_15y_old_matured_supply".to_string()), + sats: CumulativePattern::new(client.clone(), "utxos_age_range_matured_supply_cumulative_sats".to_string()), + cents: CumulativePattern::new(client.clone(), "utxos_age_range_matured_supply_cumulative_cents".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Addr { - pub over_amount: SeriesTree_Cohorts_Addr_OverAmount, - pub amount_range: SeriesTree_Cohorts_Addr_AmountRange, - pub under_amount: SeriesTree_Cohorts_Addr_UnderAmount, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Half { + pub all: BtcCentsSatsUsdPattern, + pub age: SeriesTree_Cohorts_Cohorts_Supply_Half_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Supply_Half_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Supply_Half_Class, + pub entry: DiscountPremiumPattern12, + pub term: LongShortPattern13, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10, } -impl SeriesTree_Cohorts_Addr { +impl SeriesTree_Cohorts_Cohorts_Supply_Half { pub fn new(client: Arc, base_path: String) -> Self { Self { - over_amount: SeriesTree_Cohorts_Addr_OverAmount::new(client.clone(), format!("{base_path}_over_amount")), - amount_range: SeriesTree_Cohorts_Addr_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), - under_amount: SeriesTree_Cohorts_Addr_UnderAmount::new(client.clone(), format!("{base_path}_under_amount")), + all: BtcCentsSatsUsdPattern::new(client.clone(), "supply_half".to_string()), + age: SeriesTree_Cohorts_Cohorts_Supply_Half_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Supply_Half_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Supply_Half_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern12::new(client.clone(), "supply_half".to_string()), + term: LongShortPattern13::new(client.clone(), "supply_half".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10::new(client.clone(), "supply_half".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Addr_OverAmount { - pub _1sat: ActivityAddrOutputsRealizedSupplyPattern, - pub _10sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _100sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _1k_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _10k_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _100k_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _1m_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _10m_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _1btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _10btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _100btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _1k_btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _10k_btc: ActivityAddrOutputsRealizedSupplyPattern, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Half_Age { + pub range: SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Over, } -impl SeriesTree_Cohorts_Addr_OverAmount { +impl SeriesTree_Cohorts_Cohorts_Supply_Half_Age { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1sat: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_1sat".to_string()), - _10sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_10sats".to_string()), - _100sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_100sats".to_string()), - _1k_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_1k_sats".to_string()), - _10k_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_10k_sats".to_string()), - _100k_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_100k_sats".to_string()), - _1m_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_1m_sats".to_string()), - _10m_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_10m_sats".to_string()), - _1btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_1btc".to_string()), - _10btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_10btc".to_string()), - _100btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_100btc".to_string()), - _1k_btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_1k_btc".to_string()), - _10k_btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_10k_btc".to_string()), + range: SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Over::new(client.clone(), format!("{base_path}_over")), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Addr_AmountRange { - pub _0sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _1sat_to_10sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _10sats_to_100sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _100sats_to_1k_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _1k_sats_to_10k_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _10k_sats_to_100k_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _100k_sats_to_1m_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _1m_sats_to_10m_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _10m_sats_to_1btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _1btc_to_10btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _10btc_to_100btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _100btc_to_1k_btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _1k_btc_to_10k_btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _10k_btc_to_100k_btc: ActivityAddrOutputsRealizedSupplyPattern, - pub over_100k_btc: ActivityAddrOutputsRealizedSupplyPattern, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Range { + pub under_1h: BtcCentsSatsUsdPattern, + pub _1h_to_1d: BtcCentsSatsUsdPattern, + pub _1d_to_1w: BtcCentsSatsUsdPattern, + pub _1w_to_1m: BtcCentsSatsUsdPattern, + pub _1m_to_2m: BtcCentsSatsUsdPattern, + pub _2m_to_3m: BtcCentsSatsUsdPattern, + pub _3m_to_4m: BtcCentsSatsUsdPattern, + pub _4m_to_5m: BtcCentsSatsUsdPattern, + pub _5m_to_6m: BtcCentsSatsUsdPattern, + pub _6m_to_9m: BtcCentsSatsUsdPattern, + pub _9m_to_1y: BtcCentsSatsUsdPattern, + pub _1y_to_18m: BtcCentsSatsUsdPattern, + pub _18m_to_2y: BtcCentsSatsUsdPattern, + pub _2y_to_3y: BtcCentsSatsUsdPattern, + pub _3y_to_4y: BtcCentsSatsUsdPattern, + pub _4y_to_5y: BtcCentsSatsUsdPattern, + pub _5y_to_6y: BtcCentsSatsUsdPattern, + pub _6y_to_7y: BtcCentsSatsUsdPattern, + pub _7y_to_8y: BtcCentsSatsUsdPattern, + pub _8y_to_10y: BtcCentsSatsUsdPattern, + pub _10y_to_12y: BtcCentsSatsUsdPattern, + pub _12y_to_15y: BtcCentsSatsUsdPattern, + pub over_15y: BtcCentsSatsUsdPattern, } -impl SeriesTree_Cohorts_Addr_AmountRange { +impl SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Range { pub fn new(client: Arc, base_path: String) -> Self { Self { - _0sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_0sats".to_string()), - _1sat_to_10sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_1sat_to_10sats".to_string()), - _10sats_to_100sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_10sats_to_100sats".to_string()), - _100sats_to_1k_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_100sats_to_1k_sats".to_string()), - _1k_sats_to_10k_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_1k_sats_to_10k_sats".to_string()), - _10k_sats_to_100k_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_10k_sats_to_100k_sats".to_string()), - _100k_sats_to_1m_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_100k_sats_to_1m_sats".to_string()), - _1m_sats_to_10m_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_1m_sats_to_10m_sats".to_string()), - _10m_sats_to_1btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_10m_sats_to_1btc".to_string()), - _1btc_to_10btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_1btc_to_10btc".to_string()), - _10btc_to_100btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_10btc_to_100btc".to_string()), - _100btc_to_1k_btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_100btc_to_1k_btc".to_string()), - _1k_btc_to_10k_btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_1k_btc_to_10k_btc".to_string()), - _10k_btc_to_100k_btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_10k_btc_to_100k_btc".to_string()), - over_100k_btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_over_100k_btc".to_string()), + under_1h: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1h_old_supply_half".to_string()), + _1h_to_1d: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1h_to_1d_old_supply_half".to_string()), + _1d_to_1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1d_to_1w_old_supply_half".to_string()), + _1w_to_1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1w_to_1m_old_supply_half".to_string()), + _1m_to_2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1m_to_2m_old_supply_half".to_string()), + _2m_to_3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_2m_to_3m_old_supply_half".to_string()), + _3m_to_4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_3m_to_4m_old_supply_half".to_string()), + _4m_to_5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_4m_to_5m_old_supply_half".to_string()), + _5m_to_6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_5m_to_6m_old_supply_half".to_string()), + _6m_to_9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_6m_to_9m_old_supply_half".to_string()), + _9m_to_1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_9m_to_1y_old_supply_half".to_string()), + _1y_to_18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1y_to_18m_old_supply_half".to_string()), + _18m_to_2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_18m_to_2y_old_supply_half".to_string()), + _2y_to_3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_2y_to_3y_old_supply_half".to_string()), + _3y_to_4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_3y_to_4y_old_supply_half".to_string()), + _4y_to_5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_4y_to_5y_old_supply_half".to_string()), + _5y_to_6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_5y_to_6y_old_supply_half".to_string()), + _6y_to_7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_6y_to_7y_old_supply_half".to_string()), + _7y_to_8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_7y_to_8y_old_supply_half".to_string()), + _8y_to_10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_8y_to_10y_old_supply_half".to_string()), + _10y_to_12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_10y_to_12y_old_supply_half".to_string()), + _12y_to_15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_12y_to_15y_old_supply_half".to_string()), + over_15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_15y_old_supply_half".to_string()), } } } /// Series tree node. -pub struct SeriesTree_Cohorts_Addr_UnderAmount { - pub _10sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _100sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _1k_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _10k_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _100k_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _1m_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _10m_sats: ActivityAddrOutputsRealizedSupplyPattern, - pub _1btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _10btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _100btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _1k_btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _10k_btc: ActivityAddrOutputsRealizedSupplyPattern, - pub _100k_btc: ActivityAddrOutputsRealizedSupplyPattern, +pub struct SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Under { + pub _1w: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, + pub _15y: BtcCentsSatsUsdPattern, } -impl SeriesTree_Cohorts_Addr_UnderAmount { +impl SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Under { pub fn new(client: Arc, base_path: String) -> Self { Self { - _10sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_10sats".to_string()), - _100sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_100sats".to_string()), - _1k_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_1k_sats".to_string()), - _10k_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_10k_sats".to_string()), - _100k_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_100k_sats".to_string()), - _1m_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_1m_sats".to_string()), - _10m_sats: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_10m_sats".to_string()), - _1btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_1btc".to_string()), - _10btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_10btc".to_string()), - _100btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_100btc".to_string()), - _1k_btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_1k_btc".to_string()), - _10k_btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_10k_btc".to_string()), - _100k_btc: ActivityAddrOutputsRealizedSupplyPattern::new(client.clone(), "addrs_under_100k_btc".to_string()), + _1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1w_old_supply_half".to_string()), + _1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1m_old_supply_half".to_string()), + _2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_2m_old_supply_half".to_string()), + _3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_3m_old_supply_half".to_string()), + _4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_4m_old_supply_half".to_string()), + _5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_5m_old_supply_half".to_string()), + _6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_6m_old_supply_half".to_string()), + _9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_9m_old_supply_half".to_string()), + _1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1y_old_supply_half".to_string()), + _18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_18m_old_supply_half".to_string()), + _2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_2y_old_supply_half".to_string()), + _3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_3y_old_supply_half".to_string()), + _4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_4y_old_supply_half".to_string()), + _5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_5y_old_supply_half".to_string()), + _6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_6y_old_supply_half".to_string()), + _7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_7y_old_supply_half".to_string()), + _8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_8y_old_supply_half".to_string()), + _10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_10y_old_supply_half".to_string()), + _12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_12y_old_supply_half".to_string()), + _15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_15y_old_supply_half".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Over { + pub _1d: BtcCentsSatsUsdPattern, + pub _1w: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1d_old_supply_half".to_string()), + _1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1w_old_supply_half".to_string()), + _1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1m_old_supply_half".to_string()), + _2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_2m_old_supply_half".to_string()), + _3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_3m_old_supply_half".to_string()), + _4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_4m_old_supply_half".to_string()), + _5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_5m_old_supply_half".to_string()), + _6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_6m_old_supply_half".to_string()), + _9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_9m_old_supply_half".to_string()), + _1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1y_old_supply_half".to_string()), + _18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_18m_old_supply_half".to_string()), + _2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_2y_old_supply_half".to_string()), + _3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_3y_old_supply_half".to_string()), + _4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_4y_old_supply_half".to_string()), + _5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_5y_old_supply_half".to_string()), + _6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_6y_old_supply_half".to_string()), + _7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_7y_old_supply_half".to_string()), + _8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_8y_old_supply_half".to_string()), + _10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_10y_old_supply_half".to_string()), + _12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_12y_old_supply_half".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Half_Epoch { + pub _0: BtcCentsSatsUsdPattern, + pub _1: BtcCentsSatsUsdPattern, + pub _2: BtcCentsSatsUsdPattern, + pub _3: BtcCentsSatsUsdPattern, + pub _4: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Half_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_0_supply_half".to_string()), + _1: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_1_supply_half".to_string()), + _2: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_2_supply_half".to_string()), + _3: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_3_supply_half".to_string()), + _4: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_4_supply_half".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Half_Class { + pub _2009: BtcCentsSatsUsdPattern, + pub _2010: BtcCentsSatsUsdPattern, + pub _2011: BtcCentsSatsUsdPattern, + pub _2012: BtcCentsSatsUsdPattern, + pub _2013: BtcCentsSatsUsdPattern, + pub _2014: BtcCentsSatsUsdPattern, + pub _2015: BtcCentsSatsUsdPattern, + pub _2016: BtcCentsSatsUsdPattern, + pub _2017: BtcCentsSatsUsdPattern, + pub _2018: BtcCentsSatsUsdPattern, + pub _2019: BtcCentsSatsUsdPattern, + pub _2020: BtcCentsSatsUsdPattern, + pub _2021: BtcCentsSatsUsdPattern, + pub _2022: BtcCentsSatsUsdPattern, + pub _2023: BtcCentsSatsUsdPattern, + pub _2024: BtcCentsSatsUsdPattern, + pub _2025: BtcCentsSatsUsdPattern, + pub _2026: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Half_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: BtcCentsSatsUsdPattern::new(client.clone(), "class_2009_supply_half".to_string()), + _2010: BtcCentsSatsUsdPattern::new(client.clone(), "class_2010_supply_half".to_string()), + _2011: BtcCentsSatsUsdPattern::new(client.clone(), "class_2011_supply_half".to_string()), + _2012: BtcCentsSatsUsdPattern::new(client.clone(), "class_2012_supply_half".to_string()), + _2013: BtcCentsSatsUsdPattern::new(client.clone(), "class_2013_supply_half".to_string()), + _2014: BtcCentsSatsUsdPattern::new(client.clone(), "class_2014_supply_half".to_string()), + _2015: BtcCentsSatsUsdPattern::new(client.clone(), "class_2015_supply_half".to_string()), + _2016: BtcCentsSatsUsdPattern::new(client.clone(), "class_2016_supply_half".to_string()), + _2017: BtcCentsSatsUsdPattern::new(client.clone(), "class_2017_supply_half".to_string()), + _2018: BtcCentsSatsUsdPattern::new(client.clone(), "class_2018_supply_half".to_string()), + _2019: BtcCentsSatsUsdPattern::new(client.clone(), "class_2019_supply_half".to_string()), + _2020: BtcCentsSatsUsdPattern::new(client.clone(), "class_2020_supply_half".to_string()), + _2021: BtcCentsSatsUsdPattern::new(client.clone(), "class_2021_supply_half".to_string()), + _2022: BtcCentsSatsUsdPattern::new(client.clone(), "class_2022_supply_half".to_string()), + _2023: BtcCentsSatsUsdPattern::new(client.clone(), "class_2023_supply_half".to_string()), + _2024: BtcCentsSatsUsdPattern::new(client.clone(), "class_2024_supply_half".to_string()), + _2025: BtcCentsSatsUsdPattern::new(client.clone(), "class_2025_supply_half".to_string()), + _2026: BtcCentsSatsUsdPattern::new(client.clone(), "class_2026_supply_half".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InProfit { + pub all: BtcCentsSatsUsdPattern, + pub age: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Class, + pub entry: DiscountPremiumPattern12, + pub term: LongShortPattern13, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BtcCentsSatsUsdPattern::new(client.clone(), "supply_in_profit".to_string()), + age: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern12::new(client.clone(), "supply_in_profit".to_string()), + term: LongShortPattern13::new(client.clone(), "supply_in_profit".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10::new(client.clone(), "supply_in_profit".to_string()), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_supply_in_profit_sats_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "supply_in_profit_sats_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "supply_in_profit_sats_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "supply_in_profit_sats_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "supply_in_profit_sats_by_type".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age { + pub range: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Range { + pub under_1h: BtcCentsSatsUsdPattern, + pub _1h_to_1d: BtcCentsSatsUsdPattern, + pub _1d_to_1w: BtcCentsSatsUsdPattern, + pub _1w_to_1m: BtcCentsSatsUsdPattern, + pub _1m_to_2m: BtcCentsSatsUsdPattern, + pub _2m_to_3m: BtcCentsSatsUsdPattern, + pub _3m_to_4m: BtcCentsSatsUsdPattern, + pub _4m_to_5m: BtcCentsSatsUsdPattern, + pub _5m_to_6m: BtcCentsSatsUsdPattern, + pub _6m_to_9m: BtcCentsSatsUsdPattern, + pub _9m_to_1y: BtcCentsSatsUsdPattern, + pub _1y_to_18m: BtcCentsSatsUsdPattern, + pub _18m_to_2y: BtcCentsSatsUsdPattern, + pub _2y_to_3y: BtcCentsSatsUsdPattern, + pub _3y_to_4y: BtcCentsSatsUsdPattern, + pub _4y_to_5y: BtcCentsSatsUsdPattern, + pub _5y_to_6y: BtcCentsSatsUsdPattern, + pub _6y_to_7y: BtcCentsSatsUsdPattern, + pub _7y_to_8y: BtcCentsSatsUsdPattern, + pub _8y_to_10y: BtcCentsSatsUsdPattern, + pub _10y_to_12y: BtcCentsSatsUsdPattern, + pub _12y_to_15y: BtcCentsSatsUsdPattern, + pub over_15y: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1h_old_supply_in_profit".to_string()), + _1h_to_1d: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1h_to_1d_old_supply_in_profit".to_string()), + _1d_to_1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1d_to_1w_old_supply_in_profit".to_string()), + _1w_to_1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1w_to_1m_old_supply_in_profit".to_string()), + _1m_to_2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1m_to_2m_old_supply_in_profit".to_string()), + _2m_to_3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_2m_to_3m_old_supply_in_profit".to_string()), + _3m_to_4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_3m_to_4m_old_supply_in_profit".to_string()), + _4m_to_5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_4m_to_5m_old_supply_in_profit".to_string()), + _5m_to_6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_5m_to_6m_old_supply_in_profit".to_string()), + _6m_to_9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_6m_to_9m_old_supply_in_profit".to_string()), + _9m_to_1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_9m_to_1y_old_supply_in_profit".to_string()), + _1y_to_18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1y_to_18m_old_supply_in_profit".to_string()), + _18m_to_2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_18m_to_2y_old_supply_in_profit".to_string()), + _2y_to_3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_2y_to_3y_old_supply_in_profit".to_string()), + _3y_to_4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_3y_to_4y_old_supply_in_profit".to_string()), + _4y_to_5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_4y_to_5y_old_supply_in_profit".to_string()), + _5y_to_6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_5y_to_6y_old_supply_in_profit".to_string()), + _6y_to_7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_6y_to_7y_old_supply_in_profit".to_string()), + _7y_to_8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_7y_to_8y_old_supply_in_profit".to_string()), + _8y_to_10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_8y_to_10y_old_supply_in_profit".to_string()), + _10y_to_12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_10y_to_12y_old_supply_in_profit".to_string()), + _12y_to_15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_12y_to_15y_old_supply_in_profit".to_string()), + over_15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_15y_old_supply_in_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Under { + pub _1w: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, + pub _15y: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1w_old_supply_in_profit".to_string()), + _1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1m_old_supply_in_profit".to_string()), + _2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_2m_old_supply_in_profit".to_string()), + _3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_3m_old_supply_in_profit".to_string()), + _4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_4m_old_supply_in_profit".to_string()), + _5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_5m_old_supply_in_profit".to_string()), + _6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_6m_old_supply_in_profit".to_string()), + _9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_9m_old_supply_in_profit".to_string()), + _1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1y_old_supply_in_profit".to_string()), + _18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_18m_old_supply_in_profit".to_string()), + _2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_2y_old_supply_in_profit".to_string()), + _3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_3y_old_supply_in_profit".to_string()), + _4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_4y_old_supply_in_profit".to_string()), + _5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_5y_old_supply_in_profit".to_string()), + _6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_6y_old_supply_in_profit".to_string()), + _7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_7y_old_supply_in_profit".to_string()), + _8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_8y_old_supply_in_profit".to_string()), + _10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_10y_old_supply_in_profit".to_string()), + _12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_12y_old_supply_in_profit".to_string()), + _15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_15y_old_supply_in_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Over { + pub _1d: BtcCentsSatsUsdPattern, + pub _1w: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1d_old_supply_in_profit".to_string()), + _1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1w_old_supply_in_profit".to_string()), + _1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1m_old_supply_in_profit".to_string()), + _2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_2m_old_supply_in_profit".to_string()), + _3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_3m_old_supply_in_profit".to_string()), + _4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_4m_old_supply_in_profit".to_string()), + _5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_5m_old_supply_in_profit".to_string()), + _6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_6m_old_supply_in_profit".to_string()), + _9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_9m_old_supply_in_profit".to_string()), + _1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1y_old_supply_in_profit".to_string()), + _18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_18m_old_supply_in_profit".to_string()), + _2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_2y_old_supply_in_profit".to_string()), + _3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_3y_old_supply_in_profit".to_string()), + _4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_4y_old_supply_in_profit".to_string()), + _5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_5y_old_supply_in_profit".to_string()), + _6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_6y_old_supply_in_profit".to_string()), + _7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_7y_old_supply_in_profit".to_string()), + _8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_8y_old_supply_in_profit".to_string()), + _10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_10y_old_supply_in_profit".to_string()), + _12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_12y_old_supply_in_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InProfit_Epoch { + pub _0: BtcCentsSatsUsdPattern, + pub _1: BtcCentsSatsUsdPattern, + pub _2: BtcCentsSatsUsdPattern, + pub _3: BtcCentsSatsUsdPattern, + pub _4: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InProfit_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_0_supply_in_profit".to_string()), + _1: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_1_supply_in_profit".to_string()), + _2: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_2_supply_in_profit".to_string()), + _3: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_3_supply_in_profit".to_string()), + _4: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_4_supply_in_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InProfit_Class { + pub _2009: BtcCentsSatsUsdPattern, + pub _2010: BtcCentsSatsUsdPattern, + pub _2011: BtcCentsSatsUsdPattern, + pub _2012: BtcCentsSatsUsdPattern, + pub _2013: BtcCentsSatsUsdPattern, + pub _2014: BtcCentsSatsUsdPattern, + pub _2015: BtcCentsSatsUsdPattern, + pub _2016: BtcCentsSatsUsdPattern, + pub _2017: BtcCentsSatsUsdPattern, + pub _2018: BtcCentsSatsUsdPattern, + pub _2019: BtcCentsSatsUsdPattern, + pub _2020: BtcCentsSatsUsdPattern, + pub _2021: BtcCentsSatsUsdPattern, + pub _2022: BtcCentsSatsUsdPattern, + pub _2023: BtcCentsSatsUsdPattern, + pub _2024: BtcCentsSatsUsdPattern, + pub _2025: BtcCentsSatsUsdPattern, + pub _2026: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InProfit_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: BtcCentsSatsUsdPattern::new(client.clone(), "class_2009_supply_in_profit".to_string()), + _2010: BtcCentsSatsUsdPattern::new(client.clone(), "class_2010_supply_in_profit".to_string()), + _2011: BtcCentsSatsUsdPattern::new(client.clone(), "class_2011_supply_in_profit".to_string()), + _2012: BtcCentsSatsUsdPattern::new(client.clone(), "class_2012_supply_in_profit".to_string()), + _2013: BtcCentsSatsUsdPattern::new(client.clone(), "class_2013_supply_in_profit".to_string()), + _2014: BtcCentsSatsUsdPattern::new(client.clone(), "class_2014_supply_in_profit".to_string()), + _2015: BtcCentsSatsUsdPattern::new(client.clone(), "class_2015_supply_in_profit".to_string()), + _2016: BtcCentsSatsUsdPattern::new(client.clone(), "class_2016_supply_in_profit".to_string()), + _2017: BtcCentsSatsUsdPattern::new(client.clone(), "class_2017_supply_in_profit".to_string()), + _2018: BtcCentsSatsUsdPattern::new(client.clone(), "class_2018_supply_in_profit".to_string()), + _2019: BtcCentsSatsUsdPattern::new(client.clone(), "class_2019_supply_in_profit".to_string()), + _2020: BtcCentsSatsUsdPattern::new(client.clone(), "class_2020_supply_in_profit".to_string()), + _2021: BtcCentsSatsUsdPattern::new(client.clone(), "class_2021_supply_in_profit".to_string()), + _2022: BtcCentsSatsUsdPattern::new(client.clone(), "class_2022_supply_in_profit".to_string()), + _2023: BtcCentsSatsUsdPattern::new(client.clone(), "class_2023_supply_in_profit".to_string()), + _2024: BtcCentsSatsUsdPattern::new(client.clone(), "class_2024_supply_in_profit".to_string()), + _2025: BtcCentsSatsUsdPattern::new(client.clone(), "class_2025_supply_in_profit".to_string()), + _2026: BtcCentsSatsUsdPattern::new(client.clone(), "class_2026_supply_in_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InLoss { + pub all: BtcCentsSatsUsdPattern, + pub age: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Class, + pub entry: DiscountPremiumPattern12, + pub term: LongShortPattern13, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BtcCentsSatsUsdPattern::new(client.clone(), "supply_in_loss".to_string()), + age: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern12::new(client.clone(), "supply_in_loss".to_string()), + term: LongShortPattern13::new(client.clone(), "supply_in_loss".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10::new(client.clone(), "supply_in_loss".to_string()), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_supply_in_loss_sats_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "supply_in_loss_sats_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "supply_in_loss_sats_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "supply_in_loss_sats_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "supply_in_loss_sats_by_type".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age { + pub range: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Range { + pub under_1h: BtcCentsSatsUsdPattern, + pub _1h_to_1d: BtcCentsSatsUsdPattern, + pub _1d_to_1w: BtcCentsSatsUsdPattern, + pub _1w_to_1m: BtcCentsSatsUsdPattern, + pub _1m_to_2m: BtcCentsSatsUsdPattern, + pub _2m_to_3m: BtcCentsSatsUsdPattern, + pub _3m_to_4m: BtcCentsSatsUsdPattern, + pub _4m_to_5m: BtcCentsSatsUsdPattern, + pub _5m_to_6m: BtcCentsSatsUsdPattern, + pub _6m_to_9m: BtcCentsSatsUsdPattern, + pub _9m_to_1y: BtcCentsSatsUsdPattern, + pub _1y_to_18m: BtcCentsSatsUsdPattern, + pub _18m_to_2y: BtcCentsSatsUsdPattern, + pub _2y_to_3y: BtcCentsSatsUsdPattern, + pub _3y_to_4y: BtcCentsSatsUsdPattern, + pub _4y_to_5y: BtcCentsSatsUsdPattern, + pub _5y_to_6y: BtcCentsSatsUsdPattern, + pub _6y_to_7y: BtcCentsSatsUsdPattern, + pub _7y_to_8y: BtcCentsSatsUsdPattern, + pub _8y_to_10y: BtcCentsSatsUsdPattern, + pub _10y_to_12y: BtcCentsSatsUsdPattern, + pub _12y_to_15y: BtcCentsSatsUsdPattern, + pub over_15y: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1h_old_supply_in_loss".to_string()), + _1h_to_1d: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1h_to_1d_old_supply_in_loss".to_string()), + _1d_to_1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1d_to_1w_old_supply_in_loss".to_string()), + _1w_to_1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1w_to_1m_old_supply_in_loss".to_string()), + _1m_to_2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1m_to_2m_old_supply_in_loss".to_string()), + _2m_to_3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_2m_to_3m_old_supply_in_loss".to_string()), + _3m_to_4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_3m_to_4m_old_supply_in_loss".to_string()), + _4m_to_5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_4m_to_5m_old_supply_in_loss".to_string()), + _5m_to_6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_5m_to_6m_old_supply_in_loss".to_string()), + _6m_to_9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_6m_to_9m_old_supply_in_loss".to_string()), + _9m_to_1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_9m_to_1y_old_supply_in_loss".to_string()), + _1y_to_18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_1y_to_18m_old_supply_in_loss".to_string()), + _18m_to_2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_18m_to_2y_old_supply_in_loss".to_string()), + _2y_to_3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_2y_to_3y_old_supply_in_loss".to_string()), + _3y_to_4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_3y_to_4y_old_supply_in_loss".to_string()), + _4y_to_5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_4y_to_5y_old_supply_in_loss".to_string()), + _5y_to_6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_5y_to_6y_old_supply_in_loss".to_string()), + _6y_to_7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_6y_to_7y_old_supply_in_loss".to_string()), + _7y_to_8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_7y_to_8y_old_supply_in_loss".to_string()), + _8y_to_10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_8y_to_10y_old_supply_in_loss".to_string()), + _10y_to_12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_10y_to_12y_old_supply_in_loss".to_string()), + _12y_to_15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_12y_to_15y_old_supply_in_loss".to_string()), + over_15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_15y_old_supply_in_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Under { + pub _1w: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, + pub _15y: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1w_old_supply_in_loss".to_string()), + _1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1m_old_supply_in_loss".to_string()), + _2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_2m_old_supply_in_loss".to_string()), + _3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_3m_old_supply_in_loss".to_string()), + _4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_4m_old_supply_in_loss".to_string()), + _5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_5m_old_supply_in_loss".to_string()), + _6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_6m_old_supply_in_loss".to_string()), + _9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_9m_old_supply_in_loss".to_string()), + _1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_1y_old_supply_in_loss".to_string()), + _18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_18m_old_supply_in_loss".to_string()), + _2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_2y_old_supply_in_loss".to_string()), + _3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_3y_old_supply_in_loss".to_string()), + _4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_4y_old_supply_in_loss".to_string()), + _5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_5y_old_supply_in_loss".to_string()), + _6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_6y_old_supply_in_loss".to_string()), + _7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_7y_old_supply_in_loss".to_string()), + _8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_8y_old_supply_in_loss".to_string()), + _10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_10y_old_supply_in_loss".to_string()), + _12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_12y_old_supply_in_loss".to_string()), + _15y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_under_15y_old_supply_in_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Over { + pub _1d: BtcCentsSatsUsdPattern, + pub _1w: BtcCentsSatsUsdPattern, + pub _1m: BtcCentsSatsUsdPattern, + pub _2m: BtcCentsSatsUsdPattern, + pub _3m: BtcCentsSatsUsdPattern, + pub _4m: BtcCentsSatsUsdPattern, + pub _5m: BtcCentsSatsUsdPattern, + pub _6m: BtcCentsSatsUsdPattern, + pub _9m: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _18m: BtcCentsSatsUsdPattern, + pub _2y: BtcCentsSatsUsdPattern, + pub _3y: BtcCentsSatsUsdPattern, + pub _4y: BtcCentsSatsUsdPattern, + pub _5y: BtcCentsSatsUsdPattern, + pub _6y: BtcCentsSatsUsdPattern, + pub _7y: BtcCentsSatsUsdPattern, + pub _8y: BtcCentsSatsUsdPattern, + pub _10y: BtcCentsSatsUsdPattern, + pub _12y: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1d_old_supply_in_loss".to_string()), + _1w: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1w_old_supply_in_loss".to_string()), + _1m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1m_old_supply_in_loss".to_string()), + _2m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_2m_old_supply_in_loss".to_string()), + _3m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_3m_old_supply_in_loss".to_string()), + _4m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_4m_old_supply_in_loss".to_string()), + _5m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_5m_old_supply_in_loss".to_string()), + _6m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_6m_old_supply_in_loss".to_string()), + _9m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_9m_old_supply_in_loss".to_string()), + _1y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_1y_old_supply_in_loss".to_string()), + _18m: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_18m_old_supply_in_loss".to_string()), + _2y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_2y_old_supply_in_loss".to_string()), + _3y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_3y_old_supply_in_loss".to_string()), + _4y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_4y_old_supply_in_loss".to_string()), + _5y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_5y_old_supply_in_loss".to_string()), + _6y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_6y_old_supply_in_loss".to_string()), + _7y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_7y_old_supply_in_loss".to_string()), + _8y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_8y_old_supply_in_loss".to_string()), + _10y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_10y_old_supply_in_loss".to_string()), + _12y: BtcCentsSatsUsdPattern::new(client.clone(), "utxos_over_12y_old_supply_in_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InLoss_Epoch { + pub _0: BtcCentsSatsUsdPattern, + pub _1: BtcCentsSatsUsdPattern, + pub _2: BtcCentsSatsUsdPattern, + pub _3: BtcCentsSatsUsdPattern, + pub _4: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InLoss_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_0_supply_in_loss".to_string()), + _1: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_1_supply_in_loss".to_string()), + _2: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_2_supply_in_loss".to_string()), + _3: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_3_supply_in_loss".to_string()), + _4: BtcCentsSatsUsdPattern::new(client.clone(), "epoch_4_supply_in_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_InLoss_Class { + pub _2009: BtcCentsSatsUsdPattern, + pub _2010: BtcCentsSatsUsdPattern, + pub _2011: BtcCentsSatsUsdPattern, + pub _2012: BtcCentsSatsUsdPattern, + pub _2013: BtcCentsSatsUsdPattern, + pub _2014: BtcCentsSatsUsdPattern, + pub _2015: BtcCentsSatsUsdPattern, + pub _2016: BtcCentsSatsUsdPattern, + pub _2017: BtcCentsSatsUsdPattern, + pub _2018: BtcCentsSatsUsdPattern, + pub _2019: BtcCentsSatsUsdPattern, + pub _2020: BtcCentsSatsUsdPattern, + pub _2021: BtcCentsSatsUsdPattern, + pub _2022: BtcCentsSatsUsdPattern, + pub _2023: BtcCentsSatsUsdPattern, + pub _2024: BtcCentsSatsUsdPattern, + pub _2025: BtcCentsSatsUsdPattern, + pub _2026: BtcCentsSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_InLoss_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: BtcCentsSatsUsdPattern::new(client.clone(), "class_2009_supply_in_loss".to_string()), + _2010: BtcCentsSatsUsdPattern::new(client.clone(), "class_2010_supply_in_loss".to_string()), + _2011: BtcCentsSatsUsdPattern::new(client.clone(), "class_2011_supply_in_loss".to_string()), + _2012: BtcCentsSatsUsdPattern::new(client.clone(), "class_2012_supply_in_loss".to_string()), + _2013: BtcCentsSatsUsdPattern::new(client.clone(), "class_2013_supply_in_loss".to_string()), + _2014: BtcCentsSatsUsdPattern::new(client.clone(), "class_2014_supply_in_loss".to_string()), + _2015: BtcCentsSatsUsdPattern::new(client.clone(), "class_2015_supply_in_loss".to_string()), + _2016: BtcCentsSatsUsdPattern::new(client.clone(), "class_2016_supply_in_loss".to_string()), + _2017: BtcCentsSatsUsdPattern::new(client.clone(), "class_2017_supply_in_loss".to_string()), + _2018: BtcCentsSatsUsdPattern::new(client.clone(), "class_2018_supply_in_loss".to_string()), + _2019: BtcCentsSatsUsdPattern::new(client.clone(), "class_2019_supply_in_loss".to_string()), + _2020: BtcCentsSatsUsdPattern::new(client.clone(), "class_2020_supply_in_loss".to_string()), + _2021: BtcCentsSatsUsdPattern::new(client.clone(), "class_2021_supply_in_loss".to_string()), + _2022: BtcCentsSatsUsdPattern::new(client.clone(), "class_2022_supply_in_loss".to_string()), + _2023: BtcCentsSatsUsdPattern::new(client.clone(), "class_2023_supply_in_loss".to_string()), + _2024: BtcCentsSatsUsdPattern::new(client.clone(), "class_2024_supply_in_loss".to_string()), + _2025: BtcCentsSatsUsdPattern::new(client.clone(), "class_2025_supply_in_loss".to_string()), + _2026: BtcCentsSatsUsdPattern::new(client.clone(), "class_2026_supply_in_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta { + pub all: AbsoluteRatePattern2, + pub age: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Supply_Delta_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Supply_Delta_Class, + pub entry: SeriesTree_Cohorts_Cohorts_Supply_Delta_Entry, + pub utxo_amount: OverRangeUnderPattern17, + pub term: SeriesTree_Cohorts_Cohorts_Supply_Delta_Term, + pub type_: SeriesTree_Cohorts_Cohorts_Supply_Delta_Type, + pub addr_balance: OverRangeUnderPattern17, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AbsoluteRatePattern2::new(client.clone(), "supply_delta".to_string()), + age: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Supply_Delta_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Supply_Delta_Class::new(client.clone(), format!("{base_path}_class")), + entry: SeriesTree_Cohorts_Cohorts_Supply_Delta_Entry::new(client.clone(), format!("{base_path}_entry")), + utxo_amount: OverRangeUnderPattern17::new(client.clone(), "utxos".to_string()), + term: SeriesTree_Cohorts_Cohorts_Supply_Delta_Term::new(client.clone(), format!("{base_path}_term")), + type_: SeriesTree_Cohorts_Cohorts_Supply_Delta_Type::new(client.clone(), format!("{base_path}_type")), + addr_balance: OverRangeUnderPattern17::new(client.clone(), "addrs".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta_Age { + pub range: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Range { + pub under_1h: AbsoluteRatePattern2, + pub _1h_to_1d: AbsoluteRatePattern2, + pub _1d_to_1w: AbsoluteRatePattern2, + pub _1w_to_1m: AbsoluteRatePattern2, + pub _1m_to_2m: AbsoluteRatePattern2, + pub _2m_to_3m: AbsoluteRatePattern2, + pub _3m_to_4m: AbsoluteRatePattern2, + pub _4m_to_5m: AbsoluteRatePattern2, + pub _5m_to_6m: AbsoluteRatePattern2, + pub _6m_to_9m: AbsoluteRatePattern2, + pub _9m_to_1y: AbsoluteRatePattern2, + pub _1y_to_18m: AbsoluteRatePattern2, + pub _18m_to_2y: AbsoluteRatePattern2, + pub _2y_to_3y: AbsoluteRatePattern2, + pub _3y_to_4y: AbsoluteRatePattern2, + pub _4y_to_5y: AbsoluteRatePattern2, + pub _5y_to_6y: AbsoluteRatePattern2, + pub _6y_to_7y: AbsoluteRatePattern2, + pub _7y_to_8y: AbsoluteRatePattern2, + pub _8y_to_10y: AbsoluteRatePattern2, + pub _10y_to_12y: AbsoluteRatePattern2, + pub _12y_to_15y: AbsoluteRatePattern2, + pub over_15y: AbsoluteRatePattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: AbsoluteRatePattern2::new(client.clone(), "utxos_under_1h_old_supply_delta".to_string()), + _1h_to_1d: AbsoluteRatePattern2::new(client.clone(), "utxos_1h_to_1d_old_supply_delta".to_string()), + _1d_to_1w: AbsoluteRatePattern2::new(client.clone(), "utxos_1d_to_1w_old_supply_delta".to_string()), + _1w_to_1m: AbsoluteRatePattern2::new(client.clone(), "utxos_1w_to_1m_old_supply_delta".to_string()), + _1m_to_2m: AbsoluteRatePattern2::new(client.clone(), "utxos_1m_to_2m_old_supply_delta".to_string()), + _2m_to_3m: AbsoluteRatePattern2::new(client.clone(), "utxos_2m_to_3m_old_supply_delta".to_string()), + _3m_to_4m: AbsoluteRatePattern2::new(client.clone(), "utxos_3m_to_4m_old_supply_delta".to_string()), + _4m_to_5m: AbsoluteRatePattern2::new(client.clone(), "utxos_4m_to_5m_old_supply_delta".to_string()), + _5m_to_6m: AbsoluteRatePattern2::new(client.clone(), "utxos_5m_to_6m_old_supply_delta".to_string()), + _6m_to_9m: AbsoluteRatePattern2::new(client.clone(), "utxos_6m_to_9m_old_supply_delta".to_string()), + _9m_to_1y: AbsoluteRatePattern2::new(client.clone(), "utxos_9m_to_1y_old_supply_delta".to_string()), + _1y_to_18m: AbsoluteRatePattern2::new(client.clone(), "utxos_1y_to_18m_old_supply_delta".to_string()), + _18m_to_2y: AbsoluteRatePattern2::new(client.clone(), "utxos_18m_to_2y_old_supply_delta".to_string()), + _2y_to_3y: AbsoluteRatePattern2::new(client.clone(), "utxos_2y_to_3y_old_supply_delta".to_string()), + _3y_to_4y: AbsoluteRatePattern2::new(client.clone(), "utxos_3y_to_4y_old_supply_delta".to_string()), + _4y_to_5y: AbsoluteRatePattern2::new(client.clone(), "utxos_4y_to_5y_old_supply_delta".to_string()), + _5y_to_6y: AbsoluteRatePattern2::new(client.clone(), "utxos_5y_to_6y_old_supply_delta".to_string()), + _6y_to_7y: AbsoluteRatePattern2::new(client.clone(), "utxos_6y_to_7y_old_supply_delta".to_string()), + _7y_to_8y: AbsoluteRatePattern2::new(client.clone(), "utxos_7y_to_8y_old_supply_delta".to_string()), + _8y_to_10y: AbsoluteRatePattern2::new(client.clone(), "utxos_8y_to_10y_old_supply_delta".to_string()), + _10y_to_12y: AbsoluteRatePattern2::new(client.clone(), "utxos_10y_to_12y_old_supply_delta".to_string()), + _12y_to_15y: AbsoluteRatePattern2::new(client.clone(), "utxos_12y_to_15y_old_supply_delta".to_string()), + over_15y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_15y_old_supply_delta".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Under { + pub _1w: AbsoluteRatePattern2, + pub _1m: AbsoluteRatePattern2, + pub _2m: AbsoluteRatePattern2, + pub _3m: AbsoluteRatePattern2, + pub _4m: AbsoluteRatePattern2, + pub _5m: AbsoluteRatePattern2, + pub _6m: AbsoluteRatePattern2, + pub _9m: AbsoluteRatePattern2, + pub _1y: AbsoluteRatePattern2, + pub _18m: AbsoluteRatePattern2, + pub _2y: AbsoluteRatePattern2, + pub _3y: AbsoluteRatePattern2, + pub _4y: AbsoluteRatePattern2, + pub _5y: AbsoluteRatePattern2, + pub _6y: AbsoluteRatePattern2, + pub _7y: AbsoluteRatePattern2, + pub _8y: AbsoluteRatePattern2, + pub _10y: AbsoluteRatePattern2, + pub _12y: AbsoluteRatePattern2, + pub _15y: AbsoluteRatePattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: AbsoluteRatePattern2::new(client.clone(), "utxos_under_1w_old_supply_delta".to_string()), + _1m: AbsoluteRatePattern2::new(client.clone(), "utxos_under_1m_old_supply_delta".to_string()), + _2m: AbsoluteRatePattern2::new(client.clone(), "utxos_under_2m_old_supply_delta".to_string()), + _3m: AbsoluteRatePattern2::new(client.clone(), "utxos_under_3m_old_supply_delta".to_string()), + _4m: AbsoluteRatePattern2::new(client.clone(), "utxos_under_4m_old_supply_delta".to_string()), + _5m: AbsoluteRatePattern2::new(client.clone(), "utxos_under_5m_old_supply_delta".to_string()), + _6m: AbsoluteRatePattern2::new(client.clone(), "utxos_under_6m_old_supply_delta".to_string()), + _9m: AbsoluteRatePattern2::new(client.clone(), "utxos_under_9m_old_supply_delta".to_string()), + _1y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_1y_old_supply_delta".to_string()), + _18m: AbsoluteRatePattern2::new(client.clone(), "utxos_under_18m_old_supply_delta".to_string()), + _2y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_2y_old_supply_delta".to_string()), + _3y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_3y_old_supply_delta".to_string()), + _4y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_4y_old_supply_delta".to_string()), + _5y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_5y_old_supply_delta".to_string()), + _6y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_6y_old_supply_delta".to_string()), + _7y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_7y_old_supply_delta".to_string()), + _8y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_8y_old_supply_delta".to_string()), + _10y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_10y_old_supply_delta".to_string()), + _12y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_12y_old_supply_delta".to_string()), + _15y: AbsoluteRatePattern2::new(client.clone(), "utxos_under_15y_old_supply_delta".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Over { + pub _1d: AbsoluteRatePattern2, + pub _1w: AbsoluteRatePattern2, + pub _1m: AbsoluteRatePattern2, + pub _2m: AbsoluteRatePattern2, + pub _3m: AbsoluteRatePattern2, + pub _4m: AbsoluteRatePattern2, + pub _5m: AbsoluteRatePattern2, + pub _6m: AbsoluteRatePattern2, + pub _9m: AbsoluteRatePattern2, + pub _1y: AbsoluteRatePattern2, + pub _18m: AbsoluteRatePattern2, + pub _2y: AbsoluteRatePattern2, + pub _3y: AbsoluteRatePattern2, + pub _4y: AbsoluteRatePattern2, + pub _5y: AbsoluteRatePattern2, + pub _6y: AbsoluteRatePattern2, + pub _7y: AbsoluteRatePattern2, + pub _8y: AbsoluteRatePattern2, + pub _10y: AbsoluteRatePattern2, + pub _12y: AbsoluteRatePattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: AbsoluteRatePattern2::new(client.clone(), "utxos_over_1d_old_supply_delta".to_string()), + _1w: AbsoluteRatePattern2::new(client.clone(), "utxos_over_1w_old_supply_delta".to_string()), + _1m: AbsoluteRatePattern2::new(client.clone(), "utxos_over_1m_old_supply_delta".to_string()), + _2m: AbsoluteRatePattern2::new(client.clone(), "utxos_over_2m_old_supply_delta".to_string()), + _3m: AbsoluteRatePattern2::new(client.clone(), "utxos_over_3m_old_supply_delta".to_string()), + _4m: AbsoluteRatePattern2::new(client.clone(), "utxos_over_4m_old_supply_delta".to_string()), + _5m: AbsoluteRatePattern2::new(client.clone(), "utxos_over_5m_old_supply_delta".to_string()), + _6m: AbsoluteRatePattern2::new(client.clone(), "utxos_over_6m_old_supply_delta".to_string()), + _9m: AbsoluteRatePattern2::new(client.clone(), "utxos_over_9m_old_supply_delta".to_string()), + _1y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_1y_old_supply_delta".to_string()), + _18m: AbsoluteRatePattern2::new(client.clone(), "utxos_over_18m_old_supply_delta".to_string()), + _2y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_2y_old_supply_delta".to_string()), + _3y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_3y_old_supply_delta".to_string()), + _4y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_4y_old_supply_delta".to_string()), + _5y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_5y_old_supply_delta".to_string()), + _6y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_6y_old_supply_delta".to_string()), + _7y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_7y_old_supply_delta".to_string()), + _8y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_8y_old_supply_delta".to_string()), + _10y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_10y_old_supply_delta".to_string()), + _12y: AbsoluteRatePattern2::new(client.clone(), "utxos_over_12y_old_supply_delta".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta_Epoch { + pub _0: AbsoluteRatePattern2, + pub _1: AbsoluteRatePattern2, + pub _2: AbsoluteRatePattern2, + pub _3: AbsoluteRatePattern2, + pub _4: AbsoluteRatePattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: AbsoluteRatePattern2::new(client.clone(), "epoch_0_supply_delta".to_string()), + _1: AbsoluteRatePattern2::new(client.clone(), "epoch_1_supply_delta".to_string()), + _2: AbsoluteRatePattern2::new(client.clone(), "epoch_2_supply_delta".to_string()), + _3: AbsoluteRatePattern2::new(client.clone(), "epoch_3_supply_delta".to_string()), + _4: AbsoluteRatePattern2::new(client.clone(), "epoch_4_supply_delta".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta_Class { + pub _2009: AbsoluteRatePattern2, + pub _2010: AbsoluteRatePattern2, + pub _2011: AbsoluteRatePattern2, + pub _2012: AbsoluteRatePattern2, + pub _2013: AbsoluteRatePattern2, + pub _2014: AbsoluteRatePattern2, + pub _2015: AbsoluteRatePattern2, + pub _2016: AbsoluteRatePattern2, + pub _2017: AbsoluteRatePattern2, + pub _2018: AbsoluteRatePattern2, + pub _2019: AbsoluteRatePattern2, + pub _2020: AbsoluteRatePattern2, + pub _2021: AbsoluteRatePattern2, + pub _2022: AbsoluteRatePattern2, + pub _2023: AbsoluteRatePattern2, + pub _2024: AbsoluteRatePattern2, + pub _2025: AbsoluteRatePattern2, + pub _2026: AbsoluteRatePattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: AbsoluteRatePattern2::new(client.clone(), "class_2009_supply_delta".to_string()), + _2010: AbsoluteRatePattern2::new(client.clone(), "class_2010_supply_delta".to_string()), + _2011: AbsoluteRatePattern2::new(client.clone(), "class_2011_supply_delta".to_string()), + _2012: AbsoluteRatePattern2::new(client.clone(), "class_2012_supply_delta".to_string()), + _2013: AbsoluteRatePattern2::new(client.clone(), "class_2013_supply_delta".to_string()), + _2014: AbsoluteRatePattern2::new(client.clone(), "class_2014_supply_delta".to_string()), + _2015: AbsoluteRatePattern2::new(client.clone(), "class_2015_supply_delta".to_string()), + _2016: AbsoluteRatePattern2::new(client.clone(), "class_2016_supply_delta".to_string()), + _2017: AbsoluteRatePattern2::new(client.clone(), "class_2017_supply_delta".to_string()), + _2018: AbsoluteRatePattern2::new(client.clone(), "class_2018_supply_delta".to_string()), + _2019: AbsoluteRatePattern2::new(client.clone(), "class_2019_supply_delta".to_string()), + _2020: AbsoluteRatePattern2::new(client.clone(), "class_2020_supply_delta".to_string()), + _2021: AbsoluteRatePattern2::new(client.clone(), "class_2021_supply_delta".to_string()), + _2022: AbsoluteRatePattern2::new(client.clone(), "class_2022_supply_delta".to_string()), + _2023: AbsoluteRatePattern2::new(client.clone(), "class_2023_supply_delta".to_string()), + _2024: AbsoluteRatePattern2::new(client.clone(), "class_2024_supply_delta".to_string()), + _2025: AbsoluteRatePattern2::new(client.clone(), "class_2025_supply_delta".to_string()), + _2026: AbsoluteRatePattern2::new(client.clone(), "class_2026_supply_delta".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta_Entry { + pub discount: AbsoluteRatePattern2, + pub premium: AbsoluteRatePattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta_Entry { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: AbsoluteRatePattern2::new(client.clone(), "veteran_supply_delta".to_string()), + premium: AbsoluteRatePattern2::new(client.clone(), "rookie_supply_delta".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta_Term { + pub short: AbsoluteRatePattern2, + pub long: AbsoluteRatePattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta_Term { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: AbsoluteRatePattern2::new(client.clone(), "sth_supply_delta".to_string()), + long: AbsoluteRatePattern2::new(client.clone(), "lth_supply_delta".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Delta_Type { + pub p2pk65: AbsoluteRatePattern2, + pub p2pk33: AbsoluteRatePattern2, + pub p2pkh: AbsoluteRatePattern2, + pub p2ms: AbsoluteRatePattern2, + pub p2sh: AbsoluteRatePattern2, + pub p2wpkh: AbsoluteRatePattern2, + pub p2wsh: AbsoluteRatePattern2, + pub p2tr: AbsoluteRatePattern2, + pub p2a: AbsoluteRatePattern2, + pub unknown: AbsoluteRatePattern2, + pub empty: AbsoluteRatePattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Delta_Type { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + p2pk65: AbsoluteRatePattern2::new(client.clone(), "p2pk65_supply_delta".to_string()), + p2pk33: AbsoluteRatePattern2::new(client.clone(), "p2pk33_supply_delta".to_string()), + p2pkh: AbsoluteRatePattern2::new(client.clone(), "p2pkh_supply_delta".to_string()), + p2ms: AbsoluteRatePattern2::new(client.clone(), "p2ms_supply_delta".to_string()), + p2sh: AbsoluteRatePattern2::new(client.clone(), "p2sh_supply_delta".to_string()), + p2wpkh: AbsoluteRatePattern2::new(client.clone(), "p2wpkh_supply_delta".to_string()), + p2wsh: AbsoluteRatePattern2::new(client.clone(), "p2wsh_supply_delta".to_string()), + p2tr: AbsoluteRatePattern2::new(client.clone(), "p2tr_supply_delta".to_string()), + p2a: AbsoluteRatePattern2::new(client.clone(), "p2a_supply_delta".to_string()), + unknown: AbsoluteRatePattern2::new(client.clone(), "unknown_outputs_supply_delta".to_string()), + empty: AbsoluteRatePattern2::new(client.clone(), "empty_outputs_supply_delta".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance { + pub all: PercentPpmRatioPattern2, + pub age: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Class, + pub entry: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Entry, + pub utxo_amount: OverRangeUnderPattern19, + pub term: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Term, + pub type_: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Type, + pub addr_balance: OverRangeUnderPattern19, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: PercentPpmRatioPattern2::new(client.clone(), "supply_dominance".to_string()), + age: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Class::new(client.clone(), format!("{base_path}_class")), + entry: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Entry::new(client.clone(), format!("{base_path}_entry")), + utxo_amount: OverRangeUnderPattern19::new(client.clone(), "utxos".to_string()), + term: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Term::new(client.clone(), format!("{base_path}_term")), + type_: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Type::new(client.clone(), format!("{base_path}_type")), + addr_balance: OverRangeUnderPattern19::new(client.clone(), "addrs".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age { + pub range: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Range { + pub under_1h: PercentPpmRatioPattern2, + pub _1h_to_1d: PercentPpmRatioPattern2, + pub _1d_to_1w: PercentPpmRatioPattern2, + pub _1w_to_1m: PercentPpmRatioPattern2, + pub _1m_to_2m: PercentPpmRatioPattern2, + pub _2m_to_3m: PercentPpmRatioPattern2, + pub _3m_to_4m: PercentPpmRatioPattern2, + pub _4m_to_5m: PercentPpmRatioPattern2, + pub _5m_to_6m: PercentPpmRatioPattern2, + pub _6m_to_9m: PercentPpmRatioPattern2, + pub _9m_to_1y: PercentPpmRatioPattern2, + pub _1y_to_18m: PercentPpmRatioPattern2, + pub _18m_to_2y: PercentPpmRatioPattern2, + pub _2y_to_3y: PercentPpmRatioPattern2, + pub _3y_to_4y: PercentPpmRatioPattern2, + pub _4y_to_5y: PercentPpmRatioPattern2, + pub _5y_to_6y: PercentPpmRatioPattern2, + pub _6y_to_7y: PercentPpmRatioPattern2, + pub _7y_to_8y: PercentPpmRatioPattern2, + pub _8y_to_10y: PercentPpmRatioPattern2, + pub _10y_to_12y: PercentPpmRatioPattern2, + pub _12y_to_15y: PercentPpmRatioPattern2, + pub over_15y: PercentPpmRatioPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_1h_old_supply_dominance".to_string()), + _1h_to_1d: PercentPpmRatioPattern2::new(client.clone(), "utxos_1h_to_1d_old_supply_dominance".to_string()), + _1d_to_1w: PercentPpmRatioPattern2::new(client.clone(), "utxos_1d_to_1w_old_supply_dominance".to_string()), + _1w_to_1m: PercentPpmRatioPattern2::new(client.clone(), "utxos_1w_to_1m_old_supply_dominance".to_string()), + _1m_to_2m: PercentPpmRatioPattern2::new(client.clone(), "utxos_1m_to_2m_old_supply_dominance".to_string()), + _2m_to_3m: PercentPpmRatioPattern2::new(client.clone(), "utxos_2m_to_3m_old_supply_dominance".to_string()), + _3m_to_4m: PercentPpmRatioPattern2::new(client.clone(), "utxos_3m_to_4m_old_supply_dominance".to_string()), + _4m_to_5m: PercentPpmRatioPattern2::new(client.clone(), "utxos_4m_to_5m_old_supply_dominance".to_string()), + _5m_to_6m: PercentPpmRatioPattern2::new(client.clone(), "utxos_5m_to_6m_old_supply_dominance".to_string()), + _6m_to_9m: PercentPpmRatioPattern2::new(client.clone(), "utxos_6m_to_9m_old_supply_dominance".to_string()), + _9m_to_1y: PercentPpmRatioPattern2::new(client.clone(), "utxos_9m_to_1y_old_supply_dominance".to_string()), + _1y_to_18m: PercentPpmRatioPattern2::new(client.clone(), "utxos_1y_to_18m_old_supply_dominance".to_string()), + _18m_to_2y: PercentPpmRatioPattern2::new(client.clone(), "utxos_18m_to_2y_old_supply_dominance".to_string()), + _2y_to_3y: PercentPpmRatioPattern2::new(client.clone(), "utxos_2y_to_3y_old_supply_dominance".to_string()), + _3y_to_4y: PercentPpmRatioPattern2::new(client.clone(), "utxos_3y_to_4y_old_supply_dominance".to_string()), + _4y_to_5y: PercentPpmRatioPattern2::new(client.clone(), "utxos_4y_to_5y_old_supply_dominance".to_string()), + _5y_to_6y: PercentPpmRatioPattern2::new(client.clone(), "utxos_5y_to_6y_old_supply_dominance".to_string()), + _6y_to_7y: PercentPpmRatioPattern2::new(client.clone(), "utxos_6y_to_7y_old_supply_dominance".to_string()), + _7y_to_8y: PercentPpmRatioPattern2::new(client.clone(), "utxos_7y_to_8y_old_supply_dominance".to_string()), + _8y_to_10y: PercentPpmRatioPattern2::new(client.clone(), "utxos_8y_to_10y_old_supply_dominance".to_string()), + _10y_to_12y: PercentPpmRatioPattern2::new(client.clone(), "utxos_10y_to_12y_old_supply_dominance".to_string()), + _12y_to_15y: PercentPpmRatioPattern2::new(client.clone(), "utxos_12y_to_15y_old_supply_dominance".to_string()), + over_15y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_15y_old_supply_dominance".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Under { + pub _1w: PercentPpmRatioPattern2, + pub _1m: PercentPpmRatioPattern2, + pub _2m: PercentPpmRatioPattern2, + pub _3m: PercentPpmRatioPattern2, + pub _4m: PercentPpmRatioPattern2, + pub _5m: PercentPpmRatioPattern2, + pub _6m: PercentPpmRatioPattern2, + pub _9m: PercentPpmRatioPattern2, + pub _1y: PercentPpmRatioPattern2, + pub _18m: PercentPpmRatioPattern2, + pub _2y: PercentPpmRatioPattern2, + pub _3y: PercentPpmRatioPattern2, + pub _4y: PercentPpmRatioPattern2, + pub _5y: PercentPpmRatioPattern2, + pub _6y: PercentPpmRatioPattern2, + pub _7y: PercentPpmRatioPattern2, + pub _8y: PercentPpmRatioPattern2, + pub _10y: PercentPpmRatioPattern2, + pub _12y: PercentPpmRatioPattern2, + pub _15y: PercentPpmRatioPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_1w_old_supply_dominance".to_string()), + _1m: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_1m_old_supply_dominance".to_string()), + _2m: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_2m_old_supply_dominance".to_string()), + _3m: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_3m_old_supply_dominance".to_string()), + _4m: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_4m_old_supply_dominance".to_string()), + _5m: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_5m_old_supply_dominance".to_string()), + _6m: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_6m_old_supply_dominance".to_string()), + _9m: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_9m_old_supply_dominance".to_string()), + _1y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_1y_old_supply_dominance".to_string()), + _18m: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_18m_old_supply_dominance".to_string()), + _2y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_2y_old_supply_dominance".to_string()), + _3y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_3y_old_supply_dominance".to_string()), + _4y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_4y_old_supply_dominance".to_string()), + _5y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_5y_old_supply_dominance".to_string()), + _6y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_6y_old_supply_dominance".to_string()), + _7y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_7y_old_supply_dominance".to_string()), + _8y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_8y_old_supply_dominance".to_string()), + _10y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_10y_old_supply_dominance".to_string()), + _12y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_12y_old_supply_dominance".to_string()), + _15y: PercentPpmRatioPattern2::new(client.clone(), "utxos_under_15y_old_supply_dominance".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Over { + pub _1d: PercentPpmRatioPattern2, + pub _1w: PercentPpmRatioPattern2, + pub _1m: PercentPpmRatioPattern2, + pub _2m: PercentPpmRatioPattern2, + pub _3m: PercentPpmRatioPattern2, + pub _4m: PercentPpmRatioPattern2, + pub _5m: PercentPpmRatioPattern2, + pub _6m: PercentPpmRatioPattern2, + pub _9m: PercentPpmRatioPattern2, + pub _1y: PercentPpmRatioPattern2, + pub _18m: PercentPpmRatioPattern2, + pub _2y: PercentPpmRatioPattern2, + pub _3y: PercentPpmRatioPattern2, + pub _4y: PercentPpmRatioPattern2, + pub _5y: PercentPpmRatioPattern2, + pub _6y: PercentPpmRatioPattern2, + pub _7y: PercentPpmRatioPattern2, + pub _8y: PercentPpmRatioPattern2, + pub _10y: PercentPpmRatioPattern2, + pub _12y: PercentPpmRatioPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_1d_old_supply_dominance".to_string()), + _1w: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_1w_old_supply_dominance".to_string()), + _1m: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_1m_old_supply_dominance".to_string()), + _2m: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_2m_old_supply_dominance".to_string()), + _3m: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_3m_old_supply_dominance".to_string()), + _4m: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_4m_old_supply_dominance".to_string()), + _5m: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_5m_old_supply_dominance".to_string()), + _6m: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_6m_old_supply_dominance".to_string()), + _9m: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_9m_old_supply_dominance".to_string()), + _1y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_1y_old_supply_dominance".to_string()), + _18m: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_18m_old_supply_dominance".to_string()), + _2y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_2y_old_supply_dominance".to_string()), + _3y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_3y_old_supply_dominance".to_string()), + _4y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_4y_old_supply_dominance".to_string()), + _5y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_5y_old_supply_dominance".to_string()), + _6y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_6y_old_supply_dominance".to_string()), + _7y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_7y_old_supply_dominance".to_string()), + _8y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_8y_old_supply_dominance".to_string()), + _10y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_10y_old_supply_dominance".to_string()), + _12y: PercentPpmRatioPattern2::new(client.clone(), "utxos_over_12y_old_supply_dominance".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance_Epoch { + pub _0: PercentPpmRatioPattern2, + pub _1: PercentPpmRatioPattern2, + pub _2: PercentPpmRatioPattern2, + pub _3: PercentPpmRatioPattern2, + pub _4: PercentPpmRatioPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: PercentPpmRatioPattern2::new(client.clone(), "epoch_0_supply_dominance".to_string()), + _1: PercentPpmRatioPattern2::new(client.clone(), "epoch_1_supply_dominance".to_string()), + _2: PercentPpmRatioPattern2::new(client.clone(), "epoch_2_supply_dominance".to_string()), + _3: PercentPpmRatioPattern2::new(client.clone(), "epoch_3_supply_dominance".to_string()), + _4: PercentPpmRatioPattern2::new(client.clone(), "epoch_4_supply_dominance".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance_Class { + pub _2009: PercentPpmRatioPattern2, + pub _2010: PercentPpmRatioPattern2, + pub _2011: PercentPpmRatioPattern2, + pub _2012: PercentPpmRatioPattern2, + pub _2013: PercentPpmRatioPattern2, + pub _2014: PercentPpmRatioPattern2, + pub _2015: PercentPpmRatioPattern2, + pub _2016: PercentPpmRatioPattern2, + pub _2017: PercentPpmRatioPattern2, + pub _2018: PercentPpmRatioPattern2, + pub _2019: PercentPpmRatioPattern2, + pub _2020: PercentPpmRatioPattern2, + pub _2021: PercentPpmRatioPattern2, + pub _2022: PercentPpmRatioPattern2, + pub _2023: PercentPpmRatioPattern2, + pub _2024: PercentPpmRatioPattern2, + pub _2025: PercentPpmRatioPattern2, + pub _2026: PercentPpmRatioPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: PercentPpmRatioPattern2::new(client.clone(), "class_2009_supply_dominance".to_string()), + _2010: PercentPpmRatioPattern2::new(client.clone(), "class_2010_supply_dominance".to_string()), + _2011: PercentPpmRatioPattern2::new(client.clone(), "class_2011_supply_dominance".to_string()), + _2012: PercentPpmRatioPattern2::new(client.clone(), "class_2012_supply_dominance".to_string()), + _2013: PercentPpmRatioPattern2::new(client.clone(), "class_2013_supply_dominance".to_string()), + _2014: PercentPpmRatioPattern2::new(client.clone(), "class_2014_supply_dominance".to_string()), + _2015: PercentPpmRatioPattern2::new(client.clone(), "class_2015_supply_dominance".to_string()), + _2016: PercentPpmRatioPattern2::new(client.clone(), "class_2016_supply_dominance".to_string()), + _2017: PercentPpmRatioPattern2::new(client.clone(), "class_2017_supply_dominance".to_string()), + _2018: PercentPpmRatioPattern2::new(client.clone(), "class_2018_supply_dominance".to_string()), + _2019: PercentPpmRatioPattern2::new(client.clone(), "class_2019_supply_dominance".to_string()), + _2020: PercentPpmRatioPattern2::new(client.clone(), "class_2020_supply_dominance".to_string()), + _2021: PercentPpmRatioPattern2::new(client.clone(), "class_2021_supply_dominance".to_string()), + _2022: PercentPpmRatioPattern2::new(client.clone(), "class_2022_supply_dominance".to_string()), + _2023: PercentPpmRatioPattern2::new(client.clone(), "class_2023_supply_dominance".to_string()), + _2024: PercentPpmRatioPattern2::new(client.clone(), "class_2024_supply_dominance".to_string()), + _2025: PercentPpmRatioPattern2::new(client.clone(), "class_2025_supply_dominance".to_string()), + _2026: PercentPpmRatioPattern2::new(client.clone(), "class_2026_supply_dominance".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance_Entry { + pub discount: PercentPpmRatioPattern2, + pub premium: PercentPpmRatioPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance_Entry { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: PercentPpmRatioPattern2::new(client.clone(), "veteran_supply_dominance".to_string()), + premium: PercentPpmRatioPattern2::new(client.clone(), "rookie_supply_dominance".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance_Term { + pub short: PercentPpmRatioPattern2, + pub long: PercentPpmRatioPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance_Term { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: PercentPpmRatioPattern2::new(client.clone(), "sth_supply_dominance".to_string()), + long: PercentPpmRatioPattern2::new(client.clone(), "lth_supply_dominance".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Supply_Dominance_Type { + pub p2pk65: PercentPpmRatioPattern2, + pub p2pk33: PercentPpmRatioPattern2, + pub p2pkh: PercentPpmRatioPattern2, + pub p2ms: PercentPpmRatioPattern2, + pub p2sh: PercentPpmRatioPattern2, + pub p2wpkh: PercentPpmRatioPattern2, + pub p2wsh: PercentPpmRatioPattern2, + pub p2tr: PercentPpmRatioPattern2, + pub p2a: PercentPpmRatioPattern2, + pub unknown: PercentPpmRatioPattern2, + pub empty: PercentPpmRatioPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Supply_Dominance_Type { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + p2pk65: PercentPpmRatioPattern2::new(client.clone(), "p2pk65_supply_dominance".to_string()), + p2pk33: PercentPpmRatioPattern2::new(client.clone(), "p2pk33_supply_dominance".to_string()), + p2pkh: PercentPpmRatioPattern2::new(client.clone(), "p2pkh_supply_dominance".to_string()), + p2ms: PercentPpmRatioPattern2::new(client.clone(), "p2ms_supply_dominance".to_string()), + p2sh: PercentPpmRatioPattern2::new(client.clone(), "p2sh_supply_dominance".to_string()), + p2wpkh: PercentPpmRatioPattern2::new(client.clone(), "p2wpkh_supply_dominance".to_string()), + p2wsh: PercentPpmRatioPattern2::new(client.clone(), "p2wsh_supply_dominance".to_string()), + p2tr: PercentPpmRatioPattern2::new(client.clone(), "p2tr_supply_dominance".to_string()), + p2a: PercentPpmRatioPattern2::new(client.clone(), "p2a_supply_dominance".to_string()), + unknown: PercentPpmRatioPattern2::new(client.clone(), "unknown_outputs_supply_dominance".to_string()), + empty: PercentPpmRatioPattern2::new(client.clone(), "empty_outputs_supply_dominance".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs { + pub unspent_count: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount, + pub spent_count: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + unspent_count: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount::new(client.clone(), format!("{base_path}_unspent_count")), + spent_count: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount::new(client.clone(), format!("{base_path}_spent_count")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount { + pub all: BaseDeltaPattern, + pub age: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Class, + pub entry: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Entry, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount, + pub term: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Term, + pub type_: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Type, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, + pub amount_range_matrix: SeriesPattern18, + pub addr_balance: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BaseDeltaPattern::new(client.clone(), "utxo_count".to_string()), + age: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Class::new(client.clone(), format!("{base_path}_class")), + entry: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Entry::new(client.clone(), format!("{base_path}_entry")), + utxo_amount: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Term::new(client.clone(), format!("{base_path}_term")), + type_: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Type::new(client.clone(), format!("{base_path}_type")), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_utxo_count_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "utxo_count_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "utxo_count_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "utxo_count_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "utxo_count_by_type".to_string()), + amount_range_matrix: SeriesPattern18::new(client.clone(), "utxos_utxo_count_by_amount_range".to_string()), + addr_balance: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance::new(client.clone(), format!("{base_path}_addr_balance")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age { + pub range: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Range { + pub under_1h: BaseDeltaPattern, + pub _1h_to_1d: BaseDeltaPattern, + pub _1d_to_1w: BaseDeltaPattern, + pub _1w_to_1m: BaseDeltaPattern, + pub _1m_to_2m: BaseDeltaPattern, + pub _2m_to_3m: BaseDeltaPattern, + pub _3m_to_4m: BaseDeltaPattern, + pub _4m_to_5m: BaseDeltaPattern, + pub _5m_to_6m: BaseDeltaPattern, + pub _6m_to_9m: BaseDeltaPattern, + pub _9m_to_1y: BaseDeltaPattern, + pub _1y_to_18m: BaseDeltaPattern, + pub _18m_to_2y: BaseDeltaPattern, + pub _2y_to_3y: BaseDeltaPattern, + pub _3y_to_4y: BaseDeltaPattern, + pub _4y_to_5y: BaseDeltaPattern, + pub _5y_to_6y: BaseDeltaPattern, + pub _6y_to_7y: BaseDeltaPattern, + pub _7y_to_8y: BaseDeltaPattern, + pub _8y_to_10y: BaseDeltaPattern, + pub _10y_to_12y: BaseDeltaPattern, + pub _12y_to_15y: BaseDeltaPattern, + pub over_15y: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: BaseDeltaPattern::new(client.clone(), "utxos_under_1h_old_utxo_count".to_string()), + _1h_to_1d: BaseDeltaPattern::new(client.clone(), "utxos_1h_to_1d_old_utxo_count".to_string()), + _1d_to_1w: BaseDeltaPattern::new(client.clone(), "utxos_1d_to_1w_old_utxo_count".to_string()), + _1w_to_1m: BaseDeltaPattern::new(client.clone(), "utxos_1w_to_1m_old_utxo_count".to_string()), + _1m_to_2m: BaseDeltaPattern::new(client.clone(), "utxos_1m_to_2m_old_utxo_count".to_string()), + _2m_to_3m: BaseDeltaPattern::new(client.clone(), "utxos_2m_to_3m_old_utxo_count".to_string()), + _3m_to_4m: BaseDeltaPattern::new(client.clone(), "utxos_3m_to_4m_old_utxo_count".to_string()), + _4m_to_5m: BaseDeltaPattern::new(client.clone(), "utxos_4m_to_5m_old_utxo_count".to_string()), + _5m_to_6m: BaseDeltaPattern::new(client.clone(), "utxos_5m_to_6m_old_utxo_count".to_string()), + _6m_to_9m: BaseDeltaPattern::new(client.clone(), "utxos_6m_to_9m_old_utxo_count".to_string()), + _9m_to_1y: BaseDeltaPattern::new(client.clone(), "utxos_9m_to_1y_old_utxo_count".to_string()), + _1y_to_18m: BaseDeltaPattern::new(client.clone(), "utxos_1y_to_18m_old_utxo_count".to_string()), + _18m_to_2y: BaseDeltaPattern::new(client.clone(), "utxos_18m_to_2y_old_utxo_count".to_string()), + _2y_to_3y: BaseDeltaPattern::new(client.clone(), "utxos_2y_to_3y_old_utxo_count".to_string()), + _3y_to_4y: BaseDeltaPattern::new(client.clone(), "utxos_3y_to_4y_old_utxo_count".to_string()), + _4y_to_5y: BaseDeltaPattern::new(client.clone(), "utxos_4y_to_5y_old_utxo_count".to_string()), + _5y_to_6y: BaseDeltaPattern::new(client.clone(), "utxos_5y_to_6y_old_utxo_count".to_string()), + _6y_to_7y: BaseDeltaPattern::new(client.clone(), "utxos_6y_to_7y_old_utxo_count".to_string()), + _7y_to_8y: BaseDeltaPattern::new(client.clone(), "utxos_7y_to_8y_old_utxo_count".to_string()), + _8y_to_10y: BaseDeltaPattern::new(client.clone(), "utxos_8y_to_10y_old_utxo_count".to_string()), + _10y_to_12y: BaseDeltaPattern::new(client.clone(), "utxos_10y_to_12y_old_utxo_count".to_string()), + _12y_to_15y: BaseDeltaPattern::new(client.clone(), "utxos_12y_to_15y_old_utxo_count".to_string()), + over_15y: BaseDeltaPattern::new(client.clone(), "utxos_over_15y_old_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Under { + pub _1w: BaseDeltaPattern, + pub _1m: BaseDeltaPattern, + pub _2m: BaseDeltaPattern, + pub _3m: BaseDeltaPattern, + pub _4m: BaseDeltaPattern, + pub _5m: BaseDeltaPattern, + pub _6m: BaseDeltaPattern, + pub _9m: BaseDeltaPattern, + pub _1y: BaseDeltaPattern, + pub _18m: BaseDeltaPattern, + pub _2y: BaseDeltaPattern, + pub _3y: BaseDeltaPattern, + pub _4y: BaseDeltaPattern, + pub _5y: BaseDeltaPattern, + pub _6y: BaseDeltaPattern, + pub _7y: BaseDeltaPattern, + pub _8y: BaseDeltaPattern, + pub _10y: BaseDeltaPattern, + pub _12y: BaseDeltaPattern, + pub _15y: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: BaseDeltaPattern::new(client.clone(), "utxos_under_1w_old_utxo_count".to_string()), + _1m: BaseDeltaPattern::new(client.clone(), "utxos_under_1m_old_utxo_count".to_string()), + _2m: BaseDeltaPattern::new(client.clone(), "utxos_under_2m_old_utxo_count".to_string()), + _3m: BaseDeltaPattern::new(client.clone(), "utxos_under_3m_old_utxo_count".to_string()), + _4m: BaseDeltaPattern::new(client.clone(), "utxos_under_4m_old_utxo_count".to_string()), + _5m: BaseDeltaPattern::new(client.clone(), "utxos_under_5m_old_utxo_count".to_string()), + _6m: BaseDeltaPattern::new(client.clone(), "utxos_under_6m_old_utxo_count".to_string()), + _9m: BaseDeltaPattern::new(client.clone(), "utxos_under_9m_old_utxo_count".to_string()), + _1y: BaseDeltaPattern::new(client.clone(), "utxos_under_1y_old_utxo_count".to_string()), + _18m: BaseDeltaPattern::new(client.clone(), "utxos_under_18m_old_utxo_count".to_string()), + _2y: BaseDeltaPattern::new(client.clone(), "utxos_under_2y_old_utxo_count".to_string()), + _3y: BaseDeltaPattern::new(client.clone(), "utxos_under_3y_old_utxo_count".to_string()), + _4y: BaseDeltaPattern::new(client.clone(), "utxos_under_4y_old_utxo_count".to_string()), + _5y: BaseDeltaPattern::new(client.clone(), "utxos_under_5y_old_utxo_count".to_string()), + _6y: BaseDeltaPattern::new(client.clone(), "utxos_under_6y_old_utxo_count".to_string()), + _7y: BaseDeltaPattern::new(client.clone(), "utxos_under_7y_old_utxo_count".to_string()), + _8y: BaseDeltaPattern::new(client.clone(), "utxos_under_8y_old_utxo_count".to_string()), + _10y: BaseDeltaPattern::new(client.clone(), "utxos_under_10y_old_utxo_count".to_string()), + _12y: BaseDeltaPattern::new(client.clone(), "utxos_under_12y_old_utxo_count".to_string()), + _15y: BaseDeltaPattern::new(client.clone(), "utxos_under_15y_old_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Over { + pub _1d: BaseDeltaPattern, + pub _1w: BaseDeltaPattern, + pub _1m: BaseDeltaPattern, + pub _2m: BaseDeltaPattern, + pub _3m: BaseDeltaPattern, + pub _4m: BaseDeltaPattern, + pub _5m: BaseDeltaPattern, + pub _6m: BaseDeltaPattern, + pub _9m: BaseDeltaPattern, + pub _1y: BaseDeltaPattern, + pub _18m: BaseDeltaPattern, + pub _2y: BaseDeltaPattern, + pub _3y: BaseDeltaPattern, + pub _4y: BaseDeltaPattern, + pub _5y: BaseDeltaPattern, + pub _6y: BaseDeltaPattern, + pub _7y: BaseDeltaPattern, + pub _8y: BaseDeltaPattern, + pub _10y: BaseDeltaPattern, + pub _12y: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: BaseDeltaPattern::new(client.clone(), "utxos_over_1d_old_utxo_count".to_string()), + _1w: BaseDeltaPattern::new(client.clone(), "utxos_over_1w_old_utxo_count".to_string()), + _1m: BaseDeltaPattern::new(client.clone(), "utxos_over_1m_old_utxo_count".to_string()), + _2m: BaseDeltaPattern::new(client.clone(), "utxos_over_2m_old_utxo_count".to_string()), + _3m: BaseDeltaPattern::new(client.clone(), "utxos_over_3m_old_utxo_count".to_string()), + _4m: BaseDeltaPattern::new(client.clone(), "utxos_over_4m_old_utxo_count".to_string()), + _5m: BaseDeltaPattern::new(client.clone(), "utxos_over_5m_old_utxo_count".to_string()), + _6m: BaseDeltaPattern::new(client.clone(), "utxos_over_6m_old_utxo_count".to_string()), + _9m: BaseDeltaPattern::new(client.clone(), "utxos_over_9m_old_utxo_count".to_string()), + _1y: BaseDeltaPattern::new(client.clone(), "utxos_over_1y_old_utxo_count".to_string()), + _18m: BaseDeltaPattern::new(client.clone(), "utxos_over_18m_old_utxo_count".to_string()), + _2y: BaseDeltaPattern::new(client.clone(), "utxos_over_2y_old_utxo_count".to_string()), + _3y: BaseDeltaPattern::new(client.clone(), "utxos_over_3y_old_utxo_count".to_string()), + _4y: BaseDeltaPattern::new(client.clone(), "utxos_over_4y_old_utxo_count".to_string()), + _5y: BaseDeltaPattern::new(client.clone(), "utxos_over_5y_old_utxo_count".to_string()), + _6y: BaseDeltaPattern::new(client.clone(), "utxos_over_6y_old_utxo_count".to_string()), + _7y: BaseDeltaPattern::new(client.clone(), "utxos_over_7y_old_utxo_count".to_string()), + _8y: BaseDeltaPattern::new(client.clone(), "utxos_over_8y_old_utxo_count".to_string()), + _10y: BaseDeltaPattern::new(client.clone(), "utxos_over_10y_old_utxo_count".to_string()), + _12y: BaseDeltaPattern::new(client.clone(), "utxos_over_12y_old_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Epoch { + pub _0: BaseDeltaPattern, + pub _1: BaseDeltaPattern, + pub _2: BaseDeltaPattern, + pub _3: BaseDeltaPattern, + pub _4: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: BaseDeltaPattern::new(client.clone(), "epoch_0_utxo_count".to_string()), + _1: BaseDeltaPattern::new(client.clone(), "epoch_1_utxo_count".to_string()), + _2: BaseDeltaPattern::new(client.clone(), "epoch_2_utxo_count".to_string()), + _3: BaseDeltaPattern::new(client.clone(), "epoch_3_utxo_count".to_string()), + _4: BaseDeltaPattern::new(client.clone(), "epoch_4_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Class { + pub _2009: BaseDeltaPattern, + pub _2010: BaseDeltaPattern, + pub _2011: BaseDeltaPattern, + pub _2012: BaseDeltaPattern, + pub _2013: BaseDeltaPattern, + pub _2014: BaseDeltaPattern, + pub _2015: BaseDeltaPattern, + pub _2016: BaseDeltaPattern, + pub _2017: BaseDeltaPattern, + pub _2018: BaseDeltaPattern, + pub _2019: BaseDeltaPattern, + pub _2020: BaseDeltaPattern, + pub _2021: BaseDeltaPattern, + pub _2022: BaseDeltaPattern, + pub _2023: BaseDeltaPattern, + pub _2024: BaseDeltaPattern, + pub _2025: BaseDeltaPattern, + pub _2026: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: BaseDeltaPattern::new(client.clone(), "class_2009_utxo_count".to_string()), + _2010: BaseDeltaPattern::new(client.clone(), "class_2010_utxo_count".to_string()), + _2011: BaseDeltaPattern::new(client.clone(), "class_2011_utxo_count".to_string()), + _2012: BaseDeltaPattern::new(client.clone(), "class_2012_utxo_count".to_string()), + _2013: BaseDeltaPattern::new(client.clone(), "class_2013_utxo_count".to_string()), + _2014: BaseDeltaPattern::new(client.clone(), "class_2014_utxo_count".to_string()), + _2015: BaseDeltaPattern::new(client.clone(), "class_2015_utxo_count".to_string()), + _2016: BaseDeltaPattern::new(client.clone(), "class_2016_utxo_count".to_string()), + _2017: BaseDeltaPattern::new(client.clone(), "class_2017_utxo_count".to_string()), + _2018: BaseDeltaPattern::new(client.clone(), "class_2018_utxo_count".to_string()), + _2019: BaseDeltaPattern::new(client.clone(), "class_2019_utxo_count".to_string()), + _2020: BaseDeltaPattern::new(client.clone(), "class_2020_utxo_count".to_string()), + _2021: BaseDeltaPattern::new(client.clone(), "class_2021_utxo_count".to_string()), + _2022: BaseDeltaPattern::new(client.clone(), "class_2022_utxo_count".to_string()), + _2023: BaseDeltaPattern::new(client.clone(), "class_2023_utxo_count".to_string()), + _2024: BaseDeltaPattern::new(client.clone(), "class_2024_utxo_count".to_string()), + _2025: BaseDeltaPattern::new(client.clone(), "class_2025_utxo_count".to_string()), + _2026: BaseDeltaPattern::new(client.clone(), "class_2026_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Entry { + pub discount: BaseDeltaPattern, + pub premium: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Entry { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: BaseDeltaPattern::new(client.clone(), "veteran_utxo_count".to_string()), + premium: BaseDeltaPattern::new(client.clone(), "rookie_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount { + pub range: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Range, + pub under: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Under, + pub over: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Range { + pub _0sats: BaseDeltaPattern, + pub _1sat_to_10sats: BaseDeltaPattern, + pub _10sats_to_100sats: BaseDeltaPattern, + pub _100sats_to_1k_sats: BaseDeltaPattern, + pub _1k_sats_to_10k_sats: BaseDeltaPattern, + pub _10k_sats_to_100k_sats: BaseDeltaPattern, + pub _100k_sats_to_1m_sats: BaseDeltaPattern, + pub _1m_sats_to_10m_sats: BaseDeltaPattern, + pub _10m_sats_to_1btc: BaseDeltaPattern, + pub _1btc_to_10btc: BaseDeltaPattern, + pub _10btc_to_100btc: BaseDeltaPattern, + pub _100btc_to_1k_btc: BaseDeltaPattern, + pub _1k_btc_to_10k_btc: BaseDeltaPattern, + pub _10k_btc_to_100k_btc: BaseDeltaPattern, + pub over_100k_btc: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: BaseDeltaPattern::new(client.clone(), "utxos_0sats_utxo_count".to_string()), + _1sat_to_10sats: BaseDeltaPattern::new(client.clone(), "utxos_1sat_to_10sats_utxo_count".to_string()), + _10sats_to_100sats: BaseDeltaPattern::new(client.clone(), "utxos_10sats_to_100sats_utxo_count".to_string()), + _100sats_to_1k_sats: BaseDeltaPattern::new(client.clone(), "utxos_100sats_to_1k_sats_utxo_count".to_string()), + _1k_sats_to_10k_sats: BaseDeltaPattern::new(client.clone(), "utxos_1k_sats_to_10k_sats_utxo_count".to_string()), + _10k_sats_to_100k_sats: BaseDeltaPattern::new(client.clone(), "utxos_10k_sats_to_100k_sats_utxo_count".to_string()), + _100k_sats_to_1m_sats: BaseDeltaPattern::new(client.clone(), "utxos_100k_sats_to_1m_sats_utxo_count".to_string()), + _1m_sats_to_10m_sats: BaseDeltaPattern::new(client.clone(), "utxos_1m_sats_to_10m_sats_utxo_count".to_string()), + _10m_sats_to_1btc: BaseDeltaPattern::new(client.clone(), "utxos_10m_sats_to_1btc_utxo_count".to_string()), + _1btc_to_10btc: BaseDeltaPattern::new(client.clone(), "utxos_1btc_to_10btc_utxo_count".to_string()), + _10btc_to_100btc: BaseDeltaPattern::new(client.clone(), "utxos_10btc_to_100btc_utxo_count".to_string()), + _100btc_to_1k_btc: BaseDeltaPattern::new(client.clone(), "utxos_100btc_to_1k_btc_utxo_count".to_string()), + _1k_btc_to_10k_btc: BaseDeltaPattern::new(client.clone(), "utxos_1k_btc_to_10k_btc_utxo_count".to_string()), + _10k_btc_to_100k_btc: BaseDeltaPattern::new(client.clone(), "utxos_10k_btc_to_100k_btc_utxo_count".to_string()), + over_100k_btc: BaseDeltaPattern::new(client.clone(), "utxos_over_100k_btc_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Under { + pub _10sats: BaseDeltaPattern, + pub _100sats: BaseDeltaPattern, + pub _1k_sats: BaseDeltaPattern, + pub _10k_sats: BaseDeltaPattern, + pub _100k_sats: BaseDeltaPattern, + pub _1m_sats: BaseDeltaPattern, + pub _10m_sats: BaseDeltaPattern, + pub _1btc: BaseDeltaPattern, + pub _10btc: BaseDeltaPattern, + pub _100btc: BaseDeltaPattern, + pub _1k_btc: BaseDeltaPattern, + pub _10k_btc: BaseDeltaPattern, + pub _100k_btc: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: BaseDeltaPattern::new(client.clone(), "utxos_under_10sats_utxo_count".to_string()), + _100sats: BaseDeltaPattern::new(client.clone(), "utxos_under_100sats_utxo_count".to_string()), + _1k_sats: BaseDeltaPattern::new(client.clone(), "utxos_under_1k_sats_utxo_count".to_string()), + _10k_sats: BaseDeltaPattern::new(client.clone(), "utxos_under_10k_sats_utxo_count".to_string()), + _100k_sats: BaseDeltaPattern::new(client.clone(), "utxos_under_100k_sats_utxo_count".to_string()), + _1m_sats: BaseDeltaPattern::new(client.clone(), "utxos_under_1m_sats_utxo_count".to_string()), + _10m_sats: BaseDeltaPattern::new(client.clone(), "utxos_under_10m_sats_utxo_count".to_string()), + _1btc: BaseDeltaPattern::new(client.clone(), "utxos_under_1btc_utxo_count".to_string()), + _10btc: BaseDeltaPattern::new(client.clone(), "utxos_under_10btc_utxo_count".to_string()), + _100btc: BaseDeltaPattern::new(client.clone(), "utxos_under_100btc_utxo_count".to_string()), + _1k_btc: BaseDeltaPattern::new(client.clone(), "utxos_under_1k_btc_utxo_count".to_string()), + _10k_btc: BaseDeltaPattern::new(client.clone(), "utxos_under_10k_btc_utxo_count".to_string()), + _100k_btc: BaseDeltaPattern::new(client.clone(), "utxos_under_100k_btc_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Over { + pub _1sat: BaseDeltaPattern, + pub _10sats: BaseDeltaPattern, + pub _100sats: BaseDeltaPattern, + pub _1k_sats: BaseDeltaPattern, + pub _10k_sats: BaseDeltaPattern, + pub _100k_sats: BaseDeltaPattern, + pub _1m_sats: BaseDeltaPattern, + pub _10m_sats: BaseDeltaPattern, + pub _1btc: BaseDeltaPattern, + pub _10btc: BaseDeltaPattern, + pub _100btc: BaseDeltaPattern, + pub _1k_btc: BaseDeltaPattern, + pub _10k_btc: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: BaseDeltaPattern::new(client.clone(), "utxos_over_1sat_utxo_count".to_string()), + _10sats: BaseDeltaPattern::new(client.clone(), "utxos_over_10sats_utxo_count".to_string()), + _100sats: BaseDeltaPattern::new(client.clone(), "utxos_over_100sats_utxo_count".to_string()), + _1k_sats: BaseDeltaPattern::new(client.clone(), "utxos_over_1k_sats_utxo_count".to_string()), + _10k_sats: BaseDeltaPattern::new(client.clone(), "utxos_over_10k_sats_utxo_count".to_string()), + _100k_sats: BaseDeltaPattern::new(client.clone(), "utxos_over_100k_sats_utxo_count".to_string()), + _1m_sats: BaseDeltaPattern::new(client.clone(), "utxos_over_1m_sats_utxo_count".to_string()), + _10m_sats: BaseDeltaPattern::new(client.clone(), "utxos_over_10m_sats_utxo_count".to_string()), + _1btc: BaseDeltaPattern::new(client.clone(), "utxos_over_1btc_utxo_count".to_string()), + _10btc: BaseDeltaPattern::new(client.clone(), "utxos_over_10btc_utxo_count".to_string()), + _100btc: BaseDeltaPattern::new(client.clone(), "utxos_over_100btc_utxo_count".to_string()), + _1k_btc: BaseDeltaPattern::new(client.clone(), "utxos_over_1k_btc_utxo_count".to_string()), + _10k_btc: BaseDeltaPattern::new(client.clone(), "utxos_over_10k_btc_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Term { + pub short: BaseDeltaPattern, + pub long: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Term { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: BaseDeltaPattern::new(client.clone(), "sth_utxo_count".to_string()), + long: BaseDeltaPattern::new(client.clone(), "lth_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Type { + pub p2pk65: BaseDeltaPattern, + pub p2pk33: BaseDeltaPattern, + pub p2pkh: BaseDeltaPattern, + pub p2ms: BaseDeltaPattern, + pub p2sh: BaseDeltaPattern, + pub p2wpkh: BaseDeltaPattern, + pub p2wsh: BaseDeltaPattern, + pub p2tr: BaseDeltaPattern, + pub p2a: BaseDeltaPattern, + pub unknown: BaseDeltaPattern, + pub empty: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Type { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + p2pk65: BaseDeltaPattern::new(client.clone(), "p2pk65_utxo_count".to_string()), + p2pk33: BaseDeltaPattern::new(client.clone(), "p2pk33_utxo_count".to_string()), + p2pkh: BaseDeltaPattern::new(client.clone(), "p2pkh_utxo_count".to_string()), + p2ms: BaseDeltaPattern::new(client.clone(), "p2ms_utxo_count".to_string()), + p2sh: BaseDeltaPattern::new(client.clone(), "p2sh_utxo_count".to_string()), + p2wpkh: BaseDeltaPattern::new(client.clone(), "p2wpkh_utxo_count".to_string()), + p2wsh: BaseDeltaPattern::new(client.clone(), "p2wsh_utxo_count".to_string()), + p2tr: BaseDeltaPattern::new(client.clone(), "p2tr_utxo_count".to_string()), + p2a: BaseDeltaPattern::new(client.clone(), "p2a_utxo_count".to_string()), + unknown: BaseDeltaPattern::new(client.clone(), "unknown_outputs_utxo_count".to_string()), + empty: BaseDeltaPattern::new(client.clone(), "empty_outputs_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance { + pub range: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Range, + pub under: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Under, + pub over: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Over, + pub matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Over::new(client.clone(), format!("{base_path}_over")), + matrix: SeriesPattern18::new(client.clone(), "addrs_utxo_count_by_balance_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Range { + pub _0sats: BaseDeltaPattern, + pub _1sat_to_10sats: BaseDeltaPattern, + pub _10sats_to_100sats: BaseDeltaPattern, + pub _100sats_to_1k_sats: BaseDeltaPattern, + pub _1k_sats_to_10k_sats: BaseDeltaPattern, + pub _10k_sats_to_100k_sats: BaseDeltaPattern, + pub _100k_sats_to_1m_sats: BaseDeltaPattern, + pub _1m_sats_to_10m_sats: BaseDeltaPattern, + pub _10m_sats_to_1btc: BaseDeltaPattern, + pub _1btc_to_10btc: BaseDeltaPattern, + pub _10btc_to_100btc: BaseDeltaPattern, + pub _100btc_to_1k_btc: BaseDeltaPattern, + pub _1k_btc_to_10k_btc: BaseDeltaPattern, + pub _10k_btc_to_100k_btc: BaseDeltaPattern, + pub over_100k_btc: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: BaseDeltaPattern::new(client.clone(), "addrs_0sats_utxo_count".to_string()), + _1sat_to_10sats: BaseDeltaPattern::new(client.clone(), "addrs_1sat_to_10sats_utxo_count".to_string()), + _10sats_to_100sats: BaseDeltaPattern::new(client.clone(), "addrs_10sats_to_100sats_utxo_count".to_string()), + _100sats_to_1k_sats: BaseDeltaPattern::new(client.clone(), "addrs_100sats_to_1k_sats_utxo_count".to_string()), + _1k_sats_to_10k_sats: BaseDeltaPattern::new(client.clone(), "addrs_1k_sats_to_10k_sats_utxo_count".to_string()), + _10k_sats_to_100k_sats: BaseDeltaPattern::new(client.clone(), "addrs_10k_sats_to_100k_sats_utxo_count".to_string()), + _100k_sats_to_1m_sats: BaseDeltaPattern::new(client.clone(), "addrs_100k_sats_to_1m_sats_utxo_count".to_string()), + _1m_sats_to_10m_sats: BaseDeltaPattern::new(client.clone(), "addrs_1m_sats_to_10m_sats_utxo_count".to_string()), + _10m_sats_to_1btc: BaseDeltaPattern::new(client.clone(), "addrs_10m_sats_to_1btc_utxo_count".to_string()), + _1btc_to_10btc: BaseDeltaPattern::new(client.clone(), "addrs_1btc_to_10btc_utxo_count".to_string()), + _10btc_to_100btc: BaseDeltaPattern::new(client.clone(), "addrs_10btc_to_100btc_utxo_count".to_string()), + _100btc_to_1k_btc: BaseDeltaPattern::new(client.clone(), "addrs_100btc_to_1k_btc_utxo_count".to_string()), + _1k_btc_to_10k_btc: BaseDeltaPattern::new(client.clone(), "addrs_1k_btc_to_10k_btc_utxo_count".to_string()), + _10k_btc_to_100k_btc: BaseDeltaPattern::new(client.clone(), "addrs_10k_btc_to_100k_btc_utxo_count".to_string()), + over_100k_btc: BaseDeltaPattern::new(client.clone(), "addrs_over_100k_btc_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Under { + pub _10sats: BaseDeltaPattern, + pub _100sats: BaseDeltaPattern, + pub _1k_sats: BaseDeltaPattern, + pub _10k_sats: BaseDeltaPattern, + pub _100k_sats: BaseDeltaPattern, + pub _1m_sats: BaseDeltaPattern, + pub _10m_sats: BaseDeltaPattern, + pub _1btc: BaseDeltaPattern, + pub _10btc: BaseDeltaPattern, + pub _100btc: BaseDeltaPattern, + pub _1k_btc: BaseDeltaPattern, + pub _10k_btc: BaseDeltaPattern, + pub _100k_btc: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: BaseDeltaPattern::new(client.clone(), "addrs_under_10sats_utxo_count".to_string()), + _100sats: BaseDeltaPattern::new(client.clone(), "addrs_under_100sats_utxo_count".to_string()), + _1k_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_1k_sats_utxo_count".to_string()), + _10k_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_10k_sats_utxo_count".to_string()), + _100k_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_100k_sats_utxo_count".to_string()), + _1m_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_1m_sats_utxo_count".to_string()), + _10m_sats: BaseDeltaPattern::new(client.clone(), "addrs_under_10m_sats_utxo_count".to_string()), + _1btc: BaseDeltaPattern::new(client.clone(), "addrs_under_1btc_utxo_count".to_string()), + _10btc: BaseDeltaPattern::new(client.clone(), "addrs_under_10btc_utxo_count".to_string()), + _100btc: BaseDeltaPattern::new(client.clone(), "addrs_under_100btc_utxo_count".to_string()), + _1k_btc: BaseDeltaPattern::new(client.clone(), "addrs_under_1k_btc_utxo_count".to_string()), + _10k_btc: BaseDeltaPattern::new(client.clone(), "addrs_under_10k_btc_utxo_count".to_string()), + _100k_btc: BaseDeltaPattern::new(client.clone(), "addrs_under_100k_btc_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Over { + pub _1sat: BaseDeltaPattern, + pub _10sats: BaseDeltaPattern, + pub _100sats: BaseDeltaPattern, + pub _1k_sats: BaseDeltaPattern, + pub _10k_sats: BaseDeltaPattern, + pub _100k_sats: BaseDeltaPattern, + pub _1m_sats: BaseDeltaPattern, + pub _10m_sats: BaseDeltaPattern, + pub _1btc: BaseDeltaPattern, + pub _10btc: BaseDeltaPattern, + pub _100btc: BaseDeltaPattern, + pub _1k_btc: BaseDeltaPattern, + pub _10k_btc: BaseDeltaPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: BaseDeltaPattern::new(client.clone(), "addrs_over_1sat_utxo_count".to_string()), + _10sats: BaseDeltaPattern::new(client.clone(), "addrs_over_10sats_utxo_count".to_string()), + _100sats: BaseDeltaPattern::new(client.clone(), "addrs_over_100sats_utxo_count".to_string()), + _1k_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_1k_sats_utxo_count".to_string()), + _10k_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_10k_sats_utxo_count".to_string()), + _100k_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_100k_sats_utxo_count".to_string()), + _1m_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_1m_sats_utxo_count".to_string()), + _10m_sats: BaseDeltaPattern::new(client.clone(), "addrs_over_10m_sats_utxo_count".to_string()), + _1btc: BaseDeltaPattern::new(client.clone(), "addrs_over_1btc_utxo_count".to_string()), + _10btc: BaseDeltaPattern::new(client.clone(), "addrs_over_10btc_utxo_count".to_string()), + _100btc: BaseDeltaPattern::new(client.clone(), "addrs_over_100btc_utxo_count".to_string()), + _1k_btc: BaseDeltaPattern::new(client.clone(), "addrs_over_1k_btc_utxo_count".to_string()), + _10k_btc: BaseDeltaPattern::new(client.clone(), "addrs_over_10k_btc_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount { + pub all: AverageBlockCumulativeSumPattern, + pub age: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Class, + pub entry: DiscountPremiumPattern, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount, + pub term: LongShortPattern, + pub type_: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Type, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, + pub amount_range_matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AverageBlockCumulativeSumPattern::new(client.clone(), "spent_utxo_count".to_string()), + age: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern::new(client.clone(), "spent_utxo_count".to_string()), + utxo_amount: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: LongShortPattern::new(client.clone(), "spent_utxo_count".to_string()), + type_: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Type::new(client.clone(), format!("{base_path}_type")), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_spent_utxo_count_cumulative_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "spent_utxo_count_cumulative_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "spent_utxo_count_cumulative_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "spent_utxo_count_cumulative_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "spent_utxo_count_cumulative_by_type".to_string()), + amount_range_matrix: SeriesPattern18::new(client.clone(), "utxos_spent_utxo_count_cumulative_by_amount_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age { + pub range: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Range { + pub under_1h: AverageBlockCumulativeSumPattern, + pub _1h_to_1d: AverageBlockCumulativeSumPattern, + pub _1d_to_1w: AverageBlockCumulativeSumPattern, + pub _1w_to_1m: AverageBlockCumulativeSumPattern, + pub _1m_to_2m: AverageBlockCumulativeSumPattern, + pub _2m_to_3m: AverageBlockCumulativeSumPattern, + pub _3m_to_4m: AverageBlockCumulativeSumPattern, + pub _4m_to_5m: AverageBlockCumulativeSumPattern, + pub _5m_to_6m: AverageBlockCumulativeSumPattern, + pub _6m_to_9m: AverageBlockCumulativeSumPattern, + pub _9m_to_1y: AverageBlockCumulativeSumPattern, + pub _1y_to_18m: AverageBlockCumulativeSumPattern, + pub _18m_to_2y: AverageBlockCumulativeSumPattern, + pub _2y_to_3y: AverageBlockCumulativeSumPattern, + pub _3y_to_4y: AverageBlockCumulativeSumPattern, + pub _4y_to_5y: AverageBlockCumulativeSumPattern, + pub _5y_to_6y: AverageBlockCumulativeSumPattern, + pub _6y_to_7y: AverageBlockCumulativeSumPattern, + pub _7y_to_8y: AverageBlockCumulativeSumPattern, + pub _8y_to_10y: AverageBlockCumulativeSumPattern, + pub _10y_to_12y: AverageBlockCumulativeSumPattern, + pub _12y_to_15y: AverageBlockCumulativeSumPattern, + pub over_15y: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1h_old_spent_utxo_count".to_string()), + _1h_to_1d: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1h_to_1d_old_spent_utxo_count".to_string()), + _1d_to_1w: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1d_to_1w_old_spent_utxo_count".to_string()), + _1w_to_1m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1w_to_1m_old_spent_utxo_count".to_string()), + _1m_to_2m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1m_to_2m_old_spent_utxo_count".to_string()), + _2m_to_3m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_2m_to_3m_old_spent_utxo_count".to_string()), + _3m_to_4m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_3m_to_4m_old_spent_utxo_count".to_string()), + _4m_to_5m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_4m_to_5m_old_spent_utxo_count".to_string()), + _5m_to_6m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_5m_to_6m_old_spent_utxo_count".to_string()), + _6m_to_9m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_6m_to_9m_old_spent_utxo_count".to_string()), + _9m_to_1y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_9m_to_1y_old_spent_utxo_count".to_string()), + _1y_to_18m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1y_to_18m_old_spent_utxo_count".to_string()), + _18m_to_2y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_18m_to_2y_old_spent_utxo_count".to_string()), + _2y_to_3y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_2y_to_3y_old_spent_utxo_count".to_string()), + _3y_to_4y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_3y_to_4y_old_spent_utxo_count".to_string()), + _4y_to_5y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_4y_to_5y_old_spent_utxo_count".to_string()), + _5y_to_6y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_5y_to_6y_old_spent_utxo_count".to_string()), + _6y_to_7y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_6y_to_7y_old_spent_utxo_count".to_string()), + _7y_to_8y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_7y_to_8y_old_spent_utxo_count".to_string()), + _8y_to_10y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_8y_to_10y_old_spent_utxo_count".to_string()), + _10y_to_12y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_10y_to_12y_old_spent_utxo_count".to_string()), + _12y_to_15y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_12y_to_15y_old_spent_utxo_count".to_string()), + over_15y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_15y_old_spent_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Under { + pub _1w: AverageBlockCumulativeSumPattern, + pub _1m: AverageBlockCumulativeSumPattern, + pub _2m: AverageBlockCumulativeSumPattern, + pub _3m: AverageBlockCumulativeSumPattern, + pub _4m: AverageBlockCumulativeSumPattern, + pub _5m: AverageBlockCumulativeSumPattern, + pub _6m: AverageBlockCumulativeSumPattern, + pub _9m: AverageBlockCumulativeSumPattern, + pub _1y: AverageBlockCumulativeSumPattern, + pub _18m: AverageBlockCumulativeSumPattern, + pub _2y: AverageBlockCumulativeSumPattern, + pub _3y: AverageBlockCumulativeSumPattern, + pub _4y: AverageBlockCumulativeSumPattern, + pub _5y: AverageBlockCumulativeSumPattern, + pub _6y: AverageBlockCumulativeSumPattern, + pub _7y: AverageBlockCumulativeSumPattern, + pub _8y: AverageBlockCumulativeSumPattern, + pub _10y: AverageBlockCumulativeSumPattern, + pub _12y: AverageBlockCumulativeSumPattern, + pub _15y: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1w_old_spent_utxo_count".to_string()), + _1m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1m_old_spent_utxo_count".to_string()), + _2m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_2m_old_spent_utxo_count".to_string()), + _3m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_3m_old_spent_utxo_count".to_string()), + _4m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_4m_old_spent_utxo_count".to_string()), + _5m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_5m_old_spent_utxo_count".to_string()), + _6m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_6m_old_spent_utxo_count".to_string()), + _9m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_9m_old_spent_utxo_count".to_string()), + _1y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1y_old_spent_utxo_count".to_string()), + _18m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_18m_old_spent_utxo_count".to_string()), + _2y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_2y_old_spent_utxo_count".to_string()), + _3y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_3y_old_spent_utxo_count".to_string()), + _4y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_4y_old_spent_utxo_count".to_string()), + _5y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_5y_old_spent_utxo_count".to_string()), + _6y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_6y_old_spent_utxo_count".to_string()), + _7y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_7y_old_spent_utxo_count".to_string()), + _8y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_8y_old_spent_utxo_count".to_string()), + _10y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_10y_old_spent_utxo_count".to_string()), + _12y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_12y_old_spent_utxo_count".to_string()), + _15y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_15y_old_spent_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Over { + pub _1d: AverageBlockCumulativeSumPattern, + pub _1w: AverageBlockCumulativeSumPattern, + pub _1m: AverageBlockCumulativeSumPattern, + pub _2m: AverageBlockCumulativeSumPattern, + pub _3m: AverageBlockCumulativeSumPattern, + pub _4m: AverageBlockCumulativeSumPattern, + pub _5m: AverageBlockCumulativeSumPattern, + pub _6m: AverageBlockCumulativeSumPattern, + pub _9m: AverageBlockCumulativeSumPattern, + pub _1y: AverageBlockCumulativeSumPattern, + pub _18m: AverageBlockCumulativeSumPattern, + pub _2y: AverageBlockCumulativeSumPattern, + pub _3y: AverageBlockCumulativeSumPattern, + pub _4y: AverageBlockCumulativeSumPattern, + pub _5y: AverageBlockCumulativeSumPattern, + pub _6y: AverageBlockCumulativeSumPattern, + pub _7y: AverageBlockCumulativeSumPattern, + pub _8y: AverageBlockCumulativeSumPattern, + pub _10y: AverageBlockCumulativeSumPattern, + pub _12y: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1d_old_spent_utxo_count".to_string()), + _1w: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1w_old_spent_utxo_count".to_string()), + _1m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1m_old_spent_utxo_count".to_string()), + _2m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_2m_old_spent_utxo_count".to_string()), + _3m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_3m_old_spent_utxo_count".to_string()), + _4m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_4m_old_spent_utxo_count".to_string()), + _5m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_5m_old_spent_utxo_count".to_string()), + _6m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_6m_old_spent_utxo_count".to_string()), + _9m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_9m_old_spent_utxo_count".to_string()), + _1y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1y_old_spent_utxo_count".to_string()), + _18m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_18m_old_spent_utxo_count".to_string()), + _2y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_2y_old_spent_utxo_count".to_string()), + _3y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_3y_old_spent_utxo_count".to_string()), + _4y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_4y_old_spent_utxo_count".to_string()), + _5y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_5y_old_spent_utxo_count".to_string()), + _6y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_6y_old_spent_utxo_count".to_string()), + _7y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_7y_old_spent_utxo_count".to_string()), + _8y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_8y_old_spent_utxo_count".to_string()), + _10y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_10y_old_spent_utxo_count".to_string()), + _12y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_12y_old_spent_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Epoch { + pub _0: AverageBlockCumulativeSumPattern, + pub _1: AverageBlockCumulativeSumPattern, + pub _2: AverageBlockCumulativeSumPattern, + pub _3: AverageBlockCumulativeSumPattern, + pub _4: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_0_spent_utxo_count".to_string()), + _1: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_1_spent_utxo_count".to_string()), + _2: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_2_spent_utxo_count".to_string()), + _3: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_3_spent_utxo_count".to_string()), + _4: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_4_spent_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Class { + pub _2009: AverageBlockCumulativeSumPattern, + pub _2010: AverageBlockCumulativeSumPattern, + pub _2011: AverageBlockCumulativeSumPattern, + pub _2012: AverageBlockCumulativeSumPattern, + pub _2013: AverageBlockCumulativeSumPattern, + pub _2014: AverageBlockCumulativeSumPattern, + pub _2015: AverageBlockCumulativeSumPattern, + pub _2016: AverageBlockCumulativeSumPattern, + pub _2017: AverageBlockCumulativeSumPattern, + pub _2018: AverageBlockCumulativeSumPattern, + pub _2019: AverageBlockCumulativeSumPattern, + pub _2020: AverageBlockCumulativeSumPattern, + pub _2021: AverageBlockCumulativeSumPattern, + pub _2022: AverageBlockCumulativeSumPattern, + pub _2023: AverageBlockCumulativeSumPattern, + pub _2024: AverageBlockCumulativeSumPattern, + pub _2025: AverageBlockCumulativeSumPattern, + pub _2026: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2009_spent_utxo_count".to_string()), + _2010: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2010_spent_utxo_count".to_string()), + _2011: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2011_spent_utxo_count".to_string()), + _2012: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2012_spent_utxo_count".to_string()), + _2013: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2013_spent_utxo_count".to_string()), + _2014: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2014_spent_utxo_count".to_string()), + _2015: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2015_spent_utxo_count".to_string()), + _2016: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2016_spent_utxo_count".to_string()), + _2017: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2017_spent_utxo_count".to_string()), + _2018: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2018_spent_utxo_count".to_string()), + _2019: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2019_spent_utxo_count".to_string()), + _2020: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2020_spent_utxo_count".to_string()), + _2021: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2021_spent_utxo_count".to_string()), + _2022: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2022_spent_utxo_count".to_string()), + _2023: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2023_spent_utxo_count".to_string()), + _2024: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2024_spent_utxo_count".to_string()), + _2025: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2025_spent_utxo_count".to_string()), + _2026: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2026_spent_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount { + pub range: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Range, + pub under: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Under, + pub over: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Range { + pub _0sats: AverageBlockCumulativeSumPattern, + pub _1sat_to_10sats: AverageBlockCumulativeSumPattern, + pub _10sats_to_100sats: AverageBlockCumulativeSumPattern, + pub _100sats_to_1k_sats: AverageBlockCumulativeSumPattern, + pub _1k_sats_to_10k_sats: AverageBlockCumulativeSumPattern, + pub _10k_sats_to_100k_sats: AverageBlockCumulativeSumPattern, + pub _100k_sats_to_1m_sats: AverageBlockCumulativeSumPattern, + pub _1m_sats_to_10m_sats: AverageBlockCumulativeSumPattern, + pub _10m_sats_to_1btc: AverageBlockCumulativeSumPattern, + pub _1btc_to_10btc: AverageBlockCumulativeSumPattern, + pub _10btc_to_100btc: AverageBlockCumulativeSumPattern, + pub _100btc_to_1k_btc: AverageBlockCumulativeSumPattern, + pub _1k_btc_to_10k_btc: AverageBlockCumulativeSumPattern, + pub _10k_btc_to_100k_btc: AverageBlockCumulativeSumPattern, + pub over_100k_btc: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_0sats_spent_utxo_count".to_string()), + _1sat_to_10sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1sat_to_10sats_spent_utxo_count".to_string()), + _10sats_to_100sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_10sats_to_100sats_spent_utxo_count".to_string()), + _100sats_to_1k_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_100sats_to_1k_sats_spent_utxo_count".to_string()), + _1k_sats_to_10k_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1k_sats_to_10k_sats_spent_utxo_count".to_string()), + _10k_sats_to_100k_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_10k_sats_to_100k_sats_spent_utxo_count".to_string()), + _100k_sats_to_1m_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_100k_sats_to_1m_sats_spent_utxo_count".to_string()), + _1m_sats_to_10m_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1m_sats_to_10m_sats_spent_utxo_count".to_string()), + _10m_sats_to_1btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_10m_sats_to_1btc_spent_utxo_count".to_string()), + _1btc_to_10btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1btc_to_10btc_spent_utxo_count".to_string()), + _10btc_to_100btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_10btc_to_100btc_spent_utxo_count".to_string()), + _100btc_to_1k_btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_100btc_to_1k_btc_spent_utxo_count".to_string()), + _1k_btc_to_10k_btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1k_btc_to_10k_btc_spent_utxo_count".to_string()), + _10k_btc_to_100k_btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_10k_btc_to_100k_btc_spent_utxo_count".to_string()), + over_100k_btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_100k_btc_spent_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Under { + pub _10sats: AverageBlockCumulativeSumPattern, + pub _100sats: AverageBlockCumulativeSumPattern, + pub _1k_sats: AverageBlockCumulativeSumPattern, + pub _10k_sats: AverageBlockCumulativeSumPattern, + pub _100k_sats: AverageBlockCumulativeSumPattern, + pub _1m_sats: AverageBlockCumulativeSumPattern, + pub _10m_sats: AverageBlockCumulativeSumPattern, + pub _1btc: AverageBlockCumulativeSumPattern, + pub _10btc: AverageBlockCumulativeSumPattern, + pub _100btc: AverageBlockCumulativeSumPattern, + pub _1k_btc: AverageBlockCumulativeSumPattern, + pub _10k_btc: AverageBlockCumulativeSumPattern, + pub _100k_btc: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_10sats_spent_utxo_count".to_string()), + _100sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_100sats_spent_utxo_count".to_string()), + _1k_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1k_sats_spent_utxo_count".to_string()), + _10k_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_10k_sats_spent_utxo_count".to_string()), + _100k_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_100k_sats_spent_utxo_count".to_string()), + _1m_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1m_sats_spent_utxo_count".to_string()), + _10m_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_10m_sats_spent_utxo_count".to_string()), + _1btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1btc_spent_utxo_count".to_string()), + _10btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_10btc_spent_utxo_count".to_string()), + _100btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_100btc_spent_utxo_count".to_string()), + _1k_btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1k_btc_spent_utxo_count".to_string()), + _10k_btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_10k_btc_spent_utxo_count".to_string()), + _100k_btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_100k_btc_spent_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Over { + pub _1sat: AverageBlockCumulativeSumPattern, + pub _10sats: AverageBlockCumulativeSumPattern, + pub _100sats: AverageBlockCumulativeSumPattern, + pub _1k_sats: AverageBlockCumulativeSumPattern, + pub _10k_sats: AverageBlockCumulativeSumPattern, + pub _100k_sats: AverageBlockCumulativeSumPattern, + pub _1m_sats: AverageBlockCumulativeSumPattern, + pub _10m_sats: AverageBlockCumulativeSumPattern, + pub _1btc: AverageBlockCumulativeSumPattern, + pub _10btc: AverageBlockCumulativeSumPattern, + pub _100btc: AverageBlockCumulativeSumPattern, + pub _1k_btc: AverageBlockCumulativeSumPattern, + pub _10k_btc: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1sat_spent_utxo_count".to_string()), + _10sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_10sats_spent_utxo_count".to_string()), + _100sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_100sats_spent_utxo_count".to_string()), + _1k_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1k_sats_spent_utxo_count".to_string()), + _10k_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_10k_sats_spent_utxo_count".to_string()), + _100k_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_100k_sats_spent_utxo_count".to_string()), + _1m_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1m_sats_spent_utxo_count".to_string()), + _10m_sats: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_10m_sats_spent_utxo_count".to_string()), + _1btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1btc_spent_utxo_count".to_string()), + _10btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_10btc_spent_utxo_count".to_string()), + _100btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_100btc_spent_utxo_count".to_string()), + _1k_btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1k_btc_spent_utxo_count".to_string()), + _10k_btc: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_10k_btc_spent_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Type { + pub p2pk65: AverageBlockCumulativeSumPattern, + pub p2pk33: AverageBlockCumulativeSumPattern, + pub p2pkh: AverageBlockCumulativeSumPattern, + pub p2ms: AverageBlockCumulativeSumPattern, + pub p2sh: AverageBlockCumulativeSumPattern, + pub p2wpkh: AverageBlockCumulativeSumPattern, + pub p2wsh: AverageBlockCumulativeSumPattern, + pub p2tr: AverageBlockCumulativeSumPattern, + pub p2a: AverageBlockCumulativeSumPattern, + pub unknown: AverageBlockCumulativeSumPattern, + pub empty: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Type { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + p2pk65: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk65_spent_utxo_count".to_string()), + p2pk33: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pk33_spent_utxo_count".to_string()), + p2pkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2pkh_spent_utxo_count".to_string()), + p2ms: AverageBlockCumulativeSumPattern::new(client.clone(), "p2ms_spent_utxo_count".to_string()), + p2sh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2sh_spent_utxo_count".to_string()), + p2wpkh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wpkh_spent_utxo_count".to_string()), + p2wsh: AverageBlockCumulativeSumPattern::new(client.clone(), "p2wsh_spent_utxo_count".to_string()), + p2tr: AverageBlockCumulativeSumPattern::new(client.clone(), "p2tr_spent_utxo_count".to_string()), + p2a: AverageBlockCumulativeSumPattern::new(client.clone(), "p2a_spent_utxo_count".to_string()), + unknown: AverageBlockCumulativeSumPattern::new(client.clone(), "unknown_outputs_spent_utxo_count".to_string()), + empty: AverageBlockCumulativeSumPattern::new(client.clone(), "empty_outputs_spent_utxo_count".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity { + pub transfer_volume: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume, + pub coindays_destroyed: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed, + pub coinyears_destroyed: SeriesTree_Cohorts_Cohorts_Activity_CoinyearsDestroyed, + pub dormancy: SeriesTree_Cohorts_Cohorts_Activity_Dormancy, +} + +impl SeriesTree_Cohorts_Cohorts_Activity { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + transfer_volume: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume::new(client.clone(), format!("{base_path}_transfer_volume")), + coindays_destroyed: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed::new(client.clone(), format!("{base_path}_coindays_destroyed")), + coinyears_destroyed: SeriesTree_Cohorts_Cohorts_Activity_CoinyearsDestroyed::new(client.clone(), format!("{base_path}_coinyears_destroyed")), + dormancy: SeriesTree_Cohorts_Cohorts_Activity_Dormancy::new(client.clone(), format!("{base_path}_dormancy")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume { + pub all: AverageBlockCumulativeSumPattern2, + pub age: OverRangeUnderPattern2, + pub epoch: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Class, + pub entry: DiscountPremiumPattern2, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_UtxoAmount, + pub term: LongShortPattern2, + pub type_: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Type, + pub cumulative: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Cumulative, + pub addr_balance: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_AddrBalance, + pub in_profit: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit, + pub in_loss: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AverageBlockCumulativeSumPattern2::new(client.clone(), "transfer_volume".to_string()), + age: OverRangeUnderPattern2::new(client.clone(), "utxos".to_string()), + epoch: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern2::new(client.clone(), "transfer_volume".to_string()), + utxo_amount: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: LongShortPattern2::new(client.clone(), "transfer_volume".to_string()), + type_: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Type::new(client.clone(), format!("{base_path}_type")), + cumulative: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Cumulative::new(client.clone(), format!("{base_path}_cumulative")), + addr_balance: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_AddrBalance::new(client.clone(), format!("{base_path}_addr_balance")), + in_profit: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit::new(client.clone(), format!("{base_path}_in_profit")), + in_loss: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss::new(client.clone(), format!("{base_path}_in_loss")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Epoch { + pub _0: AverageBlockCumulativeSumPattern2, + pub _1: AverageBlockCumulativeSumPattern2, + pub _2: AverageBlockCumulativeSumPattern2, + pub _3: AverageBlockCumulativeSumPattern2, + pub _4: AverageBlockCumulativeSumPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: AverageBlockCumulativeSumPattern2::new(client.clone(), "epoch_0_transfer_volume".to_string()), + _1: AverageBlockCumulativeSumPattern2::new(client.clone(), "epoch_1_transfer_volume".to_string()), + _2: AverageBlockCumulativeSumPattern2::new(client.clone(), "epoch_2_transfer_volume".to_string()), + _3: AverageBlockCumulativeSumPattern2::new(client.clone(), "epoch_3_transfer_volume".to_string()), + _4: AverageBlockCumulativeSumPattern2::new(client.clone(), "epoch_4_transfer_volume".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Class { + pub _2009: AverageBlockCumulativeSumPattern2, + pub _2010: AverageBlockCumulativeSumPattern2, + pub _2011: AverageBlockCumulativeSumPattern2, + pub _2012: AverageBlockCumulativeSumPattern2, + pub _2013: AverageBlockCumulativeSumPattern2, + pub _2014: AverageBlockCumulativeSumPattern2, + pub _2015: AverageBlockCumulativeSumPattern2, + pub _2016: AverageBlockCumulativeSumPattern2, + pub _2017: AverageBlockCumulativeSumPattern2, + pub _2018: AverageBlockCumulativeSumPattern2, + pub _2019: AverageBlockCumulativeSumPattern2, + pub _2020: AverageBlockCumulativeSumPattern2, + pub _2021: AverageBlockCumulativeSumPattern2, + pub _2022: AverageBlockCumulativeSumPattern2, + pub _2023: AverageBlockCumulativeSumPattern2, + pub _2024: AverageBlockCumulativeSumPattern2, + pub _2025: AverageBlockCumulativeSumPattern2, + pub _2026: AverageBlockCumulativeSumPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2009_transfer_volume".to_string()), + _2010: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2010_transfer_volume".to_string()), + _2011: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2011_transfer_volume".to_string()), + _2012: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2012_transfer_volume".to_string()), + _2013: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2013_transfer_volume".to_string()), + _2014: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2014_transfer_volume".to_string()), + _2015: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2015_transfer_volume".to_string()), + _2016: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2016_transfer_volume".to_string()), + _2017: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2017_transfer_volume".to_string()), + _2018: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2018_transfer_volume".to_string()), + _2019: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2019_transfer_volume".to_string()), + _2020: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2020_transfer_volume".to_string()), + _2021: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2021_transfer_volume".to_string()), + _2022: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2022_transfer_volume".to_string()), + _2023: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2023_transfer_volume".to_string()), + _2024: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2024_transfer_volume".to_string()), + _2025: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2025_transfer_volume".to_string()), + _2026: AverageBlockCumulativeSumPattern2::new(client.clone(), "class_2026_transfer_volume".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_UtxoAmount { + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2, + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_UtxoAmount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2::new(client.clone(), "utxos".to_string()), + under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2::new(client.clone(), "utxos_under".to_string()), + over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2::new(client.clone(), "utxos_over".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Type { + pub p2pk65: AverageBlockCumulativeSumPattern2, + pub p2pk33: AverageBlockCumulativeSumPattern2, + pub p2pkh: AverageBlockCumulativeSumPattern2, + pub p2ms: AverageBlockCumulativeSumPattern2, + pub p2sh: AverageBlockCumulativeSumPattern2, + pub p2wpkh: AverageBlockCumulativeSumPattern2, + pub p2wsh: AverageBlockCumulativeSumPattern2, + pub p2tr: AverageBlockCumulativeSumPattern2, + pub p2a: AverageBlockCumulativeSumPattern2, + pub unknown: AverageBlockCumulativeSumPattern2, + pub empty: AverageBlockCumulativeSumPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Type { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + p2pk65: AverageBlockCumulativeSumPattern2::new(client.clone(), "p2pk65_transfer_volume".to_string()), + p2pk33: AverageBlockCumulativeSumPattern2::new(client.clone(), "p2pk33_transfer_volume".to_string()), + p2pkh: AverageBlockCumulativeSumPattern2::new(client.clone(), "p2pkh_transfer_volume".to_string()), + p2ms: AverageBlockCumulativeSumPattern2::new(client.clone(), "p2ms_transfer_volume".to_string()), + p2sh: AverageBlockCumulativeSumPattern2::new(client.clone(), "p2sh_transfer_volume".to_string()), + p2wpkh: AverageBlockCumulativeSumPattern2::new(client.clone(), "p2wpkh_transfer_volume".to_string()), + p2wsh: AverageBlockCumulativeSumPattern2::new(client.clone(), "p2wsh_transfer_volume".to_string()), + p2tr: AverageBlockCumulativeSumPattern2::new(client.clone(), "p2tr_transfer_volume".to_string()), + p2a: AverageBlockCumulativeSumPattern2::new(client.clone(), "p2a_transfer_volume".to_string()), + unknown: AverageBlockCumulativeSumPattern2::new(client.clone(), "unknown_outputs_transfer_volume".to_string()), + empty: AverageBlockCumulativeSumPattern2::new(client.clone(), "empty_outputs_transfer_volume".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Cumulative { + pub age_range: CentsSatsPattern, + pub epoch: CentsSatsPattern, + pub class: CentsSatsPattern, + pub entry: CentsSatsPattern, + pub amount_range: CentsSatsPattern, + pub type_: CentsSatsPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Cumulative { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + age_range: CentsSatsPattern::new(client.clone(), "utxos_transfer_volume_cumulative_by_age_range".to_string()), + epoch: CentsSatsPattern::new(client.clone(), "transfer_volume_cumulative_by_epoch".to_string()), + class: CentsSatsPattern::new(client.clone(), "transfer_volume_cumulative_by_class".to_string()), + entry: CentsSatsPattern::new(client.clone(), "transfer_volume_cumulative_by_entry".to_string()), + amount_range: CentsSatsPattern::new(client.clone(), "utxos_transfer_volume_cumulative_by_amount_range".to_string()), + type_: CentsSatsPattern::new(client.clone(), "transfer_volume_cumulative_by_type".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_AddrBalance { + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2, + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2, + pub values: CentsSatsPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_AddrBalance { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2::new(client.clone(), "addrs".to_string()), + under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2::new(client.clone(), "addrs_under".to_string()), + over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2::new(client.clone(), "addrs_over".to_string()), + values: CentsSatsPattern::new(client.clone(), "addrs_transfer_volume_cumulative_by_balance_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit { + pub all: AverageBlockCumulativeSumPattern2, + pub age: OverRangeUnderPattern2, + pub epoch: _01234Pattern2, + pub class: _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2, + pub entry: DiscountPremiumPattern2, + pub term: LongShortPattern2, + pub cumulative: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit_Cumulative, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AverageBlockCumulativeSumPattern2::new(client.clone(), "transfer_volume_in_profit".to_string()), + age: OverRangeUnderPattern2::new(client.clone(), "utxos".to_string()), + epoch: _01234Pattern2::new(client.clone(), "epoch".to_string(), "in_profit".to_string()), + class: _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2::new(client.clone(), "class".to_string(), "in_profit".to_string()), + entry: DiscountPremiumPattern2::new(client.clone(), "transfer_volume_in_profit".to_string()), + term: LongShortPattern2::new(client.clone(), "transfer_volume_in_profit".to_string()), + cumulative: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit_Cumulative::new(client.clone(), format!("{base_path}_cumulative")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit_Cumulative { + pub age_range: CentsSatsPattern, + pub epoch: CentsSatsPattern, + pub class: CentsSatsPattern, + pub entry: CentsSatsPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit_Cumulative { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + age_range: CentsSatsPattern::new(client.clone(), "utxos_transfer_volume_in_profit_cumulative_by_age_range".to_string()), + epoch: CentsSatsPattern::new(client.clone(), "transfer_volume_in_profit_cumulative_by_epoch".to_string()), + class: CentsSatsPattern::new(client.clone(), "transfer_volume_in_profit_cumulative_by_class".to_string()), + entry: CentsSatsPattern::new(client.clone(), "transfer_volume_in_profit_cumulative_by_entry".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss { + pub all: AverageBlockCumulativeSumPattern2, + pub age: OverRangeUnderPattern2, + pub epoch: _01234Pattern2, + pub class: _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2, + pub entry: DiscountPremiumPattern2, + pub term: LongShortPattern2, + pub cumulative: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss_Cumulative, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AverageBlockCumulativeSumPattern2::new(client.clone(), "transfer_volume_in_loss".to_string()), + age: OverRangeUnderPattern2::new(client.clone(), "utxos".to_string()), + epoch: _01234Pattern2::new(client.clone(), "epoch".to_string(), "in_loss".to_string()), + class: _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2::new(client.clone(), "class".to_string(), "in_loss".to_string()), + entry: DiscountPremiumPattern2::new(client.clone(), "transfer_volume_in_loss".to_string()), + term: LongShortPattern2::new(client.clone(), "transfer_volume_in_loss".to_string()), + cumulative: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss_Cumulative::new(client.clone(), format!("{base_path}_cumulative")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss_Cumulative { + pub age_range: CentsSatsPattern, + pub epoch: CentsSatsPattern, + pub class: CentsSatsPattern, + pub entry: CentsSatsPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss_Cumulative { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + age_range: CentsSatsPattern::new(client.clone(), "utxos_transfer_volume_in_loss_cumulative_by_age_range".to_string()), + epoch: CentsSatsPattern::new(client.clone(), "transfer_volume_in_loss_cumulative_by_epoch".to_string()), + class: CentsSatsPattern::new(client.clone(), "transfer_volume_in_loss_cumulative_by_class".to_string()), + entry: CentsSatsPattern::new(client.clone(), "transfer_volume_in_loss_cumulative_by_entry".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed { + pub all: AverageBlockCumulativeSumPattern, + pub age: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Class, + pub entry: DiscountPremiumPattern, + pub term: LongShortPattern, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AverageBlockCumulativeSumPattern::new(client.clone(), "coindays_destroyed".to_string()), + age: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern::new(client.clone(), "coindays_destroyed".to_string()), + term: LongShortPattern::new(client.clone(), "coindays_destroyed".to_string()), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_coindays_destroyed_cumulative_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "coindays_destroyed_cumulative_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "coindays_destroyed_cumulative_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "coindays_destroyed_cumulative_by_entry".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age { + pub range: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Range { + pub under_1h: AverageBlockCumulativeSumPattern, + pub _1h_to_1d: AverageBlockCumulativeSumPattern, + pub _1d_to_1w: AverageBlockCumulativeSumPattern, + pub _1w_to_1m: AverageBlockCumulativeSumPattern, + pub _1m_to_2m: AverageBlockCumulativeSumPattern, + pub _2m_to_3m: AverageBlockCumulativeSumPattern, + pub _3m_to_4m: AverageBlockCumulativeSumPattern, + pub _4m_to_5m: AverageBlockCumulativeSumPattern, + pub _5m_to_6m: AverageBlockCumulativeSumPattern, + pub _6m_to_9m: AverageBlockCumulativeSumPattern, + pub _9m_to_1y: AverageBlockCumulativeSumPattern, + pub _1y_to_18m: AverageBlockCumulativeSumPattern, + pub _18m_to_2y: AverageBlockCumulativeSumPattern, + pub _2y_to_3y: AverageBlockCumulativeSumPattern, + pub _3y_to_4y: AverageBlockCumulativeSumPattern, + pub _4y_to_5y: AverageBlockCumulativeSumPattern, + pub _5y_to_6y: AverageBlockCumulativeSumPattern, + pub _6y_to_7y: AverageBlockCumulativeSumPattern, + pub _7y_to_8y: AverageBlockCumulativeSumPattern, + pub _8y_to_10y: AverageBlockCumulativeSumPattern, + pub _10y_to_12y: AverageBlockCumulativeSumPattern, + pub _12y_to_15y: AverageBlockCumulativeSumPattern, + pub over_15y: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1h_old_coindays_destroyed".to_string()), + _1h_to_1d: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1h_to_1d_old_coindays_destroyed".to_string()), + _1d_to_1w: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1d_to_1w_old_coindays_destroyed".to_string()), + _1w_to_1m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1w_to_1m_old_coindays_destroyed".to_string()), + _1m_to_2m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1m_to_2m_old_coindays_destroyed".to_string()), + _2m_to_3m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_2m_to_3m_old_coindays_destroyed".to_string()), + _3m_to_4m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_3m_to_4m_old_coindays_destroyed".to_string()), + _4m_to_5m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_4m_to_5m_old_coindays_destroyed".to_string()), + _5m_to_6m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_5m_to_6m_old_coindays_destroyed".to_string()), + _6m_to_9m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_6m_to_9m_old_coindays_destroyed".to_string()), + _9m_to_1y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_9m_to_1y_old_coindays_destroyed".to_string()), + _1y_to_18m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_1y_to_18m_old_coindays_destroyed".to_string()), + _18m_to_2y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_18m_to_2y_old_coindays_destroyed".to_string()), + _2y_to_3y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_2y_to_3y_old_coindays_destroyed".to_string()), + _3y_to_4y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_3y_to_4y_old_coindays_destroyed".to_string()), + _4y_to_5y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_4y_to_5y_old_coindays_destroyed".to_string()), + _5y_to_6y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_5y_to_6y_old_coindays_destroyed".to_string()), + _6y_to_7y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_6y_to_7y_old_coindays_destroyed".to_string()), + _7y_to_8y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_7y_to_8y_old_coindays_destroyed".to_string()), + _8y_to_10y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_8y_to_10y_old_coindays_destroyed".to_string()), + _10y_to_12y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_10y_to_12y_old_coindays_destroyed".to_string()), + _12y_to_15y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_12y_to_15y_old_coindays_destroyed".to_string()), + over_15y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_15y_old_coindays_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Under { + pub _1w: AverageBlockCumulativeSumPattern, + pub _1m: AverageBlockCumulativeSumPattern, + pub _2m: AverageBlockCumulativeSumPattern, + pub _3m: AverageBlockCumulativeSumPattern, + pub _4m: AverageBlockCumulativeSumPattern, + pub _5m: AverageBlockCumulativeSumPattern, + pub _6m: AverageBlockCumulativeSumPattern, + pub _9m: AverageBlockCumulativeSumPattern, + pub _1y: AverageBlockCumulativeSumPattern, + pub _18m: AverageBlockCumulativeSumPattern, + pub _2y: AverageBlockCumulativeSumPattern, + pub _3y: AverageBlockCumulativeSumPattern, + pub _4y: AverageBlockCumulativeSumPattern, + pub _5y: AverageBlockCumulativeSumPattern, + pub _6y: AverageBlockCumulativeSumPattern, + pub _7y: AverageBlockCumulativeSumPattern, + pub _8y: AverageBlockCumulativeSumPattern, + pub _10y: AverageBlockCumulativeSumPattern, + pub _12y: AverageBlockCumulativeSumPattern, + pub _15y: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1w_old_coindays_destroyed".to_string()), + _1m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1m_old_coindays_destroyed".to_string()), + _2m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_2m_old_coindays_destroyed".to_string()), + _3m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_3m_old_coindays_destroyed".to_string()), + _4m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_4m_old_coindays_destroyed".to_string()), + _5m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_5m_old_coindays_destroyed".to_string()), + _6m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_6m_old_coindays_destroyed".to_string()), + _9m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_9m_old_coindays_destroyed".to_string()), + _1y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_1y_old_coindays_destroyed".to_string()), + _18m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_18m_old_coindays_destroyed".to_string()), + _2y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_2y_old_coindays_destroyed".to_string()), + _3y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_3y_old_coindays_destroyed".to_string()), + _4y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_4y_old_coindays_destroyed".to_string()), + _5y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_5y_old_coindays_destroyed".to_string()), + _6y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_6y_old_coindays_destroyed".to_string()), + _7y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_7y_old_coindays_destroyed".to_string()), + _8y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_8y_old_coindays_destroyed".to_string()), + _10y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_10y_old_coindays_destroyed".to_string()), + _12y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_12y_old_coindays_destroyed".to_string()), + _15y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_under_15y_old_coindays_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Over { + pub _1d: AverageBlockCumulativeSumPattern, + pub _1w: AverageBlockCumulativeSumPattern, + pub _1m: AverageBlockCumulativeSumPattern, + pub _2m: AverageBlockCumulativeSumPattern, + pub _3m: AverageBlockCumulativeSumPattern, + pub _4m: AverageBlockCumulativeSumPattern, + pub _5m: AverageBlockCumulativeSumPattern, + pub _6m: AverageBlockCumulativeSumPattern, + pub _9m: AverageBlockCumulativeSumPattern, + pub _1y: AverageBlockCumulativeSumPattern, + pub _18m: AverageBlockCumulativeSumPattern, + pub _2y: AverageBlockCumulativeSumPattern, + pub _3y: AverageBlockCumulativeSumPattern, + pub _4y: AverageBlockCumulativeSumPattern, + pub _5y: AverageBlockCumulativeSumPattern, + pub _6y: AverageBlockCumulativeSumPattern, + pub _7y: AverageBlockCumulativeSumPattern, + pub _8y: AverageBlockCumulativeSumPattern, + pub _10y: AverageBlockCumulativeSumPattern, + pub _12y: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1d_old_coindays_destroyed".to_string()), + _1w: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1w_old_coindays_destroyed".to_string()), + _1m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1m_old_coindays_destroyed".to_string()), + _2m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_2m_old_coindays_destroyed".to_string()), + _3m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_3m_old_coindays_destroyed".to_string()), + _4m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_4m_old_coindays_destroyed".to_string()), + _5m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_5m_old_coindays_destroyed".to_string()), + _6m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_6m_old_coindays_destroyed".to_string()), + _9m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_9m_old_coindays_destroyed".to_string()), + _1y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_1y_old_coindays_destroyed".to_string()), + _18m: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_18m_old_coindays_destroyed".to_string()), + _2y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_2y_old_coindays_destroyed".to_string()), + _3y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_3y_old_coindays_destroyed".to_string()), + _4y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_4y_old_coindays_destroyed".to_string()), + _5y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_5y_old_coindays_destroyed".to_string()), + _6y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_6y_old_coindays_destroyed".to_string()), + _7y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_7y_old_coindays_destroyed".to_string()), + _8y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_8y_old_coindays_destroyed".to_string()), + _10y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_10y_old_coindays_destroyed".to_string()), + _12y: AverageBlockCumulativeSumPattern::new(client.clone(), "utxos_over_12y_old_coindays_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Epoch { + pub _0: AverageBlockCumulativeSumPattern, + pub _1: AverageBlockCumulativeSumPattern, + pub _2: AverageBlockCumulativeSumPattern, + pub _3: AverageBlockCumulativeSumPattern, + pub _4: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_0_coindays_destroyed".to_string()), + _1: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_1_coindays_destroyed".to_string()), + _2: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_2_coindays_destroyed".to_string()), + _3: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_3_coindays_destroyed".to_string()), + _4: AverageBlockCumulativeSumPattern::new(client.clone(), "epoch_4_coindays_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Class { + pub _2009: AverageBlockCumulativeSumPattern, + pub _2010: AverageBlockCumulativeSumPattern, + pub _2011: AverageBlockCumulativeSumPattern, + pub _2012: AverageBlockCumulativeSumPattern, + pub _2013: AverageBlockCumulativeSumPattern, + pub _2014: AverageBlockCumulativeSumPattern, + pub _2015: AverageBlockCumulativeSumPattern, + pub _2016: AverageBlockCumulativeSumPattern, + pub _2017: AverageBlockCumulativeSumPattern, + pub _2018: AverageBlockCumulativeSumPattern, + pub _2019: AverageBlockCumulativeSumPattern, + pub _2020: AverageBlockCumulativeSumPattern, + pub _2021: AverageBlockCumulativeSumPattern, + pub _2022: AverageBlockCumulativeSumPattern, + pub _2023: AverageBlockCumulativeSumPattern, + pub _2024: AverageBlockCumulativeSumPattern, + pub _2025: AverageBlockCumulativeSumPattern, + pub _2026: AverageBlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2009_coindays_destroyed".to_string()), + _2010: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2010_coindays_destroyed".to_string()), + _2011: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2011_coindays_destroyed".to_string()), + _2012: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2012_coindays_destroyed".to_string()), + _2013: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2013_coindays_destroyed".to_string()), + _2014: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2014_coindays_destroyed".to_string()), + _2015: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2015_coindays_destroyed".to_string()), + _2016: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2016_coindays_destroyed".to_string()), + _2017: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2017_coindays_destroyed".to_string()), + _2018: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2018_coindays_destroyed".to_string()), + _2019: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2019_coindays_destroyed".to_string()), + _2020: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2020_coindays_destroyed".to_string()), + _2021: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2021_coindays_destroyed".to_string()), + _2022: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2022_coindays_destroyed".to_string()), + _2023: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2023_coindays_destroyed".to_string()), + _2024: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2024_coindays_destroyed".to_string()), + _2025: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2025_coindays_destroyed".to_string()), + _2026: AverageBlockCumulativeSumPattern::new(client.clone(), "class_2026_coindays_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_CoinyearsDestroyed { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_CoinyearsDestroyed { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "all_coinyears_destroyed".to_string()), + sth: SeriesPattern1::new(client.clone(), "sth_coinyears_destroyed".to_string()), + lth: SeriesPattern1::new(client.clone(), "lth_coinyears_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Activity_Dormancy { + pub all: _1m1w1y24hHeightPattern, + pub sth: _1m1w1y24hHeightPattern, + pub lth: _1m1w1y24hHeightPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Activity_Dormancy { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: _1m1w1y24hHeightPattern::new(client.clone(), "all_dormancy".to_string()), + sth: _1m1w1y24hHeightPattern::new(client.clone(), "sth_dormancy".to_string()), + lth: _1m1w1y24hHeightPattern::new(client.clone(), "lth_dormancy".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized { + pub cap: SeriesTree_Cohorts_Cohorts_Realized_Cap, + pub price: SeriesTree_Cohorts_Cohorts_Realized_Price, + pub profit: SeriesTree_Cohorts_Cohorts_Realized_Profit, + pub loss: SeriesTree_Cohorts_Cohorts_Realized_Loss, + pub net_pnl: SeriesTree_Cohorts_Cohorts_Realized_NetPnl, + pub sopr: SeriesTree_Cohorts_Cohorts_Realized_Sopr, + pub adjusted_sopr: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr, + pub gross_pnl: SeriesTree_Cohorts_Cohorts_Realized_GrossPnl, + pub capitalized_price: SeriesTree_Cohorts_Cohorts_Realized_CapitalizedPrice, + pub cap_raw: MatrixPattern, + pub capitalized_cap_raw: MatrixPattern, + pub peak_regret: SeriesTree_Cohorts_Cohorts_Realized_PeakRegret, + pub net_pnl_change_1m_to_rcap: SeriesTree_Cohorts_Cohorts_Realized_NetPnlChange1mToRcap, + pub sell_side_risk_ratio: SeriesTree_Cohorts_Cohorts_Realized_SellSideRiskRatio, + pub sopr_ratio_extended: SeriesTree_Cohorts_Cohorts_Realized_SoprRatioExtended, + pub profit_to_loss_ratio: SeriesTree_Cohorts_Cohorts_Realized_ProfitToLossRatio, + pub mvrv: SeriesTree_Cohorts_Cohorts_Realized_Mvrv, +} + +impl SeriesTree_Cohorts_Cohorts_Realized { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + cap: SeriesTree_Cohorts_Cohorts_Realized_Cap::new(client.clone(), format!("{base_path}_cap")), + price: SeriesTree_Cohorts_Cohorts_Realized_Price::new(client.clone(), format!("{base_path}_price")), + profit: SeriesTree_Cohorts_Cohorts_Realized_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Cohorts_Realized_Loss::new(client.clone(), format!("{base_path}_loss")), + net_pnl: SeriesTree_Cohorts_Cohorts_Realized_NetPnl::new(client.clone(), format!("{base_path}_net_pnl")), + sopr: SeriesTree_Cohorts_Cohorts_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), + adjusted_sopr: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr::new(client.clone(), format!("{base_path}_adjusted_sopr")), + gross_pnl: SeriesTree_Cohorts_Cohorts_Realized_GrossPnl::new(client.clone(), format!("{base_path}_gross_pnl")), + capitalized_price: SeriesTree_Cohorts_Cohorts_Realized_CapitalizedPrice::new(client.clone(), format!("{base_path}_capitalized_price")), + cap_raw: MatrixPattern::new(client.clone(), "cap_raw_by_term".to_string()), + capitalized_cap_raw: MatrixPattern::new(client.clone(), "capitalized_cap_raw_by_term".to_string()), + peak_regret: SeriesTree_Cohorts_Cohorts_Realized_PeakRegret::new(client.clone(), format!("{base_path}_peak_regret")), + net_pnl_change_1m_to_rcap: SeriesTree_Cohorts_Cohorts_Realized_NetPnlChange1mToRcap::new(client.clone(), format!("{base_path}_net_pnl_change_1m_to_rcap")), + sell_side_risk_ratio: SeriesTree_Cohorts_Cohorts_Realized_SellSideRiskRatio::new(client.clone(), format!("{base_path}_sell_side_risk_ratio")), + sopr_ratio_extended: SeriesTree_Cohorts_Cohorts_Realized_SoprRatioExtended::new(client.clone(), format!("{base_path}_sopr_ratio_extended")), + profit_to_loss_ratio: SeriesTree_Cohorts_Cohorts_Realized_ProfitToLossRatio::new(client.clone(), format!("{base_path}_profit_to_loss_ratio")), + mvrv: SeriesTree_Cohorts_Cohorts_Realized_Mvrv::new(client.clone(), format!("{base_path}_mvrv")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap { + pub all: CentsDeltaUsdPattern, + pub age: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Realized_Cap_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Realized_Cap_Class, + pub entry: SeriesTree_Cohorts_Cohorts_Realized_Cap_Entry, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Cap_UtxoAmount, + pub term: SeriesTree_Cohorts_Cohorts_Realized_Cap_Term, + pub type_: SeriesTree_Cohorts_Cohorts_Realized_Cap_Type, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, + pub amount_range_matrix: SeriesPattern18, + pub addr_balance: SeriesTree_Cohorts_Cohorts_Realized_Cap_AddrBalance, + pub to_own_mcap: AllLthSthPattern5, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsDeltaUsdPattern::new(client.clone(), "realized_cap".to_string()), + age: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Realized_Cap_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Realized_Cap_Class::new(client.clone(), format!("{base_path}_class")), + entry: SeriesTree_Cohorts_Cohorts_Realized_Cap_Entry::new(client.clone(), format!("{base_path}_entry")), + utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Cap_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: SeriesTree_Cohorts_Cohorts_Realized_Cap_Term::new(client.clone(), format!("{base_path}_term")), + type_: SeriesTree_Cohorts_Cohorts_Realized_Cap_Type::new(client.clone(), format!("{base_path}_type")), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_cap_cents_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "realized_cap_cents_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "realized_cap_cents_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "realized_cap_cents_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "realized_cap_cents_by_type".to_string()), + amount_range_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_cap_cents_by_amount_range".to_string()), + addr_balance: SeriesTree_Cohorts_Cohorts_Realized_Cap_AddrBalance::new(client.clone(), format!("{base_path}_addr_balance")), + to_own_mcap: AllLthSthPattern5::new(client.clone(), "realized_cap_to_own_mcap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_Age { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Range { + pub under_1h: CentsDeltaUsdPattern, + pub _1h_to_1d: CentsDeltaUsdPattern, + pub _1d_to_1w: CentsDeltaUsdPattern, + pub _1w_to_1m: CentsDeltaUsdPattern, + pub _1m_to_2m: CentsDeltaUsdPattern, + pub _2m_to_3m: CentsDeltaUsdPattern, + pub _3m_to_4m: CentsDeltaUsdPattern, + pub _4m_to_5m: CentsDeltaUsdPattern, + pub _5m_to_6m: CentsDeltaUsdPattern, + pub _6m_to_9m: CentsDeltaUsdPattern, + pub _9m_to_1y: CentsDeltaUsdPattern, + pub _1y_to_18m: CentsDeltaUsdPattern, + pub _18m_to_2y: CentsDeltaUsdPattern, + pub _2y_to_3y: CentsDeltaUsdPattern, + pub _3y_to_4y: CentsDeltaUsdPattern, + pub _4y_to_5y: CentsDeltaUsdPattern, + pub _5y_to_6y: CentsDeltaUsdPattern, + pub _6y_to_7y: CentsDeltaUsdPattern, + pub _7y_to_8y: CentsDeltaUsdPattern, + pub _8y_to_10y: CentsDeltaUsdPattern, + pub _10y_to_12y: CentsDeltaUsdPattern, + pub _12y_to_15y: CentsDeltaUsdPattern, + pub over_15y: CentsDeltaUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_1h_old_realized_cap".to_string()), + _1h_to_1d: CentsDeltaUsdPattern::new(client.clone(), "utxos_1h_to_1d_old_realized_cap".to_string()), + _1d_to_1w: CentsDeltaUsdPattern::new(client.clone(), "utxos_1d_to_1w_old_realized_cap".to_string()), + _1w_to_1m: CentsDeltaUsdPattern::new(client.clone(), "utxos_1w_to_1m_old_realized_cap".to_string()), + _1m_to_2m: CentsDeltaUsdPattern::new(client.clone(), "utxos_1m_to_2m_old_realized_cap".to_string()), + _2m_to_3m: CentsDeltaUsdPattern::new(client.clone(), "utxos_2m_to_3m_old_realized_cap".to_string()), + _3m_to_4m: CentsDeltaUsdPattern::new(client.clone(), "utxos_3m_to_4m_old_realized_cap".to_string()), + _4m_to_5m: CentsDeltaUsdPattern::new(client.clone(), "utxos_4m_to_5m_old_realized_cap".to_string()), + _5m_to_6m: CentsDeltaUsdPattern::new(client.clone(), "utxos_5m_to_6m_old_realized_cap".to_string()), + _6m_to_9m: CentsDeltaUsdPattern::new(client.clone(), "utxos_6m_to_9m_old_realized_cap".to_string()), + _9m_to_1y: CentsDeltaUsdPattern::new(client.clone(), "utxos_9m_to_1y_old_realized_cap".to_string()), + _1y_to_18m: CentsDeltaUsdPattern::new(client.clone(), "utxos_1y_to_18m_old_realized_cap".to_string()), + _18m_to_2y: CentsDeltaUsdPattern::new(client.clone(), "utxos_18m_to_2y_old_realized_cap".to_string()), + _2y_to_3y: CentsDeltaUsdPattern::new(client.clone(), "utxos_2y_to_3y_old_realized_cap".to_string()), + _3y_to_4y: CentsDeltaUsdPattern::new(client.clone(), "utxos_3y_to_4y_old_realized_cap".to_string()), + _4y_to_5y: CentsDeltaUsdPattern::new(client.clone(), "utxos_4y_to_5y_old_realized_cap".to_string()), + _5y_to_6y: CentsDeltaUsdPattern::new(client.clone(), "utxos_5y_to_6y_old_realized_cap".to_string()), + _6y_to_7y: CentsDeltaUsdPattern::new(client.clone(), "utxos_6y_to_7y_old_realized_cap".to_string()), + _7y_to_8y: CentsDeltaUsdPattern::new(client.clone(), "utxos_7y_to_8y_old_realized_cap".to_string()), + _8y_to_10y: CentsDeltaUsdPattern::new(client.clone(), "utxos_8y_to_10y_old_realized_cap".to_string()), + _10y_to_12y: CentsDeltaUsdPattern::new(client.clone(), "utxos_10y_to_12y_old_realized_cap".to_string()), + _12y_to_15y: CentsDeltaUsdPattern::new(client.clone(), "utxos_12y_to_15y_old_realized_cap".to_string()), + over_15y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_15y_old_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Under { + pub _1w: CentsDeltaUsdPattern, + pub _1m: CentsDeltaUsdPattern, + pub _2m: CentsDeltaUsdPattern, + pub _3m: CentsDeltaUsdPattern, + pub _4m: CentsDeltaUsdPattern, + pub _5m: CentsDeltaUsdPattern, + pub _6m: CentsDeltaUsdPattern, + pub _9m: CentsDeltaUsdPattern, + pub _1y: CentsDeltaUsdPattern, + pub _18m: CentsDeltaUsdPattern, + pub _2y: CentsDeltaUsdPattern, + pub _3y: CentsDeltaUsdPattern, + pub _4y: CentsDeltaUsdPattern, + pub _5y: CentsDeltaUsdPattern, + pub _6y: CentsDeltaUsdPattern, + pub _7y: CentsDeltaUsdPattern, + pub _8y: CentsDeltaUsdPattern, + pub _10y: CentsDeltaUsdPattern, + pub _12y: CentsDeltaUsdPattern, + pub _15y: CentsDeltaUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_1w_old_realized_cap".to_string()), + _1m: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_1m_old_realized_cap".to_string()), + _2m: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_2m_old_realized_cap".to_string()), + _3m: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_3m_old_realized_cap".to_string()), + _4m: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_4m_old_realized_cap".to_string()), + _5m: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_5m_old_realized_cap".to_string()), + _6m: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_6m_old_realized_cap".to_string()), + _9m: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_9m_old_realized_cap".to_string()), + _1y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_1y_old_realized_cap".to_string()), + _18m: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_18m_old_realized_cap".to_string()), + _2y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_2y_old_realized_cap".to_string()), + _3y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_3y_old_realized_cap".to_string()), + _4y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_4y_old_realized_cap".to_string()), + _5y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_5y_old_realized_cap".to_string()), + _6y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_6y_old_realized_cap".to_string()), + _7y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_7y_old_realized_cap".to_string()), + _8y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_8y_old_realized_cap".to_string()), + _10y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_10y_old_realized_cap".to_string()), + _12y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_12y_old_realized_cap".to_string()), + _15y: CentsDeltaUsdPattern::new(client.clone(), "utxos_under_15y_old_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Over { + pub _1d: CentsDeltaUsdPattern, + pub _1w: CentsDeltaUsdPattern, + pub _1m: CentsDeltaUsdPattern, + pub _2m: CentsDeltaUsdPattern, + pub _3m: CentsDeltaUsdPattern, + pub _4m: CentsDeltaUsdPattern, + pub _5m: CentsDeltaUsdPattern, + pub _6m: CentsDeltaUsdPattern, + pub _9m: CentsDeltaUsdPattern, + pub _1y: CentsDeltaUsdPattern, + pub _18m: CentsDeltaUsdPattern, + pub _2y: CentsDeltaUsdPattern, + pub _3y: CentsDeltaUsdPattern, + pub _4y: CentsDeltaUsdPattern, + pub _5y: CentsDeltaUsdPattern, + pub _6y: CentsDeltaUsdPattern, + pub _7y: CentsDeltaUsdPattern, + pub _8y: CentsDeltaUsdPattern, + pub _10y: CentsDeltaUsdPattern, + pub _12y: CentsDeltaUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_1d_old_realized_cap".to_string()), + _1w: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_1w_old_realized_cap".to_string()), + _1m: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_1m_old_realized_cap".to_string()), + _2m: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_2m_old_realized_cap".to_string()), + _3m: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_3m_old_realized_cap".to_string()), + _4m: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_4m_old_realized_cap".to_string()), + _5m: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_5m_old_realized_cap".to_string()), + _6m: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_6m_old_realized_cap".to_string()), + _9m: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_9m_old_realized_cap".to_string()), + _1y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_1y_old_realized_cap".to_string()), + _18m: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_18m_old_realized_cap".to_string()), + _2y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_2y_old_realized_cap".to_string()), + _3y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_3y_old_realized_cap".to_string()), + _4y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_4y_old_realized_cap".to_string()), + _5y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_5y_old_realized_cap".to_string()), + _6y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_6y_old_realized_cap".to_string()), + _7y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_7y_old_realized_cap".to_string()), + _8y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_8y_old_realized_cap".to_string()), + _10y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_10y_old_realized_cap".to_string()), + _12y: CentsDeltaUsdPattern::new(client.clone(), "utxos_over_12y_old_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_Epoch { + pub _0: CentsDeltaUsdPattern, + pub _1: CentsDeltaUsdPattern, + pub _2: CentsDeltaUsdPattern, + pub _3: CentsDeltaUsdPattern, + pub _4: CentsDeltaUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: CentsDeltaUsdPattern::new(client.clone(), "epoch_0_realized_cap".to_string()), + _1: CentsDeltaUsdPattern::new(client.clone(), "epoch_1_realized_cap".to_string()), + _2: CentsDeltaUsdPattern::new(client.clone(), "epoch_2_realized_cap".to_string()), + _3: CentsDeltaUsdPattern::new(client.clone(), "epoch_3_realized_cap".to_string()), + _4: CentsDeltaUsdPattern::new(client.clone(), "epoch_4_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_Class { + pub _2009: CentsDeltaUsdPattern, + pub _2010: CentsDeltaUsdPattern, + pub _2011: CentsDeltaUsdPattern, + pub _2012: CentsDeltaUsdPattern, + pub _2013: CentsDeltaUsdPattern, + pub _2014: CentsDeltaUsdPattern, + pub _2015: CentsDeltaUsdPattern, + pub _2016: CentsDeltaUsdPattern, + pub _2017: CentsDeltaUsdPattern, + pub _2018: CentsDeltaUsdPattern, + pub _2019: CentsDeltaUsdPattern, + pub _2020: CentsDeltaUsdPattern, + pub _2021: CentsDeltaUsdPattern, + pub _2022: CentsDeltaUsdPattern, + pub _2023: CentsDeltaUsdPattern, + pub _2024: CentsDeltaUsdPattern, + pub _2025: CentsDeltaUsdPattern, + pub _2026: CentsDeltaUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: CentsDeltaUsdPattern::new(client.clone(), "class_2009_realized_cap".to_string()), + _2010: CentsDeltaUsdPattern::new(client.clone(), "class_2010_realized_cap".to_string()), + _2011: CentsDeltaUsdPattern::new(client.clone(), "class_2011_realized_cap".to_string()), + _2012: CentsDeltaUsdPattern::new(client.clone(), "class_2012_realized_cap".to_string()), + _2013: CentsDeltaUsdPattern::new(client.clone(), "class_2013_realized_cap".to_string()), + _2014: CentsDeltaUsdPattern::new(client.clone(), "class_2014_realized_cap".to_string()), + _2015: CentsDeltaUsdPattern::new(client.clone(), "class_2015_realized_cap".to_string()), + _2016: CentsDeltaUsdPattern::new(client.clone(), "class_2016_realized_cap".to_string()), + _2017: CentsDeltaUsdPattern::new(client.clone(), "class_2017_realized_cap".to_string()), + _2018: CentsDeltaUsdPattern::new(client.clone(), "class_2018_realized_cap".to_string()), + _2019: CentsDeltaUsdPattern::new(client.clone(), "class_2019_realized_cap".to_string()), + _2020: CentsDeltaUsdPattern::new(client.clone(), "class_2020_realized_cap".to_string()), + _2021: CentsDeltaUsdPattern::new(client.clone(), "class_2021_realized_cap".to_string()), + _2022: CentsDeltaUsdPattern::new(client.clone(), "class_2022_realized_cap".to_string()), + _2023: CentsDeltaUsdPattern::new(client.clone(), "class_2023_realized_cap".to_string()), + _2024: CentsDeltaUsdPattern::new(client.clone(), "class_2024_realized_cap".to_string()), + _2025: CentsDeltaUsdPattern::new(client.clone(), "class_2025_realized_cap".to_string()), + _2026: CentsDeltaUsdPattern::new(client.clone(), "class_2026_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_Entry { + pub discount: CentsDeltaUsdPattern, + pub premium: CentsDeltaUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_Entry { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: CentsDeltaUsdPattern::new(client.clone(), "veteran_realized_cap".to_string()), + premium: CentsDeltaUsdPattern::new(client.clone(), "rookie_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_UtxoAmount { + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4, + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_UtxoAmount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4::new(client.clone(), "utxos".to_string()), + under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4::new(client.clone(), "utxos_under".to_string()), + over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4::new(client.clone(), "utxos_over".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_Term { + pub short: CentsDeltaUsdPattern, + pub long: CentsDeltaUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_Term { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: CentsDeltaUsdPattern::new(client.clone(), "sth_realized_cap".to_string()), + long: CentsDeltaUsdPattern::new(client.clone(), "lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_Type { + pub p2pk65: CentsDeltaUsdPattern, + pub p2pk33: CentsDeltaUsdPattern, + pub p2pkh: CentsDeltaUsdPattern, + pub p2ms: CentsDeltaUsdPattern, + pub p2sh: CentsDeltaUsdPattern, + pub p2wpkh: CentsDeltaUsdPattern, + pub p2wsh: CentsDeltaUsdPattern, + pub p2tr: CentsDeltaUsdPattern, + pub p2a: CentsDeltaUsdPattern, + pub unknown: CentsDeltaUsdPattern, + pub empty: CentsDeltaUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_Type { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + p2pk65: CentsDeltaUsdPattern::new(client.clone(), "p2pk65_realized_cap".to_string()), + p2pk33: CentsDeltaUsdPattern::new(client.clone(), "p2pk33_realized_cap".to_string()), + p2pkh: CentsDeltaUsdPattern::new(client.clone(), "p2pkh_realized_cap".to_string()), + p2ms: CentsDeltaUsdPattern::new(client.clone(), "p2ms_realized_cap".to_string()), + p2sh: CentsDeltaUsdPattern::new(client.clone(), "p2sh_realized_cap".to_string()), + p2wpkh: CentsDeltaUsdPattern::new(client.clone(), "p2wpkh_realized_cap".to_string()), + p2wsh: CentsDeltaUsdPattern::new(client.clone(), "p2wsh_realized_cap".to_string()), + p2tr: CentsDeltaUsdPattern::new(client.clone(), "p2tr_realized_cap".to_string()), + p2a: CentsDeltaUsdPattern::new(client.clone(), "p2a_realized_cap".to_string()), + unknown: CentsDeltaUsdPattern::new(client.clone(), "unknown_outputs_realized_cap".to_string()), + empty: CentsDeltaUsdPattern::new(client.clone(), "empty_outputs_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Cap_AddrBalance { + pub range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4, + pub under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4, + pub over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4, + pub matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Cap_AddrBalance { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4::new(client.clone(), "addrs".to_string()), + under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4::new(client.clone(), "addrs_under".to_string()), + over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4::new(client.clone(), "addrs_over".to_string()), + matrix: SeriesPattern18::new(client.clone(), "addrs_realized_cap_cents_by_balance_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price { + pub all: CentsPpmRatioSatsUsdPattern, + pub age: SeriesTree_Cohorts_Cohorts_Realized_Price_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Realized_Price_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Realized_Price_Class, + pub entry: SeriesTree_Cohorts_Cohorts_Realized_Price_Entry, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount, + pub term: SeriesTree_Cohorts_Cohorts_Realized_Price_Term, + pub type_: SeriesTree_Cohorts_Cohorts_Realized_Price_Type, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, + pub amount_range_matrix: SeriesPattern18, + pub aggregate_matrix: SeriesPattern18, + pub under_age_matrix: SeriesPattern18, + pub over_age_matrix: SeriesPattern18, + pub under_amount_matrix: SeriesPattern18, + pub over_amount_matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsPpmRatioSatsUsdPattern::new(client.clone(), "realized_price".to_string()), + age: SeriesTree_Cohorts_Cohorts_Realized_Price_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Realized_Price_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Realized_Price_Class::new(client.clone(), format!("{base_path}_class")), + entry: SeriesTree_Cohorts_Cohorts_Realized_Price_Entry::new(client.clone(), format!("{base_path}_entry")), + utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: SeriesTree_Cohorts_Cohorts_Realized_Price_Term::new(client.clone(), format!("{base_path}_term")), + type_: SeriesTree_Cohorts_Cohorts_Realized_Price_Type::new(client.clone(), format!("{base_path}_type")), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_price_cents_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "realized_price_cents_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "realized_price_cents_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "realized_price_cents_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "realized_price_cents_by_type".to_string()), + amount_range_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_price_cents_by_amount_range".to_string()), + aggregate_matrix: SeriesPattern18::new(client.clone(), "realized_price_cents_by_aggregate".to_string()), + under_age_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_price_cents_by_under_age".to_string()), + over_age_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_price_cents_by_over_age".to_string()), + under_amount_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_price_cents_by_under_amount".to_string()), + over_amount_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_price_cents_by_over_amount".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_Age { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Range { + pub under_1h: CentsPpmRatioSatsUsdPattern, + pub _1h_to_1d: CentsPpmRatioSatsUsdPattern, + pub _1d_to_1w: CentsPpmRatioSatsUsdPattern, + pub _1w_to_1m: CentsPpmRatioSatsUsdPattern, + pub _1m_to_2m: CentsPpmRatioSatsUsdPattern, + pub _2m_to_3m: CentsPpmRatioSatsUsdPattern, + pub _3m_to_4m: CentsPpmRatioSatsUsdPattern, + pub _4m_to_5m: CentsPpmRatioSatsUsdPattern, + pub _5m_to_6m: CentsPpmRatioSatsUsdPattern, + pub _6m_to_9m: CentsPpmRatioSatsUsdPattern, + pub _9m_to_1y: CentsPpmRatioSatsUsdPattern, + pub _1y_to_18m: CentsPpmRatioSatsUsdPattern, + pub _18m_to_2y: CentsPpmRatioSatsUsdPattern, + pub _2y_to_3y: CentsPpmRatioSatsUsdPattern, + pub _3y_to_4y: CentsPpmRatioSatsUsdPattern, + pub _4y_to_5y: CentsPpmRatioSatsUsdPattern, + pub _5y_to_6y: CentsPpmRatioSatsUsdPattern, + pub _6y_to_7y: CentsPpmRatioSatsUsdPattern, + pub _7y_to_8y: CentsPpmRatioSatsUsdPattern, + pub _8y_to_10y: CentsPpmRatioSatsUsdPattern, + pub _10y_to_12y: CentsPpmRatioSatsUsdPattern, + pub _12y_to_15y: CentsPpmRatioSatsUsdPattern, + pub over_15y: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_1h_old_realized_price".to_string()), + _1h_to_1d: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1h_to_1d_old_realized_price".to_string()), + _1d_to_1w: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1d_to_1w_old_realized_price".to_string()), + _1w_to_1m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1w_to_1m_old_realized_price".to_string()), + _1m_to_2m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1m_to_2m_old_realized_price".to_string()), + _2m_to_3m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_2m_to_3m_old_realized_price".to_string()), + _3m_to_4m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_3m_to_4m_old_realized_price".to_string()), + _4m_to_5m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_4m_to_5m_old_realized_price".to_string()), + _5m_to_6m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_5m_to_6m_old_realized_price".to_string()), + _6m_to_9m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_6m_to_9m_old_realized_price".to_string()), + _9m_to_1y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_9m_to_1y_old_realized_price".to_string()), + _1y_to_18m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1y_to_18m_old_realized_price".to_string()), + _18m_to_2y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_18m_to_2y_old_realized_price".to_string()), + _2y_to_3y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_2y_to_3y_old_realized_price".to_string()), + _3y_to_4y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_3y_to_4y_old_realized_price".to_string()), + _4y_to_5y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_4y_to_5y_old_realized_price".to_string()), + _5y_to_6y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_5y_to_6y_old_realized_price".to_string()), + _6y_to_7y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_6y_to_7y_old_realized_price".to_string()), + _7y_to_8y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_7y_to_8y_old_realized_price".to_string()), + _8y_to_10y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_8y_to_10y_old_realized_price".to_string()), + _10y_to_12y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_10y_to_12y_old_realized_price".to_string()), + _12y_to_15y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_12y_to_15y_old_realized_price".to_string()), + over_15y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_15y_old_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Under { + pub _1w: CentsPpmRatioSatsUsdPattern, + pub _1m: CentsPpmRatioSatsUsdPattern, + pub _2m: CentsPpmRatioSatsUsdPattern, + pub _3m: CentsPpmRatioSatsUsdPattern, + pub _4m: CentsPpmRatioSatsUsdPattern, + pub _5m: CentsPpmRatioSatsUsdPattern, + pub _6m: CentsPpmRatioSatsUsdPattern, + pub _9m: CentsPpmRatioSatsUsdPattern, + pub _1y: CentsPpmRatioSatsUsdPattern, + pub _18m: CentsPpmRatioSatsUsdPattern, + pub _2y: CentsPpmRatioSatsUsdPattern, + pub _3y: CentsPpmRatioSatsUsdPattern, + pub _4y: CentsPpmRatioSatsUsdPattern, + pub _5y: CentsPpmRatioSatsUsdPattern, + pub _6y: CentsPpmRatioSatsUsdPattern, + pub _7y: CentsPpmRatioSatsUsdPattern, + pub _8y: CentsPpmRatioSatsUsdPattern, + pub _10y: CentsPpmRatioSatsUsdPattern, + pub _12y: CentsPpmRatioSatsUsdPattern, + pub _15y: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_1w_old_realized_price".to_string()), + _1m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_1m_old_realized_price".to_string()), + _2m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_2m_old_realized_price".to_string()), + _3m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_3m_old_realized_price".to_string()), + _4m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_4m_old_realized_price".to_string()), + _5m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_5m_old_realized_price".to_string()), + _6m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_6m_old_realized_price".to_string()), + _9m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_9m_old_realized_price".to_string()), + _1y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_1y_old_realized_price".to_string()), + _18m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_18m_old_realized_price".to_string()), + _2y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_2y_old_realized_price".to_string()), + _3y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_3y_old_realized_price".to_string()), + _4y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_4y_old_realized_price".to_string()), + _5y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_5y_old_realized_price".to_string()), + _6y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_6y_old_realized_price".to_string()), + _7y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_7y_old_realized_price".to_string()), + _8y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_8y_old_realized_price".to_string()), + _10y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_10y_old_realized_price".to_string()), + _12y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_12y_old_realized_price".to_string()), + _15y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_15y_old_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Over { + pub _1d: CentsPpmRatioSatsUsdPattern, + pub _1w: CentsPpmRatioSatsUsdPattern, + pub _1m: CentsPpmRatioSatsUsdPattern, + pub _2m: CentsPpmRatioSatsUsdPattern, + pub _3m: CentsPpmRatioSatsUsdPattern, + pub _4m: CentsPpmRatioSatsUsdPattern, + pub _5m: CentsPpmRatioSatsUsdPattern, + pub _6m: CentsPpmRatioSatsUsdPattern, + pub _9m: CentsPpmRatioSatsUsdPattern, + pub _1y: CentsPpmRatioSatsUsdPattern, + pub _18m: CentsPpmRatioSatsUsdPattern, + pub _2y: CentsPpmRatioSatsUsdPattern, + pub _3y: CentsPpmRatioSatsUsdPattern, + pub _4y: CentsPpmRatioSatsUsdPattern, + pub _5y: CentsPpmRatioSatsUsdPattern, + pub _6y: CentsPpmRatioSatsUsdPattern, + pub _7y: CentsPpmRatioSatsUsdPattern, + pub _8y: CentsPpmRatioSatsUsdPattern, + pub _10y: CentsPpmRatioSatsUsdPattern, + pub _12y: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_1d_old_realized_price".to_string()), + _1w: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_1w_old_realized_price".to_string()), + _1m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_1m_old_realized_price".to_string()), + _2m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_2m_old_realized_price".to_string()), + _3m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_3m_old_realized_price".to_string()), + _4m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_4m_old_realized_price".to_string()), + _5m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_5m_old_realized_price".to_string()), + _6m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_6m_old_realized_price".to_string()), + _9m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_9m_old_realized_price".to_string()), + _1y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_1y_old_realized_price".to_string()), + _18m: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_18m_old_realized_price".to_string()), + _2y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_2y_old_realized_price".to_string()), + _3y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_3y_old_realized_price".to_string()), + _4y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_4y_old_realized_price".to_string()), + _5y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_5y_old_realized_price".to_string()), + _6y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_6y_old_realized_price".to_string()), + _7y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_7y_old_realized_price".to_string()), + _8y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_8y_old_realized_price".to_string()), + _10y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_10y_old_realized_price".to_string()), + _12y: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_12y_old_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_Epoch { + pub _0: CentsPpmRatioSatsUsdPattern, + pub _1: CentsPpmRatioSatsUsdPattern, + pub _2: CentsPpmRatioSatsUsdPattern, + pub _3: CentsPpmRatioSatsUsdPattern, + pub _4: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: CentsPpmRatioSatsUsdPattern::new(client.clone(), "epoch_0_realized_price".to_string()), + _1: CentsPpmRatioSatsUsdPattern::new(client.clone(), "epoch_1_realized_price".to_string()), + _2: CentsPpmRatioSatsUsdPattern::new(client.clone(), "epoch_2_realized_price".to_string()), + _3: CentsPpmRatioSatsUsdPattern::new(client.clone(), "epoch_3_realized_price".to_string()), + _4: CentsPpmRatioSatsUsdPattern::new(client.clone(), "epoch_4_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_Class { + pub _2009: CentsPpmRatioSatsUsdPattern, + pub _2010: CentsPpmRatioSatsUsdPattern, + pub _2011: CentsPpmRatioSatsUsdPattern, + pub _2012: CentsPpmRatioSatsUsdPattern, + pub _2013: CentsPpmRatioSatsUsdPattern, + pub _2014: CentsPpmRatioSatsUsdPattern, + pub _2015: CentsPpmRatioSatsUsdPattern, + pub _2016: CentsPpmRatioSatsUsdPattern, + pub _2017: CentsPpmRatioSatsUsdPattern, + pub _2018: CentsPpmRatioSatsUsdPattern, + pub _2019: CentsPpmRatioSatsUsdPattern, + pub _2020: CentsPpmRatioSatsUsdPattern, + pub _2021: CentsPpmRatioSatsUsdPattern, + pub _2022: CentsPpmRatioSatsUsdPattern, + pub _2023: CentsPpmRatioSatsUsdPattern, + pub _2024: CentsPpmRatioSatsUsdPattern, + pub _2025: CentsPpmRatioSatsUsdPattern, + pub _2026: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2009_realized_price".to_string()), + _2010: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2010_realized_price".to_string()), + _2011: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2011_realized_price".to_string()), + _2012: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2012_realized_price".to_string()), + _2013: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2013_realized_price".to_string()), + _2014: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2014_realized_price".to_string()), + _2015: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2015_realized_price".to_string()), + _2016: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2016_realized_price".to_string()), + _2017: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2017_realized_price".to_string()), + _2018: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2018_realized_price".to_string()), + _2019: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2019_realized_price".to_string()), + _2020: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2020_realized_price".to_string()), + _2021: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2021_realized_price".to_string()), + _2022: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2022_realized_price".to_string()), + _2023: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2023_realized_price".to_string()), + _2024: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2024_realized_price".to_string()), + _2025: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2025_realized_price".to_string()), + _2026: CentsPpmRatioSatsUsdPattern::new(client.clone(), "class_2026_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_Entry { + pub discount: CentsPpmRatioSatsUsdPattern, + pub premium: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_Entry { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: CentsPpmRatioSatsUsdPattern::new(client.clone(), "veteran_realized_price".to_string()), + premium: CentsPpmRatioSatsUsdPattern::new(client.clone(), "rookie_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Range { + pub _0sats: CentsPpmRatioSatsUsdPattern, + pub _1sat_to_10sats: CentsPpmRatioSatsUsdPattern, + pub _10sats_to_100sats: CentsPpmRatioSatsUsdPattern, + pub _100sats_to_1k_sats: CentsPpmRatioSatsUsdPattern, + pub _1k_sats_to_10k_sats: CentsPpmRatioSatsUsdPattern, + pub _10k_sats_to_100k_sats: CentsPpmRatioSatsUsdPattern, + pub _100k_sats_to_1m_sats: CentsPpmRatioSatsUsdPattern, + pub _1m_sats_to_10m_sats: CentsPpmRatioSatsUsdPattern, + pub _10m_sats_to_1btc: CentsPpmRatioSatsUsdPattern, + pub _1btc_to_10btc: CentsPpmRatioSatsUsdPattern, + pub _10btc_to_100btc: CentsPpmRatioSatsUsdPattern, + pub _100btc_to_1k_btc: CentsPpmRatioSatsUsdPattern, + pub _1k_btc_to_10k_btc: CentsPpmRatioSatsUsdPattern, + pub _10k_btc_to_100k_btc: CentsPpmRatioSatsUsdPattern, + pub over_100k_btc: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_0sats_realized_price".to_string()), + _1sat_to_10sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1sat_to_10sats_realized_price".to_string()), + _10sats_to_100sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_10sats_to_100sats_realized_price".to_string()), + _100sats_to_1k_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_100sats_to_1k_sats_realized_price".to_string()), + _1k_sats_to_10k_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1k_sats_to_10k_sats_realized_price".to_string()), + _10k_sats_to_100k_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_10k_sats_to_100k_sats_realized_price".to_string()), + _100k_sats_to_1m_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_100k_sats_to_1m_sats_realized_price".to_string()), + _1m_sats_to_10m_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1m_sats_to_10m_sats_realized_price".to_string()), + _10m_sats_to_1btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_10m_sats_to_1btc_realized_price".to_string()), + _1btc_to_10btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1btc_to_10btc_realized_price".to_string()), + _10btc_to_100btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_10btc_to_100btc_realized_price".to_string()), + _100btc_to_1k_btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_100btc_to_1k_btc_realized_price".to_string()), + _1k_btc_to_10k_btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_1k_btc_to_10k_btc_realized_price".to_string()), + _10k_btc_to_100k_btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_10k_btc_to_100k_btc_realized_price".to_string()), + over_100k_btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_100k_btc_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Under { + pub _10sats: CentsPpmRatioSatsUsdPattern, + pub _100sats: CentsPpmRatioSatsUsdPattern, + pub _1k_sats: CentsPpmRatioSatsUsdPattern, + pub _10k_sats: CentsPpmRatioSatsUsdPattern, + pub _100k_sats: CentsPpmRatioSatsUsdPattern, + pub _1m_sats: CentsPpmRatioSatsUsdPattern, + pub _10m_sats: CentsPpmRatioSatsUsdPattern, + pub _1btc: CentsPpmRatioSatsUsdPattern, + pub _10btc: CentsPpmRatioSatsUsdPattern, + pub _100btc: CentsPpmRatioSatsUsdPattern, + pub _1k_btc: CentsPpmRatioSatsUsdPattern, + pub _10k_btc: CentsPpmRatioSatsUsdPattern, + pub _100k_btc: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_10sats_realized_price".to_string()), + _100sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_100sats_realized_price".to_string()), + _1k_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_1k_sats_realized_price".to_string()), + _10k_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_10k_sats_realized_price".to_string()), + _100k_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_100k_sats_realized_price".to_string()), + _1m_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_1m_sats_realized_price".to_string()), + _10m_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_10m_sats_realized_price".to_string()), + _1btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_1btc_realized_price".to_string()), + _10btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_10btc_realized_price".to_string()), + _100btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_100btc_realized_price".to_string()), + _1k_btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_1k_btc_realized_price".to_string()), + _10k_btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_10k_btc_realized_price".to_string()), + _100k_btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_under_100k_btc_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Over { + pub _1sat: CentsPpmRatioSatsUsdPattern, + pub _10sats: CentsPpmRatioSatsUsdPattern, + pub _100sats: CentsPpmRatioSatsUsdPattern, + pub _1k_sats: CentsPpmRatioSatsUsdPattern, + pub _10k_sats: CentsPpmRatioSatsUsdPattern, + pub _100k_sats: CentsPpmRatioSatsUsdPattern, + pub _1m_sats: CentsPpmRatioSatsUsdPattern, + pub _10m_sats: CentsPpmRatioSatsUsdPattern, + pub _1btc: CentsPpmRatioSatsUsdPattern, + pub _10btc: CentsPpmRatioSatsUsdPattern, + pub _100btc: CentsPpmRatioSatsUsdPattern, + pub _1k_btc: CentsPpmRatioSatsUsdPattern, + pub _10k_btc: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_1sat_realized_price".to_string()), + _10sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_10sats_realized_price".to_string()), + _100sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_100sats_realized_price".to_string()), + _1k_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_1k_sats_realized_price".to_string()), + _10k_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_10k_sats_realized_price".to_string()), + _100k_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_100k_sats_realized_price".to_string()), + _1m_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_1m_sats_realized_price".to_string()), + _10m_sats: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_10m_sats_realized_price".to_string()), + _1btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_1btc_realized_price".to_string()), + _10btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_10btc_realized_price".to_string()), + _100btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_100btc_realized_price".to_string()), + _1k_btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_1k_btc_realized_price".to_string()), + _10k_btc: CentsPpmRatioSatsUsdPattern::new(client.clone(), "utxos_over_10k_btc_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_Term { + pub short: CentsPpmRatioSatsUsdPattern, + pub long: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_Term { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: CentsPpmRatioSatsUsdPattern::new(client.clone(), "sth_realized_price".to_string()), + long: CentsPpmRatioSatsUsdPattern::new(client.clone(), "lth_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Price_Type { + pub p2pk65: CentsPpmRatioSatsUsdPattern, + pub p2pk33: CentsPpmRatioSatsUsdPattern, + pub p2pkh: CentsPpmRatioSatsUsdPattern, + pub p2ms: CentsPpmRatioSatsUsdPattern, + pub p2sh: CentsPpmRatioSatsUsdPattern, + pub p2wpkh: CentsPpmRatioSatsUsdPattern, + pub p2wsh: CentsPpmRatioSatsUsdPattern, + pub p2tr: CentsPpmRatioSatsUsdPattern, + pub p2a: CentsPpmRatioSatsUsdPattern, + pub unknown: CentsPpmRatioSatsUsdPattern, + pub empty: CentsPpmRatioSatsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Price_Type { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + p2pk65: CentsPpmRatioSatsUsdPattern::new(client.clone(), "p2pk65_realized_price".to_string()), + p2pk33: CentsPpmRatioSatsUsdPattern::new(client.clone(), "p2pk33_realized_price".to_string()), + p2pkh: CentsPpmRatioSatsUsdPattern::new(client.clone(), "p2pkh_realized_price".to_string()), + p2ms: CentsPpmRatioSatsUsdPattern::new(client.clone(), "p2ms_realized_price".to_string()), + p2sh: CentsPpmRatioSatsUsdPattern::new(client.clone(), "p2sh_realized_price".to_string()), + p2wpkh: CentsPpmRatioSatsUsdPattern::new(client.clone(), "p2wpkh_realized_price".to_string()), + p2wsh: CentsPpmRatioSatsUsdPattern::new(client.clone(), "p2wsh_realized_price".to_string()), + p2tr: CentsPpmRatioSatsUsdPattern::new(client.clone(), "p2tr_realized_price".to_string()), + p2a: CentsPpmRatioSatsUsdPattern::new(client.clone(), "p2a_realized_price".to_string()), + unknown: CentsPpmRatioSatsUsdPattern::new(client.clone(), "unknown_outputs_realized_price".to_string()), + empty: CentsPpmRatioSatsUsdPattern::new(client.clone(), "empty_outputs_realized_price".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit { + pub all: BlockCumulativeSumPattern, + pub age: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Realized_Profit_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Realized_Profit_Class, + pub entry: DiscountPremiumPattern5, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount, + pub term: LongShortPattern6, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, + pub amount_range_matrix: SeriesPattern18, + pub addr_balance: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BlockCumulativeSumPattern::new(client.clone(), "realized_profit".to_string()), + age: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Realized_Profit_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Realized_Profit_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern5::new(client.clone(), "realized_profit".to_string()), + utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: LongShortPattern6::new(client.clone(), "realized_profit".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5::new(client.clone(), "realized_profit".to_string()), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_profit_cumulative_cents_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "realized_profit_cumulative_cents_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "realized_profit_cumulative_cents_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "realized_profit_cumulative_cents_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "realized_profit_cumulative_cents_by_type".to_string()), + amount_range_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_profit_cumulative_cents_by_amount_range".to_string()), + addr_balance: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance::new(client.clone(), format!("{base_path}_addr_balance")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_Age { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Range { + pub under_1h: BlockCumulativeSumPattern, + pub _1h_to_1d: BlockCumulativeSumPattern, + pub _1d_to_1w: BlockCumulativeSumPattern, + pub _1w_to_1m: BlockCumulativeSumPattern, + pub _1m_to_2m: BlockCumulativeSumPattern, + pub _2m_to_3m: BlockCumulativeSumPattern, + pub _3m_to_4m: BlockCumulativeSumPattern, + pub _4m_to_5m: BlockCumulativeSumPattern, + pub _5m_to_6m: BlockCumulativeSumPattern, + pub _6m_to_9m: BlockCumulativeSumPattern, + pub _9m_to_1y: BlockCumulativeSumPattern, + pub _1y_to_18m: BlockCumulativeSumPattern, + pub _18m_to_2y: BlockCumulativeSumPattern, + pub _2y_to_3y: BlockCumulativeSumPattern, + pub _3y_to_4y: BlockCumulativeSumPattern, + pub _4y_to_5y: BlockCumulativeSumPattern, + pub _5y_to_6y: BlockCumulativeSumPattern, + pub _6y_to_7y: BlockCumulativeSumPattern, + pub _7y_to_8y: BlockCumulativeSumPattern, + pub _8y_to_10y: BlockCumulativeSumPattern, + pub _10y_to_12y: BlockCumulativeSumPattern, + pub _12y_to_15y: BlockCumulativeSumPattern, + pub over_15y: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1h_old_realized_profit".to_string()), + _1h_to_1d: BlockCumulativeSumPattern::new(client.clone(), "utxos_1h_to_1d_old_realized_profit".to_string()), + _1d_to_1w: BlockCumulativeSumPattern::new(client.clone(), "utxos_1d_to_1w_old_realized_profit".to_string()), + _1w_to_1m: BlockCumulativeSumPattern::new(client.clone(), "utxos_1w_to_1m_old_realized_profit".to_string()), + _1m_to_2m: BlockCumulativeSumPattern::new(client.clone(), "utxos_1m_to_2m_old_realized_profit".to_string()), + _2m_to_3m: BlockCumulativeSumPattern::new(client.clone(), "utxos_2m_to_3m_old_realized_profit".to_string()), + _3m_to_4m: BlockCumulativeSumPattern::new(client.clone(), "utxos_3m_to_4m_old_realized_profit".to_string()), + _4m_to_5m: BlockCumulativeSumPattern::new(client.clone(), "utxos_4m_to_5m_old_realized_profit".to_string()), + _5m_to_6m: BlockCumulativeSumPattern::new(client.clone(), "utxos_5m_to_6m_old_realized_profit".to_string()), + _6m_to_9m: BlockCumulativeSumPattern::new(client.clone(), "utxos_6m_to_9m_old_realized_profit".to_string()), + _9m_to_1y: BlockCumulativeSumPattern::new(client.clone(), "utxos_9m_to_1y_old_realized_profit".to_string()), + _1y_to_18m: BlockCumulativeSumPattern::new(client.clone(), "utxos_1y_to_18m_old_realized_profit".to_string()), + _18m_to_2y: BlockCumulativeSumPattern::new(client.clone(), "utxos_18m_to_2y_old_realized_profit".to_string()), + _2y_to_3y: BlockCumulativeSumPattern::new(client.clone(), "utxos_2y_to_3y_old_realized_profit".to_string()), + _3y_to_4y: BlockCumulativeSumPattern::new(client.clone(), "utxos_3y_to_4y_old_realized_profit".to_string()), + _4y_to_5y: BlockCumulativeSumPattern::new(client.clone(), "utxos_4y_to_5y_old_realized_profit".to_string()), + _5y_to_6y: BlockCumulativeSumPattern::new(client.clone(), "utxos_5y_to_6y_old_realized_profit".to_string()), + _6y_to_7y: BlockCumulativeSumPattern::new(client.clone(), "utxos_6y_to_7y_old_realized_profit".to_string()), + _7y_to_8y: BlockCumulativeSumPattern::new(client.clone(), "utxos_7y_to_8y_old_realized_profit".to_string()), + _8y_to_10y: BlockCumulativeSumPattern::new(client.clone(), "utxos_8y_to_10y_old_realized_profit".to_string()), + _10y_to_12y: BlockCumulativeSumPattern::new(client.clone(), "utxos_10y_to_12y_old_realized_profit".to_string()), + _12y_to_15y: BlockCumulativeSumPattern::new(client.clone(), "utxos_12y_to_15y_old_realized_profit".to_string()), + over_15y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_15y_old_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Under { + pub _1w: BlockCumulativeSumPattern, + pub _1m: BlockCumulativeSumPattern, + pub _2m: BlockCumulativeSumPattern, + pub _3m: BlockCumulativeSumPattern, + pub _4m: BlockCumulativeSumPattern, + pub _5m: BlockCumulativeSumPattern, + pub _6m: BlockCumulativeSumPattern, + pub _9m: BlockCumulativeSumPattern, + pub _1y: BlockCumulativeSumPattern, + pub _18m: BlockCumulativeSumPattern, + pub _2y: BlockCumulativeSumPattern, + pub _3y: BlockCumulativeSumPattern, + pub _4y: BlockCumulativeSumPattern, + pub _5y: BlockCumulativeSumPattern, + pub _6y: BlockCumulativeSumPattern, + pub _7y: BlockCumulativeSumPattern, + pub _8y: BlockCumulativeSumPattern, + pub _10y: BlockCumulativeSumPattern, + pub _12y: BlockCumulativeSumPattern, + pub _15y: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1w_old_realized_profit".to_string()), + _1m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1m_old_realized_profit".to_string()), + _2m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_2m_old_realized_profit".to_string()), + _3m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_3m_old_realized_profit".to_string()), + _4m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_4m_old_realized_profit".to_string()), + _5m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_5m_old_realized_profit".to_string()), + _6m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_6m_old_realized_profit".to_string()), + _9m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_9m_old_realized_profit".to_string()), + _1y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1y_old_realized_profit".to_string()), + _18m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_18m_old_realized_profit".to_string()), + _2y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_2y_old_realized_profit".to_string()), + _3y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_3y_old_realized_profit".to_string()), + _4y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_4y_old_realized_profit".to_string()), + _5y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_5y_old_realized_profit".to_string()), + _6y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_6y_old_realized_profit".to_string()), + _7y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_7y_old_realized_profit".to_string()), + _8y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_8y_old_realized_profit".to_string()), + _10y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10y_old_realized_profit".to_string()), + _12y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_12y_old_realized_profit".to_string()), + _15y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_15y_old_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Over { + pub _1d: BlockCumulativeSumPattern, + pub _1w: BlockCumulativeSumPattern, + pub _1m: BlockCumulativeSumPattern, + pub _2m: BlockCumulativeSumPattern, + pub _3m: BlockCumulativeSumPattern, + pub _4m: BlockCumulativeSumPattern, + pub _5m: BlockCumulativeSumPattern, + pub _6m: BlockCumulativeSumPattern, + pub _9m: BlockCumulativeSumPattern, + pub _1y: BlockCumulativeSumPattern, + pub _18m: BlockCumulativeSumPattern, + pub _2y: BlockCumulativeSumPattern, + pub _3y: BlockCumulativeSumPattern, + pub _4y: BlockCumulativeSumPattern, + pub _5y: BlockCumulativeSumPattern, + pub _6y: BlockCumulativeSumPattern, + pub _7y: BlockCumulativeSumPattern, + pub _8y: BlockCumulativeSumPattern, + pub _10y: BlockCumulativeSumPattern, + pub _12y: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1d_old_realized_profit".to_string()), + _1w: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1w_old_realized_profit".to_string()), + _1m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1m_old_realized_profit".to_string()), + _2m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_2m_old_realized_profit".to_string()), + _3m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_3m_old_realized_profit".to_string()), + _4m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_4m_old_realized_profit".to_string()), + _5m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_5m_old_realized_profit".to_string()), + _6m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_6m_old_realized_profit".to_string()), + _9m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_9m_old_realized_profit".to_string()), + _1y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1y_old_realized_profit".to_string()), + _18m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_18m_old_realized_profit".to_string()), + _2y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_2y_old_realized_profit".to_string()), + _3y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_3y_old_realized_profit".to_string()), + _4y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_4y_old_realized_profit".to_string()), + _5y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_5y_old_realized_profit".to_string()), + _6y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_6y_old_realized_profit".to_string()), + _7y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_7y_old_realized_profit".to_string()), + _8y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_8y_old_realized_profit".to_string()), + _10y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10y_old_realized_profit".to_string()), + _12y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_12y_old_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_Epoch { + pub _0: BlockCumulativeSumPattern, + pub _1: BlockCumulativeSumPattern, + pub _2: BlockCumulativeSumPattern, + pub _3: BlockCumulativeSumPattern, + pub _4: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: BlockCumulativeSumPattern::new(client.clone(), "epoch_0_realized_profit".to_string()), + _1: BlockCumulativeSumPattern::new(client.clone(), "epoch_1_realized_profit".to_string()), + _2: BlockCumulativeSumPattern::new(client.clone(), "epoch_2_realized_profit".to_string()), + _3: BlockCumulativeSumPattern::new(client.clone(), "epoch_3_realized_profit".to_string()), + _4: BlockCumulativeSumPattern::new(client.clone(), "epoch_4_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_Class { + pub _2009: BlockCumulativeSumPattern, + pub _2010: BlockCumulativeSumPattern, + pub _2011: BlockCumulativeSumPattern, + pub _2012: BlockCumulativeSumPattern, + pub _2013: BlockCumulativeSumPattern, + pub _2014: BlockCumulativeSumPattern, + pub _2015: BlockCumulativeSumPattern, + pub _2016: BlockCumulativeSumPattern, + pub _2017: BlockCumulativeSumPattern, + pub _2018: BlockCumulativeSumPattern, + pub _2019: BlockCumulativeSumPattern, + pub _2020: BlockCumulativeSumPattern, + pub _2021: BlockCumulativeSumPattern, + pub _2022: BlockCumulativeSumPattern, + pub _2023: BlockCumulativeSumPattern, + pub _2024: BlockCumulativeSumPattern, + pub _2025: BlockCumulativeSumPattern, + pub _2026: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: BlockCumulativeSumPattern::new(client.clone(), "class_2009_realized_profit".to_string()), + _2010: BlockCumulativeSumPattern::new(client.clone(), "class_2010_realized_profit".to_string()), + _2011: BlockCumulativeSumPattern::new(client.clone(), "class_2011_realized_profit".to_string()), + _2012: BlockCumulativeSumPattern::new(client.clone(), "class_2012_realized_profit".to_string()), + _2013: BlockCumulativeSumPattern::new(client.clone(), "class_2013_realized_profit".to_string()), + _2014: BlockCumulativeSumPattern::new(client.clone(), "class_2014_realized_profit".to_string()), + _2015: BlockCumulativeSumPattern::new(client.clone(), "class_2015_realized_profit".to_string()), + _2016: BlockCumulativeSumPattern::new(client.clone(), "class_2016_realized_profit".to_string()), + _2017: BlockCumulativeSumPattern::new(client.clone(), "class_2017_realized_profit".to_string()), + _2018: BlockCumulativeSumPattern::new(client.clone(), "class_2018_realized_profit".to_string()), + _2019: BlockCumulativeSumPattern::new(client.clone(), "class_2019_realized_profit".to_string()), + _2020: BlockCumulativeSumPattern::new(client.clone(), "class_2020_realized_profit".to_string()), + _2021: BlockCumulativeSumPattern::new(client.clone(), "class_2021_realized_profit".to_string()), + _2022: BlockCumulativeSumPattern::new(client.clone(), "class_2022_realized_profit".to_string()), + _2023: BlockCumulativeSumPattern::new(client.clone(), "class_2023_realized_profit".to_string()), + _2024: BlockCumulativeSumPattern::new(client.clone(), "class_2024_realized_profit".to_string()), + _2025: BlockCumulativeSumPattern::new(client.clone(), "class_2025_realized_profit".to_string()), + _2026: BlockCumulativeSumPattern::new(client.clone(), "class_2026_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Range { + pub _0sats: BlockCumulativeSumPattern, + pub _1sat_to_10sats: BlockCumulativeSumPattern, + pub _10sats_to_100sats: BlockCumulativeSumPattern, + pub _100sats_to_1k_sats: BlockCumulativeSumPattern, + pub _1k_sats_to_10k_sats: BlockCumulativeSumPattern, + pub _10k_sats_to_100k_sats: BlockCumulativeSumPattern, + pub _100k_sats_to_1m_sats: BlockCumulativeSumPattern, + pub _1m_sats_to_10m_sats: BlockCumulativeSumPattern, + pub _10m_sats_to_1btc: BlockCumulativeSumPattern, + pub _1btc_to_10btc: BlockCumulativeSumPattern, + pub _10btc_to_100btc: BlockCumulativeSumPattern, + pub _100btc_to_1k_btc: BlockCumulativeSumPattern, + pub _1k_btc_to_10k_btc: BlockCumulativeSumPattern, + pub _10k_btc_to_100k_btc: BlockCumulativeSumPattern, + pub over_100k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_0sats_realized_profit".to_string()), + _1sat_to_10sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_1sat_to_10sats_realized_profit".to_string()), + _10sats_to_100sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_10sats_to_100sats_realized_profit".to_string()), + _100sats_to_1k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_100sats_to_1k_sats_realized_profit".to_string()), + _1k_sats_to_10k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_1k_sats_to_10k_sats_realized_profit".to_string()), + _10k_sats_to_100k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_10k_sats_to_100k_sats_realized_profit".to_string()), + _100k_sats_to_1m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_100k_sats_to_1m_sats_realized_profit".to_string()), + _1m_sats_to_10m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_1m_sats_to_10m_sats_realized_profit".to_string()), + _10m_sats_to_1btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_10m_sats_to_1btc_realized_profit".to_string()), + _1btc_to_10btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_1btc_to_10btc_realized_profit".to_string()), + _10btc_to_100btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_10btc_to_100btc_realized_profit".to_string()), + _100btc_to_1k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_100btc_to_1k_btc_realized_profit".to_string()), + _1k_btc_to_10k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_1k_btc_to_10k_btc_realized_profit".to_string()), + _10k_btc_to_100k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_10k_btc_to_100k_btc_realized_profit".to_string()), + over_100k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_100k_btc_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Under { + pub _10sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _100btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, + pub _100k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10sats_realized_profit".to_string()), + _100sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_100sats_realized_profit".to_string()), + _1k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1k_sats_realized_profit".to_string()), + _10k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10k_sats_realized_profit".to_string()), + _100k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_100k_sats_realized_profit".to_string()), + _1m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1m_sats_realized_profit".to_string()), + _10m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10m_sats_realized_profit".to_string()), + _1btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1btc_realized_profit".to_string()), + _10btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10btc_realized_profit".to_string()), + _100btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_100btc_realized_profit".to_string()), + _1k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1k_btc_realized_profit".to_string()), + _10k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10k_btc_realized_profit".to_string()), + _100k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_100k_btc_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Over { + pub _1sat: BlockCumulativeSumPattern, + pub _10sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _100btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1sat_realized_profit".to_string()), + _10sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10sats_realized_profit".to_string()), + _100sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_100sats_realized_profit".to_string()), + _1k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1k_sats_realized_profit".to_string()), + _10k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10k_sats_realized_profit".to_string()), + _100k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_100k_sats_realized_profit".to_string()), + _1m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1m_sats_realized_profit".to_string()), + _10m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10m_sats_realized_profit".to_string()), + _1btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1btc_realized_profit".to_string()), + _10btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10btc_realized_profit".to_string()), + _100btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_100btc_realized_profit".to_string()), + _1k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1k_btc_realized_profit".to_string()), + _10k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10k_btc_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Over, + pub matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Over::new(client.clone(), format!("{base_path}_over")), + matrix: SeriesPattern18::new(client.clone(), "addrs_realized_profit_cumulative_cents_by_balance_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Range { + pub _0sats: BlockCumulativeSumPattern, + pub _1sat_to_10sats: BlockCumulativeSumPattern, + pub _10sats_to_100sats: BlockCumulativeSumPattern, + pub _100sats_to_1k_sats: BlockCumulativeSumPattern, + pub _1k_sats_to_10k_sats: BlockCumulativeSumPattern, + pub _10k_sats_to_100k_sats: BlockCumulativeSumPattern, + pub _100k_sats_to_1m_sats: BlockCumulativeSumPattern, + pub _1m_sats_to_10m_sats: BlockCumulativeSumPattern, + pub _10m_sats_to_1btc: BlockCumulativeSumPattern, + pub _1btc_to_10btc: BlockCumulativeSumPattern, + pub _10btc_to_100btc: BlockCumulativeSumPattern, + pub _100btc_to_1k_btc: BlockCumulativeSumPattern, + pub _1k_btc_to_10k_btc: BlockCumulativeSumPattern, + pub _10k_btc_to_100k_btc: BlockCumulativeSumPattern, + pub over_100k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_0sats_realized_profit".to_string()), + _1sat_to_10sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_1sat_to_10sats_realized_profit".to_string()), + _10sats_to_100sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_10sats_to_100sats_realized_profit".to_string()), + _100sats_to_1k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_100sats_to_1k_sats_realized_profit".to_string()), + _1k_sats_to_10k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_1k_sats_to_10k_sats_realized_profit".to_string()), + _10k_sats_to_100k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_10k_sats_to_100k_sats_realized_profit".to_string()), + _100k_sats_to_1m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_100k_sats_to_1m_sats_realized_profit".to_string()), + _1m_sats_to_10m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_1m_sats_to_10m_sats_realized_profit".to_string()), + _10m_sats_to_1btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_10m_sats_to_1btc_realized_profit".to_string()), + _1btc_to_10btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_1btc_to_10btc_realized_profit".to_string()), + _10btc_to_100btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_10btc_to_100btc_realized_profit".to_string()), + _100btc_to_1k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_100btc_to_1k_btc_realized_profit".to_string()), + _1k_btc_to_10k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_1k_btc_to_10k_btc_realized_profit".to_string()), + _10k_btc_to_100k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_10k_btc_to_100k_btc_realized_profit".to_string()), + over_100k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_100k_btc_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Under { + pub _10sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _100btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, + pub _100k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10sats_realized_profit".to_string()), + _100sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_100sats_realized_profit".to_string()), + _1k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_1k_sats_realized_profit".to_string()), + _10k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10k_sats_realized_profit".to_string()), + _100k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_100k_sats_realized_profit".to_string()), + _1m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_1m_sats_realized_profit".to_string()), + _10m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10m_sats_realized_profit".to_string()), + _1btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_1btc_realized_profit".to_string()), + _10btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10btc_realized_profit".to_string()), + _100btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_100btc_realized_profit".to_string()), + _1k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_1k_btc_realized_profit".to_string()), + _10k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10k_btc_realized_profit".to_string()), + _100k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_100k_btc_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Over { + pub _1sat: BlockCumulativeSumPattern, + pub _10sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _100btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1sat_realized_profit".to_string()), + _10sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10sats_realized_profit".to_string()), + _100sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_100sats_realized_profit".to_string()), + _1k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1k_sats_realized_profit".to_string()), + _10k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10k_sats_realized_profit".to_string()), + _100k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_100k_sats_realized_profit".to_string()), + _1m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1m_sats_realized_profit".to_string()), + _10m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10m_sats_realized_profit".to_string()), + _1btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1btc_realized_profit".to_string()), + _10btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10btc_realized_profit".to_string()), + _100btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_100btc_realized_profit".to_string()), + _1k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1k_btc_realized_profit".to_string()), + _10k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10k_btc_realized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss { + pub all: BlockCumulativeSumPattern, + pub age: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Realized_Loss_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Realized_Loss_Class, + pub entry: DiscountPremiumPattern5, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount, + pub term: LongShortPattern6, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, + pub amount_range_matrix: SeriesPattern18, + pub addr_balance: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance, + pub negative: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BlockCumulativeSumPattern::new(client.clone(), "realized_loss".to_string()), + age: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Realized_Loss_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Realized_Loss_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern5::new(client.clone(), "realized_loss".to_string()), + utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: LongShortPattern6::new(client.clone(), "realized_loss".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5::new(client.clone(), "realized_loss".to_string()), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_loss_cumulative_cents_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "realized_loss_cumulative_cents_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "realized_loss_cumulative_cents_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "realized_loss_cumulative_cents_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "realized_loss_cumulative_cents_by_type".to_string()), + amount_range_matrix: SeriesPattern18::new(client.clone(), "utxos_realized_loss_cumulative_cents_by_amount_range".to_string()), + addr_balance: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance::new(client.clone(), format!("{base_path}_addr_balance")), + negative: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative::new(client.clone(), format!("{base_path}_negative")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Age { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Range { + pub under_1h: BlockCumulativeSumPattern, + pub _1h_to_1d: BlockCumulativeSumPattern, + pub _1d_to_1w: BlockCumulativeSumPattern, + pub _1w_to_1m: BlockCumulativeSumPattern, + pub _1m_to_2m: BlockCumulativeSumPattern, + pub _2m_to_3m: BlockCumulativeSumPattern, + pub _3m_to_4m: BlockCumulativeSumPattern, + pub _4m_to_5m: BlockCumulativeSumPattern, + pub _5m_to_6m: BlockCumulativeSumPattern, + pub _6m_to_9m: BlockCumulativeSumPattern, + pub _9m_to_1y: BlockCumulativeSumPattern, + pub _1y_to_18m: BlockCumulativeSumPattern, + pub _18m_to_2y: BlockCumulativeSumPattern, + pub _2y_to_3y: BlockCumulativeSumPattern, + pub _3y_to_4y: BlockCumulativeSumPattern, + pub _4y_to_5y: BlockCumulativeSumPattern, + pub _5y_to_6y: BlockCumulativeSumPattern, + pub _6y_to_7y: BlockCumulativeSumPattern, + pub _7y_to_8y: BlockCumulativeSumPattern, + pub _8y_to_10y: BlockCumulativeSumPattern, + pub _10y_to_12y: BlockCumulativeSumPattern, + pub _12y_to_15y: BlockCumulativeSumPattern, + pub over_15y: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1h_old_realized_loss".to_string()), + _1h_to_1d: BlockCumulativeSumPattern::new(client.clone(), "utxos_1h_to_1d_old_realized_loss".to_string()), + _1d_to_1w: BlockCumulativeSumPattern::new(client.clone(), "utxos_1d_to_1w_old_realized_loss".to_string()), + _1w_to_1m: BlockCumulativeSumPattern::new(client.clone(), "utxos_1w_to_1m_old_realized_loss".to_string()), + _1m_to_2m: BlockCumulativeSumPattern::new(client.clone(), "utxos_1m_to_2m_old_realized_loss".to_string()), + _2m_to_3m: BlockCumulativeSumPattern::new(client.clone(), "utxos_2m_to_3m_old_realized_loss".to_string()), + _3m_to_4m: BlockCumulativeSumPattern::new(client.clone(), "utxos_3m_to_4m_old_realized_loss".to_string()), + _4m_to_5m: BlockCumulativeSumPattern::new(client.clone(), "utxos_4m_to_5m_old_realized_loss".to_string()), + _5m_to_6m: BlockCumulativeSumPattern::new(client.clone(), "utxos_5m_to_6m_old_realized_loss".to_string()), + _6m_to_9m: BlockCumulativeSumPattern::new(client.clone(), "utxos_6m_to_9m_old_realized_loss".to_string()), + _9m_to_1y: BlockCumulativeSumPattern::new(client.clone(), "utxos_9m_to_1y_old_realized_loss".to_string()), + _1y_to_18m: BlockCumulativeSumPattern::new(client.clone(), "utxos_1y_to_18m_old_realized_loss".to_string()), + _18m_to_2y: BlockCumulativeSumPattern::new(client.clone(), "utxos_18m_to_2y_old_realized_loss".to_string()), + _2y_to_3y: BlockCumulativeSumPattern::new(client.clone(), "utxos_2y_to_3y_old_realized_loss".to_string()), + _3y_to_4y: BlockCumulativeSumPattern::new(client.clone(), "utxos_3y_to_4y_old_realized_loss".to_string()), + _4y_to_5y: BlockCumulativeSumPattern::new(client.clone(), "utxos_4y_to_5y_old_realized_loss".to_string()), + _5y_to_6y: BlockCumulativeSumPattern::new(client.clone(), "utxos_5y_to_6y_old_realized_loss".to_string()), + _6y_to_7y: BlockCumulativeSumPattern::new(client.clone(), "utxos_6y_to_7y_old_realized_loss".to_string()), + _7y_to_8y: BlockCumulativeSumPattern::new(client.clone(), "utxos_7y_to_8y_old_realized_loss".to_string()), + _8y_to_10y: BlockCumulativeSumPattern::new(client.clone(), "utxos_8y_to_10y_old_realized_loss".to_string()), + _10y_to_12y: BlockCumulativeSumPattern::new(client.clone(), "utxos_10y_to_12y_old_realized_loss".to_string()), + _12y_to_15y: BlockCumulativeSumPattern::new(client.clone(), "utxos_12y_to_15y_old_realized_loss".to_string()), + over_15y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_15y_old_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Under { + pub _1w: BlockCumulativeSumPattern, + pub _1m: BlockCumulativeSumPattern, + pub _2m: BlockCumulativeSumPattern, + pub _3m: BlockCumulativeSumPattern, + pub _4m: BlockCumulativeSumPattern, + pub _5m: BlockCumulativeSumPattern, + pub _6m: BlockCumulativeSumPattern, + pub _9m: BlockCumulativeSumPattern, + pub _1y: BlockCumulativeSumPattern, + pub _18m: BlockCumulativeSumPattern, + pub _2y: BlockCumulativeSumPattern, + pub _3y: BlockCumulativeSumPattern, + pub _4y: BlockCumulativeSumPattern, + pub _5y: BlockCumulativeSumPattern, + pub _6y: BlockCumulativeSumPattern, + pub _7y: BlockCumulativeSumPattern, + pub _8y: BlockCumulativeSumPattern, + pub _10y: BlockCumulativeSumPattern, + pub _12y: BlockCumulativeSumPattern, + pub _15y: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1w_old_realized_loss".to_string()), + _1m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1m_old_realized_loss".to_string()), + _2m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_2m_old_realized_loss".to_string()), + _3m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_3m_old_realized_loss".to_string()), + _4m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_4m_old_realized_loss".to_string()), + _5m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_5m_old_realized_loss".to_string()), + _6m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_6m_old_realized_loss".to_string()), + _9m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_9m_old_realized_loss".to_string()), + _1y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1y_old_realized_loss".to_string()), + _18m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_18m_old_realized_loss".to_string()), + _2y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_2y_old_realized_loss".to_string()), + _3y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_3y_old_realized_loss".to_string()), + _4y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_4y_old_realized_loss".to_string()), + _5y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_5y_old_realized_loss".to_string()), + _6y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_6y_old_realized_loss".to_string()), + _7y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_7y_old_realized_loss".to_string()), + _8y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_8y_old_realized_loss".to_string()), + _10y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10y_old_realized_loss".to_string()), + _12y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_12y_old_realized_loss".to_string()), + _15y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_15y_old_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Over { + pub _1d: BlockCumulativeSumPattern, + pub _1w: BlockCumulativeSumPattern, + pub _1m: BlockCumulativeSumPattern, + pub _2m: BlockCumulativeSumPattern, + pub _3m: BlockCumulativeSumPattern, + pub _4m: BlockCumulativeSumPattern, + pub _5m: BlockCumulativeSumPattern, + pub _6m: BlockCumulativeSumPattern, + pub _9m: BlockCumulativeSumPattern, + pub _1y: BlockCumulativeSumPattern, + pub _18m: BlockCumulativeSumPattern, + pub _2y: BlockCumulativeSumPattern, + pub _3y: BlockCumulativeSumPattern, + pub _4y: BlockCumulativeSumPattern, + pub _5y: BlockCumulativeSumPattern, + pub _6y: BlockCumulativeSumPattern, + pub _7y: BlockCumulativeSumPattern, + pub _8y: BlockCumulativeSumPattern, + pub _10y: BlockCumulativeSumPattern, + pub _12y: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1d_old_realized_loss".to_string()), + _1w: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1w_old_realized_loss".to_string()), + _1m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1m_old_realized_loss".to_string()), + _2m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_2m_old_realized_loss".to_string()), + _3m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_3m_old_realized_loss".to_string()), + _4m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_4m_old_realized_loss".to_string()), + _5m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_5m_old_realized_loss".to_string()), + _6m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_6m_old_realized_loss".to_string()), + _9m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_9m_old_realized_loss".to_string()), + _1y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1y_old_realized_loss".to_string()), + _18m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_18m_old_realized_loss".to_string()), + _2y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_2y_old_realized_loss".to_string()), + _3y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_3y_old_realized_loss".to_string()), + _4y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_4y_old_realized_loss".to_string()), + _5y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_5y_old_realized_loss".to_string()), + _6y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_6y_old_realized_loss".to_string()), + _7y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_7y_old_realized_loss".to_string()), + _8y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_8y_old_realized_loss".to_string()), + _10y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10y_old_realized_loss".to_string()), + _12y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_12y_old_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Epoch { + pub _0: BlockCumulativeSumPattern, + pub _1: BlockCumulativeSumPattern, + pub _2: BlockCumulativeSumPattern, + pub _3: BlockCumulativeSumPattern, + pub _4: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: BlockCumulativeSumPattern::new(client.clone(), "epoch_0_realized_loss".to_string()), + _1: BlockCumulativeSumPattern::new(client.clone(), "epoch_1_realized_loss".to_string()), + _2: BlockCumulativeSumPattern::new(client.clone(), "epoch_2_realized_loss".to_string()), + _3: BlockCumulativeSumPattern::new(client.clone(), "epoch_3_realized_loss".to_string()), + _4: BlockCumulativeSumPattern::new(client.clone(), "epoch_4_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Class { + pub _2009: BlockCumulativeSumPattern, + pub _2010: BlockCumulativeSumPattern, + pub _2011: BlockCumulativeSumPattern, + pub _2012: BlockCumulativeSumPattern, + pub _2013: BlockCumulativeSumPattern, + pub _2014: BlockCumulativeSumPattern, + pub _2015: BlockCumulativeSumPattern, + pub _2016: BlockCumulativeSumPattern, + pub _2017: BlockCumulativeSumPattern, + pub _2018: BlockCumulativeSumPattern, + pub _2019: BlockCumulativeSumPattern, + pub _2020: BlockCumulativeSumPattern, + pub _2021: BlockCumulativeSumPattern, + pub _2022: BlockCumulativeSumPattern, + pub _2023: BlockCumulativeSumPattern, + pub _2024: BlockCumulativeSumPattern, + pub _2025: BlockCumulativeSumPattern, + pub _2026: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: BlockCumulativeSumPattern::new(client.clone(), "class_2009_realized_loss".to_string()), + _2010: BlockCumulativeSumPattern::new(client.clone(), "class_2010_realized_loss".to_string()), + _2011: BlockCumulativeSumPattern::new(client.clone(), "class_2011_realized_loss".to_string()), + _2012: BlockCumulativeSumPattern::new(client.clone(), "class_2012_realized_loss".to_string()), + _2013: BlockCumulativeSumPattern::new(client.clone(), "class_2013_realized_loss".to_string()), + _2014: BlockCumulativeSumPattern::new(client.clone(), "class_2014_realized_loss".to_string()), + _2015: BlockCumulativeSumPattern::new(client.clone(), "class_2015_realized_loss".to_string()), + _2016: BlockCumulativeSumPattern::new(client.clone(), "class_2016_realized_loss".to_string()), + _2017: BlockCumulativeSumPattern::new(client.clone(), "class_2017_realized_loss".to_string()), + _2018: BlockCumulativeSumPattern::new(client.clone(), "class_2018_realized_loss".to_string()), + _2019: BlockCumulativeSumPattern::new(client.clone(), "class_2019_realized_loss".to_string()), + _2020: BlockCumulativeSumPattern::new(client.clone(), "class_2020_realized_loss".to_string()), + _2021: BlockCumulativeSumPattern::new(client.clone(), "class_2021_realized_loss".to_string()), + _2022: BlockCumulativeSumPattern::new(client.clone(), "class_2022_realized_loss".to_string()), + _2023: BlockCumulativeSumPattern::new(client.clone(), "class_2023_realized_loss".to_string()), + _2024: BlockCumulativeSumPattern::new(client.clone(), "class_2024_realized_loss".to_string()), + _2025: BlockCumulativeSumPattern::new(client.clone(), "class_2025_realized_loss".to_string()), + _2026: BlockCumulativeSumPattern::new(client.clone(), "class_2026_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Range { + pub _0sats: BlockCumulativeSumPattern, + pub _1sat_to_10sats: BlockCumulativeSumPattern, + pub _10sats_to_100sats: BlockCumulativeSumPattern, + pub _100sats_to_1k_sats: BlockCumulativeSumPattern, + pub _1k_sats_to_10k_sats: BlockCumulativeSumPattern, + pub _10k_sats_to_100k_sats: BlockCumulativeSumPattern, + pub _100k_sats_to_1m_sats: BlockCumulativeSumPattern, + pub _1m_sats_to_10m_sats: BlockCumulativeSumPattern, + pub _10m_sats_to_1btc: BlockCumulativeSumPattern, + pub _1btc_to_10btc: BlockCumulativeSumPattern, + pub _10btc_to_100btc: BlockCumulativeSumPattern, + pub _100btc_to_1k_btc: BlockCumulativeSumPattern, + pub _1k_btc_to_10k_btc: BlockCumulativeSumPattern, + pub _10k_btc_to_100k_btc: BlockCumulativeSumPattern, + pub over_100k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_0sats_realized_loss".to_string()), + _1sat_to_10sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_1sat_to_10sats_realized_loss".to_string()), + _10sats_to_100sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_10sats_to_100sats_realized_loss".to_string()), + _100sats_to_1k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_100sats_to_1k_sats_realized_loss".to_string()), + _1k_sats_to_10k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_1k_sats_to_10k_sats_realized_loss".to_string()), + _10k_sats_to_100k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_10k_sats_to_100k_sats_realized_loss".to_string()), + _100k_sats_to_1m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_100k_sats_to_1m_sats_realized_loss".to_string()), + _1m_sats_to_10m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_1m_sats_to_10m_sats_realized_loss".to_string()), + _10m_sats_to_1btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_10m_sats_to_1btc_realized_loss".to_string()), + _1btc_to_10btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_1btc_to_10btc_realized_loss".to_string()), + _10btc_to_100btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_10btc_to_100btc_realized_loss".to_string()), + _100btc_to_1k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_100btc_to_1k_btc_realized_loss".to_string()), + _1k_btc_to_10k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_1k_btc_to_10k_btc_realized_loss".to_string()), + _10k_btc_to_100k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_10k_btc_to_100k_btc_realized_loss".to_string()), + over_100k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_100k_btc_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Under { + pub _10sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _100btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, + pub _100k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10sats_realized_loss".to_string()), + _100sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_100sats_realized_loss".to_string()), + _1k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1k_sats_realized_loss".to_string()), + _10k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10k_sats_realized_loss".to_string()), + _100k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_100k_sats_realized_loss".to_string()), + _1m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1m_sats_realized_loss".to_string()), + _10m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10m_sats_realized_loss".to_string()), + _1btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1btc_realized_loss".to_string()), + _10btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10btc_realized_loss".to_string()), + _100btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_100btc_realized_loss".to_string()), + _1k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1k_btc_realized_loss".to_string()), + _10k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10k_btc_realized_loss".to_string()), + _100k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_100k_btc_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Over { + pub _1sat: BlockCumulativeSumPattern, + pub _10sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _100btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1sat_realized_loss".to_string()), + _10sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10sats_realized_loss".to_string()), + _100sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_100sats_realized_loss".to_string()), + _1k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1k_sats_realized_loss".to_string()), + _10k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10k_sats_realized_loss".to_string()), + _100k_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_100k_sats_realized_loss".to_string()), + _1m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1m_sats_realized_loss".to_string()), + _10m_sats: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10m_sats_realized_loss".to_string()), + _1btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1btc_realized_loss".to_string()), + _10btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10btc_realized_loss".to_string()), + _100btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_100btc_realized_loss".to_string()), + _1k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1k_btc_realized_loss".to_string()), + _10k_btc: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10k_btc_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Over, + pub matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Over::new(client.clone(), format!("{base_path}_over")), + matrix: SeriesPattern18::new(client.clone(), "addrs_realized_loss_cumulative_cents_by_balance_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Range { + pub _0sats: BlockCumulativeSumPattern, + pub _1sat_to_10sats: BlockCumulativeSumPattern, + pub _10sats_to_100sats: BlockCumulativeSumPattern, + pub _100sats_to_1k_sats: BlockCumulativeSumPattern, + pub _1k_sats_to_10k_sats: BlockCumulativeSumPattern, + pub _10k_sats_to_100k_sats: BlockCumulativeSumPattern, + pub _100k_sats_to_1m_sats: BlockCumulativeSumPattern, + pub _1m_sats_to_10m_sats: BlockCumulativeSumPattern, + pub _10m_sats_to_1btc: BlockCumulativeSumPattern, + pub _1btc_to_10btc: BlockCumulativeSumPattern, + pub _10btc_to_100btc: BlockCumulativeSumPattern, + pub _100btc_to_1k_btc: BlockCumulativeSumPattern, + pub _1k_btc_to_10k_btc: BlockCumulativeSumPattern, + pub _10k_btc_to_100k_btc: BlockCumulativeSumPattern, + pub over_100k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_0sats_realized_loss".to_string()), + _1sat_to_10sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_1sat_to_10sats_realized_loss".to_string()), + _10sats_to_100sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_10sats_to_100sats_realized_loss".to_string()), + _100sats_to_1k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_100sats_to_1k_sats_realized_loss".to_string()), + _1k_sats_to_10k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_1k_sats_to_10k_sats_realized_loss".to_string()), + _10k_sats_to_100k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_10k_sats_to_100k_sats_realized_loss".to_string()), + _100k_sats_to_1m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_100k_sats_to_1m_sats_realized_loss".to_string()), + _1m_sats_to_10m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_1m_sats_to_10m_sats_realized_loss".to_string()), + _10m_sats_to_1btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_10m_sats_to_1btc_realized_loss".to_string()), + _1btc_to_10btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_1btc_to_10btc_realized_loss".to_string()), + _10btc_to_100btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_10btc_to_100btc_realized_loss".to_string()), + _100btc_to_1k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_100btc_to_1k_btc_realized_loss".to_string()), + _1k_btc_to_10k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_1k_btc_to_10k_btc_realized_loss".to_string()), + _10k_btc_to_100k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_10k_btc_to_100k_btc_realized_loss".to_string()), + over_100k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_100k_btc_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Under { + pub _10sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _100btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, + pub _100k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10sats_realized_loss".to_string()), + _100sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_100sats_realized_loss".to_string()), + _1k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_1k_sats_realized_loss".to_string()), + _10k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10k_sats_realized_loss".to_string()), + _100k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_100k_sats_realized_loss".to_string()), + _1m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_1m_sats_realized_loss".to_string()), + _10m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10m_sats_realized_loss".to_string()), + _1btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_1btc_realized_loss".to_string()), + _10btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10btc_realized_loss".to_string()), + _100btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_100btc_realized_loss".to_string()), + _1k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_1k_btc_realized_loss".to_string()), + _10k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_10k_btc_realized_loss".to_string()), + _100k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_under_100k_btc_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Over { + pub _1sat: BlockCumulativeSumPattern, + pub _10sats: BlockCumulativeSumPattern, + pub _100sats: BlockCumulativeSumPattern, + pub _1k_sats: BlockCumulativeSumPattern, + pub _10k_sats: BlockCumulativeSumPattern, + pub _100k_sats: BlockCumulativeSumPattern, + pub _1m_sats: BlockCumulativeSumPattern, + pub _10m_sats: BlockCumulativeSumPattern, + pub _1btc: BlockCumulativeSumPattern, + pub _10btc: BlockCumulativeSumPattern, + pub _100btc: BlockCumulativeSumPattern, + pub _1k_btc: BlockCumulativeSumPattern, + pub _10k_btc: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1sat_realized_loss".to_string()), + _10sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10sats_realized_loss".to_string()), + _100sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_100sats_realized_loss".to_string()), + _1k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1k_sats_realized_loss".to_string()), + _10k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10k_sats_realized_loss".to_string()), + _100k_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_100k_sats_realized_loss".to_string()), + _1m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1m_sats_realized_loss".to_string()), + _10m_sats: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10m_sats_realized_loss".to_string()), + _1btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1btc_realized_loss".to_string()), + _10btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10btc_realized_loss".to_string()), + _100btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_100btc_realized_loss".to_string()), + _1k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_1k_btc_realized_loss".to_string()), + _10k_btc: BlockCumulativeSumPattern::new(client.clone(), "addrs_over_10k_btc_realized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative { + pub all: BaseSumPattern, + pub age: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Class, + pub entry: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Entry, + pub term: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Term, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BaseSumPattern::new(client.clone(), "realized_loss_neg".to_string()), + age: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Class::new(client.clone(), format!("{base_path}_class")), + entry: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Entry::new(client.clone(), format!("{base_path}_entry")), + term: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Term::new(client.clone(), format!("{base_path}_term")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Range { + pub under_1h: BaseSumPattern, + pub _1h_to_1d: BaseSumPattern, + pub _1d_to_1w: BaseSumPattern, + pub _1w_to_1m: BaseSumPattern, + pub _1m_to_2m: BaseSumPattern, + pub _2m_to_3m: BaseSumPattern, + pub _3m_to_4m: BaseSumPattern, + pub _4m_to_5m: BaseSumPattern, + pub _5m_to_6m: BaseSumPattern, + pub _6m_to_9m: BaseSumPattern, + pub _9m_to_1y: BaseSumPattern, + pub _1y_to_18m: BaseSumPattern, + pub _18m_to_2y: BaseSumPattern, + pub _2y_to_3y: BaseSumPattern, + pub _3y_to_4y: BaseSumPattern, + pub _4y_to_5y: BaseSumPattern, + pub _5y_to_6y: BaseSumPattern, + pub _6y_to_7y: BaseSumPattern, + pub _7y_to_8y: BaseSumPattern, + pub _8y_to_10y: BaseSumPattern, + pub _10y_to_12y: BaseSumPattern, + pub _12y_to_15y: BaseSumPattern, + pub over_15y: BaseSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: BaseSumPattern::new(client.clone(), "utxos_under_1h_old_realized_loss_neg".to_string()), + _1h_to_1d: BaseSumPattern::new(client.clone(), "utxos_1h_to_1d_old_realized_loss_neg".to_string()), + _1d_to_1w: BaseSumPattern::new(client.clone(), "utxos_1d_to_1w_old_realized_loss_neg".to_string()), + _1w_to_1m: BaseSumPattern::new(client.clone(), "utxos_1w_to_1m_old_realized_loss_neg".to_string()), + _1m_to_2m: BaseSumPattern::new(client.clone(), "utxos_1m_to_2m_old_realized_loss_neg".to_string()), + _2m_to_3m: BaseSumPattern::new(client.clone(), "utxos_2m_to_3m_old_realized_loss_neg".to_string()), + _3m_to_4m: BaseSumPattern::new(client.clone(), "utxos_3m_to_4m_old_realized_loss_neg".to_string()), + _4m_to_5m: BaseSumPattern::new(client.clone(), "utxos_4m_to_5m_old_realized_loss_neg".to_string()), + _5m_to_6m: BaseSumPattern::new(client.clone(), "utxos_5m_to_6m_old_realized_loss_neg".to_string()), + _6m_to_9m: BaseSumPattern::new(client.clone(), "utxos_6m_to_9m_old_realized_loss_neg".to_string()), + _9m_to_1y: BaseSumPattern::new(client.clone(), "utxos_9m_to_1y_old_realized_loss_neg".to_string()), + _1y_to_18m: BaseSumPattern::new(client.clone(), "utxos_1y_to_18m_old_realized_loss_neg".to_string()), + _18m_to_2y: BaseSumPattern::new(client.clone(), "utxos_18m_to_2y_old_realized_loss_neg".to_string()), + _2y_to_3y: BaseSumPattern::new(client.clone(), "utxos_2y_to_3y_old_realized_loss_neg".to_string()), + _3y_to_4y: BaseSumPattern::new(client.clone(), "utxos_3y_to_4y_old_realized_loss_neg".to_string()), + _4y_to_5y: BaseSumPattern::new(client.clone(), "utxos_4y_to_5y_old_realized_loss_neg".to_string()), + _5y_to_6y: BaseSumPattern::new(client.clone(), "utxos_5y_to_6y_old_realized_loss_neg".to_string()), + _6y_to_7y: BaseSumPattern::new(client.clone(), "utxos_6y_to_7y_old_realized_loss_neg".to_string()), + _7y_to_8y: BaseSumPattern::new(client.clone(), "utxos_7y_to_8y_old_realized_loss_neg".to_string()), + _8y_to_10y: BaseSumPattern::new(client.clone(), "utxos_8y_to_10y_old_realized_loss_neg".to_string()), + _10y_to_12y: BaseSumPattern::new(client.clone(), "utxos_10y_to_12y_old_realized_loss_neg".to_string()), + _12y_to_15y: BaseSumPattern::new(client.clone(), "utxos_12y_to_15y_old_realized_loss_neg".to_string()), + over_15y: BaseSumPattern::new(client.clone(), "utxos_over_15y_old_realized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Under { + pub _1w: BaseSumPattern, + pub _1m: BaseSumPattern, + pub _2m: BaseSumPattern, + pub _3m: BaseSumPattern, + pub _4m: BaseSumPattern, + pub _5m: BaseSumPattern, + pub _6m: BaseSumPattern, + pub _9m: BaseSumPattern, + pub _1y: BaseSumPattern, + pub _18m: BaseSumPattern, + pub _2y: BaseSumPattern, + pub _3y: BaseSumPattern, + pub _4y: BaseSumPattern, + pub _5y: BaseSumPattern, + pub _6y: BaseSumPattern, + pub _7y: BaseSumPattern, + pub _8y: BaseSumPattern, + pub _10y: BaseSumPattern, + pub _12y: BaseSumPattern, + pub _15y: BaseSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: BaseSumPattern::new(client.clone(), "utxos_under_1w_old_realized_loss_neg".to_string()), + _1m: BaseSumPattern::new(client.clone(), "utxos_under_1m_old_realized_loss_neg".to_string()), + _2m: BaseSumPattern::new(client.clone(), "utxos_under_2m_old_realized_loss_neg".to_string()), + _3m: BaseSumPattern::new(client.clone(), "utxos_under_3m_old_realized_loss_neg".to_string()), + _4m: BaseSumPattern::new(client.clone(), "utxos_under_4m_old_realized_loss_neg".to_string()), + _5m: BaseSumPattern::new(client.clone(), "utxos_under_5m_old_realized_loss_neg".to_string()), + _6m: BaseSumPattern::new(client.clone(), "utxos_under_6m_old_realized_loss_neg".to_string()), + _9m: BaseSumPattern::new(client.clone(), "utxos_under_9m_old_realized_loss_neg".to_string()), + _1y: BaseSumPattern::new(client.clone(), "utxos_under_1y_old_realized_loss_neg".to_string()), + _18m: BaseSumPattern::new(client.clone(), "utxos_under_18m_old_realized_loss_neg".to_string()), + _2y: BaseSumPattern::new(client.clone(), "utxos_under_2y_old_realized_loss_neg".to_string()), + _3y: BaseSumPattern::new(client.clone(), "utxos_under_3y_old_realized_loss_neg".to_string()), + _4y: BaseSumPattern::new(client.clone(), "utxos_under_4y_old_realized_loss_neg".to_string()), + _5y: BaseSumPattern::new(client.clone(), "utxos_under_5y_old_realized_loss_neg".to_string()), + _6y: BaseSumPattern::new(client.clone(), "utxos_under_6y_old_realized_loss_neg".to_string()), + _7y: BaseSumPattern::new(client.clone(), "utxos_under_7y_old_realized_loss_neg".to_string()), + _8y: BaseSumPattern::new(client.clone(), "utxos_under_8y_old_realized_loss_neg".to_string()), + _10y: BaseSumPattern::new(client.clone(), "utxos_under_10y_old_realized_loss_neg".to_string()), + _12y: BaseSumPattern::new(client.clone(), "utxos_under_12y_old_realized_loss_neg".to_string()), + _15y: BaseSumPattern::new(client.clone(), "utxos_under_15y_old_realized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Over { + pub _1d: BaseSumPattern, + pub _1w: BaseSumPattern, + pub _1m: BaseSumPattern, + pub _2m: BaseSumPattern, + pub _3m: BaseSumPattern, + pub _4m: BaseSumPattern, + pub _5m: BaseSumPattern, + pub _6m: BaseSumPattern, + pub _9m: BaseSumPattern, + pub _1y: BaseSumPattern, + pub _18m: BaseSumPattern, + pub _2y: BaseSumPattern, + pub _3y: BaseSumPattern, + pub _4y: BaseSumPattern, + pub _5y: BaseSumPattern, + pub _6y: BaseSumPattern, + pub _7y: BaseSumPattern, + pub _8y: BaseSumPattern, + pub _10y: BaseSumPattern, + pub _12y: BaseSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: BaseSumPattern::new(client.clone(), "utxos_over_1d_old_realized_loss_neg".to_string()), + _1w: BaseSumPattern::new(client.clone(), "utxos_over_1w_old_realized_loss_neg".to_string()), + _1m: BaseSumPattern::new(client.clone(), "utxos_over_1m_old_realized_loss_neg".to_string()), + _2m: BaseSumPattern::new(client.clone(), "utxos_over_2m_old_realized_loss_neg".to_string()), + _3m: BaseSumPattern::new(client.clone(), "utxos_over_3m_old_realized_loss_neg".to_string()), + _4m: BaseSumPattern::new(client.clone(), "utxos_over_4m_old_realized_loss_neg".to_string()), + _5m: BaseSumPattern::new(client.clone(), "utxos_over_5m_old_realized_loss_neg".to_string()), + _6m: BaseSumPattern::new(client.clone(), "utxos_over_6m_old_realized_loss_neg".to_string()), + _9m: BaseSumPattern::new(client.clone(), "utxos_over_9m_old_realized_loss_neg".to_string()), + _1y: BaseSumPattern::new(client.clone(), "utxos_over_1y_old_realized_loss_neg".to_string()), + _18m: BaseSumPattern::new(client.clone(), "utxos_over_18m_old_realized_loss_neg".to_string()), + _2y: BaseSumPattern::new(client.clone(), "utxos_over_2y_old_realized_loss_neg".to_string()), + _3y: BaseSumPattern::new(client.clone(), "utxos_over_3y_old_realized_loss_neg".to_string()), + _4y: BaseSumPattern::new(client.clone(), "utxos_over_4y_old_realized_loss_neg".to_string()), + _5y: BaseSumPattern::new(client.clone(), "utxos_over_5y_old_realized_loss_neg".to_string()), + _6y: BaseSumPattern::new(client.clone(), "utxos_over_6y_old_realized_loss_neg".to_string()), + _7y: BaseSumPattern::new(client.clone(), "utxos_over_7y_old_realized_loss_neg".to_string()), + _8y: BaseSumPattern::new(client.clone(), "utxos_over_8y_old_realized_loss_neg".to_string()), + _10y: BaseSumPattern::new(client.clone(), "utxos_over_10y_old_realized_loss_neg".to_string()), + _12y: BaseSumPattern::new(client.clone(), "utxos_over_12y_old_realized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Epoch { + pub _0: BaseSumPattern, + pub _1: BaseSumPattern, + pub _2: BaseSumPattern, + pub _3: BaseSumPattern, + pub _4: BaseSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: BaseSumPattern::new(client.clone(), "epoch_0_realized_loss_neg".to_string()), + _1: BaseSumPattern::new(client.clone(), "epoch_1_realized_loss_neg".to_string()), + _2: BaseSumPattern::new(client.clone(), "epoch_2_realized_loss_neg".to_string()), + _3: BaseSumPattern::new(client.clone(), "epoch_3_realized_loss_neg".to_string()), + _4: BaseSumPattern::new(client.clone(), "epoch_4_realized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Class { + pub _2009: BaseSumPattern, + pub _2010: BaseSumPattern, + pub _2011: BaseSumPattern, + pub _2012: BaseSumPattern, + pub _2013: BaseSumPattern, + pub _2014: BaseSumPattern, + pub _2015: BaseSumPattern, + pub _2016: BaseSumPattern, + pub _2017: BaseSumPattern, + pub _2018: BaseSumPattern, + pub _2019: BaseSumPattern, + pub _2020: BaseSumPattern, + pub _2021: BaseSumPattern, + pub _2022: BaseSumPattern, + pub _2023: BaseSumPattern, + pub _2024: BaseSumPattern, + pub _2025: BaseSumPattern, + pub _2026: BaseSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: BaseSumPattern::new(client.clone(), "class_2009_realized_loss_neg".to_string()), + _2010: BaseSumPattern::new(client.clone(), "class_2010_realized_loss_neg".to_string()), + _2011: BaseSumPattern::new(client.clone(), "class_2011_realized_loss_neg".to_string()), + _2012: BaseSumPattern::new(client.clone(), "class_2012_realized_loss_neg".to_string()), + _2013: BaseSumPattern::new(client.clone(), "class_2013_realized_loss_neg".to_string()), + _2014: BaseSumPattern::new(client.clone(), "class_2014_realized_loss_neg".to_string()), + _2015: BaseSumPattern::new(client.clone(), "class_2015_realized_loss_neg".to_string()), + _2016: BaseSumPattern::new(client.clone(), "class_2016_realized_loss_neg".to_string()), + _2017: BaseSumPattern::new(client.clone(), "class_2017_realized_loss_neg".to_string()), + _2018: BaseSumPattern::new(client.clone(), "class_2018_realized_loss_neg".to_string()), + _2019: BaseSumPattern::new(client.clone(), "class_2019_realized_loss_neg".to_string()), + _2020: BaseSumPattern::new(client.clone(), "class_2020_realized_loss_neg".to_string()), + _2021: BaseSumPattern::new(client.clone(), "class_2021_realized_loss_neg".to_string()), + _2022: BaseSumPattern::new(client.clone(), "class_2022_realized_loss_neg".to_string()), + _2023: BaseSumPattern::new(client.clone(), "class_2023_realized_loss_neg".to_string()), + _2024: BaseSumPattern::new(client.clone(), "class_2024_realized_loss_neg".to_string()), + _2025: BaseSumPattern::new(client.clone(), "class_2025_realized_loss_neg".to_string()), + _2026: BaseSumPattern::new(client.clone(), "class_2026_realized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Entry { + pub discount: BaseSumPattern, + pub premium: BaseSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Entry { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: BaseSumPattern::new(client.clone(), "veteran_realized_loss_neg".to_string()), + premium: BaseSumPattern::new(client.clone(), "rookie_realized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Term { + pub short: BaseSumPattern, + pub long: BaseSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Term { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: BaseSumPattern::new(client.clone(), "sth_realized_loss_neg".to_string()), + long: BaseSumPattern::new(client.clone(), "lth_realized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl { + pub all: BlockCumulativeDeltaSumPattern, + pub age: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Class, + pub entry: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Entry, + pub term: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Term, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub change_1m: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BlockCumulativeDeltaSumPattern::new(client.clone(), "net_realized_pnl".to_string()), + age: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Class::new(client.clone(), format!("{base_path}_class")), + entry: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Entry::new(client.clone(), format!("{base_path}_entry")), + term: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Term::new(client.clone(), format!("{base_path}_term")), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_net_realized_pnl_cumulative_cents_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "net_realized_pnl_cumulative_cents_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "net_realized_pnl_cumulative_cents_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "net_realized_pnl_cumulative_cents_by_entry".to_string()), + change_1m: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m::new(client.clone(), format!("{base_path}_change_1m")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age { + pub range: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Range { + pub under_1h: BlockCumulativeDeltaSumPattern, + pub _1h_to_1d: BlockCumulativeDeltaSumPattern, + pub _1d_to_1w: BlockCumulativeDeltaSumPattern, + pub _1w_to_1m: BlockCumulativeDeltaSumPattern, + pub _1m_to_2m: BlockCumulativeDeltaSumPattern, + pub _2m_to_3m: BlockCumulativeDeltaSumPattern, + pub _3m_to_4m: BlockCumulativeDeltaSumPattern, + pub _4m_to_5m: BlockCumulativeDeltaSumPattern, + pub _5m_to_6m: BlockCumulativeDeltaSumPattern, + pub _6m_to_9m: BlockCumulativeDeltaSumPattern, + pub _9m_to_1y: BlockCumulativeDeltaSumPattern, + pub _1y_to_18m: BlockCumulativeDeltaSumPattern, + pub _18m_to_2y: BlockCumulativeDeltaSumPattern, + pub _2y_to_3y: BlockCumulativeDeltaSumPattern, + pub _3y_to_4y: BlockCumulativeDeltaSumPattern, + pub _4y_to_5y: BlockCumulativeDeltaSumPattern, + pub _5y_to_6y: BlockCumulativeDeltaSumPattern, + pub _6y_to_7y: BlockCumulativeDeltaSumPattern, + pub _7y_to_8y: BlockCumulativeDeltaSumPattern, + pub _8y_to_10y: BlockCumulativeDeltaSumPattern, + pub _10y_to_12y: BlockCumulativeDeltaSumPattern, + pub _12y_to_15y: BlockCumulativeDeltaSumPattern, + pub over_15y: BlockCumulativeDeltaSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_1h_old_net_realized_pnl".to_string()), + _1h_to_1d: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_1h_to_1d_old_net_realized_pnl".to_string()), + _1d_to_1w: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_1d_to_1w_old_net_realized_pnl".to_string()), + _1w_to_1m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_1w_to_1m_old_net_realized_pnl".to_string()), + _1m_to_2m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_1m_to_2m_old_net_realized_pnl".to_string()), + _2m_to_3m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_2m_to_3m_old_net_realized_pnl".to_string()), + _3m_to_4m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_3m_to_4m_old_net_realized_pnl".to_string()), + _4m_to_5m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_4m_to_5m_old_net_realized_pnl".to_string()), + _5m_to_6m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_5m_to_6m_old_net_realized_pnl".to_string()), + _6m_to_9m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_6m_to_9m_old_net_realized_pnl".to_string()), + _9m_to_1y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_9m_to_1y_old_net_realized_pnl".to_string()), + _1y_to_18m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_1y_to_18m_old_net_realized_pnl".to_string()), + _18m_to_2y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_18m_to_2y_old_net_realized_pnl".to_string()), + _2y_to_3y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_2y_to_3y_old_net_realized_pnl".to_string()), + _3y_to_4y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_3y_to_4y_old_net_realized_pnl".to_string()), + _4y_to_5y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_4y_to_5y_old_net_realized_pnl".to_string()), + _5y_to_6y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_5y_to_6y_old_net_realized_pnl".to_string()), + _6y_to_7y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_6y_to_7y_old_net_realized_pnl".to_string()), + _7y_to_8y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_7y_to_8y_old_net_realized_pnl".to_string()), + _8y_to_10y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_8y_to_10y_old_net_realized_pnl".to_string()), + _10y_to_12y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_10y_to_12y_old_net_realized_pnl".to_string()), + _12y_to_15y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_12y_to_15y_old_net_realized_pnl".to_string()), + over_15y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_15y_old_net_realized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Under { + pub _1w: BlockCumulativeDeltaSumPattern, + pub _1m: BlockCumulativeDeltaSumPattern, + pub _2m: BlockCumulativeDeltaSumPattern, + pub _3m: BlockCumulativeDeltaSumPattern, + pub _4m: BlockCumulativeDeltaSumPattern, + pub _5m: BlockCumulativeDeltaSumPattern, + pub _6m: BlockCumulativeDeltaSumPattern, + pub _9m: BlockCumulativeDeltaSumPattern, + pub _1y: BlockCumulativeDeltaSumPattern, + pub _18m: BlockCumulativeDeltaSumPattern, + pub _2y: BlockCumulativeDeltaSumPattern, + pub _3y: BlockCumulativeDeltaSumPattern, + pub _4y: BlockCumulativeDeltaSumPattern, + pub _5y: BlockCumulativeDeltaSumPattern, + pub _6y: BlockCumulativeDeltaSumPattern, + pub _7y: BlockCumulativeDeltaSumPattern, + pub _8y: BlockCumulativeDeltaSumPattern, + pub _10y: BlockCumulativeDeltaSumPattern, + pub _12y: BlockCumulativeDeltaSumPattern, + pub _15y: BlockCumulativeDeltaSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_1w_old_net_realized_pnl".to_string()), + _1m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_1m_old_net_realized_pnl".to_string()), + _2m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_2m_old_net_realized_pnl".to_string()), + _3m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_3m_old_net_realized_pnl".to_string()), + _4m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_4m_old_net_realized_pnl".to_string()), + _5m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_5m_old_net_realized_pnl".to_string()), + _6m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_6m_old_net_realized_pnl".to_string()), + _9m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_9m_old_net_realized_pnl".to_string()), + _1y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_1y_old_net_realized_pnl".to_string()), + _18m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_18m_old_net_realized_pnl".to_string()), + _2y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_2y_old_net_realized_pnl".to_string()), + _3y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_3y_old_net_realized_pnl".to_string()), + _4y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_4y_old_net_realized_pnl".to_string()), + _5y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_5y_old_net_realized_pnl".to_string()), + _6y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_6y_old_net_realized_pnl".to_string()), + _7y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_7y_old_net_realized_pnl".to_string()), + _8y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_8y_old_net_realized_pnl".to_string()), + _10y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_10y_old_net_realized_pnl".to_string()), + _12y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_12y_old_net_realized_pnl".to_string()), + _15y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_under_15y_old_net_realized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Over { + pub _1d: BlockCumulativeDeltaSumPattern, + pub _1w: BlockCumulativeDeltaSumPattern, + pub _1m: BlockCumulativeDeltaSumPattern, + pub _2m: BlockCumulativeDeltaSumPattern, + pub _3m: BlockCumulativeDeltaSumPattern, + pub _4m: BlockCumulativeDeltaSumPattern, + pub _5m: BlockCumulativeDeltaSumPattern, + pub _6m: BlockCumulativeDeltaSumPattern, + pub _9m: BlockCumulativeDeltaSumPattern, + pub _1y: BlockCumulativeDeltaSumPattern, + pub _18m: BlockCumulativeDeltaSumPattern, + pub _2y: BlockCumulativeDeltaSumPattern, + pub _3y: BlockCumulativeDeltaSumPattern, + pub _4y: BlockCumulativeDeltaSumPattern, + pub _5y: BlockCumulativeDeltaSumPattern, + pub _6y: BlockCumulativeDeltaSumPattern, + pub _7y: BlockCumulativeDeltaSumPattern, + pub _8y: BlockCumulativeDeltaSumPattern, + pub _10y: BlockCumulativeDeltaSumPattern, + pub _12y: BlockCumulativeDeltaSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_1d_old_net_realized_pnl".to_string()), + _1w: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_1w_old_net_realized_pnl".to_string()), + _1m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_1m_old_net_realized_pnl".to_string()), + _2m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_2m_old_net_realized_pnl".to_string()), + _3m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_3m_old_net_realized_pnl".to_string()), + _4m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_4m_old_net_realized_pnl".to_string()), + _5m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_5m_old_net_realized_pnl".to_string()), + _6m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_6m_old_net_realized_pnl".to_string()), + _9m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_9m_old_net_realized_pnl".to_string()), + _1y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_1y_old_net_realized_pnl".to_string()), + _18m: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_18m_old_net_realized_pnl".to_string()), + _2y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_2y_old_net_realized_pnl".to_string()), + _3y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_3y_old_net_realized_pnl".to_string()), + _4y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_4y_old_net_realized_pnl".to_string()), + _5y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_5y_old_net_realized_pnl".to_string()), + _6y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_6y_old_net_realized_pnl".to_string()), + _7y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_7y_old_net_realized_pnl".to_string()), + _8y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_8y_old_net_realized_pnl".to_string()), + _10y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_10y_old_net_realized_pnl".to_string()), + _12y: BlockCumulativeDeltaSumPattern::new(client.clone(), "utxos_over_12y_old_net_realized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Epoch { + pub _0: BlockCumulativeDeltaSumPattern, + pub _1: BlockCumulativeDeltaSumPattern, + pub _2: BlockCumulativeDeltaSumPattern, + pub _3: BlockCumulativeDeltaSumPattern, + pub _4: BlockCumulativeDeltaSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: BlockCumulativeDeltaSumPattern::new(client.clone(), "epoch_0_net_realized_pnl".to_string()), + _1: BlockCumulativeDeltaSumPattern::new(client.clone(), "epoch_1_net_realized_pnl".to_string()), + _2: BlockCumulativeDeltaSumPattern::new(client.clone(), "epoch_2_net_realized_pnl".to_string()), + _3: BlockCumulativeDeltaSumPattern::new(client.clone(), "epoch_3_net_realized_pnl".to_string()), + _4: BlockCumulativeDeltaSumPattern::new(client.clone(), "epoch_4_net_realized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Class { + pub _2009: BlockCumulativeDeltaSumPattern, + pub _2010: BlockCumulativeDeltaSumPattern, + pub _2011: BlockCumulativeDeltaSumPattern, + pub _2012: BlockCumulativeDeltaSumPattern, + pub _2013: BlockCumulativeDeltaSumPattern, + pub _2014: BlockCumulativeDeltaSumPattern, + pub _2015: BlockCumulativeDeltaSumPattern, + pub _2016: BlockCumulativeDeltaSumPattern, + pub _2017: BlockCumulativeDeltaSumPattern, + pub _2018: BlockCumulativeDeltaSumPattern, + pub _2019: BlockCumulativeDeltaSumPattern, + pub _2020: BlockCumulativeDeltaSumPattern, + pub _2021: BlockCumulativeDeltaSumPattern, + pub _2022: BlockCumulativeDeltaSumPattern, + pub _2023: BlockCumulativeDeltaSumPattern, + pub _2024: BlockCumulativeDeltaSumPattern, + pub _2025: BlockCumulativeDeltaSumPattern, + pub _2026: BlockCumulativeDeltaSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2009_net_realized_pnl".to_string()), + _2010: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2010_net_realized_pnl".to_string()), + _2011: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2011_net_realized_pnl".to_string()), + _2012: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2012_net_realized_pnl".to_string()), + _2013: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2013_net_realized_pnl".to_string()), + _2014: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2014_net_realized_pnl".to_string()), + _2015: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2015_net_realized_pnl".to_string()), + _2016: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2016_net_realized_pnl".to_string()), + _2017: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2017_net_realized_pnl".to_string()), + _2018: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2018_net_realized_pnl".to_string()), + _2019: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2019_net_realized_pnl".to_string()), + _2020: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2020_net_realized_pnl".to_string()), + _2021: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2021_net_realized_pnl".to_string()), + _2022: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2022_net_realized_pnl".to_string()), + _2023: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2023_net_realized_pnl".to_string()), + _2024: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2024_net_realized_pnl".to_string()), + _2025: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2025_net_realized_pnl".to_string()), + _2026: BlockCumulativeDeltaSumPattern::new(client.clone(), "class_2026_net_realized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Entry { + pub discount: BlockCumulativeDeltaSumPattern, + pub premium: BlockCumulativeDeltaSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Entry { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: BlockCumulativeDeltaSumPattern::new(client.clone(), "veteran_net_realized_pnl".to_string()), + premium: BlockCumulativeDeltaSumPattern::new(client.clone(), "rookie_net_realized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Term { + pub short: BlockCumulativeDeltaSumPattern, + pub long: BlockCumulativeDeltaSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Term { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: BlockCumulativeDeltaSumPattern::new(client.clone(), "sth_net_realized_pnl".to_string()), + long: BlockCumulativeDeltaSumPattern::new(client.clone(), "lth_net_realized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m { + pub to_mcap: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m_ToMcap, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + to_mcap: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m_ToMcap::new(client.clone(), format!("{base_path}_to_mcap")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m_ToMcap { + pub all: PercentPpmRatioPattern, + pub sth: PercentPpmRatioPattern, + pub lth: PercentPpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m_ToMcap { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: PercentPpmRatioPattern::new(client.clone(), "all_net_pnl_change_1m_to_mcap".to_string()), + sth: PercentPpmRatioPattern::new(client.clone(), "sth_net_pnl_change_1m_to_mcap".to_string()), + lth: PercentPpmRatioPattern::new(client.clone(), "lth_net_pnl_change_1m_to_mcap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr { + pub value_destroyed: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed, + pub all: SeriesPattern1, + pub age: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Class, + pub entry: DiscountPremiumPattern7, + pub term: LongShortPattern7, + pub aggregate_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_AggregateMatrix, + pub age_range_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_AgeRangeMatrix, + pub under_age_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_UnderAgeMatrix, + pub over_age_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_OverAgeMatrix, + pub epoch_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_EpochMatrix, + pub class_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ClassMatrix, + pub entry_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_EntryMatrix, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + value_destroyed: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed::new(client.clone(), format!("{base_path}_value_destroyed")), + all: SeriesPattern1::new(client.clone(), "sopr_24h".to_string()), + age: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern7::new(client.clone(), "sopr_24h".to_string()), + term: LongShortPattern7::new(client.clone(), "sopr_24h".to_string()), + aggregate_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_AggregateMatrix::new(client.clone(), format!("{base_path}_aggregate_matrix")), + age_range_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_AgeRangeMatrix::new(client.clone(), format!("{base_path}_age_range_matrix")), + under_age_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_UnderAgeMatrix::new(client.clone(), format!("{base_path}_under_age_matrix")), + over_age_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_OverAgeMatrix::new(client.clone(), format!("{base_path}_over_age_matrix")), + epoch_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_EpochMatrix::new(client.clone(), format!("{base_path}_epoch_matrix")), + class_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ClassMatrix::new(client.clone(), format!("{base_path}_class_matrix")), + entry_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_EntryMatrix::new(client.clone(), format!("{base_path}_entry_matrix")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed { + pub all: BlockCumulativeSumPattern, + pub age: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Class, + pub entry: DiscountPremiumPattern5, + pub term: LongShortPattern6, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BlockCumulativeSumPattern::new(client.clone(), "value_destroyed".to_string()), + age: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern5::new(client.clone(), "value_destroyed".to_string()), + term: LongShortPattern6::new(client.clone(), "value_destroyed".to_string()), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_value_destroyed_cumulative_cents_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "value_destroyed_cumulative_cents_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "value_destroyed_cumulative_cents_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "value_destroyed_cumulative_cents_by_entry".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Range { + pub under_1h: BlockCumulativeSumPattern, + pub _1h_to_1d: BlockCumulativeSumPattern, + pub _1d_to_1w: BlockCumulativeSumPattern, + pub _1w_to_1m: BlockCumulativeSumPattern, + pub _1m_to_2m: BlockCumulativeSumPattern, + pub _2m_to_3m: BlockCumulativeSumPattern, + pub _3m_to_4m: BlockCumulativeSumPattern, + pub _4m_to_5m: BlockCumulativeSumPattern, + pub _5m_to_6m: BlockCumulativeSumPattern, + pub _6m_to_9m: BlockCumulativeSumPattern, + pub _9m_to_1y: BlockCumulativeSumPattern, + pub _1y_to_18m: BlockCumulativeSumPattern, + pub _18m_to_2y: BlockCumulativeSumPattern, + pub _2y_to_3y: BlockCumulativeSumPattern, + pub _3y_to_4y: BlockCumulativeSumPattern, + pub _4y_to_5y: BlockCumulativeSumPattern, + pub _5y_to_6y: BlockCumulativeSumPattern, + pub _6y_to_7y: BlockCumulativeSumPattern, + pub _7y_to_8y: BlockCumulativeSumPattern, + pub _8y_to_10y: BlockCumulativeSumPattern, + pub _10y_to_12y: BlockCumulativeSumPattern, + pub _12y_to_15y: BlockCumulativeSumPattern, + pub over_15y: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1h_old_value_destroyed".to_string()), + _1h_to_1d: BlockCumulativeSumPattern::new(client.clone(), "utxos_1h_to_1d_old_value_destroyed".to_string()), + _1d_to_1w: BlockCumulativeSumPattern::new(client.clone(), "utxos_1d_to_1w_old_value_destroyed".to_string()), + _1w_to_1m: BlockCumulativeSumPattern::new(client.clone(), "utxos_1w_to_1m_old_value_destroyed".to_string()), + _1m_to_2m: BlockCumulativeSumPattern::new(client.clone(), "utxos_1m_to_2m_old_value_destroyed".to_string()), + _2m_to_3m: BlockCumulativeSumPattern::new(client.clone(), "utxos_2m_to_3m_old_value_destroyed".to_string()), + _3m_to_4m: BlockCumulativeSumPattern::new(client.clone(), "utxos_3m_to_4m_old_value_destroyed".to_string()), + _4m_to_5m: BlockCumulativeSumPattern::new(client.clone(), "utxos_4m_to_5m_old_value_destroyed".to_string()), + _5m_to_6m: BlockCumulativeSumPattern::new(client.clone(), "utxos_5m_to_6m_old_value_destroyed".to_string()), + _6m_to_9m: BlockCumulativeSumPattern::new(client.clone(), "utxos_6m_to_9m_old_value_destroyed".to_string()), + _9m_to_1y: BlockCumulativeSumPattern::new(client.clone(), "utxos_9m_to_1y_old_value_destroyed".to_string()), + _1y_to_18m: BlockCumulativeSumPattern::new(client.clone(), "utxos_1y_to_18m_old_value_destroyed".to_string()), + _18m_to_2y: BlockCumulativeSumPattern::new(client.clone(), "utxos_18m_to_2y_old_value_destroyed".to_string()), + _2y_to_3y: BlockCumulativeSumPattern::new(client.clone(), "utxos_2y_to_3y_old_value_destroyed".to_string()), + _3y_to_4y: BlockCumulativeSumPattern::new(client.clone(), "utxos_3y_to_4y_old_value_destroyed".to_string()), + _4y_to_5y: BlockCumulativeSumPattern::new(client.clone(), "utxos_4y_to_5y_old_value_destroyed".to_string()), + _5y_to_6y: BlockCumulativeSumPattern::new(client.clone(), "utxos_5y_to_6y_old_value_destroyed".to_string()), + _6y_to_7y: BlockCumulativeSumPattern::new(client.clone(), "utxos_6y_to_7y_old_value_destroyed".to_string()), + _7y_to_8y: BlockCumulativeSumPattern::new(client.clone(), "utxos_7y_to_8y_old_value_destroyed".to_string()), + _8y_to_10y: BlockCumulativeSumPattern::new(client.clone(), "utxos_8y_to_10y_old_value_destroyed".to_string()), + _10y_to_12y: BlockCumulativeSumPattern::new(client.clone(), "utxos_10y_to_12y_old_value_destroyed".to_string()), + _12y_to_15y: BlockCumulativeSumPattern::new(client.clone(), "utxos_12y_to_15y_old_value_destroyed".to_string()), + over_15y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_15y_old_value_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Under { + pub _1w: BlockCumulativeSumPattern, + pub _1m: BlockCumulativeSumPattern, + pub _2m: BlockCumulativeSumPattern, + pub _3m: BlockCumulativeSumPattern, + pub _4m: BlockCumulativeSumPattern, + pub _5m: BlockCumulativeSumPattern, + pub _6m: BlockCumulativeSumPattern, + pub _9m: BlockCumulativeSumPattern, + pub _1y: BlockCumulativeSumPattern, + pub _18m: BlockCumulativeSumPattern, + pub _2y: BlockCumulativeSumPattern, + pub _3y: BlockCumulativeSumPattern, + pub _4y: BlockCumulativeSumPattern, + pub _5y: BlockCumulativeSumPattern, + pub _6y: BlockCumulativeSumPattern, + pub _7y: BlockCumulativeSumPattern, + pub _8y: BlockCumulativeSumPattern, + pub _10y: BlockCumulativeSumPattern, + pub _12y: BlockCumulativeSumPattern, + pub _15y: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1w_old_value_destroyed".to_string()), + _1m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1m_old_value_destroyed".to_string()), + _2m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_2m_old_value_destroyed".to_string()), + _3m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_3m_old_value_destroyed".to_string()), + _4m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_4m_old_value_destroyed".to_string()), + _5m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_5m_old_value_destroyed".to_string()), + _6m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_6m_old_value_destroyed".to_string()), + _9m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_9m_old_value_destroyed".to_string()), + _1y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_1y_old_value_destroyed".to_string()), + _18m: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_18m_old_value_destroyed".to_string()), + _2y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_2y_old_value_destroyed".to_string()), + _3y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_3y_old_value_destroyed".to_string()), + _4y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_4y_old_value_destroyed".to_string()), + _5y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_5y_old_value_destroyed".to_string()), + _6y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_6y_old_value_destroyed".to_string()), + _7y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_7y_old_value_destroyed".to_string()), + _8y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_8y_old_value_destroyed".to_string()), + _10y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_10y_old_value_destroyed".to_string()), + _12y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_12y_old_value_destroyed".to_string()), + _15y: BlockCumulativeSumPattern::new(client.clone(), "utxos_under_15y_old_value_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Over { + pub _1d: BlockCumulativeSumPattern, + pub _1w: BlockCumulativeSumPattern, + pub _1m: BlockCumulativeSumPattern, + pub _2m: BlockCumulativeSumPattern, + pub _3m: BlockCumulativeSumPattern, + pub _4m: BlockCumulativeSumPattern, + pub _5m: BlockCumulativeSumPattern, + pub _6m: BlockCumulativeSumPattern, + pub _9m: BlockCumulativeSumPattern, + pub _1y: BlockCumulativeSumPattern, + pub _18m: BlockCumulativeSumPattern, + pub _2y: BlockCumulativeSumPattern, + pub _3y: BlockCumulativeSumPattern, + pub _4y: BlockCumulativeSumPattern, + pub _5y: BlockCumulativeSumPattern, + pub _6y: BlockCumulativeSumPattern, + pub _7y: BlockCumulativeSumPattern, + pub _8y: BlockCumulativeSumPattern, + pub _10y: BlockCumulativeSumPattern, + pub _12y: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1d_old_value_destroyed".to_string()), + _1w: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1w_old_value_destroyed".to_string()), + _1m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1m_old_value_destroyed".to_string()), + _2m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_2m_old_value_destroyed".to_string()), + _3m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_3m_old_value_destroyed".to_string()), + _4m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_4m_old_value_destroyed".to_string()), + _5m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_5m_old_value_destroyed".to_string()), + _6m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_6m_old_value_destroyed".to_string()), + _9m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_9m_old_value_destroyed".to_string()), + _1y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_1y_old_value_destroyed".to_string()), + _18m: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_18m_old_value_destroyed".to_string()), + _2y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_2y_old_value_destroyed".to_string()), + _3y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_3y_old_value_destroyed".to_string()), + _4y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_4y_old_value_destroyed".to_string()), + _5y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_5y_old_value_destroyed".to_string()), + _6y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_6y_old_value_destroyed".to_string()), + _7y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_7y_old_value_destroyed".to_string()), + _8y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_8y_old_value_destroyed".to_string()), + _10y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_10y_old_value_destroyed".to_string()), + _12y: BlockCumulativeSumPattern::new(client.clone(), "utxos_over_12y_old_value_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Epoch { + pub _0: BlockCumulativeSumPattern, + pub _1: BlockCumulativeSumPattern, + pub _2: BlockCumulativeSumPattern, + pub _3: BlockCumulativeSumPattern, + pub _4: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: BlockCumulativeSumPattern::new(client.clone(), "epoch_0_value_destroyed".to_string()), + _1: BlockCumulativeSumPattern::new(client.clone(), "epoch_1_value_destroyed".to_string()), + _2: BlockCumulativeSumPattern::new(client.clone(), "epoch_2_value_destroyed".to_string()), + _3: BlockCumulativeSumPattern::new(client.clone(), "epoch_3_value_destroyed".to_string()), + _4: BlockCumulativeSumPattern::new(client.clone(), "epoch_4_value_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Class { + pub _2009: BlockCumulativeSumPattern, + pub _2010: BlockCumulativeSumPattern, + pub _2011: BlockCumulativeSumPattern, + pub _2012: BlockCumulativeSumPattern, + pub _2013: BlockCumulativeSumPattern, + pub _2014: BlockCumulativeSumPattern, + pub _2015: BlockCumulativeSumPattern, + pub _2016: BlockCumulativeSumPattern, + pub _2017: BlockCumulativeSumPattern, + pub _2018: BlockCumulativeSumPattern, + pub _2019: BlockCumulativeSumPattern, + pub _2020: BlockCumulativeSumPattern, + pub _2021: BlockCumulativeSumPattern, + pub _2022: BlockCumulativeSumPattern, + pub _2023: BlockCumulativeSumPattern, + pub _2024: BlockCumulativeSumPattern, + pub _2025: BlockCumulativeSumPattern, + pub _2026: BlockCumulativeSumPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: BlockCumulativeSumPattern::new(client.clone(), "class_2009_value_destroyed".to_string()), + _2010: BlockCumulativeSumPattern::new(client.clone(), "class_2010_value_destroyed".to_string()), + _2011: BlockCumulativeSumPattern::new(client.clone(), "class_2011_value_destroyed".to_string()), + _2012: BlockCumulativeSumPattern::new(client.clone(), "class_2012_value_destroyed".to_string()), + _2013: BlockCumulativeSumPattern::new(client.clone(), "class_2013_value_destroyed".to_string()), + _2014: BlockCumulativeSumPattern::new(client.clone(), "class_2014_value_destroyed".to_string()), + _2015: BlockCumulativeSumPattern::new(client.clone(), "class_2015_value_destroyed".to_string()), + _2016: BlockCumulativeSumPattern::new(client.clone(), "class_2016_value_destroyed".to_string()), + _2017: BlockCumulativeSumPattern::new(client.clone(), "class_2017_value_destroyed".to_string()), + _2018: BlockCumulativeSumPattern::new(client.clone(), "class_2018_value_destroyed".to_string()), + _2019: BlockCumulativeSumPattern::new(client.clone(), "class_2019_value_destroyed".to_string()), + _2020: BlockCumulativeSumPattern::new(client.clone(), "class_2020_value_destroyed".to_string()), + _2021: BlockCumulativeSumPattern::new(client.clone(), "class_2021_value_destroyed".to_string()), + _2022: BlockCumulativeSumPattern::new(client.clone(), "class_2022_value_destroyed".to_string()), + _2023: BlockCumulativeSumPattern::new(client.clone(), "class_2023_value_destroyed".to_string()), + _2024: BlockCumulativeSumPattern::new(client.clone(), "class_2024_value_destroyed".to_string()), + _2025: BlockCumulativeSumPattern::new(client.clone(), "class_2025_value_destroyed".to_string()), + _2026: BlockCumulativeSumPattern::new(client.clone(), "class_2026_value_destroyed".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Range { + pub under_1h: SeriesPattern1, + pub _1h_to_1d: SeriesPattern1, + pub _1d_to_1w: SeriesPattern1, + pub _1w_to_1m: SeriesPattern1, + pub _1m_to_2m: SeriesPattern1, + pub _2m_to_3m: SeriesPattern1, + pub _3m_to_4m: SeriesPattern1, + pub _4m_to_5m: SeriesPattern1, + pub _5m_to_6m: SeriesPattern1, + pub _6m_to_9m: SeriesPattern1, + pub _9m_to_1y: SeriesPattern1, + pub _1y_to_18m: SeriesPattern1, + pub _18m_to_2y: SeriesPattern1, + pub _2y_to_3y: SeriesPattern1, + pub _3y_to_4y: SeriesPattern1, + pub _4y_to_5y: SeriesPattern1, + pub _5y_to_6y: SeriesPattern1, + pub _6y_to_7y: SeriesPattern1, + pub _7y_to_8y: SeriesPattern1, + pub _8y_to_10y: SeriesPattern1, + pub _10y_to_12y: SeriesPattern1, + pub _12y_to_15y: SeriesPattern1, + pub over_15y: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: SeriesPattern1::new(client.clone(), "utxos_under_1h_old_sopr_24h".to_string()), + _1h_to_1d: SeriesPattern1::new(client.clone(), "utxos_1h_to_1d_old_sopr_24h".to_string()), + _1d_to_1w: SeriesPattern1::new(client.clone(), "utxos_1d_to_1w_old_sopr_24h".to_string()), + _1w_to_1m: SeriesPattern1::new(client.clone(), "utxos_1w_to_1m_old_sopr_24h".to_string()), + _1m_to_2m: SeriesPattern1::new(client.clone(), "utxos_1m_to_2m_old_sopr_24h".to_string()), + _2m_to_3m: SeriesPattern1::new(client.clone(), "utxos_2m_to_3m_old_sopr_24h".to_string()), + _3m_to_4m: SeriesPattern1::new(client.clone(), "utxos_3m_to_4m_old_sopr_24h".to_string()), + _4m_to_5m: SeriesPattern1::new(client.clone(), "utxos_4m_to_5m_old_sopr_24h".to_string()), + _5m_to_6m: SeriesPattern1::new(client.clone(), "utxos_5m_to_6m_old_sopr_24h".to_string()), + _6m_to_9m: SeriesPattern1::new(client.clone(), "utxos_6m_to_9m_old_sopr_24h".to_string()), + _9m_to_1y: SeriesPattern1::new(client.clone(), "utxos_9m_to_1y_old_sopr_24h".to_string()), + _1y_to_18m: SeriesPattern1::new(client.clone(), "utxos_1y_to_18m_old_sopr_24h".to_string()), + _18m_to_2y: SeriesPattern1::new(client.clone(), "utxos_18m_to_2y_old_sopr_24h".to_string()), + _2y_to_3y: SeriesPattern1::new(client.clone(), "utxos_2y_to_3y_old_sopr_24h".to_string()), + _3y_to_4y: SeriesPattern1::new(client.clone(), "utxos_3y_to_4y_old_sopr_24h".to_string()), + _4y_to_5y: SeriesPattern1::new(client.clone(), "utxos_4y_to_5y_old_sopr_24h".to_string()), + _5y_to_6y: SeriesPattern1::new(client.clone(), "utxos_5y_to_6y_old_sopr_24h".to_string()), + _6y_to_7y: SeriesPattern1::new(client.clone(), "utxos_6y_to_7y_old_sopr_24h".to_string()), + _7y_to_8y: SeriesPattern1::new(client.clone(), "utxos_7y_to_8y_old_sopr_24h".to_string()), + _8y_to_10y: SeriesPattern1::new(client.clone(), "utxos_8y_to_10y_old_sopr_24h".to_string()), + _10y_to_12y: SeriesPattern1::new(client.clone(), "utxos_10y_to_12y_old_sopr_24h".to_string()), + _12y_to_15y: SeriesPattern1::new(client.clone(), "utxos_12y_to_15y_old_sopr_24h".to_string()), + over_15y: SeriesPattern1::new(client.clone(), "utxos_over_15y_old_sopr_24h".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Under { + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _9m: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, + pub _15y: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: SeriesPattern1::new(client.clone(), "utxos_under_1w_old_sopr_24h".to_string()), + _1m: SeriesPattern1::new(client.clone(), "utxos_under_1m_old_sopr_24h".to_string()), + _2m: SeriesPattern1::new(client.clone(), "utxos_under_2m_old_sopr_24h".to_string()), + _3m: SeriesPattern1::new(client.clone(), "utxos_under_3m_old_sopr_24h".to_string()), + _4m: SeriesPattern1::new(client.clone(), "utxos_under_4m_old_sopr_24h".to_string()), + _5m: SeriesPattern1::new(client.clone(), "utxos_under_5m_old_sopr_24h".to_string()), + _6m: SeriesPattern1::new(client.clone(), "utxos_under_6m_old_sopr_24h".to_string()), + _9m: SeriesPattern1::new(client.clone(), "utxos_under_9m_old_sopr_24h".to_string()), + _1y: SeriesPattern1::new(client.clone(), "utxos_under_1y_old_sopr_24h".to_string()), + _18m: SeriesPattern1::new(client.clone(), "utxos_under_18m_old_sopr_24h".to_string()), + _2y: SeriesPattern1::new(client.clone(), "utxos_under_2y_old_sopr_24h".to_string()), + _3y: SeriesPattern1::new(client.clone(), "utxos_under_3y_old_sopr_24h".to_string()), + _4y: SeriesPattern1::new(client.clone(), "utxos_under_4y_old_sopr_24h".to_string()), + _5y: SeriesPattern1::new(client.clone(), "utxos_under_5y_old_sopr_24h".to_string()), + _6y: SeriesPattern1::new(client.clone(), "utxos_under_6y_old_sopr_24h".to_string()), + _7y: SeriesPattern1::new(client.clone(), "utxos_under_7y_old_sopr_24h".to_string()), + _8y: SeriesPattern1::new(client.clone(), "utxos_under_8y_old_sopr_24h".to_string()), + _10y: SeriesPattern1::new(client.clone(), "utxos_under_10y_old_sopr_24h".to_string()), + _12y: SeriesPattern1::new(client.clone(), "utxos_under_12y_old_sopr_24h".to_string()), + _15y: SeriesPattern1::new(client.clone(), "utxos_under_15y_old_sopr_24h".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Over { + pub _1d: SeriesPattern1, + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _9m: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: SeriesPattern1::new(client.clone(), "utxos_over_1d_old_sopr_24h".to_string()), + _1w: SeriesPattern1::new(client.clone(), "utxos_over_1w_old_sopr_24h".to_string()), + _1m: SeriesPattern1::new(client.clone(), "utxos_over_1m_old_sopr_24h".to_string()), + _2m: SeriesPattern1::new(client.clone(), "utxos_over_2m_old_sopr_24h".to_string()), + _3m: SeriesPattern1::new(client.clone(), "utxos_over_3m_old_sopr_24h".to_string()), + _4m: SeriesPattern1::new(client.clone(), "utxos_over_4m_old_sopr_24h".to_string()), + _5m: SeriesPattern1::new(client.clone(), "utxos_over_5m_old_sopr_24h".to_string()), + _6m: SeriesPattern1::new(client.clone(), "utxos_over_6m_old_sopr_24h".to_string()), + _9m: SeriesPattern1::new(client.clone(), "utxos_over_9m_old_sopr_24h".to_string()), + _1y: SeriesPattern1::new(client.clone(), "utxos_over_1y_old_sopr_24h".to_string()), + _18m: SeriesPattern1::new(client.clone(), "utxos_over_18m_old_sopr_24h".to_string()), + _2y: SeriesPattern1::new(client.clone(), "utxos_over_2y_old_sopr_24h".to_string()), + _3y: SeriesPattern1::new(client.clone(), "utxos_over_3y_old_sopr_24h".to_string()), + _4y: SeriesPattern1::new(client.clone(), "utxos_over_4y_old_sopr_24h".to_string()), + _5y: SeriesPattern1::new(client.clone(), "utxos_over_5y_old_sopr_24h".to_string()), + _6y: SeriesPattern1::new(client.clone(), "utxos_over_6y_old_sopr_24h".to_string()), + _7y: SeriesPattern1::new(client.clone(), "utxos_over_7y_old_sopr_24h".to_string()), + _8y: SeriesPattern1::new(client.clone(), "utxos_over_8y_old_sopr_24h".to_string()), + _10y: SeriesPattern1::new(client.clone(), "utxos_over_10y_old_sopr_24h".to_string()), + _12y: SeriesPattern1::new(client.clone(), "utxos_over_12y_old_sopr_24h".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_Epoch { + pub _0: SeriesPattern1, + pub _1: SeriesPattern1, + pub _2: SeriesPattern1, + pub _3: SeriesPattern1, + pub _4: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: SeriesPattern1::new(client.clone(), "epoch_0_sopr_24h".to_string()), + _1: SeriesPattern1::new(client.clone(), "epoch_1_sopr_24h".to_string()), + _2: SeriesPattern1::new(client.clone(), "epoch_2_sopr_24h".to_string()), + _3: SeriesPattern1::new(client.clone(), "epoch_3_sopr_24h".to_string()), + _4: SeriesPattern1::new(client.clone(), "epoch_4_sopr_24h".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_Class { + pub _2009: SeriesPattern1, + pub _2010: SeriesPattern1, + pub _2011: SeriesPattern1, + pub _2012: SeriesPattern1, + pub _2013: SeriesPattern1, + pub _2014: SeriesPattern1, + pub _2015: SeriesPattern1, + pub _2016: SeriesPattern1, + pub _2017: SeriesPattern1, + pub _2018: SeriesPattern1, + pub _2019: SeriesPattern1, + pub _2020: SeriesPattern1, + pub _2021: SeriesPattern1, + pub _2022: SeriesPattern1, + pub _2023: SeriesPattern1, + pub _2024: SeriesPattern1, + pub _2025: SeriesPattern1, + pub _2026: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: SeriesPattern1::new(client.clone(), "class_2009_sopr_24h".to_string()), + _2010: SeriesPattern1::new(client.clone(), "class_2010_sopr_24h".to_string()), + _2011: SeriesPattern1::new(client.clone(), "class_2011_sopr_24h".to_string()), + _2012: SeriesPattern1::new(client.clone(), "class_2012_sopr_24h".to_string()), + _2013: SeriesPattern1::new(client.clone(), "class_2013_sopr_24h".to_string()), + _2014: SeriesPattern1::new(client.clone(), "class_2014_sopr_24h".to_string()), + _2015: SeriesPattern1::new(client.clone(), "class_2015_sopr_24h".to_string()), + _2016: SeriesPattern1::new(client.clone(), "class_2016_sopr_24h".to_string()), + _2017: SeriesPattern1::new(client.clone(), "class_2017_sopr_24h".to_string()), + _2018: SeriesPattern1::new(client.clone(), "class_2018_sopr_24h".to_string()), + _2019: SeriesPattern1::new(client.clone(), "class_2019_sopr_24h".to_string()), + _2020: SeriesPattern1::new(client.clone(), "class_2020_sopr_24h".to_string()), + _2021: SeriesPattern1::new(client.clone(), "class_2021_sopr_24h".to_string()), + _2022: SeriesPattern1::new(client.clone(), "class_2022_sopr_24h".to_string()), + _2023: SeriesPattern1::new(client.clone(), "class_2023_sopr_24h".to_string()), + _2024: SeriesPattern1::new(client.clone(), "class_2024_sopr_24h".to_string()), + _2025: SeriesPattern1::new(client.clone(), "class_2025_sopr_24h".to_string()), + _2026: SeriesPattern1::new(client.clone(), "class_2026_sopr_24h".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_AggregateMatrix { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_AggregateMatrix { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "sopr_24h_by_aggregate_column_0".to_string()), + sth: SeriesPattern1::new(client.clone(), "sopr_24h_by_aggregate_column_1".to_string()), + lth: SeriesPattern1::new(client.clone(), "sopr_24h_by_aggregate_column_2".to_string()), + height: SeriesPattern18::new(client.clone(), "sopr_24h_by_aggregate".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_AgeRangeMatrix { + pub under_1h: SeriesPattern1, + pub _1h_to_1d: SeriesPattern1, + pub _1d_to_1w: SeriesPattern1, + pub _1w_to_1m: SeriesPattern1, + pub _1m_to_2m: SeriesPattern1, + pub _2m_to_3m: SeriesPattern1, + pub _3m_to_4m: SeriesPattern1, + pub _4m_to_5m: SeriesPattern1, + pub _5m_to_6m: SeriesPattern1, + pub _6m_to_9m: SeriesPattern1, + pub _9m_to_1y: SeriesPattern1, + pub _1y_to_18m: SeriesPattern1, + pub _18m_to_2y: SeriesPattern1, + pub _2y_to_3y: SeriesPattern1, + pub _3y_to_4y: SeriesPattern1, + pub _4y_to_5y: SeriesPattern1, + pub _5y_to_6y: SeriesPattern1, + pub _6y_to_7y: SeriesPattern1, + pub _7y_to_8y: SeriesPattern1, + pub _8y_to_10y: SeriesPattern1, + pub _10y_to_12y: SeriesPattern1, + pub _12y_to_15y: SeriesPattern1, + pub over_15y: SeriesPattern1, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_AgeRangeMatrix { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_0".to_string()), + _1h_to_1d: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_1".to_string()), + _1d_to_1w: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_2".to_string()), + _1w_to_1m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_3".to_string()), + _1m_to_2m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_4".to_string()), + _2m_to_3m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_5".to_string()), + _3m_to_4m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_6".to_string()), + _4m_to_5m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_7".to_string()), + _5m_to_6m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_8".to_string()), + _6m_to_9m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_9".to_string()), + _9m_to_1y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_10".to_string()), + _1y_to_18m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_11".to_string()), + _18m_to_2y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_12".to_string()), + _2y_to_3y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_13".to_string()), + _3y_to_4y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_14".to_string()), + _4y_to_5y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_15".to_string()), + _5y_to_6y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_16".to_string()), + _6y_to_7y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_17".to_string()), + _7y_to_8y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_18".to_string()), + _8y_to_10y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_19".to_string()), + _10y_to_12y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_20".to_string()), + _12y_to_15y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_21".to_string()), + over_15y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_age_range_column_22".to_string()), + height: SeriesPattern18::new(client.clone(), "utxos_sopr_24h_by_age_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_UnderAgeMatrix { + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _9m: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, + pub _15y: SeriesPattern1, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_UnderAgeMatrix { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_0".to_string()), + _1m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_1".to_string()), + _2m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_2".to_string()), + _3m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_3".to_string()), + _4m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_4".to_string()), + _5m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_5".to_string()), + _6m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_6".to_string()), + _9m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_7".to_string()), + _1y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_8".to_string()), + _18m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_9".to_string()), + _2y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_10".to_string()), + _3y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_11".to_string()), + _4y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_12".to_string()), + _5y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_13".to_string()), + _6y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_14".to_string()), + _7y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_15".to_string()), + _8y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_16".to_string()), + _10y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_17".to_string()), + _12y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_18".to_string()), + _15y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_under_age_column_19".to_string()), + height: SeriesPattern18::new(client.clone(), "utxos_sopr_24h_by_under_age".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_OverAgeMatrix { + pub _1d: SeriesPattern1, + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _9m: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_OverAgeMatrix { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_0".to_string()), + _1w: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_1".to_string()), + _1m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_2".to_string()), + _2m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_3".to_string()), + _3m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_4".to_string()), + _4m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_5".to_string()), + _5m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_6".to_string()), + _6m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_7".to_string()), + _9m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_8".to_string()), + _1y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_9".to_string()), + _18m: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_10".to_string()), + _2y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_11".to_string()), + _3y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_12".to_string()), + _4y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_13".to_string()), + _5y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_14".to_string()), + _6y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_15".to_string()), + _7y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_16".to_string()), + _8y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_17".to_string()), + _10y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_18".to_string()), + _12y: SeriesPattern1::new(client.clone(), "utxos_sopr_24h_by_over_age_column_19".to_string()), + height: SeriesPattern18::new(client.clone(), "utxos_sopr_24h_by_over_age".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_EpochMatrix { + pub _0: SeriesPattern1, + pub _1: SeriesPattern1, + pub _2: SeriesPattern1, + pub _3: SeriesPattern1, + pub _4: SeriesPattern1, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_EpochMatrix { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: SeriesPattern1::new(client.clone(), "sopr_24h_by_epoch_column_0".to_string()), + _1: SeriesPattern1::new(client.clone(), "sopr_24h_by_epoch_column_1".to_string()), + _2: SeriesPattern1::new(client.clone(), "sopr_24h_by_epoch_column_2".to_string()), + _3: SeriesPattern1::new(client.clone(), "sopr_24h_by_epoch_column_3".to_string()), + _4: SeriesPattern1::new(client.clone(), "sopr_24h_by_epoch_column_4".to_string()), + height: SeriesPattern18::new(client.clone(), "sopr_24h_by_epoch".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_ClassMatrix { + pub _2009: SeriesPattern1, + pub _2010: SeriesPattern1, + pub _2011: SeriesPattern1, + pub _2012: SeriesPattern1, + pub _2013: SeriesPattern1, + pub _2014: SeriesPattern1, + pub _2015: SeriesPattern1, + pub _2016: SeriesPattern1, + pub _2017: SeriesPattern1, + pub _2018: SeriesPattern1, + pub _2019: SeriesPattern1, + pub _2020: SeriesPattern1, + pub _2021: SeriesPattern1, + pub _2022: SeriesPattern1, + pub _2023: SeriesPattern1, + pub _2024: SeriesPattern1, + pub _2025: SeriesPattern1, + pub _2026: SeriesPattern1, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_ClassMatrix { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_0".to_string()), + _2010: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_1".to_string()), + _2011: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_2".to_string()), + _2012: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_3".to_string()), + _2013: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_4".to_string()), + _2014: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_5".to_string()), + _2015: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_6".to_string()), + _2016: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_7".to_string()), + _2017: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_8".to_string()), + _2018: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_9".to_string()), + _2019: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_10".to_string()), + _2020: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_11".to_string()), + _2021: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_12".to_string()), + _2022: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_13".to_string()), + _2023: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_14".to_string()), + _2024: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_15".to_string()), + _2025: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_16".to_string()), + _2026: SeriesPattern1::new(client.clone(), "sopr_24h_by_class_column_17".to_string()), + height: SeriesPattern18::new(client.clone(), "sopr_24h_by_class".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Sopr_EntryMatrix { + pub discount: SeriesPattern1, + pub premium: SeriesPattern1, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Sopr_EntryMatrix { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: SeriesPattern1::new(client.clone(), "sopr_24h_by_entry_column_0".to_string()), + premium: SeriesPattern1::new(client.clone(), "sopr_24h_by_entry_column_1".to_string()), + height: SeriesPattern18::new(client.clone(), "sopr_24h_by_entry".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr { + pub ratio: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_Ratio, + pub transfer_volume: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_TransferVolume, + pub value_destroyed: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_ValueDestroyed, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + ratio: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_Ratio::new(client.clone(), format!("{base_path}_ratio")), + transfer_volume: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_TransferVolume::new(client.clone(), format!("{base_path}_transfer_volume")), + value_destroyed: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_ValueDestroyed::new(client.clone(), format!("{base_path}_value_destroyed")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_Ratio { + pub all: _1m1w1y24hHeightPattern2, + pub sth: _1m1w1y24hHeightPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_Ratio { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: _1m1w1y24hHeightPattern2::new(client.clone(), "asopr".to_string()), + sth: _1m1w1y24hHeightPattern2::new(client.clone(), "sth_asopr".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_TransferVolume { + pub all: AverageBlockCumulativeSumPattern, + pub sth: AverageBlockCumulativeSumPattern, + pub cumulative: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_TransferVolume { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AverageBlockCumulativeSumPattern::new(client.clone(), "adj_value_created".to_string()), + sth: AverageBlockCumulativeSumPattern::new(client.clone(), "sth_adj_value_created".to_string()), + cumulative: SeriesPattern18::new(client.clone(), "adjusted_sopr_transfer_volume_cumulative_by_cohort".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_ValueDestroyed { + pub all: AverageBlockCumulativeSumPattern, + pub sth: AverageBlockCumulativeSumPattern, + pub cumulative: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_ValueDestroyed { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AverageBlockCumulativeSumPattern::new(client.clone(), "adj_value_destroyed".to_string()), + sth: AverageBlockCumulativeSumPattern::new(client.clone(), "sth_adj_value_destroyed".to_string()), + cumulative: SeriesPattern18::new(client.clone(), "adjusted_sopr_value_destroyed_cumulative_by_cohort".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_GrossPnl { + pub all: BlockCumulativeSumPattern, + pub sth: BlockCumulativeSumPattern, + pub lth: BlockCumulativeSumPattern, + pub cumulative: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_GrossPnl { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BlockCumulativeSumPattern::new(client.clone(), "all_realized_gross_pnl".to_string()), + sth: BlockCumulativeSumPattern::new(client.clone(), "sth_realized_gross_pnl".to_string()), + lth: BlockCumulativeSumPattern::new(client.clone(), "lth_realized_gross_pnl".to_string()), + cumulative: SeriesPattern18::new(client.clone(), "realized_gross_pnl_cumulative_cents_by_term".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_CapitalizedPrice { + pub all: CentsPpmRatioSatsUsdPattern, + pub sth: CentsPpmRatioSatsUsdPattern, + pub lth: CentsPpmRatioSatsUsdPattern, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_CapitalizedPrice { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsPpmRatioSatsUsdPattern::new(client.clone(), "all_capitalized_price".to_string()), + sth: CentsPpmRatioSatsUsdPattern::new(client.clone(), "sth_capitalized_price".to_string()), + lth: CentsPpmRatioSatsUsdPattern::new(client.clone(), "lth_capitalized_price".to_string()), + height: SeriesPattern18::new(client.clone(), "capitalized_price_cents_by_aggregate".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_PeakRegret { + pub all: BlockCumulativeSumPattern, + pub sth: BlockCumulativeSumPattern, + pub lth: BlockCumulativeSumPattern, + pub cumulative: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_PeakRegret { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: BlockCumulativeSumPattern::new(client.clone(), "all_realized_peak_regret".to_string()), + sth: BlockCumulativeSumPattern::new(client.clone(), "sth_realized_peak_regret".to_string()), + lth: BlockCumulativeSumPattern::new(client.clone(), "lth_realized_peak_regret".to_string()), + cumulative: SeriesPattern18::new(client.clone(), "realized_peak_regret_cumulative_cents_by_term".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_NetPnlChange1mToRcap { + pub all: PercentPpmRatioPattern, + pub sth: PercentPpmRatioPattern, + pub lth: PercentPpmRatioPattern, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_NetPnlChange1mToRcap { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: PercentPpmRatioPattern::new(client.clone(), "all_net_pnl_change_1m_to_rcap".to_string()), + sth: PercentPpmRatioPattern::new(client.clone(), "sth_net_pnl_change_1m_to_rcap".to_string()), + lth: PercentPpmRatioPattern::new(client.clone(), "lth_net_pnl_change_1m_to_rcap".to_string()), + height: SeriesPattern18::new(client.clone(), "net_pnl_change_1m_to_rcap_ppm_by_aggregate".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_SellSideRiskRatio { + pub all: _1m1w1y24hHeightPattern3, + pub sth: _1m1w1y24hHeightPattern3, + pub lth: _1m1w1y24hHeightPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_SellSideRiskRatio { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: _1m1w1y24hHeightPattern3::new(client.clone(), "all_sell_side_risk_ratio".to_string()), + sth: _1m1w1y24hHeightPattern3::new(client.clone(), "sth_sell_side_risk_ratio".to_string()), + lth: _1m1w1y24hHeightPattern3::new(client.clone(), "lth_sell_side_risk_ratio".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_SoprRatioExtended { + pub all: _1m1w1yHeightPattern, + pub sth: _1m1w1yHeightPattern, + pub lth: _1m1w1yHeightPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_SoprRatioExtended { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: _1m1w1yHeightPattern::new(client.clone(), "all_sopr".to_string()), + sth: _1m1w1yHeightPattern::new(client.clone(), "sth_sopr".to_string()), + lth: _1m1w1yHeightPattern::new(client.clone(), "lth_sopr".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_ProfitToLossRatio { + pub all: _1m1w1y24hHeightPattern2, + pub sth: _1m1w1y24hHeightPattern2, + pub lth: _1m1w1y24hHeightPattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_ProfitToLossRatio { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: _1m1w1y24hHeightPattern2::new(client.clone(), "all_realized_profit_to_loss_ratio".to_string()), + sth: _1m1w1y24hHeightPattern2::new(client.clone(), "sth_realized_profit_to_loss_ratio".to_string()), + lth: _1m1w1y24hHeightPattern2::new(client.clone(), "lth_realized_profit_to_loss_ratio".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv { + pub all: SeriesPattern1, + pub age: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Class, + pub entry: DiscountPremiumPattern7, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount, + pub term: LongShortPattern7, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "mvrv".to_string()), + age: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern7::new(client.clone(), "mvrv".to_string()), + utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: LongShortPattern7::new(client.clone(), "mvrv".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6::new(client.clone(), "mvrv".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Range { + pub under_1h: SeriesPattern1, + pub _1h_to_1d: SeriesPattern1, + pub _1d_to_1w: SeriesPattern1, + pub _1w_to_1m: SeriesPattern1, + pub _1m_to_2m: SeriesPattern1, + pub _2m_to_3m: SeriesPattern1, + pub _3m_to_4m: SeriesPattern1, + pub _4m_to_5m: SeriesPattern1, + pub _5m_to_6m: SeriesPattern1, + pub _6m_to_9m: SeriesPattern1, + pub _9m_to_1y: SeriesPattern1, + pub _1y_to_18m: SeriesPattern1, + pub _18m_to_2y: SeriesPattern1, + pub _2y_to_3y: SeriesPattern1, + pub _3y_to_4y: SeriesPattern1, + pub _4y_to_5y: SeriesPattern1, + pub _5y_to_6y: SeriesPattern1, + pub _6y_to_7y: SeriesPattern1, + pub _7y_to_8y: SeriesPattern1, + pub _8y_to_10y: SeriesPattern1, + pub _10y_to_12y: SeriesPattern1, + pub _12y_to_15y: SeriesPattern1, + pub over_15y: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: SeriesPattern1::new(client.clone(), "utxos_under_1h_old_mvrv".to_string()), + _1h_to_1d: SeriesPattern1::new(client.clone(), "utxos_1h_to_1d_old_mvrv".to_string()), + _1d_to_1w: SeriesPattern1::new(client.clone(), "utxos_1d_to_1w_old_mvrv".to_string()), + _1w_to_1m: SeriesPattern1::new(client.clone(), "utxos_1w_to_1m_old_mvrv".to_string()), + _1m_to_2m: SeriesPattern1::new(client.clone(), "utxos_1m_to_2m_old_mvrv".to_string()), + _2m_to_3m: SeriesPattern1::new(client.clone(), "utxos_2m_to_3m_old_mvrv".to_string()), + _3m_to_4m: SeriesPattern1::new(client.clone(), "utxos_3m_to_4m_old_mvrv".to_string()), + _4m_to_5m: SeriesPattern1::new(client.clone(), "utxos_4m_to_5m_old_mvrv".to_string()), + _5m_to_6m: SeriesPattern1::new(client.clone(), "utxos_5m_to_6m_old_mvrv".to_string()), + _6m_to_9m: SeriesPattern1::new(client.clone(), "utxos_6m_to_9m_old_mvrv".to_string()), + _9m_to_1y: SeriesPattern1::new(client.clone(), "utxos_9m_to_1y_old_mvrv".to_string()), + _1y_to_18m: SeriesPattern1::new(client.clone(), "utxos_1y_to_18m_old_mvrv".to_string()), + _18m_to_2y: SeriesPattern1::new(client.clone(), "utxos_18m_to_2y_old_mvrv".to_string()), + _2y_to_3y: SeriesPattern1::new(client.clone(), "utxos_2y_to_3y_old_mvrv".to_string()), + _3y_to_4y: SeriesPattern1::new(client.clone(), "utxos_3y_to_4y_old_mvrv".to_string()), + _4y_to_5y: SeriesPattern1::new(client.clone(), "utxos_4y_to_5y_old_mvrv".to_string()), + _5y_to_6y: SeriesPattern1::new(client.clone(), "utxos_5y_to_6y_old_mvrv".to_string()), + _6y_to_7y: SeriesPattern1::new(client.clone(), "utxos_6y_to_7y_old_mvrv".to_string()), + _7y_to_8y: SeriesPattern1::new(client.clone(), "utxos_7y_to_8y_old_mvrv".to_string()), + _8y_to_10y: SeriesPattern1::new(client.clone(), "utxos_8y_to_10y_old_mvrv".to_string()), + _10y_to_12y: SeriesPattern1::new(client.clone(), "utxos_10y_to_12y_old_mvrv".to_string()), + _12y_to_15y: SeriesPattern1::new(client.clone(), "utxos_12y_to_15y_old_mvrv".to_string()), + over_15y: SeriesPattern1::new(client.clone(), "utxos_over_15y_old_mvrv".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Under { + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _9m: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, + pub _15y: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: SeriesPattern1::new(client.clone(), "utxos_under_1w_old_mvrv".to_string()), + _1m: SeriesPattern1::new(client.clone(), "utxos_under_1m_old_mvrv".to_string()), + _2m: SeriesPattern1::new(client.clone(), "utxos_under_2m_old_mvrv".to_string()), + _3m: SeriesPattern1::new(client.clone(), "utxos_under_3m_old_mvrv".to_string()), + _4m: SeriesPattern1::new(client.clone(), "utxos_under_4m_old_mvrv".to_string()), + _5m: SeriesPattern1::new(client.clone(), "utxos_under_5m_old_mvrv".to_string()), + _6m: SeriesPattern1::new(client.clone(), "utxos_under_6m_old_mvrv".to_string()), + _9m: SeriesPattern1::new(client.clone(), "utxos_under_9m_old_mvrv".to_string()), + _1y: SeriesPattern1::new(client.clone(), "utxos_under_1y_old_mvrv".to_string()), + _18m: SeriesPattern1::new(client.clone(), "utxos_under_18m_old_mvrv".to_string()), + _2y: SeriesPattern1::new(client.clone(), "utxos_under_2y_old_mvrv".to_string()), + _3y: SeriesPattern1::new(client.clone(), "utxos_under_3y_old_mvrv".to_string()), + _4y: SeriesPattern1::new(client.clone(), "utxos_under_4y_old_mvrv".to_string()), + _5y: SeriesPattern1::new(client.clone(), "utxos_under_5y_old_mvrv".to_string()), + _6y: SeriesPattern1::new(client.clone(), "utxos_under_6y_old_mvrv".to_string()), + _7y: SeriesPattern1::new(client.clone(), "utxos_under_7y_old_mvrv".to_string()), + _8y: SeriesPattern1::new(client.clone(), "utxos_under_8y_old_mvrv".to_string()), + _10y: SeriesPattern1::new(client.clone(), "utxos_under_10y_old_mvrv".to_string()), + _12y: SeriesPattern1::new(client.clone(), "utxos_under_12y_old_mvrv".to_string()), + _15y: SeriesPattern1::new(client.clone(), "utxos_under_15y_old_mvrv".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Over { + pub _1d: SeriesPattern1, + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _9m: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: SeriesPattern1::new(client.clone(), "utxos_over_1d_old_mvrv".to_string()), + _1w: SeriesPattern1::new(client.clone(), "utxos_over_1w_old_mvrv".to_string()), + _1m: SeriesPattern1::new(client.clone(), "utxos_over_1m_old_mvrv".to_string()), + _2m: SeriesPattern1::new(client.clone(), "utxos_over_2m_old_mvrv".to_string()), + _3m: SeriesPattern1::new(client.clone(), "utxos_over_3m_old_mvrv".to_string()), + _4m: SeriesPattern1::new(client.clone(), "utxos_over_4m_old_mvrv".to_string()), + _5m: SeriesPattern1::new(client.clone(), "utxos_over_5m_old_mvrv".to_string()), + _6m: SeriesPattern1::new(client.clone(), "utxos_over_6m_old_mvrv".to_string()), + _9m: SeriesPattern1::new(client.clone(), "utxos_over_9m_old_mvrv".to_string()), + _1y: SeriesPattern1::new(client.clone(), "utxos_over_1y_old_mvrv".to_string()), + _18m: SeriesPattern1::new(client.clone(), "utxos_over_18m_old_mvrv".to_string()), + _2y: SeriesPattern1::new(client.clone(), "utxos_over_2y_old_mvrv".to_string()), + _3y: SeriesPattern1::new(client.clone(), "utxos_over_3y_old_mvrv".to_string()), + _4y: SeriesPattern1::new(client.clone(), "utxos_over_4y_old_mvrv".to_string()), + _5y: SeriesPattern1::new(client.clone(), "utxos_over_5y_old_mvrv".to_string()), + _6y: SeriesPattern1::new(client.clone(), "utxos_over_6y_old_mvrv".to_string()), + _7y: SeriesPattern1::new(client.clone(), "utxos_over_7y_old_mvrv".to_string()), + _8y: SeriesPattern1::new(client.clone(), "utxos_over_8y_old_mvrv".to_string()), + _10y: SeriesPattern1::new(client.clone(), "utxos_over_10y_old_mvrv".to_string()), + _12y: SeriesPattern1::new(client.clone(), "utxos_over_12y_old_mvrv".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Epoch { + pub _0: SeriesPattern1, + pub _1: SeriesPattern1, + pub _2: SeriesPattern1, + pub _3: SeriesPattern1, + pub _4: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: SeriesPattern1::new(client.clone(), "epoch_0_mvrv".to_string()), + _1: SeriesPattern1::new(client.clone(), "epoch_1_mvrv".to_string()), + _2: SeriesPattern1::new(client.clone(), "epoch_2_mvrv".to_string()), + _3: SeriesPattern1::new(client.clone(), "epoch_3_mvrv".to_string()), + _4: SeriesPattern1::new(client.clone(), "epoch_4_mvrv".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Class { + pub _2009: SeriesPattern1, + pub _2010: SeriesPattern1, + pub _2011: SeriesPattern1, + pub _2012: SeriesPattern1, + pub _2013: SeriesPattern1, + pub _2014: SeriesPattern1, + pub _2015: SeriesPattern1, + pub _2016: SeriesPattern1, + pub _2017: SeriesPattern1, + pub _2018: SeriesPattern1, + pub _2019: SeriesPattern1, + pub _2020: SeriesPattern1, + pub _2021: SeriesPattern1, + pub _2022: SeriesPattern1, + pub _2023: SeriesPattern1, + pub _2024: SeriesPattern1, + pub _2025: SeriesPattern1, + pub _2026: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: SeriesPattern1::new(client.clone(), "class_2009_mvrv".to_string()), + _2010: SeriesPattern1::new(client.clone(), "class_2010_mvrv".to_string()), + _2011: SeriesPattern1::new(client.clone(), "class_2011_mvrv".to_string()), + _2012: SeriesPattern1::new(client.clone(), "class_2012_mvrv".to_string()), + _2013: SeriesPattern1::new(client.clone(), "class_2013_mvrv".to_string()), + _2014: SeriesPattern1::new(client.clone(), "class_2014_mvrv".to_string()), + _2015: SeriesPattern1::new(client.clone(), "class_2015_mvrv".to_string()), + _2016: SeriesPattern1::new(client.clone(), "class_2016_mvrv".to_string()), + _2017: SeriesPattern1::new(client.clone(), "class_2017_mvrv".to_string()), + _2018: SeriesPattern1::new(client.clone(), "class_2018_mvrv".to_string()), + _2019: SeriesPattern1::new(client.clone(), "class_2019_mvrv".to_string()), + _2020: SeriesPattern1::new(client.clone(), "class_2020_mvrv".to_string()), + _2021: SeriesPattern1::new(client.clone(), "class_2021_mvrv".to_string()), + _2022: SeriesPattern1::new(client.clone(), "class_2022_mvrv".to_string()), + _2023: SeriesPattern1::new(client.clone(), "class_2023_mvrv".to_string()), + _2024: SeriesPattern1::new(client.clone(), "class_2024_mvrv".to_string()), + _2025: SeriesPattern1::new(client.clone(), "class_2025_mvrv".to_string()), + _2026: SeriesPattern1::new(client.clone(), "class_2026_mvrv".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount { + pub range: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Range, + pub under: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Under, + pub over: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Range { + pub _0sats: SeriesPattern1, + pub _1sat_to_10sats: SeriesPattern1, + pub _10sats_to_100sats: SeriesPattern1, + pub _100sats_to_1k_sats: SeriesPattern1, + pub _1k_sats_to_10k_sats: SeriesPattern1, + pub _10k_sats_to_100k_sats: SeriesPattern1, + pub _100k_sats_to_1m_sats: SeriesPattern1, + pub _1m_sats_to_10m_sats: SeriesPattern1, + pub _10m_sats_to_1btc: SeriesPattern1, + pub _1btc_to_10btc: SeriesPattern1, + pub _10btc_to_100btc: SeriesPattern1, + pub _100btc_to_1k_btc: SeriesPattern1, + pub _1k_btc_to_10k_btc: SeriesPattern1, + pub _10k_btc_to_100k_btc: SeriesPattern1, + pub over_100k_btc: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: SeriesPattern1::new(client.clone(), "utxos_0sats_mvrv".to_string()), + _1sat_to_10sats: SeriesPattern1::new(client.clone(), "utxos_1sat_to_10sats_mvrv".to_string()), + _10sats_to_100sats: SeriesPattern1::new(client.clone(), "utxos_10sats_to_100sats_mvrv".to_string()), + _100sats_to_1k_sats: SeriesPattern1::new(client.clone(), "utxos_100sats_to_1k_sats_mvrv".to_string()), + _1k_sats_to_10k_sats: SeriesPattern1::new(client.clone(), "utxos_1k_sats_to_10k_sats_mvrv".to_string()), + _10k_sats_to_100k_sats: SeriesPattern1::new(client.clone(), "utxos_10k_sats_to_100k_sats_mvrv".to_string()), + _100k_sats_to_1m_sats: SeriesPattern1::new(client.clone(), "utxos_100k_sats_to_1m_sats_mvrv".to_string()), + _1m_sats_to_10m_sats: SeriesPattern1::new(client.clone(), "utxos_1m_sats_to_10m_sats_mvrv".to_string()), + _10m_sats_to_1btc: SeriesPattern1::new(client.clone(), "utxos_10m_sats_to_1btc_mvrv".to_string()), + _1btc_to_10btc: SeriesPattern1::new(client.clone(), "utxos_1btc_to_10btc_mvrv".to_string()), + _10btc_to_100btc: SeriesPattern1::new(client.clone(), "utxos_10btc_to_100btc_mvrv".to_string()), + _100btc_to_1k_btc: SeriesPattern1::new(client.clone(), "utxos_100btc_to_1k_btc_mvrv".to_string()), + _1k_btc_to_10k_btc: SeriesPattern1::new(client.clone(), "utxos_1k_btc_to_10k_btc_mvrv".to_string()), + _10k_btc_to_100k_btc: SeriesPattern1::new(client.clone(), "utxos_10k_btc_to_100k_btc_mvrv".to_string()), + over_100k_btc: SeriesPattern1::new(client.clone(), "utxos_over_100k_btc_mvrv".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Under { + pub _10sats: SeriesPattern1, + pub _100sats: SeriesPattern1, + pub _1k_sats: SeriesPattern1, + pub _10k_sats: SeriesPattern1, + pub _100k_sats: SeriesPattern1, + pub _1m_sats: SeriesPattern1, + pub _10m_sats: SeriesPattern1, + pub _1btc: SeriesPattern1, + pub _10btc: SeriesPattern1, + pub _100btc: SeriesPattern1, + pub _1k_btc: SeriesPattern1, + pub _10k_btc: SeriesPattern1, + pub _100k_btc: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: SeriesPattern1::new(client.clone(), "utxos_under_10sats_mvrv".to_string()), + _100sats: SeriesPattern1::new(client.clone(), "utxos_under_100sats_mvrv".to_string()), + _1k_sats: SeriesPattern1::new(client.clone(), "utxos_under_1k_sats_mvrv".to_string()), + _10k_sats: SeriesPattern1::new(client.clone(), "utxos_under_10k_sats_mvrv".to_string()), + _100k_sats: SeriesPattern1::new(client.clone(), "utxos_under_100k_sats_mvrv".to_string()), + _1m_sats: SeriesPattern1::new(client.clone(), "utxos_under_1m_sats_mvrv".to_string()), + _10m_sats: SeriesPattern1::new(client.clone(), "utxos_under_10m_sats_mvrv".to_string()), + _1btc: SeriesPattern1::new(client.clone(), "utxos_under_1btc_mvrv".to_string()), + _10btc: SeriesPattern1::new(client.clone(), "utxos_under_10btc_mvrv".to_string()), + _100btc: SeriesPattern1::new(client.clone(), "utxos_under_100btc_mvrv".to_string()), + _1k_btc: SeriesPattern1::new(client.clone(), "utxos_under_1k_btc_mvrv".to_string()), + _10k_btc: SeriesPattern1::new(client.clone(), "utxos_under_10k_btc_mvrv".to_string()), + _100k_btc: SeriesPattern1::new(client.clone(), "utxos_under_100k_btc_mvrv".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Over { + pub _1sat: SeriesPattern1, + pub _10sats: SeriesPattern1, + pub _100sats: SeriesPattern1, + pub _1k_sats: SeriesPattern1, + pub _10k_sats: SeriesPattern1, + pub _100k_sats: SeriesPattern1, + pub _1m_sats: SeriesPattern1, + pub _10m_sats: SeriesPattern1, + pub _1btc: SeriesPattern1, + pub _10btc: SeriesPattern1, + pub _100btc: SeriesPattern1, + pub _1k_btc: SeriesPattern1, + pub _10k_btc: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: SeriesPattern1::new(client.clone(), "utxos_over_1sat_mvrv".to_string()), + _10sats: SeriesPattern1::new(client.clone(), "utxos_over_10sats_mvrv".to_string()), + _100sats: SeriesPattern1::new(client.clone(), "utxos_over_100sats_mvrv".to_string()), + _1k_sats: SeriesPattern1::new(client.clone(), "utxos_over_1k_sats_mvrv".to_string()), + _10k_sats: SeriesPattern1::new(client.clone(), "utxos_over_10k_sats_mvrv".to_string()), + _100k_sats: SeriesPattern1::new(client.clone(), "utxos_over_100k_sats_mvrv".to_string()), + _1m_sats: SeriesPattern1::new(client.clone(), "utxos_over_1m_sats_mvrv".to_string()), + _10m_sats: SeriesPattern1::new(client.clone(), "utxos_over_10m_sats_mvrv".to_string()), + _1btc: SeriesPattern1::new(client.clone(), "utxos_over_1btc_mvrv".to_string()), + _10btc: SeriesPattern1::new(client.clone(), "utxos_over_10btc_mvrv".to_string()), + _100btc: SeriesPattern1::new(client.clone(), "utxos_over_100btc_mvrv".to_string()), + _1k_btc: SeriesPattern1::new(client.clone(), "utxos_over_1k_btc_mvrv".to_string()), + _10k_btc: SeriesPattern1::new(client.clone(), "utxos_over_10k_btc_mvrv".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized { + pub profit: SeriesTree_Cohorts_Cohorts_Unrealized_Profit, + pub loss: SeriesTree_Cohorts_Cohorts_Unrealized_Loss, + pub net_pnl: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl, + pub gross_pnl: SeriesTree_Cohorts_Cohorts_Unrealized_GrossPnl, + pub invested_capital_in_profit: SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInProfit, + pub invested_capital_in_loss: SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInLoss, + pub capitalized_cap_in_profit_raw: MatrixPattern, + pub capitalized_cap_in_loss_raw: MatrixPattern, + pub pain_index: SeriesTree_Cohorts_Cohorts_Unrealized_PainIndex, + pub greed_index: SeriesTree_Cohorts_Cohorts_Unrealized_GreedIndex, + pub net_sentiment: SeriesTree_Cohorts_Cohorts_Unrealized_NetSentiment, + pub nupl: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + profit: SeriesTree_Cohorts_Cohorts_Unrealized_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Cohorts_Unrealized_Loss::new(client.clone(), format!("{base_path}_loss")), + net_pnl: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl::new(client.clone(), format!("{base_path}_net_pnl")), + gross_pnl: SeriesTree_Cohorts_Cohorts_Unrealized_GrossPnl::new(client.clone(), format!("{base_path}_gross_pnl")), + invested_capital_in_profit: SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInProfit::new(client.clone(), format!("{base_path}_invested_capital_in_profit")), + invested_capital_in_loss: SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInLoss::new(client.clone(), format!("{base_path}_invested_capital_in_loss")), + capitalized_cap_in_profit_raw: MatrixPattern::new(client.clone(), "capitalized_cap_in_profit_raw_by_term".to_string()), + capitalized_cap_in_loss_raw: MatrixPattern::new(client.clone(), "capitalized_cap_in_loss_raw_by_term".to_string()), + pain_index: SeriesTree_Cohorts_Cohorts_Unrealized_PainIndex::new(client.clone(), format!("{base_path}_pain_index")), + greed_index: SeriesTree_Cohorts_Cohorts_Unrealized_GreedIndex::new(client.clone(), format!("{base_path}_greed_index")), + net_sentiment: SeriesTree_Cohorts_Cohorts_Unrealized_NetSentiment::new(client.clone(), format!("{base_path}_net_sentiment")), + nupl: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl::new(client.clone(), format!("{base_path}_nupl")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Profit { + pub all: CentsUsdPattern3, + pub age: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Class, + pub entry: DiscountPremiumPattern13, + pub term: LongShortPattern14, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Profit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsUsdPattern3::new(client.clone(), "unrealized_profit".to_string()), + age: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern13::new(client.clone(), "unrealized_profit".to_string()), + term: LongShortPattern14::new(client.clone(), "unrealized_profit".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11::new(client.clone(), "unrealized_profit".to_string()), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_unrealized_profit_cents_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "unrealized_profit_cents_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "unrealized_profit_cents_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "unrealized_profit_cents_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "unrealized_profit_cents_by_type".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age { + pub range: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Range { + pub under_1h: CentsUsdPattern3, + pub _1h_to_1d: CentsUsdPattern3, + pub _1d_to_1w: CentsUsdPattern3, + pub _1w_to_1m: CentsUsdPattern3, + pub _1m_to_2m: CentsUsdPattern3, + pub _2m_to_3m: CentsUsdPattern3, + pub _3m_to_4m: CentsUsdPattern3, + pub _4m_to_5m: CentsUsdPattern3, + pub _5m_to_6m: CentsUsdPattern3, + pub _6m_to_9m: CentsUsdPattern3, + pub _9m_to_1y: CentsUsdPattern3, + pub _1y_to_18m: CentsUsdPattern3, + pub _18m_to_2y: CentsUsdPattern3, + pub _2y_to_3y: CentsUsdPattern3, + pub _3y_to_4y: CentsUsdPattern3, + pub _4y_to_5y: CentsUsdPattern3, + pub _5y_to_6y: CentsUsdPattern3, + pub _6y_to_7y: CentsUsdPattern3, + pub _7y_to_8y: CentsUsdPattern3, + pub _8y_to_10y: CentsUsdPattern3, + pub _10y_to_12y: CentsUsdPattern3, + pub _12y_to_15y: CentsUsdPattern3, + pub over_15y: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: CentsUsdPattern3::new(client.clone(), "utxos_under_1h_old_unrealized_profit".to_string()), + _1h_to_1d: CentsUsdPattern3::new(client.clone(), "utxos_1h_to_1d_old_unrealized_profit".to_string()), + _1d_to_1w: CentsUsdPattern3::new(client.clone(), "utxos_1d_to_1w_old_unrealized_profit".to_string()), + _1w_to_1m: CentsUsdPattern3::new(client.clone(), "utxos_1w_to_1m_old_unrealized_profit".to_string()), + _1m_to_2m: CentsUsdPattern3::new(client.clone(), "utxos_1m_to_2m_old_unrealized_profit".to_string()), + _2m_to_3m: CentsUsdPattern3::new(client.clone(), "utxos_2m_to_3m_old_unrealized_profit".to_string()), + _3m_to_4m: CentsUsdPattern3::new(client.clone(), "utxos_3m_to_4m_old_unrealized_profit".to_string()), + _4m_to_5m: CentsUsdPattern3::new(client.clone(), "utxos_4m_to_5m_old_unrealized_profit".to_string()), + _5m_to_6m: CentsUsdPattern3::new(client.clone(), "utxos_5m_to_6m_old_unrealized_profit".to_string()), + _6m_to_9m: CentsUsdPattern3::new(client.clone(), "utxos_6m_to_9m_old_unrealized_profit".to_string()), + _9m_to_1y: CentsUsdPattern3::new(client.clone(), "utxos_9m_to_1y_old_unrealized_profit".to_string()), + _1y_to_18m: CentsUsdPattern3::new(client.clone(), "utxos_1y_to_18m_old_unrealized_profit".to_string()), + _18m_to_2y: CentsUsdPattern3::new(client.clone(), "utxos_18m_to_2y_old_unrealized_profit".to_string()), + _2y_to_3y: CentsUsdPattern3::new(client.clone(), "utxos_2y_to_3y_old_unrealized_profit".to_string()), + _3y_to_4y: CentsUsdPattern3::new(client.clone(), "utxos_3y_to_4y_old_unrealized_profit".to_string()), + _4y_to_5y: CentsUsdPattern3::new(client.clone(), "utxos_4y_to_5y_old_unrealized_profit".to_string()), + _5y_to_6y: CentsUsdPattern3::new(client.clone(), "utxos_5y_to_6y_old_unrealized_profit".to_string()), + _6y_to_7y: CentsUsdPattern3::new(client.clone(), "utxos_6y_to_7y_old_unrealized_profit".to_string()), + _7y_to_8y: CentsUsdPattern3::new(client.clone(), "utxos_7y_to_8y_old_unrealized_profit".to_string()), + _8y_to_10y: CentsUsdPattern3::new(client.clone(), "utxos_8y_to_10y_old_unrealized_profit".to_string()), + _10y_to_12y: CentsUsdPattern3::new(client.clone(), "utxos_10y_to_12y_old_unrealized_profit".to_string()), + _12y_to_15y: CentsUsdPattern3::new(client.clone(), "utxos_12y_to_15y_old_unrealized_profit".to_string()), + over_15y: CentsUsdPattern3::new(client.clone(), "utxos_over_15y_old_unrealized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Under { + pub _1w: CentsUsdPattern3, + pub _1m: CentsUsdPattern3, + pub _2m: CentsUsdPattern3, + pub _3m: CentsUsdPattern3, + pub _4m: CentsUsdPattern3, + pub _5m: CentsUsdPattern3, + pub _6m: CentsUsdPattern3, + pub _9m: CentsUsdPattern3, + pub _1y: CentsUsdPattern3, + pub _18m: CentsUsdPattern3, + pub _2y: CentsUsdPattern3, + pub _3y: CentsUsdPattern3, + pub _4y: CentsUsdPattern3, + pub _5y: CentsUsdPattern3, + pub _6y: CentsUsdPattern3, + pub _7y: CentsUsdPattern3, + pub _8y: CentsUsdPattern3, + pub _10y: CentsUsdPattern3, + pub _12y: CentsUsdPattern3, + pub _15y: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: CentsUsdPattern3::new(client.clone(), "utxos_under_1w_old_unrealized_profit".to_string()), + _1m: CentsUsdPattern3::new(client.clone(), "utxos_under_1m_old_unrealized_profit".to_string()), + _2m: CentsUsdPattern3::new(client.clone(), "utxos_under_2m_old_unrealized_profit".to_string()), + _3m: CentsUsdPattern3::new(client.clone(), "utxos_under_3m_old_unrealized_profit".to_string()), + _4m: CentsUsdPattern3::new(client.clone(), "utxos_under_4m_old_unrealized_profit".to_string()), + _5m: CentsUsdPattern3::new(client.clone(), "utxos_under_5m_old_unrealized_profit".to_string()), + _6m: CentsUsdPattern3::new(client.clone(), "utxos_under_6m_old_unrealized_profit".to_string()), + _9m: CentsUsdPattern3::new(client.clone(), "utxos_under_9m_old_unrealized_profit".to_string()), + _1y: CentsUsdPattern3::new(client.clone(), "utxos_under_1y_old_unrealized_profit".to_string()), + _18m: CentsUsdPattern3::new(client.clone(), "utxos_under_18m_old_unrealized_profit".to_string()), + _2y: CentsUsdPattern3::new(client.clone(), "utxos_under_2y_old_unrealized_profit".to_string()), + _3y: CentsUsdPattern3::new(client.clone(), "utxos_under_3y_old_unrealized_profit".to_string()), + _4y: CentsUsdPattern3::new(client.clone(), "utxos_under_4y_old_unrealized_profit".to_string()), + _5y: CentsUsdPattern3::new(client.clone(), "utxos_under_5y_old_unrealized_profit".to_string()), + _6y: CentsUsdPattern3::new(client.clone(), "utxos_under_6y_old_unrealized_profit".to_string()), + _7y: CentsUsdPattern3::new(client.clone(), "utxos_under_7y_old_unrealized_profit".to_string()), + _8y: CentsUsdPattern3::new(client.clone(), "utxos_under_8y_old_unrealized_profit".to_string()), + _10y: CentsUsdPattern3::new(client.clone(), "utxos_under_10y_old_unrealized_profit".to_string()), + _12y: CentsUsdPattern3::new(client.clone(), "utxos_under_12y_old_unrealized_profit".to_string()), + _15y: CentsUsdPattern3::new(client.clone(), "utxos_under_15y_old_unrealized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Over { + pub _1d: CentsUsdPattern3, + pub _1w: CentsUsdPattern3, + pub _1m: CentsUsdPattern3, + pub _2m: CentsUsdPattern3, + pub _3m: CentsUsdPattern3, + pub _4m: CentsUsdPattern3, + pub _5m: CentsUsdPattern3, + pub _6m: CentsUsdPattern3, + pub _9m: CentsUsdPattern3, + pub _1y: CentsUsdPattern3, + pub _18m: CentsUsdPattern3, + pub _2y: CentsUsdPattern3, + pub _3y: CentsUsdPattern3, + pub _4y: CentsUsdPattern3, + pub _5y: CentsUsdPattern3, + pub _6y: CentsUsdPattern3, + pub _7y: CentsUsdPattern3, + pub _8y: CentsUsdPattern3, + pub _10y: CentsUsdPattern3, + pub _12y: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: CentsUsdPattern3::new(client.clone(), "utxos_over_1d_old_unrealized_profit".to_string()), + _1w: CentsUsdPattern3::new(client.clone(), "utxos_over_1w_old_unrealized_profit".to_string()), + _1m: CentsUsdPattern3::new(client.clone(), "utxos_over_1m_old_unrealized_profit".to_string()), + _2m: CentsUsdPattern3::new(client.clone(), "utxos_over_2m_old_unrealized_profit".to_string()), + _3m: CentsUsdPattern3::new(client.clone(), "utxos_over_3m_old_unrealized_profit".to_string()), + _4m: CentsUsdPattern3::new(client.clone(), "utxos_over_4m_old_unrealized_profit".to_string()), + _5m: CentsUsdPattern3::new(client.clone(), "utxos_over_5m_old_unrealized_profit".to_string()), + _6m: CentsUsdPattern3::new(client.clone(), "utxos_over_6m_old_unrealized_profit".to_string()), + _9m: CentsUsdPattern3::new(client.clone(), "utxos_over_9m_old_unrealized_profit".to_string()), + _1y: CentsUsdPattern3::new(client.clone(), "utxos_over_1y_old_unrealized_profit".to_string()), + _18m: CentsUsdPattern3::new(client.clone(), "utxos_over_18m_old_unrealized_profit".to_string()), + _2y: CentsUsdPattern3::new(client.clone(), "utxos_over_2y_old_unrealized_profit".to_string()), + _3y: CentsUsdPattern3::new(client.clone(), "utxos_over_3y_old_unrealized_profit".to_string()), + _4y: CentsUsdPattern3::new(client.clone(), "utxos_over_4y_old_unrealized_profit".to_string()), + _5y: CentsUsdPattern3::new(client.clone(), "utxos_over_5y_old_unrealized_profit".to_string()), + _6y: CentsUsdPattern3::new(client.clone(), "utxos_over_6y_old_unrealized_profit".to_string()), + _7y: CentsUsdPattern3::new(client.clone(), "utxos_over_7y_old_unrealized_profit".to_string()), + _8y: CentsUsdPattern3::new(client.clone(), "utxos_over_8y_old_unrealized_profit".to_string()), + _10y: CentsUsdPattern3::new(client.clone(), "utxos_over_10y_old_unrealized_profit".to_string()), + _12y: CentsUsdPattern3::new(client.clone(), "utxos_over_12y_old_unrealized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Epoch { + pub _0: CentsUsdPattern3, + pub _1: CentsUsdPattern3, + pub _2: CentsUsdPattern3, + pub _3: CentsUsdPattern3, + pub _4: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: CentsUsdPattern3::new(client.clone(), "epoch_0_unrealized_profit".to_string()), + _1: CentsUsdPattern3::new(client.clone(), "epoch_1_unrealized_profit".to_string()), + _2: CentsUsdPattern3::new(client.clone(), "epoch_2_unrealized_profit".to_string()), + _3: CentsUsdPattern3::new(client.clone(), "epoch_3_unrealized_profit".to_string()), + _4: CentsUsdPattern3::new(client.clone(), "epoch_4_unrealized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Class { + pub _2009: CentsUsdPattern3, + pub _2010: CentsUsdPattern3, + pub _2011: CentsUsdPattern3, + pub _2012: CentsUsdPattern3, + pub _2013: CentsUsdPattern3, + pub _2014: CentsUsdPattern3, + pub _2015: CentsUsdPattern3, + pub _2016: CentsUsdPattern3, + pub _2017: CentsUsdPattern3, + pub _2018: CentsUsdPattern3, + pub _2019: CentsUsdPattern3, + pub _2020: CentsUsdPattern3, + pub _2021: CentsUsdPattern3, + pub _2022: CentsUsdPattern3, + pub _2023: CentsUsdPattern3, + pub _2024: CentsUsdPattern3, + pub _2025: CentsUsdPattern3, + pub _2026: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: CentsUsdPattern3::new(client.clone(), "class_2009_unrealized_profit".to_string()), + _2010: CentsUsdPattern3::new(client.clone(), "class_2010_unrealized_profit".to_string()), + _2011: CentsUsdPattern3::new(client.clone(), "class_2011_unrealized_profit".to_string()), + _2012: CentsUsdPattern3::new(client.clone(), "class_2012_unrealized_profit".to_string()), + _2013: CentsUsdPattern3::new(client.clone(), "class_2013_unrealized_profit".to_string()), + _2014: CentsUsdPattern3::new(client.clone(), "class_2014_unrealized_profit".to_string()), + _2015: CentsUsdPattern3::new(client.clone(), "class_2015_unrealized_profit".to_string()), + _2016: CentsUsdPattern3::new(client.clone(), "class_2016_unrealized_profit".to_string()), + _2017: CentsUsdPattern3::new(client.clone(), "class_2017_unrealized_profit".to_string()), + _2018: CentsUsdPattern3::new(client.clone(), "class_2018_unrealized_profit".to_string()), + _2019: CentsUsdPattern3::new(client.clone(), "class_2019_unrealized_profit".to_string()), + _2020: CentsUsdPattern3::new(client.clone(), "class_2020_unrealized_profit".to_string()), + _2021: CentsUsdPattern3::new(client.clone(), "class_2021_unrealized_profit".to_string()), + _2022: CentsUsdPattern3::new(client.clone(), "class_2022_unrealized_profit".to_string()), + _2023: CentsUsdPattern3::new(client.clone(), "class_2023_unrealized_profit".to_string()), + _2024: CentsUsdPattern3::new(client.clone(), "class_2024_unrealized_profit".to_string()), + _2025: CentsUsdPattern3::new(client.clone(), "class_2025_unrealized_profit".to_string()), + _2026: CentsUsdPattern3::new(client.clone(), "class_2026_unrealized_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss { + pub all: CentsUsdPattern3, + pub age: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Class, + pub entry: DiscountPremiumPattern13, + pub term: LongShortPattern14, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, + pub type_matrix: SeriesPattern18, + pub negative: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsUsdPattern3::new(client.clone(), "unrealized_loss".to_string()), + age: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern13::new(client.clone(), "unrealized_loss".to_string()), + term: LongShortPattern14::new(client.clone(), "unrealized_loss".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11::new(client.clone(), "unrealized_loss".to_string()), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_unrealized_loss_cents_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "unrealized_loss_cents_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "unrealized_loss_cents_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "unrealized_loss_cents_by_entry".to_string()), + type_matrix: SeriesPattern18::new(client.clone(), "unrealized_loss_cents_by_type".to_string()), + negative: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative::new(client.clone(), format!("{base_path}_negative")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age { + pub range: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Range { + pub under_1h: CentsUsdPattern3, + pub _1h_to_1d: CentsUsdPattern3, + pub _1d_to_1w: CentsUsdPattern3, + pub _1w_to_1m: CentsUsdPattern3, + pub _1m_to_2m: CentsUsdPattern3, + pub _2m_to_3m: CentsUsdPattern3, + pub _3m_to_4m: CentsUsdPattern3, + pub _4m_to_5m: CentsUsdPattern3, + pub _5m_to_6m: CentsUsdPattern3, + pub _6m_to_9m: CentsUsdPattern3, + pub _9m_to_1y: CentsUsdPattern3, + pub _1y_to_18m: CentsUsdPattern3, + pub _18m_to_2y: CentsUsdPattern3, + pub _2y_to_3y: CentsUsdPattern3, + pub _3y_to_4y: CentsUsdPattern3, + pub _4y_to_5y: CentsUsdPattern3, + pub _5y_to_6y: CentsUsdPattern3, + pub _6y_to_7y: CentsUsdPattern3, + pub _7y_to_8y: CentsUsdPattern3, + pub _8y_to_10y: CentsUsdPattern3, + pub _10y_to_12y: CentsUsdPattern3, + pub _12y_to_15y: CentsUsdPattern3, + pub over_15y: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: CentsUsdPattern3::new(client.clone(), "utxos_under_1h_old_unrealized_loss".to_string()), + _1h_to_1d: CentsUsdPattern3::new(client.clone(), "utxos_1h_to_1d_old_unrealized_loss".to_string()), + _1d_to_1w: CentsUsdPattern3::new(client.clone(), "utxos_1d_to_1w_old_unrealized_loss".to_string()), + _1w_to_1m: CentsUsdPattern3::new(client.clone(), "utxos_1w_to_1m_old_unrealized_loss".to_string()), + _1m_to_2m: CentsUsdPattern3::new(client.clone(), "utxos_1m_to_2m_old_unrealized_loss".to_string()), + _2m_to_3m: CentsUsdPattern3::new(client.clone(), "utxos_2m_to_3m_old_unrealized_loss".to_string()), + _3m_to_4m: CentsUsdPattern3::new(client.clone(), "utxos_3m_to_4m_old_unrealized_loss".to_string()), + _4m_to_5m: CentsUsdPattern3::new(client.clone(), "utxos_4m_to_5m_old_unrealized_loss".to_string()), + _5m_to_6m: CentsUsdPattern3::new(client.clone(), "utxos_5m_to_6m_old_unrealized_loss".to_string()), + _6m_to_9m: CentsUsdPattern3::new(client.clone(), "utxos_6m_to_9m_old_unrealized_loss".to_string()), + _9m_to_1y: CentsUsdPattern3::new(client.clone(), "utxos_9m_to_1y_old_unrealized_loss".to_string()), + _1y_to_18m: CentsUsdPattern3::new(client.clone(), "utxos_1y_to_18m_old_unrealized_loss".to_string()), + _18m_to_2y: CentsUsdPattern3::new(client.clone(), "utxos_18m_to_2y_old_unrealized_loss".to_string()), + _2y_to_3y: CentsUsdPattern3::new(client.clone(), "utxos_2y_to_3y_old_unrealized_loss".to_string()), + _3y_to_4y: CentsUsdPattern3::new(client.clone(), "utxos_3y_to_4y_old_unrealized_loss".to_string()), + _4y_to_5y: CentsUsdPattern3::new(client.clone(), "utxos_4y_to_5y_old_unrealized_loss".to_string()), + _5y_to_6y: CentsUsdPattern3::new(client.clone(), "utxos_5y_to_6y_old_unrealized_loss".to_string()), + _6y_to_7y: CentsUsdPattern3::new(client.clone(), "utxos_6y_to_7y_old_unrealized_loss".to_string()), + _7y_to_8y: CentsUsdPattern3::new(client.clone(), "utxos_7y_to_8y_old_unrealized_loss".to_string()), + _8y_to_10y: CentsUsdPattern3::new(client.clone(), "utxos_8y_to_10y_old_unrealized_loss".to_string()), + _10y_to_12y: CentsUsdPattern3::new(client.clone(), "utxos_10y_to_12y_old_unrealized_loss".to_string()), + _12y_to_15y: CentsUsdPattern3::new(client.clone(), "utxos_12y_to_15y_old_unrealized_loss".to_string()), + over_15y: CentsUsdPattern3::new(client.clone(), "utxos_over_15y_old_unrealized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Under { + pub _1w: CentsUsdPattern3, + pub _1m: CentsUsdPattern3, + pub _2m: CentsUsdPattern3, + pub _3m: CentsUsdPattern3, + pub _4m: CentsUsdPattern3, + pub _5m: CentsUsdPattern3, + pub _6m: CentsUsdPattern3, + pub _9m: CentsUsdPattern3, + pub _1y: CentsUsdPattern3, + pub _18m: CentsUsdPattern3, + pub _2y: CentsUsdPattern3, + pub _3y: CentsUsdPattern3, + pub _4y: CentsUsdPattern3, + pub _5y: CentsUsdPattern3, + pub _6y: CentsUsdPattern3, + pub _7y: CentsUsdPattern3, + pub _8y: CentsUsdPattern3, + pub _10y: CentsUsdPattern3, + pub _12y: CentsUsdPattern3, + pub _15y: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: CentsUsdPattern3::new(client.clone(), "utxos_under_1w_old_unrealized_loss".to_string()), + _1m: CentsUsdPattern3::new(client.clone(), "utxos_under_1m_old_unrealized_loss".to_string()), + _2m: CentsUsdPattern3::new(client.clone(), "utxos_under_2m_old_unrealized_loss".to_string()), + _3m: CentsUsdPattern3::new(client.clone(), "utxos_under_3m_old_unrealized_loss".to_string()), + _4m: CentsUsdPattern3::new(client.clone(), "utxos_under_4m_old_unrealized_loss".to_string()), + _5m: CentsUsdPattern3::new(client.clone(), "utxos_under_5m_old_unrealized_loss".to_string()), + _6m: CentsUsdPattern3::new(client.clone(), "utxos_under_6m_old_unrealized_loss".to_string()), + _9m: CentsUsdPattern3::new(client.clone(), "utxos_under_9m_old_unrealized_loss".to_string()), + _1y: CentsUsdPattern3::new(client.clone(), "utxos_under_1y_old_unrealized_loss".to_string()), + _18m: CentsUsdPattern3::new(client.clone(), "utxos_under_18m_old_unrealized_loss".to_string()), + _2y: CentsUsdPattern3::new(client.clone(), "utxos_under_2y_old_unrealized_loss".to_string()), + _3y: CentsUsdPattern3::new(client.clone(), "utxos_under_3y_old_unrealized_loss".to_string()), + _4y: CentsUsdPattern3::new(client.clone(), "utxos_under_4y_old_unrealized_loss".to_string()), + _5y: CentsUsdPattern3::new(client.clone(), "utxos_under_5y_old_unrealized_loss".to_string()), + _6y: CentsUsdPattern3::new(client.clone(), "utxos_under_6y_old_unrealized_loss".to_string()), + _7y: CentsUsdPattern3::new(client.clone(), "utxos_under_7y_old_unrealized_loss".to_string()), + _8y: CentsUsdPattern3::new(client.clone(), "utxos_under_8y_old_unrealized_loss".to_string()), + _10y: CentsUsdPattern3::new(client.clone(), "utxos_under_10y_old_unrealized_loss".to_string()), + _12y: CentsUsdPattern3::new(client.clone(), "utxos_under_12y_old_unrealized_loss".to_string()), + _15y: CentsUsdPattern3::new(client.clone(), "utxos_under_15y_old_unrealized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Over { + pub _1d: CentsUsdPattern3, + pub _1w: CentsUsdPattern3, + pub _1m: CentsUsdPattern3, + pub _2m: CentsUsdPattern3, + pub _3m: CentsUsdPattern3, + pub _4m: CentsUsdPattern3, + pub _5m: CentsUsdPattern3, + pub _6m: CentsUsdPattern3, + pub _9m: CentsUsdPattern3, + pub _1y: CentsUsdPattern3, + pub _18m: CentsUsdPattern3, + pub _2y: CentsUsdPattern3, + pub _3y: CentsUsdPattern3, + pub _4y: CentsUsdPattern3, + pub _5y: CentsUsdPattern3, + pub _6y: CentsUsdPattern3, + pub _7y: CentsUsdPattern3, + pub _8y: CentsUsdPattern3, + pub _10y: CentsUsdPattern3, + pub _12y: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: CentsUsdPattern3::new(client.clone(), "utxos_over_1d_old_unrealized_loss".to_string()), + _1w: CentsUsdPattern3::new(client.clone(), "utxos_over_1w_old_unrealized_loss".to_string()), + _1m: CentsUsdPattern3::new(client.clone(), "utxos_over_1m_old_unrealized_loss".to_string()), + _2m: CentsUsdPattern3::new(client.clone(), "utxos_over_2m_old_unrealized_loss".to_string()), + _3m: CentsUsdPattern3::new(client.clone(), "utxos_over_3m_old_unrealized_loss".to_string()), + _4m: CentsUsdPattern3::new(client.clone(), "utxos_over_4m_old_unrealized_loss".to_string()), + _5m: CentsUsdPattern3::new(client.clone(), "utxos_over_5m_old_unrealized_loss".to_string()), + _6m: CentsUsdPattern3::new(client.clone(), "utxos_over_6m_old_unrealized_loss".to_string()), + _9m: CentsUsdPattern3::new(client.clone(), "utxos_over_9m_old_unrealized_loss".to_string()), + _1y: CentsUsdPattern3::new(client.clone(), "utxos_over_1y_old_unrealized_loss".to_string()), + _18m: CentsUsdPattern3::new(client.clone(), "utxos_over_18m_old_unrealized_loss".to_string()), + _2y: CentsUsdPattern3::new(client.clone(), "utxos_over_2y_old_unrealized_loss".to_string()), + _3y: CentsUsdPattern3::new(client.clone(), "utxos_over_3y_old_unrealized_loss".to_string()), + _4y: CentsUsdPattern3::new(client.clone(), "utxos_over_4y_old_unrealized_loss".to_string()), + _5y: CentsUsdPattern3::new(client.clone(), "utxos_over_5y_old_unrealized_loss".to_string()), + _6y: CentsUsdPattern3::new(client.clone(), "utxos_over_6y_old_unrealized_loss".to_string()), + _7y: CentsUsdPattern3::new(client.clone(), "utxos_over_7y_old_unrealized_loss".to_string()), + _8y: CentsUsdPattern3::new(client.clone(), "utxos_over_8y_old_unrealized_loss".to_string()), + _10y: CentsUsdPattern3::new(client.clone(), "utxos_over_10y_old_unrealized_loss".to_string()), + _12y: CentsUsdPattern3::new(client.clone(), "utxos_over_12y_old_unrealized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Epoch { + pub _0: CentsUsdPattern3, + pub _1: CentsUsdPattern3, + pub _2: CentsUsdPattern3, + pub _3: CentsUsdPattern3, + pub _4: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: CentsUsdPattern3::new(client.clone(), "epoch_0_unrealized_loss".to_string()), + _1: CentsUsdPattern3::new(client.clone(), "epoch_1_unrealized_loss".to_string()), + _2: CentsUsdPattern3::new(client.clone(), "epoch_2_unrealized_loss".to_string()), + _3: CentsUsdPattern3::new(client.clone(), "epoch_3_unrealized_loss".to_string()), + _4: CentsUsdPattern3::new(client.clone(), "epoch_4_unrealized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Class { + pub _2009: CentsUsdPattern3, + pub _2010: CentsUsdPattern3, + pub _2011: CentsUsdPattern3, + pub _2012: CentsUsdPattern3, + pub _2013: CentsUsdPattern3, + pub _2014: CentsUsdPattern3, + pub _2015: CentsUsdPattern3, + pub _2016: CentsUsdPattern3, + pub _2017: CentsUsdPattern3, + pub _2018: CentsUsdPattern3, + pub _2019: CentsUsdPattern3, + pub _2020: CentsUsdPattern3, + pub _2021: CentsUsdPattern3, + pub _2022: CentsUsdPattern3, + pub _2023: CentsUsdPattern3, + pub _2024: CentsUsdPattern3, + pub _2025: CentsUsdPattern3, + pub _2026: CentsUsdPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: CentsUsdPattern3::new(client.clone(), "class_2009_unrealized_loss".to_string()), + _2010: CentsUsdPattern3::new(client.clone(), "class_2010_unrealized_loss".to_string()), + _2011: CentsUsdPattern3::new(client.clone(), "class_2011_unrealized_loss".to_string()), + _2012: CentsUsdPattern3::new(client.clone(), "class_2012_unrealized_loss".to_string()), + _2013: CentsUsdPattern3::new(client.clone(), "class_2013_unrealized_loss".to_string()), + _2014: CentsUsdPattern3::new(client.clone(), "class_2014_unrealized_loss".to_string()), + _2015: CentsUsdPattern3::new(client.clone(), "class_2015_unrealized_loss".to_string()), + _2016: CentsUsdPattern3::new(client.clone(), "class_2016_unrealized_loss".to_string()), + _2017: CentsUsdPattern3::new(client.clone(), "class_2017_unrealized_loss".to_string()), + _2018: CentsUsdPattern3::new(client.clone(), "class_2018_unrealized_loss".to_string()), + _2019: CentsUsdPattern3::new(client.clone(), "class_2019_unrealized_loss".to_string()), + _2020: CentsUsdPattern3::new(client.clone(), "class_2020_unrealized_loss".to_string()), + _2021: CentsUsdPattern3::new(client.clone(), "class_2021_unrealized_loss".to_string()), + _2022: CentsUsdPattern3::new(client.clone(), "class_2022_unrealized_loss".to_string()), + _2023: CentsUsdPattern3::new(client.clone(), "class_2023_unrealized_loss".to_string()), + _2024: CentsUsdPattern3::new(client.clone(), "class_2024_unrealized_loss".to_string()), + _2025: CentsUsdPattern3::new(client.clone(), "class_2025_unrealized_loss".to_string()), + _2026: CentsUsdPattern3::new(client.clone(), "class_2026_unrealized_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative { + pub all: SeriesPattern1, + pub age: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Class, + pub entry: DiscountPremiumPattern7, + pub term: LongShortPattern7, + pub type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "unrealized_loss_neg".to_string()), + age: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Class::new(client.clone(), format!("{base_path}_class")), + entry: DiscountPremiumPattern7::new(client.clone(), "unrealized_loss_neg".to_string()), + term: LongShortPattern7::new(client.clone(), "unrealized_loss_neg".to_string()), + type_: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6::new(client.clone(), "unrealized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age { + pub range: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Range { + pub under_1h: SeriesPattern1, + pub _1h_to_1d: SeriesPattern1, + pub _1d_to_1w: SeriesPattern1, + pub _1w_to_1m: SeriesPattern1, + pub _1m_to_2m: SeriesPattern1, + pub _2m_to_3m: SeriesPattern1, + pub _3m_to_4m: SeriesPattern1, + pub _4m_to_5m: SeriesPattern1, + pub _5m_to_6m: SeriesPattern1, + pub _6m_to_9m: SeriesPattern1, + pub _9m_to_1y: SeriesPattern1, + pub _1y_to_18m: SeriesPattern1, + pub _18m_to_2y: SeriesPattern1, + pub _2y_to_3y: SeriesPattern1, + pub _3y_to_4y: SeriesPattern1, + pub _4y_to_5y: SeriesPattern1, + pub _5y_to_6y: SeriesPattern1, + pub _6y_to_7y: SeriesPattern1, + pub _7y_to_8y: SeriesPattern1, + pub _8y_to_10y: SeriesPattern1, + pub _10y_to_12y: SeriesPattern1, + pub _12y_to_15y: SeriesPattern1, + pub over_15y: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: SeriesPattern1::new(client.clone(), "utxos_under_1h_old_unrealized_loss_neg".to_string()), + _1h_to_1d: SeriesPattern1::new(client.clone(), "utxos_1h_to_1d_old_unrealized_loss_neg".to_string()), + _1d_to_1w: SeriesPattern1::new(client.clone(), "utxos_1d_to_1w_old_unrealized_loss_neg".to_string()), + _1w_to_1m: SeriesPattern1::new(client.clone(), "utxos_1w_to_1m_old_unrealized_loss_neg".to_string()), + _1m_to_2m: SeriesPattern1::new(client.clone(), "utxos_1m_to_2m_old_unrealized_loss_neg".to_string()), + _2m_to_3m: SeriesPattern1::new(client.clone(), "utxos_2m_to_3m_old_unrealized_loss_neg".to_string()), + _3m_to_4m: SeriesPattern1::new(client.clone(), "utxos_3m_to_4m_old_unrealized_loss_neg".to_string()), + _4m_to_5m: SeriesPattern1::new(client.clone(), "utxos_4m_to_5m_old_unrealized_loss_neg".to_string()), + _5m_to_6m: SeriesPattern1::new(client.clone(), "utxos_5m_to_6m_old_unrealized_loss_neg".to_string()), + _6m_to_9m: SeriesPattern1::new(client.clone(), "utxos_6m_to_9m_old_unrealized_loss_neg".to_string()), + _9m_to_1y: SeriesPattern1::new(client.clone(), "utxos_9m_to_1y_old_unrealized_loss_neg".to_string()), + _1y_to_18m: SeriesPattern1::new(client.clone(), "utxos_1y_to_18m_old_unrealized_loss_neg".to_string()), + _18m_to_2y: SeriesPattern1::new(client.clone(), "utxos_18m_to_2y_old_unrealized_loss_neg".to_string()), + _2y_to_3y: SeriesPattern1::new(client.clone(), "utxos_2y_to_3y_old_unrealized_loss_neg".to_string()), + _3y_to_4y: SeriesPattern1::new(client.clone(), "utxos_3y_to_4y_old_unrealized_loss_neg".to_string()), + _4y_to_5y: SeriesPattern1::new(client.clone(), "utxos_4y_to_5y_old_unrealized_loss_neg".to_string()), + _5y_to_6y: SeriesPattern1::new(client.clone(), "utxos_5y_to_6y_old_unrealized_loss_neg".to_string()), + _6y_to_7y: SeriesPattern1::new(client.clone(), "utxos_6y_to_7y_old_unrealized_loss_neg".to_string()), + _7y_to_8y: SeriesPattern1::new(client.clone(), "utxos_7y_to_8y_old_unrealized_loss_neg".to_string()), + _8y_to_10y: SeriesPattern1::new(client.clone(), "utxos_8y_to_10y_old_unrealized_loss_neg".to_string()), + _10y_to_12y: SeriesPattern1::new(client.clone(), "utxos_10y_to_12y_old_unrealized_loss_neg".to_string()), + _12y_to_15y: SeriesPattern1::new(client.clone(), "utxos_12y_to_15y_old_unrealized_loss_neg".to_string()), + over_15y: SeriesPattern1::new(client.clone(), "utxos_over_15y_old_unrealized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Under { + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _9m: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, + pub _15y: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: SeriesPattern1::new(client.clone(), "utxos_under_1w_old_unrealized_loss_neg".to_string()), + _1m: SeriesPattern1::new(client.clone(), "utxos_under_1m_old_unrealized_loss_neg".to_string()), + _2m: SeriesPattern1::new(client.clone(), "utxos_under_2m_old_unrealized_loss_neg".to_string()), + _3m: SeriesPattern1::new(client.clone(), "utxos_under_3m_old_unrealized_loss_neg".to_string()), + _4m: SeriesPattern1::new(client.clone(), "utxos_under_4m_old_unrealized_loss_neg".to_string()), + _5m: SeriesPattern1::new(client.clone(), "utxos_under_5m_old_unrealized_loss_neg".to_string()), + _6m: SeriesPattern1::new(client.clone(), "utxos_under_6m_old_unrealized_loss_neg".to_string()), + _9m: SeriesPattern1::new(client.clone(), "utxos_under_9m_old_unrealized_loss_neg".to_string()), + _1y: SeriesPattern1::new(client.clone(), "utxos_under_1y_old_unrealized_loss_neg".to_string()), + _18m: SeriesPattern1::new(client.clone(), "utxos_under_18m_old_unrealized_loss_neg".to_string()), + _2y: SeriesPattern1::new(client.clone(), "utxos_under_2y_old_unrealized_loss_neg".to_string()), + _3y: SeriesPattern1::new(client.clone(), "utxos_under_3y_old_unrealized_loss_neg".to_string()), + _4y: SeriesPattern1::new(client.clone(), "utxos_under_4y_old_unrealized_loss_neg".to_string()), + _5y: SeriesPattern1::new(client.clone(), "utxos_under_5y_old_unrealized_loss_neg".to_string()), + _6y: SeriesPattern1::new(client.clone(), "utxos_under_6y_old_unrealized_loss_neg".to_string()), + _7y: SeriesPattern1::new(client.clone(), "utxos_under_7y_old_unrealized_loss_neg".to_string()), + _8y: SeriesPattern1::new(client.clone(), "utxos_under_8y_old_unrealized_loss_neg".to_string()), + _10y: SeriesPattern1::new(client.clone(), "utxos_under_10y_old_unrealized_loss_neg".to_string()), + _12y: SeriesPattern1::new(client.clone(), "utxos_under_12y_old_unrealized_loss_neg".to_string()), + _15y: SeriesPattern1::new(client.clone(), "utxos_under_15y_old_unrealized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Over { + pub _1d: SeriesPattern1, + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _3m: SeriesPattern1, + pub _4m: SeriesPattern1, + pub _5m: SeriesPattern1, + pub _6m: SeriesPattern1, + pub _9m: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _18m: SeriesPattern1, + pub _2y: SeriesPattern1, + pub _3y: SeriesPattern1, + pub _4y: SeriesPattern1, + pub _5y: SeriesPattern1, + pub _6y: SeriesPattern1, + pub _7y: SeriesPattern1, + pub _8y: SeriesPattern1, + pub _10y: SeriesPattern1, + pub _12y: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: SeriesPattern1::new(client.clone(), "utxos_over_1d_old_unrealized_loss_neg".to_string()), + _1w: SeriesPattern1::new(client.clone(), "utxos_over_1w_old_unrealized_loss_neg".to_string()), + _1m: SeriesPattern1::new(client.clone(), "utxos_over_1m_old_unrealized_loss_neg".to_string()), + _2m: SeriesPattern1::new(client.clone(), "utxos_over_2m_old_unrealized_loss_neg".to_string()), + _3m: SeriesPattern1::new(client.clone(), "utxos_over_3m_old_unrealized_loss_neg".to_string()), + _4m: SeriesPattern1::new(client.clone(), "utxos_over_4m_old_unrealized_loss_neg".to_string()), + _5m: SeriesPattern1::new(client.clone(), "utxos_over_5m_old_unrealized_loss_neg".to_string()), + _6m: SeriesPattern1::new(client.clone(), "utxos_over_6m_old_unrealized_loss_neg".to_string()), + _9m: SeriesPattern1::new(client.clone(), "utxos_over_9m_old_unrealized_loss_neg".to_string()), + _1y: SeriesPattern1::new(client.clone(), "utxos_over_1y_old_unrealized_loss_neg".to_string()), + _18m: SeriesPattern1::new(client.clone(), "utxos_over_18m_old_unrealized_loss_neg".to_string()), + _2y: SeriesPattern1::new(client.clone(), "utxos_over_2y_old_unrealized_loss_neg".to_string()), + _3y: SeriesPattern1::new(client.clone(), "utxos_over_3y_old_unrealized_loss_neg".to_string()), + _4y: SeriesPattern1::new(client.clone(), "utxos_over_4y_old_unrealized_loss_neg".to_string()), + _5y: SeriesPattern1::new(client.clone(), "utxos_over_5y_old_unrealized_loss_neg".to_string()), + _6y: SeriesPattern1::new(client.clone(), "utxos_over_6y_old_unrealized_loss_neg".to_string()), + _7y: SeriesPattern1::new(client.clone(), "utxos_over_7y_old_unrealized_loss_neg".to_string()), + _8y: SeriesPattern1::new(client.clone(), "utxos_over_8y_old_unrealized_loss_neg".to_string()), + _10y: SeriesPattern1::new(client.clone(), "utxos_over_10y_old_unrealized_loss_neg".to_string()), + _12y: SeriesPattern1::new(client.clone(), "utxos_over_12y_old_unrealized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Epoch { + pub _0: SeriesPattern1, + pub _1: SeriesPattern1, + pub _2: SeriesPattern1, + pub _3: SeriesPattern1, + pub _4: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: SeriesPattern1::new(client.clone(), "epoch_0_unrealized_loss_neg".to_string()), + _1: SeriesPattern1::new(client.clone(), "epoch_1_unrealized_loss_neg".to_string()), + _2: SeriesPattern1::new(client.clone(), "epoch_2_unrealized_loss_neg".to_string()), + _3: SeriesPattern1::new(client.clone(), "epoch_3_unrealized_loss_neg".to_string()), + _4: SeriesPattern1::new(client.clone(), "epoch_4_unrealized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Class { + pub _2009: SeriesPattern1, + pub _2010: SeriesPattern1, + pub _2011: SeriesPattern1, + pub _2012: SeriesPattern1, + pub _2013: SeriesPattern1, + pub _2014: SeriesPattern1, + pub _2015: SeriesPattern1, + pub _2016: SeriesPattern1, + pub _2017: SeriesPattern1, + pub _2018: SeriesPattern1, + pub _2019: SeriesPattern1, + pub _2020: SeriesPattern1, + pub _2021: SeriesPattern1, + pub _2022: SeriesPattern1, + pub _2023: SeriesPattern1, + pub _2024: SeriesPattern1, + pub _2025: SeriesPattern1, + pub _2026: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: SeriesPattern1::new(client.clone(), "class_2009_unrealized_loss_neg".to_string()), + _2010: SeriesPattern1::new(client.clone(), "class_2010_unrealized_loss_neg".to_string()), + _2011: SeriesPattern1::new(client.clone(), "class_2011_unrealized_loss_neg".to_string()), + _2012: SeriesPattern1::new(client.clone(), "class_2012_unrealized_loss_neg".to_string()), + _2013: SeriesPattern1::new(client.clone(), "class_2013_unrealized_loss_neg".to_string()), + _2014: SeriesPattern1::new(client.clone(), "class_2014_unrealized_loss_neg".to_string()), + _2015: SeriesPattern1::new(client.clone(), "class_2015_unrealized_loss_neg".to_string()), + _2016: SeriesPattern1::new(client.clone(), "class_2016_unrealized_loss_neg".to_string()), + _2017: SeriesPattern1::new(client.clone(), "class_2017_unrealized_loss_neg".to_string()), + _2018: SeriesPattern1::new(client.clone(), "class_2018_unrealized_loss_neg".to_string()), + _2019: SeriesPattern1::new(client.clone(), "class_2019_unrealized_loss_neg".to_string()), + _2020: SeriesPattern1::new(client.clone(), "class_2020_unrealized_loss_neg".to_string()), + _2021: SeriesPattern1::new(client.clone(), "class_2021_unrealized_loss_neg".to_string()), + _2022: SeriesPattern1::new(client.clone(), "class_2022_unrealized_loss_neg".to_string()), + _2023: SeriesPattern1::new(client.clone(), "class_2023_unrealized_loss_neg".to_string()), + _2024: SeriesPattern1::new(client.clone(), "class_2024_unrealized_loss_neg".to_string()), + _2025: SeriesPattern1::new(client.clone(), "class_2025_unrealized_loss_neg".to_string()), + _2026: SeriesPattern1::new(client.clone(), "class_2026_unrealized_loss_neg".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl { + pub all: CentsUsdPattern, + pub age: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Class, + pub entry: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Entry, + pub term: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Term, + pub age_range_matrix: SeriesPattern18, + pub epoch_matrix: SeriesPattern18, + pub class_matrix: SeriesPattern18, + pub entry_matrix: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsUsdPattern::new(client.clone(), "net_unrealized_pnl".to_string()), + age: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Class::new(client.clone(), format!("{base_path}_class")), + entry: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Entry::new(client.clone(), format!("{base_path}_entry")), + term: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Term::new(client.clone(), format!("{base_path}_term")), + age_range_matrix: SeriesPattern18::new(client.clone(), "utxos_net_unrealized_pnl_cents_by_age_range".to_string()), + epoch_matrix: SeriesPattern18::new(client.clone(), "net_unrealized_pnl_cents_by_epoch".to_string()), + class_matrix: SeriesPattern18::new(client.clone(), "net_unrealized_pnl_cents_by_class".to_string()), + entry_matrix: SeriesPattern18::new(client.clone(), "net_unrealized_pnl_cents_by_entry".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age { + pub range: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Range { + pub under_1h: CentsUsdPattern, + pub _1h_to_1d: CentsUsdPattern, + pub _1d_to_1w: CentsUsdPattern, + pub _1w_to_1m: CentsUsdPattern, + pub _1m_to_2m: CentsUsdPattern, + pub _2m_to_3m: CentsUsdPattern, + pub _3m_to_4m: CentsUsdPattern, + pub _4m_to_5m: CentsUsdPattern, + pub _5m_to_6m: CentsUsdPattern, + pub _6m_to_9m: CentsUsdPattern, + pub _9m_to_1y: CentsUsdPattern, + pub _1y_to_18m: CentsUsdPattern, + pub _18m_to_2y: CentsUsdPattern, + pub _2y_to_3y: CentsUsdPattern, + pub _3y_to_4y: CentsUsdPattern, + pub _4y_to_5y: CentsUsdPattern, + pub _5y_to_6y: CentsUsdPattern, + pub _6y_to_7y: CentsUsdPattern, + pub _7y_to_8y: CentsUsdPattern, + pub _8y_to_10y: CentsUsdPattern, + pub _10y_to_12y: CentsUsdPattern, + pub _12y_to_15y: CentsUsdPattern, + pub over_15y: CentsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: CentsUsdPattern::new(client.clone(), "utxos_under_1h_old_net_unrealized_pnl".to_string()), + _1h_to_1d: CentsUsdPattern::new(client.clone(), "utxos_1h_to_1d_old_net_unrealized_pnl".to_string()), + _1d_to_1w: CentsUsdPattern::new(client.clone(), "utxos_1d_to_1w_old_net_unrealized_pnl".to_string()), + _1w_to_1m: CentsUsdPattern::new(client.clone(), "utxos_1w_to_1m_old_net_unrealized_pnl".to_string()), + _1m_to_2m: CentsUsdPattern::new(client.clone(), "utxos_1m_to_2m_old_net_unrealized_pnl".to_string()), + _2m_to_3m: CentsUsdPattern::new(client.clone(), "utxos_2m_to_3m_old_net_unrealized_pnl".to_string()), + _3m_to_4m: CentsUsdPattern::new(client.clone(), "utxos_3m_to_4m_old_net_unrealized_pnl".to_string()), + _4m_to_5m: CentsUsdPattern::new(client.clone(), "utxos_4m_to_5m_old_net_unrealized_pnl".to_string()), + _5m_to_6m: CentsUsdPattern::new(client.clone(), "utxos_5m_to_6m_old_net_unrealized_pnl".to_string()), + _6m_to_9m: CentsUsdPattern::new(client.clone(), "utxos_6m_to_9m_old_net_unrealized_pnl".to_string()), + _9m_to_1y: CentsUsdPattern::new(client.clone(), "utxos_9m_to_1y_old_net_unrealized_pnl".to_string()), + _1y_to_18m: CentsUsdPattern::new(client.clone(), "utxos_1y_to_18m_old_net_unrealized_pnl".to_string()), + _18m_to_2y: CentsUsdPattern::new(client.clone(), "utxos_18m_to_2y_old_net_unrealized_pnl".to_string()), + _2y_to_3y: CentsUsdPattern::new(client.clone(), "utxos_2y_to_3y_old_net_unrealized_pnl".to_string()), + _3y_to_4y: CentsUsdPattern::new(client.clone(), "utxos_3y_to_4y_old_net_unrealized_pnl".to_string()), + _4y_to_5y: CentsUsdPattern::new(client.clone(), "utxos_4y_to_5y_old_net_unrealized_pnl".to_string()), + _5y_to_6y: CentsUsdPattern::new(client.clone(), "utxos_5y_to_6y_old_net_unrealized_pnl".to_string()), + _6y_to_7y: CentsUsdPattern::new(client.clone(), "utxos_6y_to_7y_old_net_unrealized_pnl".to_string()), + _7y_to_8y: CentsUsdPattern::new(client.clone(), "utxos_7y_to_8y_old_net_unrealized_pnl".to_string()), + _8y_to_10y: CentsUsdPattern::new(client.clone(), "utxos_8y_to_10y_old_net_unrealized_pnl".to_string()), + _10y_to_12y: CentsUsdPattern::new(client.clone(), "utxos_10y_to_12y_old_net_unrealized_pnl".to_string()), + _12y_to_15y: CentsUsdPattern::new(client.clone(), "utxos_12y_to_15y_old_net_unrealized_pnl".to_string()), + over_15y: CentsUsdPattern::new(client.clone(), "utxos_over_15y_old_net_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Under { + pub _1w: CentsUsdPattern, + pub _1m: CentsUsdPattern, + pub _2m: CentsUsdPattern, + pub _3m: CentsUsdPattern, + pub _4m: CentsUsdPattern, + pub _5m: CentsUsdPattern, + pub _6m: CentsUsdPattern, + pub _9m: CentsUsdPattern, + pub _1y: CentsUsdPattern, + pub _18m: CentsUsdPattern, + pub _2y: CentsUsdPattern, + pub _3y: CentsUsdPattern, + pub _4y: CentsUsdPattern, + pub _5y: CentsUsdPattern, + pub _6y: CentsUsdPattern, + pub _7y: CentsUsdPattern, + pub _8y: CentsUsdPattern, + pub _10y: CentsUsdPattern, + pub _12y: CentsUsdPattern, + pub _15y: CentsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: CentsUsdPattern::new(client.clone(), "utxos_under_1w_old_net_unrealized_pnl".to_string()), + _1m: CentsUsdPattern::new(client.clone(), "utxos_under_1m_old_net_unrealized_pnl".to_string()), + _2m: CentsUsdPattern::new(client.clone(), "utxos_under_2m_old_net_unrealized_pnl".to_string()), + _3m: CentsUsdPattern::new(client.clone(), "utxos_under_3m_old_net_unrealized_pnl".to_string()), + _4m: CentsUsdPattern::new(client.clone(), "utxos_under_4m_old_net_unrealized_pnl".to_string()), + _5m: CentsUsdPattern::new(client.clone(), "utxos_under_5m_old_net_unrealized_pnl".to_string()), + _6m: CentsUsdPattern::new(client.clone(), "utxos_under_6m_old_net_unrealized_pnl".to_string()), + _9m: CentsUsdPattern::new(client.clone(), "utxos_under_9m_old_net_unrealized_pnl".to_string()), + _1y: CentsUsdPattern::new(client.clone(), "utxos_under_1y_old_net_unrealized_pnl".to_string()), + _18m: CentsUsdPattern::new(client.clone(), "utxos_under_18m_old_net_unrealized_pnl".to_string()), + _2y: CentsUsdPattern::new(client.clone(), "utxos_under_2y_old_net_unrealized_pnl".to_string()), + _3y: CentsUsdPattern::new(client.clone(), "utxos_under_3y_old_net_unrealized_pnl".to_string()), + _4y: CentsUsdPattern::new(client.clone(), "utxos_under_4y_old_net_unrealized_pnl".to_string()), + _5y: CentsUsdPattern::new(client.clone(), "utxos_under_5y_old_net_unrealized_pnl".to_string()), + _6y: CentsUsdPattern::new(client.clone(), "utxos_under_6y_old_net_unrealized_pnl".to_string()), + _7y: CentsUsdPattern::new(client.clone(), "utxos_under_7y_old_net_unrealized_pnl".to_string()), + _8y: CentsUsdPattern::new(client.clone(), "utxos_under_8y_old_net_unrealized_pnl".to_string()), + _10y: CentsUsdPattern::new(client.clone(), "utxos_under_10y_old_net_unrealized_pnl".to_string()), + _12y: CentsUsdPattern::new(client.clone(), "utxos_under_12y_old_net_unrealized_pnl".to_string()), + _15y: CentsUsdPattern::new(client.clone(), "utxos_under_15y_old_net_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Over { + pub _1d: CentsUsdPattern, + pub _1w: CentsUsdPattern, + pub _1m: CentsUsdPattern, + pub _2m: CentsUsdPattern, + pub _3m: CentsUsdPattern, + pub _4m: CentsUsdPattern, + pub _5m: CentsUsdPattern, + pub _6m: CentsUsdPattern, + pub _9m: CentsUsdPattern, + pub _1y: CentsUsdPattern, + pub _18m: CentsUsdPattern, + pub _2y: CentsUsdPattern, + pub _3y: CentsUsdPattern, + pub _4y: CentsUsdPattern, + pub _5y: CentsUsdPattern, + pub _6y: CentsUsdPattern, + pub _7y: CentsUsdPattern, + pub _8y: CentsUsdPattern, + pub _10y: CentsUsdPattern, + pub _12y: CentsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: CentsUsdPattern::new(client.clone(), "utxos_over_1d_old_net_unrealized_pnl".to_string()), + _1w: CentsUsdPattern::new(client.clone(), "utxos_over_1w_old_net_unrealized_pnl".to_string()), + _1m: CentsUsdPattern::new(client.clone(), "utxos_over_1m_old_net_unrealized_pnl".to_string()), + _2m: CentsUsdPattern::new(client.clone(), "utxos_over_2m_old_net_unrealized_pnl".to_string()), + _3m: CentsUsdPattern::new(client.clone(), "utxos_over_3m_old_net_unrealized_pnl".to_string()), + _4m: CentsUsdPattern::new(client.clone(), "utxos_over_4m_old_net_unrealized_pnl".to_string()), + _5m: CentsUsdPattern::new(client.clone(), "utxos_over_5m_old_net_unrealized_pnl".to_string()), + _6m: CentsUsdPattern::new(client.clone(), "utxos_over_6m_old_net_unrealized_pnl".to_string()), + _9m: CentsUsdPattern::new(client.clone(), "utxos_over_9m_old_net_unrealized_pnl".to_string()), + _1y: CentsUsdPattern::new(client.clone(), "utxos_over_1y_old_net_unrealized_pnl".to_string()), + _18m: CentsUsdPattern::new(client.clone(), "utxos_over_18m_old_net_unrealized_pnl".to_string()), + _2y: CentsUsdPattern::new(client.clone(), "utxos_over_2y_old_net_unrealized_pnl".to_string()), + _3y: CentsUsdPattern::new(client.clone(), "utxos_over_3y_old_net_unrealized_pnl".to_string()), + _4y: CentsUsdPattern::new(client.clone(), "utxos_over_4y_old_net_unrealized_pnl".to_string()), + _5y: CentsUsdPattern::new(client.clone(), "utxos_over_5y_old_net_unrealized_pnl".to_string()), + _6y: CentsUsdPattern::new(client.clone(), "utxos_over_6y_old_net_unrealized_pnl".to_string()), + _7y: CentsUsdPattern::new(client.clone(), "utxos_over_7y_old_net_unrealized_pnl".to_string()), + _8y: CentsUsdPattern::new(client.clone(), "utxos_over_8y_old_net_unrealized_pnl".to_string()), + _10y: CentsUsdPattern::new(client.clone(), "utxos_over_10y_old_net_unrealized_pnl".to_string()), + _12y: CentsUsdPattern::new(client.clone(), "utxos_over_12y_old_net_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Epoch { + pub _0: CentsUsdPattern, + pub _1: CentsUsdPattern, + pub _2: CentsUsdPattern, + pub _3: CentsUsdPattern, + pub _4: CentsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: CentsUsdPattern::new(client.clone(), "epoch_0_net_unrealized_pnl".to_string()), + _1: CentsUsdPattern::new(client.clone(), "epoch_1_net_unrealized_pnl".to_string()), + _2: CentsUsdPattern::new(client.clone(), "epoch_2_net_unrealized_pnl".to_string()), + _3: CentsUsdPattern::new(client.clone(), "epoch_3_net_unrealized_pnl".to_string()), + _4: CentsUsdPattern::new(client.clone(), "epoch_4_net_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Class { + pub _2009: CentsUsdPattern, + pub _2010: CentsUsdPattern, + pub _2011: CentsUsdPattern, + pub _2012: CentsUsdPattern, + pub _2013: CentsUsdPattern, + pub _2014: CentsUsdPattern, + pub _2015: CentsUsdPattern, + pub _2016: CentsUsdPattern, + pub _2017: CentsUsdPattern, + pub _2018: CentsUsdPattern, + pub _2019: CentsUsdPattern, + pub _2020: CentsUsdPattern, + pub _2021: CentsUsdPattern, + pub _2022: CentsUsdPattern, + pub _2023: CentsUsdPattern, + pub _2024: CentsUsdPattern, + pub _2025: CentsUsdPattern, + pub _2026: CentsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: CentsUsdPattern::new(client.clone(), "class_2009_net_unrealized_pnl".to_string()), + _2010: CentsUsdPattern::new(client.clone(), "class_2010_net_unrealized_pnl".to_string()), + _2011: CentsUsdPattern::new(client.clone(), "class_2011_net_unrealized_pnl".to_string()), + _2012: CentsUsdPattern::new(client.clone(), "class_2012_net_unrealized_pnl".to_string()), + _2013: CentsUsdPattern::new(client.clone(), "class_2013_net_unrealized_pnl".to_string()), + _2014: CentsUsdPattern::new(client.clone(), "class_2014_net_unrealized_pnl".to_string()), + _2015: CentsUsdPattern::new(client.clone(), "class_2015_net_unrealized_pnl".to_string()), + _2016: CentsUsdPattern::new(client.clone(), "class_2016_net_unrealized_pnl".to_string()), + _2017: CentsUsdPattern::new(client.clone(), "class_2017_net_unrealized_pnl".to_string()), + _2018: CentsUsdPattern::new(client.clone(), "class_2018_net_unrealized_pnl".to_string()), + _2019: CentsUsdPattern::new(client.clone(), "class_2019_net_unrealized_pnl".to_string()), + _2020: CentsUsdPattern::new(client.clone(), "class_2020_net_unrealized_pnl".to_string()), + _2021: CentsUsdPattern::new(client.clone(), "class_2021_net_unrealized_pnl".to_string()), + _2022: CentsUsdPattern::new(client.clone(), "class_2022_net_unrealized_pnl".to_string()), + _2023: CentsUsdPattern::new(client.clone(), "class_2023_net_unrealized_pnl".to_string()), + _2024: CentsUsdPattern::new(client.clone(), "class_2024_net_unrealized_pnl".to_string()), + _2025: CentsUsdPattern::new(client.clone(), "class_2025_net_unrealized_pnl".to_string()), + _2026: CentsUsdPattern::new(client.clone(), "class_2026_net_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Entry { + pub discount: CentsUsdPattern, + pub premium: CentsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Entry { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: CentsUsdPattern::new(client.clone(), "veteran_net_unrealized_pnl".to_string()), + premium: CentsUsdPattern::new(client.clone(), "rookie_net_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Term { + pub short: CentsUsdPattern, + pub long: CentsUsdPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Term { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: CentsUsdPattern::new(client.clone(), "sth_net_unrealized_pnl".to_string()), + long: CentsUsdPattern::new(client.clone(), "lth_net_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_GrossPnl { + pub all: CentsUsdPattern3, + pub sth: CentsUsdPattern3, + pub lth: CentsUsdPattern3, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_GrossPnl { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsUsdPattern3::new(client.clone(), "all_unrealized_gross_pnl".to_string()), + sth: CentsUsdPattern3::new(client.clone(), "sth_unrealized_gross_pnl".to_string()), + lth: CentsUsdPattern3::new(client.clone(), "lth_unrealized_gross_pnl".to_string()), + height: SeriesPattern18::new(client.clone(), "unrealized_gross_pnl_cents_by_term".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInProfit { + pub all: CentsUsdPattern3, + pub sth: CentsUsdPattern3, + pub lth: CentsUsdPattern3, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsUsdPattern3::new(client.clone(), "all_invested_capital_in_profit".to_string()), + sth: CentsUsdPattern3::new(client.clone(), "sth_invested_capital_in_profit".to_string()), + lth: CentsUsdPattern3::new(client.clone(), "lth_invested_capital_in_profit".to_string()), + height: SeriesPattern18::new(client.clone(), "invested_capital_in_profit_cents_by_term".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInLoss { + pub all: CentsUsdPattern3, + pub sth: CentsUsdPattern3, + pub lth: CentsUsdPattern3, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsUsdPattern3::new(client.clone(), "all_invested_capital_in_loss".to_string()), + sth: CentsUsdPattern3::new(client.clone(), "sth_invested_capital_in_loss".to_string()), + lth: CentsUsdPattern3::new(client.clone(), "lth_invested_capital_in_loss".to_string()), + height: SeriesPattern18::new(client.clone(), "invested_capital_in_loss_cents_by_term".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_PainIndex { + pub all: CentsUsdPattern3, + pub sth: CentsUsdPattern3, + pub lth: CentsUsdPattern3, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_PainIndex { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsUsdPattern3::new(client.clone(), "all_pain_index".to_string()), + sth: CentsUsdPattern3::new(client.clone(), "sth_pain_index".to_string()), + lth: CentsUsdPattern3::new(client.clone(), "lth_pain_index".to_string()), + height: SeriesPattern18::new(client.clone(), "pain_index_cents_by_aggregate".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_GreedIndex { + pub all: CentsUsdPattern3, + pub sth: CentsUsdPattern3, + pub lth: CentsUsdPattern3, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_GreedIndex { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsUsdPattern3::new(client.clone(), "all_greed_index".to_string()), + sth: CentsUsdPattern3::new(client.clone(), "sth_greed_index".to_string()), + lth: CentsUsdPattern3::new(client.clone(), "lth_greed_index".to_string()), + height: SeriesPattern18::new(client.clone(), "greed_index_cents_by_aggregate".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_NetSentiment { + pub all: CentsUsdPattern, + pub sth: CentsUsdPattern, + pub lth: CentsUsdPattern, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_NetSentiment { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: CentsUsdPattern::new(client.clone(), "all_net_sentiment".to_string()), + sth: CentsUsdPattern::new(client.clone(), "sth_net_sentiment".to_string()), + lth: CentsUsdPattern::new(client.clone(), "lth_net_sentiment".to_string()), + height: SeriesPattern18::new(client.clone(), "net_sentiment_cents_by_aggregate".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl { + pub all: PpmRatioPattern, + pub age: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age, + pub epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Epoch, + pub class: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Class, + pub entry: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Entry, + pub utxo_amount: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount, + pub term: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Term, + pub type_: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Type, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: PpmRatioPattern::new(client.clone(), "nupl".to_string()), + age: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age::new(client.clone(), format!("{base_path}_age")), + epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Class::new(client.clone(), format!("{base_path}_class")), + entry: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Entry::new(client.clone(), format!("{base_path}_entry")), + utxo_amount: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount::new(client.clone(), format!("{base_path}_utxo_amount")), + term: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Term::new(client.clone(), format!("{base_path}_term")), + type_: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Type::new(client.clone(), format!("{base_path}_type")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age { + pub range: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Range, + pub under: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Under, + pub over: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Range { + pub under_1h: PpmRatioPattern, + pub _1h_to_1d: PpmRatioPattern, + pub _1d_to_1w: PpmRatioPattern, + pub _1w_to_1m: PpmRatioPattern, + pub _1m_to_2m: PpmRatioPattern, + pub _2m_to_3m: PpmRatioPattern, + pub _3m_to_4m: PpmRatioPattern, + pub _4m_to_5m: PpmRatioPattern, + pub _5m_to_6m: PpmRatioPattern, + pub _6m_to_9m: PpmRatioPattern, + pub _9m_to_1y: PpmRatioPattern, + pub _1y_to_18m: PpmRatioPattern, + pub _18m_to_2y: PpmRatioPattern, + pub _2y_to_3y: PpmRatioPattern, + pub _3y_to_4y: PpmRatioPattern, + pub _4y_to_5y: PpmRatioPattern, + pub _5y_to_6y: PpmRatioPattern, + pub _6y_to_7y: PpmRatioPattern, + pub _7y_to_8y: PpmRatioPattern, + pub _8y_to_10y: PpmRatioPattern, + pub _10y_to_12y: PpmRatioPattern, + pub _12y_to_15y: PpmRatioPattern, + pub over_15y: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + under_1h: PpmRatioPattern::new(client.clone(), "utxos_under_1h_old_nupl".to_string()), + _1h_to_1d: PpmRatioPattern::new(client.clone(), "utxos_1h_to_1d_old_nupl".to_string()), + _1d_to_1w: PpmRatioPattern::new(client.clone(), "utxos_1d_to_1w_old_nupl".to_string()), + _1w_to_1m: PpmRatioPattern::new(client.clone(), "utxos_1w_to_1m_old_nupl".to_string()), + _1m_to_2m: PpmRatioPattern::new(client.clone(), "utxos_1m_to_2m_old_nupl".to_string()), + _2m_to_3m: PpmRatioPattern::new(client.clone(), "utxos_2m_to_3m_old_nupl".to_string()), + _3m_to_4m: PpmRatioPattern::new(client.clone(), "utxos_3m_to_4m_old_nupl".to_string()), + _4m_to_5m: PpmRatioPattern::new(client.clone(), "utxos_4m_to_5m_old_nupl".to_string()), + _5m_to_6m: PpmRatioPattern::new(client.clone(), "utxos_5m_to_6m_old_nupl".to_string()), + _6m_to_9m: PpmRatioPattern::new(client.clone(), "utxos_6m_to_9m_old_nupl".to_string()), + _9m_to_1y: PpmRatioPattern::new(client.clone(), "utxos_9m_to_1y_old_nupl".to_string()), + _1y_to_18m: PpmRatioPattern::new(client.clone(), "utxos_1y_to_18m_old_nupl".to_string()), + _18m_to_2y: PpmRatioPattern::new(client.clone(), "utxos_18m_to_2y_old_nupl".to_string()), + _2y_to_3y: PpmRatioPattern::new(client.clone(), "utxos_2y_to_3y_old_nupl".to_string()), + _3y_to_4y: PpmRatioPattern::new(client.clone(), "utxos_3y_to_4y_old_nupl".to_string()), + _4y_to_5y: PpmRatioPattern::new(client.clone(), "utxos_4y_to_5y_old_nupl".to_string()), + _5y_to_6y: PpmRatioPattern::new(client.clone(), "utxos_5y_to_6y_old_nupl".to_string()), + _6y_to_7y: PpmRatioPattern::new(client.clone(), "utxos_6y_to_7y_old_nupl".to_string()), + _7y_to_8y: PpmRatioPattern::new(client.clone(), "utxos_7y_to_8y_old_nupl".to_string()), + _8y_to_10y: PpmRatioPattern::new(client.clone(), "utxos_8y_to_10y_old_nupl".to_string()), + _10y_to_12y: PpmRatioPattern::new(client.clone(), "utxos_10y_to_12y_old_nupl".to_string()), + _12y_to_15y: PpmRatioPattern::new(client.clone(), "utxos_12y_to_15y_old_nupl".to_string()), + over_15y: PpmRatioPattern::new(client.clone(), "utxos_over_15y_old_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Under { + pub _1w: PpmRatioPattern, + pub _1m: PpmRatioPattern, + pub _2m: PpmRatioPattern, + pub _3m: PpmRatioPattern, + pub _4m: PpmRatioPattern, + pub _5m: PpmRatioPattern, + pub _6m: PpmRatioPattern, + pub _9m: PpmRatioPattern, + pub _1y: PpmRatioPattern, + pub _18m: PpmRatioPattern, + pub _2y: PpmRatioPattern, + pub _3y: PpmRatioPattern, + pub _4y: PpmRatioPattern, + pub _5y: PpmRatioPattern, + pub _6y: PpmRatioPattern, + pub _7y: PpmRatioPattern, + pub _8y: PpmRatioPattern, + pub _10y: PpmRatioPattern, + pub _12y: PpmRatioPattern, + pub _15y: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: PpmRatioPattern::new(client.clone(), "utxos_under_1w_old_nupl".to_string()), + _1m: PpmRatioPattern::new(client.clone(), "utxos_under_1m_old_nupl".to_string()), + _2m: PpmRatioPattern::new(client.clone(), "utxos_under_2m_old_nupl".to_string()), + _3m: PpmRatioPattern::new(client.clone(), "utxos_under_3m_old_nupl".to_string()), + _4m: PpmRatioPattern::new(client.clone(), "utxos_under_4m_old_nupl".to_string()), + _5m: PpmRatioPattern::new(client.clone(), "utxos_under_5m_old_nupl".to_string()), + _6m: PpmRatioPattern::new(client.clone(), "utxos_under_6m_old_nupl".to_string()), + _9m: PpmRatioPattern::new(client.clone(), "utxos_under_9m_old_nupl".to_string()), + _1y: PpmRatioPattern::new(client.clone(), "utxos_under_1y_old_nupl".to_string()), + _18m: PpmRatioPattern::new(client.clone(), "utxos_under_18m_old_nupl".to_string()), + _2y: PpmRatioPattern::new(client.clone(), "utxos_under_2y_old_nupl".to_string()), + _3y: PpmRatioPattern::new(client.clone(), "utxos_under_3y_old_nupl".to_string()), + _4y: PpmRatioPattern::new(client.clone(), "utxos_under_4y_old_nupl".to_string()), + _5y: PpmRatioPattern::new(client.clone(), "utxos_under_5y_old_nupl".to_string()), + _6y: PpmRatioPattern::new(client.clone(), "utxos_under_6y_old_nupl".to_string()), + _7y: PpmRatioPattern::new(client.clone(), "utxos_under_7y_old_nupl".to_string()), + _8y: PpmRatioPattern::new(client.clone(), "utxos_under_8y_old_nupl".to_string()), + _10y: PpmRatioPattern::new(client.clone(), "utxos_under_10y_old_nupl".to_string()), + _12y: PpmRatioPattern::new(client.clone(), "utxos_under_12y_old_nupl".to_string()), + _15y: PpmRatioPattern::new(client.clone(), "utxos_under_15y_old_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Over { + pub _1d: PpmRatioPattern, + pub _1w: PpmRatioPattern, + pub _1m: PpmRatioPattern, + pub _2m: PpmRatioPattern, + pub _3m: PpmRatioPattern, + pub _4m: PpmRatioPattern, + pub _5m: PpmRatioPattern, + pub _6m: PpmRatioPattern, + pub _9m: PpmRatioPattern, + pub _1y: PpmRatioPattern, + pub _18m: PpmRatioPattern, + pub _2y: PpmRatioPattern, + pub _3y: PpmRatioPattern, + pub _4y: PpmRatioPattern, + pub _5y: PpmRatioPattern, + pub _6y: PpmRatioPattern, + pub _7y: PpmRatioPattern, + pub _8y: PpmRatioPattern, + pub _10y: PpmRatioPattern, + pub _12y: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: PpmRatioPattern::new(client.clone(), "utxos_over_1d_old_nupl".to_string()), + _1w: PpmRatioPattern::new(client.clone(), "utxos_over_1w_old_nupl".to_string()), + _1m: PpmRatioPattern::new(client.clone(), "utxos_over_1m_old_nupl".to_string()), + _2m: PpmRatioPattern::new(client.clone(), "utxos_over_2m_old_nupl".to_string()), + _3m: PpmRatioPattern::new(client.clone(), "utxos_over_3m_old_nupl".to_string()), + _4m: PpmRatioPattern::new(client.clone(), "utxos_over_4m_old_nupl".to_string()), + _5m: PpmRatioPattern::new(client.clone(), "utxos_over_5m_old_nupl".to_string()), + _6m: PpmRatioPattern::new(client.clone(), "utxos_over_6m_old_nupl".to_string()), + _9m: PpmRatioPattern::new(client.clone(), "utxos_over_9m_old_nupl".to_string()), + _1y: PpmRatioPattern::new(client.clone(), "utxos_over_1y_old_nupl".to_string()), + _18m: PpmRatioPattern::new(client.clone(), "utxos_over_18m_old_nupl".to_string()), + _2y: PpmRatioPattern::new(client.clone(), "utxos_over_2y_old_nupl".to_string()), + _3y: PpmRatioPattern::new(client.clone(), "utxos_over_3y_old_nupl".to_string()), + _4y: PpmRatioPattern::new(client.clone(), "utxos_over_4y_old_nupl".to_string()), + _5y: PpmRatioPattern::new(client.clone(), "utxos_over_5y_old_nupl".to_string()), + _6y: PpmRatioPattern::new(client.clone(), "utxos_over_6y_old_nupl".to_string()), + _7y: PpmRatioPattern::new(client.clone(), "utxos_over_7y_old_nupl".to_string()), + _8y: PpmRatioPattern::new(client.clone(), "utxos_over_8y_old_nupl".to_string()), + _10y: PpmRatioPattern::new(client.clone(), "utxos_over_10y_old_nupl".to_string()), + _12y: PpmRatioPattern::new(client.clone(), "utxos_over_12y_old_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Epoch { + pub _0: PpmRatioPattern, + pub _1: PpmRatioPattern, + pub _2: PpmRatioPattern, + pub _3: PpmRatioPattern, + pub _4: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Epoch { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0: PpmRatioPattern::new(client.clone(), "epoch_0_nupl".to_string()), + _1: PpmRatioPattern::new(client.clone(), "epoch_1_nupl".to_string()), + _2: PpmRatioPattern::new(client.clone(), "epoch_2_nupl".to_string()), + _3: PpmRatioPattern::new(client.clone(), "epoch_3_nupl".to_string()), + _4: PpmRatioPattern::new(client.clone(), "epoch_4_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Class { + pub _2009: PpmRatioPattern, + pub _2010: PpmRatioPattern, + pub _2011: PpmRatioPattern, + pub _2012: PpmRatioPattern, + pub _2013: PpmRatioPattern, + pub _2014: PpmRatioPattern, + pub _2015: PpmRatioPattern, + pub _2016: PpmRatioPattern, + pub _2017: PpmRatioPattern, + pub _2018: PpmRatioPattern, + pub _2019: PpmRatioPattern, + pub _2020: PpmRatioPattern, + pub _2021: PpmRatioPattern, + pub _2022: PpmRatioPattern, + pub _2023: PpmRatioPattern, + pub _2024: PpmRatioPattern, + pub _2025: PpmRatioPattern, + pub _2026: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Class { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _2009: PpmRatioPattern::new(client.clone(), "class_2009_nupl".to_string()), + _2010: PpmRatioPattern::new(client.clone(), "class_2010_nupl".to_string()), + _2011: PpmRatioPattern::new(client.clone(), "class_2011_nupl".to_string()), + _2012: PpmRatioPattern::new(client.clone(), "class_2012_nupl".to_string()), + _2013: PpmRatioPattern::new(client.clone(), "class_2013_nupl".to_string()), + _2014: PpmRatioPattern::new(client.clone(), "class_2014_nupl".to_string()), + _2015: PpmRatioPattern::new(client.clone(), "class_2015_nupl".to_string()), + _2016: PpmRatioPattern::new(client.clone(), "class_2016_nupl".to_string()), + _2017: PpmRatioPattern::new(client.clone(), "class_2017_nupl".to_string()), + _2018: PpmRatioPattern::new(client.clone(), "class_2018_nupl".to_string()), + _2019: PpmRatioPattern::new(client.clone(), "class_2019_nupl".to_string()), + _2020: PpmRatioPattern::new(client.clone(), "class_2020_nupl".to_string()), + _2021: PpmRatioPattern::new(client.clone(), "class_2021_nupl".to_string()), + _2022: PpmRatioPattern::new(client.clone(), "class_2022_nupl".to_string()), + _2023: PpmRatioPattern::new(client.clone(), "class_2023_nupl".to_string()), + _2024: PpmRatioPattern::new(client.clone(), "class_2024_nupl".to_string()), + _2025: PpmRatioPattern::new(client.clone(), "class_2025_nupl".to_string()), + _2026: PpmRatioPattern::new(client.clone(), "class_2026_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Entry { + pub discount: PpmRatioPattern, + pub premium: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Entry { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + discount: PpmRatioPattern::new(client.clone(), "veteran_nupl".to_string()), + premium: PpmRatioPattern::new(client.clone(), "rookie_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount { + pub range: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Range, + pub under: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Under, + pub over: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Over, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Range::new(client.clone(), format!("{base_path}_range")), + under: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Under::new(client.clone(), format!("{base_path}_under")), + over: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Over::new(client.clone(), format!("{base_path}_over")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Range { + pub _0sats: PpmRatioPattern, + pub _1sat_to_10sats: PpmRatioPattern, + pub _10sats_to_100sats: PpmRatioPattern, + pub _100sats_to_1k_sats: PpmRatioPattern, + pub _1k_sats_to_10k_sats: PpmRatioPattern, + pub _10k_sats_to_100k_sats: PpmRatioPattern, + pub _100k_sats_to_1m_sats: PpmRatioPattern, + pub _1m_sats_to_10m_sats: PpmRatioPattern, + pub _10m_sats_to_1btc: PpmRatioPattern, + pub _1btc_to_10btc: PpmRatioPattern, + pub _10btc_to_100btc: PpmRatioPattern, + pub _100btc_to_1k_btc: PpmRatioPattern, + pub _1k_btc_to_10k_btc: PpmRatioPattern, + pub _10k_btc_to_100k_btc: PpmRatioPattern, + pub over_100k_btc: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _0sats: PpmRatioPattern::new(client.clone(), "utxos_0sats_nupl".to_string()), + _1sat_to_10sats: PpmRatioPattern::new(client.clone(), "utxos_1sat_to_10sats_nupl".to_string()), + _10sats_to_100sats: PpmRatioPattern::new(client.clone(), "utxos_10sats_to_100sats_nupl".to_string()), + _100sats_to_1k_sats: PpmRatioPattern::new(client.clone(), "utxos_100sats_to_1k_sats_nupl".to_string()), + _1k_sats_to_10k_sats: PpmRatioPattern::new(client.clone(), "utxos_1k_sats_to_10k_sats_nupl".to_string()), + _10k_sats_to_100k_sats: PpmRatioPattern::new(client.clone(), "utxos_10k_sats_to_100k_sats_nupl".to_string()), + _100k_sats_to_1m_sats: PpmRatioPattern::new(client.clone(), "utxos_100k_sats_to_1m_sats_nupl".to_string()), + _1m_sats_to_10m_sats: PpmRatioPattern::new(client.clone(), "utxos_1m_sats_to_10m_sats_nupl".to_string()), + _10m_sats_to_1btc: PpmRatioPattern::new(client.clone(), "utxos_10m_sats_to_1btc_nupl".to_string()), + _1btc_to_10btc: PpmRatioPattern::new(client.clone(), "utxos_1btc_to_10btc_nupl".to_string()), + _10btc_to_100btc: PpmRatioPattern::new(client.clone(), "utxos_10btc_to_100btc_nupl".to_string()), + _100btc_to_1k_btc: PpmRatioPattern::new(client.clone(), "utxos_100btc_to_1k_btc_nupl".to_string()), + _1k_btc_to_10k_btc: PpmRatioPattern::new(client.clone(), "utxos_1k_btc_to_10k_btc_nupl".to_string()), + _10k_btc_to_100k_btc: PpmRatioPattern::new(client.clone(), "utxos_10k_btc_to_100k_btc_nupl".to_string()), + over_100k_btc: PpmRatioPattern::new(client.clone(), "utxos_over_100k_btc_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Under { + pub _10sats: PpmRatioPattern, + pub _100sats: PpmRatioPattern, + pub _1k_sats: PpmRatioPattern, + pub _10k_sats: PpmRatioPattern, + pub _100k_sats: PpmRatioPattern, + pub _1m_sats: PpmRatioPattern, + pub _10m_sats: PpmRatioPattern, + pub _1btc: PpmRatioPattern, + pub _10btc: PpmRatioPattern, + pub _100btc: PpmRatioPattern, + pub _1k_btc: PpmRatioPattern, + pub _10k_btc: PpmRatioPattern, + pub _100k_btc: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Under { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _10sats: PpmRatioPattern::new(client.clone(), "utxos_under_10sats_nupl".to_string()), + _100sats: PpmRatioPattern::new(client.clone(), "utxos_under_100sats_nupl".to_string()), + _1k_sats: PpmRatioPattern::new(client.clone(), "utxos_under_1k_sats_nupl".to_string()), + _10k_sats: PpmRatioPattern::new(client.clone(), "utxos_under_10k_sats_nupl".to_string()), + _100k_sats: PpmRatioPattern::new(client.clone(), "utxos_under_100k_sats_nupl".to_string()), + _1m_sats: PpmRatioPattern::new(client.clone(), "utxos_under_1m_sats_nupl".to_string()), + _10m_sats: PpmRatioPattern::new(client.clone(), "utxos_under_10m_sats_nupl".to_string()), + _1btc: PpmRatioPattern::new(client.clone(), "utxos_under_1btc_nupl".to_string()), + _10btc: PpmRatioPattern::new(client.clone(), "utxos_under_10btc_nupl".to_string()), + _100btc: PpmRatioPattern::new(client.clone(), "utxos_under_100btc_nupl".to_string()), + _1k_btc: PpmRatioPattern::new(client.clone(), "utxos_under_1k_btc_nupl".to_string()), + _10k_btc: PpmRatioPattern::new(client.clone(), "utxos_under_10k_btc_nupl".to_string()), + _100k_btc: PpmRatioPattern::new(client.clone(), "utxos_under_100k_btc_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Over { + pub _1sat: PpmRatioPattern, + pub _10sats: PpmRatioPattern, + pub _100sats: PpmRatioPattern, + pub _1k_sats: PpmRatioPattern, + pub _10k_sats: PpmRatioPattern, + pub _100k_sats: PpmRatioPattern, + pub _1m_sats: PpmRatioPattern, + pub _10m_sats: PpmRatioPattern, + pub _1btc: PpmRatioPattern, + pub _10btc: PpmRatioPattern, + pub _100btc: PpmRatioPattern, + pub _1k_btc: PpmRatioPattern, + pub _10k_btc: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Over { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1sat: PpmRatioPattern::new(client.clone(), "utxos_over_1sat_nupl".to_string()), + _10sats: PpmRatioPattern::new(client.clone(), "utxos_over_10sats_nupl".to_string()), + _100sats: PpmRatioPattern::new(client.clone(), "utxos_over_100sats_nupl".to_string()), + _1k_sats: PpmRatioPattern::new(client.clone(), "utxos_over_1k_sats_nupl".to_string()), + _10k_sats: PpmRatioPattern::new(client.clone(), "utxos_over_10k_sats_nupl".to_string()), + _100k_sats: PpmRatioPattern::new(client.clone(), "utxos_over_100k_sats_nupl".to_string()), + _1m_sats: PpmRatioPattern::new(client.clone(), "utxos_over_1m_sats_nupl".to_string()), + _10m_sats: PpmRatioPattern::new(client.clone(), "utxos_over_10m_sats_nupl".to_string()), + _1btc: PpmRatioPattern::new(client.clone(), "utxos_over_1btc_nupl".to_string()), + _10btc: PpmRatioPattern::new(client.clone(), "utxos_over_10btc_nupl".to_string()), + _100btc: PpmRatioPattern::new(client.clone(), "utxos_over_100btc_nupl".to_string()), + _1k_btc: PpmRatioPattern::new(client.clone(), "utxos_over_1k_btc_nupl".to_string()), + _10k_btc: PpmRatioPattern::new(client.clone(), "utxos_over_10k_btc_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Term { + pub short: PpmRatioPattern, + pub long: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Term { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: PpmRatioPattern::new(client.clone(), "sth_nupl".to_string()), + long: PpmRatioPattern::new(client.clone(), "lth_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Type { + pub p2pk65: PpmRatioPattern, + pub p2pk33: PpmRatioPattern, + pub p2pkh: PpmRatioPattern, + pub p2ms: PpmRatioPattern, + pub p2sh: PpmRatioPattern, + pub p2wpkh: PpmRatioPattern, + pub p2wsh: PpmRatioPattern, + pub p2tr: PpmRatioPattern, + pub p2a: PpmRatioPattern, + pub unknown: PpmRatioPattern, + pub empty: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Type { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + p2pk65: PpmRatioPattern::new(client.clone(), "p2pk65_nupl".to_string()), + p2pk33: PpmRatioPattern::new(client.clone(), "p2pk33_nupl".to_string()), + p2pkh: PpmRatioPattern::new(client.clone(), "p2pkh_nupl".to_string()), + p2ms: PpmRatioPattern::new(client.clone(), "p2ms_nupl".to_string()), + p2sh: PpmRatioPattern::new(client.clone(), "p2sh_nupl".to_string()), + p2wpkh: PpmRatioPattern::new(client.clone(), "p2wpkh_nupl".to_string()), + p2wsh: PpmRatioPattern::new(client.clone(), "p2wsh_nupl".to_string()), + p2tr: PpmRatioPattern::new(client.clone(), "p2tr_nupl".to_string()), + p2a: PpmRatioPattern::new(client.clone(), "p2a_nupl".to_string()), + unknown: PpmRatioPattern::new(client.clone(), "unknown_outputs_nupl".to_string()), + empty: PpmRatioPattern::new(client.clone(), "empty_outputs_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_CostBasis { + pub all: InMaxMinPerSupplyPattern, + pub sth: InMaxMinPerSupplyPattern, + pub lth: InMaxMinPerSupplyPattern, +} + +impl SeriesTree_Cohorts_Cohorts_CostBasis { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: InMaxMinPerSupplyPattern::new(client.clone(), "all".to_string()), + sth: InMaxMinPerSupplyPattern::new(client.clone(), "sth".to_string()), + lth: InMaxMinPerSupplyPattern::new(client.clone(), "lth".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative { + pub supply: SeriesTree_Cohorts_Cohorts_Relative_Supply, + pub unrealized: SeriesTree_Cohorts_Cohorts_Relative_Unrealized, + pub invested_capital: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital, +} + +impl SeriesTree_Cohorts_Cohorts_Relative { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + supply: SeriesTree_Cohorts_Cohorts_Relative_Supply::new(client.clone(), format!("{base_path}_supply")), + unrealized: SeriesTree_Cohorts_Cohorts_Relative_Unrealized::new(client.clone(), format!("{base_path}_unrealized")), + invested_capital: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital::new(client.clone(), format!("{base_path}_invested_capital")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_Supply { + pub in_profit: SharePattern2, + pub in_loss: SharePattern2, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_Supply { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + in_profit: SharePattern2::new(client.clone(), "supply_in_profit_share".to_string()), + in_loss: SharePattern2::new(client.clone(), "supply_in_loss_share".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_Unrealized { + pub profit: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit, + pub loss: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss, + pub net_pnl: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_Unrealized { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + profit: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss::new(client.clone(), format!("{base_path}_loss")), + net_pnl: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl::new(client.clone(), format!("{base_path}_net_pnl")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit { + pub to_mcap: AllLthSthPattern5, + pub to_own_mcap: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit_ToOwnMcap, + pub to_own_gross_pnl: AllLthSthPattern5, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + to_mcap: AllLthSthPattern5::new(client.clone(), "unrealized_profit_to_mcap".to_string()), + to_own_mcap: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit_ToOwnMcap::new(client.clone(), format!("{base_path}_to_own_mcap")), + to_own_gross_pnl: AllLthSthPattern5::new(client.clone(), "unrealized_profit_to_own_gross_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit_ToOwnMcap { + pub short: PercentPpmRatioPattern2, + pub long: PercentPpmRatioPattern2, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit_ToOwnMcap { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: PercentPpmRatioPattern2::new(client.clone(), "sth_unrealized_profit_to_own_mcap".to_string()), + long: PercentPpmRatioPattern2::new(client.clone(), "lth_unrealized_profit_to_own_mcap".to_string()), + height: SeriesPattern18::new(client.clone(), "unrealized_profit_to_own_mcap_ppm_by_term".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss { + pub to_mcap: AllLthSthPattern5, + pub to_own_mcap: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss_ToOwnMcap, + pub to_own_gross_pnl: AllLthSthPattern5, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + to_mcap: AllLthSthPattern5::new(client.clone(), "unrealized_loss_to_mcap".to_string()), + to_own_mcap: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss_ToOwnMcap::new(client.clone(), format!("{base_path}_to_own_mcap")), + to_own_gross_pnl: AllLthSthPattern5::new(client.clone(), "unrealized_loss_to_own_gross_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss_ToOwnMcap { + pub short: PercentPpmRatioPattern2, + pub long: PercentPpmRatioPattern2, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss_ToOwnMcap { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: PercentPpmRatioPattern2::new(client.clone(), "sth_unrealized_loss_to_own_mcap".to_string()), + long: PercentPpmRatioPattern2::new(client.clone(), "lth_unrealized_loss_to_own_mcap".to_string()), + height: SeriesPattern18::new(client.clone(), "unrealized_loss_to_own_mcap_ppm_by_term".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl { + pub to_own_mcap: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnMcap, + pub to_own_gross_pnl: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnGrossPnl, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + to_own_mcap: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnMcap::new(client.clone(), format!("{base_path}_to_own_mcap")), + to_own_gross_pnl: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnGrossPnl::new(client.clone(), format!("{base_path}_to_own_gross_pnl")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnMcap { + pub short: PercentPpmRatioPattern3, + pub long: PercentPpmRatioPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnMcap { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + short: PercentPpmRatioPattern3::new(client.clone(), "sth_net_unrealized_pnl_to_own_mcap".to_string()), + long: PercentPpmRatioPattern3::new(client.clone(), "lth_net_unrealized_pnl_to_own_mcap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnGrossPnl { + pub all: PercentPpmRatioPattern3, + pub sth: PercentPpmRatioPattern3, + pub lth: PercentPpmRatioPattern3, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnGrossPnl { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: PercentPpmRatioPattern3::new(client.clone(), "all_net_unrealized_pnl_to_own_gross_pnl".to_string()), + sth: PercentPpmRatioPattern3::new(client.clone(), "sth_net_unrealized_pnl_to_own_gross_pnl".to_string()), + lth: PercentPpmRatioPattern3::new(client.clone(), "lth_net_unrealized_pnl_to_own_gross_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital { + pub in_profit: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit, + pub in_loss: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + in_profit: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit::new(client.clone(), format!("{base_path}_in_profit")), + in_loss: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss::new(client.clone(), format!("{base_path}_in_loss")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit { + pub share: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit_Share, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + share: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit_Share::new(client.clone(), format!("{base_path}_share")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit_Share { + pub all: PercentPpmRatioPattern2, + pub sth: PercentPpmRatioPattern2, + pub lth: PercentPpmRatioPattern2, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit_Share { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: PercentPpmRatioPattern2::new(client.clone(), "all_invested_capital_in_profit_share".to_string()), + sth: PercentPpmRatioPattern2::new(client.clone(), "sth_invested_capital_in_profit_share".to_string()), + lth: PercentPpmRatioPattern2::new(client.clone(), "lth_invested_capital_in_profit_share".to_string()), + height: SeriesPattern18::new(client.clone(), "invested_capital_in_profit_share_ppm_by_aggregate".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss { + pub share: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss_Share, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + share: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss_Share::new(client.clone(), format!("{base_path}_share")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss_Share { + pub all: PercentPpmRatioPattern2, + pub sth: PercentPpmRatioPattern2, + pub lth: PercentPpmRatioPattern2, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss_Share { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: PercentPpmRatioPattern2::new(client.clone(), "all_invested_capital_in_loss_share".to_string()), + sth: PercentPpmRatioPattern2::new(client.clone(), "sth_invested_capital_in_loss_share".to_string()), + lth: PercentPpmRatioPattern2::new(client.clone(), "lth_invested_capital_in_loss_share".to_string()), + height: SeriesPattern18::new(client.clone(), "invested_capital_in_loss_share_ppm_by_aggregate".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability { + pub supply: SeriesTree_Cohorts_Cohorts_Profitability_Supply, + pub realized_cap: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap, + pub unrealized_pnl: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl, + pub nupl: SeriesTree_Cohorts_Cohorts_Profitability_Nupl, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + supply: SeriesTree_Cohorts_Cohorts_Profitability_Supply::new(client.clone(), format!("{base_path}_supply")), + realized_cap: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap::new(client.clone(), format!("{base_path}_realized_cap")), + unrealized_pnl: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl::new(client.clone(), format!("{base_path}_unrealized_pnl")), + nupl: SeriesTree_Cohorts_Cohorts_Profitability_Nupl::new(client.clone(), format!("{base_path}_nupl")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_Supply { + pub range: SeriesTree_Cohorts_Cohorts_Profitability_Supply_Range, + pub profit: SeriesTree_Cohorts_Cohorts_Profitability_Supply_Profit, + pub loss: SeriesTree_Cohorts_Cohorts_Profitability_Supply_Loss, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_Supply { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Profitability_Supply_Range::new(client.clone(), format!("{base_path}_range")), + profit: SeriesTree_Cohorts_Cohorts_Profitability_Supply_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Cohorts_Profitability_Supply_Loss::new(client.clone(), format!("{base_path}_loss")), + height: SeriesPattern18::new(client.clone(), "profitability_supply_sats_by_term_and_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_Supply_Range { + pub over_1000pct_in_profit: AllLthSthPattern4, + pub _500pct_to_1000pct_in_profit: AllLthSthPattern4, + pub _300pct_to_500pct_in_profit: AllLthSthPattern4, + pub _200pct_to_300pct_in_profit: AllLthSthPattern4, + pub _100pct_to_200pct_in_profit: AllLthSthPattern4, + pub _90pct_to_100pct_in_profit: AllLthSthPattern4, + pub _80pct_to_90pct_in_profit: AllLthSthPattern4, + pub _70pct_to_80pct_in_profit: AllLthSthPattern4, + pub _60pct_to_70pct_in_profit: AllLthSthPattern4, + pub _50pct_to_60pct_in_profit: AllLthSthPattern4, + pub _40pct_to_50pct_in_profit: AllLthSthPattern4, + pub _30pct_to_40pct_in_profit: AllLthSthPattern4, + pub _20pct_to_30pct_in_profit: AllLthSthPattern4, + pub _10pct_to_20pct_in_profit: AllLthSthPattern4, + pub _0pct_to_10pct_in_profit: AllLthSthPattern4, + pub _0pct_to_10pct_in_loss: AllLthSthPattern4, + pub _10pct_to_20pct_in_loss: AllLthSthPattern4, + pub _20pct_to_30pct_in_loss: AllLthSthPattern4, + pub _30pct_to_40pct_in_loss: AllLthSthPattern4, + pub _40pct_to_50pct_in_loss: AllLthSthPattern4, + pub _50pct_to_60pct_in_loss: AllLthSthPattern4, + pub _60pct_to_70pct_in_loss: AllLthSthPattern4, + pub _70pct_to_80pct_in_loss: AllLthSthPattern4, + pub _80pct_to_90pct_in_loss: AllLthSthPattern4, + pub _90pct_to_100pct_in_loss: AllLthSthPattern4, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_Supply_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + over_1000pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_over_1000pct_in_profit".to_string()), + _500pct_to_1000pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_500pct_to_1000pct_in_profit".to_string()), + _300pct_to_500pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_300pct_to_500pct_in_profit".to_string()), + _200pct_to_300pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_200pct_to_300pct_in_profit".to_string()), + _100pct_to_200pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_100pct_to_200pct_in_profit".to_string()), + _90pct_to_100pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_90pct_to_100pct_in_profit".to_string()), + _80pct_to_90pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_80pct_to_90pct_in_profit".to_string()), + _70pct_to_80pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_70pct_to_80pct_in_profit".to_string()), + _60pct_to_70pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_60pct_to_70pct_in_profit".to_string()), + _50pct_to_60pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_50pct_to_60pct_in_profit".to_string()), + _40pct_to_50pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_40pct_to_50pct_in_profit".to_string()), + _30pct_to_40pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_30pct_to_40pct_in_profit".to_string()), + _20pct_to_30pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_20pct_to_30pct_in_profit".to_string()), + _10pct_to_20pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_10pct_to_20pct_in_profit".to_string()), + _0pct_to_10pct_in_profit: AllLthSthPattern4::new(client.clone(), "utxos_0pct_to_10pct_in_profit".to_string()), + _0pct_to_10pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_0pct_to_10pct_in_loss".to_string()), + _10pct_to_20pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_10pct_to_20pct_in_loss".to_string()), + _20pct_to_30pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_20pct_to_30pct_in_loss".to_string()), + _30pct_to_40pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_30pct_to_40pct_in_loss".to_string()), + _40pct_to_50pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_40pct_to_50pct_in_loss".to_string()), + _50pct_to_60pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_50pct_to_60pct_in_loss".to_string()), + _60pct_to_70pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_60pct_to_70pct_in_loss".to_string()), + _70pct_to_80pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_70pct_to_80pct_in_loss".to_string()), + _80pct_to_90pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_80pct_to_90pct_in_loss".to_string()), + _90pct_to_100pct_in_loss: AllLthSthPattern4::new(client.clone(), "utxos_90pct_to_100pct_in_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_Supply_Profit { + pub all: AllLthSthPattern4, + pub _10pct: AllLthSthPattern4, + pub _20pct: AllLthSthPattern4, + pub _30pct: AllLthSthPattern4, + pub _40pct: AllLthSthPattern4, + pub _50pct: AllLthSthPattern4, + pub _60pct: AllLthSthPattern4, + pub _70pct: AllLthSthPattern4, + pub _80pct: AllLthSthPattern4, + pub _90pct: AllLthSthPattern4, + pub _100pct: AllLthSthPattern4, + pub _200pct: AllLthSthPattern4, + pub _300pct: AllLthSthPattern4, + pub _500pct: AllLthSthPattern4, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_Supply_Profit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AllLthSthPattern4::new(client.clone(), "utxos_in_profit".to_string()), + _10pct: AllLthSthPattern4::new(client.clone(), "utxos_over_10pct_in_profit".to_string()), + _20pct: AllLthSthPattern4::new(client.clone(), "utxos_over_20pct_in_profit".to_string()), + _30pct: AllLthSthPattern4::new(client.clone(), "utxos_over_30pct_in_profit".to_string()), + _40pct: AllLthSthPattern4::new(client.clone(), "utxos_over_40pct_in_profit".to_string()), + _50pct: AllLthSthPattern4::new(client.clone(), "utxos_over_50pct_in_profit".to_string()), + _60pct: AllLthSthPattern4::new(client.clone(), "utxos_over_60pct_in_profit".to_string()), + _70pct: AllLthSthPattern4::new(client.clone(), "utxos_over_70pct_in_profit".to_string()), + _80pct: AllLthSthPattern4::new(client.clone(), "utxos_over_80pct_in_profit".to_string()), + _90pct: AllLthSthPattern4::new(client.clone(), "utxos_over_90pct_in_profit".to_string()), + _100pct: AllLthSthPattern4::new(client.clone(), "utxos_over_100pct_in_profit".to_string()), + _200pct: AllLthSthPattern4::new(client.clone(), "utxos_over_200pct_in_profit".to_string()), + _300pct: AllLthSthPattern4::new(client.clone(), "utxos_over_300pct_in_profit".to_string()), + _500pct: AllLthSthPattern4::new(client.clone(), "utxos_over_500pct_in_profit".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_Supply_Loss { + pub all: AllLthSthPattern4, + pub _10pct: AllLthSthPattern4, + pub _20pct: AllLthSthPattern4, + pub _30pct: AllLthSthPattern4, + pub _40pct: AllLthSthPattern4, + pub _50pct: AllLthSthPattern4, + pub _60pct: AllLthSthPattern4, + pub _70pct: AllLthSthPattern4, + pub _80pct: AllLthSthPattern4, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_Supply_Loss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: AllLthSthPattern4::new(client.clone(), "utxos_in_loss".to_string()), + _10pct: AllLthSthPattern4::new(client.clone(), "utxos_over_10pct_in_loss".to_string()), + _20pct: AllLthSthPattern4::new(client.clone(), "utxos_over_20pct_in_loss".to_string()), + _30pct: AllLthSthPattern4::new(client.clone(), "utxos_over_30pct_in_loss".to_string()), + _40pct: AllLthSthPattern4::new(client.clone(), "utxos_over_40pct_in_loss".to_string()), + _50pct: AllLthSthPattern4::new(client.clone(), "utxos_over_50pct_in_loss".to_string()), + _60pct: AllLthSthPattern4::new(client.clone(), "utxos_over_60pct_in_loss".to_string()), + _70pct: AllLthSthPattern4::new(client.clone(), "utxos_over_70pct_in_loss".to_string()), + _80pct: AllLthSthPattern4::new(client.clone(), "utxos_over_80pct_in_loss".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap { + pub range: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range, + pub profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit, + pub loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range::new(client.clone(), format!("{base_path}_range")), + profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss::new(client.clone(), format!("{base_path}_loss")), + height: SeriesPattern18::new(client.clone(), "profitability_realized_cap_by_term_and_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range { + pub over_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_Over1000pctInProfit, + pub _500pct_to_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_500pctTo1000pctInProfit, + pub _300pct_to_500pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_300pctTo500pctInProfit, + pub _200pct_to_300pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_200pctTo300pctInProfit, + pub _100pct_to_200pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_100pctTo200pctInProfit, + pub _90pct_to_100pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInProfit, + pub _80pct_to_90pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInProfit, + pub _70pct_to_80pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInProfit, + pub _60pct_to_70pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInProfit, + pub _50pct_to_60pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInProfit, + pub _40pct_to_50pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInProfit, + pub _30pct_to_40pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInProfit, + pub _20pct_to_30pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInProfit, + pub _10pct_to_20pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInProfit, + pub _0pct_to_10pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInProfit, + pub _0pct_to_10pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInLoss, + pub _10pct_to_20pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInLoss, + pub _20pct_to_30pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInLoss, + pub _30pct_to_40pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInLoss, + pub _40pct_to_50pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInLoss, + pub _50pct_to_60pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInLoss, + pub _60pct_to_70pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInLoss, + pub _70pct_to_80pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInLoss, + pub _80pct_to_90pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInLoss, + pub _90pct_to_100pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInLoss, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + over_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_Over1000pctInProfit::new(client.clone(), format!("{base_path}_over_1000pct_in_profit")), + _500pct_to_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_500pctTo1000pctInProfit::new(client.clone(), format!("{base_path}_500pct_to_1000pct_in_profit")), + _300pct_to_500pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_300pctTo500pctInProfit::new(client.clone(), format!("{base_path}_300pct_to_500pct_in_profit")), + _200pct_to_300pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_200pctTo300pctInProfit::new(client.clone(), format!("{base_path}_200pct_to_300pct_in_profit")), + _100pct_to_200pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_100pctTo200pctInProfit::new(client.clone(), format!("{base_path}_100pct_to_200pct_in_profit")), + _90pct_to_100pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInProfit::new(client.clone(), format!("{base_path}_90pct_to_100pct_in_profit")), + _80pct_to_90pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInProfit::new(client.clone(), format!("{base_path}_80pct_to_90pct_in_profit")), + _70pct_to_80pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInProfit::new(client.clone(), format!("{base_path}_70pct_to_80pct_in_profit")), + _60pct_to_70pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInProfit::new(client.clone(), format!("{base_path}_60pct_to_70pct_in_profit")), + _50pct_to_60pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInProfit::new(client.clone(), format!("{base_path}_50pct_to_60pct_in_profit")), + _40pct_to_50pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInProfit::new(client.clone(), format!("{base_path}_40pct_to_50pct_in_profit")), + _30pct_to_40pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInProfit::new(client.clone(), format!("{base_path}_30pct_to_40pct_in_profit")), + _20pct_to_30pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInProfit::new(client.clone(), format!("{base_path}_20pct_to_30pct_in_profit")), + _10pct_to_20pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInProfit::new(client.clone(), format!("{base_path}_10pct_to_20pct_in_profit")), + _0pct_to_10pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInProfit::new(client.clone(), format!("{base_path}_0pct_to_10pct_in_profit")), + _0pct_to_10pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInLoss::new(client.clone(), format!("{base_path}_0pct_to_10pct_in_loss")), + _10pct_to_20pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInLoss::new(client.clone(), format!("{base_path}_10pct_to_20pct_in_loss")), + _20pct_to_30pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInLoss::new(client.clone(), format!("{base_path}_20pct_to_30pct_in_loss")), + _30pct_to_40pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInLoss::new(client.clone(), format!("{base_path}_30pct_to_40pct_in_loss")), + _40pct_to_50pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInLoss::new(client.clone(), format!("{base_path}_40pct_to_50pct_in_loss")), + _50pct_to_60pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInLoss::new(client.clone(), format!("{base_path}_50pct_to_60pct_in_loss")), + _60pct_to_70pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInLoss::new(client.clone(), format!("{base_path}_60pct_to_70pct_in_loss")), + _70pct_to_80pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInLoss::new(client.clone(), format!("{base_path}_70pct_to_80pct_in_loss")), + _80pct_to_90pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInLoss::new(client.clone(), format!("{base_path}_80pct_to_90pct_in_loss")), + _90pct_to_100pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInLoss::new(client.clone(), format!("{base_path}_90pct_to_100pct_in_loss")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_Over1000pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_Over1000pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_1000pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_1000pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_1000pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_500pctTo1000pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_500pctTo1000pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_500pct_to_1000pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_500pct_to_1000pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_500pct_to_1000pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_300pctTo500pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_300pctTo500pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_300pct_to_500pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_300pct_to_500pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_300pct_to_500pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_200pctTo300pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_200pctTo300pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_200pct_to_300pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_200pct_to_300pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_200pct_to_300pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_100pctTo200pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_100pctTo200pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_100pct_to_200pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_100pct_to_200pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_100pct_to_200pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit { + pub all: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_All, + pub _10pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_10pct, + pub _20pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_20pct, + pub _30pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_30pct, + pub _40pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_40pct, + pub _50pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_50pct, + pub _60pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_60pct, + pub _70pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_70pct, + pub _80pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_80pct, + pub _90pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_90pct, + pub _100pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_100pct, + pub _200pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_200pct, + pub _300pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_300pct, + pub _500pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_500pct, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_All::new(client.clone(), format!("{base_path}_all")), + _10pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_10pct::new(client.clone(), format!("{base_path}_10pct")), + _20pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_20pct::new(client.clone(), format!("{base_path}_20pct")), + _30pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_30pct::new(client.clone(), format!("{base_path}_30pct")), + _40pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_40pct::new(client.clone(), format!("{base_path}_40pct")), + _50pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_50pct::new(client.clone(), format!("{base_path}_50pct")), + _60pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_60pct::new(client.clone(), format!("{base_path}_60pct")), + _70pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_70pct::new(client.clone(), format!("{base_path}_70pct")), + _80pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_80pct::new(client.clone(), format!("{base_path}_80pct")), + _90pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_90pct::new(client.clone(), format!("{base_path}_90pct")), + _100pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_100pct::new(client.clone(), format!("{base_path}_100pct")), + _200pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_200pct::new(client.clone(), format!("{base_path}_200pct")), + _300pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_300pct::new(client.clone(), format!("{base_path}_300pct")), + _500pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_500pct::new(client.clone(), format!("{base_path}_500pct")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_All { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_All { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_10pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_10pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_20pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_20pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_30pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_30pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_40pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_40pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_50pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_50pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_60pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_60pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_70pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_70pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_80pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_80pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_90pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_90pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_90pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_90pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_90pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_100pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_100pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_100pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_100pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_100pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_200pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_200pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_200pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_200pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_200pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_300pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_300pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_300pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_300pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_300pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_500pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_500pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_500pct_in_profit_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_500pct_in_profit_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_500pct_in_profit_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss { + pub all: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_All, + pub _10pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_10pct, + pub _20pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_20pct, + pub _30pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_30pct, + pub _40pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_40pct, + pub _50pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_50pct, + pub _60pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_60pct, + pub _70pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_70pct, + pub _80pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_80pct, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_All::new(client.clone(), format!("{base_path}_all")), + _10pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_10pct::new(client.clone(), format!("{base_path}_10pct")), + _20pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_20pct::new(client.clone(), format!("{base_path}_20pct")), + _30pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_30pct::new(client.clone(), format!("{base_path}_30pct")), + _40pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_40pct::new(client.clone(), format!("{base_path}_40pct")), + _50pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_50pct::new(client.clone(), format!("{base_path}_50pct")), + _60pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_60pct::new(client.clone(), format!("{base_path}_60pct")), + _70pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_70pct::new(client.clone(), format!("{base_path}_70pct")), + _80pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_80pct::new(client.clone(), format!("{base_path}_80pct")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_All { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_All { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_10pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_10pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_20pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_20pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_30pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_30pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_40pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_40pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_50pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_50pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_60pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_60pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_70pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_70pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_80pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_80pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_loss_realized_cap".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_loss_sth_realized_cap".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_loss_lth_realized_cap".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl { + pub range: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range, + pub profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit, + pub loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range::new(client.clone(), format!("{base_path}_range")), + profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss::new(client.clone(), format!("{base_path}_loss")), + height: SeriesPattern18::new(client.clone(), "profitability_unrealized_pnl_by_term_and_range".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range { + pub over_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_Over1000pctInProfit, + pub _500pct_to_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_500pctTo1000pctInProfit, + pub _300pct_to_500pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_300pctTo500pctInProfit, + pub _200pct_to_300pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_200pctTo300pctInProfit, + pub _100pct_to_200pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_100pctTo200pctInProfit, + pub _90pct_to_100pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInProfit, + pub _80pct_to_90pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInProfit, + pub _70pct_to_80pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInProfit, + pub _60pct_to_70pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInProfit, + pub _50pct_to_60pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInProfit, + pub _40pct_to_50pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInProfit, + pub _30pct_to_40pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInProfit, + pub _20pct_to_30pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInProfit, + pub _10pct_to_20pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInProfit, + pub _0pct_to_10pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInProfit, + pub _0pct_to_10pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInLoss, + pub _10pct_to_20pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInLoss, + pub _20pct_to_30pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInLoss, + pub _30pct_to_40pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInLoss, + pub _40pct_to_50pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInLoss, + pub _50pct_to_60pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInLoss, + pub _60pct_to_70pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInLoss, + pub _70pct_to_80pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInLoss, + pub _80pct_to_90pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInLoss, + pub _90pct_to_100pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInLoss, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + over_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_Over1000pctInProfit::new(client.clone(), format!("{base_path}_over_1000pct_in_profit")), + _500pct_to_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_500pctTo1000pctInProfit::new(client.clone(), format!("{base_path}_500pct_to_1000pct_in_profit")), + _300pct_to_500pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_300pctTo500pctInProfit::new(client.clone(), format!("{base_path}_300pct_to_500pct_in_profit")), + _200pct_to_300pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_200pctTo300pctInProfit::new(client.clone(), format!("{base_path}_200pct_to_300pct_in_profit")), + _100pct_to_200pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_100pctTo200pctInProfit::new(client.clone(), format!("{base_path}_100pct_to_200pct_in_profit")), + _90pct_to_100pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInProfit::new(client.clone(), format!("{base_path}_90pct_to_100pct_in_profit")), + _80pct_to_90pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInProfit::new(client.clone(), format!("{base_path}_80pct_to_90pct_in_profit")), + _70pct_to_80pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInProfit::new(client.clone(), format!("{base_path}_70pct_to_80pct_in_profit")), + _60pct_to_70pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInProfit::new(client.clone(), format!("{base_path}_60pct_to_70pct_in_profit")), + _50pct_to_60pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInProfit::new(client.clone(), format!("{base_path}_50pct_to_60pct_in_profit")), + _40pct_to_50pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInProfit::new(client.clone(), format!("{base_path}_40pct_to_50pct_in_profit")), + _30pct_to_40pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInProfit::new(client.clone(), format!("{base_path}_30pct_to_40pct_in_profit")), + _20pct_to_30pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInProfit::new(client.clone(), format!("{base_path}_20pct_to_30pct_in_profit")), + _10pct_to_20pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInProfit::new(client.clone(), format!("{base_path}_10pct_to_20pct_in_profit")), + _0pct_to_10pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInProfit::new(client.clone(), format!("{base_path}_0pct_to_10pct_in_profit")), + _0pct_to_10pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInLoss::new(client.clone(), format!("{base_path}_0pct_to_10pct_in_loss")), + _10pct_to_20pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInLoss::new(client.clone(), format!("{base_path}_10pct_to_20pct_in_loss")), + _20pct_to_30pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInLoss::new(client.clone(), format!("{base_path}_20pct_to_30pct_in_loss")), + _30pct_to_40pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInLoss::new(client.clone(), format!("{base_path}_30pct_to_40pct_in_loss")), + _40pct_to_50pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInLoss::new(client.clone(), format!("{base_path}_40pct_to_50pct_in_loss")), + _50pct_to_60pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInLoss::new(client.clone(), format!("{base_path}_50pct_to_60pct_in_loss")), + _60pct_to_70pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInLoss::new(client.clone(), format!("{base_path}_60pct_to_70pct_in_loss")), + _70pct_to_80pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInLoss::new(client.clone(), format!("{base_path}_70pct_to_80pct_in_loss")), + _80pct_to_90pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInLoss::new(client.clone(), format!("{base_path}_80pct_to_90pct_in_loss")), + _90pct_to_100pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInLoss::new(client.clone(), format!("{base_path}_90pct_to_100pct_in_loss")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_Over1000pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_Over1000pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_1000pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_1000pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_1000pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_500pctTo1000pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_500pctTo1000pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_500pct_to_1000pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_500pct_to_1000pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_500pct_to_1000pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_300pctTo500pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_300pctTo500pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_300pct_to_500pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_300pct_to_500pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_300pct_to_500pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_200pctTo300pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_200pctTo300pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_200pct_to_300pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_200pct_to_300pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_200pct_to_300pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_100pctTo200pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_100pctTo200pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_100pct_to_200pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_100pct_to_200pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_100pct_to_200pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInProfit { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInProfit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_0pct_to_10pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_10pct_to_20pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_20pct_to_30pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_30pct_to_40pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_40pct_to_50pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_50pct_to_60pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_60pct_to_70pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_70pct_to_80pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_80pct_to_90pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInLoss { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInLoss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_90pct_to_100pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit { + pub all: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_All, + pub _10pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_10pct, + pub _20pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_20pct, + pub _30pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_30pct, + pub _40pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_40pct, + pub _50pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_50pct, + pub _60pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_60pct, + pub _70pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_70pct, + pub _80pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_80pct, + pub _90pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_90pct, + pub _100pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_100pct, + pub _200pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_200pct, + pub _300pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_300pct, + pub _500pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_500pct, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_All::new(client.clone(), format!("{base_path}_all")), + _10pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_10pct::new(client.clone(), format!("{base_path}_10pct")), + _20pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_20pct::new(client.clone(), format!("{base_path}_20pct")), + _30pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_30pct::new(client.clone(), format!("{base_path}_30pct")), + _40pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_40pct::new(client.clone(), format!("{base_path}_40pct")), + _50pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_50pct::new(client.clone(), format!("{base_path}_50pct")), + _60pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_60pct::new(client.clone(), format!("{base_path}_60pct")), + _70pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_70pct::new(client.clone(), format!("{base_path}_70pct")), + _80pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_80pct::new(client.clone(), format!("{base_path}_80pct")), + _90pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_90pct::new(client.clone(), format!("{base_path}_90pct")), + _100pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_100pct::new(client.clone(), format!("{base_path}_100pct")), + _200pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_200pct::new(client.clone(), format!("{base_path}_200pct")), + _300pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_300pct::new(client.clone(), format!("{base_path}_300pct")), + _500pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_500pct::new(client.clone(), format!("{base_path}_500pct")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_All { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_All { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_10pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_10pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_20pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_20pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_30pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_30pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_40pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_40pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_50pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_50pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_60pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_60pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_70pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_70pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_80pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_80pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_90pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_90pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_90pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_90pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_90pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_100pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_100pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_100pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_100pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_100pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_200pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_200pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_200pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_200pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_200pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_300pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_300pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_300pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_300pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_300pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_500pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_500pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_500pct_in_profit_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_500pct_in_profit_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_500pct_in_profit_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss { + pub all: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_All, + pub _10pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_10pct, + pub _20pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_20pct, + pub _30pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_30pct, + pub _40pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_40pct, + pub _50pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_50pct, + pub _60pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_60pct, + pub _70pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_70pct, + pub _80pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_80pct, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_All::new(client.clone(), format!("{base_path}_all")), + _10pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_10pct::new(client.clone(), format!("{base_path}_10pct")), + _20pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_20pct::new(client.clone(), format!("{base_path}_20pct")), + _30pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_30pct::new(client.clone(), format!("{base_path}_30pct")), + _40pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_40pct::new(client.clone(), format!("{base_path}_40pct")), + _50pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_50pct::new(client.clone(), format!("{base_path}_50pct")), + _60pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_60pct::new(client.clone(), format!("{base_path}_60pct")), + _70pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_70pct::new(client.clone(), format!("{base_path}_70pct")), + _80pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_80pct::new(client.clone(), format!("{base_path}_80pct")), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_All { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_All { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_10pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_10pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_10pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_20pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_20pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_20pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_30pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_30pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_30pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_40pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_40pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_40pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_50pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_50pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_50pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_60pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_60pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_60pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_70pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_70pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_70pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_80pct { + pub all: SeriesPattern1, + pub sth: SeriesPattern1, + pub lth: SeriesPattern1, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_80pct { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_loss_unrealized_pnl".to_string()), + sth: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_loss_sth_unrealized_pnl".to_string()), + lth: SeriesPattern1::new(client.clone(), "utxos_over_80pct_in_loss_lth_unrealized_pnl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_Nupl { + pub range: SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Range, + pub profit: SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Profit, + pub loss: SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Loss, + pub height: SeriesPattern18, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_Nupl { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + range: SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Range::new(client.clone(), format!("{base_path}_range")), + profit: SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Loss::new(client.clone(), format!("{base_path}_loss")), + height: SeriesPattern18::new(client.clone(), "profitability_nupl_ppm".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Range { + pub over_1000pct_in_profit: PpmRatioPattern, + pub _500pct_to_1000pct_in_profit: PpmRatioPattern, + pub _300pct_to_500pct_in_profit: PpmRatioPattern, + pub _200pct_to_300pct_in_profit: PpmRatioPattern, + pub _100pct_to_200pct_in_profit: PpmRatioPattern, + pub _90pct_to_100pct_in_profit: PpmRatioPattern, + pub _80pct_to_90pct_in_profit: PpmRatioPattern, + pub _70pct_to_80pct_in_profit: PpmRatioPattern, + pub _60pct_to_70pct_in_profit: PpmRatioPattern, + pub _50pct_to_60pct_in_profit: PpmRatioPattern, + pub _40pct_to_50pct_in_profit: PpmRatioPattern, + pub _30pct_to_40pct_in_profit: PpmRatioPattern, + pub _20pct_to_30pct_in_profit: PpmRatioPattern, + pub _10pct_to_20pct_in_profit: PpmRatioPattern, + pub _0pct_to_10pct_in_profit: PpmRatioPattern, + pub _0pct_to_10pct_in_loss: PpmRatioPattern, + pub _10pct_to_20pct_in_loss: PpmRatioPattern, + pub _20pct_to_30pct_in_loss: PpmRatioPattern, + pub _30pct_to_40pct_in_loss: PpmRatioPattern, + pub _40pct_to_50pct_in_loss: PpmRatioPattern, + pub _50pct_to_60pct_in_loss: PpmRatioPattern, + pub _60pct_to_70pct_in_loss: PpmRatioPattern, + pub _70pct_to_80pct_in_loss: PpmRatioPattern, + pub _80pct_to_90pct_in_loss: PpmRatioPattern, + pub _90pct_to_100pct_in_loss: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Range { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + over_1000pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_over_1000pct_in_profit_nupl".to_string()), + _500pct_to_1000pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_500pct_to_1000pct_in_profit_nupl".to_string()), + _300pct_to_500pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_300pct_to_500pct_in_profit_nupl".to_string()), + _200pct_to_300pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_200pct_to_300pct_in_profit_nupl".to_string()), + _100pct_to_200pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_100pct_to_200pct_in_profit_nupl".to_string()), + _90pct_to_100pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_90pct_to_100pct_in_profit_nupl".to_string()), + _80pct_to_90pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_80pct_to_90pct_in_profit_nupl".to_string()), + _70pct_to_80pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_70pct_to_80pct_in_profit_nupl".to_string()), + _60pct_to_70pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_60pct_to_70pct_in_profit_nupl".to_string()), + _50pct_to_60pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_50pct_to_60pct_in_profit_nupl".to_string()), + _40pct_to_50pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_40pct_to_50pct_in_profit_nupl".to_string()), + _30pct_to_40pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_30pct_to_40pct_in_profit_nupl".to_string()), + _20pct_to_30pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_20pct_to_30pct_in_profit_nupl".to_string()), + _10pct_to_20pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_10pct_to_20pct_in_profit_nupl".to_string()), + _0pct_to_10pct_in_profit: PpmRatioPattern::new(client.clone(), "utxos_0pct_to_10pct_in_profit_nupl".to_string()), + _0pct_to_10pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_0pct_to_10pct_in_loss_nupl".to_string()), + _10pct_to_20pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_10pct_to_20pct_in_loss_nupl".to_string()), + _20pct_to_30pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_20pct_to_30pct_in_loss_nupl".to_string()), + _30pct_to_40pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_30pct_to_40pct_in_loss_nupl".to_string()), + _40pct_to_50pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_40pct_to_50pct_in_loss_nupl".to_string()), + _50pct_to_60pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_50pct_to_60pct_in_loss_nupl".to_string()), + _60pct_to_70pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_60pct_to_70pct_in_loss_nupl".to_string()), + _70pct_to_80pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_70pct_to_80pct_in_loss_nupl".to_string()), + _80pct_to_90pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_80pct_to_90pct_in_loss_nupl".to_string()), + _90pct_to_100pct_in_loss: PpmRatioPattern::new(client.clone(), "utxos_90pct_to_100pct_in_loss_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Profit { + pub all: PpmRatioPattern, + pub _10pct: PpmRatioPattern, + pub _20pct: PpmRatioPattern, + pub _30pct: PpmRatioPattern, + pub _40pct: PpmRatioPattern, + pub _50pct: PpmRatioPattern, + pub _60pct: PpmRatioPattern, + pub _70pct: PpmRatioPattern, + pub _80pct: PpmRatioPattern, + pub _90pct: PpmRatioPattern, + pub _100pct: PpmRatioPattern, + pub _200pct: PpmRatioPattern, + pub _300pct: PpmRatioPattern, + pub _500pct: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Profit { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: PpmRatioPattern::new(client.clone(), "utxos_in_profit_nupl".to_string()), + _10pct: PpmRatioPattern::new(client.clone(), "utxos_over_10pct_in_profit_nupl".to_string()), + _20pct: PpmRatioPattern::new(client.clone(), "utxos_over_20pct_in_profit_nupl".to_string()), + _30pct: PpmRatioPattern::new(client.clone(), "utxos_over_30pct_in_profit_nupl".to_string()), + _40pct: PpmRatioPattern::new(client.clone(), "utxos_over_40pct_in_profit_nupl".to_string()), + _50pct: PpmRatioPattern::new(client.clone(), "utxos_over_50pct_in_profit_nupl".to_string()), + _60pct: PpmRatioPattern::new(client.clone(), "utxos_over_60pct_in_profit_nupl".to_string()), + _70pct: PpmRatioPattern::new(client.clone(), "utxos_over_70pct_in_profit_nupl".to_string()), + _80pct: PpmRatioPattern::new(client.clone(), "utxos_over_80pct_in_profit_nupl".to_string()), + _90pct: PpmRatioPattern::new(client.clone(), "utxos_over_90pct_in_profit_nupl".to_string()), + _100pct: PpmRatioPattern::new(client.clone(), "utxos_over_100pct_in_profit_nupl".to_string()), + _200pct: PpmRatioPattern::new(client.clone(), "utxos_over_200pct_in_profit_nupl".to_string()), + _300pct: PpmRatioPattern::new(client.clone(), "utxos_over_300pct_in_profit_nupl".to_string()), + _500pct: PpmRatioPattern::new(client.clone(), "utxos_over_500pct_in_profit_nupl".to_string()), + } + } +} + +/// Series tree node. +pub struct SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Loss { + pub all: PpmRatioPattern, + pub _10pct: PpmRatioPattern, + pub _20pct: PpmRatioPattern, + pub _30pct: PpmRatioPattern, + pub _40pct: PpmRatioPattern, + pub _50pct: PpmRatioPattern, + pub _60pct: PpmRatioPattern, + pub _70pct: PpmRatioPattern, + pub _80pct: PpmRatioPattern, +} + +impl SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Loss { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + all: PpmRatioPattern::new(client.clone(), "utxos_in_loss_nupl".to_string()), + _10pct: PpmRatioPattern::new(client.clone(), "utxos_over_10pct_in_loss_nupl".to_string()), + _20pct: PpmRatioPattern::new(client.clone(), "utxos_over_20pct_in_loss_nupl".to_string()), + _30pct: PpmRatioPattern::new(client.clone(), "utxos_over_30pct_in_loss_nupl".to_string()), + _40pct: PpmRatioPattern::new(client.clone(), "utxos_over_40pct_in_loss_nupl".to_string()), + _50pct: PpmRatioPattern::new(client.clone(), "utxos_over_50pct_in_loss_nupl".to_string()), + _60pct: PpmRatioPattern::new(client.clone(), "utxos_over_60pct_in_loss_nupl".to_string()), + _70pct: PpmRatioPattern::new(client.clone(), "utxos_over_70pct_in_loss_nupl".to_string()), + _80pct: PpmRatioPattern::new(client.clone(), "utxos_over_80pct_in_loss_nupl".to_string()), } } } diff --git a/crates/brk_cohort/src/addr.rs b/crates/brk_cohort/src/addr.rs deleted file mode 100644 index 984efd151..000000000 --- a/crates/brk_cohort/src/addr.rs +++ /dev/null @@ -1,82 +0,0 @@ -use brk_traversable::Traversable; -use rayon::prelude::*; - -use crate::Filter; - -use super::{AmountRange, OverAmount, UnderAmount}; - -#[derive(Default, Clone, Traversable)] -pub struct AddrGroups { - pub over_amount: OverAmount, - pub amount_range: AmountRange, - pub under_amount: UnderAmount, -} - -impl AddrGroups { - pub fn new(mut create: F) -> Self - where - F: FnMut(Filter, &'static str) -> T, - { - Self { - over_amount: OverAmount::new(&mut create), - amount_range: AmountRange::new(&mut create), - under_amount: UnderAmount::new(&mut create), - } - } - - pub fn try_new(create: &F) -> Result - where - F: Fn(Filter, &'static str) -> Result, - { - Ok(Self { - over_amount: OverAmount::try_new(create)?, - amount_range: AmountRange::try_new(create)?, - under_amount: UnderAmount::try_new(create)?, - }) - } - - pub fn iter(&self) -> impl Iterator { - self.over_amount - .iter() - .chain(self.amount_range.iter()) - .chain(self.under_amount.iter()) - } - - pub fn iter_mut(&mut self) -> impl Iterator { - self.over_amount - .iter_mut() - .chain(self.amount_range.iter_mut()) - .chain(self.under_amount.iter_mut()) - } - - pub fn par_iter_mut(&mut self) -> impl ParallelIterator - where - T: Send + Sync, - { - self.over_amount - .par_iter_mut() - .chain(self.amount_range.par_iter_mut()) - .chain(self.under_amount.par_iter_mut()) - } - - pub fn iter_separate(&self) -> impl Iterator { - self.amount_range.iter() - } - - pub fn iter_separate_mut(&mut self) -> impl Iterator { - self.amount_range.iter_mut() - } - - pub fn par_iter_separate_mut(&mut self) -> impl ParallelIterator - where - T: Send + Sync, - { - self.amount_range.par_iter_mut() - } - - pub fn iter_overlapping_mut(&mut self) -> impl Iterator { - self.under_amount - .iter_mut() - .chain(self.over_amount.iter_mut()) - } -} diff --git a/crates/brk_cohort/src/age_range.rs b/crates/brk_cohort/src/age_range.rs index 5628c182f..90b4bd873 100644 --- a/crates/brk_cohort/src/age_range.rs +++ b/crates/brk_cohort/src/age_range.rs @@ -3,6 +3,7 @@ use std::ops::Range; use brk_traversable::Traversable; use brk_types::Age; use rayon::iter::{IntoParallelIterator, ParallelIterator}; +use schemars::JsonSchema; use serde::Serialize; use vecdb::{ColumnId, VecValue, Version}; @@ -122,7 +123,7 @@ pub const LTH_AGE_RANGE_IDS: [AgeRangeId; LTH_AGE_RANGE_COUNT] = [ impl ColumnId for AgeRangeId { type Row - = [T; AGE_RANGE_COUNT] + = AgeRange where T: VecValue; @@ -136,35 +137,49 @@ impl ColumnId for AgeRangeId { #[inline] fn get(self, row: &Self::Row) -> &T { - &row[self as usize] + self.select(row) } #[inline] fn get_mut(self, row: &mut Self::Row) -> &mut T { - &mut row[self as usize] + self.select_mut(row) } #[inline] - fn from_fn(mut f: F) -> Self::Row + fn from_fn(f: F) -> Self::Row where T: VecValue, F: FnMut(Self) -> T, { - std::array::from_fn(|index| f(AGE_RANGE_IDS[index])) + AgeRange::from_fn(f) } #[inline] - fn map(row: Self::Row, f: F) -> Self::Row + fn map(row: Self::Row, mut f: F) -> Self::Row where T: VecValue, U: VecValue, F: FnMut(T) -> U, { - row.map(f) + AgeRange::from_fn(|column| f(column.get(&row).clone())) } } impl AgeRangeId { + pub fn matching(filter: &Filter) -> Option { + Self::ALL + .iter() + .copied() + .find(|column| column.filter() == filter) + } + + pub fn included_by(filter: &Filter) -> impl Iterator + '_ { + Self::ALL + .iter() + .copied() + .filter(|column| filter.includes(column.filter())) + } + #[inline] pub fn bounds(self) -> &'static Range { self.select(&AGE_RANGE_BOUNDS) @@ -367,7 +382,7 @@ pub const AGE_RANGE_NAMES: AgeRange = AgeRange { over_15y: CohortName::new("over_15y_old", "15y+", "15+ Years Old"), }; -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct AgeRange { pub under_1h: T, pub _1h_to_1d: T, @@ -394,6 +409,32 @@ pub struct AgeRange { pub over_15y: T, } +impl_column_row_formattable!(AgeRange { + under_1h, + _1h_to_1d, + _1d_to_1w, + _1w_to_1m, + _1m_to_2m, + _2m_to_3m, + _3m_to_4m, + _4m_to_5m, + _5m_to_6m, + _6m_to_9m, + _9m_to_1y, + _1y_to_18m, + _18m_to_2y, + _2y_to_3y, + _3y_to_4y, + _4y_to_5y, + _5y_to_6y, + _6y_to_7y, + _7y_to_8y, + _8y_to_10y, + _10y_to_12y, + _12y_to_15y, + over_15y, +}); + impl AgeRange { pub fn from_fn(mut create: impl FnMut(AgeRangeId) -> T) -> Self { Self { diff --git a/crates/brk_cohort/src/amount.rs b/crates/brk_cohort/src/amount.rs new file mode 100644 index 000000000..d9720cce9 --- /dev/null +++ b/crates/brk_cohort/src/amount.rs @@ -0,0 +1,106 @@ +use brk_traversable::Traversable; +use rayon::prelude::*; +use schemars::JsonSchema; +use serde::Serialize; +use vecdb::ColumnId; + +use crate::{ + AmountRange, AmountRangeId, Filter, OVER_AMOUNT_FILTERS, OverAmount, OverAmountId, + UNDER_AMOUNT_FILTERS, UnderAmount, UnderAmountId, +}; + +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] +pub struct Amount { + pub range: AmountRange, + pub under: UnderAmount, + pub over: OverAmount, +} + +impl Amount { + pub fn new(mut create: impl FnMut(Filter, &'static str) -> T) -> Self { + Self { + range: AmountRange::new(&mut create), + under: UnderAmount::new(&mut create), + over: OverAmount::new(create), + } + } + + pub fn try_new( + mut create: impl FnMut(Filter, &'static str) -> Result, + ) -> Result { + Ok(Self { + range: AmountRange::try_new(&mut create)?, + under: UnderAmount::try_new(&mut create)?, + over: OverAmount::try_new(create)?, + }) + } + + pub fn get(&self, filter: &Filter) -> Option<&T> { + AmountRangeId::matching(filter) + .map(|id| id.select(&self.range)) + .or_else(|| { + UnderAmountId::ALL + .iter() + .copied() + .find(|id| id.select(&UNDER_AMOUNT_FILTERS) == filter) + .map(|id| id.select(&self.under)) + }) + .or_else(|| { + OverAmountId::ALL + .iter() + .copied() + .find(|id| id.select(&OVER_AMOUNT_FILTERS) == filter) + .map(|id| id.select(&self.over)) + }) + } + + pub fn map_named(&self, mut map: impl FnMut(&Filter, &'static str, &T) -> U) -> Amount { + Amount { + range: AmountRange::new(|filter, name| { + map( + &filter, + name, + self.get(&filter).expect("exact amount range"), + ) + }), + under: UnderAmount::new(|filter, name| { + map( + &filter, + name, + self.get(&filter).expect("under-amount threshold"), + ) + }), + over: OverAmount::new(|filter, name| { + map( + &filter, + name, + self.get(&filter).expect("over-amount threshold"), + ) + }), + } + } + + pub fn iter(&self) -> impl Iterator { + self.range + .iter() + .chain(self.under.iter()) + .chain(self.over.iter()) + } + + pub fn iter_mut(&mut self) -> impl Iterator { + self.range + .iter_mut() + .chain(self.under.iter_mut()) + .chain(self.over.iter_mut()) + } + + pub fn par_iter_mut(&mut self) -> impl ParallelIterator + where + T: Send + Sync, + { + self.range + .par_iter_mut() + .chain(self.under.par_iter_mut()) + .chain(self.over.par_iter_mut()) + } +} diff --git a/crates/brk_cohort/src/amount_bucket.rs b/crates/brk_cohort/src/amount_bucket.rs new file mode 100644 index 000000000..06687f2ee --- /dev/null +++ b/crates/brk_cohort/src/amount_bucket.rs @@ -0,0 +1,47 @@ +use brk_types::Sats; + +/// Bucket index for amount ranges. Use for cheap comparisons and direct lookups. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct AmountBucket(u8); + +impl AmountBucket { + /// Returns both buckets when they differ. + #[inline(always)] + pub fn transition_to(self, other: Self) -> Option<(Self, Self)> { + (self != other).then_some((self, other)) + } + + #[inline(always)] + pub fn index(self) -> u8 { + self.0 + } +} + +impl From for AmountBucket { + #[inline(always)] + fn from(value: Sats) -> Self { + Self(match value { + v if v < Sats::_1 => 0, + v if v < Sats::_10 => 1, + v if v < Sats::_100 => 2, + v if v < Sats::_1K => 3, + v if v < Sats::_10K => 4, + v if v < Sats::_100K => 5, + v if v < Sats::_1M => 6, + v if v < Sats::_10M => 7, + v if v < Sats::_1BTC => 8, + v if v < Sats::_10BTC => 9, + v if v < Sats::_100BTC => 10, + v if v < Sats::_1K_BTC => 11, + v if v < Sats::_10K_BTC => 12, + v if v < Sats::_100K_BTC => 13, + _ => 14, + }) + } +} + +/// Checks whether two amounts belong to different buckets. +#[inline(always)] +pub fn amounts_in_different_buckets(a: Sats, b: Sats) -> bool { + AmountBucket::from(a) != AmountBucket::from(b) +} diff --git a/crates/brk_cohort/src/amount_range.rs b/crates/brk_cohort/src/amount_range.rs index 9bed2f474..184aa92de 100644 --- a/crates/brk_cohort/src/amount_range.rs +++ b/crates/brk_cohort/src/amount_range.rs @@ -3,60 +3,11 @@ use std::ops::{Add, AddAssign, Range}; use brk_traversable::Traversable; use brk_types::Sats; use rayon::prelude::*; +use schemars::JsonSchema; use serde::Serialize; +use vecdb::ColumnId; -use super::{AmountFilter, CohortName, Filter}; - -/// Bucket index for amount ranges. Use for cheap comparisons and direct lookups. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct AmountBucket(u8); - -impl AmountBucket { - /// Returns (self, other) if buckets differ, None if same. - /// Use with `AmountRange::get_mut_by_bucket` to avoid recomputing. - #[inline(always)] - pub fn transition_to(self, other: Self) -> Option<(Self, Self)> { - if self != other { - Some((self, other)) - } else { - None - } - } - - #[inline(always)] - pub fn index(self) -> u8 { - self.0 - } -} - -impl From for AmountBucket { - #[inline(always)] - fn from(value: Sats) -> Self { - Self(match value { - v if v < Sats::_1 => 0, - v if v < Sats::_10 => 1, - v if v < Sats::_100 => 2, - v if v < Sats::_1K => 3, - v if v < Sats::_10K => 4, - v if v < Sats::_100K => 5, - v if v < Sats::_1M => 6, - v if v < Sats::_10M => 7, - v if v < Sats::_1BTC => 8, - v if v < Sats::_10BTC => 9, - v if v < Sats::_100BTC => 10, - v if v < Sats::_1K_BTC => 11, - v if v < Sats::_10K_BTC => 12, - v if v < Sats::_100K_BTC => 13, - _ => 14, - }) - } -} - -/// Check if two amounts are in different buckets. O(1). -#[inline(always)] -pub fn amounts_in_different_buckets(a: Sats, b: Sats) -> bool { - AmountBucket::from(a) != AmountBucket::from(b) -} +use super::{AmountBucket, AmountFilter, CohortName, Filter}; /// Amount range bounds pub const AMOUNT_RANGE_BOUNDS: AmountRange> = AmountRange { @@ -131,7 +82,7 @@ pub const AMOUNT_RANGE_FILTERS: AmountRange = AmountRange { over_100k_btc: Filter::Amount(AmountFilter::Range(AMOUNT_RANGE_BOUNDS.over_100k_btc)), }; -#[derive(Debug, Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct AmountRange { pub _0sats: T, pub _1sat_to_10sats: T, @@ -150,6 +101,47 @@ pub struct AmountRange { pub over_100k_btc: T, } +define_column_id!( + AmountRangeId for AmountRange, version = 1 { + Zero => _0sats, + From1SatTo10Sats => _1sat_to_10sats, + From10SatsTo100Sats => _10sats_to_100sats, + From100SatsTo1KSats => _100sats_to_1k_sats, + From1KSatsTo10KSats => _1k_sats_to_10k_sats, + From10KSatsTo100KSats => _10k_sats_to_100k_sats, + From100KSatsTo1MSats => _100k_sats_to_1m_sats, + From1MSatsTo10MSats => _1m_sats_to_10m_sats, + From10MSatsTo1Btc => _10m_sats_to_1btc, + From1BtcTo10Btc => _1btc_to_10btc, + From10BtcTo100Btc => _10btc_to_100btc, + From100BtcTo1KBtc => _100btc_to_1k_btc, + From1KBtcTo10KBtc => _1k_btc_to_10k_btc, + From10KBtcTo100KBtc => _10k_btc_to_100k_btc, + Over100kBtc => over_100k_btc, + } +); + +impl AmountRangeId { + #[inline] + pub fn filter(self) -> &'static Filter { + self.select(&AMOUNT_RANGE_FILTERS) + } + + pub fn matching(filter: &Filter) -> Option { + Self::ALL + .iter() + .copied() + .find(|column| column.filter() == filter) + } + + pub fn included_by(filter: &Filter) -> impl Iterator + '_ { + Self::ALL + .iter() + .copied() + .filter(|column| filter.includes(column.filter())) + } +} + impl AmountRange { pub const fn names() -> &'static Self { &AMOUNT_RANGE_NAMES @@ -230,7 +222,7 @@ impl AmountRange { #[inline(always)] pub fn get(&self, value: Sats) -> &T { - match AmountBucket::from(value).0 { + match AmountBucket::from(value).index() { 0 => &self._0sats, 1 => &self._1sat_to_10sats, 2 => &self._10sats_to_100sats, @@ -258,7 +250,7 @@ impl AmountRange { /// Use with `AmountBucket::transition_to` to avoid recomputing bucket. #[inline(always)] pub fn get_mut_by_bucket(&mut self, bucket: AmountBucket) -> &mut T { - match bucket.0 { + match bucket.index() { 0 => &mut self._0sats, 1 => &mut self._1sat_to_10sats, 2 => &mut self._10sats_to_100sats, diff --git a/crates/brk_cohort/src/by_age.rs b/crates/brk_cohort/src/by_age.rs new file mode 100644 index 000000000..bbe74673c --- /dev/null +++ b/crates/brk_cohort/src/by_age.rs @@ -0,0 +1,105 @@ +use brk_traversable::Traversable; +use rayon::prelude::*; +use schemars::JsonSchema; +use serde::Serialize; +use vecdb::ColumnId; + +use crate::{ + AGE_RANGE_FILTERS, AgeRange, AgeRangeId, Filter, OVER_AGE_FILTERS, OverAge, OverAgeId, + UNDER_AGE_FILTERS, UnderAge, UnderAgeId, +}; + +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] +pub struct ByAge { + pub range: AgeRange, + pub under: UnderAge, + pub over: OverAge, +} + +impl ByAge { + pub fn new(mut create: impl FnMut(Filter, &'static str) -> T) -> Self { + Self { + range: AgeRange::new(&mut create), + under: UnderAge::new(&mut create), + over: OverAge::new(create), + } + } + + pub fn try_new( + mut create: impl FnMut(Filter, &'static str) -> Result, + ) -> Result { + Ok(Self { + range: AgeRange::try_new(&mut create)?, + under: UnderAge::try_new(&mut create)?, + over: OverAge::try_new(create)?, + }) + } + + pub fn get(&self, filter: &Filter) -> Option<&T> { + AgeRangeId::ALL + .iter() + .copied() + .find(|id| id.select(&AGE_RANGE_FILTERS) == filter) + .map(|id| id.select(&self.range)) + .or_else(|| { + UnderAgeId::ALL + .iter() + .copied() + .find(|id| id.select(&UNDER_AGE_FILTERS) == filter) + .map(|id| id.select(&self.under)) + }) + .or_else(|| { + OverAgeId::ALL + .iter() + .copied() + .find(|id| id.select(&OVER_AGE_FILTERS) == filter) + .map(|id| id.select(&self.over)) + }) + } + + pub fn map_named(&self, mut map: impl FnMut(&Filter, &'static str, &T) -> U) -> ByAge { + ByAge { + range: AgeRange::new(|filter, name| { + map(&filter, name, self.get(&filter).expect("exact age range")) + }), + under: UnderAge::new(|filter, name| { + map( + &filter, + name, + self.get(&filter).expect("under-age threshold"), + ) + }), + over: OverAge::new(|filter, name| { + map( + &filter, + name, + self.get(&filter).expect("over-age threshold"), + ) + }), + } + } + + pub fn iter(&self) -> impl Iterator { + self.range + .iter() + .chain(self.under.iter()) + .chain(self.over.iter()) + } + + pub fn iter_mut(&mut self) -> impl Iterator { + self.range + .iter_mut() + .chain(self.under.iter_mut()) + .chain(self.over.iter_mut()) + } + + pub fn par_iter_mut(&mut self) -> impl ParallelIterator + where + T: Send + Sync, + { + self.range + .par_iter_mut() + .chain(self.under.par_iter_mut()) + .chain(self.over.par_iter_mut()) + } +} diff --git a/crates/brk_cohort/src/by_entry.rs b/crates/brk_cohort/src/by_entry.rs index 3ac872e44..c7472cffd 100644 --- a/crates/brk_cohort/src/by_entry.rs +++ b/crates/brk_cohort/src/by_entry.rs @@ -1,5 +1,6 @@ use brk_traversable::Traversable; use rayon::iter::{IntoParallelIterator, ParallelIterator}; +use schemars::JsonSchema; use serde::Serialize; use super::{CohortName, Filter}; @@ -36,12 +37,19 @@ pub const ENTRY_NAMES: ByEntry = ByEntry { premium: CohortName::new("rookie", "Rookie", "Rookie Coins"), }; -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct ByEntry { pub discount: T, pub premium: T, } +define_column_id!( + EntryId for ByEntry, version = 1 { + Discount => discount, + Premium => premium, + } +); + impl ByEntry { pub const fn names() -> &'static Self { &ENTRY_NAMES diff --git a/crates/brk_cohort/src/by_epoch.rs b/crates/brk_cohort/src/by_epoch.rs index d1d71eca1..f5b6a2588 100644 --- a/crates/brk_cohort/src/by_epoch.rs +++ b/crates/brk_cohort/src/by_epoch.rs @@ -1,6 +1,7 @@ use brk_traversable::Traversable; use brk_types::{Halving, Height}; use rayon::iter::{IntoParallelIterator, ParallelIterator}; +use schemars::JsonSchema; use serde::Serialize; use super::{CohortName, Filter}; @@ -32,7 +33,7 @@ pub const EPOCH_NAMES: ByEpoch = ByEpoch { _4: CohortName::new("epoch_4", "4", "Epoch 4"), }; -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct ByEpoch { pub _0: T, pub _1: T, @@ -41,6 +42,16 @@ pub struct ByEpoch { pub _4: T, } +define_column_id!( + EpochId for ByEpoch, version = 1 { + _0 => _0, + _1 => _1, + _2 => _2, + _3 => _3, + _4 => _4, + } +); + impl ByEpoch { pub const fn names() -> &'static Self { &EPOCH_NAMES diff --git a/crates/brk_cohort/src/by_term.rs b/crates/brk_cohort/src/by_term.rs index 4e46d8759..db9290a41 100644 --- a/crates/brk_cohort/src/by_term.rs +++ b/crates/brk_cohort/src/by_term.rs @@ -1,5 +1,6 @@ use brk_traversable::Traversable; use rayon::iter::{IntoParallelIterator, ParallelIterator}; +use schemars::JsonSchema; use serde::Serialize; use super::{CohortName, Filter, Term}; @@ -22,12 +23,19 @@ pub const TERM_NAMES: ByTerm = ByTerm { long: CohortName::new("lth", "LTH", "Long Term Holders"), }; -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Copy, Traversable, Serialize, JsonSchema)] pub struct ByTerm { pub short: T, pub long: T, } +define_column_id!( + TermId for ByTerm, version = 1 { + Short => short, + Long => long, + } +); + impl ByTerm { pub const fn names() -> &'static Self { &TERM_NAMES diff --git a/crates/brk_cohort/src/class.rs b/crates/brk_cohort/src/class.rs index 0a9383fab..83642c8c4 100644 --- a/crates/brk_cohort/src/class.rs +++ b/crates/brk_cohort/src/class.rs @@ -1,6 +1,7 @@ use brk_traversable::Traversable; use brk_types::{Timestamp, Year}; use rayon::iter::{IntoParallelIterator, ParallelIterator}; +use schemars::JsonSchema; use serde::Serialize; use super::{CohortName, Filter}; @@ -71,7 +72,7 @@ pub const CLASS_NAMES: Class = Class { _2026: CohortName::new("class_2026", "2026", "Class 2026"), }; -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct Class { pub _2009: T, pub _2010: T, @@ -93,6 +94,29 @@ pub struct Class { pub _2026: T, } +define_column_id!( + ClassId for Class, version = 1 { + _2009 => _2009, + _2010 => _2010, + _2011 => _2011, + _2012 => _2012, + _2013 => _2013, + _2014 => _2014, + _2015 => _2015, + _2016 => _2016, + _2017 => _2017, + _2018 => _2018, + _2019 => _2019, + _2020 => _2020, + _2021 => _2021, + _2022 => _2022, + _2023 => _2023, + _2024 => _2024, + _2025 => _2025, + _2026 => _2026, + } +); + impl Class { pub const fn names() -> &'static Self { &CLASS_NAMES diff --git a/crates/brk_cohort/src/column_id.rs b/crates/brk_cohort/src/column_id.rs new file mode 100644 index 000000000..7b5c3ab50 --- /dev/null +++ b/crates/brk_cohort/src/column_id.rs @@ -0,0 +1,157 @@ +macro_rules! define_column_id { + ( + $id:ident for $row:ident, version = $version:literal { + $($variant:ident => $field:ident),+ $(,)? + } + ) => { + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] + #[repr(u8)] + pub enum $id { + $($variant),+ + } + + impl $id { + #[inline] + pub fn select(self, row: &$row) -> &T { + match self { + $(Self::$variant => &row.$field),+ + } + } + + #[inline] + pub fn select_mut(self, row: &mut $row) -> &mut T { + match self { + $(Self::$variant => &mut row.$field),+ + } + } + } + + impl $row { + pub fn from_fn(mut f: impl FnMut($id) -> T) -> Self { + Self { + $($field: f($id::$variant)),+ + } + } + } + + impl vecdb::ColumnId for $id { + type Row + = $row + where + T: vecdb::VecValue; + + const VERSION: vecdb::Version = vecdb::Version::new($version); + const ALL: &'static [Self] = &[$(Self::$variant),+]; + + #[inline] + fn index(self) -> usize { + self as usize + } + + #[inline] + fn get(self, row: &Self::Row) -> &T { + self.select(row) + } + + #[inline] + fn get_mut(self, row: &mut Self::Row) -> &mut T { + self.select_mut(row) + } + + #[inline] + fn from_fn(f: F) -> Self::Row + where + T: vecdb::VecValue, + F: FnMut(Self) -> T, + { + $row::from_fn(f) + } + + #[inline] + fn map(row: Self::Row, mut f: F) -> Self::Row + where + T: vecdb::VecValue, + U: vecdb::VecValue, + F: FnMut(T) -> U, + { + $row { + $($field: f(row.$field)),+ + } + } + } + + impl vecdb::Formattable for $row { + fn write_to(&self, output: &mut Vec) { + output.push(b'{'); + let mut first = true; + $( + if !first { + output.push(b','); + } + first = false; + output.extend_from_slice(concat!("\"", stringify!($field), "\":").as_bytes()); + vecdb::Formattable::fmt_json(&self.$field, output); + )+ + let _ = first; + output.push(b'}'); + } + + fn fmt_csv(&self, output: &mut String) -> std::fmt::Result { + let mut json = Vec::new(); + vecdb::Formattable::write_to(self, &mut json); + let json = std::str::from_utf8(&json).map_err(|_| std::fmt::Error)?; + + output.push('"'); + for character in json.chars() { + if character == '"' { + output.push('"'); + } + output.push(character); + } + output.push('"'); + Ok(()) + } + } + }; +} + +macro_rules! impl_column_row_formattable { + ( + $row:ident { + $($field:ident),+ $(,)? + } + ) => { + impl vecdb::Formattable for $row { + fn write_to(&self, output: &mut Vec) { + output.push(b'{'); + let mut first = true; + $( + if !first { + output.push(b','); + } + first = false; + output.extend_from_slice(concat!("\"", stringify!($field), "\":").as_bytes()); + vecdb::Formattable::fmt_json(&self.$field, output); + )+ + let _ = first; + output.push(b'}'); + } + + fn fmt_csv(&self, output: &mut String) -> std::fmt::Result { + let mut json = Vec::new(); + vecdb::Formattable::write_to(self, &mut json); + let json = std::str::from_utf8(&json).map_err(|_| std::fmt::Error)?; + + output.push('"'); + for character in json.chars() { + if character == '"' { + output.push('"'); + } + output.push(character); + } + output.push('"'); + Ok(()) + } + } + }; +} diff --git a/crates/brk_cohort/src/lib.rs b/crates/brk_cohort/src/lib.rs index 86a0de52a..07446a04c 100644 --- a/crates/brk_cohort/src/lib.rs +++ b/crates/brk_cohort/src/lib.rs @@ -1,10 +1,15 @@ #![doc = include_str!("../README.md")] -mod addr; +#[macro_use] +mod column_id; + mod age_range; +mod amount; +mod amount_bucket; mod amount_filter; mod amount_range; mod by_addr_type; +mod by_age; mod by_any_addr; mod by_entry; mod by_epoch; @@ -28,14 +33,20 @@ mod under_age; mod under_amount; mod unspendable_type; mod utxo; +mod utxo_aggregate; +mod utxo_all_and_sth; +mod utxo_groups_without_amount; +mod utxo_groups_without_amount_or_type; pub use brk_types::{Age, Term}; -pub use addr::*; pub use age_range::*; +pub use amount::*; +pub use amount_bucket::*; pub use amount_filter::*; pub use amount_range::*; pub use by_addr_type::*; +pub use by_age::*; pub use by_any_addr::*; pub use by_entry::*; pub use by_epoch::*; @@ -59,3 +70,7 @@ pub use under_age::*; pub use under_amount::*; pub use unspendable_type::*; pub use utxo::*; +pub use utxo_aggregate::*; +pub use utxo_all_and_sth::*; +pub use utxo_groups_without_amount::*; +pub use utxo_groups_without_amount_or_type::*; diff --git a/crates/brk_cohort/src/loss.rs b/crates/brk_cohort/src/loss.rs index ea11fda1b..db5d9f1ca 100644 --- a/crates/brk_cohort/src/loss.rs +++ b/crates/brk_cohort/src/loss.rs @@ -1,5 +1,6 @@ use brk_traversable::Traversable; use rayon::prelude::*; +use schemars::JsonSchema; use serde::Serialize; use super::CohortName; @@ -29,7 +30,7 @@ impl Loss { /// 9 "at least X% loss" aggregate thresholds. /// /// Each is a suffix sum over the profitability ranges, from most loss-making up. -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct Loss { pub all: T, pub _10pct: T, @@ -42,6 +43,20 @@ pub struct Loss { pub _80pct: T, } +define_column_id!( + LossId for Loss, version = 1 { + All => all, + Over10Pct => _10pct, + Over20Pct => _20pct, + Over30Pct => _30pct, + Over40Pct => _40pct, + Over50Pct => _50pct, + Over60Pct => _60pct, + Over70Pct => _70pct, + Over80Pct => _80pct, + } +); + impl Loss { pub fn new(mut create: F) -> Self where @@ -79,7 +94,7 @@ impl Loss { }) } - pub fn iter(&self) -> impl Iterator { + pub fn iter(&self) -> impl DoubleEndedIterator + ExactSizeIterator { [ &self.all, &self._10pct, @@ -94,7 +109,7 @@ impl Loss { .into_iter() } - pub fn iter_mut(&mut self) -> impl Iterator { + pub fn iter_mut(&mut self) -> impl DoubleEndedIterator + ExactSizeIterator { [ &mut self.all, &mut self._10pct, diff --git a/crates/brk_cohort/src/over_age.rs b/crates/brk_cohort/src/over_age.rs index a5cd31708..440be7545 100644 --- a/crates/brk_cohort/src/over_age.rs +++ b/crates/brk_cohort/src/over_age.rs @@ -1,5 +1,6 @@ use brk_traversable::Traversable; use rayon::prelude::*; +use schemars::JsonSchema; use serde::Serialize; use super::{ @@ -80,7 +81,7 @@ pub const OVER_AGE_NAMES: OverAge = OverAge { _12y: CohortName::new("over_12y_old", "12y+", "Over 12 Years Old"), }; -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct OverAge { pub _1d: T, pub _1w: T, @@ -104,6 +105,31 @@ pub struct OverAge { pub _12y: T, } +define_column_id!( + OverAgeId for OverAge, version = 1 { + Over1D => _1d, + Over1W => _1w, + Over1M => _1m, + Over2M => _2m, + Over3M => _3m, + Over4M => _4m, + Over5M => _5m, + Over6M => _6m, + Over9M => _9m, + Over1Y => _1y, + Over18M => _18m, + Over2Y => _2y, + Over3Y => _3y, + Over4Y => _4y, + Over5Y => _5y, + Over6Y => _6y, + Over7Y => _7y, + Over8Y => _8y, + Over10Y => _10y, + Over12Y => _12y, + } +); + impl OverAge { pub const fn names() -> &'static Self { &OVER_AGE_NAMES diff --git a/crates/brk_cohort/src/over_amount.rs b/crates/brk_cohort/src/over_amount.rs index ccfc026c8..f5215ee75 100644 --- a/crates/brk_cohort/src/over_amount.rs +++ b/crates/brk_cohort/src/over_amount.rs @@ -1,6 +1,7 @@ use brk_traversable::Traversable; use brk_types::Sats; use rayon::prelude::*; +use schemars::JsonSchema; use serde::Serialize; use super::{AmountFilter, CohortName, Filter}; @@ -70,7 +71,7 @@ pub const OVER_AMOUNT_FILTERS: OverAmount = OverAmount { )), }; -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct OverAmount { pub _1sat: T, pub _10sats: T, @@ -87,6 +88,24 @@ pub struct OverAmount { pub _10k_btc: T, } +define_column_id!( + OverAmountId for OverAmount, version = 1 { + Over1Sat => _1sat, + Over10Sats => _10sats, + Over100Sats => _100sats, + Over1KSats => _1k_sats, + Over10KSats => _10k_sats, + Over100KSats => _100k_sats, + Over1MSats => _1m_sats, + Over10MSats => _10m_sats, + Over1Btc => _1btc, + Over10Btc => _10btc, + Over100Btc => _100btc, + Over1KBtc => _1k_btc, + Over10KBtc => _10k_btc, + } +); + impl OverAmount { pub const fn names() -> &'static Self { &OVER_AMOUNT_NAMES diff --git a/crates/brk_cohort/src/profit.rs b/crates/brk_cohort/src/profit.rs index abe481743..a2341eed3 100644 --- a/crates/brk_cohort/src/profit.rs +++ b/crates/brk_cohort/src/profit.rs @@ -1,5 +1,6 @@ use brk_traversable::Traversable; use rayon::prelude::*; +use schemars::JsonSchema; use serde::Serialize; use super::CohortName; @@ -50,7 +51,7 @@ impl Profit { /// 14 "at least X% profit" aggregate thresholds. /// /// Each is a prefix sum over the profitability ranges, from most profitable down. -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct Profit { pub all: T, pub _10pct: T, @@ -68,6 +69,25 @@ pub struct Profit { pub _500pct: T, } +define_column_id!( + ProfitId for Profit, version = 1 { + All => all, + Over10Pct => _10pct, + Over20Pct => _20pct, + Over30Pct => _30pct, + Over40Pct => _40pct, + Over50Pct => _50pct, + Over60Pct => _60pct, + Over70Pct => _70pct, + Over80Pct => _80pct, + Over90Pct => _90pct, + Over100Pct => _100pct, + Over200Pct => _200pct, + Over300Pct => _300pct, + Over500Pct => _500pct, + } +); + impl Profit { pub fn new(mut create: F) -> Self where @@ -115,7 +135,7 @@ impl Profit { }) } - pub fn iter(&self) -> impl Iterator { + pub fn iter(&self) -> impl DoubleEndedIterator + ExactSizeIterator { [ &self.all, &self._10pct, @@ -135,7 +155,7 @@ impl Profit { .into_iter() } - pub fn iter_mut(&mut self) -> impl Iterator { + pub fn iter_mut(&mut self) -> impl DoubleEndedIterator + ExactSizeIterator { [ &mut self.all, &mut self._10pct, diff --git a/crates/brk_cohort/src/profitability.rs b/crates/brk_cohort/src/profitability.rs index d3c40ad3e..b280ab49f 100644 --- a/crates/brk_cohort/src/profitability.rs +++ b/crates/brk_cohort/src/profitability.rs @@ -1,43 +1,41 @@ use std::{fmt, ops::AddAssign}; +use brk_traversable::Traversable; use schemars::JsonSchema; use serde::Serialize; use vecdb::{ColumnId, Formattable, VecValue, Version}; use crate::{ - LOSS_COUNT, Loss, PROFIT_COUNT, PROFITABILITY_RANGE_COUNT, Profit, ProfitabilityRange, + LOSS_COUNT, Loss, LossId, PROFIT_COUNT, PROFITABILITY_RANGE_COUNT, Profit, ProfitId, + ProfitabilityRange, ProfitabilityRangeId, }; pub const PROFITABILITY_COUNT: usize = PROFITABILITY_RANGE_COUNT + PROFIT_COUNT + LOSS_COUNT; -#[derive(Debug, Clone, Serialize, JsonSchema)] +#[derive(Debug, Clone, Traversable, Serialize, JsonSchema)] pub struct ProfitabilityRow { - pub range: [T; PROFITABILITY_RANGE_COUNT], - pub profit: [T; PROFIT_COUNT], - pub loss: [T; LOSS_COUNT], + pub range: ProfitabilityRange, + pub profit: Profit, + pub loss: Loss, } impl ProfitabilityRow where T: AddAssign + Copy + Default, { - pub fn from_ranges(range: [T; PROFITABILITY_RANGE_COUNT]) -> Self { - let (profit_ranges, loss_ranges) = range.split_at(PROFIT_COUNT + 1); - - let mut profit = [T::default(); PROFIT_COUNT]; - let mut total = profit_ranges[0]; - for (threshold, &value) in profit.iter_mut().rev().zip(&profit_ranges[1..]) { + pub fn from_ranges(range: ProfitabilityRange) -> Self { + let mut profit = Profit::default(); + let mut profit_ranges = range.iter().take(PROFIT_COUNT + 1); + let mut total = *profit_ranges.next().expect("profitability profit range"); + for (threshold, &value) in profit.iter_mut().rev().zip(profit_ranges) { total += value; *threshold = total; } - let mut loss = [T::default(); LOSS_COUNT]; - let mut total = loss_ranges[loss_ranges.len() - 1]; - for (threshold, &value) in loss - .iter_mut() - .rev() - .zip(loss_ranges[..loss_ranges.len() - 1].iter().rev()) - { + let mut loss = Loss::default(); + let mut loss_ranges = range.iter().skip(PROFIT_COUNT + 1).rev(); + let mut total = *loss_ranges.next().expect("profitability loss range"); + for (threshold, &value) in loss.iter_mut().rev().zip(loss_ranges) { total += value; *threshold = total; } @@ -53,11 +51,11 @@ where impl Formattable for ProfitabilityRow { fn write_to(&self, buf: &mut Vec) { buf.extend_from_slice(b"{\"range\":"); - self.range.write_to(buf); + write_array(self.range.iter(), buf); buf.extend_from_slice(b",\"profit\":"); - self.profit.write_to(buf); + write_array(self.profit.iter(), buf); buf.extend_from_slice(b",\"loss\":"); - self.loss.write_to(buf); + write_array(self.loss.iter(), buf); buf.push(b'}'); } @@ -78,6 +76,17 @@ impl Formattable for ProfitabilityRow { } } +fn write_array<'a, T: Formattable + 'a>(values: impl Iterator, buf: &mut Vec) { + buf.push(b'['); + for (index, value) in values.enumerate() { + if index > 0 { + buf.push(b','); + } + value.write_to(buf); + } + buf.push(b']'); +} + /// Every profitability range and aggregate threshold in column storage order. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(u8)] @@ -184,6 +193,14 @@ pub const PROFITABILITY_IDS: [ProfitabilityId; PROFITABILITY_COUNT] = [ ]; impl ProfitabilityId { + pub fn series(mut create: impl FnMut(Self, &'static str) -> T) -> ProfitabilityRow { + ProfitabilityRow { + range: Self::range_series(&mut create), + profit: Self::profit_series(&mut create), + loss: Self::loss_series(create), + } + } + pub fn range_ids() -> &'static [Self] { &PROFITABILITY_IDS[..PROFITABILITY_RANGE_COUNT] } @@ -196,6 +213,18 @@ impl ProfitabilityId { &PROFITABILITY_IDS[PROFITABILITY_RANGE_COUNT + PROFIT_COUNT..] } + pub fn ranges(self) -> &'static [ProfitabilityRangeId] { + match self.group() { + ProfitabilityGroupId::Range(id) => &ProfitabilityRangeId::ALL[id.index()..=id.index()], + ProfitabilityGroupId::Profit(id) => { + &ProfitabilityRangeId::ALL[..PROFIT_COUNT + 1 - id.index()] + } + ProfitabilityGroupId::Loss(id) => { + &ProfitabilityRangeId::ALL[PROFIT_COUNT + 1 + id.index()..] + } + } + } + pub fn range_series( mut create: impl FnMut(Self, &'static str) -> T, ) -> ProfitabilityRange { @@ -348,13 +377,84 @@ impl ProfitabilityId { } } +enum ProfitabilityGroupId { + Range(ProfitabilityRangeId), + Profit(ProfitId), + Loss(LossId), +} + +impl ProfitabilityId { + const fn group(self) -> ProfitabilityGroupId { + use ProfitabilityGroupId::{Loss, Profit, Range}; + + match self { + Self::RangeOver1000PctInProfit => Range(ProfitabilityRangeId::Over1000PctInProfit), + Self::Range500To1000PctInProfit => { + Range(ProfitabilityRangeId::From500PctTo1000PctInProfit) + } + Self::Range300To500PctInProfit => { + Range(ProfitabilityRangeId::From300PctTo500PctInProfit) + } + Self::Range200To300PctInProfit => { + Range(ProfitabilityRangeId::From200PctTo300PctInProfit) + } + Self::Range100To200PctInProfit => { + Range(ProfitabilityRangeId::From100PctTo200PctInProfit) + } + Self::Range90To100PctInProfit => Range(ProfitabilityRangeId::From90PctTo100PctInProfit), + Self::Range80To90PctInProfit => Range(ProfitabilityRangeId::From80PctTo90PctInProfit), + Self::Range70To80PctInProfit => Range(ProfitabilityRangeId::From70PctTo80PctInProfit), + Self::Range60To70PctInProfit => Range(ProfitabilityRangeId::From60PctTo70PctInProfit), + Self::Range50To60PctInProfit => Range(ProfitabilityRangeId::From50PctTo60PctInProfit), + Self::Range40To50PctInProfit => Range(ProfitabilityRangeId::From40PctTo50PctInProfit), + Self::Range30To40PctInProfit => Range(ProfitabilityRangeId::From30PctTo40PctInProfit), + Self::Range20To30PctInProfit => Range(ProfitabilityRangeId::From20PctTo30PctInProfit), + Self::Range10To20PctInProfit => Range(ProfitabilityRangeId::From10PctTo20PctInProfit), + Self::Range0To10PctInProfit => Range(ProfitabilityRangeId::From0PctTo10PctInProfit), + Self::Range0To10PctInLoss => Range(ProfitabilityRangeId::From0PctTo10PctInLoss), + Self::Range10To20PctInLoss => Range(ProfitabilityRangeId::From10PctTo20PctInLoss), + Self::Range20To30PctInLoss => Range(ProfitabilityRangeId::From20PctTo30PctInLoss), + Self::Range30To40PctInLoss => Range(ProfitabilityRangeId::From30PctTo40PctInLoss), + Self::Range40To50PctInLoss => Range(ProfitabilityRangeId::From40PctTo50PctInLoss), + Self::Range50To60PctInLoss => Range(ProfitabilityRangeId::From50PctTo60PctInLoss), + Self::Range60To70PctInLoss => Range(ProfitabilityRangeId::From60PctTo70PctInLoss), + Self::Range70To80PctInLoss => Range(ProfitabilityRangeId::From70PctTo80PctInLoss), + Self::Range80To90PctInLoss => Range(ProfitabilityRangeId::From80PctTo90PctInLoss), + Self::Range90To100PctInLoss => Range(ProfitabilityRangeId::From90PctTo100PctInLoss), + Self::Profit => Profit(ProfitId::All), + Self::ProfitOver10Pct => Profit(ProfitId::Over10Pct), + Self::ProfitOver20Pct => Profit(ProfitId::Over20Pct), + Self::ProfitOver30Pct => Profit(ProfitId::Over30Pct), + Self::ProfitOver40Pct => Profit(ProfitId::Over40Pct), + Self::ProfitOver50Pct => Profit(ProfitId::Over50Pct), + Self::ProfitOver60Pct => Profit(ProfitId::Over60Pct), + Self::ProfitOver70Pct => Profit(ProfitId::Over70Pct), + Self::ProfitOver80Pct => Profit(ProfitId::Over80Pct), + Self::ProfitOver90Pct => Profit(ProfitId::Over90Pct), + Self::ProfitOver100Pct => Profit(ProfitId::Over100Pct), + Self::ProfitOver200Pct => Profit(ProfitId::Over200Pct), + Self::ProfitOver300Pct => Profit(ProfitId::Over300Pct), + Self::ProfitOver500Pct => Profit(ProfitId::Over500Pct), + Self::Loss => Loss(LossId::All), + Self::LossOver10Pct => Loss(LossId::Over10Pct), + Self::LossOver20Pct => Loss(LossId::Over20Pct), + Self::LossOver30Pct => Loss(LossId::Over30Pct), + Self::LossOver40Pct => Loss(LossId::Over40Pct), + Self::LossOver50Pct => Loss(LossId::Over50Pct), + Self::LossOver60Pct => Loss(LossId::Over60Pct), + Self::LossOver70Pct => Loss(LossId::Over70Pct), + Self::LossOver80Pct => Loss(LossId::Over80Pct), + } + } +} + impl ColumnId for ProfitabilityId { type Row = ProfitabilityRow where T: VecValue; - const VERSION: Version = Version::ONE; + const VERSION: Version = Version::TWO; const ALL: &'static [Self] = &PROFITABILITY_IDS; #[inline] @@ -364,25 +464,19 @@ impl ColumnId for ProfitabilityId { #[inline] fn get(self, row: &Self::Row) -> &T { - let index = self as usize; - if index < PROFITABILITY_RANGE_COUNT { - &row.range[index] - } else if index < PROFITABILITY_RANGE_COUNT + PROFIT_COUNT { - &row.profit[index - PROFITABILITY_RANGE_COUNT] - } else { - &row.loss[index - PROFITABILITY_RANGE_COUNT - PROFIT_COUNT] + match self.group() { + ProfitabilityGroupId::Range(id) => id.get(&row.range), + ProfitabilityGroupId::Profit(id) => id.get(&row.profit), + ProfitabilityGroupId::Loss(id) => id.get(&row.loss), } } #[inline] fn get_mut(self, row: &mut Self::Row) -> &mut T { - let index = self as usize; - if index < PROFITABILITY_RANGE_COUNT { - &mut row.range[index] - } else if index < PROFITABILITY_RANGE_COUNT + PROFIT_COUNT { - &mut row.profit[index - PROFITABILITY_RANGE_COUNT] - } else { - &mut row.loss[index - PROFITABILITY_RANGE_COUNT - PROFIT_COUNT] + match self.group() { + ProfitabilityGroupId::Range(id) => id.get_mut(&mut row.range), + ProfitabilityGroupId::Profit(id) => id.get_mut(&mut row.profit), + ProfitabilityGroupId::Loss(id) => id.get_mut(&mut row.loss), } } @@ -392,15 +486,7 @@ impl ColumnId for ProfitabilityId { T: VecValue, F: FnMut(Self) -> T, { - ProfitabilityRow { - range: std::array::from_fn(|index| f(PROFITABILITY_IDS[index])), - profit: std::array::from_fn(|index| { - f(PROFITABILITY_IDS[PROFITABILITY_RANGE_COUNT + index]) - }), - loss: std::array::from_fn(|index| { - f(PROFITABILITY_IDS[PROFITABILITY_RANGE_COUNT + PROFIT_COUNT + index]) - }), - } + Self::series(|id, _| f(id)) } #[inline] @@ -411,9 +497,9 @@ impl ColumnId for ProfitabilityId { F: FnMut(T) -> U, { ProfitabilityRow { - range: row.range.map(&mut f), - profit: row.profit.map(&mut f), - loss: row.loss.map(f), + range: ProfitabilityRangeId::map(row.range, &mut f), + profit: ProfitId::map(row.profit, &mut f), + loss: LossId::map(row.loss, f), } } } @@ -456,24 +542,43 @@ mod tests { #[test] fn rows_expand_ranges_into_profit_prefixes_and_loss_suffixes() { - let ranges = std::array::from_fn(|index| index + 1); - let row = ProfitabilityRow::from_ranges(ranges); + let ranges = ProfitabilityRangeId::from_fn(|id| id.index() + 1); + let row = ProfitabilityRow::from_ranges(ranges.clone()); assert_eq!( - row.profit[0], - ranges[..PROFIT_COUNT + 1].iter().copied().sum::() - ); - assert_eq!(row.profit[PROFIT_COUNT - 1], ranges[0] + ranges[1]); - assert_eq!( - row.loss[0], - ranges[PROFIT_COUNT + 1..].iter().copied().sum::() + row.profit.all, + ranges.iter().take(PROFIT_COUNT + 1).copied().sum::() ); assert_eq!( - row.loss[LOSS_COUNT - 1], - ranges[PROFITABILITY_RANGE_COUNT - 2..] - .iter() - .copied() - .sum::() + row.profit._500pct, + ranges.over_1000pct_in_profit + ranges._500pct_to_1000pct_in_profit + ); + assert_eq!( + row.loss.all, + ranges.iter().skip(PROFIT_COUNT + 1).copied().sum::() + ); + assert_eq!( + row.loss._80pct, + ranges.iter().rev().take(2).copied().sum::() ); } + + #[test] + fn aggregate_ids_select_their_exact_ranges() { + for &id in ProfitabilityId::range_ids() { + assert_eq!(id.ranges().len(), 1); + } + for (threshold, &id) in ProfitabilityId::profit_ids().iter().enumerate() { + assert_eq!( + id.ranges(), + &ProfitabilityRangeId::ALL[..PROFIT_COUNT + 1 - threshold] + ); + } + for (threshold, &id) in ProfitabilityId::loss_ids().iter().enumerate() { + assert_eq!( + id.ranges(), + &ProfitabilityRangeId::ALL[PROFIT_COUNT + 1 + threshold..] + ); + } + } } diff --git a/crates/brk_cohort/src/profitability_range.rs b/crates/brk_cohort/src/profitability_range.rs index 944962a9e..a104e842e 100644 --- a/crates/brk_cohort/src/profitability_range.rs +++ b/crates/brk_cohort/src/profitability_range.rs @@ -1,9 +1,10 @@ use brk_traversable::Traversable; use brk_types::Cents; use rayon::prelude::*; +use schemars::JsonSchema; use serde::Serialize; -use super::CohortName; +use super::{CohortName, PROFIT_COUNT}; /// Number of profitability range boundaries (24 boundaries → 25 buckets). pub const PROFITABILITY_BOUNDARY_COUNT: usize = 24; @@ -220,7 +221,7 @@ impl ProfitabilityRange { /// /// During the k-way merge (ascending price order), the cursor starts at bucket 0 /// (over_1000pct_in_profit, lowest cost basis) and advances as price crosses each boundary. -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct ProfitabilityRange { pub over_1000pct_in_profit: T, pub _500pct_to_1000pct_in_profit: T, @@ -249,6 +250,42 @@ pub struct ProfitabilityRange { pub _90pct_to_100pct_in_loss: T, } +define_column_id!( + ProfitabilityRangeId for ProfitabilityRange, version = 1 { + Over1000PctInProfit => over_1000pct_in_profit, + From500PctTo1000PctInProfit => _500pct_to_1000pct_in_profit, + From300PctTo500PctInProfit => _300pct_to_500pct_in_profit, + From200PctTo300PctInProfit => _200pct_to_300pct_in_profit, + From100PctTo200PctInProfit => _100pct_to_200pct_in_profit, + From90PctTo100PctInProfit => _90pct_to_100pct_in_profit, + From80PctTo90PctInProfit => _80pct_to_90pct_in_profit, + From70PctTo80PctInProfit => _70pct_to_80pct_in_profit, + From60PctTo70PctInProfit => _60pct_to_70pct_in_profit, + From50PctTo60PctInProfit => _50pct_to_60pct_in_profit, + From40PctTo50PctInProfit => _40pct_to_50pct_in_profit, + From30PctTo40PctInProfit => _30pct_to_40pct_in_profit, + From20PctTo30PctInProfit => _20pct_to_30pct_in_profit, + From10PctTo20PctInProfit => _10pct_to_20pct_in_profit, + From0PctTo10PctInProfit => _0pct_to_10pct_in_profit, + From0PctTo10PctInLoss => _0pct_to_10pct_in_loss, + From10PctTo20PctInLoss => _10pct_to_20pct_in_loss, + From20PctTo30PctInLoss => _20pct_to_30pct_in_loss, + From30PctTo40PctInLoss => _30pct_to_40pct_in_loss, + From40PctTo50PctInLoss => _40pct_to_50pct_in_loss, + From50PctTo60PctInLoss => _50pct_to_60pct_in_loss, + From60PctTo70PctInLoss => _60pct_to_70pct_in_loss, + From70PctTo80PctInLoss => _70pct_to_80pct_in_loss, + From80PctTo90PctInLoss => _80pct_to_90pct_in_loss, + From90PctTo100PctInLoss => _90pct_to_100pct_in_loss, + } +); + +impl ProfitabilityRangeId { + pub const fn is_profit(self) -> bool { + (self as usize) < PROFIT_COUNT + 1 + } +} + /// Number of profitability range buckets. pub const PROFITABILITY_RANGE_COUNT: usize = 25; @@ -321,7 +358,7 @@ impl ProfitabilityRange { }) } - pub fn iter(&self) -> impl Iterator { + pub fn iter(&self) -> impl DoubleEndedIterator + ExactSizeIterator { [ &self.over_1000pct_in_profit, &self._500pct_to_1000pct_in_profit, @@ -352,12 +389,14 @@ impl ProfitabilityRange { .into_iter() } - pub fn iter_mut(&mut self) -> impl Iterator { + pub fn iter_mut(&mut self) -> impl DoubleEndedIterator + ExactSizeIterator { self.iter_mut_with_is_profit().map(|(_, v)| v) } /// Iterate mutably, yielding `(is_profit, &mut T)` for each range. - pub fn iter_mut_with_is_profit(&mut self) -> impl Iterator { + pub fn iter_mut_with_is_profit( + &mut self, + ) -> impl DoubleEndedIterator + ExactSizeIterator { [ (true, &mut self.over_1000pct_in_profit), (true, &mut self._500pct_to_1000pct_in_profit), diff --git a/crates/brk_cohort/src/spendable_type.rs b/crates/brk_cohort/src/spendable_type.rs index df492cd78..82f10f0d0 100644 --- a/crates/brk_cohort/src/spendable_type.rs +++ b/crates/brk_cohort/src/spendable_type.rs @@ -3,6 +3,7 @@ use std::ops::{Add, AddAssign}; use brk_traversable::Traversable; use brk_types::OutputType; use rayon::iter::{IntoParallelIterator, ParallelIterator}; +use schemars::JsonSchema; use serde::Serialize; use vecdb::{ColumnId, VecValue, Version}; @@ -41,6 +42,40 @@ pub const SPENDABLE_TYPE_IDS: [SpendableTypeId; SPENDABLE_TYPE_COUNT] = [ ]; impl SpendableTypeId { + #[inline] + pub fn select(self, row: &SpendableType) -> &T { + match self { + Self::P2PK65 => &row.p2pk65, + Self::P2PK33 => &row.p2pk33, + Self::P2PKH => &row.p2pkh, + Self::P2MS => &row.p2ms, + Self::P2SH => &row.p2sh, + Self::P2WPKH => &row.p2wpkh, + Self::P2WSH => &row.p2wsh, + Self::P2TR => &row.p2tr, + Self::P2A => &row.p2a, + Self::Unknown => &row.unknown, + Self::Empty => &row.empty, + } + } + + #[inline] + pub fn select_mut(self, row: &mut SpendableType) -> &mut T { + match self { + Self::P2PK65 => &mut row.p2pk65, + Self::P2PK33 => &mut row.p2pk33, + Self::P2PKH => &mut row.p2pkh, + Self::P2MS => &mut row.p2ms, + Self::P2SH => &mut row.p2sh, + Self::P2WPKH => &mut row.p2wpkh, + Self::P2WSH => &mut row.p2wsh, + Self::P2TR => &mut row.p2tr, + Self::P2A => &mut row.p2a, + Self::Unknown => &mut row.unknown, + Self::Empty => &mut row.empty, + } + } + pub const fn from_output_type(value: OutputType) -> Option { match value { OutputType::P2PK65 => Some(Self::P2PK65), @@ -77,7 +112,7 @@ impl SpendableTypeId { impl ColumnId for SpendableTypeId { type Row - = [T; SPENDABLE_TYPE_COUNT] + = SpendableType where T: VecValue; @@ -91,12 +126,12 @@ impl ColumnId for SpendableTypeId { #[inline] fn get(self, row: &Self::Row) -> &T { - &row[self as usize] + self.select(row) } #[inline] fn get_mut(self, row: &mut Self::Row) -> &mut T { - &mut row[self as usize] + self.select_mut(row) } #[inline] @@ -105,17 +140,29 @@ impl ColumnId for SpendableTypeId { T: VecValue, F: FnMut(Self) -> T, { - std::array::from_fn(|index| f(SPENDABLE_TYPE_IDS[index])) + SpendableType { + p2pk65: f(Self::P2PK65), + p2pk33: f(Self::P2PK33), + p2pkh: f(Self::P2PKH), + p2ms: f(Self::P2MS), + p2sh: f(Self::P2SH), + p2wpkh: f(Self::P2WPKH), + p2wsh: f(Self::P2WSH), + p2tr: f(Self::P2TR), + p2a: f(Self::P2A), + unknown: f(Self::Unknown), + empty: f(Self::Empty), + } } #[inline] - fn map(row: Self::Row, f: F) -> Self::Row + fn map(row: Self::Row, mut f: F) -> Self::Row where T: VecValue, U: VecValue, F: FnMut(T) -> U, { - row.map(f) + Self::from_fn(|column| f(column.get(&row).clone())) } } @@ -164,7 +211,7 @@ pub const SPENDABLE_TYPE_NAMES: SpendableType = SpendableType { empty: CohortName::new("empty_outputs", "Empty", "Empty Output"), }; -#[derive(Default, Clone, Debug, Traversable, Serialize)] +#[derive(Default, Clone, Debug, Traversable, Serialize, JsonSchema)] pub struct SpendableType { pub p2pk65: T, pub p2pk33: T, @@ -179,6 +226,38 @@ pub struct SpendableType { pub empty: T, } +impl SpendableType { + pub fn from_fn(mut f: impl FnMut(SpendableTypeId) -> T) -> Self { + Self { + p2pk65: f(SpendableTypeId::P2PK65), + p2pk33: f(SpendableTypeId::P2PK33), + p2pkh: f(SpendableTypeId::P2PKH), + p2ms: f(SpendableTypeId::P2MS), + p2sh: f(SpendableTypeId::P2SH), + p2wpkh: f(SpendableTypeId::P2WPKH), + p2wsh: f(SpendableTypeId::P2WSH), + p2tr: f(SpendableTypeId::P2TR), + p2a: f(SpendableTypeId::P2A), + unknown: f(SpendableTypeId::Unknown), + empty: f(SpendableTypeId::Empty), + } + } +} + +impl_column_row_formattable!(SpendableType { + p2pk65, + p2pk33, + p2pkh, + p2ms, + p2sh, + p2wpkh, + p2wsh, + p2tr, + p2a, + unknown, + empty, +}); + impl SpendableType { pub const fn names() -> &'static Self { &SPENDABLE_TYPE_NAMES diff --git a/crates/brk_cohort/src/under_age.rs b/crates/brk_cohort/src/under_age.rs index 7e38226f8..ea2400fbe 100644 --- a/crates/brk_cohort/src/under_age.rs +++ b/crates/brk_cohort/src/under_age.rs @@ -1,5 +1,6 @@ use brk_traversable::Traversable; use rayon::prelude::*; +use schemars::JsonSchema; use serde::Serialize; use super::{ @@ -80,7 +81,7 @@ pub const UNDER_AGE_NAMES: UnderAge = UnderAge { _15y: CohortName::new("under_15y_old", "<15y", "Under 15 Years Old"), }; -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct UnderAge { pub _1w: T, pub _1m: T, @@ -104,6 +105,31 @@ pub struct UnderAge { pub _15y: T, } +define_column_id!( + UnderAgeId for UnderAge, version = 1 { + Under1W => _1w, + Under1M => _1m, + Under2M => _2m, + Under3M => _3m, + Under4M => _4m, + Under5M => _5m, + Under6M => _6m, + Under9M => _9m, + Under1Y => _1y, + Under18M => _18m, + Under2Y => _2y, + Under3Y => _3y, + Under4Y => _4y, + Under5Y => _5y, + Under6Y => _6y, + Under7Y => _7y, + Under8Y => _8y, + Under10Y => _10y, + Under12Y => _12y, + Under15Y => _15y, + } +); + impl UnderAge { pub const fn names() -> &'static Self { &UNDER_AGE_NAMES diff --git a/crates/brk_cohort/src/under_amount.rs b/crates/brk_cohort/src/under_amount.rs index dd487ab8d..e3a54c7c5 100644 --- a/crates/brk_cohort/src/under_amount.rs +++ b/crates/brk_cohort/src/under_amount.rs @@ -1,6 +1,7 @@ use brk_traversable::Traversable; use brk_types::Sats; use rayon::prelude::*; +use schemars::JsonSchema; use serde::Serialize; use super::{AmountFilter, CohortName, Filter}; @@ -56,7 +57,7 @@ pub const UNDER_AMOUNT_FILTERS: UnderAmount = UnderAmount { _100k_btc: Filter::Amount(AmountFilter::LowerThan(UNDER_AMOUNT_THRESHOLDS._100k_btc)), }; -#[derive(Default, Clone, Traversable, Serialize)] +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] pub struct UnderAmount { pub _10sats: T, pub _100sats: T, @@ -73,6 +74,24 @@ pub struct UnderAmount { pub _100k_btc: T, } +define_column_id!( + UnderAmountId for UnderAmount, version = 1 { + Under10Sats => _10sats, + Under100Sats => _100sats, + Under1KSats => _1k_sats, + Under10KSats => _10k_sats, + Under100KSats => _100k_sats, + Under1MSats => _1m_sats, + Under10MSats => _10m_sats, + Under1Btc => _1btc, + Under10Btc => _10btc, + Under100Btc => _100btc, + Under1KBtc => _1k_btc, + Under10KBtc => _10k_btc, + Under100KBtc => _100k_btc, + } +); + impl UnderAmount { pub const fn names() -> &'static Self { &UNDER_AMOUNT_NAMES diff --git a/crates/brk_cohort/src/utxo.rs b/crates/brk_cohort/src/utxo.rs index 875e9b8f1..fab1782ec 100644 --- a/crates/brk_cohort/src/utxo.rs +++ b/crates/brk_cohort/src/utxo.rs @@ -2,51 +2,113 @@ use brk_traversable::Traversable; use rayon::prelude::*; use crate::{ - AgeRange, AmountRange, ByEntry, ByEpoch, ByTerm, Class, CohortName, Filter, OverAge, - OverAmount, SpendableType, TERM_NAMES, UnderAge, UnderAmount, + Amount, ByAge, ByEntry, ByEpoch, ByTerm, CLASS_FILTERS, CLASS_NAMES, Class, ClassId, + ENTRY_FILTERS, ENTRY_NAMES, EPOCH_FILTERS, EPOCH_NAMES, EntryId, EpochId, Filter, + SPENDABLE_TYPE_FILTERS, SPENDABLE_TYPE_NAMES, SpendableType, TERM_FILTERS, TERM_NAMES, }; - -/// Canonical name for the aggregate cohort containing every UTXO. -pub const UTXO_ALL_NAME: CohortName = CohortName::new("all", "All", "All UTXOs"); - -/// Canonical names for the aggregate UTXO cohorts. -pub const UTXO_AGGREGATE_NAMES: [CohortName; 3] = - [UTXO_ALL_NAME, TERM_NAMES.short, TERM_NAMES.long]; +use vecdb::ColumnId; #[derive(Default, Clone, Traversable)] pub struct UTXOGroups { pub all: T, - pub age_range: AgeRange, + pub age: ByAge, pub epoch: ByEpoch, pub class: Class, pub entry: ByEntry, - pub over_age: OverAge, - pub over_amount: OverAmount, - pub amount_range: AmountRange, + pub utxo_amount: Amount, pub term: ByTerm, + #[traversable(rename = "type")] pub type_: SpendableType, - pub under_age: UnderAge, - pub under_amount: UnderAmount, } impl UTXOGroups { + pub fn get(&self, filter: &Filter) -> Option<&T> { + match filter { + Filter::All => Some(&self.all), + Filter::Term(term) => match term { + crate::Term::Sth => Some(&self.term.short), + crate::Term::Lth => Some(&self.term.long), + }, + Filter::Time(_) => self.age.get(filter), + Filter::Amount(_) => self.utxo_amount.get(filter), + Filter::Epoch(_) => EpochId::ALL + .iter() + .copied() + .find(|id| id.select(&EPOCH_FILTERS) == filter) + .map(|id| id.select(&self.epoch)), + Filter::Class(_) => ClassId::ALL + .iter() + .copied() + .find(|id| id.select(&CLASS_FILTERS) == filter) + .map(|id| id.select(&self.class)), + Filter::Entry(_) => EntryId::ALL + .iter() + .copied() + .find(|id| id.select(&ENTRY_FILTERS) == filter) + .map(|id| id.select(&self.entry)), + Filter::Type(output_type) => Some(self.type_.get(*output_type)), + } + } + + pub fn map_named( + &self, + mut map: impl FnMut(&Filter, &'static str, &T) -> U, + ) -> UTXOGroups { + UTXOGroups { + all: map(&Filter::All, "", &self.all), + age: self.age.map_named(&mut map), + epoch: ByEpoch::from_fn(|id| { + map( + id.select(&EPOCH_FILTERS), + id.select(&EPOCH_NAMES).id, + id.select(&self.epoch), + ) + }), + class: Class::from_fn(|id| { + map( + id.select(&CLASS_FILTERS), + id.select(&CLASS_NAMES).id, + id.select(&self.class), + ) + }), + entry: ByEntry::from_fn(|id| { + map( + id.select(&ENTRY_FILTERS), + id.select(&ENTRY_NAMES).id, + id.select(&self.entry), + ) + }), + utxo_amount: self.utxo_amount.map_named(&mut map), + term: ByTerm::from_fn(|id| { + map( + id.select(&TERM_FILTERS), + id.select(&TERM_NAMES).id, + id.select(&self.term), + ) + }), + type_: SpendableType::from_fn(|id| { + map( + id.select(&SPENDABLE_TYPE_FILTERS), + id.select(&SPENDABLE_TYPE_NAMES).id, + id.select(&self.type_), + ) + }), + } + } + pub fn new(mut create: F) -> Self where F: FnMut(Filter, &'static str) -> T, { Self { all: create(Filter::All, ""), - age_range: AgeRange::new(&mut create), + age: ByAge::new(&mut create), epoch: ByEpoch::new(&mut create), class: Class::new(&mut create), entry: ByEntry::new(&mut create), - over_age: OverAge::new(&mut create), - over_amount: OverAmount::new(&mut create), - amount_range: AmountRange::new(&mut create), + utxo_amount: Amount::new(&mut create), term: ByTerm::new(&mut create), type_: SpendableType::new(&mut create), - under_age: UnderAge::new(&mut create), - under_amount: UnderAmount::new(&mut create), } } @@ -54,15 +116,13 @@ impl UTXOGroups { [&self.all] .into_iter() .chain(self.term.iter()) - .chain(self.under_age.iter()) - .chain(self.over_age.iter()) - .chain(self.over_amount.iter()) - .chain(self.age_range.iter()) + .chain(self.age.under.iter()) + .chain(self.age.over.iter()) + .chain(self.utxo_amount.iter()) + .chain(self.age.range.iter()) .chain(self.epoch.iter()) .chain(self.class.iter()) .chain(self.entry.iter()) - .chain(self.amount_range.iter()) - .chain(self.under_amount.iter()) .chain(self.type_.iter()) } @@ -70,15 +130,13 @@ impl UTXOGroups { [&mut self.all] .into_iter() .chain(self.term.iter_mut()) - .chain(self.under_age.iter_mut()) - .chain(self.over_age.iter_mut()) - .chain(self.over_amount.iter_mut()) - .chain(self.age_range.iter_mut()) + .chain(self.age.under.iter_mut()) + .chain(self.age.over.iter_mut()) + .chain(self.utxo_amount.iter_mut()) + .chain(self.age.range.iter_mut()) .chain(self.epoch.iter_mut()) .chain(self.class.iter_mut()) .chain(self.entry.iter_mut()) - .chain(self.amount_range.iter_mut()) - .chain(self.under_amount.iter_mut()) .chain(self.type_.iter_mut()) } @@ -89,35 +147,35 @@ impl UTXOGroups { [&mut self.all] .into_par_iter() .chain(self.term.par_iter_mut()) - .chain(self.under_age.par_iter_mut()) - .chain(self.over_age.par_iter_mut()) - .chain(self.over_amount.par_iter_mut()) - .chain(self.age_range.par_iter_mut()) + .chain(self.age.under.par_iter_mut()) + .chain(self.age.over.par_iter_mut()) + .chain(self.utxo_amount.par_iter_mut()) + .chain(self.age.range.par_iter_mut()) .chain(self.epoch.par_iter_mut()) .chain(self.class.par_iter_mut()) .chain(self.entry.par_iter_mut()) - .chain(self.amount_range.par_iter_mut()) - .chain(self.under_amount.par_iter_mut()) .chain(self.type_.par_iter_mut()) } pub fn iter_separate(&self) -> impl Iterator { - self.age_range + self.age + .range .iter() .chain(self.epoch.iter()) .chain(self.class.iter()) .chain(self.entry.iter()) - .chain(self.amount_range.iter()) + .chain(self.utxo_amount.range.iter()) .chain(self.type_.iter()) } pub fn iter_separate_mut(&mut self) -> impl Iterator { - self.age_range + self.age + .range .iter_mut() .chain(self.epoch.iter_mut()) .chain(self.class.iter_mut()) .chain(self.entry.iter_mut()) - .chain(self.amount_range.iter_mut()) + .chain(self.utxo_amount.range.iter_mut()) .chain(self.type_.iter_mut()) } @@ -125,12 +183,13 @@ impl UTXOGroups { where T: Send + Sync, { - self.age_range + self.age + .range .par_iter_mut() .chain(self.epoch.par_iter_mut()) .chain(self.class.par_iter_mut()) .chain(self.entry.par_iter_mut()) - .chain(self.amount_range.par_iter_mut()) + .chain(self.utxo_amount.range.par_iter_mut()) .chain(self.type_.par_iter_mut()) } @@ -138,10 +197,10 @@ impl UTXOGroups { [&mut self.all] .into_iter() .chain(self.term.iter_mut()) - .chain(self.under_age.iter_mut()) - .chain(self.over_age.iter_mut()) - .chain(self.under_amount.iter_mut()) - .chain(self.over_amount.iter_mut()) + .chain(self.age.under.iter_mut()) + .chain(self.age.over.iter_mut()) + .chain(self.utxo_amount.under.iter_mut()) + .chain(self.utxo_amount.over.iter_mut()) } /// Iterator over aggregate cohorts (all, sth, lth) that compute values from sub-cohorts. diff --git a/crates/brk_cohort/src/utxo_aggregate.rs b/crates/brk_cohort/src/utxo_aggregate.rs new file mode 100644 index 000000000..dc0b0c1f7 --- /dev/null +++ b/crates/brk_cohort/src/utxo_aggregate.rs @@ -0,0 +1,98 @@ +use brk_traversable::Traversable; +use schemars::JsonSchema; +use serde::Serialize; + +use crate::{CohortName, Filter, TERM_FILTERS, TERM_NAMES, TermId}; + +/// Canonical name for the aggregate cohort containing every UTXO. +pub const UTXO_ALL_NAME: CohortName = CohortName::new("all", "All", "All UTXOs"); + +pub const UTXO_AGGREGATE_FILTERS: UTXOAggregate = UTXOAggregate { + all: Filter::All, + sth: TERM_FILTERS.short, + lth: TERM_FILTERS.long, +}; + +/// Canonical names for the aggregate UTXO cohorts. +pub const UTXO_AGGREGATE_NAMES: UTXOAggregate = UTXOAggregate { + all: UTXO_ALL_NAME, + sth: TERM_NAMES.short, + lth: TERM_NAMES.long, +}; + +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] +pub struct UTXOAggregate { + pub all: T, + pub sth: T, + pub lth: T, +} + +define_column_id!( + UTXOAggregateId for UTXOAggregate, version = 1 { + All => all, + Sth => sth, + Lth => lth, + } +); + +impl UTXOAggregateId { + pub const fn cohort_name(self) -> CohortName { + match self { + Self::All => UTXO_AGGREGATE_NAMES.all, + Self::Sth => UTXO_AGGREGATE_NAMES.sth, + Self::Lth => UTXO_AGGREGATE_NAMES.lth, + } + } + + pub const fn term(self) -> Option { + match self { + Self::All => None, + Self::Sth => Some(TermId::Short), + Self::Lth => Some(TermId::Long), + } + } +} + +impl UTXOAggregate { + pub fn map(&self, mut f: impl FnMut(&T) -> U) -> UTXOAggregate { + UTXOAggregate { + all: f(&self.all), + sth: f(&self.sth), + lth: f(&self.lth), + } + } + + pub fn try_from_fn(mut f: impl FnMut(UTXOAggregateId) -> Result) -> Result { + Ok(Self { + all: f(UTXOAggregateId::All)?, + sth: f(UTXOAggregateId::Sth)?, + lth: f(UTXOAggregateId::Lth)?, + }) + } + + pub fn get(&self, filter: &Filter) -> Option<&T> { + match filter { + Filter::All => Some(&self.all), + Filter::Term(crate::Term::Sth) => Some(&self.sth), + Filter::Term(crate::Term::Lth) => Some(&self.lth), + _ => None, + } + } + + pub fn get_mut(&mut self, filter: &Filter) -> Option<&mut T> { + match filter { + Filter::All => Some(&mut self.all), + Filter::Term(crate::Term::Sth) => Some(&mut self.sth), + Filter::Term(crate::Term::Lth) => Some(&mut self.lth), + _ => None, + } + } + + pub fn iter(&self) -> impl Iterator { + [&self.all, &self.sth, &self.lth].into_iter() + } + + pub fn iter_mut(&mut self) -> impl Iterator { + [&mut self.all, &mut self.sth, &mut self.lth].into_iter() + } +} diff --git a/crates/brk_cohort/src/utxo_all_and_sth.rs b/crates/brk_cohort/src/utxo_all_and_sth.rs new file mode 100644 index 000000000..814cf09b7 --- /dev/null +++ b/crates/brk_cohort/src/utxo_all_and_sth.rs @@ -0,0 +1,36 @@ +use brk_traversable::Traversable; +use schemars::JsonSchema; +use serde::Serialize; + +use crate::Filter; + +#[derive(Debug, Default, Clone, Traversable, Serialize, JsonSchema)] +pub struct UTXOAllAndSth { + pub all: T, + pub sth: T, +} + +define_column_id!( + UTXOAllAndSthId for UTXOAllAndSth, version = 1 { + All => all, + Sth => sth, + } +); + +impl UTXOAllAndSth { + pub fn get(&self, filter: &Filter) -> Option<&T> { + match filter { + Filter::All => Some(&self.all), + Filter::Term(crate::Term::Sth) => Some(&self.sth), + _ => None, + } + } + + pub fn iter(&self) -> impl Iterator { + [&self.all, &self.sth].into_iter() + } + + pub fn iter_mut(&mut self) -> impl Iterator { + [&mut self.all, &mut self.sth].into_iter() + } +} diff --git a/crates/brk_cohort/src/utxo_groups_without_amount.rs b/crates/brk_cohort/src/utxo_groups_without_amount.rs new file mode 100644 index 000000000..62677e701 --- /dev/null +++ b/crates/brk_cohort/src/utxo_groups_without_amount.rs @@ -0,0 +1,110 @@ +use brk_traversable::Traversable; +use vecdb::ColumnId; + +use crate::{ + ByAge, ByEntry, ByEpoch, ByTerm, CLASS_FILTERS, CLASS_NAMES, Class, ClassId, ENTRY_FILTERS, + ENTRY_NAMES, EPOCH_FILTERS, EPOCH_NAMES, EntryId, EpochId, Filter, SPENDABLE_TYPE_FILTERS, + SPENDABLE_TYPE_NAMES, SpendableType, TERM_FILTERS, TERM_NAMES, +}; + +#[derive(Default, Clone, Traversable)] +pub struct UTXOGroupsWithoutAmount { + pub all: T, + pub age: ByAge, + pub epoch: ByEpoch, + pub class: Class, + pub entry: ByEntry, + pub term: ByTerm, + #[traversable(rename = "type")] + pub type_: SpendableType, +} + +impl UTXOGroupsWithoutAmount { + pub fn new(mut create: F) -> Self + where + F: FnMut(Filter, &'static str) -> T, + { + Self { + all: create(Filter::All, ""), + age: ByAge::new(&mut create), + epoch: ByEpoch::new(&mut create), + class: Class::new(&mut create), + entry: ByEntry::new(&mut create), + term: ByTerm::new(&mut create), + type_: SpendableType::new(&mut create), + } + } + + pub fn get(&self, filter: &Filter) -> Option<&T> { + match filter { + Filter::All => Some(&self.all), + Filter::Term(term) => match term { + crate::Term::Sth => Some(&self.term.short), + crate::Term::Lth => Some(&self.term.long), + }, + Filter::Time(_) => self.age.get(filter), + Filter::Epoch(_) => EpochId::ALL + .iter() + .copied() + .find(|id| id.select(&EPOCH_FILTERS) == filter) + .map(|id| id.select(&self.epoch)), + Filter::Class(_) => ClassId::ALL + .iter() + .copied() + .find(|id| id.select(&CLASS_FILTERS) == filter) + .map(|id| id.select(&self.class)), + Filter::Entry(_) => EntryId::ALL + .iter() + .copied() + .find(|id| id.select(&ENTRY_FILTERS) == filter) + .map(|id| id.select(&self.entry)), + Filter::Type(output_type) => Some(self.type_.get(*output_type)), + Filter::Amount(_) => None, + } + } + + pub fn map_named( + &self, + mut map: impl FnMut(&Filter, &'static str, &T) -> U, + ) -> UTXOGroupsWithoutAmount { + UTXOGroupsWithoutAmount { + all: map(&Filter::All, "", &self.all), + age: self.age.map_named(&mut map), + epoch: ByEpoch::from_fn(|id| { + map( + id.select(&EPOCH_FILTERS), + id.select(&EPOCH_NAMES).id, + id.select(&self.epoch), + ) + }), + class: Class::from_fn(|id| { + map( + id.select(&CLASS_FILTERS), + id.select(&CLASS_NAMES).id, + id.select(&self.class), + ) + }), + entry: ByEntry::from_fn(|id| { + map( + id.select(&ENTRY_FILTERS), + id.select(&ENTRY_NAMES).id, + id.select(&self.entry), + ) + }), + term: ByTerm::from_fn(|id| { + map( + id.select(&TERM_FILTERS), + id.select(&TERM_NAMES).id, + id.select(&self.term), + ) + }), + type_: SpendableType::from_fn(|id| { + map( + id.select(&SPENDABLE_TYPE_FILTERS), + id.select(&SPENDABLE_TYPE_NAMES).id, + id.select(&self.type_), + ) + }), + } + } +} diff --git a/crates/brk_cohort/src/utxo_groups_without_amount_or_type.rs b/crates/brk_cohort/src/utxo_groups_without_amount_or_type.rs new file mode 100644 index 000000000..18a5d303a --- /dev/null +++ b/crates/brk_cohort/src/utxo_groups_without_amount_or_type.rs @@ -0,0 +1,105 @@ +use brk_traversable::Traversable; +use vecdb::ColumnId; + +use crate::{ + ByAge, ByEntry, ByEpoch, ByTerm, CLASS_FILTERS, CLASS_NAMES, Class, ClassId, ENTRY_FILTERS, + ENTRY_NAMES, EPOCH_FILTERS, EPOCH_NAMES, EntryId, EpochId, Filter, TERM_FILTERS, TERM_NAMES, +}; + +#[derive(Default, Clone, Traversable)] +pub struct UTXOGroupsWithoutAmountOrType { + pub all: T, + pub age: ByAge, + pub epoch: ByEpoch, + pub class: Class, + pub entry: ByEntry, + pub term: ByTerm, +} + +impl UTXOGroupsWithoutAmountOrType { + pub fn new(mut create: F) -> Self + where + F: FnMut(Filter, &'static str) -> T, + { + Self::new_with(&mut create) + } + + pub(crate) fn new_with(create: &mut F) -> Self + where + F: FnMut(Filter, &'static str) -> T, + { + Self { + all: create(Filter::All, ""), + age: ByAge::new(&mut *create), + epoch: ByEpoch::new(&mut *create), + class: Class::new(&mut *create), + entry: ByEntry::new(&mut *create), + term: ByTerm::new(&mut *create), + } + } + + pub fn get(&self, filter: &Filter) -> Option<&T> { + match filter { + Filter::All => Some(&self.all), + Filter::Term(term) => match term { + crate::Term::Sth => Some(&self.term.short), + crate::Term::Lth => Some(&self.term.long), + }, + Filter::Time(_) => self.age.get(filter), + Filter::Epoch(_) => EpochId::ALL + .iter() + .copied() + .find(|id| id.select(&EPOCH_FILTERS) == filter) + .map(|id| id.select(&self.epoch)), + Filter::Class(_) => ClassId::ALL + .iter() + .copied() + .find(|id| id.select(&CLASS_FILTERS) == filter) + .map(|id| id.select(&self.class)), + Filter::Entry(_) => EntryId::ALL + .iter() + .copied() + .find(|id| id.select(&ENTRY_FILTERS) == filter) + .map(|id| id.select(&self.entry)), + Filter::Amount(_) | Filter::Type(_) => None, + } + } + + pub fn map_named( + &self, + mut map: impl FnMut(&Filter, &'static str, &T) -> U, + ) -> UTXOGroupsWithoutAmountOrType { + UTXOGroupsWithoutAmountOrType { + all: map(&Filter::All, "", &self.all), + age: self.age.map_named(&mut map), + epoch: ByEpoch::from_fn(|id| { + map( + id.select(&EPOCH_FILTERS), + id.select(&EPOCH_NAMES).id, + id.select(&self.epoch), + ) + }), + class: Class::from_fn(|id| { + map( + id.select(&CLASS_FILTERS), + id.select(&CLASS_NAMES).id, + id.select(&self.class), + ) + }), + entry: ByEntry::from_fn(|id| { + map( + id.select(&ENTRY_FILTERS), + id.select(&ENTRY_NAMES).id, + id.select(&self.entry), + ) + }), + term: ByTerm::from_fn(|id| { + map( + id.select(&TERM_FILTERS), + id.select(&TERM_NAMES).id, + id.select(&self.term), + ) + }), + } + } +} diff --git a/crates/brk_computer/src/distribution/addr/activity/block_counts.rs b/crates/brk_computer/src/distribution/addr/activity/block_counts.rs new file mode 100644 index 000000000..af15aeda5 --- /dev/null +++ b/crates/brk_computer/src/distribution/addr/activity/block_counts.rs @@ -0,0 +1,21 @@ +/// Per-block activity counts, reset after every block. +#[derive(Debug, Default, Clone)] +pub struct BlockActivityCounts { + pub reactivated: u32, + pub sending: u32, + pub receiving: u32, + pub bidirectional: u32, +} + +impl BlockActivityCounts { + #[inline] + pub(crate) fn reset(&mut self) { + *self = Self::default(); + } + + #[inline(always)] + pub(crate) fn active(&self) -> u32 { + debug_assert!(self.bidirectional <= self.sending.min(self.receiving)); + self.sending + self.receiving - self.bidirectional + } +} diff --git a/crates/brk_computer/src/distribution/addr/activity/by_type.rs b/crates/brk_computer/src/distribution/addr/activity/by_type.rs new file mode 100644 index 000000000..6a17966fa --- /dev/null +++ b/crates/brk_computer/src/distribution/addr/activity/by_type.rs @@ -0,0 +1,56 @@ +use brk_cohort::{AddrTypeId, ByAddrType}; +use brk_types::{StoredU32, StoredU64}; +use derive_more::{Deref, DerefMut}; +use vecdb::ColumnId; + +use super::BlockActivityCounts; + +/// Activity counts accumulated during block processing for each address type. +#[derive(Debug, Default, Deref, DerefMut)] +pub struct AddrTypeToActivityCounts(pub ByAddrType); + +impl AddrTypeToActivityCounts { + pub(crate) fn reset(&mut self) { + self.0.values_mut().for_each(BlockActivityCounts::reset); + } + + pub(crate) fn active(&self) -> u32 { + self.0.values().map(BlockActivityCounts::active).sum() + } + + #[inline(always)] + pub(super) fn row( + &self, + value: impl Fn(&BlockActivityCounts) -> u32, + ) -> ::Row { + AddrTypeId::from_fn(|column| { + StoredU64::from(StoredU32::from(value(column.select(&self.0)))) + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn active_count_sums_distinct_addresses_across_types() { + let counts = AddrTypeToActivityCounts(ByAddrType { + p2pkh: BlockActivityCounts { + sending: 5, + receiving: 4, + bidirectional: 2, + ..BlockActivityCounts::default() + }, + p2tr: BlockActivityCounts { + sending: 3, + receiving: 2, + bidirectional: 1, + ..BlockActivityCounts::default() + }, + ..ByAddrType::default() + }); + + assert_eq!(counts.active(), 11); + } +} diff --git a/crates/brk_computer/src/distribution/addr/activity/mod.rs b/crates/brk_computer/src/distribution/addr/activity/mod.rs new file mode 100644 index 000000000..96ad31498 --- /dev/null +++ b/crates/brk_computer/src/distribution/addr/activity/mod.rs @@ -0,0 +1,7 @@ +mod block_counts; +mod by_type; +mod vecs; + +pub use block_counts::BlockActivityCounts; +pub use by_type::AddrTypeToActivityCounts; +pub use vecs::AddrActivityVecs; diff --git a/crates/brk_computer/src/distribution/addr/activity.rs b/crates/brk_computer/src/distribution/addr/activity/vecs.rs similarity index 59% rename from crates/brk_computer/src/distribution/addr/activity.rs rename to crates/brk_computer/src/distribution/addr/activity/vecs.rs index f39291e80..fcd3fb043 100644 --- a/crates/brk_computer/src/distribution/addr/activity.rs +++ b/crates/brk_computer/src/distribution/addr/activity/vecs.rs @@ -1,12 +1,9 @@ -//! Per-block address activity, split by address type. - -use brk_cohort::{AddrTypeId, ByAddrType}; +use brk_cohort::AddrTypeId; use brk_error::Result; use brk_traversable::Traversable; use brk_types::{StoredU32, StoredU64, Version}; -use derive_more::{Deref, DerefMut}; use rayon::prelude::*; -use vecdb::{AnyStoredVec, AnyVec, ColumnId, Database, ReadOnlyClone, Rw, StorageMode}; +use vecdb::{AnyStoredVec, AnyVec, Database, ReadOnlyClone, Rw, StorageMode}; use crate::{ indexes, @@ -16,68 +13,20 @@ use crate::{ }, }; -/// Per-block activity counts, reset after every block. -#[derive(Debug, Default, Clone)] -pub struct BlockActivityCounts { - pub reactivated: u32, - pub sending: u32, - pub receiving: u32, - pub bidirectional: u32, -} +use super::{AddrTypeToActivityCounts, BlockActivityCounts}; -impl BlockActivityCounts { - #[inline] - pub(crate) fn reset(&mut self) { - *self = Self::default(); - } - - #[inline(always)] - fn active(&self) -> u32 { - debug_assert!(self.bidirectional <= self.sending.min(self.receiving)); - self.sending + self.receiving - self.bidirectional - } -} - -/// Activity counts accumulated during block processing for each address type. -#[derive(Debug, Default, Deref, DerefMut)] -pub struct AddrTypeToActivityCounts(pub ByAddrType); - -impl AddrTypeToActivityCounts { - pub(crate) fn reset(&mut self) { - self.0.values_mut().for_each(BlockActivityCounts::reset); - } - - pub(crate) fn active(&self) -> u32 { - self.0.values().map(BlockActivityCounts::active).sum() - } - - #[inline(always)] - fn row( - &self, - value: impl Fn(&BlockActivityCounts) -> u32, - ) -> ::Row { - AddrTypeId::from_fn(|column| { - StoredU64::from(StoredU32::from(value(column.select(&self.0)))) - }) - } -} - -#[derive(Clone, Traversable)] -pub struct ActivityCountVecs { - pub reactivated: LazyPerBlockCumulativeAverage, - pub sending: LazyPerBlockCumulativeAverage, - pub receiving: LazyPerBlockCumulativeAverage, - pub bidirectional: LazyPerBlockCumulativeAverage, - pub active: LazyPerBlockCumulativeAverage, -} - -/// Five metric-first cumulative matrices with cohort-first public views. -#[derive(Deref, DerefMut, Traversable)] +#[derive(Traversable)] pub struct AddrActivityVecs { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub series: WithAddrTypes, + pub reactivated: + WithAddrTypes>, + pub sending: + WithAddrTypes>, + pub receiving: + WithAddrTypes>, + pub bidirectional: + WithAddrTypes>, + pub active: + WithAddrTypes>, #[traversable(hidden)] cumulative_reactivated: ColumnarPerBlockCumulativeRolling, @@ -166,26 +115,12 @@ impl AddrActivityVecs { cached_starts, ); - let by_addr_type = AddrTypeId::series(|column, _| ActivityCountVecs { - reactivated: column.select(&reactivated.by_addr_type).clone(), - sending: column.select(&sending.by_addr_type).clone(), - receiving: column.select(&receiving.by_addr_type).clone(), - bidirectional: column.select(&bidirectional.by_addr_type).clone(), - active: column.select(&active.by_addr_type).clone(), - }); - let series = WithAddrTypes { - all: ActivityCountVecs { - reactivated: reactivated.all, - sending: sending.all, - receiving: receiving.all, - bidirectional: bidirectional.all, - active: active.all, - }, - by_addr_type, - }; - Ok(Self { - series, + reactivated, + sending, + receiving, + bidirectional, + active, cumulative_reactivated, cumulative_sending, cumulative_receiving, @@ -243,29 +178,3 @@ impl AddrActivityVecs { .push_block(counts.row(BlockActivityCounts::active)); } } - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn active_count_sums_distinct_addresses_across_types() { - let counts = AddrTypeToActivityCounts(ByAddrType { - p2pkh: BlockActivityCounts { - sending: 5, - receiving: 4, - bidirectional: 2, - ..BlockActivityCounts::default() - }, - p2tr: BlockActivityCounts { - sending: 3, - receiving: 2, - bidirectional: 1, - ..BlockActivityCounts::default() - }, - ..ByAddrType::default() - }); - - assert_eq!(counts.active(), 11); - } -} diff --git a/crates/brk_computer/src/distribution/metrics/supply/avg_amount.rs b/crates/brk_computer/src/distribution/addr/avg_amount.rs similarity index 66% rename from crates/brk_computer/src/distribution/metrics/supply/avg_amount.rs rename to crates/brk_computer/src/distribution/addr/avg_amount.rs index 19b642ccb..d44af09c8 100644 --- a/crates/brk_computer/src/distribution/metrics/supply/avg_amount.rs +++ b/crates/brk_computer/src/distribution/addr/avg_amount.rs @@ -2,11 +2,10 @@ use brk_cohort::{AddrTypeId, ByAddrType}; use brk_error::Result; use brk_traversable::Traversable; use brk_types::{Cents, Height, Sats, StoredU64, Version}; -use derive_more::{Deref, DerefMut}; use rayon::prelude::*; use vecdb::{ - AnyStoredVec, CachedBoxedVec, Database, Exit, ReadOnlyClone, ReadableVec, Rw, StorageMode, - WritableVec, + AnyStoredVec, CachedBoxedVec, Database, Exit, ReadOnlyClone, ReadableCloneableVec, ReadableVec, + Rw, StorageMode, WritableVec, }; use crate::{ @@ -17,24 +16,10 @@ use crate::{ }, }; -/// Average amount held per UTXO and per funded address. -/// -/// `utxo = supply / utxo_count`, `addr = supply / funded_addr_count`. -#[derive(Clone, Traversable)] -pub struct AvgAmountMetrics { - pub utxo: V, - pub addr: V, -} - -#[derive(Deref, DerefMut, Traversable)] +#[derive(Traversable)] pub struct AvgAmountVecs { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub series: WithAddrTypes< - AvgAmountMetrics>, - AvgAmountMetrics, - >, + pub utxo: WithAddrTypes, LazySpotValuePerBlock>, + pub addr: WithAddrTypes, LazySpotValuePerBlock>, #[traversable(hidden)] utxo_source: ColumnarPerBlock, #[traversable(hidden)] @@ -48,8 +33,8 @@ impl AvgAmountVecs { indexes: &indexes::Vecs, spot_price: &CachedBoxedVec, all_chain: &AllChainCache, - utxo_count: &(impl vecdb::ReadableCloneableVec + 'static), - funded_addr_count: &(impl vecdb::ReadableCloneableVec + 'static), + utxo_count: &(impl ReadableCloneableVec + 'static), + funded_addr_count: &(impl ReadableCloneableVec + 'static), ) -> Result { let avg_utxo = all_chain.with_supply( "avg_utxo_amount_sats_source", @@ -63,50 +48,54 @@ impl AvgAmountVecs { funded_addr_count, |_, count, supply| supply / count, ); - let all = AvgAmountMetrics { - utxo: LazySpotValuePerBlock::from_sats_source( + let utxo_source = + ColumnarPerBlock::forced_import(db, "avg_utxo_amount_sats_by_type", version, |_| ())?; + let addr_source = + ColumnarPerBlock::forced_import(db, "avg_addr_amount_sats_by_type", version, |_| ())?; + let utxo_columns = utxo_source.height.read_only_clone(); + let addr_columns = addr_source.height.read_only_clone(); + let utxo = WithAddrTypes { + all: LazySpotValuePerBlock::from_sats_source( "avg_utxo_amount", version, avg_utxo, indexes, spot_price, ), - addr: LazySpotValuePerBlock::from_sats_source( + by_addr_type: AddrTypeId::series(|column, type_name| { + LazyColumnSpotValuePerBlock::new( + &format!("{type_name}_avg_utxo_amount"), + version, + &utxo_columns, + column, + indexes, + spot_price, + ) + }), + }; + let addr = WithAddrTypes { + all: LazySpotValuePerBlock::from_sats_source( "avg_addr_amount", version, avg_addr, indexes, spot_price, ), + by_addr_type: AddrTypeId::series(|column, type_name| { + LazyColumnSpotValuePerBlock::new( + &format!("{type_name}_avg_addr_amount"), + version, + &addr_columns, + column, + indexes, + spot_price, + ) + }), }; - let utxo_source = - ColumnarPerBlock::forced_import(db, "avg_utxo_amount_sats_by_type", version, |_| ())?; - let addr_source = - ColumnarPerBlock::forced_import(db, "avg_addr_amount_sats_by_type", version, |_| ())?; - let utxo = utxo_source.height.read_only_clone(); - let addr = addr_source.height.read_only_clone(); - let by_addr_type = AddrTypeId::series(|column, type_name| AvgAmountMetrics { - utxo: LazyColumnSpotValuePerBlock::new( - &format!("{type_name}_avg_utxo_amount"), - version, - &utxo, - column, - indexes, - spot_price, - ), - addr: LazyColumnSpotValuePerBlock::new( - &format!("{type_name}_avg_addr_amount"), - version, - &addr, - column, - indexes, - spot_price, - ), - }); - Ok(Self { - series: WithAddrTypes { all, by_addr_type }, + utxo, + addr, utxo_source, addr_source, }) diff --git a/crates/brk_computer/src/distribution/addr/delta.rs b/crates/brk_computer/src/distribution/addr/count/delta_vecs.rs similarity index 87% rename from crates/brk_computer/src/distribution/addr/delta.rs rename to crates/brk_computer/src/distribution/addr/count/delta_vecs.rs index 816e15a3f..b321c6f94 100644 --- a/crates/brk_computer/src/distribution/addr/delta.rs +++ b/crates/brk_computer/src/distribution/addr/count/delta_vecs.rs @@ -9,10 +9,11 @@ use crate::{ use super::AddrCountsVecs; -type AddrDelta = LazyRollingDeltasFromHeight; - #[derive(Clone, Deref, DerefMut, Traversable)] -pub struct DeltaVecs(#[traversable(flatten)] pub WithAddrTypes); +pub struct DeltaVecs( + #[traversable(flatten)] + pub WithAddrTypes>, +); impl DeltaVecs { pub(crate) fn new( diff --git a/crates/brk_computer/src/distribution/addr/count/funded_vecs.rs b/crates/brk_computer/src/distribution/addr/count/funded_vecs.rs new file mode 100644 index 000000000..c03b1c0b0 --- /dev/null +++ b/crates/brk_computer/src/distribution/addr/count/funded_vecs.rs @@ -0,0 +1,83 @@ +use brk_cohort::{AmountRange, CohortContext}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{PartsPerMillionSigned64, StoredI64, StoredU64, Version}; +use rayon::prelude::*; +use vecdb::{AnyStoredVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::ColumnarAmount, + indexes, + internal::{CachedWindowStartVec, LazyPerBlockWithDeltas, Windows}, +}; + +use super::{AddrCountsVecs, AddrTypeToAddrCount}; + +#[derive(Traversable)] +pub struct FundedAddrCountsVecs { + #[traversable(flatten)] + pub counts: AddrCountsVecs, + pub balance: ColumnarAmount< + StoredU64, + LazyPerBlockWithDeltas, + M, + >, +} + +impl FundedAddrCountsVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + Ok(Self { + counts: AddrCountsVecs::forced_import(db, "addr_count", version, indexes)?, + balance: ColumnarAmount::forced_import( + db, + "addrs_addr_count_by_balance_range", + CohortContext::Addr, + "addr_count", + version + Version::ONE, + |name, source| { + LazyPerBlockWithDeltas::from_boxed_height_source( + name, + version + Version::ONE, + source, + Version::TWO, + indexes, + cached_starts, + ) + }, + )?, + }) + } + + pub(crate) fn min_stateful_len(&self) -> usize { + self.counts.min_stateful_len().min(self.balance.len()) + } + + pub(crate) fn par_iter_height_mut( + &mut self, + ) -> impl ParallelIterator { + self.counts + .par_iter_height_mut() + .chain(rayon::iter::once(self.balance.stored_mut())) + } + + pub(crate) fn reset_height(&mut self) -> Result<()> { + self.counts.reset_height()?; + self.balance.reset()?; + Ok(()) + } + + #[inline(always)] + pub(crate) fn push_counts(&mut self, counts: &AddrTypeToAddrCount) { + self.counts.push_counts(counts); + } + + #[inline(always)] + pub(crate) fn push_balance(&mut self, counts: AmountRange) { + self.balance.push(counts); + } +} diff --git a/crates/brk_computer/src/distribution/addr/count/mod.rs b/crates/brk_computer/src/distribution/addr/count/mod.rs index 49aa00cb7..879f7caea 100644 --- a/crates/brk_computer/src/distribution/addr/count/mod.rs +++ b/crates/brk_computer/src/distribution/addr/count/mod.rs @@ -1,7 +1,15 @@ mod all_vecs; +mod delta_vecs; mod funded_total_vecs; +mod funded_vecs; +mod new_vecs; mod state; +mod total_vecs; pub use all_vecs::AddrCountsVecs; +pub use delta_vecs::DeltaVecs; pub use funded_total_vecs::AddrCountFundedTotalVecs; +pub use funded_vecs::FundedAddrCountsVecs; +pub use new_vecs::NewAddrCountVecs; pub use state::AddrTypeToAddrCount; +pub use total_vecs::TotalAddrCountVecs; diff --git a/crates/brk_computer/src/distribution/addr/new_addr_count.rs b/crates/brk_computer/src/distribution/addr/count/new_vecs.rs similarity index 100% rename from crates/brk_computer/src/distribution/addr/new_addr_count.rs rename to crates/brk_computer/src/distribution/addr/count/new_vecs.rs diff --git a/crates/brk_computer/src/distribution/addr/total_addr_count.rs b/crates/brk_computer/src/distribution/addr/count/total_vecs.rs similarity index 100% rename from crates/brk_computer/src/distribution/addr/total_addr_count.rs rename to crates/brk_computer/src/distribution/addr/count/total_vecs.rs diff --git a/crates/brk_computer/src/distribution/addr/indexes/any.rs b/crates/brk_computer/src/distribution/addr/indexes/any.rs index 9d4fd12b0..ba7240d7e 100644 --- a/crates/brk_computer/src/distribution/addr/indexes/any.rs +++ b/crates/brk_computer/src/distribution/addr/indexes/any.rs @@ -12,7 +12,7 @@ use rayon::prelude::*; use rustc_hash::FxHashMap; use vecdb::{ AnyStoredVec, AnyVec, BytesVec, Database, ImportOptions, ImportableVec, ReadableVec, Rw, Stamp, - StorageMode, WritableVec, + StorageMode, VecIndex, WritableVec, }; use super::super::AddrTypeToTypeIndexMap; @@ -159,7 +159,7 @@ impl AnyAddrIndexesVecs { } /// Process updates for a single address type's BytesVec, merging two maps. -fn process_single_type_merged( +fn process_single_type_merged( vec: &mut BytesVec, map1: FxHashMap, map2: FxHashMap, diff --git a/crates/brk_computer/src/distribution/addr/mod.rs b/crates/brk_computer/src/distribution/addr/mod.rs index 1cc61cd0d..08b2d94cc 100644 --- a/crates/brk_computer/src/distribution/addr/mod.rs +++ b/crates/brk_computer/src/distribution/addr/mod.rs @@ -1,25 +1,26 @@ mod activity; +mod avg_amount; mod count; mod data; -mod delta; mod exposed; mod indexes; -mod new_addr_count; mod reused; mod state; mod supply; -mod total_addr_count; mod type_map; +mod vecs; pub use activity::{AddrActivityVecs, AddrTypeToActivityCounts}; -pub use count::{AddrCountsVecs, AddrTypeToAddrCount}; +pub use avg_amount::AvgAmountVecs; +pub use count::{ + AddrCountsVecs, AddrTypeToAddrCount, DeltaVecs, FundedAddrCountsVecs, NewAddrCountVecs, + TotalAddrCountVecs, +}; pub use data::AddrsDataVecs; -pub use delta::DeltaVecs; pub use exposed::{ExposedAddrState, ExposedAddrVecs}; pub use indexes::AnyAddrIndexesVecs; -pub use new_addr_count::NewAddrCountVecs; pub use reused::{ReusedAddrState, ReusedAddrVecs}; pub use state::{AddrMetricsState, AddrReceivePreState, AddrSendPreState}; pub use supply::AddrTypeToSupply; -pub use total_addr_count::TotalAddrCountVecs; pub use type_map::{AddrTypeToTypeIndexMap, AddrTypeToVec, HeightToAddrTypeToVec}; +pub use vecs::AddrVecs; diff --git a/crates/brk_computer/src/distribution/addr/reused/events/vecs.rs b/crates/brk_computer/src/distribution/addr/reused/events/vecs.rs index e6be55933..a56370b3d 100644 --- a/crates/brk_computer/src/distribution/addr/reused/events/vecs.rs +++ b/crates/brk_computer/src/distribution/addr/reused/events/vecs.rs @@ -59,43 +59,12 @@ use super::state::AddrTypeToAddrEventCount; /// `active_reused_addr_share` is the per-block ratio /// `reused / active * 100` as a percentage in `[0, 100]` (or `0.0` for /// empty blocks). The denominator (distinct active addrs per block) -/// lives on `ActivityCountVecs::active` (`addrs.activity.all.active`), +/// lives at `addrs.activity.active.all`, /// derived from `sending + receiving - bidirectional`. Both fields /// expose lazy 24h/1w/1m/1y rolling *averages* of the per-block values. /// Sums and cumulatives of distinct-address counts would be misleading /// because the same address can appear in multiple blocks, so the /// cumulative count remains an internal source for the lazy views. -#[derive(Clone, Traversable)] -pub struct AddrEventShares { - pub all: LazyPercentCumulativeRolling, - #[traversable(flatten)] - pub by_addr_type: ByAddrType>, -} - -impl AddrEventShares { - fn new( - name: &str, - version: Version, - indexes: &indexes::Vecs, - cached_starts: &Windows<&CachedWindowStartVec>, - all: LazyPercentCumulativeRolling, - numerators: &ByAddrType>, - denominators: &ByAddrType, - ) -> Self { - let by_addr_type = AddrTypeId::series(|column, type_name| { - LazyPercentCumulativeRolling::from_cached_block_count( - &format!("{type_name}_{name}"), - version, - &column.select(numerators).cumulative.height, - column.select(denominators).clone(), - cached_starts, - indexes, - ) - }); - Self { all, by_addr_type } - } -} - #[derive(Traversable)] pub struct AddrEventsVecs { pub output_to_reused_addr_count: ColumnarPerBlockCumulativeRolling< @@ -107,7 +76,7 @@ pub struct AddrEventsVecs { >, M, >, - pub output_to_reused_addr_share: AddrEventShares, + pub output_to_reused_addr_share: WithAddrTypes>, pub spendable_output_to_reused_addr_share: LazyPercentCumulativeRolling, pub input_from_reused_addr_count: ColumnarPerBlockCumulativeRolling< StoredU64, @@ -118,12 +87,34 @@ pub struct AddrEventsVecs { >, M, >, - pub input_from_reused_addr_share: AddrEventShares, + pub input_from_reused_addr_share: + WithAddrTypes>, pub active_reused_addr_count: CountPerBlockRollingAverage, pub active_reused_addr_share: PerBlockRollingAverage, } impl AddrEventsVecs { + fn event_shares( + name: &str, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + all: LazyPercentCumulativeRolling, + numerators: &ByAddrType>, + denominators: &ByAddrType, + ) -> WithAddrTypes> { + let by_addr_type = AddrTypeId::series(|column, type_name| { + LazyPercentCumulativeRolling::from_cached_block_count( + &format!("{type_name}_{name}"), + version, + &column.select(numerators).cumulative.height, + column.select(denominators).clone(), + cached_starts, + indexes, + ) + }); + WithAddrTypes { all, by_addr_type } + } pub(crate) fn forced_import( db: &Database, name: &str, @@ -153,7 +144,7 @@ impl AddrEventsVecs { let output_to_reused_addr_count = import_count(&format!("output_to_{name}_addr_count"))?; let output_share_name = format!("output_to_{name}_addr_share"); let output_denominators = outputs_by_type.output_count.cached_addr_type_counts(); - let output_to_reused_addr_share = AddrEventShares::new( + let output_to_reused_addr_share = Self::event_shares( &output_share_name, version, indexes, @@ -185,7 +176,7 @@ impl AddrEventsVecs { let input_from_reused_addr_count = import_count(&format!("input_from_{name}_addr_count"))?; let input_share_name = format!("input_from_{name}_addr_share"); let input_denominators = inputs_by_type.input_count.cached_addr_type_counts(); - let input_from_reused_addr_share = AddrEventShares::new( + let input_from_reused_addr_share = Self::event_shares( &input_share_name, version, indexes, @@ -271,8 +262,8 @@ impl AddrEventsVecs { .push_block(StoredU32::from(active_reused_addr_count)); // Stored as a percentage in [0, 100] to match the rest of the // codebase (Unit.percentage on the website expects 0..100). The - // `active_addr_count` denominator lives on `ActivityCountVecs` - // (`addrs.activity.all.active`), passed in here so we can + // `active_addr_count` denominator lives at + // `addrs.activity.active.all`, passed in here so we can // compute the per-block ratio inline. let share = if active_addr_count > 0 { 100.0 * (active_reused_addr_count as f32 / active_addr_count as f32) diff --git a/crates/brk_computer/src/distribution/addr/state.rs b/crates/brk_computer/src/distribution/addr/state.rs deleted file mode 100644 index 3254af64f..000000000 --- a/crates/brk_computer/src/distribution/addr/state.rs +++ /dev/null @@ -1,180 +0,0 @@ -use brk_types::{FundedAddrData, Height, OutputType, Sats}; - -use crate::distribution::{block::TrackingStatus, vecs::AddrMetricsVecs}; - -use super::{AddrTypeToActivityCounts, AddrTypeToAddrCount, ExposedAddrState, ReusedAddrState}; - -/// Bundle of per-block runtime state for the full address-metrics pipeline. -/// Feeds `process_received` / `process_sent` and is pushed to [`AddrMetricsVecs`] -/// once per block. -/// -/// Recovery: [`From<(&AddrMetricsVecs, Height)>`] reads the prior block from -/// disk to seed all persistent running totals. Per-block counters (activity, -/// and event counts inside each [`ReusedAddrState`]) default to zero and are -/// cleared at the top of each block via [`Self::reset_per_block`]. -#[derive(Debug, Default)] -pub struct AddrMetricsState { - pub funded: AddrTypeToAddrCount, - pub empty: AddrTypeToAddrCount, - pub activity: AddrTypeToActivityCounts, - pub reused: ReusedAddrState, - pub respent: ReusedAddrState, - pub exposed: ExposedAddrState, -} - -/// Snapshot of [`FundedAddrData`] taken BEFORE a receive mutates it. -/// Feeds delta-based updates in [`AddrMetricsState::on_receive_applied`]. -#[derive(Debug)] -pub struct AddrReceivePreState { - pub was_funded: bool, - pub was_reused: bool, - pub was_respent: bool, - pub was_pubkey_exposed: bool, - pub prev_funded_txo_count: u32, - pub exposed_contribution: Sats, - pub reused_contribution: Sats, - pub respent_contribution: Sats, -} - -impl AddrReceivePreState { - #[inline] - pub fn capture(addr_data: &FundedAddrData, output_type: OutputType) -> Self { - Self { - was_funded: addr_data.is_funded(), - was_reused: addr_data.is_reused(), - was_respent: addr_data.is_respent(), - was_pubkey_exposed: addr_data.is_pubkey_exposed(output_type), - prev_funded_txo_count: addr_data.funded_txo_count, - exposed_contribution: addr_data.exposed_supply_contribution(output_type), - reused_contribution: addr_data.reused_supply_contribution(), - respent_contribution: addr_data.respent_supply_contribution(), - } - } -} - -/// Snapshot of [`FundedAddrData`] taken BEFORE a spend mutates it. -/// Feeds delta-based updates in [`AddrMetricsState::on_send_applied`]. -#[derive(Debug)] -pub struct AddrSendPreState { - pub was_reused: bool, - pub was_respent: bool, - pub was_pubkey_exposed: bool, - pub exposed_contribution: Sats, - pub reused_contribution: Sats, - pub respent_contribution: Sats, -} - -impl AddrSendPreState { - #[inline] - pub fn capture(addr_data: &FundedAddrData, output_type: OutputType) -> Self { - Self { - was_reused: addr_data.is_reused(), - was_respent: addr_data.is_respent(), - was_pubkey_exposed: addr_data.is_pubkey_exposed(output_type), - exposed_contribution: addr_data.exposed_supply_contribution(output_type), - reused_contribution: addr_data.reused_supply_contribution(), - respent_contribution: addr_data.respent_supply_contribution(), - } - } -} - -impl AddrMetricsState { - #[inline] - pub(crate) fn reset_per_block(&mut self) { - self.activity.reset(); - self.reused.reset_per_block(); - self.respent.reset_per_block(); - } - - /// Apply all state updates for a received output, AFTER the cohort and - /// `addr_data` have been mutated. `pre` is the snapshot captured before - /// the mutation, `addr_data` is the post-receive view. - #[inline] - pub(crate) fn on_receive_applied( - &mut self, - output_type: OutputType, - status: TrackingStatus, - addr_data: &FundedAddrData, - pre: &AddrReceivePreState, - output_count: u32, - ) { - let activity = self.activity.get_mut_unwrap(output_type); - activity.receiving += 1; - match status { - TrackingStatus::New => { - *self.funded.get_mut_unwrap(output_type) += 1; - } - TrackingStatus::WasEmpty => { - activity.reactivated += 1; - *self.funded.get_mut_unwrap(output_type) += 1; - *self.empty.get_mut_unwrap(output_type) -= 1; - } - TrackingStatus::Tracked => {} - } - self.reused - .on_receive_as_reused(output_type, addr_data, pre, output_count); - self.respent - .on_receive_as_respent(output_type, addr_data, pre, output_count); - self.exposed.on_receive(output_type, addr_data, pre, status); - } - - /// Apply all state updates for a spent UTXO, AFTER the cohort and - /// `addr_data` have been mutated. `pre` is the snapshot captured before - /// the mutation. `is_first_encounter` / `also_received` come from the - /// caller's per-block seen/received tracking. `will_be_empty` is from - /// the pre-mutation `addr_data.has_1_utxos()`. - #[inline] - pub(crate) fn on_send_applied( - &mut self, - output_type: OutputType, - addr_data: &FundedAddrData, - pre: &AddrSendPreState, - is_first_encounter: bool, - also_received: bool, - will_be_empty: bool, - ) { - if is_first_encounter { - let activity = self.activity.get_mut_unwrap(output_type); - activity.sending += 1; - if also_received { - activity.bidirectional += 1; - } - } - if will_be_empty { - *self.funded.get_mut_unwrap(output_type) -= 1; - *self.empty.get_mut_unwrap(output_type) += 1; - } - self.reused.on_send_as_reused( - output_type, - addr_data, - pre, - is_first_encounter, - also_received, - will_be_empty, - ); - self.respent.on_send_as_respent( - output_type, - addr_data, - pre, - is_first_encounter, - also_received, - will_be_empty, - ); - self.exposed - .on_send(output_type, addr_data, pre, will_be_empty); - } -} - -impl From<(&AddrMetricsVecs, Height)> for AddrMetricsState { - #[inline] - fn from((vecs, starting_height): (&AddrMetricsVecs, Height)) -> Self { - Self { - funded: AddrTypeToAddrCount::from((&vecs.funded, starting_height)), - empty: AddrTypeToAddrCount::from((&vecs.empty, starting_height)), - activity: AddrTypeToActivityCounts::default(), - reused: ReusedAddrState::from((&vecs.reused, starting_height)), - respent: ReusedAddrState::from((&vecs.respent, starting_height)), - exposed: ExposedAddrState::from((&vecs.exposed, starting_height)), - } - } -} diff --git a/crates/brk_computer/src/distribution/addr/state/metrics.rs b/crates/brk_computer/src/distribution/addr/state/metrics.rs new file mode 100644 index 000000000..cda6bc487 --- /dev/null +++ b/crates/brk_computer/src/distribution/addr/state/metrics.rs @@ -0,0 +1,112 @@ +use brk_types::{FundedAddrData, Height, OutputType}; + +use crate::distribution::block::TrackingStatus; + +use super::super::{ + AddrTypeToActivityCounts, AddrTypeToAddrCount, AddrVecs, ExposedAddrState, ReusedAddrState, +}; +use super::{AddrReceivePreState, AddrSendPreState}; + +/// Runtime state for the address metrics pipeline. +#[derive(Debug, Default)] +pub struct AddrMetricsState { + pub funded: AddrTypeToAddrCount, + pub empty: AddrTypeToAddrCount, + pub activity: AddrTypeToActivityCounts, + pub reused: ReusedAddrState, + pub respent: ReusedAddrState, + pub exposed: ExposedAddrState, +} + +impl AddrMetricsState { + #[inline] + pub(crate) fn reset_per_block(&mut self) { + self.activity.reset(); + self.reused.reset_per_block(); + self.respent.reset_per_block(); + } + + #[inline] + pub(crate) fn on_receive_applied( + &mut self, + output_type: OutputType, + status: TrackingStatus, + addr_data: &FundedAddrData, + pre: &AddrReceivePreState, + output_count: u32, + ) { + let activity = self.activity.get_mut_unwrap(output_type); + activity.receiving += 1; + match status { + TrackingStatus::New => { + *self.funded.get_mut_unwrap(output_type) += 1; + } + TrackingStatus::WasEmpty => { + activity.reactivated += 1; + *self.funded.get_mut_unwrap(output_type) += 1; + *self.empty.get_mut_unwrap(output_type) -= 1; + } + TrackingStatus::Tracked => {} + } + self.reused + .on_receive_as_reused(output_type, addr_data, pre, output_count); + self.respent + .on_receive_as_respent(output_type, addr_data, pre, output_count); + self.exposed.on_receive(output_type, addr_data, pre, status); + } + + #[inline] + pub(crate) fn on_send_applied( + &mut self, + output_type: OutputType, + addr_data: &FundedAddrData, + pre: &AddrSendPreState, + is_first_encounter: bool, + also_received: bool, + will_be_empty: bool, + ) { + if is_first_encounter { + let activity = self.activity.get_mut_unwrap(output_type); + activity.sending += 1; + if also_received { + activity.bidirectional += 1; + } + } + if will_be_empty { + *self.funded.get_mut_unwrap(output_type) -= 1; + *self.empty.get_mut_unwrap(output_type) += 1; + } + self.reused.on_send_as_reused( + output_type, + addr_data, + pre, + is_first_encounter, + also_received, + will_be_empty, + ); + self.respent.on_send_as_respent( + output_type, + addr_data, + pre, + is_first_encounter, + also_received, + will_be_empty, + ); + self.exposed + .on_send(output_type, addr_data, pre, will_be_empty); + } +} + +impl From<(&AddrVecs, Height)> for AddrMetricsState { + #[inline] + fn from((vecs, starting_height): (&AddrVecs, Height)) -> Self { + Self { + funded: AddrTypeToAddrCount::from((&vecs.funded.counts, starting_height)), + empty: AddrTypeToAddrCount::from((&vecs.empty, starting_height)), + activity: AddrTypeToActivityCounts::default(), + reused: ReusedAddrState::from((&vecs.reused, starting_height)), + respent: ReusedAddrState::from((&vecs.respent, starting_height)), + exposed: ExposedAddrState::from((&vecs.exposed, starting_height)), + } + } +} diff --git a/crates/brk_computer/src/distribution/addr/state/mod.rs b/crates/brk_computer/src/distribution/addr/state/mod.rs new file mode 100644 index 000000000..b92bb4f42 --- /dev/null +++ b/crates/brk_computer/src/distribution/addr/state/mod.rs @@ -0,0 +1,7 @@ +mod metrics; +mod receive; +mod send; + +pub use metrics::AddrMetricsState; +pub use receive::AddrReceivePreState; +pub use send::AddrSendPreState; diff --git a/crates/brk_computer/src/distribution/addr/state/receive.rs b/crates/brk_computer/src/distribution/addr/state/receive.rs new file mode 100644 index 000000000..28bc19b54 --- /dev/null +++ b/crates/brk_computer/src/distribution/addr/state/receive.rs @@ -0,0 +1,30 @@ +use brk_types::{FundedAddrData, OutputType, Sats}; + +/// Snapshot of [`FundedAddrData`] taken before a receive mutates it. +#[derive(Debug)] +pub struct AddrReceivePreState { + pub was_funded: bool, + pub was_reused: bool, + pub was_respent: bool, + pub was_pubkey_exposed: bool, + pub prev_funded_txo_count: u32, + pub exposed_contribution: Sats, + pub reused_contribution: Sats, + pub respent_contribution: Sats, +} + +impl AddrReceivePreState { + #[inline] + pub fn capture(addr_data: &FundedAddrData, output_type: OutputType) -> Self { + Self { + was_funded: addr_data.is_funded(), + was_reused: addr_data.is_reused(), + was_respent: addr_data.is_respent(), + was_pubkey_exposed: addr_data.is_pubkey_exposed(output_type), + prev_funded_txo_count: addr_data.funded_txo_count, + exposed_contribution: addr_data.exposed_supply_contribution(output_type), + reused_contribution: addr_data.reused_supply_contribution(), + respent_contribution: addr_data.respent_supply_contribution(), + } + } +} diff --git a/crates/brk_computer/src/distribution/addr/state/send.rs b/crates/brk_computer/src/distribution/addr/state/send.rs new file mode 100644 index 000000000..99fd7535f --- /dev/null +++ b/crates/brk_computer/src/distribution/addr/state/send.rs @@ -0,0 +1,26 @@ +use brk_types::{FundedAddrData, OutputType, Sats}; + +/// Snapshot of [`FundedAddrData`] taken before a spend mutates it. +#[derive(Debug)] +pub struct AddrSendPreState { + pub was_reused: bool, + pub was_respent: bool, + pub was_pubkey_exposed: bool, + pub exposed_contribution: Sats, + pub reused_contribution: Sats, + pub respent_contribution: Sats, +} + +impl AddrSendPreState { + #[inline] + pub fn capture(addr_data: &FundedAddrData, output_type: OutputType) -> Self { + Self { + was_reused: addr_data.is_reused(), + was_respent: addr_data.is_respent(), + was_pubkey_exposed: addr_data.is_pubkey_exposed(output_type), + exposed_contribution: addr_data.exposed_supply_contribution(output_type), + reused_contribution: addr_data.reused_supply_contribution(), + respent_contribution: addr_data.respent_supply_contribution(), + } + } +} diff --git a/crates/brk_computer/src/distribution/addr/vecs.rs b/crates/brk_computer/src/distribution/addr/vecs.rs new file mode 100644 index 000000000..7f08ac14a --- /dev/null +++ b/crates/brk_computer/src/distribution/addr/vecs.rs @@ -0,0 +1,88 @@ +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{EmptyAddrData, EmptyAddrIndex, FundedAddrData, FundedAddrIndex}; +use rayon::prelude::*; +use vecdb::{AnyStoredVec, LazyVec, Rw, StorageMode}; + +use super::{ + AddrActivityVecs, AddrCountsVecs, AddrMetricsState, AvgAmountVecs, DeltaVecs, ExposedAddrVecs, + FundedAddrCountsVecs, NewAddrCountVecs, ReusedAddrVecs, TotalAddrCountVecs, +}; + +#[derive(Traversable)] +pub struct AddrVecs { + pub funded: FundedAddrCountsVecs, + pub empty: AddrCountsVecs, + pub activity: AddrActivityVecs, + pub total: TotalAddrCountVecs, + pub new: NewAddrCountVecs, + pub reused: ReusedAddrVecs, + pub respent: ReusedAddrVecs, + pub exposed: ExposedAddrVecs, + pub delta: DeltaVecs, + pub avg_amount: AvgAmountVecs, + #[traversable(wrap = "indexes", rename = "funded")] + pub funded_index: LazyVec, + #[traversable(wrap = "indexes", rename = "empty")] + pub empty_index: LazyVec, +} + +impl AddrVecs { + pub(crate) fn reset_height(&mut self) -> Result<()> { + self.funded.reset_height()?; + self.empty.reset_height()?; + self.activity.reset_height()?; + self.total.reset_height()?; + self.reused.reset_height()?; + self.respent.reset_height()?; + self.exposed.reset_height()?; + self.avg_amount.reset_height()?; + Ok(()) + } + + pub(crate) fn min_stateful_len(&self) -> usize { + self.funded + .min_stateful_len() + .min(self.empty.min_stateful_len()) + .min(self.activity.min_stateful_len()) + .min(self.reused.min_stateful_len()) + .min(self.respent.min_stateful_len()) + .min(self.exposed.min_stateful_len()) + } + + pub(crate) fn par_iter_stateful_height_mut( + &mut self, + ) -> impl ParallelIterator { + self.funded + .par_iter_height_mut() + .chain(self.empty.par_iter_height_mut()) + .chain(self.activity.par_iter_height_mut()) + .chain(self.reused.par_iter_stateful_height_mut()) + .chain(self.respent.par_iter_stateful_height_mut()) + .chain(self.exposed.par_iter_stateful_height_mut()) + } + + pub(crate) fn par_iter_height_mut( + &mut self, + ) -> impl ParallelIterator { + self.funded + .par_iter_height_mut() + .chain(self.empty.par_iter_height_mut()) + .chain(self.activity.par_iter_height_mut()) + .chain(self.total.par_iter_height_mut()) + .chain(self.reused.par_iter_height_mut()) + .chain(self.respent.par_iter_height_mut()) + .chain(self.exposed.par_iter_height_mut()) + .chain(self.avg_amount.par_iter_height_mut()) + } + + #[inline(always)] + pub(crate) fn push_height(&mut self, state: &AddrMetricsState, active_addr_count: u32) { + self.funded.push_counts(&state.funded); + self.empty.push_counts(&state.empty); + self.activity.push_height(&state.activity); + self.exposed.push_height(&state.exposed); + self.reused.push_height(&state.reused, active_addr_count); + self.respent.push_height(&state.respent, active_addr_count); + } +} diff --git a/crates/brk_computer/src/distribution/all_chain_cache.rs b/crates/brk_computer/src/distribution/all_chain_cache.rs index 0f04b03df..d311d9942 100644 --- a/crates/brk_computer/src/distribution/all_chain_cache.rs +++ b/crates/brk_computer/src/distribution/all_chain_cache.rs @@ -1,4 +1,4 @@ -use brk_types::{Cents, Height, Sats, Version}; +use brk_types::{Cents, Height, PartsPerMillionSigned64, Sats, Version}; use vecdb::{ BinaryTransform, CachedBoxedVec, ReadableCloneableVec, ReadableVec, TypedVec, VecValue, }; @@ -100,8 +100,8 @@ impl AllChainCache { version: Version, realized_cap: &(impl ReadableCloneableVec + 'static), window_starts: CachedBoxedVec, - ) -> impl TypedVec - + ReadableVec + ) -> impl TypedVec + + ReadableVec + Clone + 'static { let caps = self.with_market_cap( @@ -125,7 +125,7 @@ impl AllChainCache { (f64::from(current) - f64::from(previous)) / f64::from(previous) } }; - brk_types::PartsPerMillionSigned64::from( + PartsPerMillionSigned64::from( growth(current.market, previous.market) - growth(current.realized, previous.realized), ) @@ -137,7 +137,10 @@ impl AllChainCache { #[cfg(test)] mod tests { use brk_types::PartsPerMillionSigned64; - use vecdb::{AnyStoredVec, CachedVec, Database, EagerVec, ImportableVec, PcoVec, WritableVec}; + use vecdb::{ + AnyStoredVec, CachedVec, Database, EagerVec, ImportableVec, PcoVec, ReadOnlyClone, + WritableVec, + }; use super::*; @@ -179,7 +182,7 @@ mod tests { realized.write().unwrap(); starts.write().unwrap(); - let supply_cache = AllSupplyCache::new(&supply); + let supply_cache = AllSupplyCache::new(supply.read_only_clone()); let price_cache = CachedVec::wrap(price); let cache = AllChainCache::new(&supply_cache, &price_cache.read_only_cached_boxed_clone()); diff --git a/crates/brk_computer/src/distribution/block/cache/addr.rs b/crates/brk_computer/src/distribution/block/cache/addr.rs index 5b9cd7884..001ae8357 100644 --- a/crates/brk_computer/src/distribution/block/cache/addr.rs +++ b/crates/brk_computer/src/distribution/block/cache/addr.rs @@ -7,7 +7,7 @@ use smallvec::SmallVec; use crate::distribution::{ addr::{AddrTypeToTypeIndexMap, AddrsDataVecs, AnyAddrIndexesVecs}, - compute::VecsReaders, + compute::AddrReaders, }; use super::super::cohort::{WithAddrDataSource, update_tx_counts}; @@ -52,7 +52,7 @@ impl BlockAddress { fn load( self, first_addr_indexes: &ByAddrType, - vr: &VecsReaders, + vr: &AddrReaders, any_addr_indexes: &AnyAddrIndexesVecs, addrs_data: &AddrsDataVecs, ) -> WithAddrDataSource { @@ -124,7 +124,7 @@ impl AddrCache { &mut self, addresses: impl Iterator, first_addr_indexes: &ByAddrType, - vr: &VecsReaders, + vr: &AddrReaders, any_addr_indexes: &AnyAddrIndexesVecs, addrs_data: &AddrsDataVecs, ) { diff --git a/crates/brk_computer/src/distribution/block/cohort/received.rs b/crates/brk_computer/src/distribution/block/cohort/received.rs index 3def7aca4..ae58decdf 100644 --- a/crates/brk_computer/src/distribution/block/cohort/received.rs +++ b/crates/brk_computer/src/distribution/block/cohort/received.rs @@ -3,8 +3,8 @@ use brk_types::{Cents, Sats, TypeIndex}; use rustc_hash::FxHashMap; use crate::distribution::{ + AddrStates, addr::{AddrMetricsState, AddrReceivePreState, AddrTypeToVec}, - cohorts::AddrCohorts, }; use super::super::cache::{AddrLookup, TrackingStatus}; @@ -18,7 +18,7 @@ struct AggregatedReceive { pub(crate) fn process_received( received_data: AddrTypeToVec<(TypeIndex, Sats)>, - cohorts: &mut AddrCohorts, + cohorts: &mut AddrStates, lookup: &mut AddrLookup<'_>, price: Cents, state: &mut AddrMetricsState, @@ -52,9 +52,6 @@ pub(crate) fn process_received( cohorts .amount_range .get_mut_by_bucket(AmountBucket::from(recv.total_value)) - .state - .as_mut() - .unwrap() .add(addr_data); } else { let prev_balance = addr_data.balance(); @@ -63,12 +60,7 @@ pub(crate) fn process_received( let new_bucket = AmountBucket::from(new_balance); if let Some((old_bucket, new_bucket)) = prev_bucket.transition_to(new_bucket) { - let cohort_state = cohorts - .amount_range - .get_mut_by_bucket(old_bucket) - .state - .as_mut() - .unwrap(); + let cohort_state = cohorts.amount_range.get_mut_by_bucket(old_bucket); if cohort_state.inner.supply.utxo_count < addr_data.utxo_count() as u64 { panic!( @@ -90,17 +82,11 @@ pub(crate) fn process_received( cohorts .amount_range .get_mut_by_bucket(new_bucket) - .state - .as_mut() - .unwrap() .add(addr_data); } else { cohorts .amount_range .get_mut_by_bucket(new_bucket) - .state - .as_mut() - .unwrap() .receive_outputs(addr_data, recv.total_value, price, recv.output_count); } } diff --git a/crates/brk_computer/src/distribution/block/cohort/sent.rs b/crates/brk_computer/src/distribution/block/cohort/sent.rs index 2a720e039..352635321 100644 --- a/crates/brk_computer/src/distribution/block/cohort/sent.rs +++ b/crates/brk_computer/src/distribution/block/cohort/sent.rs @@ -4,8 +4,8 @@ use brk_types::{Cents, Sats, TypeIndex}; use vecdb::VecIndex; use crate::distribution::{ + AddrStates, addr::{AddrMetricsState, AddrSendPreState, HeightToAddrTypeToVec}, - cohorts::AddrCohorts, }; use super::{super::cache::AddrLookup, transfer_address_cache::TransferAddressCache}; @@ -13,7 +13,7 @@ use super::{super::cache::AddrLookup, transfer_address_cache::TransferAddressCac /// Process sent UTXOs for address cohort membership and empty-address transitions. pub(crate) fn process_sent( sent_data: HeightToAddrTypeToVec<(TypeIndex, Sats)>, - cohorts: &mut AddrCohorts, + cohorts: &mut AddrStates, lookup: &mut AddrLookup<'_>, current_price: Cents, state: &mut AddrMetricsState, @@ -36,12 +36,7 @@ pub(crate) fn process_sent( let will_be_empty = addr_data.has_1_utxos(); let prev_bucket = AmountBucket::from(prev_balance); - let cohort_state = cohorts - .amount_range - .get_mut_by_bucket(prev_bucket) - .state - .as_mut() - .unwrap(); + let cohort_state = cohorts.amount_range.get_mut_by_bucket(prev_bucket); // Mutates addr_data.spent_txo_count (+= 1). on_send_applied reads the post-spend view. cohort_state.send(addr_data, value, current_price, prev_price)?; @@ -65,9 +60,6 @@ pub(crate) fn process_sent( cohorts .amount_range .get_mut_by_bucket(new_bucket) - .state - .as_mut() - .unwrap() .add(addr_data); } } diff --git a/crates/brk_computer/src/distribution/block/cohort/transfer_address_cache.rs b/crates/brk_computer/src/distribution/block/cohort/transfer_address_cache.rs index b9999255f..bc66113e9 100644 --- a/crates/brk_computer/src/distribution/block/cohort/transfer_address_cache.rs +++ b/crates/brk_computer/src/distribution/block/cohort/transfer_address_cache.rs @@ -1,5 +1,5 @@ use brk_cohort::ByAddrType; -use brk_types::{Sats, TypeIndex}; +use brk_types::{OutputType, Sats, TypeIndex}; use rustc_hash::FxHashSet; use crate::distribution::addr::AddrTypeToVec; @@ -24,7 +24,7 @@ impl TransferAddressCache { pub(super) fn sets_for( &mut self, - output_type: brk_types::OutputType, + output_type: OutputType, ) -> (Option<&FxHashSet>, &mut FxHashSet) { ( self.received.get(output_type), diff --git a/crates/brk_computer/src/distribution/block/cohort/with_source.rs b/crates/brk_computer/src/distribution/block/cohort/with_source.rs index 52dc8a8e2..ea15a154c 100644 --- a/crates/brk_computer/src/distribution/block/cohort/with_source.rs +++ b/crates/brk_computer/src/distribution/block/cohort/with_source.rs @@ -1,3 +1,5 @@ +use std::ops::{Deref, DerefMut}; + use brk_types::{EmptyAddrData, EmptyAddrIndex, FundedAddrData, FundedAddrIndex}; /// Address data wrapped with its source location for flush operations. @@ -14,7 +16,7 @@ pub enum WithAddrDataSource { FromEmpty(EmptyAddrIndex, T), } -impl std::ops::Deref for WithAddrDataSource { +impl Deref for WithAddrDataSource { type Target = T; fn deref(&self) -> &Self::Target { @@ -24,7 +26,7 @@ impl std::ops::Deref for WithAddrDataSource { } } -impl std::ops::DerefMut for WithAddrDataSource { +impl DerefMut for WithAddrDataSource { fn deref_mut(&mut self) -> &mut Self::Target { match self { Self::New(v) | Self::FromFunded(_, v) | Self::FromEmpty(_, v) => v, diff --git a/crates/brk_computer/src/distribution/cohorts/addr/groups.rs b/crates/brk_computer/src/distribution/cohorts/addr/groups.rs deleted file mode 100644 index 8921f32af..000000000 --- a/crates/brk_computer/src/distribution/cohorts/addr/groups.rs +++ /dev/null @@ -1,177 +0,0 @@ -use std::path::Path; - -use brk_cohort::{ - AddrGroups, AmountRange, CohortContext, Filter, Filtered, OverAmount, UnderAmount, -}; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Cents, Height, Version}; -use derive_more::{Deref, DerefMut}; -use rayon::prelude::*; -use vecdb::{AnyStoredVec, CachedBoxedVec, Database, Exit, Rw, StorageMode}; - -use crate::{ - distribution::{ - DynCohortVecs, - metrics::{AllSupplyCache, ImportConfig}, - }, - indexes, - internal::{CachedWindowStartVec, Windows}, - price, -}; - -use super::{super::traits::CohortVecs, vecs::AddrCohortVecs}; - -const VERSION: Version = Version::new(0); - -/// All Addr cohorts organized by filter type. -#[derive(Deref, DerefMut, Traversable)] -pub struct AddrCohorts(AddrGroups>); - -impl AddrCohorts { - /// Import all Addr cohorts from database. - pub(crate) fn forced_import( - db: &Database, - version: Version, - indexes: &indexes::Vecs, - states_path: &Path, - cached_starts: &Windows<&CachedWindowStartVec>, - spot_price: &CachedBoxedVec, - all_supply: &AllSupplyCache, - ) -> Result { - let v = version + VERSION; - - // Helper to create a cohort - only amount_range cohorts have state - let create = - |filter: Filter, name: &'static str, has_state: bool| -> Result { - let sp = if has_state { Some(states_path) } else { None }; - let full_name = CohortContext::Addr.full_name(&filter, name); - let cfg = ImportConfig { - db, - filter: &filter, - full_name: &full_name, - version: v, - indexes, - cached_starts, - spot_price, - }; - AddrCohortVecs::forced_import(&cfg, sp, all_supply) - }; - - let full = |f: Filter, name: &'static str| create(f, name, true); - let none = |f: Filter, name: &'static str| create(f, name, false); - - Ok(Self(AddrGroups { - amount_range: AmountRange::try_new(&full)?, - under_amount: UnderAmount::try_new(&none)?, - over_amount: OverAmount::try_new(&none)?, - })) - } - - /// Apply a function to each aggregate cohort with its source cohorts (in parallel). - fn for_each_aggregate(&mut self, f: F) -> Result<()> - where - F: Fn(&mut AddrCohortVecs, Vec<&AddrCohortVecs>) -> Result<()> + Sync, - { - let by_amount_range = &self.0.amount_range; - - let pairs: Vec<_> = self - .0 - .over_amount - .iter_mut() - .chain(self.0.under_amount.iter_mut()) - .map(|vecs| { - let filter = vecs.filter().clone(); - ( - vecs, - by_amount_range - .iter() - .filter(|other| filter.includes(other.filter())) - .collect(), - ) - }) - .collect(); - - pairs - .into_par_iter() - .try_for_each(|(vecs, sources)| f(vecs, sources)) - } - - /// Compute overlapping cohorts from component amount_range cohorts. - pub(crate) fn compute_overlapping_vecs( - &mut self, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.for_each_aggregate(|vecs, sources| { - vecs.compute_from_stateful(starting_lengths, &sources, exit) - }) - } - - /// First phase of post-processing: compute index transforms. - pub(crate) fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.par_iter_mut() - .try_for_each(|v| v.compute_rest_part1(prices, starting_lengths, exit))?; - - Ok(()) - } - - /// Returns a parallel iterator over all vecs for parallel writing. - pub(crate) fn par_iter_vecs_mut( - &mut self, - ) -> impl ParallelIterator { - // Collect all vecs from all cohorts - self.0 - .iter_mut() - .flat_map(|v| v.par_iter_vecs_mut().collect::>()) - .collect::>() - .into_par_iter() - } - - /// Commit all states to disk (separate from vec writes for parallelization). - pub(crate) fn commit_all_states(&mut self, height: Height, cleanup: bool) -> Result<()> { - self.par_iter_separate_mut() - .try_for_each(|v| v.write_state(height, cleanup)) - } - - /// Get minimum height from all separate cohorts' height-indexed vectors. - pub(crate) fn min_stateful_len(&self) -> Height { - self.iter_separate() - .map(|v| Height::from(v.min_stateful_len())) - .min() - .unwrap_or_default() - } - - /// Import state for all separate cohorts at or before given height. - /// Returns true if all imports succeeded and returned the expected height. - pub(crate) fn import_separate_states(&mut self, height: Height) -> bool { - self.par_iter_separate_mut() - .map(|v| v.import_state(height).unwrap_or_default()) - .all(|h| h == height) - } - - /// Reset state heights for all separate cohorts. - pub(crate) fn reset_separate_state_heights(&mut self) { - self.par_iter_separate_mut().for_each(|v| { - v.reset_state_starting_height(); - }); - } - - /// Reset cost_basis_data for all separate cohorts (called during fresh start). - pub(crate) fn reset_separate_cost_basis_data(&mut self) -> Result<()> { - self.par_iter_separate_mut() - .try_for_each(|v| v.reset_cost_basis_data_if_needed()) - } - - /// Validate computed versions for all separate cohorts. - pub(crate) fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.par_iter_separate_mut() - .try_for_each(|v| v.validate_computed_versions(base_version)) - } -} diff --git a/crates/brk_computer/src/distribution/cohorts/addr/metrics.rs b/crates/brk_computer/src/distribution/cohorts/addr/metrics.rs deleted file mode 100644 index ff808f44f..000000000 --- a/crates/brk_computer/src/distribution/cohorts/addr/metrics.rs +++ /dev/null @@ -1,103 +0,0 @@ -use brk_cohort::Filter; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use vecdb::{AnyStoredVec, Exit, Rw, StorageMode}; - -use crate::{ - distribution::metrics::{ - ActivityMinimal, AllSupplyCache, ImportConfig, OutputsUnspent, RealizedBase, SupplyBase, - }, - price, -}; - -/// Address-balance metrics: holdings plus economically meaningful flows. -/// -/// Address cohorts intentionally omit spent-output counts, realized price, -/// MVRV, and NUPL. -#[derive(Traversable)] -pub struct AddrCohortMetrics { - #[traversable(skip)] - pub filter: Filter, - pub supply: Box>, - pub outputs: Box>, - pub activity: Box>, - pub realized: Box>, -} - -impl AddrCohortMetrics { - pub(super) fn forced_import(cfg: &ImportConfig, all_supply: &AllSupplyCache) -> Result { - Ok(Self { - filter: cfg.filter.clone(), - supply: Box::new(SupplyBase::forced_import(cfg, all_supply)?), - outputs: Box::new(OutputsUnspent::forced_import(cfg)?), - activity: Box::new(ActivityMinimal::forced_import(cfg)?), - realized: Box::new(RealizedBase::forced_import(cfg)?), - }) - } - - pub(super) fn min_stateful_len(&self) -> usize { - self.supply - .min_len() - .min(self.outputs.min_len()) - .min(self.activity.min_len()) - .min(self.realized.min_stateful_len()) - } - - pub(super) fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs = Vec::new(); - vecs.extend(self.supply.collect_vecs_mut()); - vecs.extend(self.outputs.collect_vecs_mut()); - vecs.extend(self.activity.collect_vecs_mut()); - vecs.extend(self.realized.collect_vecs_mut()); - vecs - } - - pub(super) fn compute_from_sources( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - self.supply.compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.supply.as_ref()).collect::>(), - exit, - )?; - self.outputs.compute_from_stateful( - starting_lengths, - &others - .iter() - .map(|v| v.outputs.as_ref()) - .collect::>(), - exit, - )?; - self.activity.compute_from_stateful( - starting_lengths, - &others - .iter() - .map(|v| v.activity.as_ref()) - .collect::>(), - exit, - )?; - self.realized.compute_from_stateful( - starting_lengths, - &others - .iter() - .map(|v| v.realized.as_ref()) - .collect::>(), - exit, - )?; - Ok(()) - } - - pub(super) fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.activity - .compute_rest_part1(prices, starting_lengths, exit) - } -} diff --git a/crates/brk_computer/src/distribution/cohorts/addr/mod.rs b/crates/brk_computer/src/distribution/cohorts/addr/mod.rs deleted file mode 100644 index 7001381d5..000000000 --- a/crates/brk_computer/src/distribution/cohorts/addr/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -mod groups; -mod metrics; -mod vecs; - -pub use groups::*; diff --git a/crates/brk_computer/src/distribution/cohorts/addr/vecs.rs b/crates/brk_computer/src/distribution/cohorts/addr/vecs.rs deleted file mode 100644 index 28df7913b..000000000 --- a/crates/brk_computer/src/distribution/cohorts/addr/vecs.rs +++ /dev/null @@ -1,211 +0,0 @@ -use std::path::Path; - -use brk_cohort::{Filter, Filtered}; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Cents, Height, PartsPerMillionSigned64, StoredI64, StoredU64, Version}; -use rayon::prelude::*; -use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableVec, Rw, StorageMode, WritableVec}; - -use crate::{distribution::state::AddrCohortState, internal::PerBlockWithDeltas, price}; - -use crate::distribution::metrics::{AllSupplyCache, ImportConfig}; - -use super::super::traits::{CohortVecs, DynCohortVecs}; -use super::metrics::AddrCohortMetrics; - -#[derive(Traversable)] -pub struct AddrCohortVecs { - starting_height: Option, - - #[traversable(skip)] - pub state: Option>, - - #[traversable(flatten)] - pub metrics: AddrCohortMetrics, - - pub addr_count: PerBlockWithDeltas, -} - -impl AddrCohortVecs { - pub(crate) fn forced_import( - cfg: &ImportConfig, - states_path: Option<&Path>, - all_supply: &AllSupplyCache, - ) -> Result { - let addr_count = PerBlockWithDeltas::forced_import( - cfg.db, - &cfg.name("addr_count"), - cfg.version, - Version::TWO, - cfg.indexes, - cfg.cached_starts, - )?; - - Ok(Self { - starting_height: None, - state: states_path.map(|path| Box::new(AddrCohortState::new(path, cfg.full_name))), - metrics: AddrCohortMetrics::forced_import(cfg, all_supply)?, - addr_count, - }) - } - - pub(crate) fn reset_starting_height(&mut self) { - self.starting_height = Some(Height::ZERO); - } - - pub(crate) fn par_iter_vecs_mut( - &mut self, - ) -> impl ParallelIterator { - let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); - vecs.push(&mut self.addr_count.height as &mut dyn AnyStoredVec); - vecs.extend(self.metrics.collect_all_vecs_mut()); - vecs.into_par_iter() - } - - pub(crate) fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { - if let Some(state) = self.state.as_mut() { - state.inner.write(height, cleanup)?; - } - Ok(()) - } -} - -impl Filtered for AddrCohortVecs { - fn filter(&self) -> &Filter { - &self.metrics.filter - } -} - -impl DynCohortVecs for AddrCohortVecs { - fn min_stateful_len(&self) -> usize { - self.addr_count - .height - .len() - .min(self.metrics.min_stateful_len()) - } - - fn reset_state_starting_height(&mut self) { - self.reset_starting_height(); - if let Some(state) = self.state.as_mut() { - state.reset(); - } - } - - fn import_state(&mut self, starting_height: Height) -> Result { - if let Some(state) = self.state.as_mut() { - if let Some(mut prev_height) = starting_height.decremented() { - prev_height = state.inner.import_at_or_before(prev_height)?; - - state.inner.supply.value = self - .metrics - .supply - .total - .sats - .height - .collect_one(prev_height) - .unwrap(); - state.inner.supply.utxo_count = *self - .metrics - .outputs - .unspent_count - .height - .collect_one(prev_height) - .unwrap(); - state.addr_count = *self.addr_count.height.collect_one(prev_height).unwrap(); - - state.inner.restore_realized_cap(); - - let result = prev_height.incremented(); - self.starting_height = Some(result); - Ok(result) - } else { - self.starting_height = Some(Height::ZERO); - Ok(Height::ZERO) - } - } else { - self.starting_height = Some(starting_height); - Ok(starting_height) - } - } - - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - use vecdb::WritableVec; - self.addr_count - .height - .validate_computed_version_or_reset(base_version)?; - Ok(()) - } - - fn push_state(&mut self, height: Height) { - if self.starting_height.is_some_and(|h| h > height) { - return; - } - - if let Some(state) = self.state.as_ref() { - self.addr_count.height.push(state.addr_count.into()); - self.metrics.supply.push_state(&state.inner); - self.metrics.outputs.push_state(&state.inner); - self.metrics.activity.push_state(&state.inner); - self.metrics.realized.push_state(&state.inner); - } - } - - fn push_unrealized_state(&mut self, _height_price: Cents) {} - - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.metrics - .compute_rest_part1(prices, starting_lengths, exit) - } - - fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { - if let Some(state) = self.state.as_mut() { - state.inner.write(height, cleanup)?; - } - Ok(()) - } - - fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { - if let Some(state) = self.state.as_mut() { - state.inner.reset_cost_basis_data_if_needed()?; - } - Ok(()) - } - - fn reset_single_iteration_values(&mut self) { - if let Some(state) = self.state.as_mut() { - state.inner.reset_single_iteration_values(); - } - } -} - -impl CohortVecs for AddrCohortVecs { - fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - self.addr_count.height.compute_sum_of_others( - starting_lengths.height, - others - .iter() - .map(|v| &v.addr_count.height) - .collect::>() - .as_slice(), - exit, - )?; - self.metrics.compute_from_sources( - starting_lengths, - &others.iter().map(|v| &v.metrics).collect::>(), - exit, - )?; - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/cohorts/mod.rs b/crates/brk_computer/src/distribution/cohorts/mod.rs deleted file mode 100644 index 391cbb1e6..000000000 --- a/crates/brk_computer/src/distribution/cohorts/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod addr; -mod traits; -mod utxo; - -pub use addr::AddrCohorts; -pub use traits::DynCohortVecs; -pub use utxo::UTXOCohorts; diff --git a/crates/brk_computer/src/distribution/cohorts/traits.rs b/crates/brk_computer/src/distribution/cohorts/traits.rs deleted file mode 100644 index efb0a180e..000000000 --- a/crates/brk_computer/src/distribution/cohorts/traits.rs +++ /dev/null @@ -1,60 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_types::{Cents, Height, Version}; -use vecdb::Exit; - -use crate::price; - -/// Dynamic dispatch trait for cohort vectors. -/// -/// This trait enables heterogeneous cohort processing via trait objects. -pub trait DynCohortVecs: Send + Sync { - /// Get minimum length across height-indexed vectors written in block loop. - fn min_stateful_len(&self) -> usize; - - /// Reset the starting height for state tracking. - fn reset_state_starting_height(&mut self); - - /// Import state from checkpoint at or before the given height. - fn import_state(&mut self, starting_height: Height) -> Result; - - /// Validate that computed vectors have correct versions. - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()>; - - /// Push state to height-indexed vectors. - /// Height is used for the state_starting_height guard check. - fn push_state(&mut self, height: Height); - - /// Compute and push unrealized profit/loss states. - fn push_unrealized_state(&mut self, height_price: Cents); - - /// First phase of post-processing computations. - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()>; - - /// Write state checkpoint to disk. - fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()>; - - /// Reset cost basis data (called during fresh start). - fn reset_cost_basis_data_if_needed(&mut self) -> Result<()>; - - /// Reset per-block iteration values. - fn reset_single_iteration_values(&mut self); -} - -/// Static dispatch trait for cohort vectors with additional methods. -/// -/// Used by address cohorts where all cohorts share the same concrete type. -pub trait CohortVecs: DynCohortVecs { - /// Compute aggregate cohort from component cohorts. - fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()>; -} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs b/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs deleted file mode 100644 index 19c34a63b..000000000 --- a/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs +++ /dev/null @@ -1,1002 +0,0 @@ -use std::path::Path; - -use brk_cohort::{ - AGE_RANGE_COUNT, AgeRange, AgeRangeId, AmountRange, ByEntry, ByEpoch, Class, CohortContext, - Filter, OverAge, OverAmount, SpendableType, Term, UnderAge, UnderAmount, -}; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Cents, CentsSquaredSats, Height, Sats, Version}; -use rayon::prelude::*; -use vecdb::{ - AnyStoredVec, AnyVec, BinaryTransform, CachedBoxedVec, ColumnId, ColumnarVec, Database, - EagerVec, Exit, ImportableVec, PcoVec, ReadOnlyClone, ReadableVec, Rw, StorageMode, - WritableVec, -}; - -use crate::{ - distribution::{ - AllChainCache, DynCohortVecs, - metrics::{ - AgeRangeSupplySources, AllCohortMetrics, AllSupplyCache, BasicCohortMetrics, - CohortMetricsBase, CoreCohortMetrics, ExtendedAdjustedCohortMetrics, - ExtendedCohortMetrics, ImportConfig, MinimalCohortMetrics, ProfitabilityMetrics, - RealizedFullAccum, TypeCohortMetrics, - }, - state::UTXOCohortState, - }, - indexes, - internal::{ - CachedWindowStartVec, LazyColumnValuePerBlockCumulativeRolling, SatsToCents, Windows, - }, - price, -}; - -use super::{fenwick::CostBasisFenwick, vecs::UTXOCohortVecs}; - -const VERSION: Version = Version::new(0); - -/// All UTXO cohorts organized by filter type. -#[derive(Traversable)] -pub struct UTXOCohorts { - pub all: UTXOCohortVecs>, - pub sth: UTXOCohortVecs>, - pub lth: UTXOCohortVecs>, - pub age_range: AgeRange>>, - pub under_age: UnderAge>>, - pub over_age: OverAge>>, - pub epoch: ByEpoch>>, - pub class: Class>>, - pub entry: ByEntry>>, - pub over_amount: OverAmount>>, - pub amount_range: AmountRange>>, - pub under_amount: UnderAmount>>, - #[traversable(rename = "type")] - pub type_: SpendableType>>, - pub profitability: ProfitabilityMetrics, - #[traversable(skip)] - age_range_supply: AgeRangeSupplySources, - pub matured: AgeRange>, - pub cumulative_matured_sats: M::Stored, AgeRangeId>>>, - pub cumulative_matured_cents: - M::Stored, AgeRangeId>>>, - #[traversable(skip)] - all_supply_cache: AllSupplyCache, - #[traversable(skip)] - pub(super) caches: UTXOCohortsTransientState, -} - -/// In-memory state that does NOT survive rollback. -#[derive(Clone, Default)] -pub(crate) struct UTXOCohortsTransientState { - pub(super) fenwick: CostBasisFenwick, - /// Cached partition_point positions for tick_tock boundary searches. - /// Avoids O(log n) binary search per boundary per block; scans forward - /// from last known position (typically O(1) per boundary). - pub(super) tick_tock_cached_positions: [usize; AGE_RANGE_COUNT - 1], -} - -const MATURED_VERSION: Version = Version::new(4); -const AGE_RANGE_SUPPLY_VERSION: Version = Version::ONE; -const WRITE_INTERVAL: usize = 10_000; - -impl UTXOCohorts { - /// Separate cohorts currently total 74: - /// 23 age + 5 epoch + 18 class + 2 entry + 15 amount + 11 spendable type. - /// Keep small headroom because this is only Vec allocation capacity. - const SEPARATE_COHORT_CAPACITY: usize = 84; - - /// Import all UTXO cohorts from database. - pub(crate) fn forced_import( - db: &Database, - version: Version, - indexes: &indexes::Vecs, - states_path: &Path, - cached_starts: &Windows<&CachedWindowStartVec>, - spot_price: &CachedBoxedVec, - ) -> Result { - let v = version + VERSION; - let prefix = CohortContext::Utxo.prefix(); - - // Phase 1: Import the age-range supply source and its cached all-column view. - let all_full_name = CohortContext::Utxo.full_name(&Filter::All, ""); - let all_cfg = ImportConfig { - db, - filter: &Filter::All, - full_name: &all_full_name, - version: v + Version::ONE, - indexes, - cached_starts, - spot_price, - }; - let age_range_supply = - AgeRangeSupplySources::forced_import(db, prefix, v + AGE_RANGE_SUPPLY_VERSION)?; - let (all_supply, all_supply_cache) = age_range_supply.all(&all_cfg); - let all_chain_cache = AllChainCache::new(&all_supply_cache, spot_price); - - // Phase 2: Import separate (stateful) cohorts. - let age_range = AgeRange::try_from_fn(|id| { - let filter = id.filter().clone(); - let full_name = CohortContext::Utxo.full_name(&filter, id.name().id); - let cfg = ImportConfig { - db, - filter: &filter, - full_name: &full_name, - version: v, - indexes, - cached_starts, - spot_price, - }; - let state = Some(Box::new(UTXOCohortState::new(states_path, &full_name))); - let supply = age_range_supply.column(&cfg, id, &all_supply_cache); - Ok::<_, brk_error::Error>(UTXOCohortVecs::new( - state, - BasicCohortMetrics::forced_import(&cfg, supply)?, - )) - })?; - - let core_separate = - |f: Filter, name: &'static str| -> Result> { - let full_name = CohortContext::Utxo.full_name(&f, name); - let cfg = ImportConfig { - db, - filter: &f, - full_name: &full_name, - version: v, - indexes, - cached_starts, - spot_price, - }; - let state = Some(Box::new(UTXOCohortState::new(states_path, &full_name))); - Ok(UTXOCohortVecs::new( - state, - CoreCohortMetrics::forced_import(&cfg, &all_supply_cache)?, - )) - }; - - let epoch = ByEpoch::try_new(&core_separate)?; - let class = Class::try_new(&core_separate)?; - - let entry = ByEntry::try_new(&core_separate)?; - - // Helper for separate cohorts with MinimalCohortMetrics + MinimalRealizedState - let minimal_separate = - |f: Filter, name: &'static str| -> Result> { - let full_name = CohortContext::Utxo.full_name(&f, name); - let cfg = ImportConfig { - db, - filter: &f, - full_name: &full_name, - version: v, - indexes, - cached_starts, - spot_price, - }; - let state = Some(Box::new(UTXOCohortState::new(states_path, &full_name))); - Ok(UTXOCohortVecs::new( - state, - MinimalCohortMetrics::forced_import(&cfg, &all_supply_cache)?, - )) - }; - - let amount_range = AmountRange::try_new(&minimal_separate)?; - - let type_separate = - |f: Filter, name: &'static str| -> Result> { - let full_name = CohortContext::Utxo.full_name(&f, name); - let cfg = ImportConfig { - db, - filter: &f, - full_name: &full_name, - version: v, - indexes, - cached_starts, - spot_price, - }; - let state = Some(Box::new(UTXOCohortState::new(states_path, &full_name))); - Ok(UTXOCohortVecs::new( - state, - TypeCohortMetrics::forced_import(&cfg, &all_supply_cache)?, - )) - }; - - let type_ = SpendableType::try_new(&type_separate)?; - - // Phase 3: Import "all" cohort with pre-imported supply. - let all = UTXOCohortVecs::new( - None, - AllCohortMetrics::forced_import_with_supply(&all_cfg, all_supply, &all_chain_cache)?, - ); - - // Phase 3b: Import profitability metrics (derived from "all" during k-way merge). - let profitability = - ProfitabilityMetrics::forced_import(db, v, indexes, cached_starts, spot_price)?; - - // Phase 4: Import aggregate cohorts. - - // sth: ExtendedAdjustedCohortMetrics - let sth = { - let f = Filter::Term(Term::Sth); - let full_name = CohortContext::Utxo.full_name(&f, "sth"); - let cfg = ImportConfig { - db, - filter: &f, - full_name: &full_name, - version: v, - indexes, - cached_starts, - spot_price, - }; - UTXOCohortVecs::new( - None, - ExtendedAdjustedCohortMetrics::forced_import( - &cfg, - age_range_supply.filtered(&cfg, &f, &all_supply_cache), - &all_chain_cache, - )?, - ) - }; - - // lth: ExtendedCohortMetrics - let lth = { - let f = Filter::Term(Term::Lth); - let full_name = CohortContext::Utxo.full_name(&f, "lth"); - let cfg = ImportConfig { - db, - filter: &f, - full_name: &full_name, - version: v, - indexes, - cached_starts, - spot_price, - }; - UTXOCohortVecs::new( - None, - ExtendedCohortMetrics::forced_import( - &cfg, - age_range_supply.filtered(&cfg, &f, &all_supply_cache), - &all_chain_cache, - )?, - ) - }; - - // CoreCohortMetrics without state (no state, for aggregate cohorts) - let core_no_state = - |f: Filter, name: &'static str| -> Result> { - let full_name = CohortContext::Utxo.full_name(&f, name); - let cfg = ImportConfig { - db, - filter: &f, - full_name: &full_name, - version: v, - indexes, - cached_starts, - spot_price, - }; - let supply = age_range_supply.filtered(&cfg, &f, &all_supply_cache); - Ok(UTXOCohortVecs::new( - None, - CoreCohortMetrics::forced_import_with_supply(&cfg, supply)?, - )) - }; - - // under_age: CoreCohortMetrics (no state, aggregates from age_range) - let under_age = UnderAge::try_new(&core_no_state)?; - - // over_age: CoreCohortMetrics (no state, aggregates from age_range) - let over_age = OverAge::try_new(&core_no_state)?; - - let minimal_no_state = - |f: Filter, name: &'static str| -> Result> { - let full_name = CohortContext::Utxo.full_name(&f, name); - let cfg = ImportConfig { - db, - filter: &f, - full_name: &full_name, - version: v, - indexes, - cached_starts, - spot_price, - }; - Ok(UTXOCohortVecs::new( - None, - MinimalCohortMetrics::forced_import(&cfg, &all_supply_cache)?, - )) - }; - - let under_amount = UnderAmount::try_new(&minimal_no_state)?; - let over_amount = OverAmount::try_new(&minimal_no_state)?; - - let matured_version = v + MATURED_VERSION; - let matured_sats = - EagerVec::, AgeRangeId>>::forced_import( - db, - &format!("{prefix}_age_range_matured_supply_cumulative_sats"), - matured_version, - )?; - let matured_cents = - EagerVec::, AgeRangeId>>::forced_import( - db, - &format!("{prefix}_age_range_matured_supply_cumulative_cents"), - matured_version, - )?; - let matured_sats_ref = matured_sats.read_only_clone(); - let matured_cents_ref = matured_cents.read_only_clone(); - let matured = AgeRangeId::series(CohortContext::Utxo, |column, name| { - LazyColumnValuePerBlockCumulativeRolling::new( - &format!("{name}_matured_supply"), - matured_version, - &matured_sats_ref, - &matured_cents_ref, - column, - indexes, - cached_starts, - ) - }); - - Ok(Self { - all, - sth, - lth, - epoch, - class, - entry, - type_, - under_age, - over_age, - age_range, - amount_range, - under_amount, - over_amount, - profitability, - age_range_supply, - matured, - cumulative_matured_sats: matured_sats, - cumulative_matured_cents: matured_cents, - all_supply_cache, - caches: UTXOCohortsTransientState::default(), - }) - } - - /// Reset in-memory caches that become stale after rollback. - pub(crate) fn reset_caches(&mut self) { - self.all_supply_cache.clear(); - self.caches = UTXOCohortsTransientState::default(); - } - - pub(crate) fn all_supply_cache(&self) -> &AllSupplyCache { - &self.all_supply_cache - } - - /// Initialize the Fenwick tree from all age-range BTreeMaps. - /// Call after state import when all pending maps have been drained. - pub(crate) fn init_fenwick_if_needed(&mut self) { - if self.caches.fenwick.is_initialized() { - return; - } - let Self { - sth, - caches, - age_range, - .. - } = self; - caches.fenwick.compute_is_sth(&sth.metrics.filter); - - let maps: Vec<_> = AgeRangeId::ALL - .iter() - .filter_map(|&id| { - let sub = id.select(age_range); - let state = sub.state.as_ref()?; - let map = state.cost_basis_map(); - if map.is_empty() { - return None; - } - Some((map, caches.fenwick.is_sth(id))) - }) - .collect(); - caches.fenwick.bulk_init(maps.into_iter()); - } - - /// Apply pending deltas from all age-range cohorts to the Fenwick tree. - /// Call after receive/send, before push_cohort_states. - pub(crate) fn update_fenwick_from_pending(&mut self) { - if !self.caches.fenwick.is_initialized() { - return; - } - // Destructure to get separate borrows on caches and age_range - let Self { - caches, age_range, .. - } = self; - for &id in AgeRangeId::ALL { - let sub = id.select(age_range); - if let Some(state) = sub.state.as_ref() { - let is_sth = caches.fenwick.is_sth(id); - state.for_each_cost_basis_pending(|&price, delta| { - caches.fenwick.apply_delta(price, delta, is_sth); - }); - } - } - } - - /// Push maturation sats to the matured vecs for the given height. - #[inline(always)] - pub(crate) fn push_maturation(&mut self, matured: &AgeRange) { - let mut cumulative = self - .cumulative_matured_sats - .collect_last() - .unwrap_or_default(); - for column in AgeRangeId::ALL { - *column.get_mut(&mut cumulative) += *column.select(matured); - } - self.cumulative_matured_sats.push(cumulative); - } - - fn compute_matured_cents( - &mut self, - starting_height: Height, - prices: &price::Vecs, - exit: &Exit, - ) -> Result<()> { - let cumulative_sats = self.cumulative_matured_sats.read_only_clone(); - let mut previous_sats = None; - - self.cumulative_matured_cents.compute_transform2_batched( - starting_height, - &cumulative_sats, - &prices.spot.cents.height, - WRITE_INTERVAL, - |(height, current_sats, price, target)| { - let prior_sats = previous_sats.replace(current_sats).unwrap_or_else(|| { - height - .decremented() - .and_then(|height| cumulative_sats.collect_one(height)) - .unwrap_or_default() - }); - let mut current_cents = target.collect_last().unwrap_or_default(); - - for column in AgeRangeId::ALL { - let block_sats = *column.get(¤t_sats) - *column.get(&prior_sats); - *column.get_mut(&mut current_cents) += SatsToCents::apply(block_sats, price); - } - - (height, current_cents) - }, - exit, - )?; - Ok(()) - } - - pub(crate) fn par_iter_separate_mut( - &mut self, - ) -> impl ParallelIterator { - let Self { - age_range, - epoch, - class, - entry, - amount_range, - type_, - .. - } = self; - age_range - .par_iter_mut() - .map(|x| x as &mut dyn DynCohortVecs) - .chain(epoch.par_iter_mut().map(|x| x as &mut dyn DynCohortVecs)) - .chain(class.par_iter_mut().map(|x| x as &mut dyn DynCohortVecs)) - .chain(entry.par_iter_mut().map(|x| x as &mut dyn DynCohortVecs)) - .chain( - amount_range - .par_iter_mut() - .map(|x| x as &mut dyn DynCohortVecs), - ) - .chain(type_.par_iter_mut().map(|x| x as &mut dyn DynCohortVecs)) - } - - /// Sequential mutable iterator over all separate (stateful) cohorts. - /// Use instead of `par_iter_separate_mut` when per-item work is trivial. - pub(crate) fn iter_separate_mut(&mut self) -> impl Iterator { - let Self { - age_range, - epoch, - class, - entry, - amount_range, - type_, - .. - } = self; - age_range - .iter_mut() - .map(|x| x as &mut dyn DynCohortVecs) - .chain(epoch.iter_mut().map(|x| x as &mut dyn DynCohortVecs)) - .chain(class.iter_mut().map(|x| x as &mut dyn DynCohortVecs)) - .chain(entry.iter_mut().map(|x| x as &mut dyn DynCohortVecs)) - .chain(amount_range.iter_mut().map(|x| x as &mut dyn DynCohortVecs)) - .chain(type_.iter_mut().map(|x| x as &mut dyn DynCohortVecs)) - } - - /// Immutable iterator over all separate (stateful) cohorts. - pub(crate) fn iter_separate(&self) -> impl Iterator { - self.age_range - .iter() - .map(|x| x as &dyn DynCohortVecs) - .chain(self.epoch.iter().map(|x| x as &dyn DynCohortVecs)) - .chain(self.class.iter().map(|x| x as &dyn DynCohortVecs)) - .chain(self.entry.iter().map(|x| x as &dyn DynCohortVecs)) - .chain(self.amount_range.iter().map(|x| x as &dyn DynCohortVecs)) - .chain(self.type_.iter().map(|x| x as &dyn DynCohortVecs)) - } - - pub(crate) fn compute_overlapping_vecs( - &mut self, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - let Self { - all, - sth, - lth, - age_range, - under_age, - over_age, - over_amount, - amount_range, - under_amount, - .. - } = self; - - let ar = &*age_range; - let amr = &*amount_range; - let si = starting_lengths; - - let tasks: Vec Result<()> + Send + '_>> = vec![ - Box::new(|| { - let sources = filter_sources_from(ar.iter(), None); - all.metrics.compute_base_from_others(si, &sources, exit) - }), - Box::new(|| { - let sources = filter_sources_from(ar.iter(), Some(sth.metrics.filter())); - sth.metrics.compute_base_from_others(si, &sources, exit) - }), - Box::new(|| { - let sources = filter_sources_from(ar.iter(), Some(lth.metrics.filter())); - lth.metrics.compute_base_from_others(si, &sources, exit) - }), - Box::new(|| { - over_age.par_iter_mut().try_for_each(|vecs| { - let sources = filter_sources_from(ar.iter(), Some(&vecs.metrics.filter)); - vecs.metrics.compute_from_base_sources(si, &sources, exit) - }) - }), - Box::new(|| { - under_age.par_iter_mut().try_for_each(|vecs| { - let sources = filter_sources_from(ar.iter(), Some(&vecs.metrics.filter)); - vecs.metrics.compute_from_base_sources(si, &sources, exit) - }) - }), - Box::new(|| { - over_amount - .par_iter_mut() - .chain(under_amount.par_iter_mut()) - .try_for_each(|vecs| { - let sources = - filter_minimal_sources_from(amr.iter(), Some(&vecs.metrics.filter)); - vecs.metrics.compute_from_sources(si, &sources, exit) - }) - }), - ]; - - tasks - .into_par_iter() - .map(|f| f()) - .collect::>>()?; - - Ok(()) - } - - /// First phase of post-processing: compute index transforms. - pub(crate) fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - // 1. Compute all metrics except net_sentiment (all cohorts via DynCohortVecs) - { - let mut all: Vec<&mut dyn DynCohortVecs> = - Vec::with_capacity(Self::SEPARATE_COHORT_CAPACITY + 3); - all.push(&mut self.all); - all.push(&mut self.sth); - all.push(&mut self.lth); - all.extend( - self.under_age - .iter_mut() - .map(|x| x as &mut dyn DynCohortVecs), - ); - all.extend( - self.over_age - .iter_mut() - .map(|x| x as &mut dyn DynCohortVecs), - ); - all.extend( - self.over_amount - .iter_mut() - .map(|x| x as &mut dyn DynCohortVecs), - ); - all.extend( - self.age_range - .iter_mut() - .map(|x| x as &mut dyn DynCohortVecs), - ); - all.extend(self.epoch.iter_mut().map(|x| x as &mut dyn DynCohortVecs)); - all.extend(self.class.iter_mut().map(|x| x as &mut dyn DynCohortVecs)); - all.extend(self.entry.iter_mut().map(|x| x as &mut dyn DynCohortVecs)); - all.extend( - self.amount_range - .iter_mut() - .map(|x| x as &mut dyn DynCohortVecs), - ); - all.extend( - self.under_amount - .iter_mut() - .map(|x| x as &mut dyn DynCohortVecs), - ); - all.extend(self.type_.iter_mut().map(|x| x as &mut dyn DynCohortVecs)); - all.into_par_iter() - .try_for_each(|v| v.compute_rest_part1(prices, starting_lengths, exit))?; - } - - // Compute matured cumulative cents from the cumulative sats matrix × price. - self.compute_matured_cents(starting_lengths.height, prices, exit)?; - - // Compute profitability supply cents and realized price - self.profitability.compute(prices, starting_lengths, exit)?; - - Ok(()) - } - - /// Second phase of post-processing: compute relative metrics. - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - // Get under_1h value sources for adjusted computation (cloned to avoid borrow conflicts). - let under_1h_value_created = self - .age_range - .under_1h - .metrics - .activity - .transfer_volume - .block - .cents - .clone(); - let under_1h_value_destroyed = self - .age_range - .under_1h - .metrics - .realized - .sopr - .value_destroyed - .cumulative - .height - .read_only_clone(); - - // "all" cohort computed first. - self.all.metrics.compute_rest_part2( - prices, - starting_lengths, - &under_1h_value_created, - &under_1h_value_destroyed, - exit, - )?; - - // Destructure to allow parallel mutable access to independent fields. - let Self { - sth, - lth, - age_range, - under_age, - over_age, - over_amount, - amount_range, - under_amount, - epoch, - class, - entry, - type_, - .. - } = self; - - // All remaining groups run in parallel. Each closure owns an exclusive &mut - // to its field and shares read-only references to common data. - let vc = &under_1h_value_created; - let vd = &under_1h_value_destroyed; - let tasks: Vec Result<()> + Send + '_>> = vec![ - Box::new(|| { - sth.metrics - .compute_rest_part2(prices, starting_lengths, vc, vd, exit) - }), - Box::new(|| { - lth.metrics - .compute_rest_part2(prices, starting_lengths, exit) - }), - Box::new(|| { - age_range - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - Box::new(|| { - under_age - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - Box::new(|| { - over_age - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - Box::new(|| { - over_amount - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - Box::new(|| { - epoch - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - Box::new(|| { - class - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - Box::new(|| { - entry - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - Box::new(|| { - amount_range - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - Box::new(|| { - under_amount - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - Box::new(|| { - type_ - .par_iter_mut() - .try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_lengths, exit)) - }), - ]; - - tasks - .into_par_iter() - .map(|f| f()) - .collect::>>()?; - - Ok(()) - } - - /// Returns a parallel iterator over all vecs for parallel writing. - pub(crate) fn par_iter_vecs_mut( - &mut self, - ) -> impl ParallelIterator { - let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::with_capacity(2048); - vecs.extend(self.all.metrics.collect_all_vecs_mut()); - vecs.extend(self.sth.metrics.collect_all_vecs_mut()); - vecs.extend(self.lth.metrics.collect_all_vecs_mut()); - for v in self.age_range.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - for v in self.under_age.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - for v in self.over_age.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - for v in self.over_amount.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - for v in self.epoch.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - for v in self.class.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - for v in self.entry.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - for v in self.amount_range.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - for v in self.under_amount.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - for v in self.type_.iter_mut() { - vecs.extend(v.metrics.collect_all_vecs_mut()); - } - vecs.extend(self.profitability.collect_all_vecs_mut()); - vecs.extend(self.age_range_supply.stored_vecs_mut()); - vecs.push(&mut self.cumulative_matured_sats); - vecs.push(&mut self.cumulative_matured_cents); - vecs.into_par_iter() - } - - /// Commit all states to disk (separate from vec writes for parallelization). - pub(crate) fn commit_all_states(&mut self, height: Height, cleanup: bool) -> Result<()> { - self.par_iter_separate_mut() - .try_for_each(|v| v.write_state(height, cleanup)) - } - - pub(crate) fn min_stateful_len(&self) -> Height { - self.iter_separate() - .map(|v| Height::from(v.min_stateful_len())) - .chain(std::iter::once(Height::from( - self.cumulative_matured_sats.len(), - ))) - .min() - .unwrap_or_default() - .min(Height::from(self.age_range_supply.len())) - .min(Height::from(self.profitability.min_stateful_len())) - .min(Height::from(self.all.min_stateful_len())) - .min(Height::from(self.sth.min_stateful_len())) - .min(Height::from(self.lth.min_stateful_len())) - } - - /// Import state for all separate cohorts at or before given height. - /// Returns true if all imports succeeded and returned the expected height. - pub(crate) fn import_separate_states(&mut self, height: Height) -> bool { - self.par_iter_separate_mut() - .map(|v| v.import_state(height).unwrap_or_default()) - .all(|h| h == height) - } - - /// Reset state heights for all separate cohorts. - pub(crate) fn reset_separate_state_heights(&mut self) { - self.iter_separate_mut() - .for_each(|v| v.reset_state_starting_height()); - } - - /// Reset cost_basis_data for all separate cohorts (called during fresh start). - pub(crate) fn reset_separate_cost_basis_data(&mut self) -> Result<()> { - self.iter_separate_mut() - .try_for_each(|v| v.reset_cost_basis_data_if_needed()) - } - - /// Validate computed versions for all cohorts. - pub(crate) fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - // Validate separate cohorts - self.iter_separate_mut() - .try_for_each(|v| v.validate_computed_versions(base_version))?; - - // Validate aggregate cohorts - self.all.metrics.validate_computed_versions(base_version)?; - self.sth.metrics.validate_computed_versions(base_version)?; - self.lth.metrics.validate_computed_versions(base_version)?; - for v in self.over_age.iter_mut() { - v.metrics.validate_computed_versions(base_version)?; - } - for v in self.under_age.iter_mut() { - v.metrics.validate_computed_versions(base_version)?; - } - Ok(()) - } - - /// Aggregate RealizedFull fields from age_range states and push to all/sth/lth. - /// Called during the block loop after separate cohorts' push_state but before reset. - pub(crate) fn push_overlapping(&mut self, height_price: Cents) -> Cents { - let Self { - all, - sth, - lth, - age_range, - age_range_supply, - .. - } = self; - - let sth_filter = &sth.metrics.filter; - - let mut all_acc = RealizedFullAccum::default(); - let mut sth_acc = RealizedFullAccum::default(); - let mut lth_acc = RealizedFullAccum::default(); - - let mut all_ccap = (0u128, 0u128); - let mut sth_ccap = (0u128, 0u128); - let mut lth_ccap = (0u128, 0u128); - - let mut total_supply = AgeRangeId::from_fn(|_| Sats::ZERO); - let mut supply_in_profit = AgeRangeId::from_fn(|_| Sats::ZERO); - let mut supply_in_loss = AgeRangeId::from_fn(|_| Sats::ZERO); - - for &id in AgeRangeId::ALL { - let ar = id.select_mut(age_range); - if let Some(state) = ar.state.as_mut() { - all_acc.add(&state.realized); - - let u = state.compute_unrealized_state(height_price); - *id.get_mut(&mut total_supply) = state.supply.value; - *id.get_mut(&mut supply_in_profit) = u.supply_in_profit; - *id.get_mut(&mut supply_in_loss) = u.supply_in_loss; - all_ccap.0 += u.capitalized_cap_in_profit_raw; - all_ccap.1 += u.capitalized_cap_in_loss_raw; - - if sth_filter.includes(&ar.metrics.filter) { - sth_acc.add(&state.realized); - sth_ccap.0 += u.capitalized_cap_in_profit_raw; - sth_ccap.1 += u.capitalized_cap_in_loss_raw; - } else { - lth_acc.add(&state.realized); - lth_ccap.0 += u.capitalized_cap_in_profit_raw; - lth_ccap.1 += u.capitalized_cap_in_loss_raw; - } - } - } - - age_range_supply.push(total_supply, supply_in_profit, supply_in_loss); - - let all_capitalized_price = all.metrics.realized.push_accum(&all_acc); - sth.metrics.realized.push_accum(&sth_acc); - lth.metrics.realized.push_accum(<h_acc); - - all.metrics - .unrealized - .capitalized_cap_in_profit_raw - .push(CentsSquaredSats::new(all_ccap.0)); - all.metrics - .unrealized - .capitalized_cap_in_loss_raw - .push(CentsSquaredSats::new(all_ccap.1)); - sth.metrics - .unrealized - .capitalized_cap_in_profit_raw - .push(CentsSquaredSats::new(sth_ccap.0)); - sth.metrics - .unrealized - .capitalized_cap_in_loss_raw - .push(CentsSquaredSats::new(sth_ccap.1)); - lth.metrics - .unrealized - .capitalized_cap_in_profit_raw - .push(CentsSquaredSats::new(lth_ccap.0)); - lth.metrics - .unrealized - .capitalized_cap_in_loss_raw - .push(CentsSquaredSats::new(lth_ccap.1)); - - all_capitalized_price - } -} - -/// Filter source cohorts by an optional filter. -/// If filter is None, returns all sources (used for "all" aggregate). -fn filter_sources_from<'a, M: CohortMetricsBase + 'a>( - sources: impl Iterator>, - filter: Option<&Filter>, -) -> Vec<&'a M> { - match filter { - Some(f) => sources - .filter(|v| f.includes(v.metrics.filter())) - .map(|v| &v.metrics) - .collect(), - None => sources.map(|v| &v.metrics).collect(), - } -} - -/// Filter MinimalCohortMetrics source cohorts by an optional filter. -fn filter_minimal_sources_from<'a>( - sources: impl Iterator>, - filter: Option<&Filter>, -) -> Vec<&'a MinimalCohortMetrics> { - match filter { - Some(f) => sources - .filter(|v| f.includes(&v.metrics.filter)) - .map(|v| &v.metrics) - .collect(), - None => sources.map(|v| &v.metrics).collect(), - } -} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/mod.rs b/crates/brk_computer/src/distribution/cohorts/utxo/mod.rs deleted file mode 100644 index ab4ad6ddd..000000000 --- a/crates/brk_computer/src/distribution/cohorts/utxo/mod.rs +++ /dev/null @@ -1,12 +0,0 @@ -mod fenwick; -mod groups; -mod percentiles; -mod receive; -mod send; -mod tick_tock; -mod vecs; - -/// Rounding precision for UTXO cost basis prices (5 significant digits in dollars). -const COST_BASIS_PRICE_DIGITS: i32 = 5; - -pub use groups::*; diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs b/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs deleted file mode 100644 index f63bd0fa9..000000000 --- a/crates/brk_computer/src/distribution/cohorts/utxo/percentiles.rs +++ /dev/null @@ -1,285 +0,0 @@ -use std::{ - cmp::Reverse, - collections::{BTreeMap, BinaryHeap}, - path::Path, -}; - -use brk_cohort::{ - AgeRangeId, CohortContext, Filtered, PROFITABILITY_RANGE_COUNT, TERM_NAMES, UTXO_ALL_NAME, -}; -use brk_error::Result; -use brk_types::{Cents, CentsCompact, Date, Dollars, PartsPerMillion32, Sats, UrpdRaw}; -use rayon::prelude::*; -use vecdb::ColumnId; - -use crate::distribution::metrics::{CostBasis, ProfitabilityMetrics}; - -use super::{ - fenwick::{PercentileResult, ProfitabilityRangeResult}, - groups::UTXOCohorts, -}; - -use super::COST_BASIS_PRICE_DIGITS; - -impl UTXOCohorts { - /// Compute and push percentiles + profitability for aggregate cohorts. - /// - /// Percentiles and profitability are computed per-block from the Fenwick tree. - /// Disk distributions are written only at day boundaries via K-way merge. - pub(crate) fn push_aggregate_percentiles( - &mut self, - spot_price: Cents, - date_opt: Option, - states_path: &Path, - ) -> Result<()> { - if self.caches.fenwick.is_initialized() { - self.push_fenwick_results(spot_price); - } - - // Disk distributions only at day boundaries - if let Some(date) = date_opt { - self.write_disk_distributions(date, states_path)?; - } - - Ok(()) - } - - /// Iterate over the current in-memory age-cohort URPD entries. - /// - /// Prices use the same rounding as the persisted daily distributions, so - /// consumers can avoid writing and immediately rereading the current day. - pub(crate) fn age_range_urpd_entries( - &self, - ) -> impl Iterator + '_ { - AgeRangeId::ALL.iter().copied().flat_map(move |id| { - let cohort = id.select(&self.age_range); - cohort.state.iter().flat_map(move |state| { - state - .cost_basis_map() - .iter() - .map(move |(&price, &sats)| (id, rounded_urpd_price(price), sats)) - }) - }) - } - - /// Push all Fenwick-derived per-block results: percentiles, density, profitability. - fn push_fenwick_results(&mut self, spot_price: Cents) { - let (all_d, sth_d, lth_d) = self.caches.fenwick.density(spot_price); - - let all = self.caches.fenwick.percentiles_all(); - push_cost_basis(&all, all_d, &mut self.all.metrics.cost_basis); - - let sth = self.caches.fenwick.percentiles_sth(); - push_cost_basis(&sth, sth_d, &mut self.sth.metrics.cost_basis); - - let lth = self.caches.fenwick.percentiles_lth(); - push_cost_basis(<h, lth_d, &mut self.lth.metrics.cost_basis); - - let prof = self.caches.fenwick.profitability(spot_price); - push_profitability(&prof, &mut self.profitability); - } - - /// K-way merge only for writing daily cost basis distributions to disk. - fn write_disk_distributions(&mut self, date: Date, states_path: &Path) -> Result<()> { - let sth_filter = self.sth.metrics.filter.clone(); - - AgeRangeId::ALL - .iter() - .map(|&id| (id, id.select(&self.age_range))) - .collect::>() - .into_par_iter() - .try_for_each(|(id, sub)| -> Result<()> { - let Some(state) = sub.state.as_ref() else { - return Ok(()); - }; - let mut merged: Vec<(CentsCompact, Sats)> = Vec::new(); - for (&price, &sats) in state.cost_basis_map().iter() { - let rounded = rounded_urpd_price(price); - if let Some(last) = merged.last_mut() - && last.0 == rounded - { - last.1 += sats; - } else { - merged.push((rounded, sats)); - } - } - let full = CohortContext::Utxo.prefixed(id.name().id); - UrpdRaw::write(states_path, &full, date, merged.into_iter()) - })?; - - let maps: Vec<_> = self - .age_range - .iter() - .filter_map(|sub| { - let state = sub.state.as_ref()?; - let map = state.cost_basis_map(); - if map.is_empty() { - return None; - } - let is_sth = sth_filter.includes(sub.filter()); - Some((map, is_sth)) - }) - .collect(); - - if maps.is_empty() { - return Ok(()); - } - - let cap = maps.iter().map(|(m, _)| m.len()).max().unwrap_or(0); - let mut targets = AllSthLth { - all: MergeTarget::new(cap), - sth: MergeTarget::new(cap), - lth: MergeTarget::new(cap), - }; - - merge_k_way(&maps, &mut targets); - - [ - (UTXO_ALL_NAME.id, targets.all.merged), - (TERM_NAMES.short.id, targets.sth.merged), - (TERM_NAMES.long.id, targets.lth.merged), - ] - .into_par_iter() - .try_for_each(|(name, merged)| { - UrpdRaw::write(states_path, name, date, merged.into_iter()) - })?; - - Ok(()) - } -} - -#[inline] -fn rounded_urpd_price(price: CentsCompact) -> CentsCompact { - price.round_to_dollar(COST_BASIS_PRICE_DIGITS) -} - -/// Push percentiles + density to cost basis vecs. -#[inline(always)] -fn push_cost_basis( - percentiles: &PercentileResult, - density: PartsPerMillion32, - cost_basis: &mut CostBasis, -) { - cost_basis.push_minmax(percentiles.min_price, percentiles.max_price); - cost_basis.push_percentiles(&percentiles.sat_prices, &percentiles.usd_prices); - cost_basis.push_density(density); -} - -#[inline(always)] -fn raw_usd_to_dollars(raw: u128) -> Dollars { - Dollars::from(raw as f64 / 1e10) -} - -fn push_profitability( - buckets: &[ProfitabilityRangeResult; PROFITABILITY_RANGE_COUNT], - metrics: &mut ProfitabilityMetrics, -) { - metrics.push_ranges( - (*buckets).map(|range| Sats::from(range.all_sats)), - (*buckets).map(|range| Sats::from(range.sth_sats)), - (*buckets).map(|range| raw_usd_to_dollars(range.all_usd)), - (*buckets).map(|range| raw_usd_to_dollars(range.sth_usd)), - ); -} - -// --------------------------------------------------------------------------- -// K-way merge (retained only for disk distribution writes) -// --------------------------------------------------------------------------- - -struct AllSthLth { - all: T, - sth: T, - lth: T, -} - -impl AllSthLth { - fn term_mut(&mut self, is_sth: bool) -> &mut T { - if is_sth { &mut self.sth } else { &mut self.lth } - } - - fn for_each_mut(&mut self, mut f: impl FnMut(&mut T)) { - f(&mut self.all); - f(&mut self.sth); - f(&mut self.lth); - } -} - -/// Merge target that only collects rounded (price, sats) pairs for disk distribution. -struct MergeTarget { - price_sats: u64, - merged: Vec<(CentsCompact, Sats)>, -} - -impl MergeTarget { - fn new(cap: usize) -> Self { - Self { - price_sats: 0, - merged: Vec::with_capacity(cap), - } - } - - #[inline] - fn accumulate(&mut self, amount: u64) { - self.price_sats += amount; - } - - fn finalize_price(&mut self, price: CentsCompact) { - if self.price_sats > 0 { - let rounded = rounded_urpd_price(price); - if let Some((lp, ls)) = self.merged.last_mut() - && *lp == rounded - { - *ls += Sats::from(self.price_sats); - } else { - self.merged.push((rounded, Sats::from(self.price_sats))); - } - } - self.price_sats = 0; - } -} - -/// K-way merge via BinaryHeap over BTreeMap iterators. -/// Only builds merged distribution for disk writes. -fn merge_k_way( - maps: &[(&BTreeMap, bool)], - targets: &mut AllSthLth, -) { - let mut iters: Vec<_> = maps - .iter() - .map(|(map, is_sth)| (map.iter().peekable(), *is_sth)) - .collect(); - - let mut heap: BinaryHeap> = - BinaryHeap::with_capacity(iters.len()); - for (i, (iter, _)) in iters.iter_mut().enumerate() { - if let Some(&(&price, _)) = iter.peek() { - heap.push(Reverse((price, i))); - } - } - - let mut current_price: Option = None; - - while let Some(Reverse((price, ci))) = heap.pop() { - let (ref mut iter, is_sth) = iters[ci]; - let (_, &sats) = iter.next().unwrap(); - let amount = u64::from(sats); - - if let Some(prev) = current_price - && prev != price - { - targets.for_each_mut(|t| t.finalize_price(prev)); - } - - current_price = Some(price); - targets.all.accumulate(amount); - targets.term_mut(is_sth).accumulate(amount); - - if let Some(&(&next_price, _)) = iter.peek() { - heap.push(Reverse((next_price, ci))); - } - } - - if let Some(price) = current_price { - targets.for_each_mut(|t| t.finalize_price(price)); - } -} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/vecs/core.rs b/crates/brk_computer/src/distribution/cohorts/utxo/vecs/core.rs deleted file mode 100644 index 9189a7373..000000000 --- a/crates/brk_computer/src/distribution/cohorts/utxo/vecs/core.rs +++ /dev/null @@ -1,78 +0,0 @@ -use brk_cohort::{Filter, Filtered}; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_types::{Cents, Height, Version}; -use vecdb::{Exit, ReadableVec}; - -use crate::{ - distribution::{cohorts::traits::DynCohortVecs, metrics::CoreCohortMetrics}, - price, -}; - -use super::UTXOCohortVecs; - -impl Filtered for UTXOCohortVecs { - fn filter(&self) -> &Filter { - &self.metrics.filter - } -} - -impl DynCohortVecs for UTXOCohortVecs { - fn min_stateful_len(&self) -> usize { - self.metrics.min_stateful_len() - } - - fn reset_state_starting_height(&mut self) { - self.reset_state_impl(); - } - - impl_import_state!(); - - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.metrics.validate_computed_versions(base_version) - } - - fn push_state(&mut self, height: Height) { - if self.state_starting_height.is_some_and(|h| h > height) { - return; - } - - if let Some(state) = self.state.as_ref() { - self.metrics.supply.push_state(state); - self.metrics.outputs.push_state(state); - self.metrics.activity.push_state(state); - self.metrics.realized.push_state(state); - } - } - - fn push_unrealized_state(&mut self, height_price: Cents) { - if let Some(state) = self.state.as_mut() { - state.apply_pending(); - let unrealized_state = state.compute_unrealized_state(height_price); - self.metrics.unrealized.push_state(&unrealized_state); - self.metrics.supply.push_profitability(&unrealized_state); - } - } - - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.metrics - .compute_rest_part1(prices, starting_lengths, exit) - } - - fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { - self.write_state_impl(height, cleanup) - } - - fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { - self.reset_cost_basis_impl() - } - - fn reset_single_iteration_values(&mut self) { - self.reset_iteration_impl(); - } -} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/vecs/minimal.rs b/crates/brk_computer/src/distribution/cohorts/utxo/vecs/minimal.rs deleted file mode 100644 index d01a2c7cf..000000000 --- a/crates/brk_computer/src/distribution/cohorts/utxo/vecs/minimal.rs +++ /dev/null @@ -1,71 +0,0 @@ -use brk_cohort::{Filter, Filtered}; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_types::{Cents, Height, Version}; -use vecdb::{Exit, ReadableVec}; - -use crate::{ - distribution::{cohorts::traits::DynCohortVecs, metrics::MinimalCohortMetrics}, - price, -}; - -use super::UTXOCohortVecs; - -impl Filtered for UTXOCohortVecs { - fn filter(&self) -> &Filter { - &self.metrics.filter - } -} - -impl DynCohortVecs for UTXOCohortVecs { - fn min_stateful_len(&self) -> usize { - self.metrics.min_stateful_len() - } - - fn reset_state_starting_height(&mut self) { - self.reset_state_impl(); - } - - impl_import_state!(); - - fn validate_computed_versions(&mut self, _base_version: Version) -> Result<()> { - Ok(()) - } - - fn push_state(&mut self, height: Height) { - if self.state_starting_height.is_some_and(|h| h > height) { - return; - } - - if let Some(state) = self.state.as_ref() { - self.metrics.supply.push_state(state); - self.metrics.outputs.push_state(state); - self.metrics.activity.push_state(state); - self.metrics.realized.push_state(state); - } - } - - fn push_unrealized_state(&mut self, _height_price: Cents) {} - - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.metrics - .compute_rest_part1(prices, starting_lengths, exit) - } - - fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { - self.write_state_impl(height, cleanup) - } - - fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { - self.reset_cost_basis_impl() - } - - fn reset_single_iteration_values(&mut self) { - self.reset_iteration_impl(); - } -} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/vecs/mod.rs b/crates/brk_computer/src/distribution/cohorts/utxo/vecs/mod.rs deleted file mode 100644 index cfedfc50b..000000000 --- a/crates/brk_computer/src/distribution/cohorts/utxo/vecs/mod.rs +++ /dev/null @@ -1,209 +0,0 @@ -macro_rules! impl_import_state { - () => { - fn import_state(&mut self, starting_height: Height) -> Result { - if let Some(state) = self.state.as_mut() { - if let Some(mut prev_height) = starting_height.decremented() { - prev_height = state.import_at_or_before(prev_height)?; - - state.supply.value = self - .metrics - .supply - .total - .sats - .height - .collect_one(prev_height) - .unwrap(); - state.supply.utxo_count = *self - .metrics - .outputs - .unspent_count - .height - .collect_one(prev_height) - .unwrap(); - - state.restore_realized_cap(); - - let result = prev_height.incremented(); - self.state_starting_height = Some(result); - Ok(result) - } else { - self.state_starting_height = Some(Height::ZERO); - Ok(Height::ZERO) - } - } else { - self.state_starting_height = Some(starting_height); - Ok(starting_height) - } - } - }; -} - -mod core; -mod minimal; -mod r#type; - -use brk_cohort::{Filter, Filtered}; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Cents, Height, Version}; -use vecdb::{Exit, ReadableVec}; - -use crate::{ - distribution::{ - cohorts::traits::DynCohortVecs, - metrics::{CohortMetricsBase, CohortMetricsState}, - state::UTXOCohortState, - }, - price, -}; - -#[derive(Traversable)] -pub struct UTXOCohortVecs { - #[traversable(skip)] - state_starting_height: Option, - - #[traversable(skip)] - pub state: Option>>, - - #[traversable(flatten)] - pub metrics: M, -} - -impl UTXOCohortVecs { - pub(crate) fn new( - state: Option>>, - metrics: M, - ) -> Self { - Self { - state_starting_height: None, - state, - metrics, - } - } - - fn reset_state_impl(&mut self) { - self.state_starting_height = Some(Height::ZERO); - if let Some(state) = self.state.as_mut() { - state.reset(); - } - } - - fn write_state_impl(&mut self, height: Height, cleanup: bool) -> Result<()> { - if let Some(state) = self.state.as_mut() { - state.write(height, cleanup)?; - } - Ok(()) - } - - fn reset_cost_basis_impl(&mut self) -> Result<()> { - if let Some(state) = self.state.as_mut() { - state.reset_cost_basis_data_if_needed()?; - } - Ok(()) - } - - fn reset_iteration_impl(&mut self) { - if let Some(state) = self.state.as_mut() { - state.reset_single_iteration_values(); - } - } -} - -// --- Blanket impl for CohortMetricsBase types (always use full RealizedState) --- - -impl Filtered for UTXOCohortVecs { - fn filter(&self) -> &Filter { - self.metrics.filter() - } -} - -impl DynCohortVecs for UTXOCohortVecs { - fn min_stateful_len(&self) -> usize { - self.metrics.min_stateful_len() - } - - fn reset_state_starting_height(&mut self) { - self.reset_state_impl(); - } - - fn import_state(&mut self, starting_height: Height) -> Result { - if let Some(state) = self.state.as_mut() { - if let Some(mut prev_height) = starting_height.decremented() { - prev_height = state.import_at_or_before(prev_height)?; - - state.supply.value = self - .metrics - .supply() - .total - .sats - .height - .collect_one(prev_height) - .unwrap(); - state.supply.utxo_count = *self - .metrics - .outputs() - .unspent_count - .height - .collect_one(prev_height) - .unwrap(); - - state.restore_realized_cap(); - - let result = prev_height.incremented(); - self.state_starting_height = Some(result); - Ok(result) - } else { - self.state_starting_height = Some(Height::ZERO); - Ok(Height::ZERO) - } - } else { - self.state_starting_height = Some(starting_height); - Ok(starting_height) - } - } - - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.metrics.validate_computed_versions(base_version) - } - - fn push_state(&mut self, height: Height) { - if self.state_starting_height.is_some_and(|h| h > height) { - return; - } - - if let Some(state) = self.state.as_ref() { - self.metrics.push_state(state); - } - } - - fn push_unrealized_state(&mut self, height_price: Cents) { - if let Some(state) = self.state.as_mut() { - self.metrics - .compute_and_push_unrealized(height_price, state); - } - } - - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.metrics - .compute_rest_part1(prices, starting_lengths, exit)?; - Ok(()) - } - - fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { - self.write_state_impl(height, cleanup) - } - - fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { - self.reset_cost_basis_impl() - } - - fn reset_single_iteration_values(&mut self) { - self.reset_iteration_impl(); - } -} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/vecs/type.rs b/crates/brk_computer/src/distribution/cohorts/utxo/vecs/type.rs deleted file mode 100644 index fecee7ce4..000000000 --- a/crates/brk_computer/src/distribution/cohorts/utxo/vecs/type.rs +++ /dev/null @@ -1,77 +0,0 @@ -use brk_cohort::{Filter, Filtered}; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_types::{Cents, Height, Version}; -use vecdb::{Exit, ReadableVec}; - -use crate::{ - distribution::cohorts::traits::DynCohortVecs, distribution::metrics::TypeCohortMetrics, price, -}; - -use super::UTXOCohortVecs; - -impl Filtered for UTXOCohortVecs { - fn filter(&self) -> &Filter { - &self.metrics.filter - } -} - -impl DynCohortVecs for UTXOCohortVecs { - fn min_stateful_len(&self) -> usize { - self.metrics.min_stateful_len() - } - - fn reset_state_starting_height(&mut self) { - self.reset_state_impl(); - } - - impl_import_state!(); - - fn validate_computed_versions(&mut self, _base_version: Version) -> Result<()> { - Ok(()) - } - - fn push_state(&mut self, height: Height) { - if self.state_starting_height.is_some_and(|h| h > height) { - return; - } - - if let Some(state) = self.state.as_ref() { - self.metrics.supply.push_state(state); - self.metrics.outputs.push_state(state); - self.metrics.activity.push_state(state); - self.metrics.realized.push_state(state); - } - } - - fn push_unrealized_state(&mut self, height_price: Cents) { - if let Some(state) = self.state.as_mut() { - state.apply_pending(); - let unrealized_state = state.compute_unrealized_state(height_price); - self.metrics.unrealized.push_state(&unrealized_state); - self.metrics.supply.push_profitability(&unrealized_state); - } - } - - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.metrics - .compute_rest_part1(prices, starting_lengths, exit) - } - - fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { - self.write_state_impl(height, cleanup) - } - - fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { - self.reset_cost_basis_impl() - } - - fn reset_single_iteration_values(&mut self) { - self.reset_iteration_impl(); - } -} diff --git a/crates/brk_computer/src/distribution/compute/block_loop.rs b/crates/brk_computer/src/distribution/compute/block_loop.rs index 740df3bcf..4a35cc495 100644 --- a/crates/brk_computer/src/distribution/compute/block_loop.rs +++ b/crates/brk_computer/src/distribution/compute/block_loop.rs @@ -1,4 +1,4 @@ -use brk_cohort::{ByAddrType, EntryPrice}; +use brk_cohort::{ByAddrType, EntryPrice, Filter, Term}; use brk_error::Result; use brk_indexer::Indexer; use brk_types::{ @@ -10,7 +10,7 @@ use vecdb::{AnyVec, Exit, ReadableVec, VecIndex, unlikely}; use crate::{ distribution::{ - addr::AddrMetricsState, + addr::{AddrMetricsState, FundedAddrCountsVecs}, block::{ AddrCache, TransferAddressCache, process_inputs, process_outputs, process_received, process_sent, @@ -24,18 +24,21 @@ use crate::{ use super::{ super::{ RangeMap, - cohorts::{AddrCohorts, DynCohortVecs, UTXOCohorts}, + metrics::CohortMetrics, + state::{AddrStates, UTXOStates}, vecs::Vecs, }, - BIP30_DUPLICATE_HEIGHT_1, BIP30_DUPLICATE_HEIGHT_2, BIP30_ORIGINAL_HEIGHT_1, + AddrReaders, BIP30_DUPLICATE_HEIGHT_1, BIP30_DUPLICATE_HEIGHT_2, BIP30_ORIGINAL_HEIGHT_1, BIP30_ORIGINAL_HEIGHT_2, ComputeContext, FLUSH_INTERVAL, IndexToTxIndexBuf, PriceRangeMax, - TxInReaders, TxOutReaders, VecsReaders, + TxInReaders, TxOutReaders, }; /// Process all blocks from starting_height to last_height. #[allow(clippy::too_many_arguments)] pub(crate) fn process_blocks( vecs: &mut Vecs, + utxo_states: &mut UTXOStates, + addr_states: &mut AddrStates, indexer: &Indexer, indexes: &indexes::Vecs, inputs: &inputs::Vecs, @@ -101,9 +104,9 @@ pub(crate) fn process_blocks( }) .collect(); - debug!("creating VecsReaders"); - let mut vr = VecsReaders::new(&vecs.any_addr_indexes, &vecs.addrs_data); - debug!("VecsReaders created"); + debug!("creating AddrReaders"); + let mut vr = AddrReaders::new(&vecs.any_addr_indexes, &vecs.addrs_data); + debug!("AddrReaders created"); // Extend tx_index_to_height RangeMap with new entries (incremental, O(new_blocks)) let target_len = indexer.vecs().transactions.first_tx_index.len(); @@ -201,15 +204,14 @@ pub(crate) fn process_blocks( debug!("AddrCache created, entering main loop"); // Initialize Fenwick tree from imported BTreeMap state (one-time) - vecs.utxo_cohorts.init_fenwick_if_needed(); + utxo_states.init_fenwick_if_needed(&Filter::Term(Term::Sth)); // Pre-truncate all stored vecs to starting_height (one-time). // This eliminates per-push truncation checks inside the block loop. { let start = starting_height.to_usize(); - vecs.utxo_cohorts + vecs.cohorts .par_iter_vecs_mut() - .chain(vecs.addr_cohorts.par_iter_vecs_mut()) .chain(vecs.addrs.par_iter_height_mut()) .chain(rayon::iter::once(vecs.coinblocks_destroyed.stored_mut())) .try_for_each(|v| v.any_truncate_if_needed_at(start))?; @@ -263,10 +265,7 @@ pub(crate) fn process_blocks( // Keep tick-tock concurrent with the block reads and address processing. let (matured, (outputs_result, inputs_result)) = rayon::join( - || { - vecs.utxo_cohorts - .tick_tock_next_block(chain_state, timestamp) - }, + || utxo_states.tick_tock_next_block(chain_state, timestamp), || { // Collect both sides concurrently, then load their shared addresses once. let ( @@ -389,7 +388,7 @@ pub(crate) fn process_blocks( } // Record maturation (sats crossing age boundaries) - vecs.utxo_cohorts.push_maturation(&matured); + vecs.cohorts.supply.push_maturation(&matured, block_price); transfer_addresses.prepare(&outputs_result.received_data); @@ -397,11 +396,9 @@ pub(crate) fn process_blocks( let (_, addr_result) = rayon::join( || { // UTXO cohorts receive/send - vecs.utxo_cohorts - .receive(transacted, height, timestamp, block_price, entry); + utxo_states.receive(transacted, height, timestamp, block_price, entry); if let Some(min_h) = - vecs.utxo_cohorts - .send(height_to_sent, chain_state, ctx.price_range_max) + utxo_states.send(height_to_sent, chain_state, ctx.price_range_max) { min_supply_modified = Some(min_supply_modified.map_or(min_h, |cur| cur.min(min_h))); @@ -412,7 +409,7 @@ pub(crate) fn process_blocks( process_received( outputs_result.received_data, - &mut vecs.addr_cohorts, + addr_states, &mut lookup, block_price, &mut state, @@ -420,7 +417,7 @@ pub(crate) fn process_blocks( process_sent( inputs_result.sent_data, - &mut vecs.addr_cohorts, + addr_states, &mut lookup, block_price, &mut state, @@ -432,7 +429,7 @@ pub(crate) fn process_blocks( addr_result?; // Update Fenwick tree from pending deltas (must happen before push_cohort_states drains pending) - vecs.utxo_cohorts.update_fenwick_from_pending(); + utxo_states.update_fenwick_from_pending(); let active_addr_count = state.activity.active(); vecs.addrs.push_height(&state, active_addr_count); @@ -441,14 +438,20 @@ pub(crate) fn process_blocks( let date_opt = is_last_of_day.then(|| Date::from(timestamp)); entry_anchor = push_cohort_states( - &mut vecs.utxo_cohorts, - &mut vecs.addr_cohorts, + &mut vecs.cohorts, + &mut vecs.addrs.funded, + utxo_states, + addr_states, height, block_price, ); - vecs.utxo_cohorts - .push_aggregate_percentiles(block_price, date_opt, &vecs.states_path)?; + vecs.cohorts.push_aggregate_percentiles( + utxo_states, + block_price, + date_opt, + &vecs.states_path, + )?; // Periodic checkpoint flush if height != last_height @@ -471,12 +474,20 @@ pub(crate) fn process_blocks( let _lock = exit.lock(); // Write to disk (pure I/O) - no changes saved for periodic flushes - write(vecs, height, chain_state, min_supply_modified, false)?; + write( + vecs, + utxo_states, + addr_states, + height, + chain_state, + min_supply_modified, + false, + )?; min_supply_modified = None; vecs.flush()?; // Recreate readers - vr = VecsReaders::new(&vecs.any_addr_indexes, &vecs.addrs_data); + vr = AddrReaders::new(&vecs.any_addr_indexes, &vecs.addrs_data); } } @@ -496,44 +507,43 @@ pub(crate) fn process_blocks( )?; // Write to disk (pure I/O) - save changes for rollback - write(vecs, last_height, chain_state, min_supply_modified, true)?; + write( + vecs, + utxo_states, + addr_states, + last_height, + chain_state, + min_supply_modified, + true, + )?; Ok(()) } /// Push cohort states to height-indexed vectors, then reset per-block values. fn push_cohort_states( - utxo_cohorts: &mut UTXOCohorts, - addr_cohorts: &mut AddrCohorts, + cohorts: &mut CohortMetrics, + funded_addr_counts: &mut FundedAddrCountsVecs, + utxo_states: &mut UTXOStates, + addr_states: &mut AddrStates, height: Height, height_price: Cents, ) -> Cents { - // Phase 1: push + unrealized (no reset yet, states still needed for aggregation) - rayon::join( - || { - utxo_cohorts.par_iter_separate_mut().for_each(|v| { - v.push_state(height); - v.push_unrealized_state(height_price); - }) - }, - || { - addr_cohorts.par_iter_separate_mut().for_each(|v| { - v.push_state(height); - v.push_unrealized_state(height_price); - }) - }, - ); + // Phase 1: finish state updates before metric-first sources read them. + utxo_states.apply_pending(); + addr_states.push(cohorts, funded_addr_counts, height, height_price); - // Phase 2: aggregate age_range states → push to overlapping cohorts - let all_capitalized_price = utxo_cohorts.push_overlapping(height_price); + // Phase 2: push the typed supply matrices, then aggregate age-range states. + let unrealized_states = cohorts.push_supply_and_unrealized(utxo_states, height_price); + cohorts.push_outputs(utxo_states); + cohorts.push_activity(utxo_states, height_price); + cohorts.push_realized(utxo_states); + let all_capitalized_price = + cohorts.push_overlapping(utxo_states, height_price, &unrealized_states); // Phase 3: reset per-block values - utxo_cohorts - .iter_separate_mut() - .for_each(|v| v.reset_single_iteration_values()); - addr_cohorts - .iter_separate_mut() - .for_each(|v| v.reset_single_iteration_values()); + utxo_states.reset_block(); + addr_states.reset_block(); all_capitalized_price } diff --git a/crates/brk_computer/src/distribution/compute/context.rs b/crates/brk_computer/src/distribution/compute/context.rs index 0d97203f7..f8b4fc8de 100644 --- a/crates/brk_computer/src/distribution/compute/context.rs +++ b/crates/brk_computer/src/distribution/compute/context.rs @@ -1,110 +1,7 @@ -use std::time::Instant; - use brk_types::{Cents, Height, Timestamp}; -use tracing::debug; use vecdb::VecIndex; -/// Sparse table for O(1) range maximum queries on prices. -/// Vec per level for incremental O(new_blocks * log n) extension. -#[derive(Debug, Clone, Default)] -pub struct PriceRangeMax { - levels: Vec>, - n: usize, -} - -impl PriceRangeMax { - pub(crate) fn extend(&mut self, prices: &[Cents]) { - let new_n = prices.len(); - if new_n <= self.n || new_n == 0 { - return; - } - - let start = Instant::now(); - let old_n = self.n; - let new_levels_count = (usize::BITS - new_n.leading_zeros()) as usize; - - while self.levels.len() < new_levels_count { - self.levels.push(Vec::new()); - } - - self.levels[0].extend_from_slice(&prices[old_n..new_n]); - - for k in 1..new_levels_count { - let half = 1 << (k - 1); - let new_end = if new_n >= (1 << k) { - new_n + 1 - (1 << k) - } else { - 0 - }; - - let old_end = self.levels[k].len(); - if new_end > old_end { - let (prev_levels, curr_levels) = self.levels.split_at_mut(k); - let prev = &prev_levels[k - 1]; - let curr = &mut curr_levels[0]; - curr.reserve(new_end - old_end); - for i in old_end..new_end { - curr.push(prev[i].max(prev[i + half])); - } - } - } - - self.n = new_n; - - let elapsed = start.elapsed(); - let total_entries: usize = self.levels.iter().map(|l| l.len()).sum(); - debug!( - "PriceRangeMax extended: {} -> {} heights ({} new), {} levels, {:.2}MB, {:.2}ms", - old_n, - new_n, - new_n - old_n, - new_levels_count, - (total_entries * std::mem::size_of::()) as f64 / 1_000_000.0, - elapsed.as_secs_f64() * 1000.0 - ); - } - - pub(crate) fn truncate(&mut self, new_n: usize) { - if new_n >= self.n { - return; - } - if new_n == 0 { - self.levels.clear(); - self.n = 0; - return; - } - let new_levels_count = (usize::BITS - new_n.leading_zeros()) as usize; - self.levels.truncate(new_levels_count); - for k in 0..new_levels_count { - let valid = if new_n >= (1 << k) { - new_n + 1 - (1 << k) - } else { - 0 - }; - self.levels[k].truncate(valid); - } - self.n = new_n; - } - - #[inline] - pub(crate) fn range_max(&self, l: usize, r: usize) -> Cents { - debug_assert!(l <= r && r < self.n); - let len = r - l + 1; - let k = (usize::BITS - len.leading_zeros() - 1) as usize; - let half = 1 << k; - let level = &self.levels[k]; - unsafe { - let a = *level.get_unchecked(l); - let b = *level.get_unchecked(r + 1 - half); - a.max(b) - } - } - - #[inline] - pub(crate) fn max_between(&self, from: Height, to: Height) -> Cents { - self.range_max(from.to_usize(), to.to_usize()) - } -} +use super::PriceRangeMax; pub struct ComputeContext<'a> { pub starting_height: Height, diff --git a/crates/brk_computer/src/distribution/compute/mod.rs b/crates/brk_computer/src/distribution/compute/mod.rs index fe567f9b8..415afc020 100644 --- a/crates/brk_computer/src/distribution/compute/mod.rs +++ b/crates/brk_computer/src/distribution/compute/mod.rs @@ -1,13 +1,15 @@ mod block_loop; mod context; +mod price_range_max; mod readers; mod recover; mod write; pub(crate) use block_loop::process_blocks; -pub(crate) use context::{ComputeContext, PriceRangeMax}; -pub(crate) use readers::{IndexToTxIndexBuf, TxInReaders, TxOutData, TxOutReaders, VecsReaders}; -pub(crate) use recover::{StartMode, determine_start_mode, recover_state, reset_state}; +pub(crate) use context::ComputeContext; +pub(crate) use price_range_max::PriceRangeMax; +pub(crate) use readers::{AddrReaders, IndexToTxIndexBuf, TxInReaders, TxOutData, TxOutReaders}; +pub(crate) use recover::{StartMode, determine_start_mode, reset_state}; /// Flush checkpoint interval (every N blocks). pub const FLUSH_INTERVAL: usize = 10_000; diff --git a/crates/brk_computer/src/distribution/compute/price_range_max.rs b/crates/brk_computer/src/distribution/compute/price_range_max.rs new file mode 100644 index 000000000..aa5d384d9 --- /dev/null +++ b/crates/brk_computer/src/distribution/compute/price_range_max.rs @@ -0,0 +1,93 @@ +use std::time::Instant; + +use brk_types::{Cents, Height}; +use tracing::debug; +use vecdb::VecIndex; + +#[derive(Debug, Clone, Default)] +pub struct PriceRangeMax { + levels: Vec>, + n: usize, +} + +impl PriceRangeMax { + pub(crate) fn extend(&mut self, prices: &[Cents]) { + let new_n = prices.len(); + if new_n <= self.n || new_n == 0 { + return; + } + + let start = Instant::now(); + let old_n = self.n; + let level_count = (usize::BITS - new_n.leading_zeros()) as usize; + while self.levels.len() < level_count { + self.levels.push(Vec::new()); + } + + self.levels[0].extend_from_slice(&prices[old_n..new_n]); + for level in 1..level_count { + let half = 1 << (level - 1); + let new_end = new_n.saturating_add(1).saturating_sub(1 << level); + let old_end = self.levels[level].len(); + if new_end > old_end { + let (previous, current) = self.levels.split_at_mut(level); + let previous = &previous[level - 1]; + let current = &mut current[0]; + current.reserve(new_end - old_end); + for index in old_end..new_end { + current.push(previous[index].max(previous[index + half])); + } + } + } + + self.n = new_n; + let entries: usize = self.levels.iter().map(Vec::len).sum(); + debug!( + "PriceRangeMax extended: {} -> {} heights ({} new), {} levels, {:.2}MB, {:.2}ms", + old_n, + new_n, + new_n - old_n, + level_count, + (entries * std::mem::size_of::()) as f64 / 1_000_000.0, + start.elapsed().as_secs_f64() * 1000.0 + ); + } + + pub(crate) fn truncate(&mut self, new_n: usize) { + if new_n >= self.n { + return; + } + if new_n == 0 { + self.levels.clear(); + self.n = 0; + return; + } + + let level_count = (usize::BITS - new_n.leading_zeros()) as usize; + self.levels.truncate(level_count); + for level in 0..level_count { + let valid = new_n.saturating_add(1).saturating_sub(1 << level); + self.levels[level].truncate(valid); + } + self.n = new_n; + } + + #[inline] + pub(crate) fn range_max(&self, start: usize, end: usize) -> Cents { + debug_assert!(start <= end && end < self.n); + let len = end - start + 1; + let level = (usize::BITS - len.leading_zeros() - 1) as usize; + let width = 1 << level; + let values = &self.levels[level]; + unsafe { + let first = *values.get_unchecked(start); + let last = *values.get_unchecked(end + 1 - width); + first.max(last) + } + } + + #[inline] + pub(crate) fn max_between(&self, from: Height, to: Height) -> Cents { + self.range_max(from.to_usize(), to.to_usize()) + } +} diff --git a/crates/brk_computer/src/distribution/compute/readers.rs b/crates/brk_computer/src/distribution/compute/readers.rs deleted file mode 100644 index 325592236..000000000 --- a/crates/brk_computer/src/distribution/compute/readers.rs +++ /dev/null @@ -1,264 +0,0 @@ -use brk_indexer::Indexer; -use brk_types::{ - AnyAddrIndex, EmptyAddrData, EmptyAddrIndex, FundedAddrData, FundedAddrIndex, Height, OutPoint, - OutputType, P2AAddrIndex, P2PK33AddrIndex, P2PK65AddrIndex, P2PKHAddrIndex, P2SHAddrIndex, - P2TRAddrIndex, P2WPKHAddrIndex, P2WSHAddrIndex, Sats, StoredU64, TxInIndex, TxIndex, TypeIndex, -}; -use vecdb::{BytesVecReader, PcoVec, ReadableVec, VecIndex}; - -use crate::distribution::{ - RangeMap, - addr::{AddrsDataVecs, AnyAddrIndexesVecs}, -}; - -/// Output data collected from separate vecs. -#[derive(Debug, Clone, Copy)] -pub struct TxOutData { - pub value: Sats, - pub output_type: OutputType, - pub type_index: TypeIndex, -} - -/// Readers for txout vectors. Reuses internal buffers across blocks. -pub struct TxOutReaders<'a> { - indexer: &'a Indexer, - values_buf: Vec, - output_types_buf: Vec, - type_indexes_buf: Vec, - txout_data_buf: Vec, -} - -impl<'a> TxOutReaders<'a> { - pub(crate) fn new(indexer: &'a Indexer) -> Self { - Self { - indexer, - values_buf: Vec::new(), - output_types_buf: Vec::new(), - type_indexes_buf: Vec::new(), - txout_data_buf: Vec::new(), - } - } - - /// Collect output data for a block range using bulk reads with buffer reuse. - pub(crate) fn collect_block_outputs( - &mut self, - first_txout_index: usize, - output_count: usize, - ) -> &[TxOutData] { - let end = first_txout_index + output_count; - self.indexer.vecs().outputs.value.collect_range_into_at( - first_txout_index, - end, - &mut self.values_buf, - ); - self.indexer - .vecs() - .outputs - .output_type - .collect_range_into_at(first_txout_index, end, &mut self.output_types_buf); - self.indexer - .vecs() - .outputs - .type_index - .collect_range_into_at(first_txout_index, end, &mut self.type_indexes_buf); - - self.txout_data_buf.clear(); - self.txout_data_buf.extend( - self.values_buf - .iter() - .zip(&self.output_types_buf) - .zip(&self.type_indexes_buf) - .map(|((&value, &output_type), &type_index)| TxOutData { - value, - output_type, - type_index, - }), - ); - &self.txout_data_buf - } -} - -/// Readers for txin vectors. Reuses all buffers across blocks. -pub struct TxInReaders<'a> { - indexer: &'a Indexer, - input_values: &'a PcoVec, - tx_index_to_height: &'a mut RangeMap, - outpoints_buf: Vec, - values_buf: Vec, - prev_heights_buf: Vec, - output_types_buf: Vec, - type_indexes_buf: Vec, -} - -impl<'a> TxInReaders<'a> { - pub(crate) fn new( - indexer: &'a Indexer, - input_values: &'a PcoVec, - tx_index_to_height: &'a mut RangeMap, - ) -> Self { - Self { - indexer, - input_values, - tx_index_to_height, - outpoints_buf: Vec::new(), - values_buf: Vec::new(), - prev_heights_buf: Vec::new(), - output_types_buf: Vec::new(), - type_indexes_buf: Vec::new(), - } - } - - /// Collect input data for a block range using bulk reads with buffer reuse. - pub(crate) fn collect_block_inputs( - &mut self, - first_txin_index: usize, - input_count: usize, - current_height: Height, - ) -> (&[Sats], &[Height], &[OutputType], &[TypeIndex]) { - let end = first_txin_index + input_count; - self.input_values - .collect_range_into_at(first_txin_index, end, &mut self.values_buf); - self.indexer.vecs().inputs.outpoint.collect_range_into_at( - first_txin_index, - end, - &mut self.outpoints_buf, - ); - self.indexer - .vecs() - .inputs - .output_type - .collect_range_into_at(first_txin_index, end, &mut self.output_types_buf); - self.indexer.vecs().inputs.type_index.collect_range_into_at( - first_txin_index, - end, - &mut self.type_indexes_buf, - ); - - self.prev_heights_buf.clear(); - self.prev_heights_buf - .extend(self.outpoints_buf.iter().map(|outpoint| { - if outpoint.is_coinbase() { - current_height - } else { - self.tx_index_to_height - .get(outpoint.tx_index()) - .unwrap_or(current_height) - } - })); - - ( - &self.values_buf, - &self.prev_heights_buf, - &self.output_types_buf, - &self.type_indexes_buf, - ) - } -} - -/// Cached readers for stateful vectors. -pub struct VecsReaders { - p2a: BytesVecReader, - p2pk33: BytesVecReader, - p2pk65: BytesVecReader, - p2pkh: BytesVecReader, - p2sh: BytesVecReader, - p2tr: BytesVecReader, - p2wpkh: BytesVecReader, - p2wsh: BytesVecReader, - funded: BytesVecReader, - empty: BytesVecReader, -} - -impl VecsReaders { - pub(crate) fn new(any_addr_indexes: &AnyAddrIndexesVecs, addrs_data: &AddrsDataVecs) -> Self { - Self { - p2a: any_addr_indexes.p2a.reader(), - p2pk33: any_addr_indexes.p2pk33.reader(), - p2pk65: any_addr_indexes.p2pk65.reader(), - p2pkh: any_addr_indexes.p2pkh.reader(), - p2sh: any_addr_indexes.p2sh.reader(), - p2tr: any_addr_indexes.p2tr.reader(), - p2wpkh: any_addr_indexes.p2wpkh.reader(), - p2wsh: any_addr_indexes.p2wsh.reader(), - funded: addrs_data.funded.reader(), - empty: addrs_data.empty.reader(), - } - } - - /// Read the unified address index, including uncommitted updates after rollback. - pub(crate) fn any_addr_index( - &self, - vecs: &AnyAddrIndexesVecs, - addr_type: OutputType, - type_index: TypeIndex, - ) -> AnyAddrIndex { - let index = match addr_type { - OutputType::P2A => vecs.p2a.get_with_reader(type_index.into(), &self.p2a), - OutputType::P2PK33 => vecs.p2pk33.get_with_reader(type_index.into(), &self.p2pk33), - OutputType::P2PK65 => vecs.p2pk65.get_with_reader(type_index.into(), &self.p2pk65), - OutputType::P2PKH => vecs.p2pkh.get_with_reader(type_index.into(), &self.p2pkh), - OutputType::P2SH => vecs.p2sh.get_with_reader(type_index.into(), &self.p2sh), - OutputType::P2TR => vecs.p2tr.get_with_reader(type_index.into(), &self.p2tr), - OutputType::P2WPKH => vecs.p2wpkh.get_with_reader(type_index.into(), &self.p2wpkh), - OutputType::P2WSH => vecs.p2wsh.get_with_reader(type_index.into(), &self.p2wsh), - _ => unreachable!("invalid address type: {addr_type:?}"), - }; - index.unwrap() - } - - #[inline] - pub(crate) fn funded_data( - &self, - vecs: &AddrsDataVecs, - index: FundedAddrIndex, - ) -> FundedAddrData { - vecs.funded.get_with_reader(index, &self.funded).unwrap() - } - - #[inline] - pub(crate) fn empty_data(&self, vecs: &AddrsDataVecs, index: EmptyAddrIndex) -> EmptyAddrData { - vecs.empty.get_with_reader(index, &self.empty).unwrap() - } -} - -/// Reusable buffers for per-block tx_index mapping construction. -pub(crate) struct IndexToTxIndexBuf { - counts: Vec, - result: Vec, -} - -impl IndexToTxIndexBuf { - pub(crate) fn new() -> Self { - Self { - counts: Vec::new(), - result: Vec::new(), - } - } - - /// Build index -> tx_index mapping for a block, reusing internal buffers. - pub(crate) fn build( - &mut self, - block_first_tx_index: TxIndex, - block_tx_count: u64, - tx_index_to_count: &impl ReadableVec, - ) -> &[TxIndex] { - let first = block_first_tx_index.to_usize(); - tx_index_to_count.collect_range_into_at( - first, - first + block_tx_count as usize, - &mut self.counts, - ); - - let total: u64 = self.counts.iter().map(|c| u64::from(*c)).sum(); - self.result.clear(); - self.result.reserve(total as usize); - - for (offset, count) in self.counts.iter().enumerate() { - let tx_index = TxIndex::from(first + offset); - self.result - .extend(std::iter::repeat_n(tx_index, u64::from(*count) as usize)); - } - - &self.result - } -} diff --git a/crates/brk_computer/src/distribution/compute/readers/addr.rs b/crates/brk_computer/src/distribution/compute/readers/addr.rs new file mode 100644 index 000000000..d12b1eacc --- /dev/null +++ b/crates/brk_computer/src/distribution/compute/readers/addr.rs @@ -0,0 +1,73 @@ +use brk_types::{ + AnyAddrIndex, EmptyAddrData, EmptyAddrIndex, FundedAddrData, FundedAddrIndex, OutputType, + P2AAddrIndex, P2PK33AddrIndex, P2PK65AddrIndex, P2PKHAddrIndex, P2SHAddrIndex, P2TRAddrIndex, + P2WPKHAddrIndex, P2WSHAddrIndex, TypeIndex, +}; +use vecdb::BytesVecReader; + +use crate::distribution::addr::{AddrsDataVecs, AnyAddrIndexesVecs}; + +/// Cached readers for address indexes and stateful address data. +pub struct AddrReaders { + p2a: BytesVecReader, + p2pk33: BytesVecReader, + p2pk65: BytesVecReader, + p2pkh: BytesVecReader, + p2sh: BytesVecReader, + p2tr: BytesVecReader, + p2wpkh: BytesVecReader, + p2wsh: BytesVecReader, + funded: BytesVecReader, + empty: BytesVecReader, +} + +impl AddrReaders { + pub(crate) fn new(any_addr_indexes: &AnyAddrIndexesVecs, addrs_data: &AddrsDataVecs) -> Self { + Self { + p2a: any_addr_indexes.p2a.reader(), + p2pk33: any_addr_indexes.p2pk33.reader(), + p2pk65: any_addr_indexes.p2pk65.reader(), + p2pkh: any_addr_indexes.p2pkh.reader(), + p2sh: any_addr_indexes.p2sh.reader(), + p2tr: any_addr_indexes.p2tr.reader(), + p2wpkh: any_addr_indexes.p2wpkh.reader(), + p2wsh: any_addr_indexes.p2wsh.reader(), + funded: addrs_data.funded.reader(), + empty: addrs_data.empty.reader(), + } + } + + pub(crate) fn any_addr_index( + &self, + vecs: &AnyAddrIndexesVecs, + addr_type: OutputType, + type_index: TypeIndex, + ) -> AnyAddrIndex { + let index = match addr_type { + OutputType::P2A => vecs.p2a.get_with_reader(type_index.into(), &self.p2a), + OutputType::P2PK33 => vecs.p2pk33.get_with_reader(type_index.into(), &self.p2pk33), + OutputType::P2PK65 => vecs.p2pk65.get_with_reader(type_index.into(), &self.p2pk65), + OutputType::P2PKH => vecs.p2pkh.get_with_reader(type_index.into(), &self.p2pkh), + OutputType::P2SH => vecs.p2sh.get_with_reader(type_index.into(), &self.p2sh), + OutputType::P2TR => vecs.p2tr.get_with_reader(type_index.into(), &self.p2tr), + OutputType::P2WPKH => vecs.p2wpkh.get_with_reader(type_index.into(), &self.p2wpkh), + OutputType::P2WSH => vecs.p2wsh.get_with_reader(type_index.into(), &self.p2wsh), + _ => unreachable!("invalid address type: {addr_type:?}"), + }; + index.unwrap() + } + + #[inline] + pub(crate) fn funded_data( + &self, + vecs: &AddrsDataVecs, + index: FundedAddrIndex, + ) -> FundedAddrData { + vecs.funded.get_with_reader(index, &self.funded).unwrap() + } + + #[inline] + pub(crate) fn empty_data(&self, vecs: &AddrsDataVecs, index: EmptyAddrIndex) -> EmptyAddrData { + vecs.empty.get_with_reader(index, &self.empty).unwrap() + } +} diff --git a/crates/brk_computer/src/distribution/compute/readers/index_to_tx_index.rs b/crates/brk_computer/src/distribution/compute/readers/index_to_tx_index.rs new file mode 100644 index 000000000..6f0eb7142 --- /dev/null +++ b/crates/brk_computer/src/distribution/compute/readers/index_to_tx_index.rs @@ -0,0 +1,43 @@ +use brk_types::{StoredU64, TxIndex}; +use vecdb::{ReadableVec, VecIndex}; + +/// Reusable buffers for a block's index-to-transaction-index mapping. +pub(crate) struct IndexToTxIndexBuf { + counts: Vec, + result: Vec, +} + +impl IndexToTxIndexBuf { + pub(crate) fn new() -> Self { + Self { + counts: Vec::new(), + result: Vec::new(), + } + } + + pub(crate) fn build( + &mut self, + block_first_tx_index: TxIndex, + block_tx_count: u64, + tx_index_to_count: &impl ReadableVec, + ) -> &[TxIndex] { + let first = block_first_tx_index.to_usize(); + tx_index_to_count.collect_range_into_at( + first, + first + block_tx_count as usize, + &mut self.counts, + ); + + let total: u64 = self.counts.iter().map(|count| u64::from(*count)).sum(); + self.result.clear(); + self.result.reserve(total as usize); + + for (offset, count) in self.counts.iter().enumerate() { + let tx_index = TxIndex::from(first + offset); + self.result + .extend(std::iter::repeat_n(tx_index, u64::from(*count) as usize)); + } + + &self.result + } +} diff --git a/crates/brk_computer/src/distribution/compute/readers/mod.rs b/crates/brk_computer/src/distribution/compute/readers/mod.rs new file mode 100644 index 000000000..9e2af88e8 --- /dev/null +++ b/crates/brk_computer/src/distribution/compute/readers/mod.rs @@ -0,0 +1,11 @@ +mod addr; +mod index_to_tx_index; +mod tx_in; +mod tx_out; +mod tx_out_data; + +pub(crate) use addr::AddrReaders; +pub(crate) use index_to_tx_index::IndexToTxIndexBuf; +pub(crate) use tx_in::TxInReaders; +pub(crate) use tx_out::TxOutReaders; +pub(crate) use tx_out_data::TxOutData; diff --git a/crates/brk_computer/src/distribution/compute/readers/tx_in.rs b/crates/brk_computer/src/distribution/compute/readers/tx_in.rs new file mode 100644 index 000000000..7a3e7548c --- /dev/null +++ b/crates/brk_computer/src/distribution/compute/readers/tx_in.rs @@ -0,0 +1,81 @@ +use brk_indexer::Indexer; +use brk_types::{Height, OutPoint, OutputType, Sats, TxInIndex, TxIndex, TypeIndex}; +use vecdb::{PcoVec, ReadableVec}; + +use crate::distribution::RangeMap; + +/// Bulk txin reader with reusable buffers. +pub struct TxInReaders<'a> { + indexer: &'a Indexer, + input_values: &'a PcoVec, + tx_index_to_height: &'a mut RangeMap, + outpoints_buf: Vec, + values_buf: Vec, + prev_heights_buf: Vec, + output_types_buf: Vec, + type_indexes_buf: Vec, +} + +impl<'a> TxInReaders<'a> { + pub(crate) fn new( + indexer: &'a Indexer, + input_values: &'a PcoVec, + tx_index_to_height: &'a mut RangeMap, + ) -> Self { + Self { + indexer, + input_values, + tx_index_to_height, + outpoints_buf: Vec::new(), + values_buf: Vec::new(), + prev_heights_buf: Vec::new(), + output_types_buf: Vec::new(), + type_indexes_buf: Vec::new(), + } + } + + pub(crate) fn collect_block_inputs( + &mut self, + first_txin_index: usize, + input_count: usize, + current_height: Height, + ) -> (&[Sats], &[Height], &[OutputType], &[TypeIndex]) { + let end = first_txin_index + input_count; + self.input_values + .collect_range_into_at(first_txin_index, end, &mut self.values_buf); + self.indexer.vecs().inputs.outpoint.collect_range_into_at( + first_txin_index, + end, + &mut self.outpoints_buf, + ); + self.indexer + .vecs() + .inputs + .output_type + .collect_range_into_at(first_txin_index, end, &mut self.output_types_buf); + self.indexer.vecs().inputs.type_index.collect_range_into_at( + first_txin_index, + end, + &mut self.type_indexes_buf, + ); + + self.prev_heights_buf.clear(); + self.prev_heights_buf + .extend(self.outpoints_buf.iter().map(|outpoint| { + if outpoint.is_coinbase() { + current_height + } else { + self.tx_index_to_height + .get(outpoint.tx_index()) + .unwrap_or(current_height) + } + })); + + ( + &self.values_buf, + &self.prev_heights_buf, + &self.output_types_buf, + &self.type_indexes_buf, + ) + } +} diff --git a/crates/brk_computer/src/distribution/compute/readers/tx_out.rs b/crates/brk_computer/src/distribution/compute/readers/tx_out.rs new file mode 100644 index 000000000..dc0c856cb --- /dev/null +++ b/crates/brk_computer/src/distribution/compute/readers/tx_out.rs @@ -0,0 +1,63 @@ +use brk_indexer::Indexer; +use brk_types::{OutputType, Sats, TypeIndex}; +use vecdb::ReadableVec; + +use super::TxOutData; + +/// Bulk txout reader with reusable buffers. +pub struct TxOutReaders<'a> { + indexer: &'a Indexer, + values_buf: Vec, + output_types_buf: Vec, + type_indexes_buf: Vec, + txout_data_buf: Vec, +} + +impl<'a> TxOutReaders<'a> { + pub(crate) fn new(indexer: &'a Indexer) -> Self { + Self { + indexer, + values_buf: Vec::new(), + output_types_buf: Vec::new(), + type_indexes_buf: Vec::new(), + txout_data_buf: Vec::new(), + } + } + + pub(crate) fn collect_block_outputs( + &mut self, + first_txout_index: usize, + output_count: usize, + ) -> &[TxOutData] { + let end = first_txout_index + output_count; + self.indexer.vecs().outputs.value.collect_range_into_at( + first_txout_index, + end, + &mut self.values_buf, + ); + self.indexer + .vecs() + .outputs + .output_type + .collect_range_into_at(first_txout_index, end, &mut self.output_types_buf); + self.indexer + .vecs() + .outputs + .type_index + .collect_range_into_at(first_txout_index, end, &mut self.type_indexes_buf); + + self.txout_data_buf.clear(); + self.txout_data_buf.extend( + self.values_buf + .iter() + .zip(&self.output_types_buf) + .zip(&self.type_indexes_buf) + .map(|((&value, &output_type), &type_index)| TxOutData { + value, + output_type, + type_index, + }), + ); + &self.txout_data_buf + } +} diff --git a/crates/brk_computer/src/distribution/compute/readers/tx_out_data.rs b/crates/brk_computer/src/distribution/compute/readers/tx_out_data.rs new file mode 100644 index 000000000..840235beb --- /dev/null +++ b/crates/brk_computer/src/distribution/compute/readers/tx_out_data.rs @@ -0,0 +1,9 @@ +use brk_types::{OutputType, Sats, TypeIndex}; + +/// Output data collected from separate vectors. +#[derive(Debug, Clone, Copy)] +pub struct TxOutData { + pub value: Sats, + pub output_type: OutputType, + pub type_index: TypeIndex, +} diff --git a/crates/brk_computer/src/distribution/compute/recover.rs b/crates/brk_computer/src/distribution/compute/recover.rs index f6f683671..7df87bf4b 100644 --- a/crates/brk_computer/src/distribution/compute/recover.rs +++ b/crates/brk_computer/src/distribution/compute/recover.rs @@ -3,117 +3,117 @@ use std::{cmp::Ordering, collections::BTreeSet}; use brk_error::Result; use brk_types::Height; use tracing::{debug, warn}; -use vecdb::Stamp; +use vecdb::{Result as VecdbResult, Stamp}; use super::super::{ - AddrsDataVecs, - addr::AnyAddrIndexesVecs, - cohorts::{AddrCohorts, UTXOCohorts}, + AddrsDataVecs, AnyAddrIndexesVecs, Vecs, + state::{AddrStates, UTXOStates}, }; /// Result of state recovery. -pub struct RecoveredState { +pub(crate) struct RecoveredState { /// Height to start processing from. Zero means fresh start. - pub starting_height: Height, + pub(crate) starting_height: Height, } -/// Perform state recovery for resuming from checkpoint. -/// -/// Rolls back state vectors and imports cohort states. -/// Validates that all rollbacks and imports are consistent. -/// Returns Height::ZERO if any validation fails (triggers fresh start). -pub(crate) fn recover_state( - height: Height, - chain_state_rollback: Option>, - any_addr_indexes: &mut AnyAddrIndexesVecs, - addrs_data: &mut AddrsDataVecs, - utxo_cohorts: &mut UTXOCohorts, - addr_cohorts: &mut AddrCohorts, -) -> Result { - // `None`: clean resume, already at the checkpoint, nothing to undo. - // `Some`: reorg, undo state past the resume point. - let consistent_height = match chain_state_rollback { - None => height, - Some(chain_state_rollback) => { - let stamp = Stamp::from(height); +impl Vecs { + /// Perform state recovery for resuming from checkpoint. + /// + /// Rolls back state vectors and imports cohort states. + /// Validates that all rollbacks and imports are consistent. + /// Returns Height::ZERO if any validation fails (triggers fresh start). + pub(crate) fn recover_state( + &mut self, + height: Height, + chain_state_rollback: Option>, + utxo_states: &mut UTXOStates, + addr_states: &mut AddrStates, + ) -> Result { + // `None`: clean resume, already at the checkpoint, nothing to undo. + // `Some`: reorg, undo state past the resume point. + let consistent_height = match chain_state_rollback { + None => height, + Some(chain_state_rollback) => { + let stamp = Stamp::from(height); - // Rollback address state vectors - let addr_indexes_rollback = any_addr_indexes.rollback_before(stamp); - let addr_data_rollback = addrs_data.rollback_before(stamp); + // Rollback address state vectors + let addr_indexes_rollback = self.any_addr_indexes.rollback_before(stamp); + let addr_data_rollback = self.addrs_data.rollback_before(stamp); - // Verify rollback consistency - all must agree on the same height - let consistent_height = rollback_states( - chain_state_rollback, - addr_indexes_rollback, - addr_data_rollback, + // Verify rollback consistency - all must agree on the same height + let consistent_height = rollback_states( + chain_state_rollback, + addr_indexes_rollback, + addr_data_rollback, + ); + + // If rollbacks are inconsistent, start fresh + if consistent_height.is_zero() { + warn!("Rollback consistency check failed: inconsistent heights"); + return Ok(RecoveredState { + starting_height: Height::ZERO, + }); + } + + // Rollback can land at an earlier height (multi-block change file), which is fine. + // But if it lands AHEAD of target, that means rollback failed (missing change files). + if consistent_height > height { + warn!( + "Rollback failed: still at {} but target was {}, falling back to fresh start", + consistent_height, height + ); + return Ok(RecoveredState { + starting_height: Height::ZERO, + }); + } + + if consistent_height != height { + debug!( + "Rollback landed at {} instead of {}, will resume from there", + consistent_height, height + ); + } + + consistent_height + } + }; + + // Import UTXO cohort states - all must succeed + debug!( + "importing UTXO cohort states at height {}", + consistent_height + ); + if !utxo_states.import(&self.cohorts, consistent_height)? { + warn!( + "UTXO cohort state import failed at height {}", + consistent_height ); - - // If rollbacks are inconsistent, start fresh - if consistent_height.is_zero() { - warn!("Rollback consistency check failed: inconsistent heights"); - return Ok(RecoveredState { - starting_height: Height::ZERO, - }); - } - - // Rollback can land at an earlier height (multi-block change file), which is fine. - // But if it lands AHEAD of target, that means rollback failed (missing change files). - if consistent_height > height { - warn!( - "Rollback failed: still at {} but target was {}, falling back to fresh start", - consistent_height, height - ); - return Ok(RecoveredState { - starting_height: Height::ZERO, - }); - } - - if consistent_height != height { - debug!( - "Rollback landed at {} instead of {}, will resume from there", - consistent_height, height - ); - } - - consistent_height + return Ok(RecoveredState { + starting_height: Height::ZERO, + }); } - }; + debug!("UTXO cohort states imported"); - // Import UTXO cohort states - all must succeed - debug!( - "importing UTXO cohort states at height {}", - consistent_height - ); - if !utxo_cohorts.import_separate_states(consistent_height) { - warn!( - "UTXO cohort state import failed at height {}", + // Import address cohort states - all must succeed + debug!( + "importing addr cohort states at height {}", consistent_height ); - return Ok(RecoveredState { - starting_height: Height::ZERO, - }); - } - debug!("UTXO cohort states imported"); + if !addr_states.import(&self.cohorts, &self.addrs.funded, consistent_height)? { + warn!( + "Addr cohort state import failed at height {}", + consistent_height + ); + return Ok(RecoveredState { + starting_height: Height::ZERO, + }); + } + debug!("addr cohort states imported"); - // Import address cohort states - all must succeed - debug!( - "importing addr cohort states at height {}", - consistent_height - ); - if !addr_cohorts.import_separate_states(consistent_height) { - warn!( - "Addr cohort state import failed at height {}", - consistent_height - ); - return Ok(RecoveredState { - starting_height: Height::ZERO, - }); + Ok(RecoveredState { + starting_height: consistent_height, + }) } - debug!("addr cohort states imported"); - - Ok(RecoveredState { - starting_height: consistent_height, - }) } /// Reset all state for fresh start. @@ -122,23 +122,16 @@ pub(crate) fn recover_state( pub(crate) fn reset_state( any_addr_indexes: &mut AnyAddrIndexesVecs, addrs_data: &mut AddrsDataVecs, - utxo_cohorts: &mut UTXOCohorts, - addr_cohorts: &mut AddrCohorts, + utxo_states: &mut UTXOStates, + addr_states: &mut AddrStates, ) -> Result { // Reset address state any_addr_indexes.reset()?; addrs_data.reset()?; - // Reset cohort state heights - utxo_cohorts.reset_separate_state_heights(); - addr_cohorts.reset_separate_state_heights(); - - // Reset cost_basis_data for all cohorts - utxo_cohorts.reset_separate_cost_basis_data()?; - addr_cohorts.reset_separate_cost_basis_data()?; - - // Reset in-memory caches (fenwick, tick_tock positions) - utxo_cohorts.reset_caches(); + // Reset cohort state. + utxo_states.reset()?; + addr_states.reset()?; Ok(RecoveredState { starting_height: Height::ZERO, @@ -175,7 +168,7 @@ pub enum StartMode { /// Returns the consistent starting height if ALL rollbacks succeed and agree, /// otherwise returns Height::ZERO (need fresh start). fn rollback_states( - chain_state_rollback: vecdb::Result, + chain_state_rollback: VecdbResult, addr_indexes_rollbacks: Result>, addr_data_rollbacks: Result<[Stamp; 2]>, ) -> Height { diff --git a/crates/brk_computer/src/distribution/compute/write.rs b/crates/brk_computer/src/distribution/compute/write.rs index 07fc1f756..65e084815 100644 --- a/crates/brk_computer/src/distribution/compute/write.rs +++ b/crates/brk_computer/src/distribution/compute/write.rs @@ -9,7 +9,7 @@ use vecdb::{AnyStoredVec, AnyVec, Stamp, VecIndex, WritableVec}; use crate::distribution::{ Vecs, block::{WithAddrDataSource, process_empty_addrs, process_funded_addrs}, - state::BlockState, + state::{AddrStates, BlockState, UTXOStates}, }; use super::super::addr::{AddrTypeToTypeIndexMap, AddrsDataVecs, AnyAddrIndexesVecs}; @@ -52,6 +52,8 @@ pub(crate) fn process_addr_updates( /// Set `with_changes=true` near chain tip to enable rollback support. pub(crate) fn write( vecs: &mut Vecs, + utxo_states: &mut UTXOStates, + addr_states: &mut AddrStates, height: Height, chain_state: &[BlockState], min_supply_modified: Option, @@ -84,14 +86,13 @@ pub(crate) fn write( ] .into_par_iter(), ) - .chain(vecs.utxo_cohorts.par_iter_vecs_mut()) - .chain(vecs.addr_cohorts.par_iter_vecs_mut()) + .chain(vecs.cohorts.par_iter_vecs_mut()) .try_for_each(|v| v.any_stamped_write_maybe_with_changes(stamp, with_changes))?; // Commit states after vec writes let cleanup = with_changes; - vecs.utxo_cohorts.commit_all_states(height, cleanup)?; - vecs.addr_cohorts.commit_all_states(height, cleanup)?; + utxo_states.write(height, cleanup)?; + addr_states.write(height, cleanup)?; info!("Wrote in {:?}", i.elapsed()); diff --git a/crates/brk_computer/src/distribution/metrics/activity/core.rs b/crates/brk_computer/src/distribution/metrics/activity/core.rs deleted file mode 100644 index cea0e3dcf..000000000 --- a/crates/brk_computer/src/distribution/metrics/activity/core.rs +++ /dev/null @@ -1,108 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Bitcoin, StoredF64, Version}; -use derive_more::{Deref, DerefMut}; -use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode}; - -use crate::{ - distribution::{ - metrics::ImportConfig, - state::{CohortState, CostBasisOps, RealizedOps}, - }, - internal::{PerBlockCumulativeRolling, ValuePerBlockCumulativeRolling}, - price, -}; - -use super::ActivityMinimal; - -#[derive(Deref, DerefMut, Traversable)] -pub struct ActivityCore { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub minimal: ActivityMinimal, - - pub coindays_destroyed: PerBlockCumulativeRolling, - #[traversable(wrap = "transfer_volume", rename = "in_profit")] - pub transfer_volume_in_profit: ValuePerBlockCumulativeRolling, - #[traversable(wrap = "transfer_volume", rename = "in_loss")] - pub transfer_volume_in_loss: ValuePerBlockCumulativeRolling, -} - -impl ActivityCore { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - Ok(Self { - minimal: ActivityMinimal::forced_import(cfg)?, - coindays_destroyed: cfg.import("coindays_destroyed", v1)?, - transfer_volume_in_profit: cfg.import("transfer_volume_in_profit", v1)?, - transfer_volume_in_loss: cfg.import("transfer_volume_in_loss", v1)?, - }) - } - - pub(crate) fn min_len(&self) -> usize { - self.minimal - .min_len() - .min(self.coindays_destroyed.block.len()) - .min(self.transfer_volume_in_profit.cumulative.sats.height.len()) - .min(self.transfer_volume_in_loss.cumulative.sats.height.len()) - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &CohortState) { - self.minimal.push_state(state); - self.coindays_destroyed - .push_block(StoredF64::from(Bitcoin::from(state.satdays_destroyed))); - self.transfer_volume_in_profit - .push_block_sats(state.realized.sent_in_profit()); - self.transfer_volume_in_loss - .push_block_sats(state.realized.sent_in_loss()); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs = self.minimal.collect_vecs_mut(); - vecs.push(self.coindays_destroyed.stored_mut()); - vecs.push(&mut self.transfer_volume_in_profit.inner.cumulative.sats.height); - vecs.push(&mut self.transfer_volume_in_profit.inner.cumulative.cents.height); - vecs.push(&mut self.transfer_volume_in_loss.inner.cumulative.sats.height); - vecs.push(&mut self.transfer_volume_in_loss.inner.cumulative.cents.height); - vecs - } - - pub(crate) fn validate_computed_versions(&mut self, _base_version: Version) -> Result<()> { - Ok(()) - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - let minimal_refs: Vec<&ActivityMinimal> = others.iter().map(|o| &o.minimal).collect(); - self.minimal - .compute_from_stateful(starting_lengths, &minimal_refs, exit)?; - - sum_others!(self, starting_lengths, others, exit; coindays_destroyed.cumulative.height); - sum_others!(self, starting_lengths, others, exit; transfer_volume_in_profit.cumulative.sats.height); - sum_others!(self, starting_lengths, others, exit; transfer_volume_in_loss.cumulative.sats.height); - - Ok(()) - } - - pub(crate) fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.minimal - .compute_rest_part1(prices, starting_lengths, exit)?; - self.transfer_volume_in_profit - .compute_rest(starting_lengths.height, prices, exit)?; - self.transfer_volume_in_loss - .compute_rest(starting_lengths.height, prices, exit)?; - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/activity/full.rs b/crates/brk_computer/src/distribution/metrics/activity/full.rs deleted file mode 100644 index 3ed191bcc..000000000 --- a/crates/brk_computer/src/distribution/metrics/activity/full.rs +++ /dev/null @@ -1,117 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{StoredF32, StoredF64, Version}; -use derive_more::{Deref, DerefMut}; -use vecdb::{AnyStoredVec, Exit, Rw, StorageMode}; - -use crate::internal::{ColumnarRollingWindows, Identity, LazyPerBlock}; - -use crate::{ - distribution::{ - metrics::ImportConfig, - state::{CohortState, CostBasisOps, RealizedOps}, - }, - price, -}; - -use super::ActivityCore; - -#[derive(Deref, DerefMut, Traversable)] -pub struct ActivityFull { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub inner: ActivityCore, - - pub coinyears_destroyed: LazyPerBlock, - - pub dormancy: ColumnarRollingWindows, -} - -impl ActivityFull { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - let inner = ActivityCore::forced_import(cfg)?; - - let coinyears_destroyed = LazyPerBlock::from_height_source::, _>( - &cfg.name("coinyears_destroyed"), - cfg.version + v1, - inner.coindays_destroyed.sum._1y.height.clone(), - cfg.indexes, - ); - - let dormancy = ColumnarRollingWindows::forced_import( - cfg.db, - &cfg.name("dormancy"), - cfg.version + v1, - cfg.indexes, - )?; - - Ok(Self { - inner, - coinyears_destroyed, - dormancy, - }) - } - - pub(crate) fn full_min_len(&self) -> usize { - self.inner.min_len() - } - - #[inline(always)] - pub(crate) fn full_push_state( - &mut self, - state: &CohortState, - ) { - self.inner.push_state(state); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs = self.inner.collect_vecs_mut(); - vecs.push(self.dormancy.stored_mut()); - vecs - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&ActivityCore], - exit: &Exit, - ) -> Result<()> { - self.inner - .compute_from_stateful(starting_lengths, others, exit) - } - - pub(crate) fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.inner - .compute_rest_part1(prices, starting_lengths, exit)?; - - let Self { - inner, dormancy, .. - } = self; - let cdd_sums = &inner.coindays_destroyed.sum; - let transfer_volume_sums = &inner.minimal.transfer_volume.sum.0; - dormancy.compute_columns2( - starting_lengths.height, - |window| &window.select(cdd_sums).height, - |window| &window.select(transfer_volume_sums).btc.height, - |_, rolling_cdd, rolling_btc| { - let btc = f64::from(rolling_btc); - if btc == 0.0 { - StoredF32::from(0.0f32) - } else { - StoredF32::from((f64::from(rolling_cdd) / btc) as f32) - } - }, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/activity/minimal.rs b/crates/brk_computer/src/distribution/metrics/activity/minimal.rs deleted file mode 100644 index ee02f4dc4..000000000 --- a/crates/brk_computer/src/distribution/metrics/activity/minimal.rs +++ /dev/null @@ -1,78 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::Version; -use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode}; - -use crate::{ - distribution::{ - metrics::ImportConfig, - state::{CohortState, CostBasisOps, RealizedOps}, - }, - internal::ValuePerBlockCumulativeRolling, - price, -}; - -#[derive(Traversable)] -pub struct ActivityMinimal { - pub transfer_volume: ValuePerBlockCumulativeRolling, -} - -impl ActivityMinimal { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - Ok(Self { - transfer_volume: cfg.import("transfer_volume", v1)?, - }) - } - - pub(crate) fn min_len(&self) -> usize { - self.transfer_volume.cumulative.sats.height.len() - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &CohortState) { - self.transfer_volume.push_block_sats(state.sent); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let inner = &mut self.transfer_volume.inner; - vec![ - &mut inner.cumulative.sats.height as &mut dyn AnyStoredVec, - &mut inner.cumulative.cents.height, - ] - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - self.transfer_volume - .cumulative - .sats - .height - .compute_sum_of_others( - starting_lengths.height, - &others - .iter() - .map(|v| &v.transfer_volume.cumulative.sats.height) - .collect::>(), - exit, - )?; - - Ok(()) - } - - pub(crate) fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.transfer_volume - .compute_rest(starting_lengths.height, prices, exit)?; - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/activity/mod.rs b/crates/brk_computer/src/distribution/metrics/activity/mod.rs index e250c2871..b15fd20a5 100644 --- a/crates/brk_computer/src/distribution/metrics/activity/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/activity/mod.rs @@ -1,105 +1,3 @@ -mod core; -mod full; -mod minimal; +mod vecs; -pub use self::core::ActivityCore; -pub use full::ActivityFull; -pub use minimal::ActivityMinimal; - -use brk_error::Result; -use brk_indexer::Lengths; -use brk_types::Version; -use vecdb::Exit; - -use crate::{ - distribution::state::{CohortState, CostBasisOps, RealizedOps}, - price, -}; - -pub trait ActivityLike: Send + Sync { - fn as_core(&self) -> &ActivityCore; - fn as_core_mut(&mut self) -> &mut ActivityCore; - fn min_len(&self) -> usize; - fn push_state(&mut self, state: &CohortState); - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()>; - fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&ActivityCore], - exit: &Exit, - ) -> Result<()>; - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()>; -} - -impl ActivityLike for ActivityCore { - fn as_core(&self) -> &ActivityCore { - self - } - fn as_core_mut(&mut self) -> &mut ActivityCore { - self - } - fn min_len(&self) -> usize { - self.min_len() - } - fn push_state(&mut self, state: &CohortState) { - self.push_state(state); - } - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.validate_computed_versions(base_version) - } - fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&ActivityCore], - exit: &Exit, - ) -> Result<()> { - self.compute_from_stateful(starting_lengths, others, exit) - } - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.compute_rest_part1(prices, starting_lengths, exit) - } -} - -impl ActivityLike for ActivityFull { - fn as_core(&self) -> &ActivityCore { - &self.inner - } - fn as_core_mut(&mut self) -> &mut ActivityCore { - &mut self.inner - } - fn min_len(&self) -> usize { - self.full_min_len() - } - fn push_state(&mut self, state: &CohortState) { - self.full_push_state(state); - } - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.inner.validate_computed_versions(base_version) - } - fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&ActivityCore], - exit: &Exit, - ) -> Result<()> { - self.compute_from_stateful(starting_lengths, others, exit) - } - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.compute_rest_part1(prices, starting_lengths, exit) - } -} +pub use vecs::{ActivitySources, ActivityVecs}; diff --git a/crates/brk_computer/src/distribution/metrics/activity/vecs/coindays_destroyed.rs b/crates/brk_computer/src/distribution/metrics/activity/vecs/coindays_destroyed.rs new file mode 100644 index 000000000..5d59da172 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/activity/vecs/coindays_destroyed.rs @@ -0,0 +1,52 @@ +use brk_cohort::UTXOGroupsWithoutAmountOrType; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{StoredF64, Version}; +use vecdb::{Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{CumulativeUTXOColumnarMetricWithoutAmountOrType, utxo_metric_name}, + indexes, + internal::{CachedWindowStartVec, LazyPerBlockCumulativeRolling, Windows}, +}; + +#[derive(Traversable)] +pub struct CoindaysDestroyedByCohort { + #[traversable(flatten)] + pub cohorts: UTXOGroupsWithoutAmountOrType>, + #[traversable(flatten)] + pub cumulative: CumulativeUTXOColumnarMetricWithoutAmountOrType, +} + +impl CoindaysDestroyedByCohort { + pub(super) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let cumulative = CumulativeUTXOColumnarMetricWithoutAmountOrType::forced_import( + db, + "coindays_destroyed_cumulative", + version, + )?; + let cohorts = UTXOGroupsWithoutAmountOrType::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, "coindays_destroyed"); + let source = cumulative + .matrices + .additive_source(&filter, &format!("{name}_cumulative"), version) + .expect("supported coindays-destroyed cohort"); + LazyPerBlockCumulativeRolling::from_boxed_cumulative_source( + &name, + version, + source, + cached_starts, + indexes, + ) + }); + Ok(Self { + cohorts, + cumulative, + }) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/activity/vecs/collection.rs b/crates/brk_computer/src/distribution/metrics/activity/vecs/collection.rs new file mode 100644 index 000000000..87542ebd6 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/activity/vecs/collection.rs @@ -0,0 +1,226 @@ +use brk_cohort::{ + AmountRange, Filter, UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, UTXOAggregate, + UTXOAggregateId, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, StoredF32, StoredF64, Version}; +use vecdb::{AnyStoredVec, AnyVec, BinaryTransform, ColumnId, Database, Exit, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{UTXORows, utxo_metric_name}, + indexes, + internal::{ + CachedWindowStartVec, ColumnarRollingWindows, Identity, LazyPerBlock, SatsToCents, Windows, + }, +}; + +use super::{ + ActivitySources, CoindaysDestroyedByCohort, CoreCumulativeValueByCohort, + CumulativeValueByCohort, +}; + +#[derive(Traversable)] +pub struct ActivityVecs { + pub transfer_volume: Box>, + pub coindays_destroyed: Box>, + #[traversable(wrap = "transfer_volume", rename = "in_profit")] + pub transfer_volume_in_profit: Box>, + #[traversable(wrap = "transfer_volume", rename = "in_loss")] + pub transfer_volume_in_loss: Box>, + pub coinyears_destroyed: Box>>, + pub dormancy: Box>>, +} + +impl ActivityVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let aggregate_version = version; + let version = version + Version::ONE; + let transfer_volume = Box::new(CumulativeValueByCohort::forced_import( + db, + "transfer_volume", + version, + indexes, + cached_starts, + )?); + let coindays_destroyed = Box::new(CoindaysDestroyedByCohort::forced_import( + db, + version, + indexes, + cached_starts, + )?); + let transfer_volume_in_profit = Box::new(CoreCumulativeValueByCohort::forced_import( + db, + "transfer_volume_in_profit", + version, + indexes, + cached_starts, + )?); + let transfer_volume_in_loss = Box::new(CoreCumulativeValueByCohort::forced_import( + db, + "transfer_volume_in_loss", + version, + indexes, + cached_starts, + )?); + let coinyears_destroyed = Box::new(UTXOAggregate::from_fn(|id| { + let filter = id.select(&UTXO_AGGREGATE_FILTERS); + let name = Self::aggregate_metric_name(id, "coinyears_destroyed"); + LazyPerBlock::from_height_source::, _>( + &name, + Self::aggregate_version(aggregate_version, id), + coindays_destroyed + .cohorts + .get(filter) + .expect("aggregate coindays-destroyed source") + .sum + ._1y + .height + .clone(), + indexes, + ) + })); + let dormancy = Box::new(UTXOAggregate::try_from_fn(|id| { + ColumnarRollingWindows::forced_import( + db, + &Self::aggregate_metric_name(id, "dormancy"), + Self::aggregate_version(aggregate_version, id), + indexes, + ) + })?); + Ok(Self { + transfer_volume, + coindays_destroyed, + transfer_volume_in_profit, + transfer_volume_in_loss, + coinyears_destroyed, + dormancy, + }) + } + + fn aggregate_version(version: Version, id: UTXOAggregateId) -> Version { + version + + Version::ONE + + if matches!(id, UTXOAggregateId::All) { + Version::ONE + } else { + Version::ZERO + } + } + + fn aggregate_metric_name(id: UTXOAggregateId, metric: &str) -> String { + utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ) + } + + pub(crate) fn sources(&self, filter: &Filter) -> Option { + Some(ActivitySources { + transfer_volume: self.transfer_volume.cohorts.get(filter)?.clone(), + }) + } + + #[inline(always)] + pub(crate) fn push( + &mut self, + height_price: Cents, + transfer_volume: UTXORows, + coindays_destroyed: UTXORows, + transfer_volume_in_profit: UTXORows, + transfer_volume_in_loss: UTXORows, + ) { + let transfer_value = transfer_volume.map(|sats| SatsToCents::apply(*sats, height_price)); + let profit_value = + transfer_volume_in_profit.map(|sats| SatsToCents::apply(*sats, height_price)); + let loss_value = + transfer_volume_in_loss.map(|sats| SatsToCents::apply(*sats, height_price)); + + self.transfer_volume + .push_block(transfer_volume, transfer_value); + self.coindays_destroyed + .cumulative + .push_block(coindays_destroyed); + self.transfer_volume_in_profit + .push_block(transfer_volume_in_profit, profit_value); + self.transfer_volume_in_loss + .push_block(transfer_volume_in_loss, loss_value); + } + + #[inline(always)] + pub(crate) fn push_addr_balance( + &mut self, + height_price: Cents, + transfer_volume: &AmountRange, + ) { + let cents = AmountRange::from_fn(|amount| { + SatsToCents::apply(*amount.select(transfer_volume), height_price) + }); + self.transfer_volume + .push_addr_balance(transfer_volume, ¢s); + } + + pub(crate) fn min_len(&self) -> usize { + self.transfer_volume + .min_len() + .min(self.coindays_destroyed.cumulative.min_len()) + .min(self.transfer_volume_in_profit.min_len()) + .min(self.transfer_volume_in_loss.min_len()) + .min( + self.dormancy + .iter() + .map(|value| value.height.len()) + .min() + .unwrap_or_default(), + ) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = self.transfer_volume.collect_vecs_mut(); + vecs.extend(self.coindays_destroyed.cumulative.collect_vecs_mut()); + vecs.extend(self.transfer_volume_in_profit.collect_vecs_mut()); + vecs.extend(self.transfer_volume_in_loss.collect_vecs_mut()); + vecs.extend(self.dormancy.iter_mut().map(|value| value.stored_mut())); + vecs + } + + pub(crate) fn compute_dormancy(&mut self, max_from: Height, exit: &Exit) -> Result<()> { + for id in UTXOAggregateId::ALL { + let filter = id.select(&UTXO_AGGREGATE_FILTERS); + let coindays_destroyed = &self + .coindays_destroyed + .cohorts + .get(filter) + .expect("aggregate coindays-destroyed cohort") + .sum; + let transfer_volume = &self + .transfer_volume + .cohorts + .get(filter) + .expect("aggregate transfer-volume cohort") + .sum + .0; + id.select_mut(&mut self.dormancy).compute_columns2( + max_from, + |window| &window.select(coindays_destroyed).height, + |window| &window.select(transfer_volume).btc.height, + |_, rolling_coindays, rolling_btc| { + let btc = f64::from(rolling_btc); + if btc == 0.0 { + StoredF32::from(0.0f32) + } else { + StoredF32::from((f64::from(rolling_coindays) / btc) as f32) + } + }, + exit, + )?; + } + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/activity/vecs/core_cumulative_value.rs b/crates/brk_computer/src/distribution/metrics/activity/vecs/core_cumulative_value.rs new file mode 100644 index 000000000..c70adf4ab --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/activity/vecs/core_cumulative_value.rs @@ -0,0 +1,67 @@ +use brk_cohort::UTXOGroupsWithoutAmountOrType; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Sats, Version}; +use vecdb::{AnyStoredVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{ + CumulativeUTXOValueColumnarMetricWithoutAmountOrType, UTXORows, utxo_metric_name, + }, + indexes, + internal::{CachedWindowStartVec, LazyValuePerBlockCumulativeRolling, Windows}, +}; + +#[derive(Traversable)] +pub struct CoreCumulativeValueByCohort { + #[traversable(flatten)] + pub cohorts: UTXOGroupsWithoutAmountOrType, + pub cumulative: CumulativeUTXOValueColumnarMetricWithoutAmountOrType, +} + +impl CoreCumulativeValueByCohort { + pub(super) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let cumulative = CumulativeUTXOValueColumnarMetricWithoutAmountOrType::forced_import( + db, + &format!("{metric}_cumulative"), + version, + )?; + let cohorts = UTXOGroupsWithoutAmountOrType::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, metric); + let (sats, cents) = cumulative + .sources(&filter, &name, version) + .expect("supported core cumulative value cohort"); + LazyValuePerBlockCumulativeRolling::from_boxed_cumulative_sources( + &name, + version, + sats, + cents, + indexes, + cached_starts, + ) + }); + Ok(Self { + cohorts, + cumulative, + }) + } + + #[inline(always)] + pub(super) fn push_block(&mut self, sats: UTXORows, cents: UTXORows) { + self.cumulative.push_block(sats, cents); + } + + pub(super) fn min_len(&self) -> usize { + self.cumulative.min_len() + } + + pub(super) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + self.cumulative.collect_vecs_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/activity/vecs/cumulative_value.rs b/crates/brk_computer/src/distribution/metrics/activity/vecs/cumulative_value.rs new file mode 100644 index 000000000..e9413e3a5 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/activity/vecs/cumulative_value.rs @@ -0,0 +1,98 @@ +use brk_cohort::{AmountRange, CohortContext, UTXOGroups}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Sats, Version}; +use vecdb::{AnyStoredVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{ + ColumnarAmountValue, CumulativeUTXOValueColumnarMetric, UTXORows, utxo_metric_name, + }, + indexes, + internal::{CachedWindowStartVec, LazyValuePerBlockCumulativeRolling, Windows}, +}; + +#[derive(Traversable)] +pub struct CumulativeValueByCohort { + #[traversable(flatten)] + pub cohorts: UTXOGroups, + pub cumulative: CumulativeUTXOValueColumnarMetric, + pub addr_balance: ColumnarAmountValue, +} + +impl CumulativeValueByCohort { + pub(super) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let cumulative = CumulativeUTXOValueColumnarMetric::forced_import( + db, + &format!("{metric}_cumulative"), + version, + )?; + let cohorts = UTXOGroups::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, metric); + let (sats, cents) = cumulative + .sources(&filter, &name, version) + .expect("supported cumulative value cohort"); + LazyValuePerBlockCumulativeRolling::from_boxed_cumulative_sources( + &name, + version, + sats, + cents, + indexes, + cached_starts, + ) + }); + let addr_version = version + Version::ONE; + let addr_balance = ColumnarAmountValue::forced_import( + db, + &format!("addrs_{metric}_cumulative_by_balance_range"), + CohortContext::Addr, + metric, + addr_version, + |name, sats, cents| { + LazyValuePerBlockCumulativeRolling::from_boxed_cumulative_sources( + name, + addr_version, + sats, + cents, + indexes, + cached_starts, + ) + }, + )?; + Ok(Self { + cohorts, + cumulative, + addr_balance, + }) + } + + #[inline(always)] + pub(super) fn push_block(&mut self, sats: UTXORows, cents: UTXORows) { + self.cumulative.push_block(sats, cents); + } + + #[inline(always)] + pub(super) fn push_addr_balance( + &mut self, + sats: &AmountRange, + cents: &AmountRange, + ) { + self.addr_balance.push_cumulative(sats, cents); + } + + pub(super) fn min_len(&self) -> usize { + self.cumulative.min_len().min(self.addr_balance.len()) + } + + pub(super) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = self.cumulative.collect_vecs_mut(); + vecs.extend(self.addr_balance.collect_vecs_mut()); + vecs + } +} diff --git a/crates/brk_computer/src/distribution/metrics/activity/vecs/mod.rs b/crates/brk_computer/src/distribution/metrics/activity/vecs/mod.rs new file mode 100644 index 000000000..4c7ca3d49 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/activity/vecs/mod.rs @@ -0,0 +1,11 @@ +mod coindays_destroyed; +mod collection; +mod core_cumulative_value; +mod cumulative_value; +mod sources; + +pub(super) use coindays_destroyed::CoindaysDestroyedByCohort; +pub use collection::ActivityVecs; +pub(super) use core_cumulative_value::CoreCumulativeValueByCohort; +pub(super) use cumulative_value::CumulativeValueByCohort; +pub use sources::ActivitySources; diff --git a/crates/brk_computer/src/distribution/metrics/activity/vecs/sources.rs b/crates/brk_computer/src/distribution/metrics/activity/vecs/sources.rs new file mode 100644 index 000000000..313064279 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/activity/vecs/sources.rs @@ -0,0 +1,6 @@ +use crate::internal::LazyValuePerBlockCumulativeRolling; + +#[derive(Clone)] +pub struct ActivitySources { + pub transfer_volume: LazyValuePerBlockCumulativeRolling, +} diff --git a/crates/brk_computer/src/distribution/metrics/additive/aggregate/fiat.rs b/crates/brk_computer/src/distribution/metrics/additive/aggregate/fiat.rs new file mode 100644 index 000000000..1894c13a9 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/additive/aggregate/fiat.rs @@ -0,0 +1,84 @@ +use brk_cohort::{ + ByTerm, TermId, UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, UTXOAggregate, UTXOAggregateId, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::Version; +use derive_more::{Deref, DerefMut}; +use vecdb::{ + AnyStoredVec, AnyVec, ColumnId, Database, ReadableCloneableVec, ReadableColumnarVec, Rw, + StorageMode, +}; + +use crate::{ + indexes, + internal::{ColumnarPerBlock, FiatType, LazyFiatPerBlock}, +}; + +use super::super::utxo_metric_name; + +#[derive(Deref, DerefMut, Traversable)] +pub struct AdditiveAggregateFiatPerBlock { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub values: ColumnarPerBlock>, M>, +} + +impl AdditiveAggregateFiatPerBlock { + pub(crate) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + ) -> Result { + let values = ColumnarPerBlock::forced_import( + db, + &format!("{metric}_cents_by_term"), + version, + |source| { + let source = source.clone(); + UTXOAggregate::from_fn(|aggregate| { + let name = utxo_metric_name( + aggregate.select(&UTXO_AGGREGATE_FILTERS), + aggregate.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ); + let cents = match aggregate { + UTXOAggregateId::All => source + .sum_columns( + &format!("{name}_cents"), + version, + TermId::ALL.iter().copied(), + ) + .read_only_boxed_clone(), + UTXOAggregateId::Sth => source + .column(&format!("{name}_cents"), version, TermId::Short) + .read_only_boxed_clone(), + UTXOAggregateId::Lth => source + .column(&format!("{name}_cents"), version, TermId::Long) + .read_only_boxed_clone(), + }; + LazyFiatPerBlock::from_boxed_cents_source(&name, version, cents, indexes) + }) + }, + )?; + Ok(Self { values }) + } + + #[inline(always)] + pub(crate) fn push(&mut self, row: UTXOAggregate) { + self.values.push(ByTerm { + short: row.sth, + long: row.lth, + }); + } + + pub(crate) fn len(&self) -> usize { + self.values.height.len() + } + + pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { + self.values.stored_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/additive/aggregate/mod.rs b/crates/brk_computer/src/distribution/metrics/additive/aggregate/mod.rs new file mode 100644 index 000000000..b0f9497b5 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/additive/aggregate/mod.rs @@ -0,0 +1,3 @@ +mod fiat; + +pub use fiat::AdditiveAggregateFiatPerBlock; diff --git a/crates/brk_computer/src/distribution/metrics/additive/mod.rs b/crates/brk_computer/src/distribution/metrics/additive/mod.rs new file mode 100644 index 000000000..f2186cab9 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/additive/mod.rs @@ -0,0 +1,7 @@ +mod aggregate; +mod utxo_raw; + +pub use aggregate::AdditiveAggregateFiatPerBlock; +pub(crate) use utxo_raw::AdditiveUTXORawVec; + +use super::utxo_metric_name; diff --git a/crates/brk_computer/src/distribution/metrics/additive/utxo_raw.rs b/crates/brk_computer/src/distribution/metrics/additive/utxo_raw.rs new file mode 100644 index 000000000..99888ce06 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/additive/utxo_raw.rs @@ -0,0 +1,45 @@ +use std::ops::AddAssign; + +use brk_cohort::{ByTerm, TermId, UTXOAggregate}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use vecdb::{ + AnyStoredVec, AnyVec, BytesVec, BytesVecValue, ColumnarVec, Database, ImportableVec, Rw, + StorageMode, WritableVec, +}; + +#[derive(Traversable)] +pub struct AdditiveUTXORawVec +where + T: BytesVecValue, +{ + pub matrix: M::Stored, TermId>>, +} + +impl AdditiveUTXORawVec +where + T: BytesVecValue + AddAssign + Copy, +{ + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + Ok(Self { + matrix: ImportableVec::forced_import(db, &format!("{name}_by_term"), version)?, + }) + } + + #[inline(always)] + pub(crate) fn push(&mut self, row: &UTXOAggregate) { + self.matrix.push(ByTerm { + short: row.sth, + long: row.lth, + }); + } + + pub(crate) fn len(&self) -> usize { + self.matrix.len() + } + + pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { + &mut self.matrix + } +} diff --git a/crates/brk_computer/src/distribution/metrics/aggregate/cumulative_fiat.rs b/crates/brk_computer/src/distribution/metrics/aggregate/cumulative_fiat.rs new file mode 100644 index 000000000..290cca7a2 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/aggregate/cumulative_fiat.rs @@ -0,0 +1,99 @@ +use brk_cohort::{ + ByTerm, TermId, UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, UTXOAggregate, UTXOAggregateId, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::Version; +use derive_more::{Deref, DerefMut}; +use vecdb::{ + AnyStoredVec, AnyVec, ColumnId, Database, ReadableCloneableVec, ReadableColumnarVec, Rw, + StorageMode, +}; + +use crate::{ + indexes, + internal::{ + CachedWindowStartVec, ColumnarPerBlockCumulativeRolling, FiatType, + LazyFiatPerBlockCumulativeWithSums, Windows, + }, +}; + +use super::utxo_metric_name; + +#[derive(Deref, DerefMut, Traversable)] +pub struct AdditiveAggregateFiatPerBlockCumulativeWithSums { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub values: ColumnarPerBlockCumulativeRolling< + C, + TermId, + UTXOAggregate>, + M, + >, +} + +impl AdditiveAggregateFiatPerBlockCumulativeWithSums { + pub(crate) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let values = ColumnarPerBlockCumulativeRolling::forced_import( + db, + &format!("{metric}_cumulative_cents_by_term"), + version, + |source| { + let source = source.clone(); + UTXOAggregate::from_fn(|id| { + let name = utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ); + let cumulative = match id { + UTXOAggregateId::All => source + .sum_columns( + &format!("{name}_cumulative_cents"), + version, + TermId::ALL.iter().copied(), + ) + .read_only_boxed_clone(), + UTXOAggregateId::Sth => source + .column(&format!("{name}_cumulative_cents"), version, TermId::Short) + .read_only_boxed_clone(), + UTXOAggregateId::Lth => source + .column(&format!("{name}_cumulative_cents"), version, TermId::Long) + .read_only_boxed_clone(), + }; + LazyFiatPerBlockCumulativeWithSums::from_boxed_cumulative_cents_source( + &name, + version, + cumulative, + indexes, + cached_starts, + ) + }) + }, + )?; + Ok(Self { values }) + } + + #[inline(always)] + pub(crate) fn push_block(&mut self, row: UTXOAggregate) { + self.values.push_block(ByTerm { + short: row.sth, + long: row.lth, + }); + } + + pub(crate) fn len(&self) -> usize { + self.values.cumulative.len() + } + + pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { + self.values.stored_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/aggregate/fiat.rs b/crates/brk_computer/src/distribution/metrics/aggregate/fiat.rs new file mode 100644 index 000000000..dd06fa11a --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/aggregate/fiat.rs @@ -0,0 +1,69 @@ +use brk_cohort::{UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, UTXOAggregate, UTXOAggregateId}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::Version; +use derive_more::{Deref, DerefMut}; +use vecdb::{ + AnyStoredVec, AnyVec, Database, ReadableCloneableVec, ReadableColumnarVec, Rw, StorageMode, +}; + +use crate::{ + indexes, + internal::{ColumnarPerBlock, FiatType, LazyFiatPerBlock}, +}; + +use super::utxo_metric_name; + +#[derive(Deref, DerefMut, Traversable)] +pub struct AggregateFiatPerBlock { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub values: ColumnarPerBlock>, M>, +} + +impl AggregateFiatPerBlock { + pub(crate) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + ) -> Result { + let values = ColumnarPerBlock::forced_import( + db, + &format!("{metric}_cents_by_aggregate"), + version, + |source| { + UTXOAggregate::from_fn(|id| { + let name = utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ); + LazyFiatPerBlock::from_boxed_cents_source( + &name, + version, + source + .column(&format!("{name}_cents"), version, id) + .read_only_boxed_clone(), + indexes, + ) + }) + }, + )?; + Ok(Self { values }) + } + + #[inline(always)] + pub(crate) fn push(&mut self, row: UTXOAggregate) { + self.values.push(row); + } + + pub(crate) fn len(&self) -> usize { + self.values.height.len() + } + + pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { + self.values.stored_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/aggregate/mod.rs b/crates/brk_computer/src/distribution/metrics/aggregate/mod.rs new file mode 100644 index 000000000..0a414c2df --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/aggregate/mod.rs @@ -0,0 +1,11 @@ +mod cumulative_fiat; +mod fiat; +mod percent; +mod price; + +pub use cumulative_fiat::AdditiveAggregateFiatPerBlockCumulativeWithSums; +pub use fiat::AggregateFiatPerBlock; +pub use percent::AggregatePercentPerBlock; +pub use price::AggregatePriceWithRatioPerBlock; + +use super::utxo_metric_name; diff --git a/crates/brk_computer/src/distribution/metrics/aggregate/percent.rs b/crates/brk_computer/src/distribution/metrics/aggregate/percent.rs new file mode 100644 index 000000000..448f49e20 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/aggregate/percent.rs @@ -0,0 +1,74 @@ +use brk_cohort::{UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, UTXOAggregate, UTXOAggregateId}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use derive_more::{Deref, DerefMut}; +use vecdb::{AnyStoredVec, Database, Exit, ReadableVec, Rw, StorageMode, VecValue}; + +use crate::{ + indexes, + internal::{ColumnarPerBlock, FixedRatio, LazyColumnPercentPerBlock}, +}; + +use super::utxo_metric_name; + +#[derive(Deref, DerefMut, Traversable)] +pub struct AggregatePercentPerBlock { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub values: ColumnarPerBlock< + B, + UTXOAggregateId, + UTXOAggregate>, + M, + >, +} + +impl AggregatePercentPerBlock { + pub(crate) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + ) -> Result { + let values = ColumnarPerBlock::forced_import( + db, + &format!("{metric}_{}_by_aggregate", B::SUFFIX), + version, + |source| { + UTXOAggregate::from_fn(|id| { + let name = utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ); + LazyColumnPercentPerBlock::new(&name, version, source, id, indexes) + }) + }, + )?; + Ok(Self { values }) + } + + pub(crate) fn compute_columns2<'a, A, C, V1, V2>( + &mut self, + max_from: Height, + source1: impl Fn(UTXOAggregateId) -> &'a V1, + source2: impl Fn(UTXOAggregateId) -> &'a V2, + transform: impl FnMut(UTXOAggregateId, A, C) -> B, + exit: &Exit, + ) -> Result<()> + where + A: VecValue, + C: VecValue, + V1: ReadableVec + 'a, + V2: ReadableVec + 'a, + { + self.values + .compute_columns2(max_from, source1, source2, transform, exit) + } + + pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { + self.values.stored_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/aggregate/price.rs b/crates/brk_computer/src/distribution/metrics/aggregate/price.rs new file mode 100644 index 000000000..5f9c16158 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/aggregate/price.rs @@ -0,0 +1,68 @@ +use brk_cohort::{UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, UTXOAggregate, UTXOAggregateId}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Version}; +use derive_more::{Deref, DerefMut}; +use vecdb::{AnyStoredVec, AnyVec, CachedBoxedVec, Database, Rw, StorageMode}; + +use crate::{ + indexes, + internal::{ColumnarPerBlock, LazyColumnPriceWithRatioPerBlock}, +}; + +use super::utxo_metric_name; + +#[derive(Deref, DerefMut, Traversable)] +pub struct AggregatePriceWithRatioPerBlock { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub values: ColumnarPerBlock< + Cents, + UTXOAggregateId, + UTXOAggregate>, + M, + >, +} + +impl AggregatePriceWithRatioPerBlock { + pub(crate) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + spot_price: &CachedBoxedVec, + ) -> Result { + let values = ColumnarPerBlock::forced_import( + db, + &format!("{metric}_cents_by_aggregate"), + version, + |source| { + UTXOAggregate::from_fn(|id| { + let name = utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ); + LazyColumnPriceWithRatioPerBlock::new( + &name, version, source, id, indexes, spot_price, + ) + }) + }, + )?; + Ok(Self { values }) + } + + #[inline(always)] + pub(crate) fn push(&mut self, row: UTXOAggregate) { + self.values.push(row); + } + + pub(crate) fn len(&self) -> usize { + self.values.height.len() + } + + pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { + self.values.stored_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/all.rs b/crates/brk_computer/src/distribution/metrics/cohort/all.rs deleted file mode 100644 index 7a6f66913..000000000 --- a/crates/brk_computer/src/distribution/metrics/cohort/all.rs +++ /dev/null @@ -1,151 +0,0 @@ -use brk_cohort::Filter; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Cents, Height, Version}; -use vecdb::{AnyStoredVec, Exit, ReadableVec, Rw, StorageMode}; - -use crate::{ - distribution::AllChainCache, - distribution::metrics::{ - ActivityFull, AdjustedSopr, CohortMetricsBase, CostBasis, ImportConfig, OutputsBase, - RealizedFull, RelativeForAll, SupplyCore, UnrealizedFull, - }, - price, -}; - -/// All-cohort metrics: extended realized + adjusted (as composable add-on), -/// extended cost basis, relative for-all (no rel_to_all). -/// Used by: the "all" cohort. -#[derive(Traversable)] -pub struct AllCohortMetrics { - #[traversable(skip)] - pub filter: Filter, - pub supply: Box>, - pub outputs: Box>, - pub activity: Box>, - pub realized: Box>, - pub cost_basis: Box>, - pub unrealized: Box>, - #[traversable(wrap = "realized/sopr", rename = "adjusted")] - pub asopr: Box>, - #[traversable(flatten)] - pub relative: Box>, -} - -impl CohortMetricsBase for AllCohortMetrics { - type ActivityVecs = ActivityFull; - type RealizedVecs = RealizedFull; - type UnrealizedVecs = UnrealizedFull; - - impl_cohort_accessors!(); - - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.supply.validate_computed_versions(base_version)?; - self.activity.validate_computed_versions(base_version)?; - self.cost_basis.validate_computed_versions(base_version)?; - Ok(()) - } - - fn min_stateful_len(&self) -> usize { - // Only check per-block pushed vecs, not aggregated ones (supply, outputs, - // activity, realized core, unrealized core are summed from age_range). - self.realized - .min_stateful_len() - .min(self.unrealized.min_stateful_len()) - .min(self.cost_basis.min_stateful_len()) - } - - fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); - vecs.extend(self.supply.collect_vecs_mut()); - vecs.extend(self.outputs.collect_vecs_mut()); - vecs.extend(self.activity.collect_vecs_mut()); - vecs.extend(self.realized.collect_vecs_mut()); - vecs.extend(self.cost_basis.collect_vecs_mut()); - vecs.extend(self.unrealized.collect_vecs_mut()); - vecs - } -} - -impl AllCohortMetrics { - /// Import the "all" cohort metrics with a pre-imported supply. - /// - /// Supply is imported first (before other cohorts) so it can be used as `all_supply` - /// reference for relative metric lazy vecs in other cohorts. - pub(crate) fn forced_import_with_supply( - cfg: &ImportConfig, - supply: SupplyCore, - all_chain: &AllChainCache, - ) -> Result { - let realized = RealizedFull::forced_import(cfg, all_chain)?; - let unrealized = UnrealizedFull::forced_import(cfg, &realized.price.ppm)?; - let asopr = AdjustedSopr::forced_import(cfg)?; - - let relative = RelativeForAll::forced_import(cfg, &unrealized, all_chain)?; - - Ok(Self { - filter: cfg.filter.clone(), - supply: Box::new(supply), - outputs: Box::new(OutputsBase::forced_import(cfg)?), - activity: Box::new(ActivityFull::forced_import(cfg)?), - realized: Box::new(realized), - cost_basis: Box::new(CostBasis::forced_import(cfg)?), - unrealized: Box::new(unrealized), - asopr: Box::new(asopr), - relative: Box::new(relative), - }) - } - - #[allow(clippy::too_many_arguments)] - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - under_1h_value_created: &impl ReadableVec, - under_1h_value_destroyed: &impl ReadableVec, - exit: &Exit, - ) -> Result<()> { - self.realized.compute_rest_part2( - prices, - starting_lengths, - &self.supply.total.btc.height, - &self.activity.transfer_volume, - exit, - )?; - - self.asopr.compute_rest_part2( - starting_lengths, - &self.activity.transfer_volume.inner.cumulative.cents.height, - &self.realized.core.sopr.value_destroyed.cumulative.height, - under_1h_value_created, - under_1h_value_destroyed, - exit, - )?; - - self.cost_basis.compute_prices( - starting_lengths, - &prices.spot.cents.height, - &self.unrealized.invested_capital.in_profit.cents.height, - &self.unrealized.invested_capital.in_loss.cents.height, - &self.supply.in_profit.sats.height, - &self.supply.in_loss.sats.height, - &self.unrealized.capitalized_cap_in_profit_raw, - &self.unrealized.capitalized_cap_in_loss_raw, - exit, - )?; - - self.unrealized - .compute_sentiment(starting_lengths, &prices.spot.cents.height, exit)?; - - self.relative.compute( - starting_lengths.height, - &self.supply, - &self.unrealized, - &self.realized, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/basic.rs b/crates/brk_computer/src/distribution/metrics/cohort/basic.rs deleted file mode 100644 index 5e9ea26ed..000000000 --- a/crates/brk_computer/src/distribution/metrics/cohort/basic.rs +++ /dev/null @@ -1,76 +0,0 @@ -use brk_cohort::Filter; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use vecdb::{AnyStoredVec, Exit, Rw, StorageMode}; - -use crate::{ - distribution::metrics::{ - ActivityCore, CohortMetricsBase, ImportConfig, OutputsBase, RealizedCore, SupplyCore, - UnrealizedCore, - }, - price, -}; - -/// Basic cohort metrics: no extensions, used by age_range cohorts. -#[derive(Traversable)] -pub struct BasicCohortMetrics { - #[traversable(skip)] - pub filter: Filter, - pub supply: Box>, - pub outputs: Box>, - pub activity: Box>, - pub realized: Box>, - pub unrealized: Box>, -} - -impl CohortMetricsBase for BasicCohortMetrics { - type ActivityVecs = ActivityCore; - type RealizedVecs = RealizedCore; - type UnrealizedVecs = UnrealizedCore; - - impl_cohort_accessors!(); - - fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); - vecs.extend(self.supply.collect_vecs_mut()); - vecs.extend(self.outputs.collect_vecs_mut()); - vecs.extend(self.activity.collect_vecs_mut()); - vecs.extend(self.realized.collect_vecs_mut()); - vecs.extend(self.unrealized.collect_vecs_mut()); - vecs - } -} - -impl BasicCohortMetrics { - pub(crate) fn forced_import(cfg: &ImportConfig, supply: SupplyCore) -> Result { - let realized = RealizedCore::forced_import(cfg)?; - let unrealized = UnrealizedCore::forced_import(cfg, &realized.price.ppm)?; - - Ok(Self { - filter: cfg.filter.clone(), - supply: Box::new(supply), - outputs: Box::new(OutputsBase::forced_import(cfg)?), - activity: Box::new(ActivityCore::forced_import(cfg)?), - realized: Box::new(realized), - unrealized: Box::new(unrealized), - }) - } - - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.realized.compute_rest_part2( - prices, - starting_lengths, - &self.supply.total.btc.height, - &self.activity.transfer_volume.sum._24h.cents.height, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/core.rs b/crates/brk_computer/src/distribution/metrics/cohort/core.rs deleted file mode 100644 index 26b95a65b..000000000 --- a/crates/brk_computer/src/distribution/metrics/cohort/core.rs +++ /dev/null @@ -1,146 +0,0 @@ -use brk_cohort::Filter; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::Version; -use vecdb::{AnyStoredVec, Exit, Rw, StorageMode}; - -use crate::{ - distribution::metrics::{ - ActivityCore, AllSupplyCache, CohortMetricsBase, ImportConfig, OutputsBase, RealizedCore, - SupplyCore, UnrealizedCore, - }, - price, -}; - -#[derive(Traversable)] -pub struct CoreCohortMetrics { - #[traversable(skip)] - pub filter: Filter, - pub supply: Box>, - pub outputs: Box>, - pub activity: Box>, - pub realized: Box>, - pub unrealized: Box>, -} - -impl CoreCohortMetrics { - pub(crate) fn forced_import(cfg: &ImportConfig, all_supply: &AllSupplyCache) -> Result { - let supply = SupplyCore::forced_import(cfg, all_supply)?; - Self::forced_import_with_supply(cfg, supply) - } - - pub(crate) fn forced_import_with_supply( - cfg: &ImportConfig, - supply: SupplyCore, - ) -> Result { - let realized = RealizedCore::forced_import(cfg)?; - let unrealized = UnrealizedCore::forced_import(cfg, &realized.price.ppm)?; - - Ok(Self { - filter: cfg.filter.clone(), - supply: Box::new(supply), - outputs: Box::new(OutputsBase::forced_import(cfg)?), - activity: Box::new(ActivityCore::forced_import(cfg)?), - realized: Box::new(realized), - unrealized: Box::new(unrealized), - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.supply - .min_len() - .min(self.outputs.min_len()) - .min(self.activity.min_len()) - .min(self.realized.min_stateful_len()) - .min(self.unrealized.min_stateful_len()) - } - - pub(crate) fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.supply.validate_computed_versions(base_version)?; - self.activity.validate_computed_versions(base_version)?; - Ok(()) - } - - pub(crate) fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); - vecs.extend(self.supply.collect_vecs_mut()); - vecs.extend(self.outputs.collect_vecs_mut()); - vecs.extend(self.activity.collect_vecs_mut()); - vecs.extend(self.realized.collect_vecs_mut()); - vecs.extend(self.unrealized.collect_vecs_mut()); - vecs - } - - /// Aggregate Core-tier fields from CohortMetricsBase sources (e.g. age_range -> under_age/over_age). - pub(crate) fn compute_from_base_sources( - &mut self, - starting_lengths: &Lengths, - others: &[&T], - exit: &Exit, - ) -> Result<()> { - self.supply.compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.supply()).collect::>(), - exit, - )?; - self.outputs.compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.outputs()).collect::>(), - exit, - )?; - self.activity.compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.activity_core()).collect::>(), - exit, - )?; - self.realized.compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.realized_core()).collect::>(), - exit, - )?; - self.unrealized.compute_from_stateful( - starting_lengths, - &others - .iter() - .map(|v| v.unrealized_core()) - .collect::>(), - exit, - )?; - - Ok(()) - } - - pub(crate) fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.activity - .compute_rest_part1(prices, starting_lengths, exit)?; - - self.realized.compute_rest_part1(starting_lengths, exit)?; - - self.unrealized.compute_rest(starting_lengths, exit)?; - - Ok(()) - } - - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.realized.compute_rest_part2( - prices, - starting_lengths, - &self.supply.total.btc.height, - &self.activity.transfer_volume.sum._24h.cents.height, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/extended.rs b/crates/brk_computer/src/distribution/metrics/cohort/extended.rs deleted file mode 100644 index 97e50b455..000000000 --- a/crates/brk_computer/src/distribution/metrics/cohort/extended.rs +++ /dev/null @@ -1,133 +0,0 @@ -use brk_cohort::Filter; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::Version; -use vecdb::AnyStoredVec; -use vecdb::{Exit, Rw, StorageMode}; - -use crate::{ - distribution::AllChainCache, - distribution::metrics::{ - ActivityFull, CohortMetricsBase, CostBasis, ImportConfig, OutputsBase, RealizedFull, - RelativeWithExtended, SupplyCore, UnrealizedFull, - }, - price, -}; - -/// Cohort metrics with extended realized + extended cost basis (no adjusted). -/// Used by: lth, age_range cohorts. -#[derive(Traversable)] -pub struct ExtendedCohortMetrics { - #[traversable(skip)] - pub filter: Filter, - pub supply: Box>, - pub outputs: Box>, - pub activity: Box>, - pub realized: Box>, - pub cost_basis: Box>, - pub unrealized: Box>, - #[traversable(flatten)] - pub relative: Box>, -} - -impl CohortMetricsBase for ExtendedCohortMetrics { - type ActivityVecs = ActivityFull; - type RealizedVecs = RealizedFull; - type UnrealizedVecs = UnrealizedFull; - - impl_cohort_accessors!(); - - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.supply.validate_computed_versions(base_version)?; - self.activity.validate_computed_versions(base_version)?; - self.cost_basis.validate_computed_versions(base_version)?; - Ok(()) - } - - fn min_stateful_len(&self) -> usize { - // Only check per-block pushed vecs, not aggregated ones (supply, outputs, - // activity, realized core, unrealized core are summed from age_range). - self.realized - .min_stateful_len() - .min(self.unrealized.min_stateful_len()) - .min(self.cost_basis.min_stateful_len()) - } - - fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); - vecs.extend(self.supply.collect_vecs_mut()); - vecs.extend(self.outputs.collect_vecs_mut()); - vecs.extend(self.activity.collect_vecs_mut()); - vecs.extend(self.realized.collect_vecs_mut()); - vecs.extend(self.cost_basis.collect_vecs_mut()); - vecs.extend(self.unrealized.collect_vecs_mut()); - vecs - } -} - -impl ExtendedCohortMetrics { - pub(crate) fn forced_import( - cfg: &ImportConfig, - supply: SupplyCore, - all_chain: &AllChainCache, - ) -> Result { - let realized = RealizedFull::forced_import(cfg, all_chain)?; - let unrealized = UnrealizedFull::forced_import(cfg, &realized.price.ppm)?; - - let relative = RelativeWithExtended::forced_import(cfg, &unrealized, all_chain)?; - - Ok(Self { - filter: cfg.filter.clone(), - supply: Box::new(supply), - outputs: Box::new(OutputsBase::forced_import(cfg)?), - activity: Box::new(ActivityFull::forced_import(cfg)?), - realized: Box::new(realized), - cost_basis: Box::new(CostBasis::forced_import(cfg)?), - unrealized: Box::new(unrealized), - relative: Box::new(relative), - }) - } - - #[allow(clippy::too_many_arguments)] - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.realized.compute_rest_part2( - prices, - starting_lengths, - &self.supply.total.btc.height, - &self.activity.transfer_volume, - exit, - )?; - - self.cost_basis.compute_prices( - starting_lengths, - &prices.spot.cents.height, - &self.unrealized.invested_capital.in_profit.cents.height, - &self.unrealized.invested_capital.in_loss.cents.height, - &self.supply.in_profit.sats.height, - &self.supply.in_loss.sats.height, - &self.unrealized.capitalized_cap_in_profit_raw, - &self.unrealized.capitalized_cap_in_loss_raw, - exit, - )?; - - self.unrealized - .compute_sentiment(starting_lengths, &prices.spot.cents.height, exit)?; - - self.relative.compute( - starting_lengths.height, - &self.supply, - &self.unrealized, - &self.realized, - &self.supply.total.usd.height, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/extended_adjusted.rs b/crates/brk_computer/src/distribution/metrics/cohort/extended_adjusted.rs deleted file mode 100644 index 487f24db9..000000000 --- a/crates/brk_computer/src/distribution/metrics/cohort/extended_adjusted.rs +++ /dev/null @@ -1,103 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Cents, Height, Version}; -use derive_more::{Deref, DerefMut}; -use vecdb::{AnyStoredVec, Exit, ReadableVec, Rw, StorageMode}; - -use crate::{ - distribution::AllChainCache, - distribution::metrics::{ - ActivityFull, AdjustedSopr, CohortMetricsBase, ImportConfig, RealizedFull, SupplyCore, - UnrealizedFull, - }, - price, -}; - -use super::ExtendedCohortMetrics; - -/// Cohort metrics with extended + adjusted realized, extended cost basis. -/// Wraps `ExtendedCohortMetrics` and adds adjusted SOPR as a composable add-on. -/// Used by: sth cohort. -#[derive(Deref, DerefMut, Traversable)] -pub struct ExtendedAdjustedCohortMetrics { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub inner: ExtendedCohortMetrics, - #[traversable(wrap = "realized/sopr", rename = "adjusted")] - pub asopr: Box>, -} - -impl CohortMetricsBase for ExtendedAdjustedCohortMetrics { - type ActivityVecs = ActivityFull; - type RealizedVecs = RealizedFull; - type UnrealizedVecs = UnrealizedFull; - - impl_cohort_accessors_inner!(); - - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.inner.validate_computed_versions(base_version) - } - - fn min_stateful_len(&self) -> usize { - self.inner.min_stateful_len() - } - - fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - self.inner.collect_all_vecs_mut() - } -} - -impl ExtendedAdjustedCohortMetrics { - pub(crate) fn forced_import( - cfg: &ImportConfig, - supply: SupplyCore, - all_chain: &AllChainCache, - ) -> Result { - let inner = ExtendedCohortMetrics::forced_import(cfg, supply, all_chain)?; - let asopr = AdjustedSopr::forced_import(cfg)?; - Ok(Self { - inner, - asopr: Box::new(asopr), - }) - } - - #[allow(clippy::too_many_arguments)] - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - under_1h_value_created: &impl ReadableVec, - under_1h_value_destroyed: &impl ReadableVec, - exit: &Exit, - ) -> Result<()> { - self.inner - .compute_rest_part2(prices, starting_lengths, exit)?; - - self.asopr.compute_rest_part2( - starting_lengths, - &self - .inner - .activity - .transfer_volume - .inner - .cumulative - .cents - .height, - &self - .inner - .realized - .core - .sopr - .value_destroyed - .cumulative - .height, - under_1h_value_created, - under_1h_value_destroyed, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/minimal.rs b/crates/brk_computer/src/distribution/metrics/cohort/minimal.rs deleted file mode 100644 index bd3a45391..000000000 --- a/crates/brk_computer/src/distribution/metrics/cohort/minimal.rs +++ /dev/null @@ -1,127 +0,0 @@ -use brk_cohort::Filter; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use vecdb::{AnyStoredVec, Exit, Rw, StorageMode}; - -use crate::{ - distribution::metrics::{ - ActivityMinimal, AllSupplyCache, ImportConfig, OutputsBase, RealizedMinimal, SupplyBase, - UnrealizedMinimal, - }, - price, -}; - -/// MinimalCohortMetrics: supply, outputs, realized cap/price/mvrv/profit/loss + value_created/destroyed. -/// -/// Used for amount_range cohorts. -/// Does NOT implement CohortMetricsBase — standalone, not aggregatable via trait. -#[derive(Traversable)] -pub struct MinimalCohortMetrics { - #[traversable(skip)] - pub filter: Filter, - pub supply: Box>, - pub outputs: Box>, - pub activity: Box>, - pub realized: Box>, - pub unrealized: Box, -} - -impl MinimalCohortMetrics { - pub(crate) fn forced_import(cfg: &ImportConfig, all_supply: &AllSupplyCache) -> Result { - let realized = RealizedMinimal::forced_import(cfg)?; - let unrealized = UnrealizedMinimal::new(cfg, &realized.price.ppm); - - Ok(Self { - filter: cfg.filter.clone(), - supply: Box::new(SupplyBase::forced_import(cfg, all_supply)?), - outputs: Box::new(OutputsBase::forced_import(cfg)?), - activity: Box::new(ActivityMinimal::forced_import(cfg)?), - realized: Box::new(realized), - unrealized: Box::new(unrealized), - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.supply - .min_len() - .min(self.outputs.min_len()) - .min(self.activity.min_len()) - .min(self.realized.min_stateful_len()) - } - - pub(crate) fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); - vecs.extend(self.supply.collect_vecs_mut()); - vecs.extend(self.outputs.collect_vecs_mut()); - vecs.extend(self.activity.collect_vecs_mut()); - vecs.extend(self.realized.collect_vecs_mut()); - vecs - } - - /// Aggregate Minimal-tier metrics from other MinimalCohortMetrics sources. - pub(crate) fn compute_from_sources( - &mut self, - starting_lengths: &Lengths, - others: &[&MinimalCohortMetrics], - exit: &Exit, - ) -> Result<()> { - self.supply.compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.supply.as_ref()).collect::>(), - exit, - )?; - self.outputs.compute_from_stateful( - starting_lengths, - &others - .iter() - .map(|v| v.outputs.as_ref()) - .collect::>(), - exit, - )?; - self.activity.compute_from_stateful( - starting_lengths, - &others - .iter() - .map(|v| v.activity.as_ref()) - .collect::>(), - exit, - )?; - self.realized.compute_from_stateful( - starting_lengths, - &others - .iter() - .map(|v| v.realized.as_ref()) - .collect::>(), - exit, - )?; - Ok(()) - } - - pub(crate) fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.activity - .compute_rest_part1(prices, starting_lengths, exit)?; - Ok(()) - } - - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.realized.compute_rest_part2( - prices, - starting_lengths, - &self.supply.total.btc.height, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/mod.rs b/crates/brk_computer/src/distribution/metrics/cohort/mod.rs deleted file mode 100644 index 25f31a548..000000000 --- a/crates/brk_computer/src/distribution/metrics/cohort/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -mod all; -mod basic; -mod core; -mod extended; -mod extended_adjusted; -mod minimal; -mod r#type; - -pub use all::AllCohortMetrics; -pub use basic::BasicCohortMetrics; -pub use core::CoreCohortMetrics; -pub use extended::ExtendedCohortMetrics; -pub use extended_adjusted::ExtendedAdjustedCohortMetrics; -pub use minimal::MinimalCohortMetrics; -pub use r#type::TypeCohortMetrics; diff --git a/crates/brk_computer/src/distribution/metrics/cohort/type.rs b/crates/brk_computer/src/distribution/metrics/cohort/type.rs deleted file mode 100644 index 1b301ea95..000000000 --- a/crates/brk_computer/src/distribution/metrics/cohort/type.rs +++ /dev/null @@ -1,89 +0,0 @@ -use brk_cohort::Filter; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use vecdb::{AnyStoredVec, Exit, Rw, StorageMode}; - -use crate::{ - distribution::metrics::{ - ActivityMinimal, AllSupplyCache, ImportConfig, OutputsBase, RealizedMinimal, SupplyCore, - UnrealizedBasic, - }, - price, -}; - -/// TypeCohortMetrics: supply(core), outputs(base), realized(minimal), unrealized(basic). -/// -/// Used for type_ cohorts (p2pkh, p2sh, etc.). -#[derive(Traversable)] -pub struct TypeCohortMetrics { - #[traversable(skip)] - pub filter: Filter, - pub supply: Box>, - pub outputs: Box>, - pub activity: Box>, - pub realized: Box>, - pub unrealized: Box>, -} - -impl TypeCohortMetrics { - pub(crate) fn forced_import(cfg: &ImportConfig, all_supply: &AllSupplyCache) -> Result { - let realized = RealizedMinimal::forced_import(cfg)?; - let unrealized = UnrealizedBasic::forced_import(cfg, &realized.price.ppm)?; - - Ok(Self { - filter: cfg.filter.clone(), - supply: Box::new(SupplyCore::forced_import(cfg, all_supply)?), - outputs: Box::new(OutputsBase::forced_import(cfg)?), - activity: Box::new(ActivityMinimal::forced_import(cfg)?), - realized: Box::new(realized), - unrealized: Box::new(unrealized), - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.supply - .min_len() - .min(self.outputs.min_len()) - .min(self.activity.min_len()) - .min(self.realized.min_stateful_len()) - .min(self.unrealized.min_stateful_len()) - } - - pub(crate) fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); - vecs.extend(self.supply.collect_vecs_mut()); - vecs.extend(self.outputs.collect_vecs_mut()); - vecs.extend(self.activity.collect_vecs_mut()); - vecs.extend(self.realized.collect_vecs_mut()); - vecs.extend(self.unrealized.collect_vecs_mut()); - vecs - } - - pub(crate) fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.activity - .compute_rest_part1(prices, starting_lengths, exit)?; - Ok(()) - } - - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.realized.compute_rest_part2( - prices, - starting_lengths, - &self.supply.total.btc.height, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/cohorts.rs b/crates/brk_computer/src/distribution/metrics/cohorts.rs new file mode 100644 index 000000000..1bcb5737d --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/cohorts.rs @@ -0,0 +1,524 @@ +use brk_cohort::{ + AgeRange, AgeRangeId, AmountRange, ByEntry, ByEpoch, Class, Filter, SpendableType, Term, + UTXO_AGGREGATE_FILTERS, UTXOAggregate, UTXOAllAndSth, UTXOGroupsWithoutAmountOrType, +}; +use brk_error::Result; +use brk_indexer::Lengths; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, StoredU64, Version}; +use rayon::prelude::*; +use vecdb::{ + AnyStoredVec, CachedBoxedVec, ColumnId, Database, Exit, ReadOnlyClone, Rw, StorageMode, +}; + +use crate::{ + distribution::{ + AllChainCache, + metrics::{ + ActivityVecs, AdjustedSoprComputeSource, AllSupplyCache, CostBasisVecs, OutputsVecs, + ProfitabilityVecs, RealizedAggregateSources, RealizedAggregateState, RealizedVecs, + RelativeSource, RelativeVecs, Sopr24hInput, SupplyVecs, UTXORows, UnrealizedVecs, + }, + state::{AddrCohortState, RealizedOps, UTXOStates, UnrealizedState}, + }, + indexes, + internal::{CachedWindowStartVec, Windows}, +}; + +const VERSION: Version = Version::new(0); + +/// Distribution metrics organized by metric, with cohorts at the leaves. +#[derive(Traversable)] +pub struct CohortMetrics { + pub supply: Box>, + pub outputs: Box>, + pub activity: Box>, + pub realized: Box>, + pub unrealized: Box>, + pub cost_basis: Box>, + pub relative: Box>, + pub profitability: Box>, + #[traversable(skip)] + all_supply_cache: AllSupplyCache, +} + +impl CohortMetrics { + /// Import all cohort metrics from the database. + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + spot_price: &CachedBoxedVec, + ) -> Result { + let v = version + VERSION; + + // Phase 1: Import supply first so its shared sources can back every cohort view. + let (supply, all_supply_cache) = + SupplyVecs::forced_import(db, v, indexes, cached_starts, spot_price)?; + let supply = Box::new(supply); + let all_chain_cache = AllChainCache::new(&all_supply_cache, spot_price); + let outputs = Box::new(OutputsVecs::forced_import(db, v, indexes, cached_starts)?); + let activity = Box::new(ActivityVecs::forced_import(db, v, indexes, cached_starts)?); + let realized = Box::new(RealizedVecs::forced_import( + db, + v, + indexes, + cached_starts, + spot_price, + &all_chain_cache, + )?); + let unrealized = Box::new(UnrealizedVecs::forced_import( + db, + v, + indexes, + &realized.price.cohorts, + )?); + let cost_basis = Box::new(CostBasisVecs::forced_import(db, v, indexes)?); + let profitability = Box::new(ProfitabilityVecs::forced_import( + db, + v, + indexes, + cached_starts, + spot_price, + )?); + + let relative_sources = UTXOAggregate::from_fn(|id| { + let filter = id.select(&UTXO_AGGREGATE_FILTERS); + RelativeSource { + supply: supply.sources(filter).expect("aggregate supply sources"), + unrealized: unrealized + .sources(filter) + .expect("aggregate unrealized sources"), + unrealized_aggregate: unrealized + .aggregate_sources(filter) + .expect("aggregate unrealized sources"), + realized: realized + .sources(filter) + .expect("aggregate realized sources"), + nupl: unrealized.nupl.get(filter).expect("aggregate NUPL source"), + } + }); + let relative = Box::new(RelativeVecs::forced_import( + db, + v, + indexes, + &all_chain_cache, + &relative_sources, + )?); + + Ok(Self { + supply, + outputs, + activity, + realized, + unrealized, + cost_basis, + relative, + profitability, + all_supply_cache, + }) + } + + /// Reset in-memory caches that become stale after rollback. + pub(crate) fn reset_caches(&mut self) { + self.all_supply_cache.clear(); + } + + pub(crate) fn all_supply_cache(&self) -> &AllSupplyCache { + &self.all_supply_cache + } + + fn sopr_24h_inputs(&self) -> UTXOGroupsWithoutAmountOrType { + UTXOGroupsWithoutAmountOrType::new(|filter, _| { + Sopr24hInput::new( + self.activity + .transfer_volume + .cohorts + .get(&filter) + .expect("SOPR transfer-volume cohort"), + self.realized + .value_destroyed + .cohorts + .get(&filter) + .expect("SOPR value-destroyed cohort"), + ) + }) + } + + #[inline(always)] + pub(crate) fn push_supply_and_unrealized( + &mut self, + states: &mut UTXOStates, + height_price: Cents, + ) -> UTXOAggregate { + let Self { + supply, unrealized, .. + } = self; + let UTXOStates { + age_range, + epoch, + class, + entry, + amount_range, + type_, + .. + } = states; + + let total = UTXORows { + age_range: AgeRange::from_fn(|id| id.select(age_range).supply_value()), + epoch: ByEpoch::from_fn(|id| id.select(epoch).supply_value()), + class: Class::from_fn(|id| id.select(class).supply_value()), + entry: ByEntry::from_fn(|id| id.select(entry).supply_value()), + amount_range: AmountRange::from_fn(|id| id.select(amount_range).supply_value()), + type_: SpendableType::from_fn(|id| id.select(type_).supply_value()), + }; + let profitability = UTXORows { + age_range: AgeRange::from_fn(|id| { + id.select_mut(age_range) + .compute_unrealized_state(height_price) + }), + epoch: ByEpoch::from_fn(|id| { + id.select_mut(epoch).compute_unrealized_state(height_price) + }), + class: Class::from_fn(|id| id.select_mut(class).compute_unrealized_state(height_price)), + entry: ByEntry::from_fn(|id| { + id.select_mut(entry).compute_unrealized_state(height_price) + }), + amount_range: AmountRange::default(), + type_: SpendableType::from_fn(|id| { + id.select_mut(type_).compute_unrealized_state(height_price) + }), + }; + + let mut aggregates = UTXOAggregate::default(); + let sth_filter = Filter::Term(Term::Sth); + for id in AgeRangeId::ALL { + let state = id.select(&profitability.age_range); + aggregates.all += state; + if sth_filter.includes(id.filter()) { + aggregates.sth += state; + } else { + aggregates.lth += state; + } + } + + supply.push(total, &profitability); + unrealized.push(&profitability, height_price, &aggregates); + aggregates + } + + #[inline(always)] + pub(crate) fn push_outputs(&mut self, states: &UTXOStates) { + let outputs = &mut self.outputs; + let UTXOStates { + age_range, + epoch, + class, + entry, + amount_range, + type_, + .. + } = states; + + let rows = UTXORows { + age_range: AgeRange::from_fn(|id| id.select(age_range).output_counts()), + epoch: ByEpoch::from_fn(|id| id.select(epoch).output_counts()), + class: Class::from_fn(|id| id.select(class).output_counts()), + entry: ByEntry::from_fn(|id| id.select(entry).output_counts()), + amount_range: AmountRange::from_fn(|id| id.select(amount_range).output_counts()), + type_: SpendableType::from_fn(|id| id.select(type_).output_counts()), + }; + let unspent_count = rows.map(|counts| counts.0); + let spent_count = rows.map(|counts| counts.1); + outputs.push(unspent_count, spent_count); + } + + #[inline(always)] + pub(crate) fn push_activity(&mut self, states: &UTXOStates, height_price: Cents) { + let activity = &mut self.activity; + let UTXOStates { + age_range, + epoch, + class, + entry, + amount_range, + type_, + .. + } = states; + + let transfer_volume = UTXORows { + age_range: AgeRange::from_fn(|id| id.select(age_range).transfer_volume()), + epoch: ByEpoch::from_fn(|id| id.select(epoch).transfer_volume()), + class: Class::from_fn(|id| id.select(class).transfer_volume()), + entry: ByEntry::from_fn(|id| id.select(entry).transfer_volume()), + amount_range: AmountRange::from_fn(|id| id.select(amount_range).transfer_volume()), + type_: SpendableType::from_fn(|id| id.select(type_).transfer_volume()), + }; + let core = UTXORows { + age_range: AgeRange::from_fn(|id| id.select(age_range).core_activity()), + epoch: ByEpoch::from_fn(|id| id.select(epoch).core_activity()), + class: Class::from_fn(|id| id.select(class).core_activity()), + entry: ByEntry::from_fn(|id| id.select(entry).core_activity()), + amount_range: AmountRange::default(), + type_: SpendableType::default(), + }; + let coindays_destroyed = core.map(|values| values.0); + let transfer_volume_in_profit = core.map(|values| values.1); + let transfer_volume_in_loss = core.map(|values| values.2); + + activity.push( + height_price, + transfer_volume, + coindays_destroyed, + transfer_volume_in_profit, + transfer_volume_in_loss, + ); + } + + #[inline(always)] + pub(crate) fn push_realized(&mut self, states: &UTXOStates) { + let realized = &mut self.realized; + let UTXOStates { + age_range, + epoch, + class, + entry, + amount_range, + type_, + .. + } = states; + + let rows = UTXORows { + age_range: AgeRange::from_fn(|id| id.select(age_range).realized_block_data()), + epoch: ByEpoch::from_fn(|id| id.select(epoch).realized_block_data()), + class: Class::from_fn(|id| id.select(class).realized_block_data()), + entry: ByEntry::from_fn(|id| id.select(entry).realized_block_data()), + amount_range: AmountRange::from_fn(|id| id.select(amount_range).realized_block_data()), + type_: SpendableType::from_fn(|id| id.select(type_).realized_block_data()), + }; + realized.push(&rows); + } + + #[inline(always)] + pub(crate) fn push_addr_balance( + &mut self, + states: &AmountRange, + height_price: Cents, + ) { + let supply = AmountRange::from_fn(|amount| amount.select(states).inner.supply.value); + let output_count = AmountRange::from_fn(|amount| { + StoredU64::from(amount.select(states).inner.supply.utxo_count) + }); + let transfer_volume = AmountRange::from_fn(|amount| amount.select(states).inner.sent); + let realized_cap = + AmountRange::from_fn(|amount| amount.select(states).inner.realized.cap()); + let realized_profit = + AmountRange::from_fn(|amount| amount.select(states).inner.realized.profit()); + let realized_loss = + AmountRange::from_fn(|amount| amount.select(states).inner.realized.loss()); + + self.supply.total.push_addr_balance(supply); + self.outputs.push_addr_balance(output_count); + self.activity + .push_addr_balance(height_price, &transfer_volume); + self.realized + .push_addr_balance(realized_cap, &realized_profit, &realized_loss); + } + + /// First phase of post-processing: compute index transforms. + pub(crate) fn compute_rest_part1( + &mut self, + starting_lengths: &Lengths, + exit: &Exit, + ) -> Result<()> { + self.activity + .compute_dormancy(starting_lengths.height, exit)?; + + Ok(()) + } + + /// Second phase of post-processing: compute derived ratios and relative metrics. + pub(crate) fn compute_rest_part2( + &mut self, + starting_lengths: &Lengths, + exit: &Exit, + ) -> Result<()> { + // Get under_1h value sources for adjusted computation (cloned to avoid borrow conflicts). + let under_1h_value_created = self + .activity + .transfer_volume + .cohorts + .age + .range + .under_1h + .block + .cents + .clone(); + let under_1h_value_destroyed = self + .realized + .value_destroyed + .cohorts + .age + .range + .under_1h + .cumulative + .cents + .height + .read_only_clone(); + + let sopr_inputs = self.sopr_24h_inputs(); + let adjusted_sources = UTXOAllAndSth { + all: AdjustedSoprComputeSource { + activity: self + .activity + .sources(&Filter::All) + .expect("all activity sources"), + realized: self + .realized + .sources(&Filter::All) + .expect("all realized sources"), + }, + sth: AdjustedSoprComputeSource { + activity: self + .activity + .sources(&Filter::Term(Term::Sth)) + .expect("STH activity sources"), + realized: self + .realized + .sources(&Filter::Term(Term::Sth)) + .expect("STH realized sources"), + }, + }; + let realized_sources = UTXOAggregate::from_fn(|id| { + let filter = id.select(&UTXO_AGGREGATE_FILTERS); + RealizedAggregateSources { + activity: self + .activity + .sources(filter) + .expect("aggregate activity sources"), + realized: self + .realized + .sources(filter) + .expect("aggregate realized sources"), + } + }); + let Self { + realized: realized_vecs, + relative, + .. + } = self; + + realized_vecs.compute_adjusted_sopr( + starting_lengths.height, + &adjusted_sources, + &under_1h_value_created, + &under_1h_value_destroyed, + exit, + )?; + realized_vecs.compute_sopr(starting_lengths.height, &sopr_inputs, exit)?; + + realized_vecs.compute_aggregate_metrics( + starting_lengths.height, + &realized_sources, + exit, + )?; + + let relative_sources = UTXOAggregate::from_fn(|id| { + let filter = id.select(&UTXO_AGGREGATE_FILTERS); + RelativeSource { + supply: self + .supply + .sources(filter) + .expect("aggregate supply sources"), + unrealized: self + .unrealized + .sources(filter) + .expect("aggregate unrealized sources"), + unrealized_aggregate: self + .unrealized + .aggregate_sources(filter) + .expect("aggregate unrealized sources"), + realized: self + .realized + .sources(filter) + .expect("aggregate realized sources"), + nupl: self + .unrealized + .nupl + .get(filter) + .expect("aggregate NUPL source"), + } + }); + relative.compute(starting_lengths.height, &relative_sources, exit)?; + + Ok(()) + } + + /// Returns a parallel iterator over all vecs for parallel writing. + pub(crate) fn par_iter_vecs_mut( + &mut self, + ) -> impl ParallelIterator { + let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::with_capacity(128); + vecs.extend(self.supply.collect_vecs_mut()); + vecs.extend(self.outputs.collect_vecs_mut()); + vecs.extend(self.activity.collect_vecs_mut()); + vecs.extend(self.realized.collect_vecs_mut()); + vecs.extend(self.unrealized.collect_vecs_mut()); + vecs.extend(self.cost_basis.collect_vecs_mut()); + vecs.extend(self.relative.collect_vecs_mut()); + vecs.extend(self.profitability.collect_all_vecs_mut()); + vecs.into_par_iter() + } + + pub(crate) fn min_stateful_len(&self) -> Height { + Height::from(self.supply.min_len()) + .min(Height::from(self.outputs.min_len())) + .min(Height::from(self.activity.min_len())) + .min(Height::from(self.realized.min_len())) + .min(Height::from(self.unrealized.min_len())) + .min(Height::from(self.cost_basis.min_len())) + .min(Height::from(self.profitability.min_stateful_len())) + } + + /// Validate computed versions for all cohorts. + pub(crate) fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { + self.cost_basis.validate_computed_versions(base_version) + } + + /// Aggregate realized fields from age-range states and push all/STH/LTH. + /// Called during the block loop after separate cohorts' push_state but before reset. + pub(crate) fn push_overlapping( + &mut self, + states: &UTXOStates, + height_price: Cents, + unrealized_states: &UTXOAggregate, + ) -> Cents { + let Self { + realized, + cost_basis, + .. + } = self; + + let sth_filter = Filter::Term(Term::Sth); + + let mut accumulated = UTXOAggregate::::default(); + + for id in AgeRangeId::ALL { + let state = id.select(&states.age_range); + accumulated.all.add(&state.realized); + + if sth_filter.includes(id.filter()) { + accumulated.sth.add(&state.realized); + } else { + accumulated.lth.add(&state.realized); + } + } + + let all_capitalized_price = realized.push_aggregate(&accumulated); + + cost_basis.push_prices(height_price, unrealized_states); + + all_capitalized_price + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/additive/mod.rs b/crates/brk_computer/src/distribution/metrics/columnar/additive/mod.rs new file mode 100644 index 000000000..77ac0307e --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/additive/mod.rs @@ -0,0 +1,7 @@ +mod with_amount_and_type; +mod without_amount; +mod without_amount_or_type; + +pub(crate) use with_amount_and_type::UTXOColumnarMetric; +pub(crate) use without_amount::UTXOColumnarMetricWithoutAmount; +pub(crate) use without_amount_or_type::UTXOColumnarMetricWithoutAmountOrType; diff --git a/crates/brk_computer/src/distribution/metrics/columnar/additive/with_amount_and_type.rs b/crates/brk_computer/src/distribution/metrics/columnar/additive/with_amount_and_type.rs new file mode 100644 index 000000000..699bea539 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/additive/with_amount_and_type.rs @@ -0,0 +1,186 @@ +use std::ops::AddAssign; + +use brk_cohort::{ + AgeRangeId, AmountRangeId, ClassId, EntryId, EpochId, Filter, OVER_AMOUNT_FILTERS, + SpendableTypeId, UNDER_AMOUNT_FILTERS, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use vecdb::{ + AnyStoredVec, AnyVec, ColumnarVec, Database, EagerVec, ImportableVec, PcoVec, PcoVecValue, + ReadOnlyClone, ReadableBoxedVec, ReadableVec, Rw, StorageMode, WritableVec, +}; + +use super::super::UTXORows; +use super::UTXOColumnarMetricWithoutAmountOrType; + +#[derive(Traversable)] +pub struct UTXOColumnarMetric +where + T: PcoVecValue, +{ + pub age_range_matrix: M::Stored, AgeRangeId>>>, + pub epoch_matrix: M::Stored, EpochId>>>, + pub class_matrix: M::Stored, ClassId>>>, + pub entry_matrix: M::Stored, EntryId>>>, + pub type_matrix: M::Stored, SpendableTypeId>>>, + pub amount_range_matrix: M::Stored, AmountRangeId>>>, +} + +impl UTXOColumnarMetric +where + T: PcoVecValue + AddAssign, +{ + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + let version = version + Version::ONE; + Ok(Self { + age_range_matrix: EagerVec::forced_import( + db, + &format!("utxos_{name}_by_age_range"), + version, + )?, + epoch_matrix: EagerVec::forced_import(db, &format!("{name}_by_epoch"), version)?, + class_matrix: EagerVec::forced_import(db, &format!("{name}_by_class"), version)?, + entry_matrix: EagerVec::forced_import(db, &format!("{name}_by_entry"), version)?, + type_matrix: EagerVec::forced_import(db, &format!("{name}_by_type"), version)?, + amount_range_matrix: EagerVec::forced_import( + db, + &format!("utxos_{name}_by_amount_range"), + version, + )?, + }) + } + + pub(crate) fn additive_source( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + self.direct_source(filter, name, version) + .or_else(|| self.aggregate_amount_source(filter, name, version)) + .or_else(|| { + UTXOColumnarMetricWithoutAmountOrType::aggregate_source_from( + &self.age_range_matrix.read_only_clone(), + filter, + name, + version, + ) + }) + } + + pub(crate) fn direct_source( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + match filter { + Filter::Amount(_) => AmountRangeId::matching(filter).map(|id| { + UTXOColumnarMetricWithoutAmountOrType::column( + &self.amount_range_matrix.read_only_clone(), + name, + version, + id, + ) + }), + Filter::Type(output_type) => { + SpendableTypeId::from_output_type(*output_type).map(|id| { + UTXOColumnarMetricWithoutAmountOrType::column( + &self.type_matrix.read_only_clone(), + name, + version, + id, + ) + }) + } + _ => UTXOColumnarMetricWithoutAmountOrType::direct_source_from( + &self.age_range_matrix.read_only_clone(), + &self.epoch_matrix.read_only_clone(), + &self.class_matrix.read_only_clone(), + &self.entry_matrix.read_only_clone(), + filter, + name, + version, + ), + } + } + + fn aggregate_amount_source( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + let matrix = self.amount_range_matrix.read_only_clone(); + match filter { + Filter::Amount(_) => UNDER_AMOUNT_FILTERS + .iter() + .chain(OVER_AMOUNT_FILTERS.iter()) + .find(|candidate| *candidate == filter) + .map(|filter| { + UTXOColumnarMetricWithoutAmountOrType::sum( + &matrix, + name, + version, + AmountRangeId::included_by(filter), + ) + }), + _ => None, + } + } + + pub(crate) fn min_len(&self) -> usize { + self.age_range_matrix + .len() + .min(self.epoch_matrix.len()) + .min(self.class_matrix.len()) + .min(self.entry_matrix.len()) + .min(self.type_matrix.len()) + .min(self.amount_range_matrix.len()) + } + + #[inline(always)] + pub(crate) fn push(&mut self, rows: UTXORows) { + let UTXORows { + age_range, + epoch, + class, + entry, + amount_range, + type_, + } = rows; + self.age_range_matrix.push(age_range); + self.epoch_matrix.push(epoch); + self.class_matrix.push(class); + self.entry_matrix.push(entry); + self.type_matrix.push(type_); + self.amount_range_matrix.push(amount_range); + } + + pub(crate) fn collect_last(&self) -> Option> + where + T: Default, + { + Some(UTXORows { + age_range: self.age_range_matrix.collect_last()?, + epoch: self.epoch_matrix.collect_last()?, + class: self.class_matrix.collect_last()?, + entry: self.entry_matrix.collect_last()?, + amount_range: self.amount_range_matrix.collect_last()?, + type_: self.type_matrix.collect_last()?, + }) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + vec![ + &mut self.age_range_matrix, + &mut self.epoch_matrix, + &mut self.class_matrix, + &mut self.entry_matrix, + &mut self.type_matrix, + &mut self.amount_range_matrix, + ] + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/additive/without_amount.rs b/crates/brk_computer/src/distribution/metrics/columnar/additive/without_amount.rs new file mode 100644 index 000000000..1af987e91 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/additive/without_amount.rs @@ -0,0 +1,129 @@ +use std::ops::AddAssign; + +use brk_cohort::{ + AgeRangeId, ClassId, EntryId, EpochId, Filter, SPENDABLE_TYPE_FILTERS, SpendableTypeId, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use vecdb::{ + AnyStoredVec, AnyVec, ColumnarVec, Database, EagerVec, ImportableVec, PcoVec, PcoVecValue, + ReadOnlyClone, ReadableBoxedVec, Rw, StorageMode, WritableVec, +}; + +use super::super::UTXORows; +use super::UTXOColumnarMetricWithoutAmountOrType; + +#[derive(Traversable)] +pub struct UTXOColumnarMetricWithoutAmount +where + T: PcoVecValue, +{ + pub age_range_matrix: M::Stored, AgeRangeId>>>, + pub epoch_matrix: M::Stored, EpochId>>>, + pub class_matrix: M::Stored, ClassId>>>, + pub entry_matrix: M::Stored, EntryId>>>, + pub type_matrix: M::Stored, SpendableTypeId>>>, +} + +impl UTXOColumnarMetricWithoutAmount +where + T: PcoVecValue + AddAssign, +{ + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + let version = version + Version::ONE; + Ok(Self { + age_range_matrix: EagerVec::forced_import( + db, + &format!("utxos_{name}_by_age_range"), + version, + )?, + epoch_matrix: EagerVec::forced_import(db, &format!("{name}_by_epoch"), version)?, + class_matrix: EagerVec::forced_import(db, &format!("{name}_by_class"), version)?, + entry_matrix: EagerVec::forced_import(db, &format!("{name}_by_entry"), version)?, + type_matrix: EagerVec::forced_import(db, &format!("{name}_by_type"), version)?, + }) + } + + pub(crate) fn additive_source( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + self.direct_source(filter, name, version).or_else(|| { + UTXOColumnarMetricWithoutAmountOrType::aggregate_source_from( + &self.age_range_matrix.read_only_clone(), + filter, + name, + version, + ) + }) + } + + pub(super) fn direct_source( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + match filter { + Filter::Type(output_type) => { + SpendableTypeId::from_output_type(*output_type).map(|id| { + debug_assert_eq!(id.select(&SPENDABLE_TYPE_FILTERS), filter); + UTXOColumnarMetricWithoutAmountOrType::column( + &self.type_matrix.read_only_clone(), + name, + version, + id, + ) + }) + } + _ => UTXOColumnarMetricWithoutAmountOrType::direct_source_from( + &self.age_range_matrix.read_only_clone(), + &self.epoch_matrix.read_only_clone(), + &self.class_matrix.read_only_clone(), + &self.entry_matrix.read_only_clone(), + filter, + name, + version, + ), + } + } + + pub(crate) fn min_len(&self) -> usize { + self.age_range_matrix + .len() + .min(self.epoch_matrix.len()) + .min(self.class_matrix.len()) + .min(self.entry_matrix.len()) + .min(self.type_matrix.len()) + } + + #[inline(always)] + pub(crate) fn push(&mut self, rows: UTXORows) { + let UTXORows { + age_range, + epoch, + class, + entry, + type_, + .. + } = rows; + self.age_range_matrix.push(age_range); + self.epoch_matrix.push(epoch); + self.class_matrix.push(class); + self.entry_matrix.push(entry); + self.type_matrix.push(type_); + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + vec![ + &mut self.age_range_matrix, + &mut self.epoch_matrix, + &mut self.class_matrix, + &mut self.entry_matrix, + &mut self.type_matrix, + ] + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/additive/without_amount_or_type.rs b/crates/brk_computer/src/distribution/metrics/columnar/additive/without_amount_or_type.rs new file mode 100644 index 000000000..acf066707 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/additive/without_amount_or_type.rs @@ -0,0 +1,242 @@ +use std::ops::AddAssign; + +use brk_cohort::{ + AgeRange, AgeRangeId, AmountRange, ByEntry, ByEpoch, CLASS_FILTERS, Class, ClassId, + ENTRY_FILTERS, EPOCH_FILTERS, EntryId, EpochId, Filter, OVER_AGE_FILTERS, SpendableType, + TERM_FILTERS, Term, UNDER_AGE_FILTERS, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use vecdb::{ + AnyStoredVec, AnyVec, ColumnId, ColumnarVec, Database, EagerVec, ImportableVec, PcoVec, + PcoVecValue, ReadOnlyClone, ReadOnlyColumnarVec, ReadableBoxedVec, ReadableCloneableVec, + ReadableColumnarVec, ReadableVec, Rw, StorageMode, WritableVec, +}; + +use super::super::UTXORows; + +#[derive(Traversable)] +pub struct UTXOColumnarMetricWithoutAmountOrType +where + T: PcoVecValue, +{ + pub age_range_matrix: M::Stored, AgeRangeId>>>, + pub epoch_matrix: M::Stored, EpochId>>>, + pub class_matrix: M::Stored, ClassId>>>, + pub entry_matrix: M::Stored, EntryId>>>, +} + +impl UTXOColumnarMetricWithoutAmountOrType +where + T: PcoVecValue + AddAssign, +{ + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + let version = version + Version::ONE; + Ok(Self { + age_range_matrix: EagerVec::forced_import( + db, + &format!("utxos_{name}_by_age_range"), + version, + )?, + epoch_matrix: EagerVec::forced_import(db, &format!("{name}_by_epoch"), version)?, + class_matrix: EagerVec::forced_import(db, &format!("{name}_by_class"), version)?, + entry_matrix: EagerVec::forced_import(db, &format!("{name}_by_entry"), version)?, + }) + } + + pub(crate) fn additive_source( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + self.direct_source(filter, name, version) + .or_else(|| self.aggregate_source(filter, name, version)) + } + + pub(super) fn direct_source( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + Self::direct_source_from( + &self.age_range_matrix.read_only_clone(), + &self.epoch_matrix.read_only_clone(), + &self.class_matrix.read_only_clone(), + &self.entry_matrix.read_only_clone(), + filter, + name, + version, + ) + } + + pub(super) fn direct_source_from( + age_range_matrix: &ReadOnlyColumnarVec, AgeRangeId>, + epoch_matrix: &ReadOnlyColumnarVec, EpochId>, + class_matrix: &ReadOnlyColumnarVec, ClassId>, + entry_matrix: &ReadOnlyColumnarVec, EntryId>, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + match filter { + Filter::Time(_) => AgeRangeId::matching(filter) + .map(|id| Self::column(age_range_matrix, name, version, id)), + Filter::Epoch(_) => EpochId::ALL + .iter() + .copied() + .find(|id| id.select(&EPOCH_FILTERS) == filter) + .map(|id| Self::column(epoch_matrix, name, version, id)), + Filter::Class(_) => ClassId::ALL + .iter() + .copied() + .find(|id| id.select(&CLASS_FILTERS) == filter) + .map(|id| Self::column(class_matrix, name, version, id)), + Filter::Entry(_) => EntryId::ALL + .iter() + .copied() + .find(|id| id.select(&ENTRY_FILTERS) == filter) + .map(|id| Self::column(entry_matrix, name, version, id)), + Filter::All | Filter::Term(_) | Filter::Amount(_) | Filter::Type(_) => None, + } + } + + pub(super) fn aggregate_source( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + Self::aggregate_source_from( + &self.age_range_matrix.read_only_clone(), + filter, + name, + version, + ) + } + + pub(super) fn aggregate_source_from( + age_range_matrix: &ReadOnlyColumnarVec, AgeRangeId>, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + match filter { + Filter::All => Some(Self::sum( + age_range_matrix, + name, + version, + AgeRangeId::ALL.iter().copied(), + )), + Filter::Term(term) => { + let term = match term { + Term::Sth => &TERM_FILTERS.short, + Term::Lth => &TERM_FILTERS.long, + }; + Some(Self::sum( + age_range_matrix, + name, + version, + AgeRangeId::ALL + .iter() + .copied() + .filter(|column| term.includes(column.filter())), + )) + } + Filter::Time(_) => UNDER_AGE_FILTERS + .iter() + .chain(OVER_AGE_FILTERS.iter()) + .find(|candidate| *candidate == filter) + .map(|filter| { + Self::sum( + age_range_matrix, + name, + version, + AgeRangeId::included_by(filter), + ) + }), + Filter::Amount(_) + | Filter::Epoch(_) + | Filter::Class(_) + | Filter::Entry(_) + | Filter::Type(_) => None, + } + } + + pub(super) fn column( + source: &ReadOnlyColumnarVec, C>, + name: &str, + version: Version, + column: C, + ) -> ReadableBoxedVec + where + C: ColumnId, + { + source.column(name, version, column).read_only_boxed_clone() + } + + pub(super) fn sum( + source: &ReadOnlyColumnarVec, C>, + name: &str, + version: Version, + columns: impl IntoIterator, + ) -> ReadableBoxedVec + where + C: ColumnId, + { + source + .sum_columns(name, version, columns) + .read_only_boxed_clone() + } + + pub(crate) fn min_len(&self) -> usize { + self.age_range_matrix + .len() + .min(self.epoch_matrix.len()) + .min(self.class_matrix.len()) + .min(self.entry_matrix.len()) + } + + pub(super) fn push_parts( + &mut self, + age_range: AgeRange, + epoch: ByEpoch, + class: Class, + entry: ByEntry, + ) { + self.age_range_matrix.push(age_range); + self.epoch_matrix.push(epoch); + self.class_matrix.push(class); + self.entry_matrix.push(entry); + } + + #[inline(always)] + pub(crate) fn push(&mut self, rows: UTXORows) { + self.push_parts(rows.age_range, rows.epoch, rows.class, rows.entry); + } + + pub(crate) fn collect_last(&self) -> Option> + where + T: Default, + { + Some(UTXORows { + age_range: self.age_range_matrix.collect_last()?, + epoch: self.epoch_matrix.collect_last()?, + class: self.class_matrix.collect_last()?, + entry: self.entry_matrix.collect_last()?, + amount_range: AmountRange::default(), + type_: SpendableType::default(), + }) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + vec![ + &mut self.age_range_matrix, + &mut self.epoch_matrix, + &mut self.class_matrix, + &mut self.entry_matrix, + ] + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/amount.rs b/crates/brk_computer/src/distribution/metrics/columnar/amount.rs new file mode 100644 index 000000000..8ab59a017 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/amount.rs @@ -0,0 +1,109 @@ +use std::ops::AddAssign; + +use brk_cohort::{Amount, AmountRange, AmountRangeId, CohortContext, Filter}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use derive_more::{Deref, DerefMut}; +use vecdb::{ + AnyStoredVec, AnyVec, ColumnarVec, Database, EagerVec, ImportableVec, PcoVec, PcoVecValue, + ReadOnlyClone, ReadOnlyColumnarVec, ReadableBoxedVec, ReadableCloneableVec, + ReadableColumnarVec, ReadableVec, Rw, StorageMode, WritableVec, +}; + +#[derive(Deref, DerefMut, Traversable)] +pub struct ColumnarAmount +where + T: PcoVecValue, +{ + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub series: Amount, + pub matrix: M::Stored, AmountRangeId>>>, + #[traversable(skip)] + last: Option<(usize, AmountRange)>, +} + +impl ColumnarAmount +where + T: PcoVecValue + AddAssign, +{ + pub(crate) fn forced_import( + db: &Database, + matrix_name: &str, + context: CohortContext, + metric: &str, + version: Version, + mut build: impl FnMut(&str, ReadableBoxedVec) -> S, + ) -> Result { + let matrix = EagerVec::forced_import(db, matrix_name, version)?; + let source: ReadOnlyColumnarVec, AmountRangeId> = + matrix.read_only_clone(); + + let series = Amount::new(|filter, cohort_name| { + let name = Self::metric_name(context, &filter, cohort_name, metric); + let source = match AmountRangeId::matching(&filter) { + Some(column) => source + .column(&name, version, column) + .read_only_boxed_clone(), + None => source + .sum_columns(&name, version, AmountRangeId::included_by(&filter)) + .read_only_boxed_clone(), + }; + build(&name, source) + }); + + Ok(Self { + series, + matrix, + last: None, + }) + } + + fn metric_name( + context: CohortContext, + filter: &Filter, + cohort_name: &str, + metric: &str, + ) -> String { + let cohort = context.full_name(filter, cohort_name); + format!("{cohort}_{metric}") + } + + #[inline(always)] + pub(crate) fn push(&mut self, row: AmountRange) { + self.matrix.push(row); + } + + #[inline(always)] + pub(crate) fn push_cumulative(&mut self, delta: &AmountRange) + where + T: AddAssign + Default, + { + let len = self.matrix.len(); + let mut cumulative = match self.last.take() { + Some((cached_len, values)) if cached_len == len => values, + _ => self.matrix.collect_last().unwrap_or_default(), + }; + for (value, &delta) in cumulative.iter_mut().zip(delta.iter()) { + *value += delta; + } + self.matrix.push(cumulative.clone()); + self.last = Some((len + 1, cumulative)); + } + + pub(crate) fn len(&self) -> usize { + self.matrix.len() + } + + pub(crate) fn reset(&mut self) -> Result<()> { + self.last = None; + self.matrix.reset().map_err(Into::into) + } + + pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { + self.last = None; + &mut self.matrix + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/amount_value.rs b/crates/brk_computer/src/distribution/metrics/columnar/amount_value.rs new file mode 100644 index 000000000..8b0cde3e4 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/amount_value.rs @@ -0,0 +1,74 @@ +use brk_cohort::{Amount, AmountRange, AmountRangeId, CohortContext, Filter}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, Version}; +use derive_more::{Deref, DerefMut}; +use vecdb::{AnyStoredVec, Database, ReadableBoxedVec, Rw, StorageMode}; + +use crate::internal::ColumnarValuePerBlockCumulativeRolling; + +#[derive(Deref, DerefMut, Traversable)] +pub struct ColumnarAmountValue { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub series: Amount, + pub values: ColumnarValuePerBlockCumulativeRolling, +} + +impl ColumnarAmountValue { + pub(crate) fn forced_import( + db: &Database, + matrix_name: &str, + context: CohortContext, + metric: &str, + version: Version, + mut build: impl FnMut( + &str, + ReadableBoxedVec, + ReadableBoxedVec, + ) -> S, + ) -> Result { + let values = ColumnarValuePerBlockCumulativeRolling::forced_import( + db, + matrix_name, + version, + |_, _| (), + )?; + + let series = Amount::new(|filter, cohort_name| { + let amounts: Vec<_> = match AmountRangeId::matching(&filter) { + Some(amount) => vec![amount], + None => AmountRangeId::included_by(&filter).collect(), + }; + let name = Self::metric_name(context, &filter, cohort_name, metric); + let (sats, cents) = values.sources(&format!("{name}_cumulative"), version, amounts); + build(&name, sats, cents) + }); + + Ok(Self { series, values }) + } + + fn metric_name( + context: CohortContext, + filter: &Filter, + cohort_name: &str, + metric: &str, + ) -> String { + let cohort = context.full_name(filter, cohort_name); + format!("{cohort}_{metric}") + } + + #[inline(always)] + pub(crate) fn push_cumulative(&mut self, sats: &AmountRange, cents: &AmountRange) { + self.values.push_block(sats.clone(), cents.clone()); + } + + pub(crate) fn len(&self) -> usize { + self.values.len() + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + self.values.collect_vecs_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/cumulative/mod.rs b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/mod.rs new file mode 100644 index 000000000..301ebbfb4 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/mod.rs @@ -0,0 +1,9 @@ +mod value_with_amount_and_type; +mod value_without_amount_or_type; +mod with_amount_and_type; +mod without_amount_or_type; + +pub(crate) use value_with_amount_and_type::CumulativeUTXOValueColumnarMetric; +pub(crate) use value_without_amount_or_type::CumulativeUTXOValueColumnarMetricWithoutAmountOrType; +pub(crate) use with_amount_and_type::CumulativeUTXOColumnarMetric; +pub(crate) use without_amount_or_type::CumulativeUTXOColumnarMetricWithoutAmountOrType; diff --git a/crates/brk_computer/src/distribution/metrics/columnar/cumulative/value_with_amount_and_type.rs b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/value_with_amount_and_type.rs new file mode 100644 index 000000000..5dd1e83fe --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/value_with_amount_and_type.rs @@ -0,0 +1,187 @@ +use brk_cohort::{ + AgeRangeId, AmountRangeId, ClassId, EntryId, EpochId, Filter, OVER_AMOUNT_FILTERS, + SPENDABLE_TYPE_FILTERS, SpendableTypeId, UNDER_AMOUNT_FILTERS, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, Version}; +use vecdb::{AnyStoredVec, ColumnId, Database, ReadableBoxedVec, Rw, StorageMode}; + +use crate::internal::ColumnarValuePerBlockCumulativeRolling; + +use super::super::UTXORows; +use super::CumulativeUTXOValueColumnarMetricWithoutAmountOrType; + +#[derive(Traversable)] +pub struct CumulativeUTXOValueColumnarMetric { + pub age_range: ColumnarValuePerBlockCumulativeRolling, + pub epoch: ColumnarValuePerBlockCumulativeRolling, + pub class: ColumnarValuePerBlockCumulativeRolling, + pub entry: ColumnarValuePerBlockCumulativeRolling, + pub amount_range: ColumnarValuePerBlockCumulativeRolling, + pub type_: ColumnarValuePerBlockCumulativeRolling, +} + +impl CumulativeUTXOValueColumnarMetric { + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + let version = version + Version::ONE; + Ok(Self { + age_range: Self::import(db, &format!("utxos_{name}_by_age_range"), version)?, + epoch: Self::import(db, &format!("{name}_by_epoch"), version)?, + class: Self::import(db, &format!("{name}_by_class"), version)?, + entry: Self::import(db, &format!("{name}_by_entry"), version)?, + amount_range: Self::import(db, &format!("utxos_{name}_by_amount_range"), version)?, + type_: Self::import(db, &format!("{name}_by_type"), version)?, + }) + } + + fn import( + db: &Database, + name: &str, + version: Version, + ) -> Result> + where + C: ColumnId, + { + ColumnarValuePerBlockCumulativeRolling::forced_import(db, name, version, |_, _| ()) + } + + pub(crate) fn sources( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option<( + ReadableBoxedVec, + ReadableBoxedVec, + )> { + self.direct_sources(filter, name, version) + .or_else(|| self.amount_aggregate_sources(filter, name, version)) + .or_else(|| self.age_aggregate_sources(filter, name, version)) + } + + fn direct_sources( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option<( + ReadableBoxedVec, + ReadableBoxedVec, + )> { + match filter { + Filter::Amount(_) => AmountRangeId::matching(filter) + .map(|column| Self::matrix_sources(&self.amount_range, name, version, [column])), + Filter::Type(_) => SpendableTypeId::ALL + .iter() + .copied() + .find(|column| column.select(&SPENDABLE_TYPE_FILTERS) == filter) + .map(|column| Self::matrix_sources(&self.type_, name, version, [column])), + _ => CumulativeUTXOValueColumnarMetricWithoutAmountOrType::direct_sources_from( + &self.age_range, + &self.epoch, + &self.class, + &self.entry, + filter, + name, + version, + ), + } + } + + fn amount_aggregate_sources( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option<( + ReadableBoxedVec, + ReadableBoxedVec, + )> { + let columns: Vec<_> = UNDER_AMOUNT_FILTERS + .iter() + .chain(OVER_AMOUNT_FILTERS.iter()) + .find(|candidate| *candidate == filter) + .map(|filter| AmountRangeId::included_by(filter).collect())?; + Some(Self::matrix_sources( + &self.amount_range, + name, + version, + columns, + )) + } + + fn age_aggregate_sources( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option<( + ReadableBoxedVec, + ReadableBoxedVec, + )> { + let columns = CumulativeUTXOValueColumnarMetricWithoutAmountOrType::age_columns(filter)?; + Some(Self::matrix_sources( + &self.age_range, + name, + version, + columns, + )) + } + + fn matrix_sources( + matrix: &ColumnarValuePerBlockCumulativeRolling, + name: &str, + version: Version, + columns: impl IntoIterator, + ) -> ( + ReadableBoxedVec, + ReadableBoxedVec, + ) + where + C: ColumnId, + { + CumulativeUTXOValueColumnarMetricWithoutAmountOrType::matrix_sources( + matrix, name, version, columns, + ) + } + + #[inline(always)] + pub(crate) fn push_block(&mut self, sats: UTXORows, cents: UTXORows) { + self.age_range.push_block(sats.age_range, cents.age_range); + self.epoch.push_block(sats.epoch, cents.epoch); + self.class.push_block(sats.class, cents.class); + self.entry.push_block(sats.entry, cents.entry); + self.amount_range + .push_block(sats.amount_range, cents.amount_range); + self.type_.push_block(sats.type_, cents.type_); + } + + pub(crate) fn min_len(&self) -> usize { + self.age_range + .len() + .min(self.epoch.len()) + .min(self.class.len()) + .min(self.entry.len()) + .min(self.amount_range.len()) + .min(self.type_.len()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let Self { + age_range, + epoch, + class, + entry, + amount_range, + type_, + } = self; + let mut vecs = age_range.collect_vecs_mut(); + vecs.extend(epoch.collect_vecs_mut()); + vecs.extend(class.collect_vecs_mut()); + vecs.extend(entry.collect_vecs_mut()); + vecs.extend(amount_range.collect_vecs_mut()); + vecs.extend(type_.collect_vecs_mut()); + vecs + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/cumulative/value_without_amount_or_type.rs b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/value_without_amount_or_type.rs new file mode 100644 index 000000000..c89802d4b --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/value_without_amount_or_type.rs @@ -0,0 +1,196 @@ +use brk_cohort::{ + AgeRangeId, CLASS_FILTERS, ClassId, ENTRY_FILTERS, EPOCH_FILTERS, EntryId, EpochId, Filter, + OVER_AGE_FILTERS, TERM_FILTERS, Term, UNDER_AGE_FILTERS, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, Version}; +use vecdb::{AnyStoredVec, ColumnId, Database, ReadableBoxedVec, Rw, StorageMode}; + +use crate::internal::ColumnarValuePerBlockCumulativeRolling; + +use super::super::UTXORows; + +#[derive(Traversable)] +pub struct CumulativeUTXOValueColumnarMetricWithoutAmountOrType { + pub age_range: ColumnarValuePerBlockCumulativeRolling, + pub epoch: ColumnarValuePerBlockCumulativeRolling, + pub class: ColumnarValuePerBlockCumulativeRolling, + pub entry: ColumnarValuePerBlockCumulativeRolling, +} + +impl CumulativeUTXOValueColumnarMetricWithoutAmountOrType { + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + let version = version + Version::ONE; + Ok(Self { + age_range: Self::import(db, &format!("utxos_{name}_by_age_range"), version)?, + epoch: Self::import(db, &format!("{name}_by_epoch"), version)?, + class: Self::import(db, &format!("{name}_by_class"), version)?, + entry: Self::import(db, &format!("{name}_by_entry"), version)?, + }) + } + + fn import( + db: &Database, + name: &str, + version: Version, + ) -> Result> + where + C: ColumnId, + { + ColumnarValuePerBlockCumulativeRolling::forced_import(db, name, version, |_, _| ()) + } + + pub(crate) fn sources( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option<( + ReadableBoxedVec, + ReadableBoxedVec, + )> { + self.direct_sources(filter, name, version) + .or_else(|| self.aggregate_sources(filter, name, version)) + } + + pub(super) fn direct_sources( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option<( + ReadableBoxedVec, + ReadableBoxedVec, + )> { + Self::direct_sources_from( + &self.age_range, + &self.epoch, + &self.class, + &self.entry, + filter, + name, + version, + ) + } + + pub(super) fn direct_sources_from( + age_range: &ColumnarValuePerBlockCumulativeRolling, + epoch: &ColumnarValuePerBlockCumulativeRolling, + class: &ColumnarValuePerBlockCumulativeRolling, + entry: &ColumnarValuePerBlockCumulativeRolling, + filter: &Filter, + name: &str, + version: Version, + ) -> Option<( + ReadableBoxedVec, + ReadableBoxedVec, + )> { + match filter { + Filter::Time(_) => AgeRangeId::matching(filter) + .map(|column| Self::matrix_sources(age_range, name, version, [column])), + Filter::Epoch(_) => EpochId::ALL + .iter() + .copied() + .find(|column| column.select(&EPOCH_FILTERS) == filter) + .map(|column| Self::matrix_sources(epoch, name, version, [column])), + Filter::Class(_) => ClassId::ALL + .iter() + .copied() + .find(|column| column.select(&CLASS_FILTERS) == filter) + .map(|column| Self::matrix_sources(class, name, version, [column])), + Filter::Entry(_) => EntryId::ALL + .iter() + .copied() + .find(|column| column.select(&ENTRY_FILTERS) == filter) + .map(|column| Self::matrix_sources(entry, name, version, [column])), + Filter::All | Filter::Term(_) | Filter::Amount(_) | Filter::Type(_) => None, + } + } + + pub(super) fn aggregate_sources( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option<( + ReadableBoxedVec, + ReadableBoxedVec, + )> { + let columns = Self::age_columns(filter)?; + Some(Self::matrix_sources( + &self.age_range, + name, + version, + columns, + )) + } + + pub(super) fn age_columns(filter: &Filter) -> Option> { + Some(match filter { + Filter::All => AgeRangeId::ALL.to_vec(), + Filter::Term(term) => { + let filter = match term { + Term::Sth => &TERM_FILTERS.short, + Term::Lth => &TERM_FILTERS.long, + }; + AgeRangeId::included_by(filter).collect() + } + Filter::Time(_) => UNDER_AGE_FILTERS + .iter() + .chain(OVER_AGE_FILTERS.iter()) + .find(|candidate| *candidate == filter) + .map(|filter| AgeRangeId::included_by(filter).collect())?, + Filter::Amount(_) + | Filter::Epoch(_) + | Filter::Class(_) + | Filter::Entry(_) + | Filter::Type(_) => return None, + }) + } + + pub(super) fn matrix_sources( + matrix: &ColumnarValuePerBlockCumulativeRolling, + name: &str, + version: Version, + columns: impl IntoIterator, + ) -> ( + ReadableBoxedVec, + ReadableBoxedVec, + ) + where + C: ColumnId, + { + matrix.sources(&format!("{name}_cumulative"), version, columns) + } + + #[inline(always)] + pub(crate) fn push_block(&mut self, sats: UTXORows, cents: UTXORows) { + self.age_range.push_block(sats.age_range, cents.age_range); + self.epoch.push_block(sats.epoch, cents.epoch); + self.class.push_block(sats.class, cents.class); + self.entry.push_block(sats.entry, cents.entry); + } + + pub(crate) fn min_len(&self) -> usize { + self.age_range + .len() + .min(self.epoch.len()) + .min(self.class.len()) + .min(self.entry.len()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let Self { + age_range, + epoch, + class, + entry, + } = self; + let mut vecs = age_range.collect_vecs_mut(); + vecs.extend(epoch.collect_vecs_mut()); + vecs.extend(class.collect_vecs_mut()); + vecs.extend(entry.collect_vecs_mut()); + vecs + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/cumulative/with_amount_and_type.rs b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/with_amount_and_type.rs new file mode 100644 index 000000000..cd969fc19 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/with_amount_and_type.rs @@ -0,0 +1,52 @@ +use std::ops::AddAssign; + +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::Version; +use vecdb::{AnyStoredVec, Database, PcoVecValue, Rw, StorageMode}; + +use super::super::{UTXOColumnarMetric, UTXORows}; + +#[derive(Traversable)] +pub struct CumulativeUTXOColumnarMetric +where + T: PcoVecValue, +{ + #[traversable(flatten)] + pub matrices: UTXOColumnarMetric, + #[traversable(skip)] + last: Option<(usize, UTXORows)>, +} + +impl CumulativeUTXOColumnarMetric +where + T: PcoVecValue + AddAssign + Copy + Default, +{ + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + Ok(Self { + matrices: UTXOColumnarMetric::forced_import(db, name, version)?, + last: None, + }) + } + + #[inline(always)] + pub(crate) fn push_block(&mut self, rows: UTXORows) { + let len = self.matrices.min_len(); + let mut cumulative = match self.last.take() { + Some((cached_len, row)) if cached_len == len => row, + _ => self.matrices.collect_last().unwrap_or_default(), + }; + cumulative += rows; + self.matrices.push(cumulative.clone()); + self.last = Some((len + 1, cumulative)); + } + + pub(crate) fn min_len(&self) -> usize { + self.matrices.min_len() + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + self.last = None; + self.matrices.collect_vecs_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/cumulative/without_amount_or_type.rs b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/without_amount_or_type.rs new file mode 100644 index 000000000..b87997fd1 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/cumulative/without_amount_or_type.rs @@ -0,0 +1,52 @@ +use std::ops::AddAssign; + +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::Version; +use vecdb::{AnyStoredVec, Database, PcoVecValue, Rw, StorageMode}; + +use super::super::{UTXOColumnarMetricWithoutAmountOrType, UTXORows}; + +#[derive(Traversable)] +pub struct CumulativeUTXOColumnarMetricWithoutAmountOrType +where + T: PcoVecValue, +{ + #[traversable(flatten)] + pub matrices: UTXOColumnarMetricWithoutAmountOrType, + #[traversable(skip)] + last: Option<(usize, UTXORows)>, +} + +impl CumulativeUTXOColumnarMetricWithoutAmountOrType +where + T: PcoVecValue + AddAssign + Copy + Default, +{ + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + Ok(Self { + matrices: UTXOColumnarMetricWithoutAmountOrType::forced_import(db, name, version)?, + last: None, + }) + } + + #[inline(always)] + pub(crate) fn push_block(&mut self, rows: UTXORows) { + let len = self.matrices.min_len(); + let mut cumulative = match self.last.take() { + Some((cached_len, row)) if cached_len == len => row, + _ => self.matrices.collect_last().unwrap_or_default(), + }; + cumulative += rows; + self.matrices.push(cumulative.clone()); + self.last = Some((len + 1, cumulative)); + } + + pub(crate) fn min_len(&self) -> usize { + self.matrices.min_len() + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + self.last = None; + self.matrices.collect_vecs_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/exact.rs b/crates/brk_computer/src/distribution/metrics/columnar/exact.rs new file mode 100644 index 000000000..03e829728 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/exact.rs @@ -0,0 +1,168 @@ +use std::ops::AddAssign; + +use brk_cohort::{ + Filter, OVER_AGE_FILTERS, OVER_AMOUNT_FILTERS, OverAgeId, OverAmountId, UNDER_AGE_FILTERS, + UNDER_AMOUNT_FILTERS, UTXO_AGGREGATE_FILTERS, UTXOAggregateId, UnderAgeId, UnderAmountId, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use vecdb::{ + AnyStoredVec, AnyVec, ColumnId, ColumnarVec, Database, EagerVec, ImportableVec, PcoVec, + PcoVecValue, ReadOnlyClone, ReadableBoxedVec, ReadableCloneableVec, ReadableColumnarVec, Rw, + StorageMode, WritableVec, +}; + +use super::{UTXOAggregateRows, UTXOColumnarMetric, UTXORows}; + +#[derive(Traversable)] +pub struct ExactUTXOColumnarMetric +where + T: PcoVecValue, +{ + #[traversable(flatten)] + pub direct: UTXOColumnarMetric, + pub aggregate_matrix: M::Stored, UTXOAggregateId>>>, + pub under_age_matrix: M::Stored, UnderAgeId>>>, + pub over_age_matrix: M::Stored, OverAgeId>>>, + pub under_amount_matrix: M::Stored, UnderAmountId>>>, + pub over_amount_matrix: M::Stored, OverAmountId>>>, +} + +impl ExactUTXOColumnarMetric +where + T: PcoVecValue + AddAssign, +{ + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + let direct = UTXOColumnarMetric::forced_import(db, name, version)?; + let version = version + Version::ONE; + + Ok(Self { + direct, + aggregate_matrix: EagerVec::forced_import( + db, + &format!("{name}_by_aggregate"), + version, + )?, + under_age_matrix: EagerVec::forced_import( + db, + &format!("utxos_{name}_by_under_age"), + version, + )?, + over_age_matrix: EagerVec::forced_import( + db, + &format!("utxos_{name}_by_over_age"), + version, + )?, + under_amount_matrix: EagerVec::forced_import( + db, + &format!("utxos_{name}_by_under_amount"), + version, + )?, + over_amount_matrix: EagerVec::forced_import( + db, + &format!("utxos_{name}_by_over_amount"), + version, + )?, + }) + } + + pub(crate) fn source( + &self, + filter: &Filter, + name: &str, + version: Version, + ) -> Option> { + if let Some(source) = self.direct.direct_source(filter, name, version) { + return Some(source); + } + + match filter { + Filter::All | Filter::Term(_) => UTXOAggregateId::ALL + .iter() + .copied() + .find(|id| id.select(&UTXO_AGGREGATE_FILTERS) == filter) + .map(|id| Self::column(&self.aggregate_matrix, name, version, id)), + Filter::Time(_) => UnderAgeId::ALL + .iter() + .copied() + .find(|id| id.select(&UNDER_AGE_FILTERS) == filter) + .map(|id| Self::column(&self.under_age_matrix, name, version, id)) + .or_else(|| { + OverAgeId::ALL + .iter() + .copied() + .find(|id| id.select(&OVER_AGE_FILTERS) == filter) + .map(|id| Self::column(&self.over_age_matrix, name, version, id)) + }), + Filter::Amount(_) => UnderAmountId::ALL + .iter() + .copied() + .find(|id| id.select(&UNDER_AMOUNT_FILTERS) == filter) + .map(|id| Self::column(&self.under_amount_matrix, name, version, id)) + .or_else(|| { + OverAmountId::ALL + .iter() + .copied() + .find(|id| id.select(&OVER_AMOUNT_FILTERS) == filter) + .map(|id| Self::column(&self.over_amount_matrix, name, version, id)) + }), + Filter::Epoch(_) | Filter::Class(_) | Filter::Entry(_) | Filter::Type(_) => None, + } + } + + fn column( + matrix: &EagerVec, C>>, + name: &str, + version: Version, + column: C, + ) -> ReadableBoxedVec + where + C: ColumnId, + { + matrix + .read_only_clone() + .column(name, version, column) + .read_only_boxed_clone() + } + + #[inline(always)] + pub(crate) fn push(&mut self, direct: UTXORows, aggregates: UTXOAggregateRows) { + self.direct.push(direct); + self.aggregate_matrix.push(aggregates.aggregate); + self.under_age_matrix.push(aggregates.under_age); + self.over_age_matrix.push(aggregates.over_age); + self.under_amount_matrix.push(aggregates.under_amount); + self.over_amount_matrix.push(aggregates.over_amount); + } + + pub(crate) fn min_len(&self) -> usize { + self.direct + .min_len() + .min(self.aggregate_matrix.len()) + .min(self.under_age_matrix.len()) + .min(self.over_age_matrix.len()) + .min(self.under_amount_matrix.len()) + .min(self.over_amount_matrix.len()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let Self { + direct, + aggregate_matrix, + under_age_matrix, + over_age_matrix, + under_amount_matrix, + over_amount_matrix, + } = self; + let mut vecs = direct.collect_vecs_mut(); + vecs.extend([ + aggregate_matrix as &mut dyn AnyStoredVec, + under_age_matrix, + over_age_matrix, + under_amount_matrix, + over_amount_matrix, + ]); + vecs + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/mod.rs b/crates/brk_computer/src/distribution/metrics/columnar/mod.rs new file mode 100644 index 000000000..553784c74 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/mod.rs @@ -0,0 +1,29 @@ +mod additive; +mod amount; +mod amount_value; +mod cumulative; +mod exact; +mod rows; + +use brk_cohort::{CohortContext, Filter}; + +pub(crate) use additive::{ + UTXOColumnarMetric, UTXOColumnarMetricWithoutAmount, UTXOColumnarMetricWithoutAmountOrType, +}; +pub use amount::ColumnarAmount; +pub use amount_value::ColumnarAmountValue; +pub(crate) use cumulative::{ + CumulativeUTXOColumnarMetric, CumulativeUTXOColumnarMetricWithoutAmountOrType, + CumulativeUTXOValueColumnarMetric, CumulativeUTXOValueColumnarMetricWithoutAmountOrType, +}; +pub(crate) use exact::ExactUTXOColumnarMetric; +pub(crate) use rows::{UTXOAggregateRows, UTXORows}; + +pub(crate) fn utxo_metric_name(filter: &Filter, cohort_name: &str, metric: &str) -> String { + let cohort_name = CohortContext::Utxo.full_name(filter, cohort_name); + if cohort_name.is_empty() { + metric.to_owned() + } else { + format!("{cohort_name}_{metric}") + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/rows/aggregate.rs b/crates/brk_computer/src/distribution/metrics/columnar/rows/aggregate.rs new file mode 100644 index 000000000..5312b39e0 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/rows/aggregate.rs @@ -0,0 +1,22 @@ +use brk_cohort::{OverAge, OverAmount, UTXOAggregate, UnderAge, UnderAmount}; + +#[derive(Clone, Default)] +pub(crate) struct UTXOAggregateRows { + pub aggregate: UTXOAggregate, + pub under_age: UnderAge, + pub over_age: OverAge, + pub under_amount: UnderAmount, + pub over_amount: OverAmount, +} + +impl UTXOAggregateRows { + pub(crate) fn map(&self, mut map: impl FnMut(&T) -> U) -> UTXOAggregateRows { + UTXOAggregateRows { + aggregate: self.aggregate.map(&mut map), + under_age: UnderAge::from_fn(|id| map(id.select(&self.under_age))), + over_age: OverAge::from_fn(|id| map(id.select(&self.over_age))), + under_amount: UnderAmount::from_fn(|id| map(id.select(&self.under_amount))), + over_amount: OverAmount::from_fn(|id| map(id.select(&self.over_amount))), + } + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/rows/direct.rs b/crates/brk_computer/src/distribution/metrics/columnar/rows/direct.rs new file mode 100644 index 000000000..0bf705258 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/rows/direct.rs @@ -0,0 +1,105 @@ +use std::ops::AddAssign; + +use brk_cohort::{ + AgeRange, AgeRangeId, AmountRange, AmountRangeId, ByEntry, ByEpoch, Class, ClassId, EntryId, + EpochId, Filter, OVER_AGE_FILTERS, OVER_AMOUNT_FILTERS, OverAge, OverAmount, SpendableType, + SpendableTypeId, TERM_FILTERS, UNDER_AGE_FILTERS, UNDER_AMOUNT_FILTERS, UTXOAggregate, + UnderAge, UnderAmount, +}; +use vecdb::{ColumnId, VecValue}; + +use super::UTXOAggregateRows; + +#[derive(Clone, Default)] +pub(crate) struct UTXORows { + pub age_range: AgeRange, + pub epoch: ByEpoch, + pub class: Class, + pub entry: ByEntry, + pub amount_range: AmountRange, + pub type_: SpendableType, +} + +impl UTXORows { + pub(crate) fn map(&self, mut map: impl FnMut(&T) -> U) -> UTXORows { + UTXORows { + age_range: AgeRange::from_fn(|id| map(id.select(&self.age_range))), + epoch: ByEpoch::from_fn(|id| map(id.select(&self.epoch))), + class: Class::from_fn(|id| map(id.select(&self.class))), + entry: ByEntry::from_fn(|id| map(id.select(&self.entry))), + amount_range: AmountRange::from_fn(|id| map(id.select(&self.amount_range))), + type_: SpendableType::from_fn(|id| map(id.select(&self.type_))), + } + } + + pub(crate) fn aggregate(&self) -> UTXOAggregateRows + where + T: AddAssign + Clone + Default, + { + UTXOAggregateRows { + aggregate: UTXOAggregate { + all: Self::sum(self.age_range.iter()), + sth: self.sum_age(&TERM_FILTERS.short), + lth: self.sum_age(&TERM_FILTERS.long), + }, + under_age: UnderAge::from_fn(|id| self.sum_age(id.select(&UNDER_AGE_FILTERS))), + over_age: OverAge::from_fn(|id| self.sum_age(id.select(&OVER_AGE_FILTERS))), + under_amount: UnderAmount::from_fn(|id| { + self.sum_amount(id.select(&UNDER_AMOUNT_FILTERS)) + }), + over_amount: OverAmount::from_fn(|id| self.sum_amount(id.select(&OVER_AMOUNT_FILTERS))), + } + } + + fn sum_age(&self, filter: &Filter) -> T + where + T: AddAssign + Clone + Default, + { + Self::sum(AgeRangeId::included_by(filter).map(|column| column.select(&self.age_range))) + } + + fn sum_amount(&self, filter: &Filter) -> T + where + T: AddAssign + Clone + Default, + { + Self::sum( + AmountRangeId::included_by(filter).map(|column| column.select(&self.amount_range)), + ) + } + + fn sum<'a>(values: impl Iterator) -> T + where + T: AddAssign + Clone + Default + 'a, + { + values.fold(T::default(), |mut total, value| { + total += value.clone(); + total + }) + } +} + +impl AddAssign for UTXORows +where + T: VecValue + AddAssign + Copy, +{ + fn add_assign(&mut self, rhs: Self) { + for id in AgeRangeId::ALL { + *id.get_mut(&mut self.age_range) += *id.get(&rhs.age_range); + } + for id in EpochId::ALL { + *id.get_mut(&mut self.epoch) += *id.get(&rhs.epoch); + } + for id in ClassId::ALL { + *id.get_mut(&mut self.class) += *id.get(&rhs.class); + } + for id in EntryId::ALL { + *id.get_mut(&mut self.entry) += *id.get(&rhs.entry); + } + for id in AmountRangeId::ALL { + *id.get_mut(&mut self.amount_range) += *id.get(&rhs.amount_range); + } + for id in SpendableTypeId::ALL { + *id.get_mut(&mut self.type_) += *id.get(&rhs.type_); + } + } +} diff --git a/crates/brk_computer/src/distribution/metrics/columnar/rows/mod.rs b/crates/brk_computer/src/distribution/metrics/columnar/rows/mod.rs new file mode 100644 index 000000000..b78df3d57 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/columnar/rows/mod.rs @@ -0,0 +1,5 @@ +mod aggregate; +mod direct; + +pub(crate) use aggregate::UTXOAggregateRows; +pub(crate) use direct::UTXORows; diff --git a/crates/brk_computer/src/distribution/metrics/config.rs b/crates/brk_computer/src/distribution/metrics/config.rs deleted file mode 100644 index 774946f7f..000000000 --- a/crates/brk_computer/src/distribution/metrics/config.rs +++ /dev/null @@ -1,177 +0,0 @@ -use brk_cohort::Filter; -use brk_error::Result; -use brk_types::{ - Cents, Height, PartsPerMillion32, PartsPerMillionSigned32, PartsPerMillionSigned64, Version, -}; -use schemars::JsonSchema; -use vecdb::{BytesVec, BytesVecValue, CachedBoxedVec, Database, ImportableVec}; - -use crate::{ - indexes, - internal::{ - CachedWindowStartVec, ColumnarPercentRollingWindows, ColumnarRollingWindows, - ColumnarRollingWindowsFrom1w, FiatPerBlock, FiatPerBlockCumulativeWithSums, FiatType, - NumericValue, PerBlock, PerBlockCumulativeRolling, PercentPerBlock, Price, - PriceWithRatioPerBlock, RatioPerBlock, RollingWindow24hPerBlock, RollingWindows, - SpotValuePerBlock, ValuePerBlock, ValuePerBlockCumulative, ValuePerBlockCumulativeRolling, - Windows, - }, -}; - -/// Trait for types importable via `ImportConfig::import`. -pub(crate) trait ConfigImport: Sized { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result; -} - -/// Implement `ConfigImport` for types whose `forced_import` takes `(db, name, version, indexes)`. -macro_rules! impl_config_import { - ($($type:ty),+ $(,)?) => { - $( - impl ConfigImport for $type { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import(cfg.db, &cfg.name(suffix), cfg.version + offset, cfg.indexes) - } - } - )+ - }; -} - -// Non-generic types -impl_config_import!( - ValuePerBlock, - ValuePerBlockCumulative, - RatioPerBlock, - PercentPerBlock, - PercentPerBlock, - PercentPerBlock, - ColumnarPercentRollingWindows, - Price>, -); - -impl ConfigImport for PriceWithRatioPerBlock { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import( - cfg.db, - &cfg.name(suffix), - cfg.version + offset, - cfg.indexes, - cfg.spot_price, - ) - } -} - -impl ConfigImport for SpotValuePerBlock { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import( - cfg.db, - &cfg.name(suffix), - cfg.version + offset, - cfg.indexes, - cfg.spot_price, - ) - } -} - -// Generic types (macro_rules can't parse generic bounds, so written out) -impl ConfigImport for PerBlock { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import(cfg.db, &cfg.name(suffix), cfg.version + offset, cfg.indexes) - } -} -impl ConfigImport for PerBlockCumulativeRolling -where - T: NumericValue + JsonSchema, -{ - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import( - cfg.db, - &cfg.name(suffix), - cfg.version + offset, - cfg.indexes, - cfg.cached_starts, - ) - } -} -impl ConfigImport for RollingWindows { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import(cfg.db, &cfg.name(suffix), cfg.version + offset, cfg.indexes) - } -} -impl ConfigImport for ColumnarRollingWindows { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import(cfg.db, &cfg.name(suffix), cfg.version + offset, cfg.indexes) - } -} -impl ConfigImport for RollingWindow24hPerBlock { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import(cfg.db, &cfg.name(suffix), cfg.version + offset, cfg.indexes) - } -} -impl ConfigImport for ValuePerBlockCumulativeRolling { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import( - cfg.db, - &cfg.name(suffix), - cfg.version + offset, - cfg.indexes, - cfg.cached_starts, - ) - } -} -impl ConfigImport for FiatPerBlockCumulativeWithSums { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import( - cfg.db, - &cfg.name(suffix), - cfg.version + offset, - cfg.indexes, - cfg.cached_starts, - ) - } -} -impl ConfigImport for ColumnarRollingWindowsFrom1w { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import(cfg.db, &cfg.name(suffix), cfg.version + offset, cfg.indexes) - } -} -impl ConfigImport for FiatPerBlock { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Self::forced_import(cfg.db, &cfg.name(suffix), cfg.version + offset, cfg.indexes) - } -} -impl ConfigImport for BytesVec { - fn config_import(cfg: &ImportConfig, suffix: &str, offset: Version) -> Result { - Ok(Self::forced_import( - cfg.db, - &cfg.name(suffix), - cfg.version + offset, - )?) - } -} - -#[derive(Clone, Copy)] -pub struct ImportConfig<'a> { - pub db: &'a Database, - pub filter: &'a Filter, - pub full_name: &'a str, - pub version: Version, - pub indexes: &'a indexes::Vecs, - pub cached_starts: &'a Windows<&'a CachedWindowStartVec>, - pub spot_price: &'a CachedBoxedVec, -} - -impl<'a> ImportConfig<'a> { - pub(crate) fn name(&self, suffix: &str) -> String { - if self.full_name.is_empty() { - suffix.to_string() - } else if suffix.is_empty() { - self.full_name.to_string() - } else { - format!("{}_{suffix}", self.full_name) - } - } - - pub(crate) fn import(&self, suffix: &str, offset: Version) -> Result { - T::config_import(self, suffix, offset) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/cost_basis/base.rs b/crates/brk_computer/src/distribution/metrics/cost_basis/base.rs new file mode 100644 index 000000000..fc17ca394 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/cost_basis/base.rs @@ -0,0 +1,18 @@ +use brk_cohort::UTXOAggregateId; +use brk_traversable::Traversable; +use brk_types::{Cents, PartsPerMillion32, PercentileId}; + +use crate::internal::{LazyColumnPerBlock, LazyColumnPercentPerBlock, PercentilePrices, Price}; + +use super::CostBasisSide; + +#[derive(Clone, Traversable)] +pub struct CostBasis { + pub in_profit: CostBasisSide, + pub in_loss: CostBasisSide, + pub min: Price>, + pub max: Price>, + pub per_coin: PercentilePrices>>, + pub per_dollar: PercentilePrices>>, + pub supply_density: LazyColumnPercentPerBlock, +} diff --git a/crates/brk_computer/src/distribution/metrics/cost_basis/block_data.rs b/crates/brk_computer/src/distribution/metrics/cost_basis/block_data.rs new file mode 100644 index 000000000..d89736316 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/cost_basis/block_data.rs @@ -0,0 +1,12 @@ +use brk_types::{Cents, PartsPerMillion32}; + +use crate::internal::PERCENTILES_LEN; + +#[derive(Clone)] +pub(crate) struct CostBasisBlockData { + pub min: Cents, + pub max: Cents, + pub per_coin: [Cents; PERCENTILES_LEN], + pub per_dollar: [Cents; PERCENTILES_LEN], + pub supply_density: PartsPerMillion32, +} diff --git a/crates/brk_computer/src/distribution/metrics/cost_basis/mod.rs b/crates/brk_computer/src/distribution/metrics/cost_basis/mod.rs index 13dd571e2..201725587 100644 --- a/crates/brk_computer/src/distribution/metrics/cost_basis/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/cost_basis/mod.rs @@ -1,223 +1,9 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::CentsSquaredSats; -use brk_types::{Cents, Height, PartsPerMillion32, Sats, Version}; -use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableVec, Rw, StorageMode, WritableVec}; +mod base; +mod block_data; +mod side; +mod vecs; -use crate::internal::{PERCENTILES_LEN, PerBlock, PercentPerBlock, PercentilesVecs, Price}; - -use super::ImportConfig; - -#[derive(Traversable)] -pub struct CostBasisSide { - pub per_coin: Price>, - pub per_dollar: Price>, -} - -/// Cost basis metrics: min/max + profit/loss splits + percentiles + supply density. -/// Used by all/sth/lth cohorts only. -#[derive(Traversable)] -pub struct CostBasis { - pub in_profit: CostBasisSide, - pub in_loss: CostBasisSide, - pub min: Price>, - pub max: Price>, - pub per_coin: PercentilesVecs, - pub per_dollar: PercentilesVecs, - pub supply_density: PercentPerBlock, -} - -impl CostBasis { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - Ok(Self { - in_profit: CostBasisSide { - per_coin: Price::forced_import( - cfg.db, - &cfg.name("cost_basis_in_profit_per_coin"), - cfg.version + Version::ONE, - cfg.indexes, - )?, - per_dollar: Price::forced_import( - cfg.db, - &cfg.name("cost_basis_in_profit_per_dollar"), - cfg.version + Version::ONE, - cfg.indexes, - )?, - }, - in_loss: CostBasisSide { - per_coin: Price::forced_import( - cfg.db, - &cfg.name("cost_basis_in_loss_per_coin"), - cfg.version + Version::ONE, - cfg.indexes, - )?, - per_dollar: Price::forced_import( - cfg.db, - &cfg.name("cost_basis_in_loss_per_dollar"), - cfg.version + Version::ONE, - cfg.indexes, - )?, - }, - min: cfg.import("cost_basis_min", Version::ZERO)?, - max: cfg.import("cost_basis_max", Version::ZERO)?, - per_coin: PercentilesVecs::forced_import( - cfg.db, - &cfg.name("cost_basis_per_coin"), - cfg.version, - cfg.indexes, - )?, - per_dollar: PercentilesVecs::forced_import( - cfg.db, - &cfg.name("cost_basis_per_dollar"), - cfg.version, - cfg.indexes, - )?, - supply_density: PercentPerBlock::forced_import( - cfg.db, - &cfg.name("supply_density"), - cfg.version, - cfg.indexes, - )?, - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.min - .cents - .height - .len() - .min(self.max.cents.height.len()) - .min(self.supply_density.ppm.height.len()) - .min(self.per_coin.prices.height.len()) - .min(self.per_dollar.prices.height.len()) - } - - #[inline(always)] - pub(crate) fn push_minmax(&mut self, min_price: Cents, max_price: Cents) { - self.min.cents.height.push(min_price); - self.max.cents.height.push(max_price); - } - - #[inline(always)] - pub(crate) fn push_percentiles( - &mut self, - sat_prices: &[Cents; PERCENTILES_LEN], - usd_prices: &[Cents; PERCENTILES_LEN], - ) { - self.per_coin.push(sat_prices); - self.per_dollar.push(usd_prices); - } - - #[inline(always)] - pub(crate) fn push_density(&mut self, density: PartsPerMillion32) { - self.supply_density.ppm.height.push(density); - } - - pub(crate) fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.per_coin - .validate_computed_version_or_reset(base_version)?; - self.per_dollar - .validate_computed_version_or_reset(base_version)?; - Ok(()) - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs: Vec<&mut dyn AnyStoredVec> = vec![ - &mut self.in_profit.per_coin.cents.height, - &mut self.in_profit.per_dollar.cents.height, - &mut self.in_loss.per_coin.cents.height, - &mut self.in_loss.per_dollar.cents.height, - &mut self.min.cents.height, - &mut self.max.cents.height, - &mut self.supply_density.ppm.height, - ]; - vecs.push(self.per_coin.prices.stored_mut()); - vecs.push(self.per_dollar.prices.stored_mut()); - vecs - } - - #[allow(clippy::too_many_arguments)] - pub(crate) fn compute_prices( - &mut self, - starting_lengths: &Lengths, - spot: &impl ReadableVec, - invested_cap_in_profit: &impl ReadableVec, - invested_cap_in_loss: &impl ReadableVec, - supply_in_profit_sats: &impl ReadableVec, - supply_in_loss_sats: &impl ReadableVec, - capitalized_cap_in_profit_raw: &impl ReadableVec, - capitalized_cap_in_loss_raw: &impl ReadableVec, - exit: &Exit, - ) -> Result<()> { - self.in_profit.per_coin.cents.height.compute_transform3( - starting_lengths.height, - invested_cap_in_profit, - supply_in_profit_sats, - spot, - |(h, invested_cents, supply_sats, spot, ..)| { - let supply = supply_sats.as_u128(); - if supply == 0 { - return (h, spot); - } - ( - h, - Cents::new((invested_cents.as_u128() * Sats::ONE_BTC_U128 / supply) as u64), - ) - }, - exit, - )?; - self.in_loss.per_coin.cents.height.compute_transform3( - starting_lengths.height, - invested_cap_in_loss, - supply_in_loss_sats, - spot, - |(h, invested_cents, supply_sats, spot, ..)| { - let supply = supply_sats.as_u128(); - if supply == 0 { - return (h, spot); - } - ( - h, - Cents::new((invested_cents.as_u128() * Sats::ONE_BTC_U128 / supply) as u64), - ) - }, - exit, - )?; - self.in_profit.per_dollar.cents.height.compute_transform3( - starting_lengths.height, - capitalized_cap_in_profit_raw, - invested_cap_in_profit, - spot, - |(h, capitalized_cap, invested_cents, spot, ..)| { - let invested_raw = invested_cents.as_u128() * Sats::ONE_BTC_U128; - if invested_raw == 0 { - return (h, spot); - } - ( - h, - Cents::new((capitalized_cap.inner() / invested_raw) as u64), - ) - }, - exit, - )?; - self.in_loss.per_dollar.cents.height.compute_transform3( - starting_lengths.height, - capitalized_cap_in_loss_raw, - invested_cap_in_loss, - spot, - |(h, capitalized_cap, invested_cents, spot, ..)| { - let invested_raw = invested_cents.as_u128() * Sats::ONE_BTC_U128; - if invested_raw == 0 { - return (h, spot); - } - ( - h, - Cents::new((capitalized_cap.inner() / invested_raw) as u64), - ) - }, - exit, - )?; - Ok(()) - } -} +pub use base::CostBasis; +pub(crate) use block_data::CostBasisBlockData; +pub use side::CostBasisSide; +pub use vecs::CostBasisVecs; diff --git a/crates/brk_computer/src/distribution/metrics/cost_basis/side.rs b/crates/brk_computer/src/distribution/metrics/cost_basis/side.rs new file mode 100644 index 000000000..85cd8d97f --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/cost_basis/side.rs @@ -0,0 +1,11 @@ +use brk_cohort::UTXOAggregateId; +use brk_traversable::Traversable; +use brk_types::Cents; + +use crate::internal::{LazyColumnPerBlock, Price}; + +#[derive(Clone, Traversable)] +pub struct CostBasisSide { + pub per_coin: Price>, + pub per_dollar: Price>, +} diff --git a/crates/brk_computer/src/distribution/metrics/cost_basis/vecs.rs b/crates/brk_computer/src/distribution/metrics/cost_basis/vecs.rs new file mode 100644 index 000000000..2d1d98e79 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/cost_basis/vecs.rs @@ -0,0 +1,351 @@ +use brk_cohort::{UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, UTXOAggregate, UTXOAggregateId}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, PartsPerMillion32, Sats, Version}; +use vecdb::{AnyStoredVec, AnyVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::{metrics::utxo_metric_name, state::UnrealizedState}, + indexes, + internal::{ + ColumnarPerBlock, LazyColumnPerBlock, LazyColumnPercentPerBlock, PercentilesVecs, Price, + }, +}; + +use super::{CostBasis, CostBasisBlockData, CostBasisSide}; + +#[derive(Traversable)] +pub struct CostBasisVecs { + #[traversable(flatten)] + pub cohorts: UTXOAggregate, + #[traversable(hidden)] + pub in_profit_per_coin_source: ColumnarPerBlock< + Cents, + UTXOAggregateId, + UTXOAggregate>>, + M, + >, + #[traversable(hidden)] + pub in_profit_per_dollar_source: ColumnarPerBlock< + Cents, + UTXOAggregateId, + UTXOAggregate>>, + M, + >, + #[traversable(hidden)] + pub in_loss_per_coin_source: ColumnarPerBlock< + Cents, + UTXOAggregateId, + UTXOAggregate>>, + M, + >, + #[traversable(hidden)] + pub in_loss_per_dollar_source: ColumnarPerBlock< + Cents, + UTXOAggregateId, + UTXOAggregate>>, + M, + >, + #[traversable(hidden)] + pub min_source: ColumnarPerBlock< + Cents, + UTXOAggregateId, + UTXOAggregate>>, + M, + >, + #[traversable(hidden)] + pub max_source: ColumnarPerBlock< + Cents, + UTXOAggregateId, + UTXOAggregate>>, + M, + >, + #[traversable(hidden)] + pub per_coin_sources: UTXOAggregate>, + #[traversable(hidden)] + pub per_dollar_sources: UTXOAggregate>, + #[traversable(hidden)] + pub supply_density_source: ColumnarPerBlock< + PartsPerMillion32, + UTXOAggregateId, + UTXOAggregate>, + M, + >, +} + +impl CostBasisVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + ) -> Result { + let aggregate_version = version + Version::ONE; + let in_profit_per_coin_source = Self::import_prices( + db, + "cost_basis_in_profit_per_coin", + aggregate_version, + indexes, + )?; + let in_profit_per_dollar_source = Self::import_prices( + db, + "cost_basis_in_profit_per_dollar", + aggregate_version, + indexes, + )?; + let in_loss_per_coin_source = Self::import_prices( + db, + "cost_basis_in_loss_per_coin", + aggregate_version, + indexes, + )?; + let in_loss_per_dollar_source = Self::import_prices( + db, + "cost_basis_in_loss_per_dollar", + aggregate_version, + indexes, + )?; + let min_source = Self::import_prices(db, "cost_basis_min", aggregate_version, indexes)?; + let max_source = Self::import_prices(db, "cost_basis_max", aggregate_version, indexes)?; + let per_coin_sources = + Self::import_percentiles(db, "cost_basis_per_coin", version, indexes)?; + let per_dollar_sources = + Self::import_percentiles(db, "cost_basis_per_dollar", version, indexes)?; + let supply_density_source = ColumnarPerBlock::forced_import( + db, + "supply_density_by_aggregate", + aggregate_version, + |source| { + UTXOAggregate::from_fn(|id| { + LazyColumnPercentPerBlock::new( + &Self::cohort_metric_name(id, "supply_density"), + aggregate_version, + source, + id, + indexes, + ) + }) + }, + )?; + let cohorts = UTXOAggregate::from_fn(|id| CostBasis { + in_profit: CostBasisSide { + per_coin: id.select(&in_profit_per_coin_source.series).clone(), + per_dollar: id.select(&in_profit_per_dollar_source.series).clone(), + }, + in_loss: CostBasisSide { + per_coin: id.select(&in_loss_per_coin_source.series).clone(), + per_dollar: id.select(&in_loss_per_dollar_source.series).clone(), + }, + min: id.select(&min_source.series).clone(), + max: id.select(&max_source.series).clone(), + per_coin: id.select(&per_coin_sources).prices.series.clone(), + per_dollar: id.select(&per_dollar_sources).prices.series.clone(), + supply_density: id.select(&supply_density_source.series).clone(), + }); + + Ok(Self { + cohorts, + in_profit_per_coin_source, + in_profit_per_dollar_source, + in_loss_per_coin_source, + in_loss_per_dollar_source, + min_source, + max_source, + per_coin_sources, + per_dollar_sources, + supply_density_source, + }) + } + + fn import_prices( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + ) -> Result< + ColumnarPerBlock< + Cents, + UTXOAggregateId, + UTXOAggregate>>, + >, + > { + ColumnarPerBlock::forced_import( + db, + &format!("{metric}_cents_by_aggregate"), + version, + |source| { + UTXOAggregate::from_fn(|id| { + Price::from_columnar_source( + &Self::cohort_metric_name(id, metric), + version, + source, + id, + indexes, + ) + }) + }, + ) + } + + fn import_percentiles( + db: &Database, + metric: &str, + base_version: Version, + indexes: &indexes::Vecs, + ) -> Result> { + UTXOAggregate::try_from_fn(|id| { + let version = if matches!(id, UTXOAggregateId::All) { + base_version + Version::ONE + } else { + base_version + }; + PercentilesVecs::forced_import( + db, + &Self::cohort_metric_name(id, metric), + version, + indexes, + ) + }) + } + + fn cohort_metric_name(id: UTXOAggregateId, metric: &str) -> String { + utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ) + } + + #[inline(always)] + pub(crate) fn push_prices(&mut self, spot: Cents, states: &UTXOAggregate) { + self.in_profit_per_coin_source + .push(UTXOAggregate::from_fn(|id| { + Self::per_coin_price(spot, id.select(states), true) + })); + self.in_loss_per_coin_source + .push(UTXOAggregate::from_fn(|id| { + Self::per_coin_price(spot, id.select(states), false) + })); + self.in_profit_per_dollar_source + .push(UTXOAggregate::from_fn(|id| { + Self::per_dollar_price(spot, id.select(states), true) + })); + self.in_loss_per_dollar_source + .push(UTXOAggregate::from_fn(|id| { + Self::per_dollar_price(spot, id.select(states), false) + })); + } + + #[inline(always)] + fn per_coin_price(spot: Cents, state: &UnrealizedState, in_profit: bool) -> Cents { + let (supply, unrealized) = if in_profit { + (state.supply_in_profit, state.unrealized_profit) + } else { + (state.supply_in_loss, state.unrealized_loss) + }; + let supply = supply.as_u128(); + if supply == 0 { + return spot; + } + let market_value = supply * spot.as_u128() / Sats::ONE_BTC_U128; + let invested = if in_profit { + market_value.saturating_sub(unrealized.as_u128()) + } else { + market_value + unrealized.as_u128() + }; + Cents::new((invested * Sats::ONE_BTC_U128 / supply) as u64) + } + + #[inline(always)] + fn per_dollar_price(spot: Cents, state: &UnrealizedState, in_profit: bool) -> Cents { + let (supply, unrealized, capitalized_cap) = if in_profit { + ( + state.supply_in_profit, + state.unrealized_profit, + state.capitalized_cap_in_profit_raw, + ) + } else { + ( + state.supply_in_loss, + state.unrealized_loss, + state.capitalized_cap_in_loss_raw, + ) + }; + let market_value = supply.as_u128() * spot.as_u128() / Sats::ONE_BTC_U128; + let invested = if in_profit { + market_value.saturating_sub(unrealized.as_u128()) + } else { + market_value + unrealized.as_u128() + }; + let invested_raw = invested * Sats::ONE_BTC_U128; + capitalized_cap + .checked_div(invested_raw) + .map(|price| Cents::new(price as u64)) + .unwrap_or(spot) + } + + #[inline(always)] + pub(crate) fn push(&mut self, rows: UTXOAggregate) { + self.min_source + .push(UTXOAggregate::from_fn(|id| id.select(&rows).min)); + self.max_source + .push(UTXOAggregate::from_fn(|id| id.select(&rows).max)); + self.supply_density_source + .push(UTXOAggregate::from_fn(|id| id.select(&rows).supply_density)); + self.per_coin_sources.all.push(&rows.all.per_coin); + self.per_coin_sources.sth.push(&rows.sth.per_coin); + self.per_coin_sources.lth.push(&rows.lth.per_coin); + self.per_dollar_sources.all.push(&rows.all.per_dollar); + self.per_dollar_sources.sth.push(&rows.sth.per_dollar); + self.per_dollar_sources.lth.push(&rows.lth.per_dollar); + } + + pub(crate) fn validate_computed_versions(&mut self, version: Version) -> Result<()> { + for percentiles in self + .per_coin_sources + .iter_mut() + .chain(self.per_dollar_sources.iter_mut()) + { + percentiles.validate_computed_version_or_reset(version)?; + } + Ok(()) + } + + pub(crate) fn min_len(&self) -> usize { + self.in_profit_per_coin_source + .height + .len() + .min(self.in_profit_per_dollar_source.height.len()) + .min(self.in_loss_per_coin_source.height.len()) + .min(self.in_loss_per_dollar_source.height.len()) + .min(self.min_source.height.len()) + .min(self.max_source.height.len()) + .min(self.supply_density_source.height.len()) + .min( + self.per_coin_sources + .iter() + .chain(self.per_dollar_sources.iter()) + .map(|percentiles| percentiles.prices.height.len()) + .min() + .unwrap_or_default(), + ) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = vec![ + self.in_profit_per_coin_source.stored_mut(), + self.in_profit_per_dollar_source.stored_mut(), + self.in_loss_per_coin_source.stored_mut(), + self.in_loss_per_dollar_source.stored_mut(), + self.min_source.stored_mut(), + self.max_source.stored_mut(), + self.supply_density_source.stored_mut(), + ]; + vecs.extend( + self.per_coin_sources + .iter_mut() + .chain(self.per_dollar_sources.iter_mut()) + .map(|percentiles| percentiles.prices.stored_mut()), + ); + vecs + } +} diff --git a/crates/brk_computer/src/distribution/metrics/mod.rs b/crates/brk_computer/src/distribution/metrics/mod.rs index b34b07b87..f1b36da1c 100644 --- a/crates/brk_computer/src/distribution/metrics/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/mod.rs @@ -1,334 +1,42 @@ -/// Aggregate a field by summing the same field across `others`. -macro_rules! sum_others { - ($self_:ident, $si:ident, $others:ident, $exit:ident; $($field:tt).+) => { - $self_.$($field).+.compute_sum_of_others( - $si.height, - &$others.iter().map(|v| &v.$($field).+).collect::>(), - $exit, - )? - }; -} - mod activity; +mod additive; +mod aggregate; +mod cohorts; +mod columnar; -/// Accessor methods for `CohortMetricsBase` implementations. -/// -/// All cohort metric types share the same field names (`filter`, `supply`, `outputs`, -/// `activity`, `realized`, `unrealized`). For wrapper types like -/// `ExtendedAdjustedCohortMetrics`, Rust's auto-deref resolves these through `Deref`. -macro_rules! impl_cohort_accessors { - () => { - fn filter(&self) -> &brk_cohort::Filter { - &self.filter - } - fn supply(&self) -> &$crate::distribution::metrics::SupplyCore { - &self.supply - } - fn supply_mut(&mut self) -> &mut $crate::distribution::metrics::SupplyCore { - &mut self.supply - } - fn outputs(&self) -> &$crate::distribution::metrics::OutputsBase { - &self.outputs - } - fn outputs_mut(&mut self) -> &mut $crate::distribution::metrics::OutputsBase { - &mut self.outputs - } - fn activity(&self) -> &Self::ActivityVecs { - &self.activity - } - fn activity_mut(&mut self) -> &mut Self::ActivityVecs { - &mut self.activity - } - fn realized(&self) -> &Self::RealizedVecs { - &self.realized - } - fn realized_mut(&mut self) -> &mut Self::RealizedVecs { - &mut self.realized - } - fn unrealized(&self) -> &Self::UnrealizedVecs { - &self.unrealized - } - fn unrealized_mut(&mut self) -> &mut Self::UnrealizedVecs { - &mut self.unrealized - } - fn supply_and_unrealized_mut( - &mut self, - ) -> ( - &$crate::distribution::metrics::SupplyCore, - &mut Self::UnrealizedVecs, - ) { - (&*self.supply, &mut self.unrealized) - } - }; -} - -/// Variant of `impl_cohort_accessors` for wrapper types that deref to an `inner` field. -/// Uses `self.inner.*` directly to enable split borrows that Rust cannot infer through `Deref`. -macro_rules! impl_cohort_accessors_inner { - () => { - fn filter(&self) -> &brk_cohort::Filter { - &self.inner.filter - } - fn supply(&self) -> &$crate::distribution::metrics::SupplyCore { - &self.inner.supply - } - fn supply_mut(&mut self) -> &mut $crate::distribution::metrics::SupplyCore { - &mut self.inner.supply - } - fn outputs(&self) -> &$crate::distribution::metrics::OutputsBase { - &self.inner.outputs - } - fn outputs_mut(&mut self) -> &mut $crate::distribution::metrics::OutputsBase { - &mut self.inner.outputs - } - fn activity(&self) -> &Self::ActivityVecs { - &self.inner.activity - } - fn activity_mut(&mut self) -> &mut Self::ActivityVecs { - &mut self.inner.activity - } - fn realized(&self) -> &Self::RealizedVecs { - &self.inner.realized - } - fn realized_mut(&mut self) -> &mut Self::RealizedVecs { - &mut self.inner.realized - } - fn unrealized(&self) -> &Self::UnrealizedVecs { - &self.inner.unrealized - } - fn unrealized_mut(&mut self) -> &mut Self::UnrealizedVecs { - &mut self.inner.unrealized - } - fn supply_and_unrealized_mut( - &mut self, - ) -> ( - &$crate::distribution::metrics::SupplyCore, - &mut Self::UnrealizedVecs, - ) { - (&*self.inner.supply, &mut self.inner.unrealized) - } - }; -} - -mod cohort; -mod config; mod cost_basis; mod outputs; +mod percentiles; mod profitability; mod realized; mod relative; mod supply; mod unrealized; -pub use activity::{ActivityCore, ActivityFull, ActivityLike, ActivityMinimal}; -pub use cohort::{ - AllCohortMetrics, BasicCohortMetrics, CoreCohortMetrics, ExtendedAdjustedCohortMetrics, - ExtendedCohortMetrics, MinimalCohortMetrics, TypeCohortMetrics, +pub use activity::{ActivitySources, ActivityVecs}; +pub use additive::AdditiveAggregateFiatPerBlock; +pub(crate) use additive::AdditiveUTXORawVec; +pub use aggregate::{ + AdditiveAggregateFiatPerBlockCumulativeWithSums, AggregateFiatPerBlock, + AggregatePercentPerBlock, AggregatePriceWithRatioPerBlock, }; -pub use config::ImportConfig; -pub use cost_basis::CostBasis; -pub use outputs::{OutputsBase, OutputsUnspent}; -pub use profitability::ProfitabilityMetrics; -pub use realized::{ - AdjustedSopr, RealizedBase, RealizedCore, RealizedFull, RealizedFullAccum, RealizedLike, - RealizedMinimal, +pub use cohorts::CohortMetrics; +pub use columnar::{ColumnarAmount, ColumnarAmountValue}; +pub(crate) use columnar::{ + CumulativeUTXOColumnarMetric, CumulativeUTXOColumnarMetricWithoutAmountOrType, + CumulativeUTXOValueColumnarMetric, CumulativeUTXOValueColumnarMetricWithoutAmountOrType, + ExactUTXOColumnarMetric, UTXOColumnarMetric, UTXOColumnarMetricWithoutAmount, + UTXOColumnarMetricWithoutAmountOrType, UTXORows, utxo_metric_name, }; -pub use relative::{RelativeForAll, RelativeWithExtended}; +pub(crate) use cost_basis::CostBasisBlockData; +pub use cost_basis::CostBasisVecs; +pub use outputs::OutputsVecs; +pub use profitability::ProfitabilityVecs; +pub(crate) use realized::{AdjustedSoprComputeSource, RealizedAggregateSources}; +pub use realized::{RealizedAggregateState, RealizedSources, RealizedVecs}; +pub(crate) use realized::{RealizedBlockData, RealizedTotals, Sopr24hInput}; +pub(crate) use relative::RelativeSource; +pub use relative::RelativeVecs; pub(crate) use supply::AllSupplyCache; -pub use supply::{AvgAmountVecs, SupplyBase, SupplyCore}; -pub use unrealized::{ - UnrealizedBasic, UnrealizedCore, UnrealizedFull, UnrealizedLike, UnrealizedMinimal, -}; - -use brk_cohort::Filter; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_types::{Cents, Version}; -use vecdb::{AnyStoredVec, Exit, StorageMode}; - -use crate::{ - distribution::state::{ - CohortState, CoreRealizedState, CostBasisData, CostBasisOps, CostBasisRaw, - MinimalRealizedState, RealizedOps, RealizedState, WithCapital, WithoutCapital, - }, - price, -}; - -pub trait CohortMetricsState { - type Realized: RealizedOps; - type CostBasis: CostBasisOps; -} - -impl CohortMetricsState for TypeCohortMetrics { - type Realized = MinimalRealizedState; - type CostBasis = CostBasisData; -} -impl CohortMetricsState for MinimalCohortMetrics { - type Realized = MinimalRealizedState; - type CostBasis = CostBasisRaw; -} -impl CohortMetricsState for CoreCohortMetrics { - type Realized = CoreRealizedState; - type CostBasis = CostBasisData; -} -impl CohortMetricsState for BasicCohortMetrics { - type Realized = RealizedState; - type CostBasis = CostBasisData; -} -impl CohortMetricsState for ExtendedCohortMetrics { - type Realized = RealizedState; - type CostBasis = CostBasisData; -} -impl CohortMetricsState for ExtendedAdjustedCohortMetrics { - type Realized = RealizedState; - type CostBasis = CostBasisData; -} -impl CohortMetricsState for AllCohortMetrics { - type Realized = RealizedState; - type CostBasis = CostBasisData; -} - -pub trait CohortMetricsBase: - CohortMetricsState> + Send + Sync -{ - type ActivityVecs: ActivityLike; - type RealizedVecs: RealizedLike; - type UnrealizedVecs: UnrealizedLike; - - fn filter(&self) -> &Filter; - fn supply(&self) -> &SupplyCore; - fn supply_mut(&mut self) -> &mut SupplyCore; - fn outputs(&self) -> &OutputsBase; - fn outputs_mut(&mut self) -> &mut OutputsBase; - fn activity(&self) -> &Self::ActivityVecs; - fn activity_mut(&mut self) -> &mut Self::ActivityVecs; - fn realized(&self) -> &Self::RealizedVecs; - fn realized_mut(&mut self) -> &mut Self::RealizedVecs; - fn unrealized(&self) -> &Self::UnrealizedVecs; - fn unrealized_mut(&mut self) -> &mut Self::UnrealizedVecs; - fn supply_and_unrealized_mut(&mut self) -> (&SupplyCore, &mut Self::UnrealizedVecs); - - /// Convenience: access activity as `&ActivityCore` (via `ActivityLike::as_core`). - fn activity_core(&self) -> &ActivityCore { - self.activity().as_core() - } - fn activity_core_mut(&mut self) -> &mut ActivityCore { - self.activity_mut().as_core_mut() - } - - /// Convenience: access realized as `&RealizedCore` (via `RealizedLike::as_core`). - fn realized_core(&self) -> &RealizedCore { - self.realized().as_core() - } - fn realized_core_mut(&mut self) -> &mut RealizedCore { - self.realized_mut().as_core_mut() - } - - /// Convenience: access unrealized as `&UnrealizedCore` (via `UnrealizedLike::as_core`). - fn unrealized_core(&self) -> &UnrealizedCore { - self.unrealized().as_core() - } - fn unrealized_core_mut(&mut self) -> &mut UnrealizedCore { - self.unrealized_mut().as_core_mut() - } - - fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { - self.supply_mut().validate_computed_versions(base_version)?; - self.activity_mut() - .validate_computed_versions(base_version)?; - Ok(()) - } - - /// Apply pending state, compute and push unrealized state. - fn compute_and_push_unrealized( - &mut self, - height_price: Cents, - state: &mut CohortState>, - ) { - state.apply_pending(); - let unrealized_state = state.compute_unrealized_state(height_price); - self.unrealized_mut().push_state(&unrealized_state); - self.supply_mut().push_profitability(&unrealized_state); - } - - fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec>; - - fn min_stateful_len(&self) -> usize { - self.supply() - .min_len() - .min(self.outputs().min_len()) - .min(self.activity().min_len()) - .min(self.realized().min_stateful_len()) - .min(self.unrealized().min_stateful_len()) - } - - fn push_state(&mut self, state: &CohortState>) { - self.supply_mut().push_state(state); - self.outputs_mut().push_state(state); - self.activity_mut().push_state(state); - self.realized_mut().push_state(state); - } - - /// First phase of computed metrics (indexes from height). - fn compute_rest_part1( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.activity_mut() - .compute_rest_part1(prices, starting_lengths, exit)?; - - self.realized_mut() - .compute_rest_part1(starting_lengths, exit)?; - - let (supply, unrealized) = self.supply_and_unrealized_mut(); - unrealized.compute_rest( - prices, - starting_lengths, - &supply.in_profit.sats.height, - &supply.in_loss.sats.height, - exit, - )?; - - Ok(()) - } - - /// Compute aggregate base metrics from source cohorts. - fn compute_base_from_others( - &mut self, - starting_lengths: &Lengths, - others: &[&T], - exit: &Exit, - ) -> Result<()> { - self.supply_mut().compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.supply()).collect::>(), - exit, - )?; - self.outputs_mut().compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.outputs()).collect::>(), - exit, - )?; - self.activity_mut().compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.activity_core()).collect::>(), - exit, - )?; - self.realized_mut().compute_from_stateful( - starting_lengths, - &others.iter().map(|v| v.realized_core()).collect::>(), - exit, - )?; - self.unrealized_core_mut().compute_from_stateful( - starting_lengths, - &others - .iter() - .map(|v| v.unrealized_core()) - .collect::>(), - exit, - )?; - Ok(()) - } -} +pub use supply::{SupplySources, SupplyVecs}; +pub use unrealized::{UnrealizedAggregateSources, UnrealizedSources, UnrealizedVecs}; diff --git a/crates/brk_computer/src/distribution/metrics/outputs/base.rs b/crates/brk_computer/src/distribution/metrics/outputs/base.rs deleted file mode 100644 index f54000c08..000000000 --- a/crates/brk_computer/src/distribution/metrics/outputs/base.rs +++ /dev/null @@ -1,117 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{PartsPerMillionSigned64, StoredI64, StoredU64, Version}; -use derive_more::{Deref, DerefMut}; -use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec}; - -use crate::{ - distribution::{ - metrics::ImportConfig, - state::{CohortState, CostBasisOps, RealizedOps}, - }, - internal::{PerBlockCumulativeRolling, PerBlockWithDeltas}, -}; - -/// Unspent output metrics. -#[derive(Traversable)] -pub struct OutputsUnspent { - pub unspent_count: PerBlockWithDeltas, -} - -impl OutputsUnspent { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - Ok(Self { - unspent_count: PerBlockWithDeltas::forced_import( - cfg.db, - &cfg.name("utxo_count"), - cfg.version, - Version::TWO, - cfg.indexes, - cfg.cached_starts, - )?, - }) - } - - pub(crate) fn min_len(&self) -> usize { - self.unspent_count.height.len() - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &CohortState) { - self.unspent_count - .height - .push(StoredU64::from(state.supply.utxo_count)); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - vec![&mut self.unspent_count.height as &mut dyn AnyStoredVec] - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - self.unspent_count.height.compute_sum_of_others( - starting_lengths.height, - &others - .iter() - .map(|v| &v.unspent_count.height) - .collect::>(), - exit, - )?; - Ok(()) - } -} - -/// Base output metrics: unspent and spent output counts. -#[derive(Deref, DerefMut, Traversable)] -pub struct OutputsBase { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub unspent: OutputsUnspent, - pub spent_count: PerBlockCumulativeRolling, -} - -impl OutputsBase { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - Ok(Self { - unspent: OutputsUnspent::forced_import(cfg)?, - spent_count: cfg.import("spent_utxo_count", v1)?, - }) - } - - pub(crate) fn min_len(&self) -> usize { - self.unspent.min_len().min(self.spent_count.block.len()) - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &CohortState) { - self.unspent.push_state(state); - self.spent_count - .push_block(StoredU64::from(state.spent_utxo_count)); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs = self.unspent.collect_vecs_mut(); - vecs.push(self.spent_count.stored_mut()); - vecs - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - let unspent: Vec<_> = others.iter().map(|v| &v.unspent).collect(); - self.unspent - .compute_from_stateful(starting_lengths, &unspent, exit)?; - sum_others!(self, starting_lengths, others, exit; spent_count.cumulative.height); - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/outputs/mod.rs b/crates/brk_computer/src/distribution/metrics/outputs/mod.rs index 69f9fbd6d..013c75afd 100644 --- a/crates/brk_computer/src/distribution/metrics/outputs/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/outputs/mod.rs @@ -1,3 +1,3 @@ -mod base; +mod vecs; -pub use base::{OutputsBase, OutputsUnspent}; +pub use vecs::OutputsVecs; diff --git a/crates/brk_computer/src/distribution/metrics/outputs/vecs/collection.rs b/crates/brk_computer/src/distribution/metrics/outputs/vecs/collection.rs new file mode 100644 index 000000000..ac9bb4ce3 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/outputs/vecs/collection.rs @@ -0,0 +1,63 @@ +use brk_cohort::AmountRange; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{StoredU64, Version}; +use vecdb::{AnyStoredVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::UTXORows, + indexes, + internal::{CachedWindowStartVec, Windows}, +}; + +use super::{SpentOutputCount, UnspentOutputCount}; + +#[derive(Traversable)] +pub struct OutputsVecs { + pub unspent_count: UnspentOutputCount, + pub spent_count: SpentOutputCount, +} + +impl OutputsVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + Ok(Self { + unspent_count: UnspentOutputCount::forced_import(db, version, indexes, cached_starts)?, + spent_count: SpentOutputCount::forced_import(db, version, indexes, cached_starts)?, + }) + } + + #[inline(always)] + pub(crate) fn push( + &mut self, + unspent_count: UTXORows, + spent_count: UTXORows, + ) { + self.unspent_count.matrices.push(unspent_count); + self.spent_count.cumulative.push_block(spent_count); + } + + #[inline(always)] + pub(crate) fn push_addr_balance(&mut self, row: AmountRange) { + self.unspent_count.push_addr_balance(row); + } + + pub(crate) fn min_len(&self) -> usize { + self.unspent_count + .matrices + .min_len() + .min(self.unspent_count.addr_balance.len()) + .min(self.spent_count.cumulative.min_len()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = self.unspent_count.matrices.collect_vecs_mut(); + vecs.push(self.unspent_count.addr_balance.stored_mut()); + vecs.extend(self.spent_count.cumulative.collect_vecs_mut()); + vecs + } +} diff --git a/crates/brk_computer/src/distribution/metrics/outputs/vecs/mod.rs b/crates/brk_computer/src/distribution/metrics/outputs/vecs/mod.rs new file mode 100644 index 000000000..13a0e7ff7 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/outputs/vecs/mod.rs @@ -0,0 +1,7 @@ +mod collection; +mod spent; +mod unspent; + +pub use collection::OutputsVecs; +pub(super) use spent::SpentOutputCount; +pub(super) use unspent::UnspentOutputCount; diff --git a/crates/brk_computer/src/distribution/metrics/outputs/vecs/spent.rs b/crates/brk_computer/src/distribution/metrics/outputs/vecs/spent.rs new file mode 100644 index 000000000..de8efb507 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/outputs/vecs/spent.rs @@ -0,0 +1,52 @@ +use brk_cohort::UTXOGroups; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{StoredU64, Version}; +use vecdb::{Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{CumulativeUTXOColumnarMetric, utxo_metric_name}, + indexes, + internal::{CachedWindowStartVec, LazyPerBlockCumulativeRolling, Windows}, +}; + +#[derive(Traversable)] +pub struct SpentOutputCount { + #[traversable(flatten)] + pub cohorts: UTXOGroups>, + #[traversable(flatten)] + pub cumulative: CumulativeUTXOColumnarMetric, +} + +impl SpentOutputCount { + pub(super) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let version = version + Version::ONE; + let cumulative = CumulativeUTXOColumnarMetric::forced_import( + db, + "spent_utxo_count_cumulative", + version, + )?; + let cohorts = UTXOGroups::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, "spent_utxo_count"); + LazyPerBlockCumulativeRolling::from_boxed_cumulative_source( + &name, + version, + cumulative + .matrices + .additive_source(&filter, &format!("{name}_cumulative"), version) + .expect("spent-output cohort source"), + cached_starts, + indexes, + ) + }); + Ok(Self { + cohorts, + cumulative, + }) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/outputs/vecs/unspent.rs b/crates/brk_computer/src/distribution/metrics/outputs/vecs/unspent.rs new file mode 100644 index 000000000..27f40846c --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/outputs/vecs/unspent.rs @@ -0,0 +1,75 @@ +use brk_cohort::{AmountRange, CohortContext, UTXOGroups}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{PartsPerMillionSigned64, StoredI64, StoredU64, Version}; +use vecdb::{Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{ColumnarAmount, UTXOColumnarMetric, utxo_metric_name}, + indexes, + internal::{CachedWindowStartVec, LazyPerBlockWithDeltas, Windows}, +}; + +#[derive(Traversable)] +pub struct UnspentOutputCount { + #[traversable(flatten)] + pub cohorts: UTXOGroups>, + #[traversable(flatten)] + pub matrices: UTXOColumnarMetric, + pub addr_balance: ColumnarAmount< + StoredU64, + LazyPerBlockWithDeltas, + M, + >, +} + +impl UnspentOutputCount { + pub(super) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let matrices = UTXOColumnarMetric::forced_import(db, "utxo_count", version)?; + let cohorts = UTXOGroups::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, "utxo_count"); + LazyPerBlockWithDeltas::from_boxed_height_source( + &name, + version, + matrices + .additive_source(&filter, &name, version) + .expect("unspent-output cohort source"), + Version::TWO, + indexes, + cached_starts, + ) + }); + let addr_balance = ColumnarAmount::forced_import( + db, + "addrs_utxo_count_by_balance_range", + CohortContext::Addr, + "utxo_count", + version + Version::ONE, + |name, source| { + LazyPerBlockWithDeltas::from_boxed_height_source( + name, + version + Version::ONE, + source, + Version::TWO, + indexes, + cached_starts, + ) + }, + )?; + Ok(Self { + cohorts, + matrices, + addr_balance, + }) + } + + #[inline(always)] + pub(crate) fn push_addr_balance(&mut self, row: AmountRange) { + self.addr_balance.push(row); + } +} diff --git a/crates/brk_computer/src/distribution/metrics/percentiles.rs b/crates/brk_computer/src/distribution/metrics/percentiles.rs new file mode 100644 index 000000000..a48006b47 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/percentiles.rs @@ -0,0 +1,66 @@ +use std::path::Path; + +use brk_cohort::{ByTerm, Filter, ProfitabilityRangeId, Term, UTXOAggregate}; +use brk_error::Result; +use brk_types::{Cents, Date, PartsPerMillion32}; +use vecdb::ColumnId; + +use crate::distribution::{ + metrics::{CohortMetrics, CostBasisBlockData}, + state::{PercentileResult, UTXOStates}, +}; + +impl CohortMetrics { + pub(crate) fn push_aggregate_percentiles( + &mut self, + states: &UTXOStates, + spot_price: Cents, + date: Option, + states_path: &Path, + ) -> Result<()> { + if states.fenwick().is_initialized() { + self.push_fenwick_results(states, spot_price); + } + if let Some(date) = date { + states.write_urpds(date, states_path, &Filter::Term(Term::Sth))?; + } + Ok(()) + } + + fn push_fenwick_results(&mut self, states: &UTXOStates, spot_price: Cents) { + let fenwick = states.fenwick(); + let (all_density, sth_density, lth_density) = fenwick.density(spot_price); + self.cost_basis.push(UTXOAggregate { + all: cost_basis_data(fenwick.percentiles_all(), all_density), + sth: cost_basis_data(fenwick.percentiles_sth(), sth_density), + lth: cost_basis_data(fenwick.percentiles_lth(), lth_density), + }); + + let profitability = fenwick.profitability(spot_price); + self.profitability.push( + spot_price, + ByTerm { + short: ProfitabilityRangeId::map_ref(&profitability, |row| row.supply.short), + long: ProfitabilityRangeId::map_ref(&profitability, |row| row.supply.long), + }, + ByTerm { + short: ProfitabilityRangeId::map_ref(&profitability, |row| row.realized_cap.short), + long: ProfitabilityRangeId::map_ref(&profitability, |row| row.realized_cap.long), + }, + ); + } +} + +#[inline(always)] +fn cost_basis_data( + percentiles: PercentileResult, + supply_density: PartsPerMillion32, +) -> CostBasisBlockData { + CostBasisBlockData { + min: percentiles.min_price, + max: percentiles.max_price, + per_coin: percentiles.sat_prices, + per_dollar: percentiles.usd_prices, + supply_density, + } +} diff --git a/crates/brk_computer/src/distribution/metrics/profitability.rs b/crates/brk_computer/src/distribution/metrics/profitability.rs deleted file mode 100644 index bf097068e..000000000 --- a/crates/brk_computer/src/distribution/metrics/profitability.rs +++ /dev/null @@ -1,446 +0,0 @@ -use brk_cohort::{ - Loss, PROFITABILITY_RANGE_COUNT, Profit, ProfitabilityId, ProfitabilityRange, ProfitabilityRow, -}; -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Bitcoin, Cents, Dollars, Height, PartsPerMillionSigned32, Sats, Version}; -use vecdb::{ - AnyStoredVec, AnyVec, CachedBoxedVec, ColumnId, ColumnarVec, Database, EagerVec, Exit, - ImportableVec, PcoVec, ReadOnlyClone, ReadOnlyColumnarVec, Rw, StorageMode, WritableVec, -}; - -use crate::{ - indexes, - internal::{ - CachedWindowStartVec, LazyColumnPerBlock, LazyColumnRatioPerBlock, - LazyColumnSpotValuePerBlock, LazyColumnSpotValuePerBlockWithDeltas, Windows, - }, - price, -}; - -#[derive(Clone, Traversable)] -pub struct WithSth { - pub all: All, - pub sth: Sth, -} - -#[derive(Clone, Traversable)] -pub struct ProfitabilityBucket { - pub supply: WithSth< - LazyColumnSpotValuePerBlockWithDeltas, - LazyColumnSpotValuePerBlock, - >, - pub realized_cap: WithSth< - LazyColumnPerBlock, - LazyColumnPerBlock, - >, - pub unrealized_pnl: WithSth< - LazyColumnPerBlock, - LazyColumnPerBlock, - >, - pub nupl: LazyColumnRatioPerBlock, -} - -struct ProfitabilitySources { - all_supply_sats: ReadOnlyColumnarVec, ProfitabilityId>, - sth_supply_sats: ReadOnlyColumnarVec, ProfitabilityId>, - all_realized_cap: ReadOnlyColumnarVec, ProfitabilityId>, - sth_realized_cap: ReadOnlyColumnarVec, ProfitabilityId>, - all_unrealized_pnl: ReadOnlyColumnarVec, ProfitabilityId>, - sth_unrealized_pnl: ReadOnlyColumnarVec, ProfitabilityId>, - nupl: ReadOnlyColumnarVec, ProfitabilityId>, -} - -impl ProfitabilityBucket { - fn new( - name: &str, - version: Version, - column: ProfitabilityId, - sources: &ProfitabilitySources, - indexes: &indexes::Vecs, - cached_starts: &Windows<&CachedWindowStartVec>, - spot_price: &CachedBoxedVec, - ) -> Self { - Self { - supply: WithSth { - all: LazyColumnSpotValuePerBlockWithDeltas::new( - &format!("{name}_supply"), - version, - &sources.all_supply_sats, - column, - indexes, - cached_starts, - spot_price, - ), - sth: LazyColumnSpotValuePerBlock::new( - &format!("{name}_sth_supply"), - version, - &sources.sth_supply_sats, - column, - indexes, - spot_price, - ), - }, - realized_cap: WithSth { - all: LazyColumnPerBlock::new( - &format!("{name}_realized_cap"), - version, - &sources.all_realized_cap, - column, - indexes, - ), - sth: LazyColumnPerBlock::new( - &format!("{name}_sth_realized_cap"), - version, - &sources.sth_realized_cap, - column, - indexes, - ), - }, - unrealized_pnl: WithSth { - all: LazyColumnPerBlock::new( - &format!("{name}_unrealized_pnl"), - version, - &sources.all_unrealized_pnl, - column, - indexes, - ), - sth: LazyColumnPerBlock::new( - &format!("{name}_sth_unrealized_pnl"), - version, - &sources.sth_unrealized_pnl, - column, - indexes, - ), - }, - nupl: LazyColumnRatioPerBlock::new( - &format!("{name}_nupl"), - version + Version::new(4), - &sources.nupl, - column, - indexes, - ), - } - } -} - -/// All profitability metrics: 25 ranges + 14 profit thresholds + 9 loss thresholds. -#[derive(Traversable)] -pub struct ProfitabilityMetrics { - pub range: ProfitabilityRange, - pub profit: Profit, - pub loss: Loss, - pub all_supply_sats: M::Stored, ProfitabilityId>>>, - pub sth_supply_sats: M::Stored, ProfitabilityId>>>, - pub all_realized_cap: - M::Stored, ProfitabilityId>>>, - pub sth_realized_cap: - M::Stored, ProfitabilityId>>>, - pub all_unrealized_pnl: - M::Stored, ProfitabilityId>>>, - pub sth_unrealized_pnl: - M::Stored, ProfitabilityId>>>, - pub nupl: - M::Stored, ProfitabilityId>>>, -} - -impl ProfitabilityMetrics { - pub fn iter(&self) -> impl Iterator { - self.range - .iter() - .chain(self.profit.iter()) - .chain(self.loss.iter()) - } - - pub fn iter_mut(&mut self) -> impl Iterator { - self.range - .iter_mut() - .chain(self.profit.iter_mut()) - .chain(self.loss.iter_mut()) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.all_supply_sats.len().min(self.all_realized_cap.len()) - } -} - -impl ProfitabilityMetrics { - pub(crate) fn forced_import( - db: &Database, - version: Version, - indexes: &indexes::Vecs, - cached_starts: &Windows<&CachedWindowStartVec>, - spot_price: &CachedBoxedVec, - ) -> Result { - let source_version = version + Version::TWO; - let all_supply_sats = - EagerVec::, ProfitabilityId>>::forced_import( - db, - "profitability_all_supply_sats", - source_version, - )?; - let sth_supply_sats = - EagerVec::, ProfitabilityId>>::forced_import( - db, - "profitability_sth_supply_sats", - source_version, - )?; - let all_realized_cap = - EagerVec::, ProfitabilityId>>::forced_import( - db, - "profitability_all_realized_cap", - source_version, - )?; - let sth_realized_cap = - EagerVec::, ProfitabilityId>>::forced_import( - db, - "profitability_sth_realized_cap", - source_version, - )?; - let all_unrealized_pnl = - EagerVec::, ProfitabilityId>>::forced_import( - db, - "profitability_all_unrealized_pnl", - source_version, - )?; - let sth_unrealized_pnl = - EagerVec::, ProfitabilityId>>::forced_import( - db, - "profitability_sth_unrealized_pnl", - source_version, - )?; - let nupl = EagerVec::, - ProfitabilityId, - >>::forced_import( - db, - "profitability_nupl_ppm", - source_version + Version::new(4), - )?; - - let sources = ProfitabilitySources { - all_supply_sats: all_supply_sats.read_only_clone(), - sth_supply_sats: sth_supply_sats.read_only_clone(), - all_realized_cap: all_realized_cap.read_only_clone(), - sth_realized_cap: sth_realized_cap.read_only_clone(), - all_unrealized_pnl: all_unrealized_pnl.read_only_clone(), - sth_unrealized_pnl: sth_unrealized_pnl.read_only_clone(), - nupl: nupl.read_only_clone(), - }; - - let range = ProfitabilityId::range_series(|column, name| { - ProfitabilityBucket::new( - name, - version, - column, - &sources, - indexes, - cached_starts, - spot_price, - ) - }); - - let aggregate_version = version + Version::TWO; - let profit = ProfitabilityId::profit_series(|column, name| { - ProfitabilityBucket::new( - name, - aggregate_version, - column, - &sources, - indexes, - cached_starts, - spot_price, - ) - }); - - let loss = ProfitabilityId::loss_series(|column, name| { - ProfitabilityBucket::new( - name, - aggregate_version, - column, - &sources, - indexes, - cached_starts, - spot_price, - ) - }); - - Ok(Self { - range, - profit, - loss, - all_supply_sats, - sth_supply_sats, - all_realized_cap, - sth_realized_cap, - all_unrealized_pnl, - sth_unrealized_pnl, - nupl, - }) - } - - #[inline(always)] - pub(crate) fn push_ranges( - &mut self, - all_supply_sats: [Sats; PROFITABILITY_RANGE_COUNT], - sth_supply_sats: [Sats; PROFITABILITY_RANGE_COUNT], - all_realized_cap: [Dollars; PROFITABILITY_RANGE_COUNT], - sth_realized_cap: [Dollars; PROFITABILITY_RANGE_COUNT], - ) { - self.all_supply_sats - .push(ProfitabilityRow::from_ranges(all_supply_sats)); - self.sth_supply_sats - .push(ProfitabilityRow::from_ranges(sth_supply_sats)); - self.all_realized_cap - .push(ProfitabilityRow::from_ranges(all_realized_cap)); - self.sth_realized_cap - .push(ProfitabilityRow::from_ranges(sth_realized_cap)); - } - - pub(crate) fn compute( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - let Self { - all_supply_sats, - sth_supply_sats, - all_realized_cap, - sth_realized_cap, - all_unrealized_pnl, - sth_unrealized_pnl, - nupl, - .. - } = self; - let max_from = starting_lengths.height; - - all_unrealized_pnl.compute_transform3( - max_from, - &prices.spot.cents.height, - all_realized_cap, - all_supply_sats, - |(height, spot, cap, supply, ..)| (height, unrealized_pnl_row(spot, cap, supply)), - exit, - )?; - sth_unrealized_pnl.compute_transform3( - max_from, - &prices.spot.cents.height, - sth_realized_cap, - sth_supply_sats, - |(height, spot, cap, supply, ..)| (height, unrealized_pnl_row(spot, cap, supply)), - exit, - )?; - nupl.compute_transform3( - max_from, - &prices.spot.cents.height, - all_realized_cap, - all_supply_sats, - |(height, spot, cap, supply, ..)| (height, nupl_row(spot, cap, supply)), - exit, - )?; - - Ok(()) - } - - pub(crate) fn collect_all_vecs_mut(&mut self) -> [&mut dyn AnyStoredVec; 7] { - [ - &mut self.all_supply_sats as &mut dyn AnyStoredVec, - &mut self.sth_supply_sats, - &mut self.all_realized_cap, - &mut self.sth_realized_cap, - &mut self.all_unrealized_pnl, - &mut self.sth_unrealized_pnl, - &mut self.nupl, - ] - } -} - -fn unrealized_pnl_row( - spot: Cents, - cap: ProfitabilityRow, - supply: ProfitabilityRow, -) -> ProfitabilityRow { - ProfitabilityId::from_fn(|column| { - let market_value = - f64::from(Dollars::from(spot)) * f64::from(Bitcoin::from(*column.get(&supply))); - let realized_cap = f64::from(*column.get(&cap)); - let pnl = if column.is_profit() { - market_value - realized_cap - } else { - realized_cap - market_value - } - .max(0.0); - Dollars::from(pnl) - }) -} - -fn nupl_row( - spot: Cents, - cap: ProfitabilityRow, - supply: ProfitabilityRow, -) -> ProfitabilityRow { - ProfitabilityId::from_fn(|column| { - let spot = spot.as_u128(); - let supply = column.get(&supply).as_u128(); - if spot == 0 || supply == 0 { - PartsPerMillionSigned32::ZERO - } else { - let realized_price = - Cents::from(*column.get(&cap)).as_u128() * Sats::ONE_BTC_U128 / supply; - PartsPerMillionSigned32::from((spot as f64 - realized_price as f64) / spot as f64) - } - }) -} - -#[cfg(test)] -mod tests { - use super::*; - use brk_cohort::PROFIT_COUNT; - - #[test] - fn expanded_profitability_thresholds_match_prefix_and_suffix_sums() { - let ranges = std::array::from_fn(|index| Sats::from(index as u64 + 1)); - let row = ProfitabilityRow::from_ranges(ranges); - let sum = |values: &[Sats]| { - values - .iter() - .copied() - .fold(Sats::default(), |total, value| total + value) - }; - - for (threshold, &column) in ProfitabilityId::profit_ids().iter().enumerate() { - assert_eq!( - *column.get(&row), - sum(&ranges[..PROFIT_COUNT + 1 - threshold]) - ); - } - for (threshold, &column) in ProfitabilityId::loss_ids().iter().enumerate() { - assert_eq!( - *column.get(&row), - sum(&ranges[PROFIT_COUNT + 1 + threshold..]) - ); - } - } - - #[test] - fn derived_rows_preserve_profit_and_loss_polarity() { - let supply = ProfitabilityId::from_fn(|_| Sats::ONE_BTC); - let cap = ProfitabilityId::from_fn(|column| { - Dollars::from(if column.is_profit() { 1.0 } else { 3.0 }) - }); - let spot = Cents::from(200_u64); - - let pnl = unrealized_pnl_row(spot, cap.clone(), supply.clone()); - let nupl = nupl_row(spot, cap, supply); - - for column in ProfitabilityId::ALL { - assert_eq!(*column.get(&pnl), Dollars::from(1.0)); - assert_eq!( - *column.get(&nupl), - PartsPerMillionSigned32::from(if column.is_profit() { 0.5 } else { -0.5 }) - ); - } - } -} diff --git a/crates/brk_computer/src/distribution/metrics/profitability/column_id.rs b/crates/brk_computer/src/distribution/metrics/profitability/column_id.rs new file mode 100644 index 000000000..fa68e67a4 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/profitability/column_id.rs @@ -0,0 +1,164 @@ +use std::ops::AddAssign; + +use brk_cohort::{ByTerm, ProfitabilityRange, ProfitabilityRangeId, TermId, UTXOAggregateId}; +use brk_types::{Height, Version}; +use vecdb::{ + ColumnId, PcoVec, PcoVecValue, ReadOnlyColumnarVec, ReadableBoxedVec, ReadableCloneableVec, + ReadableColumnarVec, VecValue, +}; + +const RANGE_COUNT: usize = ProfitabilityRangeId::ALL.len(); +const COLUMN_COUNT: usize = TermId::ALL.len() * RANGE_COUNT; + +const COLUMNS: [TermProfitabilityRangeId; COLUMN_COUNT] = { + let first = TermProfitabilityRangeId { + term: TermId::Short, + range: ProfitabilityRangeId::ALL[0], + }; + let mut columns = [first; COLUMN_COUNT]; + let mut term_index = 0; + while term_index < TermId::ALL.len() { + let mut range_index = 0; + while range_index < RANGE_COUNT { + columns[term_index * RANGE_COUNT + range_index] = TermProfitabilityRangeId { + term: TermId::ALL[term_index], + range: ProfitabilityRangeId::ALL[range_index], + }; + range_index += 1; + } + term_index += 1; + } + columns +}; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +pub struct TermProfitabilityRangeId { + term: TermId, + range: ProfitabilityRangeId, +} + +impl TermProfitabilityRangeId { + pub(super) fn source( + source: &ReadOnlyColumnarVec, Self>, + name: &str, + version: Version, + aggregate: UTXOAggregateId, + ranges: &[ProfitabilityRangeId], + ) -> ReadableBoxedVec + where + T: PcoVecValue + AddAssign, + { + if let (Some(term), [range]) = (aggregate.term(), ranges) { + return source + .column( + name, + version, + Self { + term, + range: *range, + }, + ) + .read_only_boxed_clone(); + } + + let selected_term = aggregate.term(); + source + .sum_columns( + name, + version, + TermId::ALL + .iter() + .copied() + .filter(move |&term| selected_term.is_none_or(|selected| selected == term)) + .flat_map(|term| { + ranges + .iter() + .copied() + .map(move |range| Self { term, range }) + }), + ) + .read_only_boxed_clone() + } +} + +impl ColumnId for TermProfitabilityRangeId { + type Row + = ByTerm> + where + T: VecValue; + + const VERSION: Version = Version::ONE; + const ALL: &'static [Self] = &COLUMNS; + + #[inline(always)] + fn index(self) -> usize { + self.term.index() * RANGE_COUNT + self.range.index() + } + + #[inline(always)] + fn get(self, row: &Self::Row) -> &T { + self.range.get(self.term.get(row)) + } + + #[inline(always)] + fn get_mut(self, row: &mut Self::Row) -> &mut T { + self.range.get_mut(self.term.get_mut(row)) + } + + fn from_fn(mut create: F) -> Self::Row + where + T: VecValue, + F: FnMut(Self) -> T, + { + ByTerm { + short: ProfitabilityRangeId::from_fn(|range| { + create(Self { + term: TermId::Short, + range, + }) + }), + long: ProfitabilityRangeId::from_fn(|range| { + create(Self { + term: TermId::Long, + range, + }) + }), + } + } + + fn map(row: Self::Row, mut map: F) -> Self::Row + where + T: VecValue, + U: VecValue, + F: FnMut(T) -> U, + { + ByTerm { + short: ProfitabilityRangeId::map(row.short, &mut map), + long: ProfitabilityRangeId::map(row.long, map), + } + } +} + +#[cfg(test)] +mod tests { + use brk_cohort::{ProfitabilityRangeId, TermId}; + use vecdb::ColumnId; + + use super::TermProfitabilityRangeId; + + #[test] + fn stores_short_then_long_ranges() { + let columns = TermProfitabilityRangeId::ALL; + let range_count = ProfitabilityRangeId::ALL.len(); + + assert_eq!(columns.len(), range_count * TermId::ALL.len()); + for (term_index, &term) in TermId::ALL.iter().enumerate() { + for (range_index, &range) in ProfitabilityRangeId::ALL.iter().enumerate() { + assert_eq!( + columns[term_index * range_count + range_index], + TermProfitabilityRangeId { term, range }, + ); + } + } + } +} diff --git a/crates/brk_computer/src/distribution/metrics/profitability/compute.rs b/crates/brk_computer/src/distribution/metrics/profitability/compute.rs new file mode 100644 index 000000000..8702859e2 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/profitability/compute.rs @@ -0,0 +1,134 @@ +use std::ops::Add; + +use brk_cohort::{ + ByTerm, ProfitabilityId, ProfitabilityRange, ProfitabilityRangeId, ProfitabilityRow, +}; +use brk_types::{Bitcoin, Cents, Dollars, PartsPerMillionSigned32, Sats}; +use vecdb::ColumnId; + +pub(super) fn sum_terms(rows: &ByTerm>) -> ProfitabilityRange +where + T: Add + Copy, +{ + ProfitabilityRange::from_fn(|range| *range.select(&rows.short) + *range.select(&rows.long)) +} + +pub(super) fn unrealized_pnl_rows( + spot: Cents, + cap: &ByTerm>, + supply: &ByTerm>, +) -> ByTerm> { + ByTerm { + short: unrealized_pnl_row(spot, &cap.short, &supply.short), + long: unrealized_pnl_row(spot, &cap.long, &supply.long), + } +} + +fn unrealized_pnl_row( + spot: Cents, + cap: &ProfitabilityRange, + supply: &ProfitabilityRange, +) -> ProfitabilityRange { + ProfitabilityRangeId::from_fn(|column| { + let market_value = + f64::from(Dollars::from(spot)) * f64::from(Bitcoin::from(*column.get(supply))); + let realized_cap = f64::from(*column.get(cap)); + let pnl = if column.is_profit() { + market_value - realized_cap + } else { + realized_cap - market_value + } + .max(0.0); + Dollars::from(pnl) + }) +} + +pub(super) fn nupl_row( + spot: Cents, + cap: &ProfitabilityRange, + supply: &ProfitabilityRange, +) -> ProfitabilityRow { + let cap = ProfitabilityRow::from_ranges(cap.clone()); + let supply = ProfitabilityRow::from_ranges(supply.clone()); + ProfitabilityId::from_fn(|column| { + let spot = spot.as_u128(); + let supply = column.get(&supply).as_u128(); + if spot == 0 || supply == 0 { + PartsPerMillionSigned32::ZERO + } else { + let realized_price = + Cents::from(*column.get(&cap)).as_u128() * Sats::ONE_BTC_U128 / supply; + PartsPerMillionSigned32::from((spot as f64 - realized_price as f64) / spot as f64) + } + }) +} + +#[cfg(test)] +mod tests { + use brk_cohort::{ + ByTerm, PROFIT_COUNT, ProfitabilityId, ProfitabilityRangeId, ProfitabilityRow, + }; + use brk_types::{Cents, Dollars, PartsPerMillionSigned32, Sats}; + use vecdb::ColumnId; + + use super::{nupl_row, sum_terms, unrealized_pnl_rows}; + + #[test] + fn expanded_thresholds_match_prefix_and_suffix_sums() { + let ranges = ProfitabilityRangeId::from_fn(|id| Sats::from(id.index() as u64 + 1)); + let row = ProfitabilityRow::from_ranges(ranges.clone()); + let sum = |values: &[Sats]| { + values + .iter() + .copied() + .fold(Sats::default(), |total, value| total + value) + }; + + let ranges: Vec<_> = ranges.iter().copied().collect(); + for (threshold, &column) in ProfitabilityId::profit_ids().iter().enumerate() { + assert_eq!( + *column.get(&row), + sum(&ranges[..PROFIT_COUNT + 1 - threshold]) + ); + } + for (threshold, &column) in ProfitabilityId::loss_ids().iter().enumerate() { + assert_eq!( + *column.get(&row), + sum(&ranges[PROFIT_COUNT + 1 + threshold..]) + ); + } + } + + #[test] + fn derived_rows_preserve_profit_and_loss_polarity() { + let supply = ProfitabilityRangeId::from_fn(|_| Sats::ONE_BTC); + let cap = ProfitabilityRangeId::from_fn(|column| { + Dollars::from(if column.is_profit() { 1.0 } else { 3.0 }) + }); + let spot = Cents::from(200_u64); + + let cap = ByTerm { + short: cap.clone(), + long: cap.clone(), + }; + let supply = ByTerm { + short: supply.clone(), + long: supply.clone(), + }; + let pnl = unrealized_pnl_rows(spot, &cap, &supply); + let all_cap = sum_terms(&cap); + let all_supply = sum_terms(&supply); + let nupl = nupl_row(spot, &all_cap, &all_supply); + + for column in ProfitabilityRangeId::ALL { + assert_eq!(*column.get(&pnl.short), Dollars::from(1.0)); + assert_eq!(*column.get(&pnl.long), Dollars::from(1.0)); + } + for column in ProfitabilityId::ALL { + assert_eq!( + *column.get(&nupl), + PartsPerMillionSigned32::from(if column.is_profit() { 0.5 } else { -0.5 }) + ); + } + } +} diff --git a/crates/brk_computer/src/distribution/metrics/profitability/mod.rs b/crates/brk_computer/src/distribution/metrics/profitability/mod.rs new file mode 100644 index 000000000..67ece38e3 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/profitability/mod.rs @@ -0,0 +1,7 @@ +mod column_id; +mod compute; +mod vecs; + +pub use vecs::ProfitabilityVecs; + +use column_id::TermProfitabilityRangeId; diff --git a/crates/brk_computer/src/distribution/metrics/profitability/vecs.rs b/crates/brk_computer/src/distribution/metrics/profitability/vecs.rs new file mode 100644 index 000000000..38be0a34d --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/profitability/vecs.rs @@ -0,0 +1,198 @@ +use std::ops::AddAssign; + +use brk_cohort::{ + ByTerm, ProfitabilityId, ProfitabilityRange, ProfitabilityRow, UTXOAggregate, UTXOAggregateId, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Dollars, Height, PartsPerMillionSigned32, Sats, Version}; +use vecdb::{ + AnyStoredVec, AnyVec, CachedBoxedVec, Database, PcoVec, PcoVecValue, ReadOnlyColumnarVec, + ReadableBoxedVec, Rw, StorageMode, +}; + +use crate::{ + indexes, + internal::{ + CachedWindowStartVec, ColumnarPerBlock, Identity, LazyColumnRatioPerBlock, LazyPerBlock, + LazySpotValuePerBlockWithDeltas, Windows, + }, +}; + +use super::{ + TermProfitabilityRangeId, + compute::{nupl_row, sum_terms, unrealized_pnl_rows}, +}; + +const VERSION: Version = Version::new(7); + +#[derive(Traversable)] +pub struct ProfitabilityVecs { + pub supply: ColumnarPerBlock< + Sats, + TermProfitabilityRangeId, + ProfitabilityRow>, + M, + >, + pub realized_cap: ColumnarPerBlock< + Dollars, + TermProfitabilityRangeId, + ProfitabilityRow>>, + M, + >, + pub unrealized_pnl: ColumnarPerBlock< + Dollars, + TermProfitabilityRangeId, + ProfitabilityRow>>, + M, + >, + pub nupl: ColumnarPerBlock< + PartsPerMillionSigned32, + ProfitabilityId, + ProfitabilityRow>, + M, + >, +} + +impl ProfitabilityVecs { + pub(crate) fn min_stateful_len(&self) -> usize { + self.supply + .height + .len() + .min(self.realized_cap.height.len()) + .min(self.unrealized_pnl.height.len()) + .min(self.nupl.height.len()) + } +} + +impl ProfitabilityVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + spot_price: &CachedBoxedVec, + ) -> Result { + let version = version + VERSION; + let supply = ColumnarPerBlock::forced_import( + db, + "profitability_supply_sats_by_term_and_range", + version, + |source| { + Self::series(source, "supply", version, |name, source| { + LazySpotValuePerBlockWithDeltas::from_boxed_sats_source( + name, + version, + source, + indexes, + cached_starts, + spot_price, + ) + }) + }, + )?; + let realized_cap = ColumnarPerBlock::forced_import( + db, + "profitability_realized_cap_by_term_and_range", + version, + |source| { + Self::series(source, "realized_cap", version, |name, source| { + LazyPerBlock::from_uncached_boxed_height_source::>( + name, version, source, indexes, + ) + }) + }, + )?; + let unrealized_pnl = ColumnarPerBlock::forced_import( + db, + "profitability_unrealized_pnl_by_term_and_range", + version, + |source| { + Self::series(source, "unrealized_pnl", version, |name, source| { + LazyPerBlock::from_uncached_boxed_height_source::>( + name, version, source, indexes, + ) + }) + }, + )?; + let nupl = + ColumnarPerBlock::forced_import(db, "profitability_nupl_ppm", version, |source| { + ProfitabilityId::series(|column, name| { + LazyColumnRatioPerBlock::new( + &format!("{name}_nupl"), + version, + source, + column, + indexes, + ) + }) + })?; + + Ok(Self { + supply, + realized_cap, + unrealized_pnl, + nupl, + }) + } + + fn series( + source: &ReadOnlyColumnarVec, TermProfitabilityRangeId>, + metric: &str, + version: Version, + mut build: impl FnMut(&str, ReadableBoxedVec) -> S, + ) -> ProfitabilityRow> + where + T: PcoVecValue + AddAssign, + { + ProfitabilityId::series(|column, cohort_name| { + UTXOAggregate::from_fn(|aggregate| { + let name = Self::metric_name(cohort_name, aggregate, metric); + let source = TermProfitabilityRangeId::source( + source, + &format!("{name}_source"), + version, + aggregate, + column.ranges(), + ); + build(&name, source) + }) + }) + } + + fn metric_name(cohort: &str, aggregate: UTXOAggregateId, metric: &str) -> String { + match aggregate { + UTXOAggregateId::All => format!("{cohort}_{metric}"), + UTXOAggregateId::Sth | UTXOAggregateId::Lth => { + format!("{cohort}_{}_{metric}", aggregate.cohort_name().id) + } + } + } + + #[inline(always)] + pub(crate) fn push( + &mut self, + spot: Cents, + supply: ByTerm>, + realized_cap: ByTerm>, + ) { + let all_supply = sum_terms(&supply); + let all_realized_cap = sum_terms(&realized_cap); + let unrealized_pnl = unrealized_pnl_rows(spot, &realized_cap, &supply); + let nupl = nupl_row(spot, &all_realized_cap, &all_supply); + + self.supply.push(supply); + self.realized_cap.push(realized_cap); + self.unrealized_pnl.push(unrealized_pnl); + self.nupl.push(nupl); + } + + pub(crate) fn collect_all_vecs_mut(&mut self) -> [&mut dyn AnyStoredVec; 4] { + [ + self.supply.stored_mut(), + self.realized_cap.stored_mut(), + self.unrealized_pnl.stored_mut(), + self.nupl.stored_mut(), + ] + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/adjusted.rs b/crates/brk_computer/src/distribution/metrics/realized/adjusted.rs index 7b4a8078f..7da8a2d25 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/adjusted.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/adjusted.rs @@ -1,63 +1,230 @@ +use brk_cohort::{Filter, TERM_NAMES, Term, UTXO_ALL_NAME, UTXOAllAndSth, UTXOAllAndSthId}; use brk_error::Result; -use brk_indexer::Lengths; use brk_traversable::Traversable; use brk_types::{Cents, Height, StoredF64, Version}; -use vecdb::{BinaryTransform, Exit, ReadableVec, Rw, StorageMode}; - -use crate::{ - distribution::metrics::ImportConfig, - internal::{ColumnarRollingWindows, PerBlockCumulativeRolling, RatioCents64}, +use vecdb::{ + AnyStoredVec, AnyVec, BinaryTransform, ColumnId, Database, Exit, ReadableVec, Rw, StorageMode, }; +use crate::{ + distribution::metrics::utxo_metric_name, + indexes, + internal::{ + CachedWindowStartVec, ColumnarPerBlockCumulativeRolling, ColumnarRollingWindows, + LazyColumnPerBlockCumulativeRolling, RatioCents64, Windows, + }, +}; + +use super::AdjustedSoprComputeSource; + #[derive(Traversable)] -pub struct AdjustedSopr { - pub ratio: ColumnarRollingWindows, - pub transfer_volume: PerBlockCumulativeRolling, - pub value_destroyed: PerBlockCumulativeRolling, +pub struct AdjustedSoprVecs { + pub ratio: UTXOAllAndSth>, + pub transfer_volume: ColumnarPerBlockCumulativeRolling< + Cents, + UTXOAllAndSthId, + UTXOAllAndSth>, + M, + >, + pub value_destroyed: ColumnarPerBlockCumulativeRolling< + Cents, + UTXOAllAndSthId, + UTXOAllAndSth>, + M, + >, } -impl AdjustedSopr { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { +impl AdjustedSoprVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let transfer_volume = Self::import_cumulative( + db, + "adjusted_sopr_transfer_volume_cumulative_by_cohort", + "adj_value_created", + version, + indexes, + cached_starts, + )?; + let value_destroyed = Self::import_cumulative( + db, + "adjusted_sopr_value_destroyed_cumulative_by_cohort", + "adj_value_destroyed", + version, + indexes, + cached_starts, + )?; + let ratio = UTXOAllAndSth { + all: ColumnarRollingWindows::forced_import( + db, + "asopr", + Self::cohort_version(version, UTXOAllAndSthId::All), + indexes, + )?, + sth: ColumnarRollingWindows::forced_import( + db, + &Self::cohort_metric_name(UTXOAllAndSthId::Sth, "asopr"), + Self::cohort_version(version, UTXOAllAndSthId::Sth), + indexes, + )?, + }; + Ok(Self { - ratio: cfg.import("asopr", Version::ONE)?, - transfer_volume: cfg.import("adj_value_created", Version::ONE)?, - value_destroyed: cfg.import("adj_value_destroyed", Version::ONE)?, + ratio, + transfer_volume, + value_destroyed, }) } - #[allow(clippy::too_many_arguments)] - pub(crate) fn compute_rest_part2( + fn import_cumulative( + db: &Database, + matrix_name: &str, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result< + ColumnarPerBlockCumulativeRolling< + Cents, + UTXOAllAndSthId, + UTXOAllAndSth>, + >, + > { + ColumnarPerBlockCumulativeRolling::forced_import( + db, + matrix_name, + version + Version::ONE, + |source| UTXOAllAndSth { + all: LazyColumnPerBlockCumulativeRolling::new( + metric, + Self::cohort_version(version, UTXOAllAndSthId::All), + source, + UTXOAllAndSthId::All, + indexes, + cached_starts, + ), + sth: LazyColumnPerBlockCumulativeRolling::new( + &Self::cohort_metric_name(UTXOAllAndSthId::Sth, metric), + Self::cohort_version(version, UTXOAllAndSthId::Sth), + source, + UTXOAllAndSthId::Sth, + indexes, + cached_starts, + ), + }, + ) + } + + fn cohort_metric_name(id: UTXOAllAndSthId, metric: &str) -> String { + match id { + UTXOAllAndSthId::All => utxo_metric_name(&Filter::All, UTXO_ALL_NAME.id, metric), + UTXOAllAndSthId::Sth => { + utxo_metric_name(&Filter::Term(Term::Sth), TERM_NAMES.short.id, metric) + } + } + } + + fn cohort_version(base: Version, id: UTXOAllAndSthId) -> Version { + base + Version::ONE + + if matches!(id, UTXOAllAndSthId::All) { + Version::ONE + } else { + Version::ZERO + } + } + + pub(crate) fn compute( &mut self, - starting_lengths: &Lengths, - base_transfer_volume: &impl ReadableVec, - base_value_destroyed: &impl ReadableVec, - under_1h_transfer_volume: &impl ReadableVec, - under_1h_value_destroyed: &impl ReadableVec, + max_from: Height, + sources: &UTXOAllAndSth, + under_1h_transfer_volume: &V1, + under_1h_value_destroyed: &V2, exit: &Exit, - ) -> Result<()> { - self.transfer_volume.cumulative.height.compute_subtract( - starting_lengths.height, - base_transfer_volume, - under_1h_transfer_volume, + ) -> Result<()> + where + V1: ReadableVec, + V2: ReadableVec, + { + self.transfer_volume.compute_columns2( + max_from, + |id| { + &id.select(sources) + .activity + .transfer_volume + .cumulative + .cents + .height + }, + |_| under_1h_transfer_volume, + |_, base, under_1h| base - under_1h, exit, )?; - self.value_destroyed.cumulative.height.compute_subtract( - starting_lengths.height, - base_value_destroyed, - under_1h_value_destroyed, + self.value_destroyed.compute_columns2( + max_from, + |id| { + &id.select(sources) + .realized + .value_destroyed + .cumulative + .cents + .height + }, + |_| under_1h_value_destroyed, + |_, base, under_1h| base - under_1h, exit, )?; - self.ratio.compute_columns2( - starting_lengths.height, - |window| &window.select(&self.transfer_volume.sum).height, - |window| &window.select(&self.value_destroyed.sum).height, - |_, transfer_volume, value_destroyed| { - RatioCents64::apply(transfer_volume, value_destroyed) - }, - exit, - )?; + let Self { + ratio, + transfer_volume, + value_destroyed, + } = self; + for id in UTXOAllAndSthId::ALL { + id.select_mut(ratio).compute_columns2( + max_from, + |window| { + &window + .select(&id.select(&transfer_volume.series).sum) + .height + }, + |window| { + &window + .select(&id.select(&value_destroyed.series).sum) + .height + }, + |_, transfer_volume, value_destroyed| { + RatioCents64::apply(transfer_volume, value_destroyed) + }, + exit, + )?; + } Ok(()) } + + pub(crate) fn min_len(&self) -> usize { + self.transfer_volume + .cumulative + .len() + .min(self.value_destroyed.cumulative.len()) + .min( + self.ratio + .iter() + .map(|value| value.height.len()) + .min() + .unwrap_or_default(), + ) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = vec![ + self.transfer_volume.stored_mut(), + self.value_destroyed.stored_mut(), + ]; + vecs.extend(self.ratio.iter_mut().map(|value| value.stored_mut())); + vecs + } } diff --git a/crates/brk_computer/src/distribution/metrics/realized/adjusted_sopr_compute_source.rs b/crates/brk_computer/src/distribution/metrics/realized/adjusted_sopr_compute_source.rs new file mode 100644 index 000000000..cfcf660e9 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/adjusted_sopr_compute_source.rs @@ -0,0 +1,6 @@ +use crate::distribution::metrics::{ActivitySources, RealizedSources}; + +pub(crate) struct AdjustedSoprComputeSource { + pub activity: ActivitySources, + pub realized: RealizedSources, +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/aggregate_sources.rs b/crates/brk_computer/src/distribution/metrics/realized/aggregate_sources.rs new file mode 100644 index 000000000..a54808a26 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/aggregate_sources.rs @@ -0,0 +1,6 @@ +use crate::distribution::metrics::{ActivitySources, RealizedSources}; + +pub(crate) struct RealizedAggregateSources { + pub activity: ActivitySources, + pub realized: RealizedSources, +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/aggregate_state.rs b/crates/brk_computer/src/distribution/metrics/realized/aggregate_state.rs new file mode 100644 index 000000000..04a85e6ce --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/aggregate_state.rs @@ -0,0 +1,37 @@ +use brk_types::{Cents, CentsSats, CentsSquaredSats}; + +use crate::distribution::state::{RealizedOps, RealizedState}; + +#[derive(Default)] +pub struct RealizedAggregateState { + pub(crate) cap_raw: CentsSats, + pub(crate) capitalized_cap_raw: CentsSquaredSats, + peak_regret: CentsSats, + gross_pnl: Cents, +} + +impl RealizedAggregateState { + pub(crate) fn add(&mut self, state: &RealizedState) { + self.cap_raw += state.cap_raw(); + self.capitalized_cap_raw += state.capitalized_cap_raw(); + self.peak_regret += CentsSats::new(state.peak_regret_raw()); + self.gross_pnl += state.profit() + state.loss(); + } + + pub(crate) fn peak_regret(&self) -> Cents { + self.peak_regret.to_cents() + } + + pub(crate) fn capitalized_price(&self) -> Cents { + let cap = self.cap_raw.as_u128(); + self.capitalized_cap_raw + .inner() + .checked_div(cap) + .map(|price| Cents::new(price as u64)) + .unwrap_or_default() + } + + pub(crate) fn gross_pnl(&self) -> Cents { + self.gross_pnl + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/block_data.rs b/crates/brk_computer/src/distribution/metrics/realized/block_data.rs new file mode 100644 index 000000000..d9373b839 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/block_data.rs @@ -0,0 +1,24 @@ +use brk_types::{Cents, CentsSats, CentsSigned, Sats}; + +use super::RealizedTotals; + +#[derive(Clone, Default)] +pub(crate) struct RealizedBlockData { + pub cap_raw: CentsSats, + pub supply: Sats, + pub cap: Cents, + pub price: Cents, + pub profit: Cents, + pub loss: Cents, + pub net_pnl: CentsSigned, + pub value_destroyed: Cents, +} + +impl RealizedBlockData { + pub(crate) fn totals(&self) -> RealizedTotals { + RealizedTotals { + cap_raw: self.cap_raw, + supply: self.supply, + } + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/core.rs b/crates/brk_computer/src/distribution/metrics/realized/core.rs deleted file mode 100644 index 1504fa097..000000000 --- a/crates/brk_computer/src/distribution/metrics/realized/core.rs +++ /dev/null @@ -1,177 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{ - Bitcoin, Cents, CentsSigned, Dollars, Height, PartsPerMillionSigned64, StoredF64, Version, -}; -use derive_more::{Deref, DerefMut}; -use vecdb::{AnyStoredVec, Exit, LazyVec, ReadableCloneableVec, ReadableVec, Rw, StorageMode}; - -use crate::{ - distribution::state::{CohortState, CostBasisOps, RealizedOps}, - internal::{ - FiatPerBlockCumulativeWithSumsAndDeltas, LazyPerBlock, NegCentsUnsignedToDollars, - PerBlockCumulativeRolling, RatioCents64, RollingWindow24hPerBlock, Windows, - }, - price, -}; - -use crate::distribution::metrics::ImportConfig; - -use super::RealizedMinimal; - -#[derive(Clone, Traversable)] -pub struct NegRealizedLoss { - #[traversable(flatten)] - pub base: LazyVec, - pub sum: Windows>, -} - -#[derive(Traversable)] -pub struct RealizedSoprCore { - pub value_destroyed: PerBlockCumulativeRolling, - pub ratio: RollingWindow24hPerBlock, -} - -#[derive(Deref, DerefMut, Traversable)] -pub struct RealizedCore { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub minimal: RealizedMinimal, - - #[traversable(wrap = "loss", rename = "negative")] - pub neg_loss: NegRealizedLoss, - pub net_pnl: FiatPerBlockCumulativeWithSumsAndDeltas< - CentsSigned, - CentsSigned, - PartsPerMillionSigned64, - M, - >, - pub sopr: RealizedSoprCore, -} - -impl RealizedCore { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - - let minimal = RealizedMinimal::forced_import(cfg)?; - - let neg_loss_base = LazyVec::transformed::( - &cfg.name("realized_loss_neg"), - cfg.version + Version::ONE, - minimal.loss.block.cents.read_only_boxed_clone(), - ); - - let neg_loss_sum = minimal.loss.sum.0.map_with_suffix(|suffix, slot| { - LazyPerBlock::from_height_source::( - &cfg.name(&format!("realized_loss_neg_sum_{suffix}")), - cfg.version + Version::ONE, - slot.cents.height.clone(), - cfg.indexes, - ) - }); - - let neg_loss = NegRealizedLoss { - base: neg_loss_base, - sum: neg_loss_sum, - }; - - let net_pnl = FiatPerBlockCumulativeWithSumsAndDeltas::forced_import( - cfg.db, - &cfg.name("net_realized_pnl"), - cfg.version + v1, - Version::new(5), - cfg.indexes, - cfg.cached_starts, - )?; - - let value_destroyed = PerBlockCumulativeRolling::forced_import( - cfg.db, - &cfg.name("value_destroyed"), - cfg.version + v1, - cfg.indexes, - cfg.cached_starts, - )?; - - Ok(Self { - minimal, - neg_loss, - net_pnl, - sopr: RealizedSoprCore { - value_destroyed, - ratio: cfg.import("sopr", v1)?, - }, - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.minimal.min_stateful_len() - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &CohortState) { - self.minimal.push_state(state); - self.sopr - .value_destroyed - .push_block(state.realized.value_destroyed()); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs = self.minimal.collect_vecs_mut(); - vecs.push(self.sopr.value_destroyed.stored_mut()); - vecs - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - let minimal_refs: Vec<&RealizedMinimal> = others.iter().map(|o| &o.minimal).collect(); - self.minimal - .compute_from_stateful(starting_lengths, &minimal_refs, exit)?; - - sum_others!(self, starting_lengths, others, exit; sopr.value_destroyed.cumulative.height); - Ok(()) - } - - pub(crate) fn compute_rest_part1( - &mut self, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.net_pnl.compute_from_cumulative_pair( - starting_lengths.height, - &self.minimal.profit.cumulative.cents.height, - &self.minimal.loss.cumulative.cents.height, - |_, profit, loss| CentsSigned::new(profit.inner() as i64 - loss.inner() as i64), - exit, - ) - } - - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - height_to_supply: &impl ReadableVec, - transfer_volume_sum_24h_cents: &impl ReadableVec, - exit: &Exit, - ) -> Result<()> { - self.minimal - .compute_rest_part2(prices, starting_lengths, height_to_supply, exit)?; - - self.sopr - .ratio - ._24h - .compute_binary::( - starting_lengths.height, - transfer_volume_sum_24h_cents, - &self.sopr.value_destroyed.sum._24h.height, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/realized/full.rs b/crates/brk_computer/src/distribution/metrics/realized/full.rs deleted file mode 100644 index 3ec6371f2..000000000 --- a/crates/brk_computer/src/distribution/metrics/realized/full.rs +++ /dev/null @@ -1,352 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{ - Bitcoin, Cents, CentsSats, CentsSigned, CentsSquaredSats, Height, PartsPerMillion32, - PartsPerMillion64, PartsPerMillionSigned64, StoredF64, Version, -}; -use derive_more::{Deref, DerefMut}; -use vecdb::{ - AnyStoredVec, AnyVec, BinaryTransform, BytesVec, Exit, ReadableVec, Rw, StorageMode, - WritableVec, -}; - -use crate::{ - distribution::AllChainCache, - distribution::state::{CohortState, CostBasisData, RealizedState, WithCapital}, - internal::{ - ColumnarPercentRollingWindows, ColumnarRollingWindows, ColumnarRollingWindowsFrom1w, - FiatPerBlockCumulativeWithSums, LazyPercentPerBlock, PercentPerBlock, - PriceWithRatioPerBlock, RatioCents, RatioCents64, RatioCentsSignedCents, - ValuePerBlockCumulativeRolling, - }, - price, -}; - -use crate::distribution::metrics::ImportConfig; - -use super::RealizedCore; - -#[derive(Traversable)] -pub struct RealizedNetPnl { - #[traversable(wrap = "change_1m", rename = "to_rcap")] - pub change_1m_to_rcap: PercentPerBlock, - #[traversable(wrap = "change_1m", rename = "to_mcap")] - pub change_1m_to_mcap: LazyPercentPerBlock, -} - -#[derive(Traversable)] -pub struct RealizedSopr { - #[traversable(rename = "ratio")] - pub ratio_extended: ColumnarRollingWindowsFrom1w, -} - -#[derive(Traversable)] -pub struct RealizedPeakRegret { - #[traversable(flatten)] - pub value: FiatPerBlockCumulativeWithSums, -} - -#[derive(Traversable)] -pub struct RealizedCapitalized { - pub price: PriceWithRatioPerBlock, - #[traversable(hidden)] - cap_raw: M::Stored>, -} - -#[derive(Deref, DerefMut, Traversable)] -pub struct RealizedFull { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub core: RealizedCore, - - #[traversable(wrap = "cap", rename = "to_own_mcap")] - pub cap_to_own_mcap: LazyPercentPerBlock, - pub gross_pnl: FiatPerBlockCumulativeWithSums, - pub sell_side_risk_ratio: ColumnarPercentRollingWindows, - pub net_pnl: RealizedNetPnl, - pub sopr: RealizedSopr, - pub peak_regret: RealizedPeakRegret, - pub capitalized: RealizedCapitalized, - - pub profit_to_loss_ratio: ColumnarRollingWindows, - - #[traversable(hidden)] - cap_raw: M::Stored>, -} - -impl RealizedFull { - pub(crate) fn forced_import(cfg: &ImportConfig, all_chain: &AllChainCache) -> Result { - let v0 = Version::ZERO; - let v1 = Version::ONE; - - let core = RealizedCore::forced_import(cfg)?; - let cap_to_own_mcap = LazyPercentPerBlock::from_indexed_source( - &cfg.name("realized_cap_to_own_mcap"), - cfg.version + Version::TWO, - &core.minimal.price.ppm.height, - mvrv_to_realized_cap_ratio, - cfg.indexes, - ); - - // Gross PnL - let gross_pnl: FiatPerBlockCumulativeWithSums = - cfg.import("realized_gross_pnl", v1)?; - let sell_side_risk_ratio = cfg.import("sell_side_risk_ratio", Version::new(2))?; - - // Net PnL - let mcap_name = cfg.name("net_pnl_change_1m_to_mcap"); - let mcap_version = Version::new(5); - let mcap_source = all_chain.with_market_cap( - &format!("{mcap_name}_ppm_source"), - mcap_version, - &core.net_pnl.delta.absolute._1m.cents.height, - |_, net_pnl, market_cap| Self::net_pnl_to_market_cap(net_pnl, market_cap), - ); - let net_pnl = RealizedNetPnl { - change_1m_to_rcap: cfg.import("net_pnl_change_1m_to_rcap", Version::new(5))?, - change_1m_to_mcap: LazyPercentPerBlock::from_uncached_height_source( - &mcap_name, - mcap_version, - mcap_source, - cfg.indexes, - ), - }; - - // SOPR - let sopr = RealizedSopr { - ratio_extended: cfg.import("sopr", v1)?, - }; - - // Peak regret - let peak_regret = RealizedPeakRegret { - value: cfg.import("realized_peak_regret", Version::new(3))?, - }; - - // Capitalized - let capitalized = RealizedCapitalized { - price: cfg.import("capitalized_price", v0)?, - cap_raw: cfg.import("capitalized_cap_raw", v0)?, - }; - - Ok(Self { - core, - cap_to_own_mcap, - gross_pnl, - sell_side_risk_ratio, - net_pnl, - sopr, - peak_regret, - capitalized, - profit_to_loss_ratio: cfg.import("realized_profit_to_loss_ratio", v1)?, - cap_raw: cfg.import("cap_raw", v0)?, - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.capitalized - .price - .cents - .height - .len() - .min(self.cap_raw.len()) - .min(self.capitalized.cap_raw.len()) - .min(self.peak_regret.value.cumulative.cents.height.len()) - } - - fn net_pnl_to_market_cap(net_pnl: CentsSigned, market_cap: Cents) -> PartsPerMillionSigned64 { - let market_cap = f64::from(market_cap); - if market_cap > 0.0 { - PartsPerMillionSigned64::from(net_pnl.inner() as f64 / market_cap) - } else { - PartsPerMillionSigned64::default() - } - } - - #[inline(always)] - pub(crate) fn push_state( - &mut self, - state: &CohortState>, - ) { - self.core.push_state(state); - self.capitalized - .price - .cents - .height - .push(state.realized.capitalized_price()); - self.cap_raw.push(state.realized.cap_raw()); - self.capitalized - .cap_raw - .push(state.realized.capitalized_cap_raw()); - self.peak_regret - .value - .push_block(state.realized.peak_regret()); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs = self.core.collect_vecs_mut(); - vecs.push(&mut self.capitalized.price.cents.height); - vecs.push(&mut self.cap_raw as &mut dyn AnyStoredVec); - vecs.push(&mut self.capitalized.cap_raw as &mut dyn AnyStoredVec); - vecs.push(self.peak_regret.value.stored_mut()); - vecs - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&RealizedCore], - exit: &Exit, - ) -> Result<()> { - self.core - .compute_from_stateful(starting_lengths, others, exit) - } - - #[inline(always)] - pub(crate) fn push_accum(&mut self, accum: &RealizedFullAccum) -> Cents { - self.cap_raw.push(accum.cap_raw); - self.capitalized.cap_raw.push(accum.capitalized_cap_raw); - - let capitalized_price = { - let cap = accum.cap_raw.as_u128(); - if cap == 0 { - Cents::ZERO - } else { - Cents::new((accum.capitalized_cap_raw / cap) as u64) - } - }; - self.capitalized.price.cents.height.push(capitalized_price); - - self.peak_regret.value.push_block(accum.peak_regret()); - - capitalized_price - } - - pub(crate) fn compute_rest_part1( - &mut self, - starting_lengths: &Lengths, - exit: &Exit, - ) -> Result<()> { - self.core.compute_rest_part1(starting_lengths, exit) - } - - #[allow(clippy::too_many_arguments)] - pub(crate) fn compute_rest_part2( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - height_to_supply: &impl ReadableVec, - activity_transfer_volume: &ValuePerBlockCumulativeRolling, - exit: &Exit, - ) -> Result<()> { - self.core.compute_rest_part2( - prices, - starting_lengths, - height_to_supply, - &activity_transfer_volume.sum._24h.cents.height, - exit, - )?; - - // SOPR ratios from lazy rolling sums (1w, 1m, 1y) - self.sopr.ratio_extended.compute_columns2( - starting_lengths.height, - |window| { - &window - .select_full(&activity_transfer_volume.sum.0) - .cents - .height - }, - |window| { - &window - .select_full(&self.core.sopr.value_destroyed.sum) - .height - }, - |_, value_created, value_destroyed| RatioCents64::apply(value_created, value_destroyed), - exit, - )?; - - // Gross PnL - self.gross_pnl.compute_from_cumulative_pair( - starting_lengths.height, - &self.core.minimal.profit.cumulative.cents.height, - &self.core.minimal.loss.cumulative.cents.height, - |_, profit, loss| profit + loss, - exit, - )?; - - // Net PnL 1m change relative to rcap and mcap - self.net_pnl - .change_1m_to_rcap - .compute_binary::>( - starting_lengths.height, - &self.core.net_pnl.delta.absolute._1m.cents.height, - &self.core.minimal.cap.cents.height, - exit, - )?; - // Sell-side risk ratios - self.sell_side_risk_ratio.compute_columns2( - starting_lengths.height, - |window| &window.select(&self.gross_pnl.sum).cents.height, - |_| &self.core.minimal.cap.cents.height, - |_, realized_value, realized_cap| { - RatioCents::::apply(realized_value, realized_cap) - }, - exit, - )?; - - // Realized profit to loss ratios - self.profit_to_loss_ratio.compute_columns2( - starting_lengths.height, - |window| &window.select(&self.core.minimal.profit.sum).cents.height, - |window| &window.select(&self.core.minimal.loss.sum).cents.height, - |_, profit, loss| RatioCents64::apply(profit, loss), - exit, - )?; - - Ok(()) - } -} - -#[inline(always)] -fn mvrv_to_realized_cap_ratio(_: Height, mvrv: PartsPerMillion64) -> PartsPerMillion32 { - PartsPerMillion32::from(1.0 / f64::from(mvrv)) -} - -#[derive(Default)] -pub struct RealizedFullAccum { - pub(crate) cap_raw: CentsSats, - pub(crate) capitalized_cap_raw: CentsSquaredSats, - peak_regret: CentsSats, -} - -impl RealizedFullAccum { - pub(crate) fn add(&mut self, state: &RealizedState) { - self.cap_raw += state.cap_raw(); - self.capitalized_cap_raw += state.capitalized_cap_raw(); - self.peak_regret += CentsSats::new(state.peak_regret_raw()); - } - - pub(crate) fn peak_regret(&self) -> Cents { - self.peak_regret.to_cents() - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn realized_cap_ratio_is_inverse_mvrv() { - assert_eq!( - mvrv_to_realized_cap_ratio(Height::ZERO, PartsPerMillion64::from(2.0)), - PartsPerMillion32::from(0.5), - ); - assert_eq!( - mvrv_to_realized_cap_ratio(Height::ZERO, PartsPerMillion64::from(1.0)), - PartsPerMillion32::from(1.0), - ); - assert!(mvrv_to_realized_cap_ratio(Height::ZERO, PartsPerMillion64::NAN).is_nan()); - assert!(mvrv_to_realized_cap_ratio(Height::ZERO, PartsPerMillion64::ZERO).is_nan()); - } -} diff --git a/crates/brk_computer/src/distribution/metrics/realized/minimal.rs b/crates/brk_computer/src/distribution/metrics/realized/minimal.rs deleted file mode 100644 index 4ab9045cc..000000000 --- a/crates/brk_computer/src/distribution/metrics/realized/minimal.rs +++ /dev/null @@ -1,167 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{ - Bitcoin, Cents, CentsSigned, Height, PartsPerMillion64, PartsPerMillionSigned64, Sats, - StoredF32, Version, -}; -use derive_more::{Deref, DerefMut}; -use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableVec, Rw, StorageMode, WritableVec}; - -use crate::{ - distribution::state::{CohortState, CostBasisOps, RealizedOps}, - internal::{ - FiatPerBlockCumulativeWithSums, FiatPerBlockWithDeltas, Identity, LazyPerBlock, - PriceWithRatioPerBlock, - }, - price, -}; - -use crate::distribution::metrics::ImportConfig; - -#[derive(Traversable)] -pub struct RealizedBase { - pub cap: FiatPerBlockWithDeltas, - pub profit: FiatPerBlockCumulativeWithSums, - pub loss: FiatPerBlockCumulativeWithSums, -} - -impl RealizedBase { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - - Ok(Self { - cap: FiatPerBlockWithDeltas::forced_import( - cfg.db, - &cfg.name("realized_cap"), - cfg.version, - Version::TWO, - cfg.indexes, - cfg.cached_starts, - )?, - profit: cfg.import("realized_profit", v1)?, - loss: cfg.import("realized_loss", v1)?, - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.cap - .cents - .height - .len() - .min(self.profit.cumulative.cents.height.len()) - .min(self.loss.cumulative.cents.height.len()) - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &CohortState) { - self.cap.cents.height.push(state.realized.cap()); - self.profit.push_block(state.realized.profit()); - self.loss.push_block(state.realized.loss()); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - vec![ - &mut self.cap.cents.height as &mut dyn AnyStoredVec, - self.profit.stored_mut(), - self.loss.stored_mut(), - ] - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - sum_others!(self, starting_lengths, others, exit; cap.cents.height); - self.profit.compute_sum_of_others( - starting_lengths.height, - &others.iter().map(|v| &v.profit).collect::>(), - exit, - )?; - self.loss.compute_sum_of_others( - starting_lengths.height, - &others.iter().map(|v| &v.loss).collect::>(), - exit, - )?; - Ok(()) - } -} - -#[derive(Deref, DerefMut, Traversable)] -pub struct RealizedMinimal { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub base: RealizedBase, - pub price: PriceWithRatioPerBlock, - pub mvrv: LazyPerBlock, -} - -impl RealizedMinimal { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - - let base = RealizedBase::forced_import(cfg)?; - let price: PriceWithRatioPerBlock = cfg.import("realized_price", v1)?; - let mvrv = LazyPerBlock::from_lazy::, PartsPerMillion64>( - &cfg.name("mvrv"), - cfg.version, - &price.ratio, - ); - - Ok(Self { base, price, mvrv }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.base.min_stateful_len() - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &CohortState) { - self.base.push_state(state); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - self.base.collect_vecs_mut() - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - let bases: Vec<_> = others.iter().map(|v| &v.base).collect(); - self.base - .compute_from_stateful(starting_lengths, &bases, exit) - } - - pub(crate) fn compute_rest_part2( - &mut self, - _prices: &price::Vecs, - starting_lengths: &Lengths, - height_to_supply: &impl ReadableVec, - exit: &Exit, - ) -> Result<()> { - let cap = &self.base.cap.cents.height; - self.price.cents.height.compute_transform2( - starting_lengths.height, - cap, - height_to_supply, - |(i, cap_cents, supply, ..)| { - let cap = cap_cents.as_u128(); - let supply_sats = Sats::from(supply).as_u128(); - let cents = (cap * Sats::ONE_BTC_U128) - .checked_div(supply_sats) - .map(Cents::from) - .unwrap_or(Cents::ZERO); - (i, cents) - }, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/realized/mod.rs b/crates/brk_computer/src/distribution/metrics/realized/mod.rs index 74ba32186..a064d8d32 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/mod.rs @@ -1,83 +1,21 @@ mod adjusted; -mod core; -mod full; -mod minimal; +mod adjusted_sopr_compute_source; +mod aggregate_sources; +mod aggregate_state; +mod block_data; +mod neg_loss; +mod sopr_24h_input; +mod sopr_vecs; +mod totals; +mod vecs; -pub use self::core::RealizedCore; -pub use adjusted::AdjustedSopr; -pub use full::{RealizedFull, RealizedFullAccum}; -pub use minimal::{RealizedBase, RealizedMinimal}; - -use brk_error::Result; -use brk_indexer::Lengths; -use vecdb::Exit; - -use crate::distribution::state::{CohortState, CostBasisData, RealizedState, WithCapital}; - -pub trait RealizedLike: Send + Sync { - fn as_core(&self) -> &RealizedCore; - fn as_core_mut(&mut self) -> &mut RealizedCore; - fn min_stateful_len(&self) -> usize; - fn push_state(&mut self, state: &CohortState>); - fn compute_rest_part1(&mut self, starting_lengths: &Lengths, exit: &Exit) -> Result<()>; - fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&RealizedCore], - exit: &Exit, - ) -> Result<()>; -} - -impl RealizedLike for RealizedCore { - fn as_core(&self) -> &RealizedCore { - self - } - fn as_core_mut(&mut self) -> &mut RealizedCore { - self - } - fn min_stateful_len(&self) -> usize { - self.min_stateful_len() - } - #[inline(always)] - fn push_state(&mut self, state: &CohortState>) { - self.push_state(state) - } - fn compute_rest_part1(&mut self, starting_lengths: &Lengths, exit: &Exit) -> Result<()> { - self.compute_rest_part1(starting_lengths, exit) - } - fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&RealizedCore], - exit: &Exit, - ) -> Result<()> { - self.compute_from_stateful(starting_lengths, others, exit) - } -} - -impl RealizedLike for RealizedFull { - fn as_core(&self) -> &RealizedCore { - &self.core - } - fn as_core_mut(&mut self) -> &mut RealizedCore { - &mut self.core - } - fn min_stateful_len(&self) -> usize { - self.min_stateful_len() - } - #[inline(always)] - fn push_state(&mut self, state: &CohortState>) { - self.push_state(state) - } - fn compute_rest_part1(&mut self, starting_lengths: &Lengths, exit: &Exit) -> Result<()> { - self.compute_rest_part1(starting_lengths, exit) - } - fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&RealizedCore], - exit: &Exit, - ) -> Result<()> { - self.compute_from_stateful(starting_lengths, others, exit) - } -} +pub use adjusted::AdjustedSoprVecs; +pub(crate) use adjusted_sopr_compute_source::AdjustedSoprComputeSource; +pub(crate) use aggregate_sources::RealizedAggregateSources; +pub use aggregate_state::RealizedAggregateState; +pub(crate) use block_data::RealizedBlockData; +pub use neg_loss::NegRealizedLoss; +pub(crate) use sopr_24h_input::Sopr24hInput; +pub use sopr_vecs::Sopr24hVecs; +pub(crate) use totals::RealizedTotals; +pub use vecs::{RealizedSources, RealizedVecs}; diff --git a/crates/brk_computer/src/distribution/metrics/realized/neg_loss.rs b/crates/brk_computer/src/distribution/metrics/realized/neg_loss.rs new file mode 100644 index 000000000..f3e0438c3 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/neg_loss.rs @@ -0,0 +1,12 @@ +use brk_traversable::Traversable; +use brk_types::{Cents, Dollars, Height}; +use vecdb::LazyVec; + +use crate::internal::{LazyPerBlock, Windows}; + +#[derive(Clone, Traversable)] +pub struct NegRealizedLoss { + #[traversable(flatten)] + pub base: LazyVec, + pub sum: Windows>, +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/sopr_24h_input.rs b/crates/brk_computer/src/distribution/metrics/realized/sopr_24h_input.rs new file mode 100644 index 000000000..684f83514 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/sopr_24h_input.rs @@ -0,0 +1,22 @@ +use brk_types::{Cents, Height}; +use vecdb::{DeltaSub, LazyDeltaVec}; + +use crate::internal::{LazyFiatPerBlockCumulativeWithSums, LazyValuePerBlockCumulativeRolling}; + +#[derive(Clone)] +pub(crate) struct Sopr24hInput { + pub(super) transfer_volume: LazyDeltaVec, + pub(super) value_destroyed: LazyDeltaVec, +} + +impl Sopr24hInput { + pub(crate) fn new( + transfer_volume: &LazyValuePerBlockCumulativeRolling, + value_destroyed: &LazyFiatPerBlockCumulativeWithSums, + ) -> Self { + Self { + transfer_volume: transfer_volume.sum._24h.cents.height.clone(), + value_destroyed: value_destroyed.sum._24h.cents.height.clone(), + } + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/sopr_vecs.rs b/crates/brk_computer/src/distribution/metrics/realized/sopr_vecs.rs new file mode 100644 index 000000000..269852f02 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/sopr_vecs.rs @@ -0,0 +1,385 @@ +use brk_cohort::{ + AGE_RANGE_FILTERS, AgeRange, AgeRangeId, ByEntry, ByEpoch, CLASS_FILTERS, Class, ClassId, + ENTRY_FILTERS, EPOCH_FILTERS, EntryId, EpochId, Filter, OVER_AGE_FILTERS, OverAge, OverAgeId, + Term, UNDER_AGE_FILTERS, UTXOAggregate, UTXOAggregateId, UTXOGroupsWithoutAmountOrType, + UnderAge, UnderAgeId, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, StoredF64, Version}; +use vecdb::{ + AnyStoredVec, AnyVec, BinaryTransform, ColumnId, Database, Exit, PcoVec, ReadOnlyColumnarVec, + ReadableCloneableVec, Rw, StorageMode, +}; + +use crate::{ + distribution::metrics::utxo_metric_name, + indexes, + internal::{ColumnarPerBlock, Identity, LazyColumnPerBlock, LazyPerBlock, RatioCents64}, +}; + +use super::Sopr24hInput; + +#[derive(Traversable)] +pub struct Sopr24hVecs { + #[traversable(flatten)] + pub cohorts: UTXOGroupsWithoutAmountOrType>, + pub aggregate_matrix: ColumnarPerBlock< + StoredF64, + UTXOAggregateId, + UTXOAggregate>, + M, + >, + pub age_range_matrix: ColumnarPerBlock< + StoredF64, + AgeRangeId, + AgeRange>, + M, + >, + pub under_age_matrix: ColumnarPerBlock< + StoredF64, + UnderAgeId, + UnderAge>, + M, + >, + pub over_age_matrix: ColumnarPerBlock< + StoredF64, + OverAgeId, + OverAge>, + M, + >, + pub epoch_matrix: + ColumnarPerBlock>, M>, + pub class_matrix: + ColumnarPerBlock>, M>, + pub entry_matrix: + ColumnarPerBlock>, M>, +} + +impl Sopr24hVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + ) -> Result { + let matrix_version = version + Version::ONE; + let aggregate_matrix = Self::import_matrix( + db, + "sopr_24h_by_aggregate", + matrix_version, + |name, source| UTXOAggregate { + all: Self::column(name, matrix_version, source, UTXOAggregateId::All, indexes), + sth: Self::column(name, matrix_version, source, UTXOAggregateId::Sth, indexes), + lth: Self::column(name, matrix_version, source, UTXOAggregateId::Lth, indexes), + }, + )?; + let age_range_matrix = Self::import_matrix( + db, + "utxos_sopr_24h_by_age_range", + matrix_version, + |name, source| { + AgeRange::from_fn(|column| { + Self::column(name, matrix_version, source, column, indexes) + }) + }, + )?; + let under_age_matrix = Self::import_matrix( + db, + "utxos_sopr_24h_by_under_age", + matrix_version, + |name, source| { + UnderAge::from_fn(|column| { + Self::column(name, matrix_version, source, column, indexes) + }) + }, + )?; + let over_age_matrix = Self::import_matrix( + db, + "utxos_sopr_24h_by_over_age", + matrix_version, + |name, source| { + OverAge::from_fn(|column| { + Self::column(name, matrix_version, source, column, indexes) + }) + }, + )?; + let epoch_matrix = + Self::import_matrix(db, "sopr_24h_by_epoch", matrix_version, |name, source| { + ByEpoch::from_fn(|column| { + Self::column(name, matrix_version, source, column, indexes) + }) + })?; + let class_matrix = + Self::import_matrix(db, "sopr_24h_by_class", matrix_version, |name, source| { + Class::from_fn(|column| Self::column(name, matrix_version, source, column, indexes)) + })?; + let entry_matrix = + Self::import_matrix(db, "sopr_24h_by_entry", matrix_version, |name, source| { + ByEntry::from_fn(|column| { + Self::column(name, matrix_version, source, column, indexes) + }) + })?; + + let cohorts = UTXOGroupsWithoutAmountOrType::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, "sopr_24h"); + let version = Self::cohort_version(version, &filter); + match &filter { + Filter::All => { + Self::logical_source(&aggregate_matrix.series.all, &name, version, indexes) + } + Filter::Term(Term::Sth) => { + Self::logical_source(&aggregate_matrix.series.sth, &name, version, indexes) + } + Filter::Term(Term::Lth) => { + Self::logical_source(&aggregate_matrix.series.lth, &name, version, indexes) + } + Filter::Time(_) => AgeRangeId::ALL + .iter() + .copied() + .find(|id| id.select(&AGE_RANGE_FILTERS) == &filter) + .map(|id| { + Self::logical_source( + id.select(&age_range_matrix.series), + &name, + version, + indexes, + ) + }) + .or_else(|| { + UnderAgeId::ALL + .iter() + .copied() + .find(|id| id.select(&UNDER_AGE_FILTERS) == &filter) + .map(|id| { + Self::logical_source( + id.select(&under_age_matrix.series), + &name, + version, + indexes, + ) + }) + }) + .or_else(|| { + OverAgeId::ALL + .iter() + .copied() + .find(|id| id.select(&OVER_AGE_FILTERS) == &filter) + .map(|id| { + Self::logical_source( + id.select(&over_age_matrix.series), + &name, + version, + indexes, + ) + }) + }) + .expect("supported SOPR time cohort"), + Filter::Epoch(_) => EpochId::ALL + .iter() + .copied() + .find(|id| id.select(&EPOCH_FILTERS) == &filter) + .map(|id| { + Self::logical_source( + id.select(&epoch_matrix.series), + &name, + version, + indexes, + ) + }) + .expect("supported SOPR epoch cohort"), + Filter::Class(_) => ClassId::ALL + .iter() + .copied() + .find(|id| id.select(&CLASS_FILTERS) == &filter) + .map(|id| { + Self::logical_source( + id.select(&class_matrix.series), + &name, + version, + indexes, + ) + }) + .expect("supported SOPR class cohort"), + Filter::Entry(_) => EntryId::ALL + .iter() + .copied() + .find(|id| id.select(&ENTRY_FILTERS) == &filter) + .map(|id| { + Self::logical_source( + id.select(&entry_matrix.series), + &name, + version, + indexes, + ) + }) + .expect("supported SOPR entry cohort"), + Filter::Amount(_) | Filter::Type(_) => unreachable!("unsupported SOPR cohort"), + } + }); + + Ok(Self { + cohorts, + aggregate_matrix, + age_range_matrix, + under_age_matrix, + over_age_matrix, + epoch_matrix, + class_matrix, + entry_matrix, + }) + } + + fn import_matrix( + db: &Database, + name: &str, + version: Version, + build_series: impl FnOnce(&str, &ReadOnlyColumnarVec, C>) -> S, + ) -> Result> { + ColumnarPerBlock::forced_import(db, name, version, |source| build_series(name, source)) + } + + fn column( + name: &str, + version: Version, + source: &ReadOnlyColumnarVec, C>, + column: C, + indexes: &indexes::Vecs, + ) -> LazyColumnPerBlock { + LazyColumnPerBlock::new( + &format!("{name}_column_{}", column.index()), + version, + source, + column, + indexes, + ) + } + + fn logical_source( + source: &LazyColumnPerBlock, + name: &str, + version: Version, + indexes: &indexes::Vecs, + ) -> LazyPerBlock { + LazyPerBlock::from_uncached_boxed_height_source::>( + name, + version, + source.height.read_only_boxed_clone(), + indexes, + ) + } + + fn cohort_version(base: Version, filter: &Filter) -> Version { + base + Version::ONE + + if matches!(filter, Filter::All) { + Version::ONE + } else { + Version::ZERO + } + } + + pub(crate) fn compute( + &mut self, + max_from: Height, + inputs: &UTXOGroupsWithoutAmountOrType, + exit: &Exit, + ) -> Result<()> { + Self::compute_matrix( + &mut self.aggregate_matrix, + inputs, + |column, inputs| match column { + UTXOAggregateId::All => &inputs.all, + UTXOAggregateId::Sth => &inputs.term.short, + UTXOAggregateId::Lth => &inputs.term.long, + }, + max_from, + exit, + )?; + Self::compute_matrix( + &mut self.age_range_matrix, + &inputs.age.range, + |column, inputs| column.select(inputs), + max_from, + exit, + )?; + Self::compute_matrix( + &mut self.under_age_matrix, + &inputs.age.under, + |column, inputs| column.select(inputs), + max_from, + exit, + )?; + Self::compute_matrix( + &mut self.over_age_matrix, + &inputs.age.over, + |column, inputs| column.select(inputs), + max_from, + exit, + )?; + Self::compute_matrix( + &mut self.epoch_matrix, + &inputs.epoch, + |column, inputs| column.select(inputs), + max_from, + exit, + )?; + Self::compute_matrix( + &mut self.class_matrix, + &inputs.class, + |column, inputs| column.select(inputs), + max_from, + exit, + )?; + Self::compute_matrix( + &mut self.entry_matrix, + &inputs.entry, + |column, inputs| column.select(inputs), + max_from, + exit, + ) + } + + fn compute_matrix( + target: &mut ColumnarPerBlock, + inputs: &I, + select: impl for<'a> Fn(C, &'a I) -> &'a Sopr24hInput, + max_from: Height, + exit: &Exit, + ) -> Result<()> { + target.compute_columns2( + max_from, + |column| &select(column, inputs).transfer_volume, + |column| &select(column, inputs).value_destroyed, + |_, transfer_volume, value_destroyed| { + RatioCents64::apply(transfer_volume, value_destroyed) + }, + exit, + ) + } + + pub(crate) fn min_len(&self) -> usize { + [ + self.aggregate_matrix.height.len(), + self.age_range_matrix.height.len(), + self.under_age_matrix.height.len(), + self.over_age_matrix.height.len(), + self.epoch_matrix.height.len(), + self.class_matrix.height.len(), + self.entry_matrix.height.len(), + ] + .into_iter() + .min() + .unwrap_or_default() + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + vec![ + self.aggregate_matrix.stored_mut(), + self.age_range_matrix.stored_mut(), + self.under_age_matrix.stored_mut(), + self.over_age_matrix.stored_mut(), + self.epoch_matrix.stored_mut(), + self.class_matrix.stored_mut(), + self.entry_matrix.stored_mut(), + ] + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/totals.rs b/crates/brk_computer/src/distribution/metrics/realized/totals.rs new file mode 100644 index 000000000..581bd2f6e --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/totals.rs @@ -0,0 +1,51 @@ +use std::ops::AddAssign; + +use brk_types::{Cents, CentsSats, Sats}; + +#[derive(Clone, Copy, Debug, Default)] +pub(crate) struct RealizedTotals { + pub(super) cap_raw: CentsSats, + pub(super) supply: Sats, +} + +impl RealizedTotals { + pub(crate) fn price(&self) -> Cents { + self.cap_raw + .as_u128() + .checked_div(self.supply.as_u128()) + .map(|price| Cents::new(price as u64)) + .unwrap_or_default() + } +} + +impl AddAssign for RealizedTotals { + fn add_assign(&mut self, rhs: Self) { + self.cap_raw += rhs.cap_raw; + self.supply += rhs.supply; + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn price_uses_total_raw_cap_and_supply() { + let mut totals = RealizedTotals { + cap_raw: CentsSats::new(100), + supply: Sats::new(3), + }; + totals += RealizedTotals { + cap_raw: CentsSats::new(100), + supply: Sats::new(7), + }; + + assert_eq!(totals.price(), Cents::new(20)); + assert_ne!(totals.price(), Cents::new(100 / 3 + 100 / 7)); + } + + #[test] + fn price_is_zero_without_supply() { + assert_eq!(RealizedTotals::default().price(), Cents::ZERO); + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/vecs/cap.rs b/crates/brk_computer/src/distribution/metrics/realized/vecs/cap.rs new file mode 100644 index 000000000..6a8fb8062 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/vecs/cap.rs @@ -0,0 +1,45 @@ +use brk_cohort::UTXOGroups; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, CentsSigned, PartsPerMillionSigned64, Version}; +use vecdb::{Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{UTXOColumnarMetric, utxo_metric_name}, + indexes, + internal::{CachedWindowStartVec, LazyFiatPerBlockWithDeltas, Windows}, +}; + +#[derive(Traversable)] +pub struct RealizedCapByCohort { + #[traversable(flatten)] + pub cohorts: + UTXOGroups>, + #[traversable(flatten)] + pub matrices: UTXOColumnarMetric, +} + +impl RealizedCapByCohort { + pub(super) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let matrices = UTXOColumnarMetric::forced_import(db, "realized_cap_cents", version)?; + let cohorts = UTXOGroups::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, "realized_cap"); + LazyFiatPerBlockWithDeltas::from_boxed_cents_source( + &name, + version, + matrices + .additive_source(&filter, &format!("{name}_cents"), version) + .expect("realized-cap cohort source"), + Version::TWO, + indexes, + cached_starts, + ) + }); + Ok(Self { cohorts, matrices }) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/vecs/collection.rs b/crates/brk_computer/src/distribution/metrics/realized/vecs/collection.rs new file mode 100644 index 000000000..638a12d28 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/vecs/collection.rs @@ -0,0 +1,619 @@ +use brk_cohort::{ + AmountRange, CohortContext, Filter, UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, + UTXOAggregate, UTXOAggregateId, UTXOAllAndSth, UTXOGroups, UTXOGroupsWithoutAmountOrType, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{ + Cents, CentsSats, CentsSigned, CentsSquaredSats, Height, PartsPerMillion32, PartsPerMillion64, + PartsPerMillionSigned64, StoredF32, StoredF64, Version, +}; +use vecdb::{ + AnyStoredVec, AnyVec, BinaryTransform, CachedBoxedVec, ColumnId, Database, Exit, LazyVec, + ReadableCloneableVec, ReadableVec, Rw, StorageMode, +}; + +use crate::{ + distribution::{ + AllChainCache, + metrics::{ + AdditiveAggregateFiatPerBlockCumulativeWithSums, AdditiveUTXORawVec, + AggregatePercentPerBlock, AggregatePriceWithRatioPerBlock, ColumnarAmount, + RealizedBlockData, RealizedTotals, UTXORows, utxo_metric_name, + }, + }, + indexes, + internal::{ + CachedWindowStartVec, ColumnarPercentRollingWindows, ColumnarRollingWindows, + ColumnarRollingWindowsFrom1w, Identity, LazyFiatPerBlockCumulativeWithSums, + LazyFiatPerBlockWithDeltas, LazyPerBlock, LazyPercentPerBlock, NegCentsUnsignedToDollars, + RatioCents, RatioCents64, RatioCentsSignedCents, Windows, + }, +}; + +use super::{ + super::{ + AdjustedSoprComputeSource, AdjustedSoprVecs, NegRealizedLoss, RealizedAggregateSources, + RealizedAggregateState, Sopr24hInput, Sopr24hVecs, + }, + CumulativeNetRealizedByCohort, CumulativeRealizedByCohort, CumulativeValueDestroyedByCohort, + RealizedCapByCohort, RealizedPriceByCohort, RealizedSources, +}; + +#[derive(Traversable)] +pub struct RealizedVecs { + pub cap: RealizedCapByCohort, + pub price: RealizedPriceByCohort, + pub profit: CumulativeRealizedByCohort, + #[traversable(wrap = "profit", rename = "addr_balance")] + pub addr_balance_profit: ColumnarAmount, M>, + pub loss: CumulativeRealizedByCohort, + #[traversable(wrap = "loss", rename = "addr_balance")] + pub addr_balance_loss: ColumnarAmount, M>, + pub net_pnl: CumulativeNetRealizedByCohort, + #[traversable(wrap = "sopr")] + pub value_destroyed: CumulativeValueDestroyedByCohort, + pub sopr: Sopr24hVecs, + pub adjusted_sopr: AdjustedSoprVecs, + #[traversable(wrap = "cap", rename = "addr_balance")] + pub addr_balance_cap: ColumnarAmount< + Cents, + LazyFiatPerBlockWithDeltas, + M, + >, + pub gross_pnl: AdditiveAggregateFiatPerBlockCumulativeWithSums, + pub capitalized_price: AggregatePriceWithRatioPerBlock, + pub cap_raw: AdditiveUTXORawVec, + pub capitalized_cap_raw: AdditiveUTXORawVec, + pub peak_regret: AdditiveAggregateFiatPerBlockCumulativeWithSums, + pub net_pnl_change_1m_to_rcap: AggregatePercentPerBlock, + pub sell_side_risk_ratio: UTXOAggregate>, + pub sopr_ratio_extended: UTXOAggregate>, + pub profit_to_loss_ratio: UTXOAggregate>, + pub mvrv: UTXOGroups>, + #[traversable(wrap = "loss", rename = "negative")] + pub negative_loss: UTXOGroupsWithoutAmountOrType, + #[traversable(wrap = "cap", rename = "to_own_mcap")] + pub cap_to_own_mcap: UTXOAggregate>, + #[traversable(wrap = "net_pnl/change_1m", rename = "to_mcap")] + pub net_pnl_change_1m_to_mcap: UTXOAggregate>, +} + +impl RealizedVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + spot_price: &CachedBoxedVec, + all_chain: &AllChainCache, + ) -> Result { + let aggregate_version = version + Version::ONE; + let gross_pnl = AdditiveAggregateFiatPerBlockCumulativeWithSums::forced_import( + db, + "realized_gross_pnl", + aggregate_version, + indexes, + cached_starts, + )?; + let capitalized_price = AggregatePriceWithRatioPerBlock::forced_import( + db, + "capitalized_price", + aggregate_version, + indexes, + spot_price, + )?; + let cap_raw = AdditiveUTXORawVec::forced_import(db, "cap_raw", version)?; + let capitalized_cap_raw = + AdditiveUTXORawVec::forced_import(db, "capitalized_cap_raw", version)?; + let peak_regret = AdditiveAggregateFiatPerBlockCumulativeWithSums::forced_import( + db, + "realized_peak_regret", + aggregate_version, + indexes, + cached_starts, + )?; + let net_pnl_change_1m_to_rcap = AggregatePercentPerBlock::forced_import( + db, + "net_pnl_change_1m_to_rcap", + aggregate_version, + indexes, + )?; + let sell_side_risk_ratio = UTXOAggregate::try_from_fn(|id| { + ColumnarPercentRollingWindows::forced_import( + db, + &Self::aggregate_metric_name(id, "sell_side_risk_ratio"), + Self::aggregate_metric_version(version, id, Version::TWO), + indexes, + ) + })?; + let sopr_ratio_extended = UTXOAggregate::try_from_fn(|id| { + ColumnarRollingWindowsFrom1w::forced_import( + db, + &Self::aggregate_metric_name(id, "sopr"), + Self::aggregate_metric_version(version, id, Version::ONE), + indexes, + ) + })?; + let profit_to_loss_ratio = UTXOAggregate::try_from_fn(|id| { + ColumnarRollingWindows::forced_import( + db, + &Self::aggregate_metric_name(id, "realized_profit_to_loss_ratio"), + Self::aggregate_metric_version(version, id, Version::ONE), + indexes, + ) + })?; + let cap = RealizedCapByCohort::forced_import(db, version, indexes, cached_starts)?; + let price = RealizedPriceByCohort::forced_import(db, version, indexes, spot_price)?; + let profit = CumulativeRealizedByCohort::forced_import( + db, + "realized_profit", + version + Version::ONE, + indexes, + cached_starts, + )?; + let loss = CumulativeRealizedByCohort::forced_import( + db, + "realized_loss", + version + Version::ONE, + indexes, + cached_starts, + )?; + let net_pnl = + CumulativeNetRealizedByCohort::forced_import(db, version, indexes, cached_starts)?; + let value_destroyed = CumulativeValueDestroyedByCohort::forced_import( + db, + version + Version::ONE, + indexes, + cached_starts, + )?; + let sopr = Sopr24hVecs::forced_import(db, version, indexes)?; + let adjusted_sopr = AdjustedSoprVecs::forced_import(db, version, indexes, cached_starts)?; + let addr_version = version + Version::ONE; + let addr_balance_cap = ColumnarAmount::forced_import( + db, + "addrs_realized_cap_cents_by_balance_range", + CohortContext::Addr, + "realized_cap", + addr_version, + |name, source| { + LazyFiatPerBlockWithDeltas::from_boxed_cents_source( + name, + addr_version, + source, + Version::TWO, + indexes, + cached_starts, + ) + }, + )?; + let addr_balance_profit = ColumnarAmount::forced_import( + db, + "addrs_realized_profit_cumulative_cents_by_balance_range", + CohortContext::Addr, + "realized_profit", + addr_version + Version::ONE, + |name, source| { + LazyFiatPerBlockCumulativeWithSums::from_boxed_cumulative_cents_source( + name, + addr_version + Version::ONE, + source, + indexes, + cached_starts, + ) + }, + )?; + let addr_balance_loss = ColumnarAmount::forced_import( + db, + "addrs_realized_loss_cumulative_cents_by_balance_range", + CohortContext::Addr, + "realized_loss", + addr_version + Version::ONE, + |name, source| { + LazyFiatPerBlockCumulativeWithSums::from_boxed_cumulative_cents_source( + name, + addr_version + Version::ONE, + source, + indexes, + cached_starts, + ) + }, + )?; + + let mvrv = price.cohorts.map_named(|filter, cohort_name, price| { + LazyPerBlock::from_lazy::, PartsPerMillion64>( + &utxo_metric_name(filter, cohort_name, "mvrv"), + Self::cohort_version(version, filter), + &price.ratio, + ) + }); + let negative_loss = UTXOGroupsWithoutAmountOrType::new(|filter, cohort_name| { + let loss = loss.cohorts.get(&filter).expect("realized-loss cohort"); + let name = utxo_metric_name(&filter, cohort_name, "realized_loss_neg"); + let version = Self::cohort_version(version, &filter) + Version::ONE; + let base = LazyVec::transformed::( + &name, + version, + loss.block.cents.read_only_boxed_clone(), + ); + let sum = loss.sum.0.map_with_suffix(|suffix, slot| { + LazyPerBlock::from_height_source::( + &format!("{name}_sum_{suffix}"), + version, + slot.cents.height.clone(), + indexes, + ) + }); + NegRealizedLoss { base, sum } + }); + let cap_to_own_mcap = UTXOAggregate::from_fn(|id| { + let filter = id.select(&UTXO_AGGREGATE_FILTERS); + let name = utxo_metric_name( + filter, + id.select(&UTXO_AGGREGATE_NAMES).id, + "realized_cap_to_own_mcap", + ); + LazyPercentPerBlock::from_indexed_source( + &name, + Self::cohort_version(version, filter) + Version::TWO, + &price + .cohorts + .get(filter) + .expect("realized-price cohort") + .ppm + .height, + Self::mvrv_to_realized_cap_ratio, + indexes, + ) + }); + let net_pnl_change_1m_to_mcap = UTXOAggregate::from_fn(|id| { + let filter = id.select(&UTXO_AGGREGATE_FILTERS); + let name = utxo_metric_name( + filter, + id.select(&UTXO_AGGREGATE_NAMES).id, + "net_pnl_change_1m_to_mcap", + ); + let source = all_chain.with_market_cap( + &format!("{name}_ppm_source"), + Version::new(5), + &net_pnl + .cohorts + .get(filter) + .expect("aggregate net-realized-PnL cohort") + .delta + .absolute + ._1m + .cents + .height, + |_, net_pnl, market_cap| Self::net_pnl_to_market_cap(net_pnl, market_cap), + ); + LazyPercentPerBlock::from_uncached_height_source( + &name, + Version::new(5), + source, + indexes, + ) + }); + + Ok(Self { + cap, + price, + profit, + addr_balance_profit, + loss, + addr_balance_loss, + net_pnl, + value_destroyed, + sopr, + adjusted_sopr, + addr_balance_cap, + gross_pnl, + capitalized_price, + cap_raw, + capitalized_cap_raw, + peak_regret, + net_pnl_change_1m_to_rcap, + sell_side_risk_ratio, + sopr_ratio_extended, + profit_to_loss_ratio, + mvrv, + negative_loss, + cap_to_own_mcap, + net_pnl_change_1m_to_mcap, + }) + } + + fn cohort_version(version: Version, filter: &Filter) -> Version { + version + + if matches!(filter, Filter::All) { + Version::ONE + } else { + Version::ZERO + } + } + + fn aggregate_metric_version(version: Version, id: UTXOAggregateId, offset: Version) -> Version { + version + + offset + + if matches!(id, UTXOAggregateId::All) { + Version::ONE + } else { + Version::ZERO + } + } + + fn aggregate_metric_name(id: UTXOAggregateId, metric: &str) -> String { + utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ) + } + + fn net_pnl_to_market_cap(net_pnl: CentsSigned, market_cap: Cents) -> PartsPerMillionSigned64 { + let market_cap = f64::from(market_cap); + if market_cap > 0.0 { + PartsPerMillionSigned64::from(net_pnl.inner() as f64 / market_cap) + } else { + PartsPerMillionSigned64::default() + } + } + + #[inline(always)] + fn mvrv_to_realized_cap_ratio(_: Height, mvrv: PartsPerMillion64) -> PartsPerMillion32 { + PartsPerMillion32::from(1.0 / f64::from(mvrv)) + } + + pub(crate) fn sources(&self, filter: &Filter) -> Option { + Some(RealizedSources { + cap: self.cap.cohorts.get(filter)?.clone(), + profit: self.profit.cohorts.get(filter)?.clone(), + loss: self.loss.cohorts.get(filter)?.clone(), + net_pnl: self.net_pnl.cohorts.get(filter)?.clone(), + value_destroyed: self.value_destroyed.cohorts.get(filter)?.clone(), + }) + } + + #[inline(always)] + pub(crate) fn push_aggregate(&mut self, rows: &UTXOAggregate) -> Cents { + let prices = rows.map(RealizedAggregateState::capitalized_price); + self.gross_pnl + .push_block(rows.map(RealizedAggregateState::gross_pnl)); + self.capitalized_price.push(prices.clone()); + self.peak_regret + .push_block(rows.map(RealizedAggregateState::peak_regret)); + self.cap_raw.push(&rows.map(|row| row.cap_raw)); + self.capitalized_cap_raw + .push(&rows.map(|row| row.capitalized_cap_raw)); + prices.all + } + + pub(crate) fn compute_sopr( + &mut self, + max_from: Height, + inputs: &UTXOGroupsWithoutAmountOrType, + exit: &Exit, + ) -> Result<()> { + self.sopr.compute(max_from, inputs, exit) + } + + pub(crate) fn compute_adjusted_sopr( + &mut self, + max_from: Height, + sources: &UTXOAllAndSth, + under_1h_transfer_volume: &V1, + under_1h_value_destroyed: &V2, + exit: &Exit, + ) -> Result<()> + where + V1: ReadableVec, + V2: ReadableVec, + { + self.adjusted_sopr.compute( + max_from, + sources, + under_1h_transfer_volume, + under_1h_value_destroyed, + exit, + ) + } + + pub(crate) fn compute_aggregate_metrics( + &mut self, + max_from: Height, + sources: &UTXOAggregate, + exit: &Exit, + ) -> Result<()> { + let Self { + gross_pnl, + net_pnl_change_1m_to_rcap, + sell_side_risk_ratio, + sopr_ratio_extended, + profit_to_loss_ratio, + .. + } = self; + + net_pnl_change_1m_to_rcap.compute_columns2( + max_from, + |id| { + &id.select(sources) + .realized + .net_pnl + .delta + .absolute + ._1m + .cents + .height + }, + |id| &id.select(sources).realized.cap.cents.height, + |_, change, cap| RatioCentsSignedCents::::apply(change, cap), + exit, + )?; + + for id in UTXOAggregateId::ALL { + let source = id.select(sources); + let realized = &source.realized; + + id.select_mut(sopr_ratio_extended).compute_columns2( + max_from, + |window| { + &window + .select_full(&source.activity.transfer_volume.sum.0) + .cents + .height + }, + |window| { + &window + .select_full(&realized.value_destroyed.sum) + .cents + .height + }, + |_, value_created, value_destroyed| { + RatioCents64::apply(value_created, value_destroyed) + }, + exit, + )?; + + id.select_mut(sell_side_risk_ratio).compute_columns2( + max_from, + |window| { + &window + .select(&id.select(&gross_pnl.series).sum) + .cents + .height + }, + |_| &realized.cap.cents.height, + |_, realized_value, realized_cap| { + RatioCents::::apply(realized_value, realized_cap) + }, + exit, + )?; + + id.select_mut(profit_to_loss_ratio).compute_columns2( + max_from, + |window| &window.select(&realized.profit.sum).cents.height, + |window| &window.select(&realized.loss.sum).cents.height, + |_, profit, loss| RatioCents64::apply(profit, loss), + exit, + )?; + } + + Ok(()) + } + + #[inline(always)] + pub(crate) fn push(&mut self, rows: &UTXORows) { + let aggregate_price = rows + .map(RealizedBlockData::totals) + .aggregate() + .map(RealizedTotals::price); + + self.cap.matrices.push(rows.map(|values| values.cap)); + self.price + .matrices + .push(rows.map(|values| values.price), aggregate_price); + self.profit + .cumulative + .push_block(rows.map(|values| values.profit)); + self.loss + .cumulative + .push_block(rows.map(|values| values.loss)); + self.net_pnl + .cumulative + .push_block(rows.map(|values| values.net_pnl)); + self.value_destroyed + .cumulative + .push_block(rows.map(|values| values.value_destroyed)); + } + + #[inline(always)] + pub(crate) fn push_addr_balance( + &mut self, + cap: AmountRange, + profit: &AmountRange, + loss: &AmountRange, + ) { + self.addr_balance_cap.push(cap); + self.addr_balance_profit.push_cumulative(profit); + self.addr_balance_loss.push_cumulative(loss); + } + + pub(crate) fn min_len(&self) -> usize { + self.cap + .matrices + .min_len() + .min(self.addr_balance_cap.len()) + .min(self.price.matrices.min_len()) + .min(self.profit.cumulative.min_len()) + .min(self.addr_balance_profit.len()) + .min(self.loss.cumulative.min_len()) + .min(self.addr_balance_loss.len()) + .min(self.net_pnl.cumulative.min_len()) + .min(self.sopr.min_len()) + .min(self.adjusted_sopr.min_len()) + .min(self.capitalized_price.len()) + .min(self.gross_pnl.len()) + .min(self.peak_regret.len()) + .min( + self.sell_side_risk_ratio + .iter() + .map(|value| value.height.len()) + .min() + .unwrap_or_default(), + ) + .min( + self.sopr_ratio_extended + .iter() + .map(|value| value.height.len()) + .min() + .unwrap_or_default(), + ) + .min( + self.profit_to_loss_ratio + .iter() + .map(|value| value.height.len()) + .min() + .unwrap_or_default(), + ) + .min(self.cap_raw.len()) + .min(self.capitalized_cap_raw.len()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = self.cap.matrices.collect_vecs_mut(); + vecs.push(self.addr_balance_cap.stored_mut()); + vecs.extend(self.price.matrices.collect_vecs_mut()); + vecs.extend(self.profit.cumulative.collect_vecs_mut()); + vecs.push(self.addr_balance_profit.stored_mut()); + vecs.extend(self.loss.cumulative.collect_vecs_mut()); + vecs.push(self.addr_balance_loss.stored_mut()); + vecs.extend(self.net_pnl.cumulative.collect_vecs_mut()); + vecs.extend(self.value_destroyed.cumulative.collect_vecs_mut()); + vecs.extend(self.sopr.collect_vecs_mut()); + vecs.extend(self.adjusted_sopr.collect_vecs_mut()); + vecs.extend([ + self.gross_pnl.stored_mut(), + self.capitalized_price.stored_mut(), + self.peak_regret.stored_mut(), + self.net_pnl_change_1m_to_rcap.stored_mut(), + self.cap_raw.stored_mut(), + self.capitalized_cap_raw.stored_mut(), + ]); + vecs.extend( + self.sell_side_risk_ratio + .iter_mut() + .map(|value| value.stored_mut()), + ); + vecs.extend( + self.sopr_ratio_extended + .iter_mut() + .map(|value| value.stored_mut()), + ); + vecs.extend( + self.profit_to_loss_ratio + .iter_mut() + .map(|value| value.stored_mut()), + ); + vecs + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/vecs/cumulative.rs b/crates/brk_computer/src/distribution/metrics/realized/vecs/cumulative.rs new file mode 100644 index 000000000..b5d733e0b --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/vecs/cumulative.rs @@ -0,0 +1,53 @@ +use brk_cohort::UTXOGroups; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Version}; +use vecdb::{Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{CumulativeUTXOColumnarMetric, utxo_metric_name}, + indexes, + internal::{CachedWindowStartVec, LazyFiatPerBlockCumulativeWithSums, Windows}, +}; + +#[derive(Traversable)] +pub struct CumulativeRealizedByCohort { + #[traversable(flatten)] + pub cohorts: UTXOGroups>, + #[traversable(flatten)] + pub cumulative: CumulativeUTXOColumnarMetric, +} + +impl CumulativeRealizedByCohort { + pub(super) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let cumulative = CumulativeUTXOColumnarMetric::forced_import( + db, + &format!("{metric}_cumulative_cents"), + version, + )?; + let cohorts = UTXOGroups::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, metric); + let source = cumulative + .matrices + .additive_source(&filter, &format!("{name}_cumulative_cents"), version) + .expect("supported cumulative realized cohort"); + LazyFiatPerBlockCumulativeWithSums::from_boxed_cumulative_cents_source( + &name, + version, + source, + indexes, + cached_starts, + ) + }); + Ok(Self { + cohorts, + cumulative, + }) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/vecs/cumulative_net.rs b/crates/brk_computer/src/distribution/metrics/realized/vecs/cumulative_net.rs new file mode 100644 index 000000000..d596e49ec --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/vecs/cumulative_net.rs @@ -0,0 +1,60 @@ +use brk_cohort::UTXOGroupsWithoutAmountOrType; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{CentsSigned, PartsPerMillionSigned64, Version}; +use vecdb::{Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{CumulativeUTXOColumnarMetricWithoutAmountOrType, utxo_metric_name}, + indexes, + internal::{CachedWindowStartVec, LazyFiatPerBlockCumulativeWithSumsAndDeltas, Windows}, +}; + +#[derive(Traversable)] +pub struct CumulativeNetRealizedByCohort { + #[traversable(flatten)] + pub cohorts: UTXOGroupsWithoutAmountOrType< + LazyFiatPerBlockCumulativeWithSumsAndDeltas< + CentsSigned, + CentsSigned, + PartsPerMillionSigned64, + >, + >, + #[traversable(flatten)] + pub cumulative: CumulativeUTXOColumnarMetricWithoutAmountOrType, +} + +impl CumulativeNetRealizedByCohort { + pub(super) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let version = version + Version::ONE; + let cumulative = CumulativeUTXOColumnarMetricWithoutAmountOrType::forced_import( + db, + "net_realized_pnl_cumulative_cents", + version, + )?; + let cohorts = UTXOGroupsWithoutAmountOrType::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, "net_realized_pnl"); + let source = cumulative + .matrices + .additive_source(&filter, &format!("{name}_cumulative_cents"), version) + .expect("supported net realized cohort"); + LazyFiatPerBlockCumulativeWithSumsAndDeltas::from_boxed_cumulative_cents_source( + &name, + version, + source, + Version::new(5), + indexes, + cached_starts, + ) + }); + Ok(Self { + cohorts, + cumulative, + }) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/vecs/mod.rs b/crates/brk_computer/src/distribution/metrics/realized/vecs/mod.rs new file mode 100644 index 000000000..67ce18314 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/vecs/mod.rs @@ -0,0 +1,15 @@ +mod cap; +mod collection; +mod cumulative; +mod cumulative_net; +mod price; +mod sources; +mod value_destroyed; + +pub(super) use cap::RealizedCapByCohort; +pub use collection::RealizedVecs; +pub(super) use cumulative::CumulativeRealizedByCohort; +pub(super) use cumulative_net::CumulativeNetRealizedByCohort; +pub(super) use price::RealizedPriceByCohort; +pub use sources::RealizedSources; +pub(super) use value_destroyed::CumulativeValueDestroyedByCohort; diff --git a/crates/brk_computer/src/distribution/metrics/realized/vecs/price.rs b/crates/brk_computer/src/distribution/metrics/realized/vecs/price.rs new file mode 100644 index 000000000..cd3c016df --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/vecs/price.rs @@ -0,0 +1,44 @@ +use brk_cohort::UTXOGroups; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Version}; +use vecdb::{CachedBoxedVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{ExactUTXOColumnarMetric, utxo_metric_name}, + indexes, + internal::LazyPriceWithRatioPerBlock, +}; + +#[derive(Traversable)] +pub struct RealizedPriceByCohort { + #[traversable(flatten)] + pub cohorts: UTXOGroups, + #[traversable(flatten)] + pub matrices: ExactUTXOColumnarMetric, +} + +impl RealizedPriceByCohort { + pub(super) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + spot_price: &CachedBoxedVec, + ) -> Result { + let version = version + Version::ONE; + let matrices = ExactUTXOColumnarMetric::forced_import(db, "realized_price_cents", version)?; + let cohorts = UTXOGroups::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, "realized_price"); + LazyPriceWithRatioPerBlock::from_boxed_height_source( + &name, + version, + matrices + .source(&filter, &format!("{name}_cents"), version) + .expect("realized-price cohort source"), + indexes, + spot_price, + ) + }); + Ok(Self { cohorts, matrices }) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/vecs/sources.rs b/crates/brk_computer/src/distribution/metrics/realized/vecs/sources.rs new file mode 100644 index 000000000..2cb0f3172 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/vecs/sources.rs @@ -0,0 +1,19 @@ +use brk_types::{Cents, CentsSigned, PartsPerMillionSigned64}; + +use crate::internal::{ + LazyFiatPerBlockCumulativeWithSums, LazyFiatPerBlockCumulativeWithSumsAndDeltas, + LazyFiatPerBlockWithDeltas, +}; + +#[derive(Clone)] +pub struct RealizedSources { + pub cap: LazyFiatPerBlockWithDeltas, + pub profit: LazyFiatPerBlockCumulativeWithSums, + pub loss: LazyFiatPerBlockCumulativeWithSums, + pub net_pnl: LazyFiatPerBlockCumulativeWithSumsAndDeltas< + CentsSigned, + CentsSigned, + PartsPerMillionSigned64, + >, + pub value_destroyed: LazyFiatPerBlockCumulativeWithSums, +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/vecs/value_destroyed.rs b/crates/brk_computer/src/distribution/metrics/realized/vecs/value_destroyed.rs new file mode 100644 index 000000000..9acae5ddf --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/vecs/value_destroyed.rs @@ -0,0 +1,53 @@ +use brk_cohort::UTXOGroupsWithoutAmountOrType; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Version}; +use vecdb::{Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{CumulativeUTXOColumnarMetricWithoutAmountOrType, utxo_metric_name}, + indexes, + internal::{CachedWindowStartVec, LazyFiatPerBlockCumulativeWithSums, Windows}, +}; + +#[derive(Traversable)] +pub struct CumulativeValueDestroyedByCohort { + #[traversable(flatten)] + pub cohorts: UTXOGroupsWithoutAmountOrType>, + #[traversable(flatten)] + pub cumulative: CumulativeUTXOColumnarMetricWithoutAmountOrType, +} + +impl CumulativeValueDestroyedByCohort { + pub(super) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Result { + let metric = "value_destroyed"; + let cumulative = CumulativeUTXOColumnarMetricWithoutAmountOrType::forced_import( + db, + "value_destroyed_cumulative_cents", + version, + )?; + let cohorts = UTXOGroupsWithoutAmountOrType::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, metric); + let source = cumulative + .matrices + .additive_source(&filter, &format!("{name}_cumulative_cents"), version) + .expect("supported value-destroyed cohort"); + LazyFiatPerBlockCumulativeWithSums::from_boxed_cumulative_cents_source( + &name, + version, + source, + indexes, + cached_starts, + ) + }); + Ok(Self { + cohorts, + cumulative, + }) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/relative/extended_own_market_cap.rs b/crates/brk_computer/src/distribution/metrics/relative/extended_own_market_cap.rs deleted file mode 100644 index 433c0ecf9..000000000 --- a/crates/brk_computer/src/distribution/metrics/relative/extended_own_market_cap.rs +++ /dev/null @@ -1,61 +0,0 @@ -use brk_error::Result; -use brk_traversable::Traversable; -use brk_types::{Dollars, Height, PartsPerMillion32, PartsPerMillionSigned32, Version}; -use vecdb::{Exit, ReadableVec, Rw, StorageMode}; - -use crate::internal::{LazyPercentPerBlock, PercentPerBlock, RatioDollars}; - -use crate::distribution::metrics::{ImportConfig, UnrealizedCore}; - -/// Extended relative metrics for own market cap (extended && rel_to_all). -#[derive(Traversable)] -pub struct RelativeExtendedOwnMarketCap { - #[traversable(wrap = "unrealized/net_pnl", rename = "to_own_mcap")] - pub net_unrealized_pnl_to_own_mcap: LazyPercentPerBlock, - #[traversable(wrap = "unrealized/profit", rename = "to_own_mcap")] - pub unrealized_profit_to_own_mcap: PercentPerBlock, - #[traversable(wrap = "unrealized/loss", rename = "to_own_mcap")] - pub unrealized_loss_to_own_mcap: PercentPerBlock, -} - -impl RelativeExtendedOwnMarketCap { - pub(crate) fn forced_import(cfg: &ImportConfig, unrealized: &UnrealizedCore) -> Result { - let v2 = Version::new(2); - - Ok(Self { - net_unrealized_pnl_to_own_mcap: LazyPercentPerBlock::from_height_source( - &cfg.name("net_unrealized_pnl_to_own_mcap"), - cfg.version + Version::new(4), - unrealized.nupl.ppm.height.clone(), - cfg.indexes, - ), - unrealized_profit_to_own_mcap: cfg.import("unrealized_profit_to_own_mcap", v2)?, - unrealized_loss_to_own_mcap: cfg - .import("unrealized_loss_to_own_mcap", Version::new(3))?, - }) - } - - pub(crate) fn compute( - &mut self, - max_from: Height, - unrealized: &UnrealizedCore, - own_market_cap: &impl ReadableVec, - exit: &Exit, - ) -> Result<()> { - self.unrealized_profit_to_own_mcap - .compute_binary::>( - max_from, - &unrealized.profit.usd.height, - own_market_cap, - exit, - )?; - self.unrealized_loss_to_own_mcap - .compute_binary::>( - max_from, - &unrealized.loss.usd.height, - own_market_cap, - exit, - )?; - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/relative/extended_own_pnl.rs b/crates/brk_computer/src/distribution/metrics/relative/extended_own_pnl.rs deleted file mode 100644 index c99c40625..000000000 --- a/crates/brk_computer/src/distribution/metrics/relative/extended_own_pnl.rs +++ /dev/null @@ -1,63 +0,0 @@ -use brk_error::Result; -use brk_traversable::Traversable; -use brk_types::{Dollars, Height, PartsPerMillion32, PartsPerMillionSigned32, Version}; -use vecdb::{Exit, ReadableVec, Rw, StorageMode}; - -use crate::internal::{PercentPerBlock, RatioDollars}; - -use crate::distribution::metrics::{ImportConfig, UnrealizedCore}; - -/// Extended relative metrics for own total unrealized PnL (extended only). -#[derive(Traversable)] -pub struct RelativeExtendedOwnPnl { - #[traversable(wrap = "unrealized/profit", rename = "to_own_gross_pnl")] - pub unrealized_profit_to_own_gross_pnl: PercentPerBlock, - #[traversable(wrap = "unrealized/loss", rename = "to_own_gross_pnl")] - pub unrealized_loss_to_own_gross_pnl: PercentPerBlock, - #[traversable(wrap = "unrealized/net_pnl", rename = "to_own_gross_pnl")] - pub net_unrealized_pnl_to_own_gross_pnl: PercentPerBlock, -} - -impl RelativeExtendedOwnPnl { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - Ok(Self { - unrealized_profit_to_own_gross_pnl: cfg - .import("unrealized_profit_to_own_gross_pnl", Version::ONE)?, - unrealized_loss_to_own_gross_pnl: cfg - .import("unrealized_loss_to_own_gross_pnl", Version::ONE)?, - net_unrealized_pnl_to_own_gross_pnl: cfg - .import("net_unrealized_pnl_to_own_gross_pnl", Version::new(3))?, - }) - } - - pub(crate) fn compute( - &mut self, - max_from: Height, - unrealized: &UnrealizedCore, - gross_pnl_usd: &impl ReadableVec, - exit: &Exit, - ) -> Result<()> { - self.unrealized_profit_to_own_gross_pnl - .compute_binary::>( - max_from, - &unrealized.profit.usd.height, - gross_pnl_usd, - exit, - )?; - self.unrealized_loss_to_own_gross_pnl - .compute_binary::>( - max_from, - &unrealized.loss.usd.height, - gross_pnl_usd, - exit, - )?; - self.net_unrealized_pnl_to_own_gross_pnl - .compute_binary::>( - max_from, - &unrealized.net_pnl.usd.height, - gross_pnl_usd, - exit, - )?; - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/relative/for_all.rs b/crates/brk_computer/src/distribution/metrics/relative/for_all.rs deleted file mode 100644 index f4ef0e2ef..000000000 --- a/crates/brk_computer/src/distribution/metrics/relative/for_all.rs +++ /dev/null @@ -1,59 +0,0 @@ -use brk_error::Result; -use brk_traversable::Traversable; -use brk_types::Height; -use derive_more::{Deref, DerefMut}; -use vecdb::{Exit, Rw, StorageMode}; - -use crate::distribution::{ - AllChainCache, - metrics::{ImportConfig, RealizedFull, SupplyCore, UnrealizedFull}, -}; - -use super::{RelativeExtendedOwnPnl, RelativeFull, RelativeInvestedCapital}; - -/// Relative metrics for the "all" cohort (base + own_pnl, NO rel_to_all). -#[derive(Deref, DerefMut, Traversable)] -pub struct RelativeForAll { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub base: RelativeFull, - #[traversable(flatten)] - pub extended_own_pnl: RelativeExtendedOwnPnl, - #[traversable(flatten)] - pub invested_capital: RelativeInvestedCapital, -} - -impl RelativeForAll { - pub(crate) fn forced_import( - cfg: &ImportConfig, - unrealized: &UnrealizedFull, - all_chain: &AllChainCache, - ) -> Result { - Ok(Self { - base: RelativeFull::forced_import(cfg, &unrealized.inner.basic, all_chain)?, - extended_own_pnl: RelativeExtendedOwnPnl::forced_import(cfg)?, - invested_capital: RelativeInvestedCapital::forced_import(cfg)?, - }) - } - - pub(crate) fn compute( - &mut self, - max_from: Height, - supply: &SupplyCore, - unrealized: &UnrealizedFull, - realized: &RealizedFull, - exit: &Exit, - ) -> Result<()> { - self.base.compute(max_from, supply, exit)?; - self.extended_own_pnl.compute( - max_from, - &unrealized.inner, - &unrealized.gross_pnl.usd.height, - exit, - )?; - self.invested_capital - .compute(max_from, unrealized, realized, exit)?; - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/relative/full.rs b/crates/brk_computer/src/distribution/metrics/relative/full.rs deleted file mode 100644 index d09a22875..000000000 --- a/crates/brk_computer/src/distribution/metrics/relative/full.rs +++ /dev/null @@ -1,104 +0,0 @@ -use brk_error::Result; -use brk_traversable::Traversable; -use brk_types::{Height, PartsPerMillion32, Sats, Version}; -use vecdb::{Exit, Rw, StorageMode}; - -use crate::{ - distribution::{ - AllChainCache, - metrics::{ImportConfig, SupplyCore, UnrealizedBasic}, - }, - internal::{LazyPercentPerBlock, PercentPerBlock, RatioSats}, -}; - -/// Full relative metrics (sth/lth/all tier). -#[derive(Traversable)] -pub struct RelativeFull { - #[traversable(wrap = "supply/in_profit", rename = "share")] - pub supply_in_profit_share: PercentPerBlock, - #[traversable(wrap = "supply/in_loss", rename = "share")] - pub supply_in_loss_share: PercentPerBlock, - - #[traversable(wrap = "unrealized/profit", rename = "to_mcap")] - pub unrealized_profit_to_mcap: LazyPercentPerBlock, - #[traversable(wrap = "unrealized/loss", rename = "to_mcap")] - pub unrealized_loss_to_mcap: LazyPercentPerBlock, -} - -impl RelativeFull { - pub(crate) fn forced_import( - cfg: &ImportConfig, - unrealized: &UnrealizedBasic, - all_chain: &AllChainCache, - ) -> Result { - let v1 = Version::ONE; - let v2 = Version::new(2); - let profit_name = cfg.name("unrealized_profit_to_mcap"); - let profit_source = all_chain.with_market_cap( - &format!("{profit_name}_ppm_source"), - v2, - &unrealized.profit.cents.height, - |_, profit, market_cap| Self::ratio_to_market_cap(profit, market_cap), - ); - let loss_name = cfg.name("unrealized_loss_to_mcap"); - let loss_source = all_chain.with_market_cap( - &format!("{loss_name}_ppm_source"), - v2, - &unrealized.loss.cents.height, - |_, loss, market_cap| Self::ratio_to_market_cap(loss, market_cap), - ); - - Ok(Self { - supply_in_profit_share: cfg.import("supply_in_profit_share", v1)?, - supply_in_loss_share: cfg.import("supply_in_loss_share", v1)?, - unrealized_profit_to_mcap: LazyPercentPerBlock::from_uncached_height_source( - &profit_name, - v2, - profit_source, - cfg.indexes, - ), - unrealized_loss_to_mcap: LazyPercentPerBlock::from_uncached_height_source( - &loss_name, - v2, - loss_source, - cfg.indexes, - ), - }) - } - - pub(crate) fn compute( - &mut self, - max_from: Height, - supply: &SupplyCore, - exit: &Exit, - ) -> Result<()> { - self.supply_in_profit_share - .compute_binary::>( - max_from, - &supply.in_profit.sats.height, - &supply.total.sats.height, - exit, - )?; - self.supply_in_loss_share - .compute_binary::>( - max_from, - &supply.in_loss.sats.height, - &supply.total.sats.height, - exit, - )?; - - Ok(()) - } - - fn ratio_to_market_cap( - value: brk_types::Cents, - market_cap: brk_types::Cents, - ) -> PartsPerMillion32 { - let ratio = f64::from(value) / f64::from(market_cap); - if ratio.is_finite() { - PartsPerMillion32::from(ratio) - } else { - PartsPerMillion32::default() - } - } -} diff --git a/crates/brk_computer/src/distribution/metrics/relative/gross_pnl_composition.rs b/crates/brk_computer/src/distribution/metrics/relative/gross_pnl_composition.rs new file mode 100644 index 000000000..ccb06bedd --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/relative/gross_pnl_composition.rs @@ -0,0 +1,191 @@ +use brk_cohort::{UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, UTXOAggregate, UTXOAggregateId}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Dollars, Height, PartsPerMillion32, PartsPerMillionSigned32, Version}; +use vecdb::{ + AnyStoredVec, Database, Exit, PcoVec, ReadOnlyClone, ReadOnlyColumnarVec, ReadableColumnarVec, + Rw, StorageMode, +}; + +use crate::{ + distribution::metrics::utxo_metric_name, + indexes, + internal::{ColumnarPerBlock, FixedRatio, LazyPercentPerBlock}, +}; + +use super::RelativeSource; + +const VERSION: Version = Version::ONE; + +#[derive(Traversable)] +pub struct GrossPnlComposition { + #[traversable(wrap = "unrealized/profit", rename = "to_own_gross_pnl")] + pub unrealized_profit_to_own_gross_pnl: UTXOAggregate>, + #[traversable(wrap = "unrealized/loss", rename = "to_own_gross_pnl")] + pub unrealized_loss_to_own_gross_pnl: UTXOAggregate>, + #[traversable(wrap = "unrealized/net_pnl", rename = "to_own_gross_pnl")] + pub net_unrealized_pnl_to_own_gross_pnl: + UTXOAggregate>, + #[traversable(hidden)] + pub profit_share_source: ColumnarPerBlock, +} + +impl GrossPnlComposition { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + ) -> Result { + let version = version + VERSION; + let profit_share_source = ColumnarPerBlock::forced_import( + db, + "unrealized_profit_to_own_gross_pnl_ppm_by_aggregate", + version, + |_| (), + )?; + let source = profit_share_source.height.read_only_clone(); + let unrealized_profit_to_own_gross_pnl = Self::views( + &source, + "unrealized_profit_to_own_gross_pnl", + version, + Self::public_profit_share, + indexes, + ); + let unrealized_loss_to_own_gross_pnl = Self::views( + &source, + "unrealized_loss_to_own_gross_pnl", + version, + Self::public_loss_share, + indexes, + ); + let net_unrealized_pnl_to_own_gross_pnl = Self::views( + &source, + "net_unrealized_pnl_to_own_gross_pnl", + version, + Self::public_net_share, + indexes, + ); + + Ok(Self { + unrealized_profit_to_own_gross_pnl, + unrealized_loss_to_own_gross_pnl, + net_unrealized_pnl_to_own_gross_pnl, + profit_share_source, + }) + } + + fn views( + source: &ReadOnlyColumnarVec, UTXOAggregateId>, + metric: &str, + version: Version, + compute: fn(Height, PartsPerMillion32) -> B, + indexes: &indexes::Vecs, + ) -> UTXOAggregate> { + UTXOAggregate::from_fn(|id| { + let name = utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ); + let source = source.column(&format!("{name}_source"), version, id); + LazyPercentPerBlock::from_uncached_indexed_source( + &name, version, &source, compute, indexes, + ) + }) + } + + #[inline(always)] + fn stored_profit_share(profit: Dollars, gross: Dollars) -> PartsPerMillion32 { + if gross.is_zero() { + PartsPerMillion32::NAN + } else { + PartsPerMillion32::from(f64::from(profit) / f64::from(gross)) + } + } + + #[inline(always)] + fn public_profit_share(_: Height, profit_share: PartsPerMillion32) -> PartsPerMillion32 { + if profit_share.is_nan() { + PartsPerMillion32::ZERO + } else { + profit_share + } + } + + #[inline(always)] + fn public_loss_share(_: Height, profit_share: PartsPerMillion32) -> PartsPerMillion32 { + if profit_share.is_nan() { + PartsPerMillion32::ZERO + } else { + PartsPerMillion32::ONE - profit_share + } + } + + #[inline(always)] + fn public_net_share(_: Height, profit_share: PartsPerMillion32) -> PartsPerMillionSigned32 { + if profit_share.is_nan() { + PartsPerMillionSigned32::ZERO + } else { + PartsPerMillionSigned32::from(2.0 * f64::from(profit_share) - 1.0) + } + } + + pub(crate) fn compute( + &mut self, + max_from: Height, + sources: &UTXOAggregate>, + exit: &Exit, + ) -> Result<()> { + self.profit_share_source.compute_columns2( + max_from, + |id| &id.select(sources).unrealized.profit.usd.height, + |id| &id.select(sources).unrealized_aggregate.gross_pnl.usd.height, + |_, profit, gross| Self::stored_profit_share(profit, gross), + exit, + ) + } + + pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { + self.profit_share_source.stored_mut() + } +} + +#[cfg(test)] +mod tests { + use brk_types::{Dollars, Height, PartsPerMillion32, PartsPerMillionSigned32}; + + use super::GrossPnlComposition; + + #[test] + fn derives_every_public_share_from_profit_composition() { + let empty = GrossPnlComposition::stored_profit_share(Dollars::ZERO, Dollars::ZERO); + assert!(empty.is_nan()); + assert_eq!( + GrossPnlComposition::public_profit_share(Height::ZERO, empty), + PartsPerMillion32::ZERO + ); + assert_eq!( + GrossPnlComposition::public_loss_share(Height::ZERO, empty), + PartsPerMillion32::ZERO + ); + assert_eq!( + GrossPnlComposition::public_net_share(Height::ZERO, empty), + PartsPerMillionSigned32::ZERO + ); + + let profit_share = + GrossPnlComposition::stored_profit_share(Dollars::from(25.0), Dollars::from(100.0)); + assert_eq!( + GrossPnlComposition::public_profit_share(Height::ZERO, profit_share), + PartsPerMillion32::from(0.25) + ); + assert_eq!( + GrossPnlComposition::public_loss_share(Height::ZERO, profit_share), + PartsPerMillion32::from(0.75) + ); + assert_eq!( + GrossPnlComposition::public_net_share(Height::ZERO, profit_share), + PartsPerMillionSigned32::from(-0.5) + ); + } +} diff --git a/crates/brk_computer/src/distribution/metrics/relative/invested_capital.rs b/crates/brk_computer/src/distribution/metrics/relative/invested_capital.rs deleted file mode 100644 index 5748be598..000000000 --- a/crates/brk_computer/src/distribution/metrics/relative/invested_capital.rs +++ /dev/null @@ -1,53 +0,0 @@ -use brk_error::Result; -use brk_traversable::Traversable; -use brk_types::{Cents, Height, PartsPerMillion32, Version}; -use vecdb::{Exit, Rw, StorageMode}; - -use crate::internal::{PercentPerBlock, RatioCents}; - -use crate::distribution::metrics::{ImportConfig, RealizedFull, UnrealizedFull}; - -/// Shares of invested capital in profit / in loss relative to own realized cap. -/// Present for cohorts with `UnrealizedFull` (all, sth, lth). -#[derive(Traversable)] -pub struct RelativeInvestedCapital { - #[traversable(wrap = "invested_capital/in_profit", rename = "share")] - pub in_profit_share: PercentPerBlock, - #[traversable(wrap = "invested_capital/in_loss", rename = "share")] - pub in_loss_share: PercentPerBlock, -} - -impl RelativeInvestedCapital { - pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v0 = Version::ZERO; - Ok(Self { - in_profit_share: cfg.import("invested_capital_in_profit_share", v0)?, - in_loss_share: cfg.import("invested_capital_in_loss_share", v0)?, - }) - } - - pub(crate) fn compute( - &mut self, - max_from: Height, - unrealized: &UnrealizedFull, - realized: &RealizedFull, - exit: &Exit, - ) -> Result<()> { - let realized_cap = &realized.core.minimal.cap.cents.height; - self.in_profit_share - .compute_binary::>( - max_from, - &unrealized.invested_capital.in_profit.cents.height, - realized_cap, - exit, - )?; - self.in_loss_share - .compute_binary::>( - max_from, - &unrealized.invested_capital.in_loss.cents.height, - realized_cap, - exit, - )?; - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/relative/mod.rs b/crates/brk_computer/src/distribution/metrics/relative/mod.rs index de9669ce6..dbbab18f5 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/mod.rs @@ -1,13 +1,9 @@ -mod extended_own_market_cap; -mod extended_own_pnl; -mod for_all; -mod full; -mod invested_capital; -mod with_extended; +mod gross_pnl_composition; +mod source; +mod supply_profitability_shares; +mod vecs; -pub use extended_own_market_cap::RelativeExtendedOwnMarketCap; -pub use extended_own_pnl::RelativeExtendedOwnPnl; -pub use for_all::RelativeForAll; -pub use full::RelativeFull; -pub use invested_capital::RelativeInvestedCapital; -pub use with_extended::RelativeWithExtended; +pub use gross_pnl_composition::GrossPnlComposition; +pub(crate) use source::RelativeSource; +pub use supply_profitability_shares::SupplyProfitabilityShares; +pub use vecs::RelativeVecs; diff --git a/crates/brk_computer/src/distribution/metrics/relative/source.rs b/crates/brk_computer/src/distribution/metrics/relative/source.rs new file mode 100644 index 000000000..c171c3bb6 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/relative/source.rs @@ -0,0 +1,16 @@ +use brk_types::{PartsPerMillion64, PartsPerMillionSigned32}; + +use crate::{ + distribution::metrics::{ + RealizedSources, SupplySources, UnrealizedAggregateSources, UnrealizedSources, + }, + internal::LazyRatioPerBlock, +}; + +pub(crate) struct RelativeSource<'a> { + pub supply: SupplySources, + pub unrealized: UnrealizedSources, + pub unrealized_aggregate: UnrealizedAggregateSources, + pub realized: RealizedSources, + pub nupl: &'a LazyRatioPerBlock, +} diff --git a/crates/brk_computer/src/distribution/metrics/relative/supply_profitability_shares.rs b/crates/brk_computer/src/distribution/metrics/relative/supply_profitability_shares.rs new file mode 100644 index 000000000..484d20896 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/relative/supply_profitability_shares.rs @@ -0,0 +1,163 @@ +use brk_cohort::{UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, UTXOAggregate, UTXOAggregateId}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, PartsPerMillion32, Sats, Version}; +use vecdb::{ + AnyStoredVec, BinaryTransform, Database, Exit, PcoVec, ReadOnlyClone, ReadOnlyColumnarVec, + ReadableColumnarVec, Rw, StorageMode, +}; + +use crate::{ + distribution::metrics::utxo_metric_name, + indexes, + internal::{ColumnarPerBlock, LazyPercentPerBlock, RatioSats}, +}; + +use super::RelativeSource; + +const VERSION: Version = Version::ONE; + +#[derive(Traversable)] +pub struct SupplyProfitabilityShares { + #[traversable(wrap = "supply/in_profit", rename = "share")] + pub supply_in_profit_share: UTXOAggregate>, + #[traversable(wrap = "supply/in_loss", rename = "share")] + pub supply_in_loss_share: UTXOAggregate>, + #[traversable(hidden)] + pub profit_share_source: ColumnarPerBlock, +} + +impl SupplyProfitabilityShares { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + ) -> Result { + let version = version + VERSION; + let profit_share_source = ColumnarPerBlock::forced_import( + db, + "supply_in_profit_share_ppm_by_aggregate", + version, + |_| (), + )?; + let source = profit_share_source.height.read_only_clone(); + let supply_in_profit_share = Self::views( + &source, + "supply_in_profit_share", + version, + Self::public_profit_share, + indexes, + ); + let supply_in_loss_share = Self::views( + &source, + "supply_in_loss_share", + version, + Self::public_loss_share, + indexes, + ); + + Ok(Self { + supply_in_profit_share, + supply_in_loss_share, + profit_share_source, + }) + } + + fn views( + source: &ReadOnlyColumnarVec, UTXOAggregateId>, + metric: &str, + version: Version, + compute: fn(Height, PartsPerMillion32) -> PartsPerMillion32, + indexes: &indexes::Vecs, + ) -> UTXOAggregate> { + UTXOAggregate::from_fn(|id| { + let name = utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ); + let source = source.column(&format!("{name}_source"), version, id); + LazyPercentPerBlock::from_uncached_indexed_source( + &name, version, &source, compute, indexes, + ) + }) + } + + #[inline(always)] + fn stored_profit_share(profit: Sats, total: Sats) -> PartsPerMillion32 { + if total.is_zero() { + PartsPerMillion32::NAN + } else { + RatioSats::apply(profit, total) + } + } + + #[inline(always)] + fn public_profit_share(_: Height, profit_share: PartsPerMillion32) -> PartsPerMillion32 { + if profit_share.is_nan() { + PartsPerMillion32::ZERO + } else { + profit_share + } + } + + #[inline(always)] + fn public_loss_share(_: Height, profit_share: PartsPerMillion32) -> PartsPerMillion32 { + if profit_share.is_nan() { + PartsPerMillion32::ZERO + } else { + PartsPerMillion32::ONE - profit_share + } + } + + pub(crate) fn compute( + &mut self, + max_from: Height, + sources: &UTXOAggregate>, + exit: &Exit, + ) -> Result<()> { + self.profit_share_source.compute_columns2( + max_from, + |id| &id.select(sources).supply.in_profit.sats.height, + |id| &id.select(sources).supply.total.sats.height, + |_, profit, total| Self::stored_profit_share(profit, total), + exit, + ) + } + + pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { + self.profit_share_source.stored_mut() + } +} + +#[cfg(test)] +mod tests { + use brk_types::{Height, PartsPerMillion32, Sats}; + + use super::SupplyProfitabilityShares; + + #[test] + fn derives_both_public_shares_from_profit_share() { + let empty = SupplyProfitabilityShares::stored_profit_share(Sats::ZERO, Sats::ZERO); + assert!(empty.is_nan()); + assert_eq!( + SupplyProfitabilityShares::public_profit_share(Height::ZERO, empty), + PartsPerMillion32::ZERO + ); + assert_eq!( + SupplyProfitabilityShares::public_loss_share(Height::ZERO, empty), + PartsPerMillion32::ZERO + ); + + let profit_share = + SupplyProfitabilityShares::stored_profit_share(Sats::new(25), Sats::new(100)); + assert_eq!( + SupplyProfitabilityShares::public_profit_share(Height::ZERO, profit_share), + PartsPerMillion32::from(0.25) + ); + assert_eq!( + SupplyProfitabilityShares::public_loss_share(Height::ZERO, profit_share), + PartsPerMillion32::from(0.75) + ); + } +} diff --git a/crates/brk_computer/src/distribution/metrics/relative/vecs.rs b/crates/brk_computer/src/distribution/metrics/relative/vecs.rs new file mode 100644 index 000000000..3bbbe6e3f --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/relative/vecs.rs @@ -0,0 +1,266 @@ +use brk_cohort::{ + ByTerm, TERM_FILTERS, TERM_NAMES, TermId, UTXO_AGGREGATE_FILTERS, UTXO_AGGREGATE_NAMES, + UTXOAggregate, UTXOAggregateId, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, PartsPerMillion32, PartsPerMillionSigned32, Version}; +use vecdb::{AnyStoredVec, BinaryTransform, Database, Exit, Rw, StorageMode}; + +use crate::{ + distribution::{ + AllChainCache, + metrics::{AggregatePercentPerBlock, utxo_metric_name}, + }, + indexes, + internal::{ + ColumnarPerBlock, LazyColumnPercentPerBlock, LazyPercentPerBlock, RatioCents, RatioDollars, + }, +}; + +use super::{GrossPnlComposition, RelativeSource, SupplyProfitabilityShares}; + +#[derive(Traversable)] +pub struct RelativeVecs { + #[traversable(flatten)] + pub supply_profitability_shares: SupplyProfitabilityShares, + #[traversable(wrap = "unrealized/profit", rename = "to_mcap")] + pub unrealized_profit_to_mcap: UTXOAggregate>, + #[traversable(wrap = "unrealized/loss", rename = "to_mcap")] + pub unrealized_loss_to_mcap: UTXOAggregate>, + #[traversable(wrap = "unrealized/profit", rename = "to_own_mcap")] + pub unrealized_profit_to_own_mcap: ColumnarPerBlock< + PartsPerMillion32, + TermId, + ByTerm>, + M, + >, + #[traversable(wrap = "unrealized/loss", rename = "to_own_mcap")] + pub unrealized_loss_to_own_mcap: ColumnarPerBlock< + PartsPerMillion32, + TermId, + ByTerm>, + M, + >, + #[traversable(wrap = "unrealized/net_pnl", rename = "to_own_mcap")] + pub net_unrealized_pnl_to_own_mcap: ByTerm>, + #[traversable(flatten)] + pub gross_pnl_composition: GrossPnlComposition, + #[traversable(wrap = "invested_capital/in_profit", rename = "share")] + pub invested_capital_in_profit_share: AggregatePercentPerBlock, + #[traversable(wrap = "invested_capital/in_loss", rename = "share")] + pub invested_capital_in_loss_share: AggregatePercentPerBlock, +} + +impl RelativeVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + all_chain: &AllChainCache, + sources: &UTXOAggregate>, + ) -> Result { + let aggregate_version = version + Version::ONE; + let supply_profitability_shares = + SupplyProfitabilityShares::forced_import(db, aggregate_version, indexes)?; + let unrealized_profit_to_own_mcap = Self::import_term_percent( + db, + "unrealized_profit_to_own_mcap", + aggregate_version, + indexes, + )?; + let unrealized_loss_to_own_mcap = Self::import_term_percent( + db, + "unrealized_loss_to_own_mcap", + aggregate_version, + indexes, + )?; + let gross_pnl_composition = + GrossPnlComposition::forced_import(db, aggregate_version, indexes)?; + let invested_capital_in_profit_share = AggregatePercentPerBlock::forced_import( + db, + "invested_capital_in_profit_share", + aggregate_version, + indexes, + )?; + let invested_capital_in_loss_share = AggregatePercentPerBlock::forced_import( + db, + "invested_capital_in_loss_share", + aggregate_version, + indexes, + )?; + + let unrealized_profit_to_mcap = UTXOAggregate::from_fn(|id| { + let source = id.select(sources); + let name = Self::aggregate_metric_name(id, "unrealized_profit_to_mcap"); + let source = all_chain.with_market_cap( + &format!("{name}_ppm_source"), + Version::new(2), + &source.unrealized.profit.cents.height, + |_, value, market_cap| Self::ratio_to_market_cap(value, market_cap), + ); + LazyPercentPerBlock::from_uncached_height_source( + &name, + Version::new(2), + source, + indexes, + ) + }); + let unrealized_loss_to_mcap = UTXOAggregate::from_fn(|id| { + let source = id.select(sources); + let name = Self::aggregate_metric_name(id, "unrealized_loss_to_mcap"); + let source = all_chain.with_market_cap( + &format!("{name}_ppm_source"), + Version::new(2), + &source.unrealized.loss.cents.height, + |_, value, market_cap| Self::ratio_to_market_cap(value, market_cap), + ); + LazyPercentPerBlock::from_uncached_height_source( + &name, + Version::new(2), + source, + indexes, + ) + }); + let net_unrealized_pnl_to_own_mcap = ByTerm::from_fn(|term_id| { + let aggregate_id = match term_id { + TermId::Short => UTXOAggregateId::Sth, + TermId::Long => UTXOAggregateId::Lth, + }; + LazyPercentPerBlock::from_height_source( + &Self::aggregate_metric_name(aggregate_id, "net_unrealized_pnl_to_own_mcap"), + version + Version::new(4), + aggregate_id.select(sources).nupl.ppm.height.clone(), + indexes, + ) + }); + + Ok(Self { + supply_profitability_shares, + unrealized_profit_to_mcap, + unrealized_loss_to_mcap, + unrealized_profit_to_own_mcap, + unrealized_loss_to_own_mcap, + net_unrealized_pnl_to_own_mcap, + gross_pnl_composition, + invested_capital_in_profit_share, + invested_capital_in_loss_share, + }) + } + + fn import_term_percent( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + ) -> Result< + ColumnarPerBlock< + PartsPerMillion32, + TermId, + ByTerm>, + >, + > { + ColumnarPerBlock::forced_import(db, &format!("{metric}_ppm_by_term"), version, |source| { + ByTerm::from_fn(|id| { + let name = + utxo_metric_name(id.select(&TERM_FILTERS), id.select(&TERM_NAMES).id, metric); + LazyColumnPercentPerBlock::new(&name, version, source, id, indexes) + }) + }) + } + + fn aggregate_metric_name(id: UTXOAggregateId, metric: &str) -> String { + utxo_metric_name( + id.select(&UTXO_AGGREGATE_FILTERS), + id.select(&UTXO_AGGREGATE_NAMES).id, + metric, + ) + } + + fn ratio_to_market_cap(value: Cents, market_cap: Cents) -> PartsPerMillion32 { + let ratio = f64::from(value) / f64::from(market_cap); + if ratio.is_finite() { + PartsPerMillion32::from(ratio) + } else { + PartsPerMillion32::default() + } + } + + fn term_source<'a>( + sources: &'a UTXOAggregate>, + id: TermId, + ) -> &'a RelativeSource<'a> { + match id { + TermId::Short => &sources.sth, + TermId::Long => &sources.lth, + } + } + + pub(crate) fn compute( + &mut self, + max_from: Height, + sources: &UTXOAggregate>, + exit: &Exit, + ) -> Result<()> { + self.supply_profitability_shares + .compute(max_from, sources, exit)?; + self.unrealized_profit_to_own_mcap.compute_columns2( + max_from, + |id| &Self::term_source(sources, id).unrealized.profit.usd.height, + |id| &Self::term_source(sources, id).supply.total.usd.height, + |_, value, market_cap| RatioDollars::::apply(value, market_cap), + exit, + )?; + self.unrealized_loss_to_own_mcap.compute_columns2( + max_from, + |id| &Self::term_source(sources, id).unrealized.loss.usd.height, + |id| &Self::term_source(sources, id).supply.total.usd.height, + |_, value, market_cap| RatioDollars::::apply(value, market_cap), + exit, + )?; + self.gross_pnl_composition + .compute(max_from, sources, exit)?; + self.invested_capital_in_profit_share.compute_columns2( + max_from, + |id| { + &id.select(sources) + .unrealized_aggregate + .invested_capital_in_profit + .cents + .height + }, + |id| &id.select(sources).realized.cap.cents.height, + |_, invested, realized_cap| { + RatioCents::::apply(invested, realized_cap) + }, + exit, + )?; + self.invested_capital_in_loss_share.compute_columns2( + max_from, + |id| { + &id.select(sources) + .unrealized_aggregate + .invested_capital_in_loss + .cents + .height + }, + |id| &id.select(sources).realized.cap.cents.height, + |_, invested, realized_cap| { + RatioCents::::apply(invested, realized_cap) + }, + exit, + )?; + Ok(()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + vec![ + self.supply_profitability_shares.stored_mut(), + self.unrealized_profit_to_own_mcap.stored_mut(), + self.unrealized_loss_to_own_mcap.stored_mut(), + self.gross_pnl_composition.stored_mut(), + self.invested_capital_in_profit_share.stored_mut(), + self.invested_capital_in_loss_share.stored_mut(), + ] + } +} diff --git a/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs b/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs deleted file mode 100644 index ef21f5a1e..000000000 --- a/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs +++ /dev/null @@ -1,72 +0,0 @@ -use brk_error::Result; -use brk_traversable::Traversable; -use brk_types::{Dollars, Height}; -use derive_more::{Deref, DerefMut}; -use vecdb::{Exit, ReadableVec, Rw, StorageMode}; - -use crate::distribution::{ - AllChainCache, - metrics::{ImportConfig, RealizedFull, SupplyCore, UnrealizedFull}, -}; - -use super::{ - RelativeExtendedOwnMarketCap, RelativeExtendedOwnPnl, RelativeFull, RelativeInvestedCapital, -}; - -/// Full extended relative metrics (base + own_market_cap + own_pnl + invested_capital). -/// Used by: sth, lth cohorts. -#[derive(Deref, DerefMut, Traversable)] -pub struct RelativeWithExtended { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub base: RelativeFull, - #[traversable(flatten)] - pub extended_own_market_cap: RelativeExtendedOwnMarketCap, - #[traversable(flatten)] - pub extended_own_pnl: RelativeExtendedOwnPnl, - #[traversable(flatten)] - pub invested_capital: RelativeInvestedCapital, -} - -impl RelativeWithExtended { - pub(crate) fn forced_import( - cfg: &ImportConfig, - unrealized: &UnrealizedFull, - all_chain: &AllChainCache, - ) -> Result { - Ok(Self { - base: RelativeFull::forced_import(cfg, &unrealized.inner.basic, all_chain)?, - extended_own_market_cap: RelativeExtendedOwnMarketCap::forced_import( - cfg, - &unrealized.inner, - )?, - extended_own_pnl: RelativeExtendedOwnPnl::forced_import(cfg)?, - invested_capital: RelativeInvestedCapital::forced_import(cfg)?, - }) - } - - #[allow(clippy::too_many_arguments)] - pub(crate) fn compute( - &mut self, - max_from: Height, - supply: &SupplyCore, - unrealized: &UnrealizedFull, - realized: &RealizedFull, - own_market_cap: &impl ReadableVec, - exit: &Exit, - ) -> Result<()> { - self.base.compute(max_from, supply, exit)?; - self.extended_own_market_cap - .compute(max_from, &unrealized.inner, own_market_cap, exit)?; - self.extended_own_pnl.compute( - max_from, - &unrealized.inner, - &unrealized.gross_pnl.usd.height, - exit, - )?; - self.invested_capital - .compute(max_from, unrealized, realized, exit)?; - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/supply/age_range.rs b/crates/brk_computer/src/distribution/metrics/supply/age_range.rs deleted file mode 100644 index af8a1d568..000000000 --- a/crates/brk_computer/src/distribution/metrics/supply/age_range.rs +++ /dev/null @@ -1,176 +0,0 @@ -use brk_cohort::{AGE_RANGE_IDS, AgeRangeId, Filter}; -use brk_error::Result; -use brk_types::{Height, Sats, Version}; -use vecdb::{ - AnyStoredVec, AnyVec, ColumnId, ColumnarVec, Database, EagerVec, ImportableVec, PcoVec, - ReadOnlyClone, ReadableColumnarVec, Rw, StorageMode, WritableVec, -}; - -use crate::{ - distribution::metrics::{AllSupplyCache, ImportConfig, SupplyCore}, - internal::LazySpotValuePerBlock, -}; - -type Source = M::Stored, AgeRangeId>>>; - -pub(crate) struct AgeRangeSupplySources { - total: Source, - in_profit: Source, - in_loss: Source, -} - -impl AgeRangeSupplySources { - pub(crate) fn forced_import( - db: &Database, - prefix: &str, - version: Version, - ) -> Result { - Ok(Self { - total: EagerVec::forced_import( - db, - &format!("{prefix}_age_range_supply_sats"), - version, - )?, - in_profit: EagerVec::forced_import( - db, - &format!("{prefix}_age_range_supply_in_profit_sats"), - version, - )?, - in_loss: EagerVec::forced_import( - db, - &format!("{prefix}_age_range_supply_in_loss_sats"), - version, - )?, - }) - } - - pub(crate) fn all(&self, cfg: &ImportConfig) -> (SupplyCore, AllSupplyCache) { - let total_name = cfg.name("supply"); - let total_source = self.total.read_only_clone().sum_columns( - &format!("{total_name}_sats"), - cfg.version, - AGE_RANGE_IDS, - ); - let all_supply = AllSupplyCache::new(total_source); - let total = LazySpotValuePerBlock::from_sats_source( - &total_name, - cfg.version, - all_supply.readable_boxed_clone(), - cfg.indexes, - cfg.spot_price, - ); - let in_profit = - Self::summed_spot(&self.in_profit, cfg, "supply_in_profit", AGE_RANGE_IDS); - let in_loss = Self::summed_spot(&self.in_loss, cfg, "supply_in_loss", AGE_RANGE_IDS); - - ( - SupplyCore::from_lazy_all(cfg, total, in_profit, in_loss), - all_supply, - ) - } - - pub(crate) fn column( - &self, - cfg: &ImportConfig, - column: AgeRangeId, - all_supply: &AllSupplyCache, - ) -> SupplyCore { - SupplyCore::from_lazy( - cfg, - Self::column_spot(&self.total, cfg, "supply", column), - Self::column_spot(&self.in_profit, cfg, "supply_in_profit", column), - Self::column_spot(&self.in_loss, cfg, "supply_in_loss", column), - all_supply, - ) - } - - pub(crate) fn filtered( - &self, - cfg: &ImportConfig, - filter: &Filter, - all_supply: &AllSupplyCache, - ) -> SupplyCore { - let columns: Vec<_> = AGE_RANGE_IDS - .into_iter() - .filter(|column| filter.includes(column.filter())) - .collect(); - - SupplyCore::from_lazy( - cfg, - Self::summed_spot(&self.total, cfg, "supply", columns.iter().copied()), - Self::summed_spot( - &self.in_profit, - cfg, - "supply_in_profit", - columns.iter().copied(), - ), - Self::summed_spot(&self.in_loss, cfg, "supply_in_loss", columns), - all_supply, - ) - } - - fn column_spot( - source: &EagerVec, AgeRangeId>>, - cfg: &ImportConfig, - suffix: &str, - column: AgeRangeId, - ) -> LazySpotValuePerBlock { - let name = cfg.name(suffix); - let source = source.read_only_clone().column( - &format!("{name}_sats"), - cfg.version, - column, - ); - LazySpotValuePerBlock::from_sats_source( - &name, - cfg.version, - source, - cfg.indexes, - cfg.spot_price, - ) - } - - fn summed_spot( - source: &EagerVec, AgeRangeId>>, - cfg: &ImportConfig, - suffix: &str, - columns: impl IntoIterator, - ) -> LazySpotValuePerBlock { - let name = cfg.name(suffix); - let source = source.read_only_clone().sum_columns( - &format!("{name}_sats"), - cfg.version, - columns, - ); - LazySpotValuePerBlock::from_sats_source( - &name, - cfg.version, - source, - cfg.indexes, - cfg.spot_price, - ) - } - - #[inline(always)] - pub(crate) fn push( - &mut self, - total: ::Row, - in_profit: ::Row, - in_loss: ::Row, - ) { - self.total.push(total); - self.in_profit.push(in_profit); - self.in_loss.push(in_loss); - } - - pub(crate) fn stored_vecs_mut(&mut self) -> [&mut dyn AnyStoredVec; 3] { - [&mut self.total, &mut self.in_profit, &mut self.in_loss] - } - - pub(crate) fn len(&self) -> usize { - self.total - .len() - .min(self.in_profit.len()) - .min(self.in_loss.len()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/supply/base.rs b/crates/brk_computer/src/distribution/metrics/supply/base.rs index 53e43e894..6bd9e26f7 100644 --- a/crates/brk_computer/src/distribution/metrics/supply/base.rs +++ b/crates/brk_computer/src/distribution/metrics/supply/base.rs @@ -1,155 +1,114 @@ -use brk_error::Result; -use brk_indexer::Lengths; use brk_traversable::Traversable; use brk_types::{Height, PartsPerMillion32, PartsPerMillionSigned64, Sats, SatsSigned, Version}; -use vecdb::{ - AnyStoredVec, AnyVec, BinaryTransform, EagerVec, Exit, ImportableVec, PcoVec, ReadOnlyClone, - ReadableCloneableVec, Rw, StorageMode, WritableVec, +use vecdb::{BinaryTransform, ReadableCloneableVec}; + +use crate::{ + distribution::metrics::AllSupplyCache, + indexes, + internal::{ + CachedWindowStartVec, LazyIndexedVec, LazyPercentPerBlock, + LazyRollingDeltasAmountFromHeight, LazySpotValuePerBlock, RatioSats, Windows, + }, }; -use crate::distribution::state::{CohortState, CostBasisOps, RealizedOps}; - -use crate::internal::{ - LazyIndexedVec, LazyPercentPerBlock, LazyRollingDeltasAmountFromHeight, LazySpotValuePerBlock, - RatioSats, -}; - -use crate::distribution::metrics::{AllSupplyCache, ImportConfig}; - -/// Base supply metrics: total supply + dominance (share of circulating). -#[derive(Traversable)] -pub struct SupplyBase { +#[derive(Clone, Traversable)] +pub struct SupplyBase { pub total: LazySpotValuePerBlock, pub delta: LazyRollingDeltasAmountFromHeight, #[traversable(rename = "dominance")] pub dominance: LazyPercentPerBlock, - #[traversable(hidden)] - source: Option>>>, } impl SupplyBase { - pub(crate) fn forced_import(cfg: &ImportConfig, all_supply: &AllSupplyCache) -> Result { - let name = cfg.name("supply"); - let sats_source = - EagerVec::forced_import(cfg.db, &format!("{name}_sats"), cfg.version)?; - let supply = LazySpotValuePerBlock::from_sats_source( - &name, - cfg.version, - sats_source.read_only_clone(), - cfg.indexes, - cfg.spot_price, - ); - let name = cfg.name("supply_dominance"); - let dominance_source = LazyIndexedVec::new( - &format!("{name}_ppm_source"), - cfg.version, - supply.sats.height.read_only_boxed_clone(), - all_supply.cached_boxed_clone(), - |_, supply, all_supply| RatioSats::::apply(supply, all_supply), - ); - let dominance = LazyPercentPerBlock::from_height_source( - &name, - cfg.version, - dominance_source, - cfg.indexes, - ); - - Ok(Self::new(cfg, supply, dominance, Some(sats_source))) - } - - pub(crate) fn from_lazy( - cfg: &ImportConfig, - supply: LazySpotValuePerBlock, + pub(crate) fn from_total( + cohort_name: &str, + version: Version, + total: LazySpotValuePerBlock, all_supply: &AllSupplyCache, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, ) -> Self { - let name = cfg.name("supply_dominance"); + let dominance_name = Self::metric_name(cohort_name, "supply_dominance"); let source = LazyIndexedVec::new( - &format!("{name}_ppm_source"), - cfg.version, - supply.sats.height.read_only_boxed_clone(), + &format!("{dominance_name}_ppm_source"), + version, + total.sats.height.read_only_boxed_clone(), all_supply.cached_boxed_clone(), |_, supply, all_supply| RatioSats::::apply(supply, all_supply), ); let dominance = - LazyPercentPerBlock::from_height_source(&name, cfg.version, source, cfg.indexes); + LazyPercentPerBlock::from_height_source(&dominance_name, version, source, indexes); - Self::new(cfg, supply, dominance, None) + Self::new( + cohort_name, + version, + total, + dominance, + indexes, + cached_starts, + ) } - pub(crate) fn from_lazy_all(cfg: &ImportConfig, supply: LazySpotValuePerBlock) -> Self { + pub(crate) fn from_all_total( + cohort_name: &str, + version: Version, + total: LazySpotValuePerBlock, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Self { + let dominance_name = Self::metric_name(cohort_name, "supply_dominance"); let dominance = LazyPercentPerBlock::from_indexed_source( - &cfg.name("supply_dominance"), - cfg.version, - &supply.sats.height, + &dominance_name, + version, + &total.sats.height, Self::all_dominance, - cfg.indexes, + indexes, ); - Self::new(cfg, supply, dominance, None) + Self::new( + cohort_name, + version, + total, + dominance, + indexes, + cached_starts, + ) + } + + fn new( + cohort_name: &str, + version: Version, + total: LazySpotValuePerBlock, + dominance: LazyPercentPerBlock, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Self { + let delta = LazyRollingDeltasAmountFromHeight::new( + &Self::metric_name(cohort_name, "supply_delta"), + version + Version::TWO, + &total.sats.height, + cached_starts, + indexes, + ); + + Self { + total, + delta, + dominance, + } + } + + pub(super) fn metric_name(cohort_name: &str, metric: &str) -> String { + if cohort_name.is_empty() { + metric.to_owned() + } else { + format!("{cohort_name}_{metric}") + } } fn all_dominance(_height: Height, supply: Sats) -> PartsPerMillion32 { RatioSats::::apply(supply, supply) } - - fn new( - cfg: &ImportConfig, - supply: LazySpotValuePerBlock, - dominance: LazyPercentPerBlock, - source: Option>>, - ) -> Self { - let delta = LazyRollingDeltasAmountFromHeight::new( - &cfg.name("supply_delta"), - cfg.version + Version::TWO, - &supply.sats.height, - cfg.cached_starts, - cfg.indexes, - ); - - Self { - total: supply, - delta, - dominance, - source, - } - } - - pub(crate) fn min_len(&self) -> usize { - self.total.sats.height.len() - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &CohortState) { - if let Some(source) = self.source.as_mut() { - source.push(state.supply.value); - } - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - self.source - .iter_mut() - .map(|source| source as &mut dyn AnyStoredVec) - .collect() - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - if let Some(source) = self.source.as_mut() { - source.compute_sum_of_others( - starting_lengths.height, - &others - .iter() - .map(|v| &v.total.sats.height) - .collect::>(), - exit, - )?; - } - Ok(()) - } } #[cfg(test)] diff --git a/crates/brk_computer/src/distribution/metrics/supply/by_cohort.rs b/crates/brk_computer/src/distribution/metrics/supply/by_cohort.rs new file mode 100644 index 000000000..c4bbde43b --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/supply/by_cohort.rs @@ -0,0 +1,60 @@ +use brk_cohort::{Filter, UTXOGroupsWithoutAmount}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, Version}; +use vecdb::{AnyStoredVec, CachedBoxedVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{UTXOColumnarMetricWithoutAmount, UTXORows, utxo_metric_name}, + indexes, + internal::LazySpotValuePerBlock, +}; + +#[derive(Traversable)] +pub struct SupplyByCohort { + #[traversable(flatten)] + pub cohorts: UTXOGroupsWithoutAmount, + #[traversable(flatten)] + pub matrices: UTXOColumnarMetricWithoutAmount, +} + +impl SupplyByCohort { + pub(crate) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + spot_price: &CachedBoxedVec, + ) -> Result { + let matrices = + UTXOColumnarMetricWithoutAmount::forced_import(db, &format!("{metric}_sats"), version)?; + let cohorts = UTXOGroupsWithoutAmount::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, metric); + let source = matrices + .additive_source(&filter, &format!("{name}_sats"), version) + .expect("supported supply cohort"); + LazySpotValuePerBlock::from_boxed_sats_source( + &name, version, source, indexes, spot_price, + ) + }); + + Ok(Self { cohorts, matrices }) + } + + pub(crate) fn get(&self, filter: &Filter) -> Option<&LazySpotValuePerBlock> { + self.cohorts.get(filter) + } + + pub(crate) fn min_len(&self) -> usize { + self.matrices.min_len() + } + + #[inline(always)] + pub(crate) fn push(&mut self, rows: UTXORows) { + self.matrices.push(rows); + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + self.matrices.collect_vecs_mut() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/supply/cache.rs b/crates/brk_computer/src/distribution/metrics/supply/cache.rs index 31209a863..8594a1eda 100644 --- a/crates/brk_computer/src/distribution/metrics/supply/cache.rs +++ b/crates/brk_computer/src/distribution/metrics/supply/cache.rs @@ -1,8 +1,5 @@ use brk_types::{Height, Sats}; -use vecdb::{ - CachedBoxedVec, CachedReadableVec, CachedVec, ReadableBoxedVec, ReadableCloneableVec, - ReadableVec, TypedVec, -}; +use vecdb::{CachedBoxedVec, CachedReadableVec, CachedVec, ReadableVec, TypedVec}; /// Pinned in-memory snapshot of the all-cohort supply. /// @@ -11,7 +8,6 @@ use vecdb::{ #[derive(Clone)] pub(crate) struct AllSupplyCache { cache: CachedBoxedVec, - source: ReadableBoxedVec, } impl AllSupplyCache { @@ -25,20 +21,15 @@ impl AllSupplyCache { + 'static, { let cache = CachedVec::wrap(source); - let source = ReadableCloneableVec::read_only_boxed_clone(&cache); let cache = cache.cached_boxed_clone(); - Self { cache, source } + Self { cache } } pub(crate) fn cached_boxed_clone(&self) -> CachedBoxedVec { self.cache.cached_boxed_clone() } - pub(crate) fn readable_boxed_clone(&self) -> ReadableBoxedVec { - self.source.read_only_boxed_clone() - } - pub(crate) fn clear(&self) { self.cache.clear(); } @@ -47,7 +38,9 @@ impl AllSupplyCache { #[cfg(test)] mod tests { use brk_types::Version; - use vecdb::{AnyStoredVec, Database, EagerVec, ImportableVec, PcoVec, ReadOnlyClone, WritableVec}; + use vecdb::{ + AnyStoredVec, Database, EagerVec, ImportableVec, PcoVec, ReadOnlyClone, WritableVec, + }; use super::*; diff --git a/crates/brk_computer/src/distribution/metrics/supply/core.rs b/crates/brk_computer/src/distribution/metrics/supply/core.rs deleted file mode 100644 index 11fcb35d3..000000000 --- a/crates/brk_computer/src/distribution/metrics/supply/core.rs +++ /dev/null @@ -1,195 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Height, Sats, Version}; -use derive_more::{Deref, DerefMut}; -use vecdb::{ - AnyStoredVec, AnyVec, EagerVec, Exit, ImportableVec, PcoVec, ReadOnlyClone, Rw, StorageMode, - WritableVec, -}; - -use crate::distribution::state::UnrealizedState; - -use crate::internal::{ - HalveCents, HalveDollars, HalveSats, HalveSatsToBitcoin, LazySpotValuePerBlock, - LazyValuePerBlock, -}; - -use crate::distribution::metrics::{AllSupplyCache, ImportConfig}; - -use super::SupplyBase; - -/// Core supply metrics: total + halved + in_profit/in_loss. -#[derive(Deref, DerefMut, Traversable)] -pub struct SupplyCore { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub base: SupplyBase, - - pub half: LazyValuePerBlock, - pub in_profit: LazySpotValuePerBlock, - pub in_loss: LazySpotValuePerBlock, - #[traversable(hidden)] - in_profit_source: Option>>>, - #[traversable(hidden)] - in_loss_source: Option>>>, -} - -impl SupplyCore { - pub(crate) fn forced_import(cfg: &ImportConfig, all_supply: &AllSupplyCache) -> Result { - let base = SupplyBase::forced_import(cfg, all_supply)?; - let (in_profit, in_profit_source) = Self::import_spot(cfg, "supply_in_profit")?; - let (in_loss, in_loss_source) = Self::import_spot(cfg, "supply_in_loss")?; - Ok(Self::new( - cfg, - base, - in_profit, - in_loss, - Some(in_profit_source), - Some(in_loss_source), - )) - } - - pub(crate) fn from_lazy( - cfg: &ImportConfig, - total: LazySpotValuePerBlock, - in_profit: LazySpotValuePerBlock, - in_loss: LazySpotValuePerBlock, - all_supply: &AllSupplyCache, - ) -> Self { - Self::new( - cfg, - SupplyBase::from_lazy(cfg, total, all_supply), - in_profit, - in_loss, - None, - None, - ) - } - - pub(crate) fn from_lazy_all( - cfg: &ImportConfig, - total: LazySpotValuePerBlock, - in_profit: LazySpotValuePerBlock, - in_loss: LazySpotValuePerBlock, - ) -> Self { - Self::new( - cfg, - SupplyBase::from_lazy_all(cfg, total), - in_profit, - in_loss, - None, - None, - ) - } - - fn import_spot( - cfg: &ImportConfig, - suffix: &str, - ) -> Result<(LazySpotValuePerBlock, EagerVec>)> { - let name = cfg.name(suffix); - let source = EagerVec::forced_import(cfg.db, &format!("{name}_sats"), cfg.version)?; - let series = LazySpotValuePerBlock::from_sats_source( - &name, - cfg.version, - source.read_only_clone(), - cfg.indexes, - cfg.spot_price, - ); - Ok((series, source)) - } - - fn new( - cfg: &ImportConfig, - base: SupplyBase, - in_profit: LazySpotValuePerBlock, - in_loss: LazySpotValuePerBlock, - in_profit_source: Option>>, - in_loss_source: Option>>, - ) -> Self { - let half = LazyValuePerBlock::from_spot_block_source::< - HalveSats, - HalveSatsToBitcoin, - HalveCents, - HalveDollars, - >(&cfg.name("supply_half"), &base.total, cfg.version); - - Self { - base, - half, - in_profit, - in_loss, - in_profit_source, - in_loss_source, - } - } - - pub(crate) fn min_len(&self) -> usize { - self.base - .min_len() - .min(self.in_profit.sats.height.len()) - .min(self.in_loss.sats.height.len()) - } - - #[inline(always)] - pub(crate) fn push_profitability(&mut self, state: &UnrealizedState) { - if let Some(source) = self.in_profit_source.as_mut() { - source.push(state.supply_in_profit); - } - if let Some(source) = self.in_loss_source.as_mut() { - source.push(state.supply_in_loss); - } - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs = self.base.collect_vecs_mut(); - vecs.extend( - self.in_profit_source - .iter_mut() - .map(|source| source as &mut dyn AnyStoredVec), - ); - vecs.extend( - self.in_loss_source - .iter_mut() - .map(|source| source as &mut dyn AnyStoredVec), - ); - vecs - } - - pub(crate) fn validate_computed_versions(&mut self, _base_version: Version) -> Result<()> { - Ok(()) - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - let base_refs: Vec<&SupplyBase> = others.iter().map(|o| &o.base).collect(); - self.base - .compute_from_stateful(starting_lengths, &base_refs, exit)?; - if let Some(source) = self.in_profit_source.as_mut() { - source.compute_sum_of_others( - starting_lengths.height, - &others - .iter() - .map(|other| &other.in_profit.sats.height) - .collect::>(), - exit, - )?; - } - if let Some(source) = self.in_loss_source.as_mut() { - source.compute_sum_of_others( - starting_lengths.height, - &others - .iter() - .map(|other| &other.in_loss.sats.height) - .collect::>(), - exit, - )?; - } - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/supply/mod.rs b/crates/brk_computer/src/distribution/metrics/supply/mod.rs index 8e0b42860..37c224170 100644 --- a/crates/brk_computer/src/distribution/metrics/supply/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/supply/mod.rs @@ -1,11 +1,13 @@ -mod age_range; -mod avg_amount; mod base; +mod by_cohort; mod cache; -mod core; +mod sources; +mod total; +mod vecs; -pub(crate) use age_range::AgeRangeSupplySources; -pub use self::core::SupplyCore; -pub use avg_amount::AvgAmountVecs; -pub use base::SupplyBase; +pub(super) use base::SupplyBase; +pub use by_cohort::SupplyByCohort; pub(crate) use cache::AllSupplyCache; +pub use sources::SupplySources; +pub use total::SupplyTotal; +pub use vecs::SupplyVecs; diff --git a/crates/brk_computer/src/distribution/metrics/supply/sources.rs b/crates/brk_computer/src/distribution/metrics/supply/sources.rs new file mode 100644 index 000000000..5b0e4f40f --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/supply/sources.rs @@ -0,0 +1,7 @@ +use crate::internal::LazySpotValuePerBlock; + +#[derive(Clone)] +pub struct SupplySources { + pub total: LazySpotValuePerBlock, + pub in_profit: LazySpotValuePerBlock, +} diff --git a/crates/brk_computer/src/distribution/metrics/supply/total.rs b/crates/brk_computer/src/distribution/metrics/supply/total.rs new file mode 100644 index 000000000..f3edcf96b --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/supply/total.rs @@ -0,0 +1,95 @@ +use brk_cohort::{AmountRange, CohortContext, Filter, UTXOGroups}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, Version}; +use vecdb::{AnyStoredVec, CachedBoxedVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{ColumnarAmount, UTXOColumnarMetric, UTXORows, utxo_metric_name}, + indexes, + internal::LazySpotValuePerBlock, +}; + +use super::AllSupplyCache; + +#[derive(Traversable)] +pub struct SupplyTotal { + #[traversable(flatten)] + pub cohorts: UTXOGroups, + #[traversable(flatten)] + pub matrices: UTXOColumnarMetric, + pub addr_balance: ColumnarAmount, +} + +impl SupplyTotal { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + spot_price: &CachedBoxedVec, + ) -> Result<(Self, AllSupplyCache)> { + let matrices = UTXOColumnarMetric::forced_import(db, "supply_sats", version)?; + let cohorts = UTXOGroups::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, "supply"); + LazySpotValuePerBlock::from_boxed_sats_source( + &name, + version, + matrices + .additive_source(&filter, &format!("{name}_sats"), version) + .expect("total-supply cohort source"), + indexes, + spot_price, + ) + }); + let all_supply = AllSupplyCache::new(cohorts.all.sats.height.clone()); + let addr_balance = ColumnarAmount::forced_import( + db, + "addrs_supply_sats_by_balance_range", + CohortContext::Addr, + "supply", + version + Version::ONE, + |name, source| { + LazySpotValuePerBlock::from_boxed_sats_source( + name, + version + Version::ONE, + source, + indexes, + spot_price, + ) + }, + )?; + + Ok(( + Self { + cohorts, + matrices, + addr_balance, + }, + all_supply, + )) + } + + pub(crate) fn min_len(&self) -> usize { + self.matrices.min_len().min(self.addr_balance.len()) + } + + pub(crate) fn get(&self, filter: &Filter) -> Option<&LazySpotValuePerBlock> { + self.cohorts.get(filter) + } + + #[inline(always)] + pub(crate) fn push(&mut self, rows: UTXORows) { + self.matrices.push(rows); + } + + #[inline(always)] + pub(crate) fn push_addr_balance(&mut self, row: AmountRange) { + self.addr_balance.push(row); + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = self.matrices.collect_vecs_mut(); + vecs.push(self.addr_balance.stored_mut()); + vecs + } +} diff --git a/crates/brk_computer/src/distribution/metrics/supply/vecs.rs b/crates/brk_computer/src/distribution/metrics/supply/vecs.rs new file mode 100644 index 000000000..49e8847fd --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/supply/vecs.rs @@ -0,0 +1,198 @@ +use brk_cohort::{ + AgeRange, AgeRangeId, Amount, CohortContext, Filter, UTXOGroups, UTXOGroupsWithoutAmount, +}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{ + Cents, Height, PartsPerMillion32, PartsPerMillionSigned64, Sats, SatsSigned, Version, +}; +use vecdb::{AnyStoredVec, BinaryTransform, CachedBoxedVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::{metrics::UTXORows, state::UnrealizedState}, + indexes, + internal::{ + CachedWindowStartVec, ColumnarValuePerBlockCumulativeRolling, HalveCents, HalveDollars, + HalveSats, HalveSatsToBitcoin, LazyPercentPerBlock, LazyRollingDeltasAmountFromHeight, + LazyValuePerBlock, LazyValuePerBlockCumulativeRolling, SatsToCents, Windows, + }, +}; + +use super::{AllSupplyCache, SupplyBase, SupplyByCohort, SupplySources, SupplyTotal}; + +const MATURED_VERSION: Version = Version::new(5); + +#[derive(Traversable)] +pub struct SupplyVecs { + pub total: SupplyTotal, + pub matured: ColumnarValuePerBlockCumulativeRolling< + AgeRangeId, + AgeRange, + M, + >, + pub half: UTXOGroupsWithoutAmount, + pub in_profit: SupplyByCohort, + pub in_loss: SupplyByCohort, + pub delta: + UTXOGroups>, + #[traversable(wrap = "delta", rename = "addr_balance")] + pub addr_balance_delta: + Amount>, + pub dominance: UTXOGroups>, + #[traversable(wrap = "dominance", rename = "addr_balance")] + pub addr_balance_dominance: Amount>, +} + +impl SupplyVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + spot_price: &CachedBoxedVec, + ) -> Result<(Self, AllSupplyCache)> { + let (total, all_supply) = SupplyTotal::forced_import(db, version, indexes, spot_price)?; + let in_profit = + SupplyByCohort::forced_import(db, "supply_in_profit", version, indexes, spot_price)?; + let in_loss = + SupplyByCohort::forced_import(db, "supply_in_loss", version, indexes, spot_price)?; + let bases = total.cohorts.map_named(|filter, cohort_name, total| { + let full_name = CohortContext::Utxo.full_name(filter, cohort_name); + if matches!(filter, Filter::All) { + SupplyBase::from_all_total( + &full_name, + version, + total.clone(), + indexes, + cached_starts, + ) + } else { + SupplyBase::from_total( + &full_name, + version, + total.clone(), + &all_supply, + indexes, + cached_starts, + ) + } + }); + let delta = bases.map_named(|_, _, base| base.delta.clone()); + let dominance = bases.map_named(|_, _, base| base.dominance.clone()); + let addr_balance_bases = total.addr_balance.series.map_named(|filter, name, total| { + let full_name = CohortContext::Addr.full_name(filter, name); + SupplyBase::from_total( + &full_name, + version + Version::ONE, + total.clone(), + &all_supply, + indexes, + cached_starts, + ) + }); + let addr_balance_delta = addr_balance_bases.map_named(|_, _, base| base.delta.clone()); + let addr_balance_dominance = + addr_balance_bases.map_named(|_, _, base| base.dominance.clone()); + let half = in_profit.cohorts.map_named(|filter, cohort_name, _| { + let full_name = CohortContext::Utxo.full_name(filter, cohort_name); + LazyValuePerBlock::from_spot_block_source::< + HalveSats, + HalveSatsToBitcoin, + HalveCents, + HalveDollars, + >( + &SupplyBase::metric_name(&full_name, "supply_half"), + total.get(filter).expect("supported half-supply view"), + version, + ) + }); + let matured_version = version + MATURED_VERSION; + let matured = ColumnarValuePerBlockCumulativeRolling::forced_import( + db, + &format!( + "{}_age_range_matured_supply_cumulative", + CohortContext::Utxo.prefix() + ), + matured_version, + |sats, cents| { + AgeRangeId::series(CohortContext::Utxo, |column, name| { + let name = format!("{name}_matured_supply"); + let (sats, cents) = + ColumnarValuePerBlockCumulativeRolling::::sources_from( + sats, + cents, + &format!("{name}_cumulative"), + matured_version, + [column], + ); + LazyValuePerBlockCumulativeRolling::from_boxed_cumulative_sources( + &name, + matured_version, + sats, + cents, + indexes, + cached_starts, + ) + }) + }, + )?; + + Ok(( + Self { + total, + matured, + half, + in_profit, + in_loss, + delta, + addr_balance_delta, + dominance, + addr_balance_dominance, + }, + all_supply, + )) + } + + pub(crate) fn sources(&self, filter: &Filter) -> Option { + Some(SupplySources { + total: self.total.get(filter)?.clone(), + in_profit: self.in_profit.get(filter)?.clone(), + }) + } + + pub(crate) fn min_len(&self) -> usize { + self.total + .min_len() + .min(self.matured.len()) + .min(self.in_profit.min_len()) + .min(self.in_loss.min_len()) + } + + #[inline(always)] + pub(crate) fn push_maturation(&mut self, matured: &AgeRange, price: Cents) { + let cents = AgeRange::from_fn(|column| SatsToCents::apply(*column.select(matured), price)); + self.matured.push_block(matured.clone(), cents); + } + + #[inline(always)] + pub(crate) fn push( + &mut self, + total: UTXORows, + profitability: &UTXORows, + ) { + let in_profit = profitability.map(|state| state.supply_in_profit); + let in_loss = profitability.map(|state| state.supply_in_loss); + + self.total.push(total); + self.in_profit.push(in_profit); + self.in_loss.push(in_loss); + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = self.total.collect_vecs_mut(); + vecs.extend(self.matured.collect_vecs_mut()); + vecs.extend(self.in_profit.collect_vecs_mut()); + vecs.extend(self.in_loss.collect_vecs_mut()); + vecs + } +} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/aggregate_sources.rs b/crates/brk_computer/src/distribution/metrics/unrealized/aggregate_sources.rs new file mode 100644 index 000000000..85907f208 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/unrealized/aggregate_sources.rs @@ -0,0 +1,10 @@ +use brk_types::Cents; + +use crate::internal::LazyFiatPerBlock; + +#[derive(Clone)] +pub struct UnrealizedAggregateSources { + pub gross_pnl: LazyFiatPerBlock, + pub invested_capital_in_profit: LazyFiatPerBlock, + pub invested_capital_in_loss: LazyFiatPerBlock, +} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/basic.rs b/crates/brk_computer/src/distribution/metrics/unrealized/basic.rs deleted file mode 100644 index 1e618a8ae..000000000 --- a/crates/brk_computer/src/distribution/metrics/unrealized/basic.rs +++ /dev/null @@ -1,82 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Cents, Dollars, PartsPerMillion64, Version}; -use derive_more::{Deref, DerefMut}; -use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableCloneableVec, Rw, StorageMode, WritableVec}; - -use crate::{ - distribution::{metrics::ImportConfig, state::UnrealizedState}, - internal::{FiatPerBlock, LazyPerBlock, NegCentsUnsignedToDollars}, -}; - -use super::UnrealizedMinimal; - -#[derive(Deref, DerefMut, Traversable)] -pub struct UnrealizedBasic { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub minimal: UnrealizedMinimal, - pub profit: FiatPerBlock, - pub loss: FiatPerBlock, - #[traversable(wrap = "loss", rename = "negative")] - pub neg_loss: LazyPerBlock, -} - -impl UnrealizedBasic { - pub(crate) fn forced_import( - cfg: &ImportConfig, - mvrv: &LazyPerBlock, - ) -> Result { - let v1 = Version::ONE; - - let loss: FiatPerBlock = cfg.import("unrealized_loss", v1)?; - - let neg_loss = LazyPerBlock::from_computed::( - &cfg.name("unrealized_loss_neg"), - cfg.version, - loss.cents.height.read_only_boxed_clone(), - &loss.cents, - ); - - Ok(Self { - minimal: UnrealizedMinimal::new(cfg, mvrv), - profit: cfg.import("unrealized_profit", v1)?, - loss, - neg_loss, - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.profit - .cents - .height - .len() - .min(self.loss.cents.height.len()) - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &UnrealizedState) { - self.profit.cents.height.push(state.unrealized_profit); - self.loss.cents.height.push(state.unrealized_loss); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - vec![ - &mut self.profit.cents.height as &mut dyn AnyStoredVec, - &mut self.loss.cents.height, - ] - } - - pub(crate) fn compute_from_sources( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - sum_others!(self, starting_lengths, others, exit; profit.cents.height); - sum_others!(self, starting_lengths, others, exit; loss.cents.height); - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/core.rs b/crates/brk_computer/src/distribution/metrics/unrealized/core.rs deleted file mode 100644 index ccd6a987d..000000000 --- a/crates/brk_computer/src/distribution/metrics/unrealized/core.rs +++ /dev/null @@ -1,77 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Cents, CentsSigned, PartsPerMillion64, Version}; -use derive_more::{Deref, DerefMut}; -use vecdb::{AnyStoredVec, Exit, Rw, StorageMode}; - -use crate::{ - distribution::{metrics::ImportConfig, state::UnrealizedState}, - internal::{CentsSubtractToCentsSigned, FiatPerBlock, LazyPerBlock}, -}; - -use super::UnrealizedBasic; - -#[derive(Deref, DerefMut, Traversable)] -pub struct UnrealizedCore { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub basic: UnrealizedBasic, - - pub net_pnl: FiatPerBlock, -} - -impl UnrealizedCore { - pub(crate) fn forced_import( - cfg: &ImportConfig, - mvrv: &LazyPerBlock, - ) -> Result { - let basic = UnrealizedBasic::forced_import(cfg, mvrv)?; - let net_unrealized_pnl = cfg.import("net_unrealized_pnl", Version::ZERO)?; - - Ok(Self { - basic, - net_pnl: net_unrealized_pnl, - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.basic.min_stateful_len() - } - - #[inline(always)] - pub(crate) fn push_state(&mut self, state: &UnrealizedState) { - self.basic.push_state(state); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - self.basic.collect_vecs_mut() - } - - pub(crate) fn compute_from_stateful( - &mut self, - starting_lengths: &Lengths, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - let basic_refs: Vec<&UnrealizedBasic> = others.iter().map(|o| &o.basic).collect(); - self.basic - .compute_from_sources(starting_lengths, &basic_refs, exit)?; - Ok(()) - } - - pub(crate) fn compute_rest(&mut self, starting_lengths: &Lengths, exit: &Exit) -> Result<()> { - self.net_pnl - .cents - .height - .compute_binary::( - starting_lengths.height, - &self.basic.profit.cents.height, - &self.basic.loss.cents.height, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/full.rs b/crates/brk_computer/src/distribution/metrics/unrealized/full.rs deleted file mode 100644 index db90ec58c..000000000 --- a/crates/brk_computer/src/distribution/metrics/unrealized/full.rs +++ /dev/null @@ -1,227 +0,0 @@ -use brk_error::Result; -use brk_indexer::Lengths; -use brk_traversable::Traversable; -use brk_types::{Cents, CentsSigned, CentsSquaredSats, Height, PartsPerMillion64, Sats, Version}; -use derive_more::{Deref, DerefMut}; -use vecdb::{AnyStoredVec, AnyVec, BytesVec, Exit, ReadableVec, Rw, StorageMode, WritableVec}; - -use crate::distribution::state::UnrealizedState; -use crate::internal::{CentsSubtractToCentsSigned, FiatPerBlock, LazyPerBlock}; -use crate::{distribution::metrics::ImportConfig, price}; - -use super::UnrealizedCore; - -#[derive(Traversable)] -pub struct UnrealizedSentiment { - pub pain_index: FiatPerBlock, - pub greed_index: FiatPerBlock, - pub net: FiatPerBlock, -} - -#[derive(Traversable)] -pub struct UnrealizedInvestedCapital { - pub in_profit: FiatPerBlock, - pub in_loss: FiatPerBlock, -} - -#[derive(Deref, DerefMut, Traversable)] -pub struct UnrealizedFull { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub inner: UnrealizedCore, - - pub gross_pnl: FiatPerBlock, - pub invested_capital: UnrealizedInvestedCapital, - - pub capitalized_cap_in_profit_raw: M::Stored>, - pub capitalized_cap_in_loss_raw: M::Stored>, - - pub sentiment: UnrealizedSentiment, -} - -impl UnrealizedFull { - pub(crate) fn forced_import( - cfg: &ImportConfig, - mvrv: &LazyPerBlock, - ) -> Result { - let v0 = Version::ZERO; - let inner = UnrealizedCore::forced_import(cfg, mvrv)?; - - let gross_pnl = cfg.import("unrealized_gross_pnl", v0)?; - - let v1 = Version::ONE; - - let invested_capital = UnrealizedInvestedCapital { - in_profit: cfg.import("invested_capital_in_profit", v1)?, - in_loss: cfg.import("invested_capital_in_loss", v1)?, - }; - - let capitalized_cap_in_profit_raw = cfg.import("capitalized_cap_in_profit_raw", v0)?; - let capitalized_cap_in_loss_raw = cfg.import("capitalized_cap_in_loss_raw", v0)?; - - let sentiment = UnrealizedSentiment { - pain_index: cfg.import("pain_index", v1)?, - greed_index: cfg.import("greed_index", v1)?, - net: cfg.import("net_sentiment", Version::new(2))?, - }; - - Ok(Self { - inner, - gross_pnl, - invested_capital, - capitalized_cap_in_profit_raw, - capitalized_cap_in_loss_raw, - sentiment, - }) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - // Only check per-block pushed vecs (capitalized_cap_raw). - // Core-level vecs (profit/loss) are aggregated from age_range, not stateful. - self.capitalized_cap_in_profit_raw - .len() - .min(self.capitalized_cap_in_loss_raw.len()) - } - - #[inline(always)] - pub(crate) fn push_state_all(&mut self, state: &UnrealizedState) { - self.inner.push_state(state); - self.capitalized_cap_in_profit_raw - .push(CentsSquaredSats::new(state.capitalized_cap_in_profit_raw)); - self.capitalized_cap_in_loss_raw - .push(CentsSquaredSats::new(state.capitalized_cap_in_loss_raw)); - } - - pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - let mut vecs = self.inner.collect_vecs_mut(); - vecs.push(&mut self.capitalized_cap_in_profit_raw as &mut dyn AnyStoredVec); - vecs.push(&mut self.capitalized_cap_in_loss_raw as &mut dyn AnyStoredVec); - vecs - } - - pub(crate) fn compute_rest_all( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - supply_in_profit_sats: &(impl ReadableVec + Sync), - supply_in_loss_sats: &(impl ReadableVec + Sync), - exit: &Exit, - ) -> Result<()> { - self.inner.compute_rest(starting_lengths, exit)?; - - // gross_pnl = profit + loss - self.gross_pnl.cents.height.compute_add( - starting_lengths.height, - &self.inner.basic.profit.cents.height, - &self.inner.basic.loss.cents.height, - exit, - )?; - - // invested_capital_in_profit = supply_profit_sats × spot / ONE_BTC - unrealized_profit - self.invested_capital - .in_profit - .cents - .height - .compute_transform3( - starting_lengths.height, - supply_in_profit_sats, - &prices.spot.cents.height, - &self.inner.basic.profit.cents.height, - |(h, supply_sats, spot, profit, ..): (_, Sats, Cents, Cents, _)| { - let market_value = supply_sats.as_u128() * spot.as_u128() / Sats::ONE_BTC_U128; - ( - h, - Cents::new(market_value.saturating_sub(profit.as_u128()) as u64), - ) - }, - exit, - )?; - - // invested_capital_in_loss = supply_loss_sats × spot / ONE_BTC + unrealized_loss - self.invested_capital - .in_loss - .cents - .height - .compute_transform3( - starting_lengths.height, - supply_in_loss_sats, - &prices.spot.cents.height, - &self.inner.basic.loss.cents.height, - |(h, supply_sats, spot, loss, ..): (_, Sats, Cents, Cents, _)| { - let market_value = supply_sats.as_u128() * spot.as_u128() / Sats::ONE_BTC_U128; - (h, Cents::new((market_value + loss.as_u128()) as u64)) - }, - exit, - )?; - - Ok(()) - } - - /// Compute sentiment using capitalized_price (original formula). - /// Called after cost_basis.in_profit/loss are computed at the cohort level. - pub(crate) fn compute_sentiment( - &mut self, - starting_lengths: &Lengths, - spot: &impl ReadableVec, - exit: &Exit, - ) -> Result<()> { - // greed = spot - capitalized_price_winners - // capitalized_price = capitalized_cap / invested_cap - // invested_cap is in Cents (already / ONE_BTC), multiply back for CentsSats scale - self.sentiment.greed_index.cents.height.compute_transform3( - starting_lengths.height, - &self.capitalized_cap_in_profit_raw, - &self.invested_capital.in_profit.cents.height, - spot, - |(h, capitalized_cap, invested_cap_cents, spot, ..)| { - let invested_cap_raw = invested_cap_cents.as_u128() * Sats::ONE_BTC_U128; - if invested_cap_raw == 0 { - return (h, Cents::ZERO); - } - let capitalized_price = capitalized_cap.inner() / invested_cap_raw; - let spot_u128 = spot.as_u128(); - ( - h, - Cents::new(spot_u128.saturating_sub(capitalized_price) as u64), - ) - }, - exit, - )?; - - // pain = capitalized_price_losers - spot - self.sentiment.pain_index.cents.height.compute_transform3( - starting_lengths.height, - &self.capitalized_cap_in_loss_raw, - &self.invested_capital.in_loss.cents.height, - spot, - |(h, capitalized_cap, invested_cap_cents, spot, ..)| { - let invested_cap_raw = invested_cap_cents.as_u128() * Sats::ONE_BTC_U128; - if invested_cap_raw == 0 { - return (h, Cents::ZERO); - } - let capitalized_price = capitalized_cap.inner() / invested_cap_raw; - let spot_u128 = spot.as_u128(); - ( - h, - Cents::new(capitalized_price.saturating_sub(spot_u128) as u64), - ) - }, - exit, - )?; - - // net = greed - pain - self.sentiment - .net - .cents - .height - .compute_binary::( - starting_lengths.height, - &self.sentiment.greed_index.cents.height, - &self.sentiment.pain_index.cents.height, - exit, - )?; - - Ok(()) - } -} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/mod.rs b/crates/brk_computer/src/distribution/metrics/unrealized/mod.rs index 38947d47b..927d14459 100644 --- a/crates/brk_computer/src/distribution/metrics/unrealized/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/unrealized/mod.rs @@ -1,89 +1,7 @@ -mod basic; -mod core; -mod full; -mod minimal; +mod aggregate_sources; +mod mvrv_to_nupl; +mod vecs; -pub use self::core::UnrealizedCore; -pub use basic::UnrealizedBasic; -pub use full::UnrealizedFull; -pub use minimal::UnrealizedMinimal; - -use brk_error::Result; -use brk_indexer::Lengths; -use brk_types::{Height, Sats}; -use vecdb::{Exit, ReadableVec}; - -use crate::{distribution::state::UnrealizedState, price}; - -pub trait UnrealizedLike: Send + Sync { - fn as_core(&self) -> &UnrealizedCore; - fn as_core_mut(&mut self) -> &mut UnrealizedCore; - fn min_stateful_len(&self) -> usize; - fn push_state(&mut self, state: &UnrealizedState); - fn compute_rest( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - supply_in_profit_sats: &(impl ReadableVec + Sync), - supply_in_loss_sats: &(impl ReadableVec + Sync), - exit: &Exit, - ) -> Result<()>; -} - -impl UnrealizedLike for UnrealizedCore { - fn as_core(&self) -> &UnrealizedCore { - self - } - fn as_core_mut(&mut self) -> &mut UnrealizedCore { - self - } - fn min_stateful_len(&self) -> usize { - self.min_stateful_len() - } - #[inline(always)] - fn push_state(&mut self, state: &UnrealizedState) { - self.push_state(state); - } - fn compute_rest( - &mut self, - _prices: &price::Vecs, - starting_lengths: &Lengths, - _supply_in_profit_sats: &(impl ReadableVec + Sync), - _supply_in_loss_sats: &(impl ReadableVec + Sync), - exit: &Exit, - ) -> Result<()> { - self.compute_rest(starting_lengths, exit) - } -} - -impl UnrealizedLike for UnrealizedFull { - fn as_core(&self) -> &UnrealizedCore { - &self.inner - } - fn as_core_mut(&mut self) -> &mut UnrealizedCore { - &mut self.inner - } - fn min_stateful_len(&self) -> usize { - UnrealizedFull::min_stateful_len(self) - } - #[inline(always)] - fn push_state(&mut self, state: &UnrealizedState) { - self.push_state_all(state); - } - fn compute_rest( - &mut self, - prices: &price::Vecs, - starting_lengths: &Lengths, - supply_in_profit_sats: &(impl ReadableVec + Sync), - supply_in_loss_sats: &(impl ReadableVec + Sync), - exit: &Exit, - ) -> Result<()> { - self.compute_rest_all( - prices, - starting_lengths, - supply_in_profit_sats, - supply_in_loss_sats, - exit, - ) - } -} +pub use aggregate_sources::UnrealizedAggregateSources; +pub(crate) use mvrv_to_nupl::MvrvToNupl; +pub use vecs::{UnrealizedSources, UnrealizedVecs}; diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/minimal.rs b/crates/brk_computer/src/distribution/metrics/unrealized/mvrv_to_nupl.rs similarity index 50% rename from crates/brk_computer/src/distribution/metrics/unrealized/minimal.rs rename to crates/brk_computer/src/distribution/metrics/unrealized/mvrv_to_nupl.rs index 1642da4a7..1307fd87e 100644 --- a/crates/brk_computer/src/distribution/metrics/unrealized/minimal.rs +++ b/crates/brk_computer/src/distribution/metrics/unrealized/mvrv_to_nupl.rs @@ -1,31 +1,7 @@ -use brk_traversable::Traversable; -use brk_types::{PartsPerMillion64, PartsPerMillionSigned32, Version}; +use brk_types::{PartsPerMillion64, PartsPerMillionSigned32}; use vecdb::UnaryTransform; -use crate::internal::{LazyPerBlock, LazyRatioPerBlock}; - -use crate::distribution::metrics::ImportConfig; - -const VERSION: Version = Version::new(5); - -#[derive(Clone, Traversable)] -pub struct UnrealizedMinimal { - pub nupl: LazyRatioPerBlock, -} - -impl UnrealizedMinimal { - pub(crate) fn new(cfg: &ImportConfig, mvrv: &LazyPerBlock) -> Self { - Self { - nupl: LazyRatioPerBlock::from_lazy_source::( - &cfg.name("nupl"), - cfg.version + VERSION, - mvrv, - ), - } - } -} - -struct MvrvToNupl; +pub(crate) struct MvrvToNupl; impl UnaryTransform for MvrvToNupl { #[inline(always)] diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/vecs/by_cohort.rs b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/by_cohort.rs new file mode 100644 index 000000000..8bfe6b469 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/by_cohort.rs @@ -0,0 +1,50 @@ +use std::ops::AddAssign; + +use brk_cohort::UTXOGroupsWithoutAmount; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::Version; +use vecdb::{Database, PcoVecValue, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{UTXOColumnarMetricWithoutAmount, utxo_metric_name}, + indexes, + internal::{FiatType, LazyFiatPerBlock}, +}; + +#[derive(Traversable)] +pub struct UnrealizedByCohort +where + C: FiatType + PcoVecValue, +{ + #[traversable(flatten)] + pub cohorts: UTXOGroupsWithoutAmount>, + #[traversable(flatten)] + pub matrices: UTXOColumnarMetricWithoutAmount, +} + +impl UnrealizedByCohort +where + C: FiatType + PcoVecValue + AddAssign, +{ + pub(super) fn forced_import( + db: &Database, + metric: &str, + version: Version, + indexes: &indexes::Vecs, + ) -> Result { + let matrices = UTXOColumnarMetricWithoutAmount::forced_import( + db, + &format!("{metric}_cents"), + version, + )?; + let cohorts = UTXOGroupsWithoutAmount::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, metric); + let source = matrices + .additive_source(&filter, &format!("{name}_cents"), version) + .expect("supported unrealized cohort"); + LazyFiatPerBlock::from_boxed_cents_source(&name, version, source, indexes) + }); + Ok(Self { cohorts, matrices }) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/vecs/collection.rs b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/collection.rs new file mode 100644 index 000000000..aa9180682 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/collection.rs @@ -0,0 +1,277 @@ +use brk_cohort::{Filter, UTXOAggregate, UTXOGroups, UTXOGroupsWithoutAmount}; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{ + Cents, CentsSigned, CentsSquaredSats, Dollars, PartsPerMillion64, PartsPerMillionSigned32, + Sats, Version, +}; +use vecdb::{AnyStoredVec, Database, Rw, StorageMode}; + +use crate::{ + distribution::{ + metrics::{ + AdditiveAggregateFiatPerBlock, AdditiveUTXORawVec, AggregateFiatPerBlock, UTXORows, + utxo_metric_name, + }, + state::UnrealizedState, + }, + indexes, + internal::{ + LazyPerBlock, LazyPriceWithRatioPerBlock, LazyRatioPerBlock, NegCentsUnsignedToDollars, + }, +}; + +use super::{ + super::{MvrvToNupl, UnrealizedAggregateSources}, + NetUnrealizedByCohort, UnrealizedByCohort, UnrealizedSources, +}; + +#[derive(Traversable)] +pub struct UnrealizedVecs { + pub profit: UnrealizedByCohort, + pub loss: UnrealizedByCohort, + pub net_pnl: NetUnrealizedByCohort, + pub gross_pnl: AdditiveAggregateFiatPerBlock, + pub invested_capital_in_profit: AdditiveAggregateFiatPerBlock, + pub invested_capital_in_loss: AdditiveAggregateFiatPerBlock, + pub capitalized_cap_in_profit_raw: AdditiveUTXORawVec, + pub capitalized_cap_in_loss_raw: AdditiveUTXORawVec, + pub pain_index: AggregateFiatPerBlock, + pub greed_index: AggregateFiatPerBlock, + pub net_sentiment: AggregateFiatPerBlock, + pub nupl: UTXOGroups>, + #[traversable(wrap = "loss", rename = "negative")] + pub negative_loss: UTXOGroupsWithoutAmount>, +} + +impl UnrealizedVecs { + pub(crate) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + realized_price: &UTXOGroups, + ) -> Result { + let profit = UnrealizedByCohort::forced_import( + db, + "unrealized_profit", + version + Version::ONE, + indexes, + )?; + let loss = UnrealizedByCohort::forced_import( + db, + "unrealized_loss", + version + Version::ONE, + indexes, + )?; + let net_pnl = NetUnrealizedByCohort::forced_import(db, version, indexes)?; + let aggregate_version = version + Version::ONE; + let gross_pnl = AdditiveAggregateFiatPerBlock::forced_import( + db, + "unrealized_gross_pnl", + aggregate_version, + indexes, + )?; + let invested_capital_in_profit = AdditiveAggregateFiatPerBlock::forced_import( + db, + "invested_capital_in_profit", + aggregate_version, + indexes, + )?; + let invested_capital_in_loss = AdditiveAggregateFiatPerBlock::forced_import( + db, + "invested_capital_in_loss", + aggregate_version, + indexes, + )?; + let capitalized_cap_in_profit_raw = + AdditiveUTXORawVec::forced_import(db, "capitalized_cap_in_profit_raw", version)?; + let capitalized_cap_in_loss_raw = + AdditiveUTXORawVec::forced_import(db, "capitalized_cap_in_loss_raw", version)?; + let pain_index = + AggregateFiatPerBlock::forced_import(db, "pain_index", aggregate_version, indexes)?; + let greed_index = + AggregateFiatPerBlock::forced_import(db, "greed_index", aggregate_version, indexes)?; + let net_sentiment = + AggregateFiatPerBlock::forced_import(db, "net_sentiment", aggregate_version, indexes)?; + let nupl = realized_price.map_named(|filter, cohort_name, price| { + LazyRatioPerBlock::from_lazy_source::( + &utxo_metric_name(filter, cohort_name, "nupl"), + Self::cohort_version(version, filter) + Version::new(5), + &price.ppm, + ) + }); + let negative_loss = UTXOGroupsWithoutAmount::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, "unrealized_loss_neg"); + LazyPerBlock::from_lazy::( + &name, + Self::cohort_version(version, &filter), + &loss + .cohorts + .get(&filter) + .expect("unrealized-loss cohort") + .cents, + ) + }); + Ok(Self { + profit, + loss, + net_pnl, + gross_pnl, + invested_capital_in_profit, + invested_capital_in_loss, + capitalized_cap_in_profit_raw, + capitalized_cap_in_loss_raw, + pain_index, + greed_index, + net_sentiment, + nupl, + negative_loss, + }) + } + + fn cohort_version(version: Version, filter: &Filter) -> Version { + version + + if matches!(filter, Filter::All) { + Version::ONE + } else { + Version::ZERO + } + } + + pub(crate) fn sources(&self, filter: &Filter) -> Option { + Some(UnrealizedSources { + profit: self.profit.cohorts.get(filter)?.clone(), + loss: self.loss.cohorts.get(filter)?.clone(), + }) + } + + pub(crate) fn aggregate_sources(&self, filter: &Filter) -> Option { + Some(UnrealizedAggregateSources { + gross_pnl: self.gross_pnl.series.get(filter)?.clone(), + invested_capital_in_profit: self.invested_capital_in_profit.series.get(filter)?.clone(), + invested_capital_in_loss: self.invested_capital_in_loss.series.get(filter)?.clone(), + }) + } + + #[inline(always)] + pub(crate) fn push( + &mut self, + rows: &UTXORows, + spot: Cents, + aggregate: &UTXOAggregate, + ) { + self.profit + .matrices + .push(rows.map(|state| state.unrealized_profit)); + self.loss + .matrices + .push(rows.map(|state| state.unrealized_loss)); + self.net_pnl.matrices.push(rows.map(|state| { + CentsSigned::new( + state.unrealized_profit.inner() as i64 - state.unrealized_loss.inner() as i64, + ) + })); + let rows = aggregate.map(|state| UnrealizedAggregateBlockData::new(spot, state)); + self.gross_pnl.push(rows.map(|row| row.gross_pnl)); + self.invested_capital_in_profit + .push(rows.map(|row| row.invested_capital_in_profit)); + self.invested_capital_in_loss + .push(rows.map(|row| row.invested_capital_in_loss)); + self.pain_index.push(rows.map(|row| row.pain_index)); + self.greed_index.push(rows.map(|row| row.greed_index)); + self.net_sentiment.push(rows.map(|row| row.net_sentiment)); + self.capitalized_cap_in_profit_raw + .push(&rows.map(|row| row.capitalized_cap_in_profit_raw)); + self.capitalized_cap_in_loss_raw + .push(&rows.map(|row| row.capitalized_cap_in_loss_raw)); + } + + pub(crate) fn min_len(&self) -> usize { + self.profit + .matrices + .min_len() + .min(self.loss.matrices.min_len()) + .min(self.net_pnl.matrices.min_len()) + .min(self.gross_pnl.len()) + .min(self.invested_capital_in_profit.len()) + .min(self.invested_capital_in_loss.len()) + .min(self.pain_index.len()) + .min(self.greed_index.len()) + .min(self.net_sentiment.len()) + .min(self.capitalized_cap_in_profit_raw.len()) + .min(self.capitalized_cap_in_loss_raw.len()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = self.profit.matrices.collect_vecs_mut(); + vecs.extend(self.loss.matrices.collect_vecs_mut()); + vecs.extend(self.net_pnl.matrices.collect_vecs_mut()); + vecs.extend([ + self.gross_pnl.stored_mut(), + self.invested_capital_in_profit.stored_mut(), + self.invested_capital_in_loss.stored_mut(), + self.pain_index.stored_mut(), + self.greed_index.stored_mut(), + self.net_sentiment.stored_mut(), + self.capitalized_cap_in_profit_raw.stored_mut(), + self.capitalized_cap_in_loss_raw.stored_mut(), + ]); + vecs + } +} + +struct UnrealizedAggregateBlockData { + gross_pnl: Cents, + invested_capital_in_profit: Cents, + invested_capital_in_loss: Cents, + capitalized_cap_in_profit_raw: CentsSquaredSats, + capitalized_cap_in_loss_raw: CentsSquaredSats, + pain_index: Cents, + greed_index: Cents, + net_sentiment: CentsSigned, +} + +impl UnrealizedAggregateBlockData { + #[inline(always)] + fn new(spot: Cents, state: &UnrealizedState) -> Self { + let market_value_in_profit = + state.supply_in_profit.as_u128() * spot.as_u128() / Sats::ONE_BTC_U128; + let market_value_in_loss = + state.supply_in_loss.as_u128() * spot.as_u128() / Sats::ONE_BTC_U128; + let invested_capital_in_profit = Cents::new( + market_value_in_profit.saturating_sub(state.unrealized_profit.as_u128()) as u64, + ); + let invested_capital_in_loss = + Cents::new((market_value_in_loss + state.unrealized_loss.as_u128()) as u64); + let greed_index = Cents::new(spot.as_u128().saturating_sub(Self::capitalized_price( + state.capitalized_cap_in_profit_raw, + invested_capital_in_profit, + )) as u64); + let pain_index = Cents::new( + Self::capitalized_price(state.capitalized_cap_in_loss_raw, invested_capital_in_loss) + .saturating_sub(spot.as_u128()) as u64, + ); + + Self { + gross_pnl: state.unrealized_profit + state.unrealized_loss, + invested_capital_in_profit, + invested_capital_in_loss, + capitalized_cap_in_profit_raw: CentsSquaredSats::new( + state.capitalized_cap_in_profit_raw, + ), + capitalized_cap_in_loss_raw: CentsSquaredSats::new(state.capitalized_cap_in_loss_raw), + pain_index, + greed_index, + net_sentiment: CentsSigned::new( + i64::try_from(i128::from(greed_index.inner()) - i128::from(pain_index.inner())) + .expect("net sentiment overflowed CentsSigned"), + ), + } + } + + #[inline(always)] + fn capitalized_price(raw: u128, invested_capital: Cents) -> u128 { + let invested_raw = invested_capital.as_u128() * Sats::ONE_BTC_U128; + raw.checked_div(invested_raw).unwrap_or_default() + } +} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/vecs/mod.rs b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/mod.rs new file mode 100644 index 000000000..13ba7a282 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/mod.rs @@ -0,0 +1,9 @@ +mod by_cohort; +mod collection; +mod net_by_cohort; +mod sources; + +pub(super) use by_cohort::UnrealizedByCohort; +pub use collection::UnrealizedVecs; +pub(super) use net_by_cohort::NetUnrealizedByCohort; +pub use sources::UnrealizedSources; diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/vecs/net_by_cohort.rs b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/net_by_cohort.rs new file mode 100644 index 000000000..90efa0d0a --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/net_by_cohort.rs @@ -0,0 +1,42 @@ +use brk_cohort::UTXOGroupsWithoutAmountOrType; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{CentsSigned, Version}; +use vecdb::{Database, Rw, StorageMode}; + +use crate::{ + distribution::metrics::{UTXOColumnarMetricWithoutAmountOrType, utxo_metric_name}, + indexes, + internal::LazyFiatPerBlock, +}; + +#[derive(Traversable)] +pub struct NetUnrealizedByCohort { + #[traversable(flatten)] + pub cohorts: UTXOGroupsWithoutAmountOrType>, + #[traversable(flatten)] + pub matrices: UTXOColumnarMetricWithoutAmountOrType, +} + +impl NetUnrealizedByCohort { + pub(super) fn forced_import( + db: &Database, + version: Version, + indexes: &indexes::Vecs, + ) -> Result { + let metric = "net_unrealized_pnl"; + let matrices = UTXOColumnarMetricWithoutAmountOrType::forced_import( + db, + "net_unrealized_pnl_cents", + version, + )?; + let cohorts = UTXOGroupsWithoutAmountOrType::new(|filter, cohort_name| { + let name = utxo_metric_name(&filter, cohort_name, metric); + let source = matrices + .additive_source(&filter, &format!("{name}_cents"), version) + .expect("supported net unrealized cohort"); + LazyFiatPerBlock::from_boxed_cents_source(&name, version, source, indexes) + }); + Ok(Self { cohorts, matrices }) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/vecs/sources.rs b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/sources.rs new file mode 100644 index 000000000..731eb1b1c --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/unrealized/vecs/sources.rs @@ -0,0 +1,9 @@ +use brk_types::Cents; + +use crate::internal::LazyFiatPerBlock; + +#[derive(Clone)] +pub struct UnrealizedSources { + pub profit: LazyFiatPerBlock, + pub loss: LazyFiatPerBlock, +} diff --git a/crates/brk_computer/src/distribution/mod.rs b/crates/brk_computer/src/distribution/mod.rs index 7deed51fc..43b005536 100644 --- a/crates/brk_computer/src/distribution/mod.rs +++ b/crates/brk_computer/src/distribution/mod.rs @@ -1,7 +1,6 @@ pub mod addr; mod all_chain_cache; mod block; -pub mod cohorts; pub mod compute; pub mod metrics; mod state; @@ -14,4 +13,5 @@ pub use vecs::Vecs; pub const DB_NAME: &str = "distribution"; pub use addr::{AddrTypeToTypeIndexMap, AddrsDataVecs, AnyAddrIndexesVecs}; -pub use cohorts::{AddrCohorts, DynCohortVecs, UTXOCohorts}; +pub use metrics::CohortMetrics; +pub use state::{AddrStates, UTXOStates}; diff --git a/crates/brk_computer/src/distribution/state/cohort/addr.rs b/crates/brk_computer/src/distribution/state/addr/cohort.rs similarity index 98% rename from crates/brk_computer/src/distribution/state/cohort/addr.rs rename to crates/brk_computer/src/distribution/state/addr/cohort.rs index 57cd4c64a..8e0140713 100644 --- a/crates/brk_computer/src/distribution/state/cohort/addr.rs +++ b/crates/brk_computer/src/distribution/state/addr/cohort.rs @@ -4,9 +4,10 @@ use brk_error::Result; use brk_types::{Cents, FundedAddrData, Sats, SupplyState}; use vecdb::unlikely; +use super::super::CohortState; use super::super::cost_basis::{CostBasisRaw, MinimalRealizedState}; -use super::base::CohortState; +/// Mutable state for one address balance cohort. pub struct AddrCohortState { pub addr_count: u64, pub inner: CohortState, diff --git a/crates/brk_computer/src/distribution/state/addr/collection.rs b/crates/brk_computer/src/distribution/state/addr/collection.rs new file mode 100644 index 000000000..012afa60c --- /dev/null +++ b/crates/brk_computer/src/distribution/state/addr/collection.rs @@ -0,0 +1,117 @@ +use std::path::Path; + +use brk_cohort::{AmountRange, AmountRangeId, CohortContext, Filter}; +use brk_error::Result; +use brk_types::{Cents, Height, StoredU64}; +use rayon::prelude::*; +use vecdb::{ColumnId, ReadableVec}; + +use crate::distribution::{addr::FundedAddrCountsVecs, metrics::CohortMetrics}; + +use super::AddrCohortState; + +pub struct AddrStates { + pub amount_range: AmountRange, + starting_height: Height, +} + +impl AddrStates { + pub(crate) fn new(path: &Path) -> Self { + Self { + amount_range: AmountRange::new(|filter: Filter, name| { + let name = CohortContext::Addr.full_name(&filter, name); + AddrCohortState::new(path, &name) + }), + starting_height: Height::ZERO, + } + } + + pub(crate) fn import( + &mut self, + metrics: &CohortMetrics, + funded: &FundedAddrCountsVecs, + height: Height, + ) -> Result { + let Some(previous_height) = height.decremented() else { + self.starting_height = Height::ZERO; + return Ok(true); + }; + + for state in self.amount_range.iter_mut() { + let imported_height = state.inner.import_at_or_before(previous_height)?; + if imported_height != previous_height { + return Ok(false); + } + } + + let Some(supply) = metrics + .supply + .total + .addr_balance + .matrix + .collect_one(previous_height) + else { + return Ok(false); + }; + let Some(output_count) = metrics + .outputs + .unspent_count + .addr_balance + .matrix + .collect_one(previous_height) + else { + return Ok(false); + }; + let Some(addr_count) = funded.balance.matrix.collect_one(previous_height) else { + return Ok(false); + }; + + for amount in AmountRangeId::ALL { + let state = amount.select_mut(&mut self.amount_range); + state.inner.supply.value = *amount.select(&supply); + state.inner.supply.utxo_count = u64::from(*amount.select(&output_count)); + state.addr_count = u64::from(*amount.select(&addr_count)); + state.inner.restore_realized_cap(); + } + + self.starting_height = previous_height.incremented(); + Ok(self.starting_height == height) + } + + pub(crate) fn reset(&mut self) -> Result<()> { + self.starting_height = Height::ZERO; + for state in self.amount_range.iter_mut() { + state.reset(); + state.inner.reset_cost_basis_data_if_needed()?; + } + Ok(()) + } + + pub(crate) fn push( + &self, + metrics: &mut CohortMetrics, + funded: &mut FundedAddrCountsVecs, + height: Height, + height_price: Cents, + ) { + if height < self.starting_height { + return; + } + metrics.push_addr_balance(&self.amount_range, height_price); + funded.push_balance(AmountRange::from_fn(|amount| { + StoredU64::from(amount.select(&self.amount_range).addr_count) + })); + } + + pub(crate) fn reset_block(&mut self) { + self.amount_range + .iter_mut() + .for_each(|state| state.inner.reset_single_iteration_values()); + } + + pub(crate) fn write(&mut self, height: Height, cleanup: bool) -> Result<()> { + self.amount_range + .par_iter_mut() + .try_for_each(|state| state.inner.write(height, cleanup)) + } +} diff --git a/crates/brk_computer/src/distribution/state/addr/mod.rs b/crates/brk_computer/src/distribution/state/addr/mod.rs new file mode 100644 index 000000000..3f40c4d54 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/addr/mod.rs @@ -0,0 +1,5 @@ +mod cohort; +mod collection; + +pub use cohort::*; +pub use collection::*; diff --git a/crates/brk_computer/src/distribution/state/cohort/base.rs b/crates/brk_computer/src/distribution/state/cohort.rs similarity index 81% rename from crates/brk_computer/src/distribution/state/cohort/base.rs rename to crates/brk_computer/src/distribution/state/cohort.rs index 71751689b..f3e7ad1d1 100644 --- a/crates/brk_computer/src/distribution/state/cohort/base.rs +++ b/crates/brk_computer/src/distribution/state/cohort.rs @@ -1,12 +1,12 @@ -use std::path::Path; +use std::{collections::BTreeMap, path::Path}; use brk_error::Result; use brk_types::{ - Age, Cents, CentsCompact, CentsSats, CentsSquaredSats, CostBasisSnapshot, Height, Sats, - SupplyState, + Age, Cents, CentsCompact, CentsSats, CostBasisSnapshot, Height, Sats, SupplyState, }; -use super::super::{ +use super::{ + SendPrecomputed, cost_basis::{ Accumulate, CostBasisData, CostBasisOps, CostBasisRaw, MinimalRealizedState, RealizedOps, UnrealizedState, @@ -14,50 +14,6 @@ use super::super::{ pending::PendingDelta, }; -pub struct SendPrecomputed { - pub sats: Sats, - pub prev_price: Cents, - pub age: Age, - pub current_ps: CentsSats, - pub prev_ps: CentsSats, - pub ath_ps: CentsSats, - pub prev_capitalized_cap: CentsSquaredSats, -} - -impl SendPrecomputed { - /// Pre-compute values for send_utxo when the same supply/prices are shared - /// across multiple cohorts (age_range, epoch, class). - pub(crate) fn new( - supply: &SupplyState, - current_price: Cents, - prev_price: Cents, - ath: Cents, - age: Age, - ) -> Option { - if supply.utxo_count == 0 || supply.value == Sats::ZERO { - return None; - } - let sats = supply.value; - let current_ps = CentsSats::from_price_sats(current_price, sats); - let prev_ps = CentsSats::from_price_sats(prev_price, sats); - let ath_ps = if ath == current_price { - current_ps - } else { - CentsSats::from_price_sats(ath, sats) - }; - let prev_capitalized_cap = prev_ps.to_capitalized_cap(prev_price); - Some(Self { - sats, - prev_price, - age, - current_ps, - prev_ps, - ath_ps, - prev_capitalized_cap, - }) - } -} - pub struct CohortState { pub supply: SupplyState, pub realized: R, @@ -263,7 +219,7 @@ impl CohortState> { self.cost_basis.for_each_pending(f); } - pub(crate) fn cost_basis_map(&self) -> &std::collections::BTreeMap { + pub(crate) fn cost_basis_map(&self) -> &BTreeMap { self.cost_basis.map() } } diff --git a/crates/brk_computer/src/distribution/state/cohort/mod.rs b/crates/brk_computer/src/distribution/state/cohort/mod.rs deleted file mode 100644 index 1c057f86d..000000000 --- a/crates/brk_computer/src/distribution/state/cohort/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -mod addr; -mod base; -mod utxo; - -pub use addr::*; -pub use base::*; -pub use utxo::*; diff --git a/crates/brk_computer/src/distribution/state/cohort/utxo.rs b/crates/brk_computer/src/distribution/state/cohort/utxo.rs deleted file mode 100644 index bfa002d04..000000000 --- a/crates/brk_computer/src/distribution/state/cohort/utxo.rs +++ /dev/null @@ -1,30 +0,0 @@ -use std::path::Path; - -use brk_error::Result; -use brk_types::{Sats, SupplyState}; -use derive_more::{Deref, DerefMut}; - -use super::super::cost_basis::{CostBasisOps, RealizedOps}; -use super::base::CohortState; - -#[derive(Deref, DerefMut)] -pub struct UTXOCohortState(pub(crate) CohortState); - -impl UTXOCohortState { - pub(crate) fn new(path: &Path, name: &str) -> Self { - Self(CohortState::new(path, name)) - } - - pub(crate) fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { - self.0.reset_cost_basis_data_if_needed() - } - - /// Reset state for fresh start. - pub(crate) fn reset(&mut self) { - self.0.supply = SupplyState::default(); - self.0.sent = Sats::ZERO; - self.0.spent_utxo_count = 0; - self.0.satdays_destroyed = Sats::ZERO; - self.0.realized = R::default(); - } -} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/core_realized_state.rs b/crates/brk_computer/src/distribution/state/cost_basis/core_realized_state.rs new file mode 100644 index 000000000..b20a59aff --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/core_realized_state.rs @@ -0,0 +1,139 @@ +use std::cmp::Ordering; + +use brk_types::{Cents, CentsSats, CentsSquaredSats, Sats}; +use vecdb::unlikely; + +use super::{MinimalRealizedState, RealizedOps}; + +/// Realized state with activity tracking. +#[derive(Debug, Default, Clone)] +pub struct CoreRealizedState { + minimal: MinimalRealizedState, + value_destroyed_raw: u128, + sent_in_profit: Sats, + sent_in_loss: Sats, +} + +impl RealizedOps for CoreRealizedState { + const TRACK_ACTIVITY: bool = true; + + #[inline] + fn cap_raw(&self) -> CentsSats { + self.minimal.cap_raw() + } + + #[inline] + fn cap(&self) -> Cents { + self.minimal.cap() + } + + #[inline] + fn profit(&self) -> Cents { + self.minimal.profit() + } + + #[inline] + fn loss(&self) -> Cents { + self.minimal.loss() + } + + #[inline] + fn value_destroyed(&self) -> Cents { + if unlikely(self.value_destroyed_raw == 0) { + Cents::ZERO + } else { + Cents::new((self.value_destroyed_raw / Sats::ONE_BTC_U128) as u64) + } + } + + #[inline] + fn sent_in_profit(&self) -> Sats { + self.sent_in_profit + } + + #[inline] + fn sent_in_loss(&self) -> Sats { + self.sent_in_loss + } + + #[inline] + fn set_cap_raw(&mut self, cap_raw: CentsSats) { + self.minimal.set_cap_raw(cap_raw); + } + + #[inline] + fn set_capitalized_cap_raw(&mut self, _capitalized_cap_raw: CentsSquaredSats) {} + + #[inline] + fn reset_single_iteration_values(&mut self) { + self.minimal.reset_single_iteration_values(); + self.value_destroyed_raw = 0; + self.sent_in_profit = Sats::ZERO; + self.sent_in_loss = Sats::ZERO; + } + + #[inline] + fn increment(&mut self, price: Cents, sats: Sats) { + self.minimal.increment(price, sats); + } + + #[inline] + fn increment_snapshot(&mut self, price_sats: CentsSats, capitalized_cap: CentsSquaredSats) { + self.minimal.increment_snapshot(price_sats, capitalized_cap); + } + + #[inline] + fn decrement_snapshot(&mut self, price_sats: CentsSats, capitalized_cap: CentsSquaredSats) { + self.minimal.decrement_snapshot(price_sats, capitalized_cap); + } + + #[inline] + fn send( + &mut self, + sats: Sats, + current_ps: CentsSats, + prev_ps: CentsSats, + ath_ps: CentsSats, + prev_capitalized_cap: CentsSquaredSats, + ) { + self.minimal + .send(sats, current_ps, prev_ps, ath_ps, prev_capitalized_cap); + self.value_destroyed_raw += prev_ps.as_u128(); + match current_ps.cmp(&prev_ps) { + Ordering::Greater | Ordering::Equal => self.sent_in_profit += sats, + Ordering::Less => self.sent_in_loss += sats, + } + } +} + +impl CoreRealizedState { + #[inline(always)] + pub(super) fn cap_raw_u128(&self) -> u128 { + self.minimal.cap_raw().as_u128() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn adds_activity_to_minimal_state() { + let mut state = CoreRealizedState::default(); + state.increment(Cents::new(10_000), Sats::ONE_BTC); + state.send( + Sats::ONE_BTC, + CentsSats::from_price_sats(Cents::new(15_000), Sats::ONE_BTC), + CentsSats::from_price_sats(Cents::new(10_000), Sats::ONE_BTC), + CentsSats::ZERO, + CentsSquaredSats::ZERO, + ); + + assert_eq!(state.cap(), Cents::ZERO); + assert_eq!(state.profit(), Cents::new(5_000)); + assert_eq!(state.loss(), Cents::ZERO); + assert_eq!(state.value_destroyed(), Cents::new(10_000)); + assert_eq!(state.sent_in_profit(), Sats::ONE_BTC); + assert_eq!(state.sent_in_loss(), Sats::ZERO); + } +} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/data.rs b/crates/brk_computer/src/distribution/state/cost_basis/data.rs index be471f560..a55b761f8 100644 --- a/crates/brk_computer/src/distribution/state/cost_basis/data.rs +++ b/crates/brk_computer/src/distribution/state/cost_basis/data.rs @@ -1,7 +1,7 @@ use std::{ collections::{BTreeMap, btree_map::Entry}, fs, - path::{Path, PathBuf}, + path::Path, }; use brk_error::{Error, Result}; @@ -9,232 +9,9 @@ use brk_types::{Cents, CentsCompact, CentsSats, CentsSquaredSats, Height, Sats, use rustc_hash::FxHashMap; use vecdb::{Bytes, unlikely}; -use super::{Accumulate, CachedUnrealizedState, UnrealizedState}; -use crate::distribution::state::pending::{ - PendingCapDelta, PendingCapitalizedCapRawDelta, PendingDelta, -}; - -/// Type alias for the price-to-sats map used in cost basis data. -pub(super) type CostBasisMap = BTreeMap; - -const STATE_TO_KEEP: usize = 10; - -/// Common interface for cost basis tracking. -/// -/// Implemented by `CostBasisRaw` (scalars only) and `CostBasisData` (full map + scalars). -pub trait CostBasisOps: Send + Sync + 'static { - fn create(path: &Path, name: &str) -> Self; - fn import_at_or_before(&mut self, height: Height) -> Result; - fn cap_raw(&self) -> CentsSats; - fn capitalized_cap_raw(&self) -> CentsSquaredSats; - fn increment( - &mut self, - price: Cents, - sats: Sats, - price_sats: CentsSats, - capitalized_cap: CentsSquaredSats, - ); - fn decrement( - &mut self, - price: Cents, - sats: Sats, - price_sats: CentsSats, - capitalized_cap: CentsSquaredSats, - ); - fn apply_pending(&mut self); - fn init(&mut self); - fn clean(&mut self) -> Result<()>; - fn write(&mut self, height: Height, cleanup: bool) -> Result<()>; -} - -// ─── CostBasisRaw ─────────────────────────────────────────────────────────── - -#[derive(Clone, Default, Debug)] -struct RawState { - cap_raw: CentsSats, -} - -impl RawState { - fn serialize(&self) -> Vec { - self.cap_raw.to_bytes().to_vec() - } - - fn deserialize(data: &[u8]) -> Result { - Ok(Self { - cap_raw: CentsSats::from_bytes(&data[0..16])?, - }) - } -} - -/// Lightweight cost basis tracking: only cap_raw scalar. -/// No BTreeMap, no unrealized computation, no pending map. -/// Used by cohorts that only need realized cap on restart (amount_range, address). -#[derive(Clone, Debug)] -pub struct CostBasisRaw { - pathbuf: PathBuf, - state: Option, - pending_cap: PendingCapDelta, -} - -impl CostBasisRaw { - #[inline] - pub(crate) fn increment_cap(&mut self, value: CentsSats) { - self.pending_cap.inc += value; - } - - #[inline] - pub(crate) fn decrement_cap(&mut self, value: CentsSats) { - self.pending_cap.dec += value; - } - - pub(super) fn path_state(&self, height: Height) -> PathBuf { - self.pathbuf.join(height.to_string()) - } - - pub(super) fn read_dir( - &self, - keep_only_before: Option, - ) -> Result> { - if !self.pathbuf.exists() { - return Ok(BTreeMap::new()); - } - Ok(fs::read_dir(&self.pathbuf)? - .filter_map(|entry| { - let path = entry.ok()?.path(); - let name = path.file_name()?.to_str()?; - if let Ok(h) = name.parse::().map(Height::from) { - if keep_only_before.is_none_or(|height| h < height) { - Some((h, path)) - } else { - let _ = fs::remove_file(path); - None - } - } else { - None - } - }) - .collect()) - } - - fn apply_pending_cap(&mut self) { - if self.pending_cap.is_zero() { - return; - } - let state = self.state.as_mut().unwrap(); - - state.cap_raw += self.pending_cap.inc; - if unlikely(state.cap_raw.inner() < self.pending_cap.dec.inner()) { - panic!( - "CostBasis cap_raw underflow!\n\ - Path: {:?}\n\ - Current cap_raw (after increments): {}\n\ - Trying to decrement by: {}", - self.pathbuf, state.cap_raw, self.pending_cap.dec - ); - } - state.cap_raw -= self.pending_cap.dec; - - self.pending_cap = PendingCapDelta::default(); - } - - fn write_and_cleanup(&mut self, height: Height, cleanup: bool) -> Result<()> { - if cleanup { - let files = self.read_dir(Some(height))?; - for (_, path) in files - .iter() - .take(files.len().saturating_sub(STATE_TO_KEEP - 1)) - { - fs::remove_file(path)?; - } - } - Ok(()) - } -} - -impl CostBasisOps for CostBasisRaw { - fn create(path: &Path, name: &str) -> Self { - Self { - pathbuf: path.join(name).join("cost_basis"), - state: None, - pending_cap: PendingCapDelta::default(), - } - } - - fn import_at_or_before(&mut self, height: Height) -> Result { - let files = self.read_dir(None)?; - let (&height, path) = files.range(..=height).next_back().ok_or(Error::NotFound( - "No cost basis state found at or before height".into(), - ))?; - let data = fs::read(path)?; - // Handle both formats: full (map + raw at end) and raw-only (16 bytes). - self.state = Some(if data.len() == 16 { - RawState::deserialize(&data)? - } else { - let (_, rest) = UrpdRaw::deserialize_with_rest(&data)?; - RawState::deserialize(rest)? - }); - self.pending_cap = PendingCapDelta::default(); - Ok(height) - } - - fn cap_raw(&self) -> CentsSats { - debug_assert!(self.pending_cap.is_zero()); - self.state.as_ref().unwrap().cap_raw - } - - fn capitalized_cap_raw(&self) -> CentsSquaredSats { - CentsSquaredSats::ZERO - } - - #[inline] - fn increment( - &mut self, - _price: Cents, - _sats: Sats, - price_sats: CentsSats, - _capitalized_cap: CentsSquaredSats, - ) { - self.increment_cap(price_sats); - } - - #[inline] - fn decrement( - &mut self, - _price: Cents, - _sats: Sats, - price_sats: CentsSats, - _capitalized_cap: CentsSquaredSats, - ) { - self.decrement_cap(price_sats); - } - - fn apply_pending(&mut self) { - self.apply_pending_cap(); - } - - fn init(&mut self) { - self.state.replace(RawState::default()); - self.pending_cap = PendingCapDelta::default(); - } - - fn clean(&mut self) -> Result<()> { - let _ = fs::remove_dir_all(&self.pathbuf); - fs::create_dir_all(&self.pathbuf)?; - Ok(()) - } - - fn write(&mut self, height: Height, cleanup: bool) -> Result<()> { - self.apply_pending_cap(); - self.write_and_cleanup(height, cleanup)?; - fs::write( - self.path_state(height), - self.state.as_ref().unwrap().serialize(), - )?; - Ok(()) - } -} - -// ─── CostBasisData ────────────────────────────────────────────────────────── +use super::unrealized::CachedUnrealizedState; +use super::{Accumulate, CostBasisOps, CostBasisRaw, UnrealizedState}; +use crate::distribution::state::pending::{PendingCapitalizedCapRawDelta, PendingDelta}; /// Full cost basis tracking: BTreeMap distribution + raw scalars. /// Composes `CostBasisRaw` for scalar tracking, adds map, pending, and cache. @@ -254,8 +31,8 @@ pub struct CostBasisData { } impl CostBasisData { - pub(crate) fn map(&self) -> &CostBasisMap { - debug_assert!(self.pending.is_empty() && self.raw.pending_cap.is_zero()); + pub(crate) fn map(&self) -> &BTreeMap { + debug_assert!(self.pending.is_empty() && self.raw.has_no_pending_cap()); &self.map.as_ref().unwrap().map } @@ -300,7 +77,7 @@ impl CostBasisData { Price: {}\n\ Current + increments: {}\n\ Trying to decrement by: {}", - self.raw.pathbuf, + self.raw.path(), cents.to_dollars(), e.get(), dec @@ -319,7 +96,7 @@ impl CostBasisData { Price: {}\n\ Increment: {}\n\ Trying to decrement by: {}", - self.raw.pathbuf, + self.raw.path(), cents.to_dollars(), inc, dec @@ -360,14 +137,13 @@ impl CostBasisOps for CostBasisData { rest.len() ); self.map = Some(base); - self.raw.state = Some(RawState::deserialize(rest)?); + self.raw.import_state(rest)?; self.capitalized_cap_raw = if S::TRACK_CAPITAL { CentsSquaredSats::from_bytes(&rest[16..32])? } else { CentsSquaredSats::ZERO }; self.pending.clear(); - self.raw.pending_cap = PendingCapDelta::default(); self.pending_capitalized_cap = PendingCapitalizedCapRawDelta::default(); self.cache = None; Ok(height) @@ -428,7 +204,7 @@ impl CostBasisOps for CostBasisData { Path: {:?}\n\ Current (after increments): {:?}\n\ Trying to decrement by: {:?}", - self.raw.pathbuf, + self.raw.path(), self.capitalized_cap_raw, self.pending_capitalized_cap.dec ); @@ -456,9 +232,8 @@ impl CostBasisOps for CostBasisData { self.apply_pending(); self.raw.write_and_cleanup(height, cleanup)?; - let raw_state = self.raw.state.as_ref().unwrap(); let mut buffer = self.map.as_ref().unwrap().serialize()?; - buffer.extend(raw_state.cap_raw.to_bytes()); + buffer.extend(self.raw.serialized_state()); if S::TRACK_CAPITAL { buffer.extend(self.capitalized_cap_raw.to_bytes()); } @@ -472,6 +247,7 @@ impl CostBasisOps for CostBasisData { mod tests { use std::{ fs, + path::PathBuf, sync::atomic::{AtomicU64, Ordering}, }; diff --git a/crates/brk_computer/src/distribution/state/cost_basis/minimal_realized_state.rs b/crates/brk_computer/src/distribution/state/cost_basis/minimal_realized_state.rs new file mode 100644 index 000000000..1efd40dc1 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/minimal_realized_state.rs @@ -0,0 +1,125 @@ +use std::cmp::Ordering; + +use brk_types::{Cents, CentsSats, CentsSquaredSats, Sats}; + +use super::RealizedOps; + +/// Realized state used by minimal cohorts and address cohorts. +#[derive(Debug, Default, Clone)] +pub struct MinimalRealizedState { + cap_raw: u128, + profit_raw: u128, + loss_raw: u128, +} + +impl MinimalRealizedState { + #[inline] + pub(crate) fn increment_cap(&mut self, cap: CentsSats) { + self.cap_raw += cap.as_u128(); + } + + #[inline] + pub(crate) fn decrement_cap(&mut self, cap: CentsSats) { + self.cap_raw -= cap.as_u128(); + } + + #[inline] + pub(crate) fn realize_spend(&mut self, current: CentsSats, previous: CentsSats) { + match current.cmp(&previous) { + Ordering::Greater => self.profit_raw += (current - previous).as_u128(), + Ordering::Less => self.loss_raw += (previous - current).as_u128(), + Ordering::Equal => {} + } + self.decrement_cap(previous); + } +} + +impl RealizedOps for MinimalRealizedState { + #[inline] + fn cap_raw(&self) -> CentsSats { + CentsSats::new(self.cap_raw) + } + + #[inline] + fn cap(&self) -> Cents { + Cents::new((self.cap_raw / Sats::ONE_BTC_U128) as u64) + } + + #[inline] + fn profit(&self) -> Cents { + Cents::new((self.profit_raw / Sats::ONE_BTC_U128) as u64) + } + + #[inline] + fn loss(&self) -> Cents { + Cents::new((self.loss_raw / Sats::ONE_BTC_U128) as u64) + } + + #[inline] + fn set_cap_raw(&mut self, cap_raw: CentsSats) { + self.cap_raw = cap_raw.inner(); + } + + #[inline] + fn set_capitalized_cap_raw(&mut self, _capitalized_cap_raw: CentsSquaredSats) {} + + #[inline] + fn reset_single_iteration_values(&mut self) { + self.profit_raw = 0; + self.loss_raw = 0; + } + + #[inline] + fn increment(&mut self, price: Cents, sats: Sats) { + if sats.is_not_zero() { + self.increment_cap(CentsSats::from_price_sats(price, sats)); + } + } + + #[inline] + fn increment_snapshot(&mut self, price_sats: CentsSats, _capitalized_cap: CentsSquaredSats) { + self.increment_cap(price_sats); + } + + #[inline] + fn decrement_snapshot(&mut self, price_sats: CentsSats, _capitalized_cap: CentsSquaredSats) { + self.decrement_cap(price_sats); + } + + #[inline] + fn send( + &mut self, + _sats: Sats, + current_ps: CentsSats, + prev_ps: CentsSats, + _ath_ps: CentsSats, + _prev_capitalized_cap: CentsSquaredSats, + ) { + self.realize_spend(current_ps, prev_ps); + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn tracks_only_cap_profit_and_loss() { + let mut state = MinimalRealizedState::default(); + state.increment(Cents::new(10_000), Sats::ONE_BTC); + state.send( + Sats::ONE_BTC, + CentsSats::from_price_sats(Cents::new(15_000), Sats::ONE_BTC), + CentsSats::from_price_sats(Cents::new(10_000), Sats::ONE_BTC), + CentsSats::ZERO, + CentsSquaredSats::ZERO, + ); + + assert_eq!(state.cap(), Cents::ZERO); + assert_eq!(state.profit(), Cents::new(5_000)); + assert_eq!(state.loss(), Cents::ZERO); + assert_eq!(state.value_destroyed(), Cents::ZERO); + assert_eq!(state.sent_in_profit(), Sats::ZERO); + assert_eq!(state.sent_in_loss(), Sats::ZERO); + } +} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/mod.rs b/crates/brk_computer/src/distribution/state/cost_basis/mod.rs index f71940038..6d3479d1a 100644 --- a/crates/brk_computer/src/distribution/state/cost_basis/mod.rs +++ b/crates/brk_computer/src/distribution/state/cost_basis/mod.rs @@ -1,12 +1,21 @@ +mod core_realized_state; mod data; +mod minimal_realized_state; +mod ops; +mod raw; mod realized; +mod realized_state; mod unrealized; -pub use data::*; +pub use core_realized_state::CoreRealizedState; +pub use data::CostBasisData; +pub use minimal_realized_state::MinimalRealizedState; +pub use ops::CostBasisOps; +pub use raw::CostBasisRaw; pub use realized::*; +pub use realized_state::RealizedState; pub use unrealized::UnrealizedState; pub(crate) use unrealized::{Accumulate, WithCapital, WithoutCapital}; // Internal use only -pub(super) use unrealized::CachedUnrealizedState; diff --git a/crates/brk_computer/src/distribution/state/cost_basis/ops.rs b/crates/brk_computer/src/distribution/state/cost_basis/ops.rs new file mode 100644 index 000000000..b40105c0b --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/ops.rs @@ -0,0 +1,30 @@ +use std::path::Path; + +use brk_error::Result; +use brk_types::{Cents, CentsSats, CentsSquaredSats, Height, Sats}; + +/// Common interface for persisted cost-basis state. +pub trait CostBasisOps: Send + Sync + 'static { + fn create(path: &Path, name: &str) -> Self; + fn import_at_or_before(&mut self, height: Height) -> Result; + fn cap_raw(&self) -> CentsSats; + fn capitalized_cap_raw(&self) -> CentsSquaredSats; + fn increment( + &mut self, + price: Cents, + sats: Sats, + price_sats: CentsSats, + capitalized_cap: CentsSquaredSats, + ); + fn decrement( + &mut self, + price: Cents, + sats: Sats, + price_sats: CentsSats, + capitalized_cap: CentsSquaredSats, + ); + fn apply_pending(&mut self); + fn init(&mut self); + fn clean(&mut self) -> Result<()>; + fn write(&mut self, height: Height, cleanup: bool) -> Result<()>; +} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/raw.rs b/crates/brk_computer/src/distribution/state/cost_basis/raw.rs new file mode 100644 index 000000000..d7806ea6d --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/raw.rs @@ -0,0 +1,213 @@ +use std::{ + collections::BTreeMap, + fs, + path::{Path, PathBuf}, +}; + +use brk_error::{Error, Result}; +use brk_types::{Cents, CentsSats, CentsSquaredSats, Height, Sats, UrpdRaw}; +use vecdb::{Bytes, unlikely}; + +use crate::distribution::state::pending::PendingCapDelta; + +use super::CostBasisOps; + +const STATE_TO_KEEP: usize = 10; + +#[derive(Clone, Default, Debug)] +struct RawState { + cap_raw: CentsSats, +} + +impl RawState { + fn serialize(&self) -> Vec { + self.cap_raw.to_bytes().to_vec() + } + + fn deserialize(data: &[u8]) -> Result { + Ok(Self { + cap_raw: CentsSats::from_bytes(&data[0..16])?, + }) + } +} + +/// Cost-basis tracking for cohorts that only need realized cap on restart. +#[derive(Clone, Debug)] +pub struct CostBasisRaw { + pathbuf: PathBuf, + state: Option, + pending_cap: PendingCapDelta, +} + +impl CostBasisRaw { + #[inline] + pub(crate) fn increment_cap(&mut self, value: CentsSats) { + self.pending_cap.inc += value; + } + + #[inline] + pub(crate) fn decrement_cap(&mut self, value: CentsSats) { + self.pending_cap.dec += value; + } + + #[inline] + pub(super) fn has_no_pending_cap(&self) -> bool { + self.pending_cap.is_zero() + } + + #[inline] + pub(super) fn path(&self) -> &Path { + &self.pathbuf + } + + pub(super) fn path_state(&self, height: Height) -> PathBuf { + self.pathbuf.join(height.to_string()) + } + + pub(super) fn read_dir( + &self, + keep_only_before: Option, + ) -> Result> { + if !self.pathbuf.exists() { + return Ok(BTreeMap::new()); + } + Ok(fs::read_dir(&self.pathbuf)? + .filter_map(|entry| { + let path = entry.ok()?.path(); + let name = path.file_name()?.to_str()?; + if let Ok(height) = name.parse::().map(Height::from) { + if keep_only_before.is_none_or(|limit| height < limit) { + Some((height, path)) + } else { + let _ = fs::remove_file(path); + None + } + } else { + None + } + }) + .collect()) + } + + pub(super) fn import_state(&mut self, data: &[u8]) -> Result<()> { + self.state = Some(RawState::deserialize(data)?); + self.pending_cap = PendingCapDelta::default(); + Ok(()) + } + + pub(super) fn serialized_state(&self) -> Vec { + self.state.as_ref().unwrap().serialize() + } + + pub(super) fn apply_pending_cap(&mut self) { + if self.pending_cap.is_zero() { + return; + } + let state = self.state.as_mut().unwrap(); + + state.cap_raw += self.pending_cap.inc; + if unlikely(state.cap_raw.inner() < self.pending_cap.dec.inner()) { + panic!( + "CostBasis cap_raw underflow!\n\ + Path: {:?}\n\ + Current cap_raw (after increments): {}\n\ + Trying to decrement by: {}", + self.pathbuf, state.cap_raw, self.pending_cap.dec + ); + } + state.cap_raw -= self.pending_cap.dec; + + self.pending_cap = PendingCapDelta::default(); + } + + pub(super) fn write_and_cleanup(&mut self, height: Height, cleanup: bool) -> Result<()> { + if cleanup { + let files = self.read_dir(Some(height))?; + for (_, path) in files + .iter() + .take(files.len().saturating_sub(STATE_TO_KEEP - 1)) + { + fs::remove_file(path)?; + } + } + Ok(()) + } +} + +impl CostBasisOps for CostBasisRaw { + fn create(path: &Path, name: &str) -> Self { + Self { + pathbuf: path.join(name).join("cost_basis"), + state: None, + pending_cap: PendingCapDelta::default(), + } + } + + fn import_at_or_before(&mut self, height: Height) -> Result { + let files = self.read_dir(None)?; + let (&height, path) = files.range(..=height).next_back().ok_or(Error::NotFound( + "No cost basis state found at or before height".into(), + ))?; + let data = fs::read(path)?; + if data.len() == 16 { + self.import_state(&data)?; + } else { + let (_, rest) = UrpdRaw::deserialize_with_rest(&data)?; + self.import_state(rest)?; + } + Ok(height) + } + + fn cap_raw(&self) -> CentsSats { + debug_assert!(self.pending_cap.is_zero()); + self.state.as_ref().unwrap().cap_raw + } + + fn capitalized_cap_raw(&self) -> CentsSquaredSats { + CentsSquaredSats::ZERO + } + + #[inline] + fn increment( + &mut self, + _price: Cents, + _sats: Sats, + price_sats: CentsSats, + _capitalized_cap: CentsSquaredSats, + ) { + self.increment_cap(price_sats); + } + + #[inline] + fn decrement( + &mut self, + _price: Cents, + _sats: Sats, + price_sats: CentsSats, + _capitalized_cap: CentsSquaredSats, + ) { + self.decrement_cap(price_sats); + } + + fn apply_pending(&mut self) { + self.apply_pending_cap(); + } + + fn init(&mut self) { + self.state.replace(RawState::default()); + self.pending_cap = PendingCapDelta::default(); + } + + fn clean(&mut self) -> Result<()> { + let _ = fs::remove_dir_all(&self.pathbuf); + fs::create_dir_all(&self.pathbuf)?; + Ok(()) + } + + fn write(&mut self, height: Height, cleanup: bool) -> Result<()> { + self.apply_pending_cap(); + self.write_and_cleanup(height, cleanup)?; + fs::write(self.path_state(height), self.serialized_state())?; + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/realized.rs b/crates/brk_computer/src/distribution/state/cost_basis/realized.rs index f7bc4c942..da0c76c85 100644 --- a/crates/brk_computer/src/distribution/state/cost_basis/realized.rs +++ b/crates/brk_computer/src/distribution/state/cost_basis/realized.rs @@ -1,11 +1,9 @@ -use std::cmp::Ordering; - use brk_types::{Cents, CentsSats, CentsSquaredSats, Sats}; -use vecdb::unlikely; /// Trait for realized state operations, implemented by Minimal, Core, and Full variants. pub trait RealizedOps: Default + Clone + Send + Sync + 'static { const TRACK_ACTIVITY: bool = false; + fn cap_raw(&self) -> CentsSats; fn cap(&self) -> Cents; fn profit(&self) -> Cents; fn loss(&self) -> Cents; @@ -36,404 +34,3 @@ pub trait RealizedOps: Default + Clone + Send + Sync + 'static { prev_capitalized_cap: CentsSquaredSats, ); } - -/// Minimal realized state: cap, profit, and loss. -/// Used by MinimalCohortMetrics cohorts (amount_range and type) and address cohorts. -#[derive(Debug, Default, Clone)] -pub struct MinimalRealizedState { - cap_raw: u128, - profit_raw: u128, - loss_raw: u128, -} - -impl MinimalRealizedState { - #[inline] - pub(crate) fn increment_cap(&mut self, cap: CentsSats) { - self.cap_raw += cap.as_u128(); - } - - #[inline] - pub(crate) fn decrement_cap(&mut self, cap: CentsSats) { - self.cap_raw -= cap.as_u128(); - } - - #[inline] - pub(crate) fn realize_spend(&mut self, current: CentsSats, previous: CentsSats) { - match current.cmp(&previous) { - Ordering::Greater => { - self.profit_raw += (current - previous).as_u128(); - } - Ordering::Less => { - self.loss_raw += (previous - current).as_u128(); - } - Ordering::Equal => {} - } - self.decrement_cap(previous); - } -} - -impl RealizedOps for MinimalRealizedState { - #[inline] - fn cap(&self) -> Cents { - if self.cap_raw == 0 { - return Cents::ZERO; - } - Cents::new((self.cap_raw / Sats::ONE_BTC_U128) as u64) - } - - #[inline] - fn profit(&self) -> Cents { - if self.profit_raw == 0 { - return Cents::ZERO; - } - Cents::new((self.profit_raw / Sats::ONE_BTC_U128) as u64) - } - - #[inline] - fn loss(&self) -> Cents { - if self.loss_raw == 0 { - return Cents::ZERO; - } - Cents::new((self.loss_raw / Sats::ONE_BTC_U128) as u64) - } - - #[inline] - fn set_cap_raw(&mut self, cap_raw: CentsSats) { - self.cap_raw = cap_raw.inner(); - } - - #[inline] - fn set_capitalized_cap_raw(&mut self, _capitalized_cap_raw: CentsSquaredSats) {} - - #[inline] - fn reset_single_iteration_values(&mut self) { - self.profit_raw = 0; - self.loss_raw = 0; - } - - #[inline] - fn increment(&mut self, price: Cents, sats: Sats) { - if sats.is_zero() { - return; - } - self.increment_cap(CentsSats::from_price_sats(price, sats)); - } - - #[inline] - fn increment_snapshot(&mut self, price_sats: CentsSats, _capitalized_cap: CentsSquaredSats) { - self.increment_cap(price_sats); - } - - #[inline] - fn decrement_snapshot(&mut self, price_sats: CentsSats, _capitalized_cap: CentsSquaredSats) { - self.decrement_cap(price_sats); - } - - #[inline] - fn send( - &mut self, - _sats: Sats, - current_ps: CentsSats, - prev_ps: CentsSats, - _ath_ps: CentsSats, - _prev_capitalized_cap: CentsSquaredSats, - ) { - self.realize_spend(current_ps, prev_ps); - } -} - -/// Core realized state: extends Minimal with activity tracking. -/// Used by CoreCohortMetrics cohorts (entry, epoch, class, under_age, over_age). -#[derive(Debug, Default, Clone)] -pub struct CoreRealizedState { - minimal: MinimalRealizedState, - value_destroyed_raw: u128, - sent_in_profit: Sats, - sent_in_loss: Sats, -} - -impl RealizedOps for CoreRealizedState { - const TRACK_ACTIVITY: bool = true; - - #[inline] - fn cap(&self) -> Cents { - self.minimal.cap() - } - - #[inline] - fn profit(&self) -> Cents { - self.minimal.profit() - } - - #[inline] - fn loss(&self) -> Cents { - self.minimal.loss() - } - - #[inline] - fn value_destroyed(&self) -> Cents { - if unlikely(self.value_destroyed_raw == 0) { - return Cents::ZERO; - } - Cents::new((self.value_destroyed_raw / Sats::ONE_BTC_U128) as u64) - } - - #[inline] - fn sent_in_profit(&self) -> Sats { - self.sent_in_profit - } - - #[inline] - fn sent_in_loss(&self) -> Sats { - self.sent_in_loss - } - - #[inline] - fn set_cap_raw(&mut self, cap_raw: CentsSats) { - self.minimal.set_cap_raw(cap_raw); - } - - #[inline] - fn set_capitalized_cap_raw(&mut self, _capitalized_cap_raw: CentsSquaredSats) {} - - #[inline] - fn reset_single_iteration_values(&mut self) { - self.minimal.reset_single_iteration_values(); - self.value_destroyed_raw = 0; - self.sent_in_profit = Sats::ZERO; - self.sent_in_loss = Sats::ZERO; - } - - #[inline] - fn increment(&mut self, price: Cents, sats: Sats) { - self.minimal.increment(price, sats); - } - - #[inline] - fn increment_snapshot(&mut self, price_sats: CentsSats, _capitalized_cap: CentsSquaredSats) { - self.minimal - .increment_snapshot(price_sats, _capitalized_cap); - } - - #[inline] - fn decrement_snapshot(&mut self, price_sats: CentsSats, _capitalized_cap: CentsSquaredSats) { - self.minimal - .decrement_snapshot(price_sats, _capitalized_cap); - } - - #[inline] - fn send( - &mut self, - sats: Sats, - current_ps: CentsSats, - prev_ps: CentsSats, - ath_ps: CentsSats, - prev_capitalized_cap: CentsSquaredSats, - ) { - self.minimal - .send(sats, current_ps, prev_ps, ath_ps, prev_capitalized_cap); - self.value_destroyed_raw += prev_ps.as_u128(); - match current_ps.cmp(&prev_ps) { - Ordering::Greater | Ordering::Equal => { - self.sent_in_profit += sats; - } - Ordering::Less => { - self.sent_in_loss += sats; - } - } - } -} - -impl CoreRealizedState { - #[inline(always)] - pub(super) fn cap_raw_u128(&self) -> u128 { - self.minimal.cap_raw - } -} - -/// Full realized state (~160 bytes). -/// Used by BasicCohortMetrics cohorts (age_range — 23 separate cohorts). -#[derive(Debug, Default, Clone)] -pub struct RealizedState { - core: CoreRealizedState, - /// Raw capitalized cap: Σ(price² × sats) - capitalized_cap_raw: CentsSquaredSats, - /// Raw realized peak regret: Σ((peak - sell_price) × sats) - peak_regret_raw: u128, -} - -impl RealizedOps for RealizedState { - const TRACK_ACTIVITY: bool = true; - - #[inline] - fn cap(&self) -> Cents { - self.core.cap() - } - - #[inline] - fn profit(&self) -> Cents { - self.core.profit() - } - - #[inline] - fn loss(&self) -> Cents { - self.core.loss() - } - - #[inline] - fn value_destroyed(&self) -> Cents { - self.core.value_destroyed() - } - - #[inline] - fn sent_in_profit(&self) -> Sats { - self.core.sent_in_profit() - } - - #[inline] - fn sent_in_loss(&self) -> Sats { - self.core.sent_in_loss() - } - - #[inline] - fn set_cap_raw(&mut self, cap_raw: CentsSats) { - self.core.set_cap_raw(cap_raw); - } - - #[inline] - fn set_capitalized_cap_raw(&mut self, capitalized_cap_raw: CentsSquaredSats) { - self.capitalized_cap_raw = capitalized_cap_raw; - } - - #[inline] - fn reset_single_iteration_values(&mut self) { - self.core.reset_single_iteration_values(); - self.peak_regret_raw = 0; - } - - #[inline] - fn increment(&mut self, price: Cents, sats: Sats) { - self.core.increment(price, sats); - if sats.is_not_zero() { - self.capitalized_cap_raw += - CentsSats::from_price_sats(price, sats).to_capitalized_cap(price); - } - } - - #[inline] - fn increment_snapshot(&mut self, price_sats: CentsSats, capitalized_cap: CentsSquaredSats) { - self.core.increment_snapshot(price_sats, capitalized_cap); - self.capitalized_cap_raw += capitalized_cap; - } - - #[inline] - fn decrement_snapshot(&mut self, price_sats: CentsSats, capitalized_cap: CentsSquaredSats) { - self.core.decrement_snapshot(price_sats, capitalized_cap); - self.capitalized_cap_raw -= capitalized_cap; - } - - #[inline] - fn send( - &mut self, - sats: Sats, - current_ps: CentsSats, - prev_ps: CentsSats, - ath_ps: CentsSats, - prev_capitalized_cap: CentsSquaredSats, - ) { - self.core - .send(sats, current_ps, prev_ps, ath_ps, prev_capitalized_cap); - - self.peak_regret_raw += (ath_ps - current_ps).as_u128(); - self.capitalized_cap_raw -= prev_capitalized_cap; - } -} - -impl RealizedState { - /// Get capitalized price as CentsUnsigned. - /// capitalized_price = Σ(price² × sats) / Σ(price × sats) - #[inline] - pub(crate) fn capitalized_price(&self) -> Cents { - let cap_raw = self.core.cap_raw_u128(); - if cap_raw == 0 { - return Cents::ZERO; - } - Cents::new((self.capitalized_cap_raw / cap_raw) as u64) - } - - /// Get raw realized cap for aggregation. - #[inline] - pub(crate) fn cap_raw(&self) -> CentsSats { - CentsSats::new(self.core.cap_raw_u128()) - } - - /// Get raw capitalized cap for aggregation. - #[inline] - pub(crate) fn capitalized_cap_raw(&self) -> CentsSquaredSats { - self.capitalized_cap_raw - } - - /// Get realized peak regret as CentsUnsigned. - #[inline] - pub(crate) fn peak_regret(&self) -> Cents { - if self.peak_regret_raw == 0 { - return Cents::ZERO; - } - Cents::new((self.peak_regret_raw / Sats::ONE_BTC_U128) as u64) - } - - /// Raw peak regret for lossless aggregation. - #[inline] - pub(crate) fn peak_regret_raw(&self) -> u128 { - self.peak_regret_raw - } -} - -#[cfg(test)] -mod tests { - use super::*; - - fn price_sats(price: u64) -> CentsSats { - CentsSats::from_price_sats(Cents::new(price), Sats::ONE_BTC) - } - - #[test] - fn minimal_tracks_only_cap_profit_and_loss() { - let mut state = MinimalRealizedState::default(); - state.increment(Cents::new(10_000), Sats::ONE_BTC); - state.send( - Sats::ONE_BTC, - price_sats(15_000), - price_sats(10_000), - CentsSats::ZERO, - CentsSquaredSats::ZERO, - ); - - assert_eq!(state.cap(), Cents::ZERO); - assert_eq!(state.profit(), Cents::new(5_000)); - assert_eq!(state.loss(), Cents::ZERO); - assert_eq!(state.value_destroyed(), Cents::ZERO); - assert_eq!(state.sent_in_profit(), Sats::ZERO); - assert_eq!(state.sent_in_loss(), Sats::ZERO); - } - - #[test] - fn core_adds_activity_to_minimal_realized_state() { - let mut state = CoreRealizedState::default(); - state.increment(Cents::new(10_000), Sats::ONE_BTC); - state.send( - Sats::ONE_BTC, - price_sats(15_000), - price_sats(10_000), - CentsSats::ZERO, - CentsSquaredSats::ZERO, - ); - - assert_eq!(state.cap(), Cents::ZERO); - assert_eq!(state.profit(), Cents::new(5_000)); - assert_eq!(state.loss(), Cents::ZERO); - assert_eq!(state.value_destroyed(), Cents::new(10_000)); - assert_eq!(state.sent_in_profit(), Sats::ONE_BTC); - assert_eq!(state.sent_in_loss(), Sats::ZERO); - } -} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/realized_state.rs b/crates/brk_computer/src/distribution/state/cost_basis/realized_state.rs new file mode 100644 index 000000000..09fc4dd61 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/realized_state.rs @@ -0,0 +1,121 @@ +use brk_types::{Cents, CentsSats, CentsSquaredSats, Sats}; + +use super::{CoreRealizedState, RealizedOps}; + +/// Full realized state used by age-range cohorts. +#[derive(Debug, Default, Clone)] +pub struct RealizedState { + core: CoreRealizedState, + /// Raw capitalized cap: sum(price squared times sats). + capitalized_cap_raw: CentsSquaredSats, + /// Raw realized peak regret: sum((peak minus sell price) times sats). + peak_regret_raw: u128, +} + +impl RealizedOps for RealizedState { + const TRACK_ACTIVITY: bool = true; + + #[inline] + fn cap_raw(&self) -> CentsSats { + self.core.cap_raw() + } + + #[inline] + fn cap(&self) -> Cents { + self.core.cap() + } + + #[inline] + fn profit(&self) -> Cents { + self.core.profit() + } + + #[inline] + fn loss(&self) -> Cents { + self.core.loss() + } + + #[inline] + fn value_destroyed(&self) -> Cents { + self.core.value_destroyed() + } + + #[inline] + fn sent_in_profit(&self) -> Sats { + self.core.sent_in_profit() + } + + #[inline] + fn sent_in_loss(&self) -> Sats { + self.core.sent_in_loss() + } + + #[inline] + fn set_cap_raw(&mut self, cap_raw: CentsSats) { + self.core.set_cap_raw(cap_raw); + } + + #[inline] + fn set_capitalized_cap_raw(&mut self, capitalized_cap_raw: CentsSquaredSats) { + self.capitalized_cap_raw = capitalized_cap_raw; + } + + #[inline] + fn reset_single_iteration_values(&mut self) { + self.core.reset_single_iteration_values(); + self.peak_regret_raw = 0; + } + + #[inline] + fn increment(&mut self, price: Cents, sats: Sats) { + self.core.increment(price, sats); + if sats.is_not_zero() { + self.capitalized_cap_raw += + CentsSats::from_price_sats(price, sats).to_capitalized_cap(price); + } + } + + #[inline] + fn increment_snapshot(&mut self, price_sats: CentsSats, capitalized_cap: CentsSquaredSats) { + self.core.increment_snapshot(price_sats, capitalized_cap); + self.capitalized_cap_raw += capitalized_cap; + } + + #[inline] + fn decrement_snapshot(&mut self, price_sats: CentsSats, capitalized_cap: CentsSquaredSats) { + self.core.decrement_snapshot(price_sats, capitalized_cap); + self.capitalized_cap_raw -= capitalized_cap; + } + + #[inline] + fn send( + &mut self, + sats: Sats, + current_ps: CentsSats, + prev_ps: CentsSats, + ath_ps: CentsSats, + prev_capitalized_cap: CentsSquaredSats, + ) { + self.core + .send(sats, current_ps, prev_ps, ath_ps, prev_capitalized_cap); + self.peak_regret_raw += (ath_ps - current_ps).as_u128(); + self.capitalized_cap_raw -= prev_capitalized_cap; + } +} + +impl RealizedState { + #[inline] + pub(crate) fn cap_raw(&self) -> CentsSats { + CentsSats::new(self.core.cap_raw_u128()) + } + + #[inline] + pub(crate) fn capitalized_cap_raw(&self) -> CentsSquaredSats { + self.capitalized_cap_raw + } + + #[inline] + pub(crate) fn peak_regret_raw(&self) -> u128 { + self.peak_regret_raw + } +} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/unrealized.rs b/crates/brk_computer/src/distribution/state/cost_basis/unrealized.rs deleted file mode 100644 index 80b401458..000000000 --- a/crates/brk_computer/src/distribution/state/cost_basis/unrealized.rs +++ /dev/null @@ -1,316 +0,0 @@ -use std::ops::Bound; - -use brk_types::{Cents, CentsCompact, Sats}; - -use super::CostBasisMap; - -#[derive(Debug, Default, Clone)] -pub struct UnrealizedState { - pub supply_in_profit: Sats, - pub supply_in_loss: Sats, - pub unrealized_profit: Cents, - pub unrealized_loss: Cents, - pub capitalized_cap_in_profit_raw: u128, - pub capitalized_cap_in_loss_raw: u128, -} - -impl UnrealizedState { - pub const ZERO: Self = Self { - supply_in_profit: Sats::ZERO, - supply_in_loss: Sats::ZERO, - unrealized_profit: Cents::ZERO, - unrealized_loss: Cents::ZERO, - capitalized_cap_in_profit_raw: 0, - capitalized_cap_in_loss_raw: 0, - }; -} - -/// Core cache state: supply + unrealized profit/loss only (64 bytes, 1 cache line). -#[derive(Debug, Default, Clone)] -pub struct WithoutCapital { - pub(crate) supply_in_profit: Sats, - pub(crate) supply_in_loss: Sats, - pub(crate) unrealized_profit: u128, - pub(crate) unrealized_loss: u128, -} - -/// Full cache state: core + capitalized cap (for sentiment computation). -#[derive(Debug, Default, Clone)] -pub struct WithCapital { - core: WithoutCapital, - capitalized_cap_in_profit: u128, - capitalized_cap_in_loss: u128, -} - -#[inline(always)] -fn div_btc(raw: u128) -> Cents { - if raw == 0 { - Cents::ZERO - } else { - Cents::new((raw / Sats::ONE_BTC_U128) as u64) - } -} - -/// Trait for accumulating profit/loss across BTreeMap entries. -/// `WithoutCapital` skips capital tracking; `WithCapital` tracks all fields. -pub trait Accumulate: Default + Clone + Send + Sync + 'static { - const TRACK_CAPITAL: bool; - - fn to_output(&self) -> UnrealizedState; - fn core(&self) -> &WithoutCapital; - fn core_mut(&mut self) -> &mut WithoutCapital; - - fn supply_in_profit(&self) -> Sats { - self.core().supply_in_profit - } - fn supply_in_loss(&self) -> Sats { - self.core().supply_in_loss - } - fn unrealized_profit(&mut self) -> &mut u128 { - &mut self.core_mut().unrealized_profit - } - fn unrealized_loss(&mut self) -> &mut u128 { - &mut self.core_mut().unrealized_loss - } - - fn accumulate_profit(&mut self, price_u128: u128, sats: Sats); - fn accumulate_loss(&mut self, price_u128: u128, sats: Sats); - fn deaccumulate_profit(&mut self, price_u128: u128, sats: Sats); - fn deaccumulate_loss(&mut self, price_u128: u128, sats: Sats); -} - -impl Accumulate for WithoutCapital { - const TRACK_CAPITAL: bool = false; - - fn to_output(&self) -> UnrealizedState { - UnrealizedState { - supply_in_profit: self.supply_in_profit, - supply_in_loss: self.supply_in_loss, - unrealized_profit: div_btc(self.unrealized_profit), - unrealized_loss: div_btc(self.unrealized_loss), - ..UnrealizedState::ZERO - } - } - - fn core(&self) -> &WithoutCapital { - self - } - fn core_mut(&mut self) -> &mut WithoutCapital { - self - } - - #[inline(always)] - fn accumulate_profit(&mut self, _price_u128: u128, sats: Sats) { - self.supply_in_profit += sats; - } - #[inline(always)] - fn accumulate_loss(&mut self, _price_u128: u128, sats: Sats) { - self.supply_in_loss += sats; - } - #[inline(always)] - fn deaccumulate_profit(&mut self, _price_u128: u128, sats: Sats) { - self.supply_in_profit -= sats; - } - #[inline(always)] - fn deaccumulate_loss(&mut self, _price_u128: u128, sats: Sats) { - self.supply_in_loss -= sats; - } -} - -impl Accumulate for WithCapital { - const TRACK_CAPITAL: bool = true; - - fn to_output(&self) -> UnrealizedState { - UnrealizedState { - capitalized_cap_in_profit_raw: self.capitalized_cap_in_profit, - capitalized_cap_in_loss_raw: self.capitalized_cap_in_loss, - ..Accumulate::to_output(&self.core) - } - } - - fn core(&self) -> &WithoutCapital { - &self.core - } - fn core_mut(&mut self) -> &mut WithoutCapital { - &mut self.core - } - - #[inline(always)] - fn accumulate_profit(&mut self, price_u128: u128, sats: Sats) { - self.core.supply_in_profit += sats; - let invested = price_u128 * sats.as_u128(); - self.capitalized_cap_in_profit += price_u128 * invested; - } - #[inline(always)] - fn accumulate_loss(&mut self, price_u128: u128, sats: Sats) { - self.core.supply_in_loss += sats; - let invested = price_u128 * sats.as_u128(); - self.capitalized_cap_in_loss += price_u128 * invested; - } - #[inline(always)] - fn deaccumulate_profit(&mut self, price_u128: u128, sats: Sats) { - self.core.supply_in_profit -= sats; - let invested = price_u128 * sats.as_u128(); - self.capitalized_cap_in_profit -= price_u128 * invested; - } - #[inline(always)] - fn deaccumulate_loss(&mut self, price_u128: u128, sats: Sats) { - self.core.supply_in_loss -= sats; - let invested = price_u128 * sats.as_u128(); - self.capitalized_cap_in_loss -= price_u128 * invested; - } -} - -#[derive(Debug, Clone)] -pub(crate) struct CachedUnrealizedState { - state: S, - at_price: CentsCompact, - cached_output: Option, -} - -impl CachedUnrealizedState { - pub(crate) fn compute_fresh(price: Cents, map: &CostBasisMap) -> Self { - let price: CentsCompact = price.into(); - let state = Self::compute_raw(price, map); - Self { - state, - at_price: price, - cached_output: None, - } - } - - pub(crate) fn current_state(&self) -> UnrealizedState { - self.state.to_output() - } - - pub(crate) fn get_at_price(&mut self, new_price: Cents, map: &CostBasisMap) -> UnrealizedState { - let new_price: CentsCompact = new_price.into(); - if new_price != self.at_price { - self.update_for_price_change(new_price, map); - self.cached_output = None; - } - if let Some(ref output) = self.cached_output { - return output.clone(); - } - self.cached_output.insert(self.state.to_output()).clone() - } - - pub(crate) fn on_receive(&mut self, price: Cents, sats: Sats) { - self.cached_output = None; - let price: CentsCompact = price.into(); - let sats_u128 = sats.as_u128(); - let price_u128 = price.as_u128(); - - if price <= self.at_price { - self.state.accumulate_profit(price_u128, sats); - if price < self.at_price { - let diff = (self.at_price - price).as_u128(); - *self.state.unrealized_profit() += diff * sats_u128; - } - } else { - self.state.accumulate_loss(price_u128, sats); - let diff = (price - self.at_price).as_u128(); - *self.state.unrealized_loss() += diff * sats_u128; - } - } - - pub(crate) fn on_send(&mut self, price: Cents, sats: Sats) { - self.cached_output = None; - let price: CentsCompact = price.into(); - let sats_u128 = sats.as_u128(); - let price_u128 = price.as_u128(); - - if price <= self.at_price { - self.state.deaccumulate_profit(price_u128, sats); - if price < self.at_price { - let diff = (self.at_price - price).as_u128(); - *self.state.unrealized_profit() -= diff * sats_u128; - } - } else { - self.state.deaccumulate_loss(price_u128, sats); - let diff = (price - self.at_price).as_u128(); - *self.state.unrealized_loss() -= diff * sats_u128; - } - } - - fn update_for_price_change(&mut self, new_price: CentsCompact, map: &CostBasisMap) { - let old_price = self.at_price; - - if new_price > old_price { - let delta = (new_price - old_price).as_u128(); - let original_supply_in_profit = self.state.supply_in_profit().as_u128(); - - for (&price, &sats) in - map.range((Bound::Excluded(old_price), Bound::Included(new_price))) - { - let sats_u128 = sats.as_u128(); - let price_u128 = price.as_u128(); - - self.state.deaccumulate_loss(price_u128, sats); - self.state.accumulate_profit(price_u128, sats); - - let original_loss = (price - old_price).as_u128(); - *self.state.unrealized_loss() -= original_loss * sats_u128; - - if price < new_price { - let new_profit = (new_price - price).as_u128(); - *self.state.unrealized_profit() += new_profit * sats_u128; - } - } - - *self.state.unrealized_profit() += delta * original_supply_in_profit; - let non_crossing_loss_sats = self.state.supply_in_loss().as_u128(); - *self.state.unrealized_loss() -= delta * non_crossing_loss_sats; - } else if new_price < old_price { - let delta = (old_price - new_price).as_u128(); - let original_supply_in_loss = self.state.supply_in_loss().as_u128(); - - for (&price, &sats) in - map.range((Bound::Excluded(new_price), Bound::Included(old_price))) - { - let sats_u128 = sats.as_u128(); - let price_u128 = price.as_u128(); - - self.state.deaccumulate_profit(price_u128, sats); - self.state.accumulate_loss(price_u128, sats); - - if price < old_price { - let original_profit = (old_price - price).as_u128(); - *self.state.unrealized_profit() -= original_profit * sats_u128; - } - - let new_loss = (price - new_price).as_u128(); - *self.state.unrealized_loss() += new_loss * sats_u128; - } - - *self.state.unrealized_loss() += delta * original_supply_in_loss; - let non_crossing_profit_sats = self.state.supply_in_profit().as_u128(); - *self.state.unrealized_profit() -= delta * non_crossing_profit_sats; - } - - self.at_price = new_price; - } - - fn compute_raw(current_price: CentsCompact, map: &CostBasisMap) -> S { - let mut state = S::default(); - - for (&price, &sats) in map.iter() { - let sats_u128 = sats.as_u128(); - let price_u128 = price.as_u128(); - - if price <= current_price { - state.accumulate_profit(price_u128, sats); - if price < current_price { - let diff = (current_price - price).as_u128(); - *state.unrealized_profit() += diff * sats_u128; - } - } else { - state.accumulate_loss(price_u128, sats); - let diff = (price - current_price).as_u128(); - *state.unrealized_loss() += diff * sats_u128; - } - } - - state - } -} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/unrealized/accumulate.rs b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/accumulate.rs new file mode 100644 index 000000000..7164ee118 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/accumulate.rs @@ -0,0 +1,42 @@ +use brk_types::{Cents, Sats}; + +use super::{UnrealizedState, WithoutCapital}; + +/// Accumulates profit and loss across cost-basis entries. +pub trait Accumulate: Default + Clone + Send + Sync + 'static { + const TRACK_CAPITAL: bool; + + fn to_output(&self) -> UnrealizedState; + fn core(&self) -> &WithoutCapital; + fn core_mut(&mut self) -> &mut WithoutCapital; + + fn supply_in_profit(&self) -> Sats { + self.core().supply_in_profit + } + + fn supply_in_loss(&self) -> Sats { + self.core().supply_in_loss + } + + fn unrealized_profit(&mut self) -> &mut u128 { + &mut self.core_mut().unrealized_profit + } + + fn unrealized_loss(&mut self) -> &mut u128 { + &mut self.core_mut().unrealized_loss + } + + fn accumulate_profit(&mut self, price: u128, sats: Sats); + fn accumulate_loss(&mut self, price: u128, sats: Sats); + fn deaccumulate_profit(&mut self, price: u128, sats: Sats); + fn deaccumulate_loss(&mut self, price: u128, sats: Sats); +} + +#[inline(always)] +pub(super) fn div_btc(raw: u128) -> Cents { + if raw == 0 { + Cents::ZERO + } else { + Cents::new((raw / Sats::ONE_BTC_U128) as u64) + } +} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/unrealized/cache.rs b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/cache.rs new file mode 100644 index 000000000..3f5b72795 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/cache.rs @@ -0,0 +1,167 @@ +use std::{collections::BTreeMap, ops::Bound}; + +use brk_types::{Cents, CentsCompact, Sats}; + +use super::{Accumulate, UnrealizedState}; + +#[derive(Debug, Clone)] +pub(crate) struct CachedUnrealizedState { + state: S, + at_price: CentsCompact, + cached_output: Option, +} + +impl CachedUnrealizedState { + pub(crate) fn compute_fresh(price: Cents, map: &BTreeMap) -> Self { + let price = price.into(); + let state = Self::compute_raw(price, map); + Self { + state, + at_price: price, + cached_output: None, + } + } + + pub(crate) fn current_state(&self) -> UnrealizedState { + self.state.to_output() + } + + pub(crate) fn get_at_price( + &mut self, + new_price: Cents, + map: &BTreeMap, + ) -> UnrealizedState { + let new_price = new_price.into(); + if new_price != self.at_price { + self.update_for_price_change(new_price, map); + self.cached_output = None; + } + if let Some(output) = &self.cached_output { + return output.clone(); + } + self.cached_output.insert(self.state.to_output()).clone() + } + + pub(crate) fn on_receive(&mut self, price: Cents, sats: Sats) { + self.cached_output = None; + let price: CentsCompact = price.into(); + let sats_u128 = sats.as_u128(); + let price_u128 = price.as_u128(); + + if price <= self.at_price { + self.state.accumulate_profit(price_u128, sats); + if price < self.at_price { + let diff = (self.at_price - price).as_u128(); + *self.state.unrealized_profit() += diff * sats_u128; + } + } else { + self.state.accumulate_loss(price_u128, sats); + let diff = (price - self.at_price).as_u128(); + *self.state.unrealized_loss() += diff * sats_u128; + } + } + + pub(crate) fn on_send(&mut self, price: Cents, sats: Sats) { + self.cached_output = None; + let price: CentsCompact = price.into(); + let sats_u128 = sats.as_u128(); + let price_u128 = price.as_u128(); + + if price <= self.at_price { + self.state.deaccumulate_profit(price_u128, sats); + if price < self.at_price { + let diff = (self.at_price - price).as_u128(); + *self.state.unrealized_profit() -= diff * sats_u128; + } + } else { + self.state.deaccumulate_loss(price_u128, sats); + let diff = (price - self.at_price).as_u128(); + *self.state.unrealized_loss() -= diff * sats_u128; + } + } + + fn update_for_price_change( + &mut self, + new_price: CentsCompact, + map: &BTreeMap, + ) { + let old_price = self.at_price; + + if new_price > old_price { + let delta = (new_price - old_price).as_u128(); + let original_supply_in_profit = self.state.supply_in_profit().as_u128(); + + for (&price, &sats) in + map.range((Bound::Excluded(old_price), Bound::Included(new_price))) + { + let sats_u128 = sats.as_u128(); + let price_u128 = price.as_u128(); + + self.state.deaccumulate_loss(price_u128, sats); + self.state.accumulate_profit(price_u128, sats); + + let original_loss = (price - old_price).as_u128(); + *self.state.unrealized_loss() -= original_loss * sats_u128; + + if price < new_price { + let new_profit = (new_price - price).as_u128(); + *self.state.unrealized_profit() += new_profit * sats_u128; + } + } + + *self.state.unrealized_profit() += delta * original_supply_in_profit; + let non_crossing_loss_sats = self.state.supply_in_loss().as_u128(); + *self.state.unrealized_loss() -= delta * non_crossing_loss_sats; + } else if new_price < old_price { + let delta = (old_price - new_price).as_u128(); + let original_supply_in_loss = self.state.supply_in_loss().as_u128(); + + for (&price, &sats) in + map.range((Bound::Excluded(new_price), Bound::Included(old_price))) + { + let sats_u128 = sats.as_u128(); + let price_u128 = price.as_u128(); + + self.state.deaccumulate_profit(price_u128, sats); + self.state.accumulate_loss(price_u128, sats); + + if price < old_price { + let original_profit = (old_price - price).as_u128(); + *self.state.unrealized_profit() -= original_profit * sats_u128; + } + + let new_loss = (price - new_price).as_u128(); + *self.state.unrealized_loss() += new_loss * sats_u128; + } + + *self.state.unrealized_loss() += delta * original_supply_in_loss; + let non_crossing_profit_sats = self.state.supply_in_profit().as_u128(); + *self.state.unrealized_profit() -= delta * non_crossing_profit_sats; + } + + self.at_price = new_price; + } + + fn compute_raw(current_price: CentsCompact, map: &BTreeMap) -> S { + let mut state = S::default(); + + for (&price, &sats) in map { + let sats_u128 = sats.as_u128(); + let price_u128 = price.as_u128(); + + if price <= current_price { + state.accumulate_profit(price_u128, sats); + if price < current_price { + let diff = (current_price - price).as_u128(); + *state.unrealized_profit() += diff * sats_u128; + } + } else { + state.accumulate_loss(price_u128, sats); + let diff = (price - current_price).as_u128(); + *state.unrealized_loss() += diff * sats_u128; + } + } + + state + } +} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/unrealized/mod.rs b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/mod.rs new file mode 100644 index 000000000..3d0fad5d3 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/mod.rs @@ -0,0 +1,13 @@ +mod accumulate; +mod cache; +mod state; +mod with_capital; +mod without_capital; + +pub use state::UnrealizedState; + +pub(crate) use accumulate::Accumulate; +pub(crate) use with_capital::WithCapital; +pub(crate) use without_capital::WithoutCapital; + +pub(super) use cache::CachedUnrealizedState; diff --git a/crates/brk_computer/src/distribution/state/cost_basis/unrealized/state.rs b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/state.rs new file mode 100644 index 000000000..2410bf1e0 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/state.rs @@ -0,0 +1,36 @@ +use std::ops::AddAssign; + +use brk_types::{Cents, Sats}; + +#[derive(Debug, Default, Clone)] +pub struct UnrealizedState { + pub supply_in_profit: Sats, + pub supply_in_loss: Sats, + pub unrealized_profit: Cents, + pub unrealized_loss: Cents, + pub capitalized_cap_in_profit_raw: u128, + pub capitalized_cap_in_loss_raw: u128, +} + +impl UnrealizedState { + pub const ZERO: Self = Self { + supply_in_profit: Sats::ZERO, + supply_in_loss: Sats::ZERO, + unrealized_profit: Cents::ZERO, + unrealized_loss: Cents::ZERO, + capitalized_cap_in_profit_raw: 0, + capitalized_cap_in_loss_raw: 0, + }; +} + +impl AddAssign<&Self> for UnrealizedState { + #[inline(always)] + fn add_assign(&mut self, rhs: &Self) { + self.supply_in_profit += rhs.supply_in_profit; + self.supply_in_loss += rhs.supply_in_loss; + self.unrealized_profit += rhs.unrealized_profit; + self.unrealized_loss += rhs.unrealized_loss; + self.capitalized_cap_in_profit_raw += rhs.capitalized_cap_in_profit_raw; + self.capitalized_cap_in_loss_raw += rhs.capitalized_cap_in_loss_raw; + } +} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/unrealized/with_capital.rs b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/with_capital.rs new file mode 100644 index 000000000..ffe425b75 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/with_capital.rs @@ -0,0 +1,59 @@ +use brk_types::Sats; + +use super::{Accumulate, UnrealizedState, WithoutCapital}; + +/// Unrealized cache state with capitalized-cap tracking. +#[derive(Debug, Default, Clone)] +pub struct WithCapital { + core: WithoutCapital, + capitalized_cap_in_profit: u128, + capitalized_cap_in_loss: u128, +} + +impl Accumulate for WithCapital { + const TRACK_CAPITAL: bool = true; + + fn to_output(&self) -> UnrealizedState { + UnrealizedState { + capitalized_cap_in_profit_raw: self.capitalized_cap_in_profit, + capitalized_cap_in_loss_raw: self.capitalized_cap_in_loss, + ..Accumulate::to_output(&self.core) + } + } + + fn core(&self) -> &WithoutCapital { + &self.core + } + + fn core_mut(&mut self) -> &mut WithoutCapital { + &mut self.core + } + + #[inline(always)] + fn accumulate_profit(&mut self, price: u128, sats: Sats) { + self.core.supply_in_profit += sats; + let invested = price * sats.as_u128(); + self.capitalized_cap_in_profit += price * invested; + } + + #[inline(always)] + fn accumulate_loss(&mut self, price: u128, sats: Sats) { + self.core.supply_in_loss += sats; + let invested = price * sats.as_u128(); + self.capitalized_cap_in_loss += price * invested; + } + + #[inline(always)] + fn deaccumulate_profit(&mut self, price: u128, sats: Sats) { + self.core.supply_in_profit -= sats; + let invested = price * sats.as_u128(); + self.capitalized_cap_in_profit -= price * invested; + } + + #[inline(always)] + fn deaccumulate_loss(&mut self, price: u128, sats: Sats) { + self.core.supply_in_loss -= sats; + let invested = price * sats.as_u128(); + self.capitalized_cap_in_loss -= price * invested; + } +} diff --git a/crates/brk_computer/src/distribution/state/cost_basis/unrealized/without_capital.rs b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/without_capital.rs new file mode 100644 index 000000000..fb851a5cc --- /dev/null +++ b/crates/brk_computer/src/distribution/state/cost_basis/unrealized/without_capital.rs @@ -0,0 +1,54 @@ +use brk_types::Sats; + +use super::{Accumulate, UnrealizedState, accumulate::div_btc}; + +/// Supply and unrealized profit/loss cache state without capital tracking. +#[derive(Debug, Default, Clone)] +pub struct WithoutCapital { + pub(crate) supply_in_profit: Sats, + pub(crate) supply_in_loss: Sats, + pub(crate) unrealized_profit: u128, + pub(crate) unrealized_loss: u128, +} + +impl Accumulate for WithoutCapital { + const TRACK_CAPITAL: bool = false; + + fn to_output(&self) -> UnrealizedState { + UnrealizedState { + supply_in_profit: self.supply_in_profit, + supply_in_loss: self.supply_in_loss, + unrealized_profit: div_btc(self.unrealized_profit), + unrealized_loss: div_btc(self.unrealized_loss), + ..UnrealizedState::ZERO + } + } + + fn core(&self) -> &WithoutCapital { + self + } + + fn core_mut(&mut self) -> &mut WithoutCapital { + self + } + + #[inline(always)] + fn accumulate_profit(&mut self, _price: u128, sats: Sats) { + self.supply_in_profit += sats; + } + + #[inline(always)] + fn accumulate_loss(&mut self, _price: u128, sats: Sats) { + self.supply_in_loss += sats; + } + + #[inline(always)] + fn deaccumulate_profit(&mut self, _price: u128, sats: Sats) { + self.supply_in_profit -= sats; + } + + #[inline(always)] + fn deaccumulate_loss(&mut self, _price: u128, sats: Sats) { + self.supply_in_loss -= sats; + } +} diff --git a/crates/brk_computer/src/distribution/state/mod.rs b/crates/brk_computer/src/distribution/state/mod.rs index 025bac204..c40f646f1 100644 --- a/crates/brk_computer/src/distribution/state/mod.rs +++ b/crates/brk_computer/src/distribution/state/mod.rs @@ -1,11 +1,15 @@ +mod addr; mod block; mod cohort; mod cost_basis; mod pending; mod transacted; +mod utxo; +pub use addr::*; pub use block::*; pub use cohort::*; pub use cost_basis::*; pub use pending::*; pub use transacted::*; +pub use utxo::*; diff --git a/crates/brk_computer/src/distribution/state/pending.rs b/crates/brk_computer/src/distribution/state/pending.rs deleted file mode 100644 index 1f78516b3..000000000 --- a/crates/brk_computer/src/distribution/state/pending.rs +++ /dev/null @@ -1,26 +0,0 @@ -use brk_types::{CentsSats, CentsSquaredSats, Sats}; - -#[derive(Clone, Debug, Default)] -pub(crate) struct PendingCapDelta { - pub inc: CentsSats, - pub dec: CentsSats, -} - -impl PendingCapDelta { - pub fn is_zero(&self) -> bool { - self.inc == CentsSats::ZERO && self.dec == CentsSats::ZERO - } -} - -#[derive(Clone, Debug, Default)] -pub(crate) struct PendingCapitalizedCapRawDelta { - pub inc: CentsSquaredSats, - pub dec: CentsSquaredSats, -} - -/// Pending increments and decrements for a single price bucket. -#[derive(Clone, Copy, Debug, Default)] -pub struct PendingDelta { - pub inc: Sats, - pub dec: Sats, -} diff --git a/crates/brk_computer/src/distribution/state/pending/cap.rs b/crates/brk_computer/src/distribution/state/pending/cap.rs new file mode 100644 index 000000000..221499fc6 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/pending/cap.rs @@ -0,0 +1,13 @@ +use brk_types::CentsSats; + +#[derive(Clone, Debug, Default)] +pub(crate) struct PendingCapDelta { + pub inc: CentsSats, + pub dec: CentsSats, +} + +impl PendingCapDelta { + pub(crate) fn is_zero(&self) -> bool { + self.inc == CentsSats::ZERO && self.dec == CentsSats::ZERO + } +} diff --git a/crates/brk_computer/src/distribution/state/pending/capitalized_cap.rs b/crates/brk_computer/src/distribution/state/pending/capitalized_cap.rs new file mode 100644 index 000000000..3454fd132 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/pending/capitalized_cap.rs @@ -0,0 +1,7 @@ +use brk_types::CentsSquaredSats; + +#[derive(Clone, Debug, Default)] +pub(crate) struct PendingCapitalizedCapRawDelta { + pub inc: CentsSquaredSats, + pub dec: CentsSquaredSats, +} diff --git a/crates/brk_computer/src/distribution/state/pending/delta.rs b/crates/brk_computer/src/distribution/state/pending/delta.rs new file mode 100644 index 000000000..e81a8c7cf --- /dev/null +++ b/crates/brk_computer/src/distribution/state/pending/delta.rs @@ -0,0 +1,7 @@ +use brk_types::Sats; + +#[derive(Clone, Copy, Debug, Default)] +pub struct PendingDelta { + pub inc: Sats, + pub dec: Sats, +} diff --git a/crates/brk_computer/src/distribution/state/pending/mod.rs b/crates/brk_computer/src/distribution/state/pending/mod.rs new file mode 100644 index 000000000..ca1fef802 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/pending/mod.rs @@ -0,0 +1,7 @@ +mod cap; +mod capitalized_cap; +mod delta; + +pub(crate) use cap::PendingCapDelta; +pub(crate) use capitalized_cap::PendingCapitalizedCapRawDelta; +pub use delta::PendingDelta; diff --git a/crates/brk_computer/src/distribution/state/utxo/cohort.rs b/crates/brk_computer/src/distribution/state/utxo/cohort.rs new file mode 100644 index 000000000..419dc8904 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/utxo/cohort.rs @@ -0,0 +1,83 @@ +use std::path::Path; + +use brk_error::Result; +use brk_types::{Bitcoin, Cents, CentsSigned, Sats, StoredF64, StoredU64, SupplyState}; +use derive_more::{Deref, DerefMut}; + +use super::super::CohortState; +use super::super::cost_basis::{CostBasisOps, RealizedOps}; +use crate::distribution::metrics::RealizedBlockData; + +#[derive(Deref, DerefMut)] +pub struct UTXOCohortState(pub(crate) CohortState); + +impl UTXOCohortState { + pub(crate) fn new(path: &Path, name: &str) -> Self { + Self(CohortState::new(path, name)) + } + + pub(crate) fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { + self.0.reset_cost_basis_data_if_needed() + } + + /// Reset state for fresh start. + pub(crate) fn reset(&mut self) { + self.0.supply = SupplyState::default(); + self.0.sent = Sats::ZERO; + self.0.spent_utxo_count = 0; + self.0.satdays_destroyed = Sats::ZERO; + self.0.realized = R::default(); + } + + #[inline(always)] + pub(crate) fn supply_value(&self) -> Sats { + self.supply.value + } + + #[inline(always)] + pub(crate) fn output_counts(&self) -> (StoredU64, StoredU64) { + ( + StoredU64::from(self.supply.utxo_count), + StoredU64::from(self.spent_utxo_count), + ) + } + + #[inline(always)] + pub(crate) fn transfer_volume(&self) -> Sats { + self.sent + } + + #[inline(always)] + pub(crate) fn core_activity(&self) -> (StoredF64, Sats, Sats) { + ( + StoredF64::from(Bitcoin::from(self.satdays_destroyed)), + self.realized.sent_in_profit(), + self.realized.sent_in_loss(), + ) + } + + #[inline(always)] + pub(crate) fn realized_block_data(&self) -> RealizedBlockData { + let cap_raw = self.realized.cap_raw(); + let supply = self.supply.value; + let cap = self.realized.cap(); + let profit = self.realized.profit(); + let loss = self.realized.loss(); + let price = cap_raw + .as_u128() + .checked_div(supply.as_u128()) + .map(|price| Cents::new(price as u64)) + .unwrap_or_default(); + + RealizedBlockData { + cap_raw, + supply, + cap, + price, + profit, + loss, + net_pnl: CentsSigned::new(profit.inner() as i64 - loss.inner() as i64), + value_destroyed: self.realized.value_destroyed(), + } + } +} diff --git a/crates/brk_computer/src/distribution/state/utxo/collection.rs b/crates/brk_computer/src/distribution/state/utxo/collection.rs new file mode 100644 index 000000000..41c2b806c --- /dev/null +++ b/crates/brk_computer/src/distribution/state/utxo/collection.rs @@ -0,0 +1,287 @@ +use std::path::Path; + +use brk_cohort::{ + AgeRange, AgeRangeId, AmountRange, ByEntry, ByEpoch, Class, CohortContext, Filter, + SpendableType, +}; +use brk_error::Result; +use brk_types::{Height, Sats, StoredU64}; +use rayon::prelude::*; +use vecdb::{ColumnId, ReadableVec}; + +use super::{CostBasisFenwick, UTXOCohortState, UTXOTransientState}; +use crate::distribution::metrics::CohortMetrics; +use crate::distribution::state::{ + CoreRealizedState, CostBasisData, CostBasisOps, CostBasisRaw, MinimalRealizedState, + RealizedOps, RealizedState, WithCapital, WithoutCapital, +}; + +pub struct UTXOStates { + pub age_range: AgeRange>>, + pub epoch: ByEpoch>>, + pub class: Class>>, + pub entry: ByEntry>>, + pub amount_range: AmountRange>, + pub type_: SpendableType>>, + pub(super) transient: UTXOTransientState, +} + +impl UTXOStates { + pub(crate) fn new(path: &Path) -> Self { + let name = |filter: &Filter, cohort: &str| CohortContext::Utxo.full_name(filter, cohort); + + Self { + age_range: AgeRange::new(|filter, cohort| { + UTXOCohortState::new(path, &name(&filter, cohort)) + }), + epoch: ByEpoch::new(|filter, cohort| { + UTXOCohortState::new(path, &name(&filter, cohort)) + }), + class: Class::new(|filter, cohort| UTXOCohortState::new(path, &name(&filter, cohort))), + entry: ByEntry::new(|filter, cohort| { + UTXOCohortState::new(path, &name(&filter, cohort)) + }), + amount_range: AmountRange::new(|filter, cohort| { + UTXOCohortState::new(path, &name(&filter, cohort)) + }), + type_: SpendableType::new(|filter, cohort| { + UTXOCohortState::new(path, &name(&filter, cohort)) + }), + transient: UTXOTransientState::default(), + } + } + + pub(crate) fn reset(&mut self) -> Result<()> { + for state in self.age_range.iter_mut() { + state.reset(); + state.reset_cost_basis_data_if_needed()?; + } + for state in self.epoch.iter_mut() { + state.reset(); + state.reset_cost_basis_data_if_needed()?; + } + for state in self.class.iter_mut() { + state.reset(); + state.reset_cost_basis_data_if_needed()?; + } + for state in self.entry.iter_mut() { + state.reset(); + state.reset_cost_basis_data_if_needed()?; + } + for state in self.amount_range.iter_mut() { + state.reset(); + state.reset_cost_basis_data_if_needed()?; + } + for state in self.type_.iter_mut() { + state.reset(); + state.reset_cost_basis_data_if_needed()?; + } + self.transient = UTXOTransientState::default(); + Ok(()) + } + + pub(crate) fn import(&mut self, metrics: &CohortMetrics, height: Height) -> Result { + for ((state, supply), unspent_count) in self + .age_range + .iter_mut() + .zip(metrics.supply.total.cohorts.age.range.iter()) + .zip(metrics.outputs.unspent_count.cohorts.age.range.iter()) + { + if Self::import_one(state, &supply.sats.height, &unspent_count.height, height)? + != height + { + return Ok(false); + } + } + for ((state, supply), unspent_count) in self + .epoch + .iter_mut() + .zip(metrics.supply.total.cohorts.epoch.iter()) + .zip(metrics.outputs.unspent_count.cohorts.epoch.iter()) + { + if Self::import_one(state, &supply.sats.height, &unspent_count.height, height)? + != height + { + return Ok(false); + } + } + for ((state, supply), unspent_count) in self + .class + .iter_mut() + .zip(metrics.supply.total.cohorts.class.iter()) + .zip(metrics.outputs.unspent_count.cohorts.class.iter()) + { + if Self::import_one(state, &supply.sats.height, &unspent_count.height, height)? + != height + { + return Ok(false); + } + } + for ((state, supply), unspent_count) in self + .entry + .iter_mut() + .zip(metrics.supply.total.cohorts.entry.iter()) + .zip(metrics.outputs.unspent_count.cohorts.entry.iter()) + { + if Self::import_one(state, &supply.sats.height, &unspent_count.height, height)? + != height + { + return Ok(false); + } + } + for ((state, supply), unspent_count) in self + .amount_range + .iter_mut() + .zip(metrics.supply.total.cohorts.utxo_amount.range.iter()) + .zip( + metrics + .outputs + .unspent_count + .cohorts + .utxo_amount + .range + .iter(), + ) + { + if Self::import_one(state, &supply.sats.height, &unspent_count.height, height)? + != height + { + return Ok(false); + } + } + for ((state, supply), unspent_count) in self + .type_ + .iter_mut() + .zip(metrics.supply.total.cohorts.type_.iter()) + .zip(metrics.outputs.unspent_count.cohorts.type_.iter()) + { + if Self::import_one(state, &supply.sats.height, &unspent_count.height, height)? + != height + { + return Ok(false); + } + } + Ok(true) + } + + fn import_one( + state: &mut UTXOCohortState, + total_supply: &impl ReadableVec, + unspent_count: &impl ReadableVec, + height: Height, + ) -> Result + where + R: RealizedOps, + C: CostBasisOps, + { + let Some(mut previous_height) = height.decremented() else { + return Ok(Height::ZERO); + }; + + previous_height = state.import_at_or_before(previous_height)?; + state.supply.value = total_supply.collect_one(previous_height).unwrap(); + state.supply.utxo_count = *unspent_count.collect_one(previous_height).unwrap(); + state.restore_realized_cap(); + Ok(previous_height.incremented()) + } + + pub(crate) fn apply_pending(&mut self) { + self.age_range + .iter_mut() + .for_each(|state| state.apply_pending()); + self.epoch + .iter_mut() + .for_each(|state| state.apply_pending()); + self.class + .iter_mut() + .for_each(|state| state.apply_pending()); + self.entry + .iter_mut() + .for_each(|state| state.apply_pending()); + self.type_ + .iter_mut() + .for_each(|state| state.apply_pending()); + } + + pub(crate) fn reset_block(&mut self) { + self.age_range + .iter_mut() + .for_each(|state| state.reset_single_iteration_values()); + self.epoch + .iter_mut() + .for_each(|state| state.reset_single_iteration_values()); + self.class + .iter_mut() + .for_each(|state| state.reset_single_iteration_values()); + self.entry + .iter_mut() + .for_each(|state| state.reset_single_iteration_values()); + self.amount_range + .iter_mut() + .for_each(|state| state.reset_single_iteration_values()); + self.type_ + .iter_mut() + .for_each(|state| state.reset_single_iteration_values()); + } + + pub(crate) fn write(&mut self, height: Height, cleanup: bool) -> Result<()> { + self.age_range + .par_iter_mut() + .try_for_each(|state| state.write(height, cleanup))?; + self.epoch + .par_iter_mut() + .try_for_each(|state| state.write(height, cleanup))?; + self.class + .par_iter_mut() + .try_for_each(|state| state.write(height, cleanup))?; + self.entry + .par_iter_mut() + .try_for_each(|state| state.write(height, cleanup))?; + self.amount_range + .par_iter_mut() + .try_for_each(|state| state.write(height, cleanup))?; + self.type_ + .par_iter_mut() + .try_for_each(|state| state.write(height, cleanup))?; + Ok(()) + } + + pub(crate) fn init_fenwick_if_needed(&mut self, sth_filter: &Filter) { + if self.transient.fenwick.is_initialized() { + return; + } + + self.transient.fenwick.compute_is_sth(sth_filter); + let maps: Vec<_> = AgeRangeId::ALL + .iter() + .filter_map(|&id| { + let map = id.select(&self.age_range).cost_basis_map(); + (!map.is_empty()).then(|| (map, sth_filter.includes(id.filter()))) + }) + .collect(); + self.transient.fenwick.bulk_init(maps.into_iter()); + } + + pub(crate) fn update_fenwick_from_pending(&mut self) { + if !self.transient.fenwick.is_initialized() { + return; + } + + let Self { + age_range, + transient, + .. + } = self; + for &id in AgeRangeId::ALL { + let is_sth = transient.fenwick.is_sth(id); + id.select(age_range) + .for_each_cost_basis_pending(|&price, delta| { + transient.fenwick.apply_delta(price, delta, is_sth); + }); + } + } + + pub(crate) fn fenwick(&self) -> &CostBasisFenwick { + &self.transient.fenwick + } +} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/fenwick.rs b/crates/brk_computer/src/distribution/state/utxo/fenwick.rs similarity index 84% rename from crates/brk_computer/src/distribution/cohorts/utxo/fenwick.rs rename to crates/brk_computer/src/distribution/state/utxo/fenwick.rs index 7fec88b0f..dab95ffc4 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/fenwick.rs +++ b/crates/brk_computer/src/distribution/state/utxo/fenwick.rs @@ -1,8 +1,8 @@ use std::collections::BTreeMap; use brk_cohort::{ - AGE_RANGE_COUNT, AgeRangeId, Filter, PROFITABILITY_RANGE_COUNT, - compute_profitability_boundaries, + AGE_RANGE_COUNT, AgeRangeId, Filter, PROFITABILITY_RANGE_COUNT, ProfitabilityRange, + ProfitabilityRangeId, compute_profitability_boundaries, }; use brk_types::{Cents, CentsCompact, PartsPerMillion32, Sats}; use vecdb::ColumnId; @@ -15,7 +15,7 @@ use crate::{ }, }; -use super::COST_BASIS_PRICE_DIGITS; +use super::{COST_BASIS_PRICE_DIGITS, PercentileResult, ProfitabilityRangeResult}; // Tier boundaries for 5-significant-digit dollar bucketing. // Matches the rounding used by `Cents::round_to_dollar(5)`. @@ -61,7 +61,7 @@ impl FenwickNode for CostBasisNode { /// Combined Fenwick tree for per-block accurate percentile and profitability queries. #[derive(Clone)] -pub(super) struct CostBasisFenwick { +pub(crate) struct CostBasisFenwick { tree: FenwickTree, /// Running totals (sum of all underlying frequencies). totals: CostBasisNode, @@ -122,7 +122,7 @@ impl Default for CostBasisFenwick { } impl CostBasisFenwick { - pub(super) fn is_initialized(&self) -> bool { + pub(crate) fn is_initialized(&self) -> bool { self.initialized } @@ -183,7 +183,7 @@ impl CostBasisFenwick { // ----------------------------------------------------------------------- /// Compute sat-weighted and usd-weighted percentile prices for ALL cohort. - pub(super) fn percentiles_all(&self) -> PercentileResult { + pub(crate) fn percentiles_all(&self) -> PercentileResult { self.compute_percentiles( self.totals.all_sats, self.totals.all_usd, @@ -193,7 +193,7 @@ impl CostBasisFenwick { } /// Compute percentile prices for STH cohort. - pub(super) fn percentiles_sth(&self) -> PercentileResult { + pub(crate) fn percentiles_sth(&self) -> PercentileResult { self.compute_percentiles( self.totals.sth_sats, self.totals.sth_usd, @@ -203,7 +203,7 @@ impl CostBasisFenwick { } /// Compute percentile prices for LTH cohort (all - sth per node). - pub(super) fn percentiles_lth(&self) -> PercentileResult { + pub(crate) fn percentiles_lth(&self) -> PercentileResult { self.compute_percentiles( self.totals.all_sats - self.totals.sth_sats, self.totals.all_usd - self.totals.sth_usd, @@ -265,7 +265,7 @@ impl CostBasisFenwick { // ----------------------------------------------------------------------- /// Compute supply density: % of supply with cost basis within ±5% of spot. - pub(super) fn density( + pub(crate) fn density( &self, spot_price: Cents, ) -> (PartsPerMillion32, PartsPerMillion32, PartsPerMillion32) { @@ -327,12 +327,12 @@ impl CostBasisFenwick { // ----------------------------------------------------------------------- /// Compute profitability range buckets from current spot price. - /// Returns 25 ranges with all/sth splits. - pub(super) fn profitability( + /// Returns exact STH/LTH values for every profitability range. + pub(crate) fn profitability( &self, spot_price: Cents, - ) -> [ProfitabilityRangeResult; PROFITABILITY_RANGE_COUNT] { - let mut result = [ProfitabilityRangeResult::ZERO; PROFITABILITY_RANGE_COUNT]; + ) -> ProfitabilityRange { + let mut result = ProfitabilityRange::default(); if self.totals.all_sats <= 0 { return result; @@ -349,50 +349,25 @@ impl CostBasisFenwick { } else { CostBasisNode::default() }; - result[i] = ProfitabilityRangeResult { - all_sats: (cum.all_sats - prev.all_sats).max(0) as u64, - all_usd: (cum.all_usd - prev.all_usd).max(0) as u128, - sth_sats: (cum.sth_sats - prev.sth_sats).max(0) as u64, - sth_usd: (cum.sth_usd - prev.sth_usd).max(0) as u128, - }; + *ProfitabilityRangeId::ALL[i].get_mut(&mut result) = + ProfitabilityRangeResult::from_all_and_sth( + (cum.all_sats - prev.all_sats).max(0) as u64, + (cum.all_usd - prev.all_usd).max(0) as u128, + (cum.sth_sats - prev.sth_sats).max(0) as u64, + (cum.sth_usd - prev.sth_usd).max(0) as u128, + ); prev = cum; } // Last range: everything >= last boundary - result[PROFITABILITY_RANGE_COUNT - 1] = ProfitabilityRangeResult { - all_sats: (self.totals.all_sats - prev.all_sats).max(0) as u64, - all_usd: (self.totals.all_usd - prev.all_usd).max(0) as u128, - sth_sats: (self.totals.sth_sats - prev.sth_sats).max(0) as u64, - sth_usd: (self.totals.sth_usd - prev.sth_usd).max(0) as u128, - }; + *ProfitabilityRangeId::ALL[PROFITABILITY_RANGE_COUNT - 1].get_mut(&mut result) = + ProfitabilityRangeResult::from_all_and_sth( + (self.totals.all_sats - prev.all_sats).max(0) as u64, + (self.totals.all_usd - prev.all_usd).max(0) as u128, + (self.totals.sth_sats - prev.sth_sats).max(0) as u64, + (self.totals.sth_usd - prev.sth_usd).max(0) as u128, + ); result } } - -/// Per-range profitability result with all/sth split. -#[derive(Clone, Copy)] -pub(super) struct ProfitabilityRangeResult { - pub all_sats: u64, - pub all_usd: u128, - pub sth_sats: u64, - pub sth_usd: u128, -} - -impl ProfitabilityRangeResult { - const ZERO: Self = Self { - all_sats: 0, - all_usd: 0, - sth_sats: 0, - sth_usd: 0, - }; -} - -/// Result of a percentile computation for one cohort. -#[derive(Default)] -pub(super) struct PercentileResult { - pub sat_prices: [Cents; PERCENTILES_LEN], - pub usd_prices: [Cents; PERCENTILES_LEN], - pub min_price: Cents, - pub max_price: Cents, -} diff --git a/crates/brk_computer/src/distribution/state/utxo/mod.rs b/crates/brk_computer/src/distribution/state/utxo/mod.rs new file mode 100644 index 000000000..093033c02 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/utxo/mod.rs @@ -0,0 +1,22 @@ +mod cohort; +mod collection; +mod fenwick; +mod percentile_result; +mod profitability_range_result; +mod receive; +mod send; +mod send_precomputed; +mod tick_tock; +mod transient; +mod urpd; + +/// Rounding precision for UTXO cost basis prices (5 significant digits in dollars). +pub(crate) const COST_BASIS_PRICE_DIGITS: i32 = 5; + +pub use cohort::*; +pub use collection::*; +pub(crate) use fenwick::CostBasisFenwick; +pub(crate) use percentile_result::PercentileResult; +pub(crate) use profitability_range_result::ProfitabilityRangeResult; +pub(crate) use send_precomputed::SendPrecomputed; +pub(super) use transient::UTXOTransientState; diff --git a/crates/brk_computer/src/distribution/state/utxo/percentile_result.rs b/crates/brk_computer/src/distribution/state/utxo/percentile_result.rs new file mode 100644 index 000000000..d25d96e31 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/utxo/percentile_result.rs @@ -0,0 +1,11 @@ +use brk_types::Cents; + +use crate::internal::PERCENTILES_LEN; + +#[derive(Default)] +pub(crate) struct PercentileResult { + pub sat_prices: [Cents; PERCENTILES_LEN], + pub usd_prices: [Cents; PERCENTILES_LEN], + pub min_price: Cents, + pub max_price: Cents, +} diff --git a/crates/brk_computer/src/distribution/state/utxo/profitability_range_result.rs b/crates/brk_computer/src/distribution/state/utxo/profitability_range_result.rs new file mode 100644 index 000000000..60fd1473d --- /dev/null +++ b/crates/brk_computer/src/distribution/state/utxo/profitability_range_result.rs @@ -0,0 +1,35 @@ +use brk_cohort::ByTerm; +use brk_types::{Dollars, Sats}; + +#[derive(Debug, Clone, Copy, Default)] +pub(crate) struct ProfitabilityRangeResult { + pub supply: ByTerm, + pub realized_cap: ByTerm, +} + +impl ProfitabilityRangeResult { + pub(super) fn from_all_and_sth( + all_sats: u64, + all_usd: u128, + sth_sats: u64, + sth_usd: u128, + ) -> Self { + let all_realized_cap = Self::dollars(all_usd); + let short_realized_cap = Self::dollars(sth_usd); + Self { + supply: ByTerm { + short: Sats::from(sth_sats), + long: Sats::from(all_sats.saturating_sub(sth_sats)), + }, + realized_cap: ByTerm { + short: short_realized_cap, + long: all_realized_cap - short_realized_cap, + }, + } + } + + #[inline(always)] + fn dollars(raw: u128) -> Dollars { + Dollars::from(raw as f64 / 1e10) + } +} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/receive.rs b/crates/brk_computer/src/distribution/state/utxo/receive.rs similarity index 68% rename from crates/brk_computer/src/distribution/cohorts/utxo/receive.rs rename to crates/brk_computer/src/distribution/state/utxo/receive.rs index ba82f7492..3408bbed0 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/receive.rs +++ b/crates/brk_computer/src/distribution/state/utxo/receive.rs @@ -1,12 +1,11 @@ use brk_cohort::EntryPrice; use brk_types::{Cents, CostBasisSnapshot, Height, Timestamp}; -use vecdb::Rw; use crate::distribution::state::Transacted; -use super::groups::UTXOCohorts; +use super::UTXOStates; -impl UTXOCohorts { +impl UTXOStates { /// Process received outputs for this block. /// /// New UTXOs are added to: @@ -32,39 +31,26 @@ impl UTXOCohorts { // New UTXOs go into under_1h plus immutable creation cohorts self.age_range .under_1h - .state - .as_mut() - .unwrap() .receive_utxo_snapshot(&supply_state, &snapshot); if let Some(v) = self.epoch.mut_vec_from_height(height) { - v.state - .as_mut() - .unwrap() - .receive_utxo_snapshot(&supply_state, &snapshot); + v.receive_utxo_snapshot(&supply_state, &snapshot); } if let Some(v) = self.class.mut_vec_from_timestamp(timestamp) { - v.state - .as_mut() - .unwrap() - .receive_utxo_snapshot(&supply_state, &snapshot); + v.receive_utxo_snapshot(&supply_state, &snapshot); } self.entry .get_mut(entry) - .state - .as_mut() - .unwrap() .receive_utxo_snapshot(&supply_state, &snapshot); // Update output type cohorts (skip types with no outputs this block) - self.type_.iter_typed_mut().for_each(|(output_type, vecs)| { - let supply_state = received.by_type.get(output_type); - if supply_state.utxo_count > 0 { - vecs.state - .as_mut() - .unwrap() - .receive_utxo(supply_state, price) - } - }); + self.type_ + .iter_typed_mut() + .for_each(|(output_type, state)| { + let supply_state = received.by_type.get(output_type); + if supply_state.utxo_count > 0 { + state.receive_utxo(supply_state, price) + } + }); // Update amount range cohorts (skip empty ranges) received @@ -74,9 +60,6 @@ impl UTXOCohorts { .for_each(|(group, supply_state)| { self.amount_range .get_mut(group) - .state - .as_mut() - .unwrap() .receive_utxo(supply_state, price); }); } diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/send.rs b/crates/brk_computer/src/distribution/state/utxo/send.rs similarity index 69% rename from crates/brk_computer/src/distribution/cohorts/utxo/send.rs rename to crates/brk_computer/src/distribution/state/utxo/send.rs index 8ed31e8e5..7a6531e15 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/send.rs +++ b/crates/brk_computer/src/distribution/state/utxo/send.rs @@ -1,15 +1,15 @@ use brk_types::{Age, Height}; use rustc_hash::FxHashMap; -use vecdb::{Rw, VecIndex}; +use vecdb::VecIndex; use crate::distribution::{ compute::PriceRangeMax, state::{BlockState, SendPrecomputed, Transacted}, }; -use super::groups::UTXOCohorts; +use super::UTXOStates; -impl UTXOCohorts { +impl UTXOStates { /// Process spent inputs for this block. /// /// Each input references a UTXO created at some previous height. @@ -59,44 +59,26 @@ impl UTXOCohorts { ) { self.age_range .get_mut(age) - .state - .as_mut() - .unwrap() .send_utxo_precomputed(&sent.spendable_supply, &pre); if let Some(v) = self.epoch.mut_vec_from_height(receive_height) { - v.state - .as_mut() - .unwrap() - .send_utxo_precomputed(&sent.spendable_supply, &pre); + v.send_utxo_precomputed(&sent.spendable_supply, &pre); } if let Some(v) = self.class.mut_vec_from_timestamp(block_state.timestamp) { - v.state - .as_mut() - .unwrap() - .send_utxo_precomputed(&sent.spendable_supply, &pre); + v.send_utxo_precomputed(&sent.spendable_supply, &pre); } self.entry .get_mut(block_state.entry) - .state - .as_mut() - .unwrap() .send_utxo_precomputed(&sent.spendable_supply, &pre); } else if sent.spendable_supply.utxo_count > 0 { // Zero-value UTXOs: just subtract supply - self.age_range.get_mut(age).state.as_mut().unwrap().supply -= - &sent.spendable_supply; + self.age_range.get_mut(age).supply -= &sent.spendable_supply; if let Some(v) = self.epoch.mut_vec_from_height(receive_height) { - v.state.as_mut().unwrap().supply -= &sent.spendable_supply; + v.supply -= &sent.spendable_supply; } if let Some(v) = self.class.mut_vec_from_timestamp(block_state.timestamp) { - v.state.as_mut().unwrap().supply -= &sent.spendable_supply; + v.supply -= &sent.spendable_supply; } - self.entry - .get_mut(block_state.entry) - .state - .as_mut() - .unwrap() - .supply -= &sent.spendable_supply; + self.entry.get_mut(block_state.entry).supply -= &sent.spendable_supply; } // Update output type cohorts (skip zero-supply entries) @@ -105,12 +87,13 @@ impl UTXOCohorts { .iter_typed() .filter(|(_, supply_state)| supply_state.utxo_count > 0) .for_each(|(output_type, supply_state)| { - self.type_ - .get_mut(output_type) - .state - .as_mut() - .unwrap() - .send_utxo(supply_state, current_price, prev_price, peak_price, age) + self.type_.get_mut(output_type).send_utxo( + supply_state, + current_price, + prev_price, + peak_price, + age, + ) }); // Update amount range cohorts (skip zero-supply entries) @@ -118,12 +101,13 @@ impl UTXOCohorts { .iter_typed() .filter(|(_, supply_state)| supply_state.utxo_count > 0) .for_each(|(group, supply_state)| { - self.amount_range - .get_mut(group) - .state - .as_mut() - .unwrap() - .send_utxo(supply_state, current_price, prev_price, peak_price, age); + self.amount_range.get_mut(group).send_utxo( + supply_state, + current_price, + prev_price, + peak_price, + age, + ); }); } diff --git a/crates/brk_computer/src/distribution/state/utxo/send_precomputed.rs b/crates/brk_computer/src/distribution/state/utxo/send_precomputed.rs new file mode 100644 index 000000000..a909c0c9a --- /dev/null +++ b/crates/brk_computer/src/distribution/state/utxo/send_precomputed.rs @@ -0,0 +1,44 @@ +use brk_types::{Age, Cents, CentsSats, CentsSquaredSats, Sats, SupplyState}; + +pub(crate) struct SendPrecomputed { + pub sats: Sats, + pub prev_price: Cents, + pub age: Age, + pub current_ps: CentsSats, + pub prev_ps: CentsSats, + pub ath_ps: CentsSats, + pub prev_capitalized_cap: CentsSquaredSats, +} + +impl SendPrecomputed { + pub(crate) fn new( + supply: &SupplyState, + current_price: Cents, + prev_price: Cents, + ath: Cents, + age: Age, + ) -> Option { + if supply.utxo_count == 0 || supply.value == Sats::ZERO { + return None; + } + + let sats = supply.value; + let current_ps = CentsSats::from_price_sats(current_price, sats); + let prev_ps = CentsSats::from_price_sats(prev_price, sats); + let ath_ps = if ath == current_price { + current_ps + } else { + CentsSats::from_price_sats(ath, sats) + }; + + Some(Self { + sats, + prev_price, + age, + current_ps, + prev_ps, + ath_ps, + prev_capitalized_cap: prev_ps.to_capitalized_cap(prev_price), + }) + } +} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/tick_tock.rs b/crates/brk_computer/src/distribution/state/utxo/tick_tock.rs similarity index 88% rename from crates/brk_computer/src/distribution/cohorts/utxo/tick_tock.rs rename to crates/brk_computer/src/distribution/state/utxo/tick_tock.rs index 7804fc20e..38814aab5 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/tick_tock.rs +++ b/crates/brk_computer/src/distribution/state/utxo/tick_tock.rs @@ -1,12 +1,12 @@ use brk_cohort::{AGE_BOUNDARIES, AGE_RANGE_IDS, AgeRange}; use brk_types::{CostBasisSnapshot, ONE_HOUR_IN_SEC, Sats, Timestamp}; -use vecdb::{Rw, unlikely}; +use vecdb::unlikely; use crate::distribution::state::BlockState; -use super::groups::UTXOCohorts; +use super::UTXOStates; -impl UTXOCohorts { +impl UTXOStates { /// Handle age transitions when processing a new block. /// /// UTXOs age with each block. When they cross hour boundaries, @@ -37,9 +37,11 @@ impl UTXOCohorts { let mut matured = AgeRange::default(); let Self { - age_range, caches, .. + age_range, + transient, + .. } = self; - let cached = &mut caches.tick_tock_cached_positions; + let cached = &mut transient.tick_tock_cached_positions; // For each boundary (in hours), find blocks that just crossed it for (boundary_idx, (&boundary_hours, adjacent)) in AGE_BOUNDARIES @@ -87,12 +89,8 @@ impl UTXOCohorts { let matured_sats = younger.select_mut(&mut matured); for block_state in &chain_state[start_idx..end_idx] { let snapshot = CostBasisSnapshot::from_utxo(block_state.price, &block_state.supply); - if let Some(state) = younger.select_mut(age_range).state.as_mut() { - state.decrement_snapshot(&snapshot); - } - if let Some(state) = older.select_mut(age_range).state.as_mut() { - state.increment_snapshot(&snapshot); - } + younger.select_mut(age_range).decrement_snapshot(&snapshot); + older.select_mut(age_range).increment_snapshot(&snapshot); *matured_sats += block_state.supply.value; } } diff --git a/crates/brk_computer/src/distribution/state/utxo/transient.rs b/crates/brk_computer/src/distribution/state/utxo/transient.rs new file mode 100644 index 000000000..5172227b6 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/utxo/transient.rs @@ -0,0 +1,11 @@ +use brk_cohort::AGE_RANGE_COUNT; + +use super::fenwick::CostBasisFenwick; + +/// In-memory state that does not survive rollback. +#[derive(Clone, Default)] +pub(crate) struct UTXOTransientState { + pub(super) fenwick: CostBasisFenwick, + /// Cached positions for tick-tock boundary searches. + pub(super) tick_tock_cached_positions: [usize; AGE_RANGE_COUNT - 1], +} diff --git a/crates/brk_computer/src/distribution/state/utxo/urpd.rs b/crates/brk_computer/src/distribution/state/utxo/urpd.rs new file mode 100644 index 000000000..5ab2bbf57 --- /dev/null +++ b/crates/brk_computer/src/distribution/state/utxo/urpd.rs @@ -0,0 +1,169 @@ +use std::{ + cmp::Reverse, + collections::{BTreeMap, BinaryHeap}, + path::Path, +}; + +use brk_cohort::{AgeRangeId, CohortContext, Filter, TERM_NAMES, UTXO_ALL_NAME, UTXOAggregate}; +use brk_error::Result; +use brk_types::{CentsCompact, Date, Sats, UrpdRaw}; +use rayon::prelude::*; +use vecdb::ColumnId; + +use super::{COST_BASIS_PRICE_DIGITS, UTXOStates}; + +impl UTXOStates { + pub(crate) fn write_urpds( + &self, + date: Date, + states_path: &Path, + sth_filter: &Filter, + ) -> Result<()> { + AgeRangeId::ALL + .iter() + .map(|&id| (id, id.select(&self.age_range))) + .collect::>() + .into_par_iter() + .try_for_each(|(id, state)| -> Result<()> { + let mut merged = Vec::<(CentsCompact, Sats)>::new(); + for (&price, &sats) in state.cost_basis_map() { + let rounded = rounded_price(price); + if let Some(last) = merged.last_mut() + && last.0 == rounded + { + last.1 += sats; + } else { + merged.push((rounded, sats)); + } + } + let name = CohortContext::Utxo.prefixed(id.name().id); + UrpdRaw::write(states_path, &name, date, merged.into_iter()) + })?; + + let maps: Vec<_> = AgeRangeId::ALL + .iter() + .filter_map(|&id| { + let map = id.select(&self.age_range).cost_basis_map(); + (!map.is_empty()).then(|| (map, sth_filter.includes(id.filter()))) + }) + .collect(); + if maps.is_empty() { + return Ok(()); + } + + let capacity = maps.iter().map(|(map, _)| map.len()).max().unwrap_or(0); + let mut targets = UTXOAggregate { + all: MergeTarget::new(capacity), + sth: MergeTarget::new(capacity), + lth: MergeTarget::new(capacity), + }; + merge_k_way(&maps, &mut targets); + + [ + (UTXO_ALL_NAME.id, targets.all.merged), + (TERM_NAMES.short.id, targets.sth.merged), + (TERM_NAMES.long.id, targets.lth.merged), + ] + .into_par_iter() + .try_for_each(|(name, merged)| UrpdRaw::write(states_path, name, date, merged.into_iter())) + } + + pub(crate) fn age_range_urpd_entries( + &self, + ) -> impl Iterator + '_ { + AgeRangeId::ALL.iter().copied().flat_map(move |id| { + id.select(&self.age_range) + .cost_basis_map() + .iter() + .map(move |(&price, &sats)| (id, rounded_price(price), sats)) + }) + } +} + +#[inline] +fn rounded_price(price: CentsCompact) -> CentsCompact { + price.round_to_dollar(COST_BASIS_PRICE_DIGITS) +} + +struct MergeTarget { + price_sats: u64, + merged: Vec<(CentsCompact, Sats)>, +} + +impl MergeTarget { + fn new(capacity: usize) -> Self { + Self { + price_sats: 0, + merged: Vec::with_capacity(capacity), + } + } + + #[inline] + fn accumulate(&mut self, amount: u64) { + self.price_sats += amount; + } + + fn finalize_price(&mut self, price: CentsCompact) { + if self.price_sats > 0 { + let rounded = rounded_price(price); + if let Some((last_price, last_sats)) = self.merged.last_mut() + && *last_price == rounded + { + *last_sats += Sats::from(self.price_sats); + } else { + self.merged.push((rounded, Sats::from(self.price_sats))); + } + } + self.price_sats = 0; + } +} + +fn merge_k_way( + maps: &[(&BTreeMap, bool)], + targets: &mut UTXOAggregate, +) { + let mut iterators: Vec<_> = maps + .iter() + .map(|(map, is_sth)| (map.iter().peekable(), *is_sth)) + .collect(); + let mut heap = BinaryHeap::>::with_capacity(iterators.len()); + + for (index, (iterator, _)) in iterators.iter_mut().enumerate() { + if let Some(&(&price, _)) = iterator.peek() { + heap.push(Reverse((price, index))); + } + } + + let mut current_price = None; + while let Some(Reverse((price, index))) = heap.pop() { + let (iterator, is_sth) = &mut iterators[index]; + let (_, &sats) = iterator.next().unwrap(); + + if let Some(previous) = current_price + && previous != price + { + targets + .iter_mut() + .for_each(|target| target.finalize_price(previous)); + } + + current_price = Some(price); + let amount = u64::from(sats); + targets.all.accumulate(amount); + if *is_sth { + targets.sth.accumulate(amount); + } else { + targets.lth.accumulate(amount); + } + + if let Some(&(&next_price, _)) = iterator.peek() { + heap.push(Reverse((next_price, index))); + } + } + + if let Some(price) = current_price { + targets + .iter_mut() + .for_each(|target| target.finalize_price(price)); + } +} diff --git a/crates/brk_computer/src/distribution/vecs.rs b/crates/brk_computer/src/distribution/vecs.rs index abc7fff71..574347514 100644 --- a/crates/brk_computer/src/distribution/vecs.rs +++ b/crates/brk_computer/src/distribution/vecs.rs @@ -1,26 +1,22 @@ -use std::path::{Path, PathBuf}; +use std::{ + mem, + path::{Path, PathBuf}, +}; use brk_cohort::{AddrTypeId, EntryPrice}; use brk_error::Result; use brk_indexer::Indexer; use brk_traversable::Traversable; -use brk_types::{ - Cents, EmptyAddrData, EmptyAddrIndex, FundedAddrData, FundedAddrIndex, Height, StoredF64, - SupplyState, Timestamp, TxIndex, Version, -}; -use rayon::prelude::*; +use brk_types::{Cents, Height, StoredF64, SupplyState, Timestamp, TxIndex, Version}; use tracing::{debug, info}; use vecdb::{ - AnyStoredVec, AnyVec, BytesVec, Database, Exit, ImportOptions, ImportableVec, LazyVec, - ReadableCloneableVec, ReadableVec, Rw, Stamp, StorageMode, WritableVec, + AnyVec, BytesVec, Database, Exit, ImportOptions, ImportableVec, LazyVec, ReadableCloneableVec, + ReadableVec, Rw, Stamp, StorageMode, WritableVec, }; use crate::{ distribution::{ - compute::{ - PriceRangeMax, StartMode, determine_start_mode, process_blocks, recover_state, - reset_state, - }, + compute::{PriceRangeMax, StartMode, determine_start_mode, process_blocks, reset_state}, state::BlockState, }, indexes, inputs, @@ -32,101 +28,16 @@ use crate::{ }; use super::{ - AddrCohorts, AddrsDataVecs, AnyAddrIndexesVecs, RangeMap, UTXOCohorts, + AddrStates, AddrsDataVecs, AllChainCache, AnyAddrIndexesVecs, CohortMetrics, DB_NAME, RangeMap, + UTXOStates, addr::{ - AddrActivityVecs, AddrCountsVecs, AddrMetricsState, DeltaVecs, ExposedAddrVecs, - NewAddrCountVecs, ReusedAddrVecs, TotalAddrCountVecs, + AddrActivityVecs, AddrCountsVecs, AddrVecs, AvgAmountVecs, DeltaVecs, ExposedAddrVecs, + FundedAddrCountsVecs, NewAddrCountVecs, ReusedAddrVecs, TotalAddrCountVecs, }, - metrics::AvgAmountVecs, }; const VERSION: Version = Version::new(30 + brk_oracle::VERSION); -#[derive(Traversable)] -pub struct AddrMetricsVecs { - pub funded: AddrCountsVecs, - pub empty: AddrCountsVecs, - pub activity: AddrActivityVecs, - pub total: TotalAddrCountVecs, - pub new: NewAddrCountVecs, - pub reused: ReusedAddrVecs, - pub respent: ReusedAddrVecs, - pub exposed: ExposedAddrVecs, - pub delta: DeltaVecs, - pub avg_amount: AvgAmountVecs, - #[traversable(wrap = "indexes", rename = "funded")] - pub funded_index: LazyVec, - #[traversable(wrap = "indexes", rename = "empty")] - pub empty_index: LazyVec, -} - -impl AddrMetricsVecs { - pub(crate) fn reset_height(&mut self) -> Result<()> { - self.funded.reset_height()?; - self.empty.reset_height()?; - self.activity.reset_height()?; - self.total.reset_height()?; - self.reused.reset_height()?; - self.respent.reset_height()?; - self.exposed.reset_height()?; - self.avg_amount.reset_height()?; - Ok(()) - } - - pub(crate) fn min_stateful_len(&self) -> usize { - self.funded - .min_stateful_len() - .min(self.empty.min_stateful_len()) - .min(self.activity.min_stateful_len()) - .min(self.reused.min_stateful_len()) - .min(self.respent.min_stateful_len()) - .min(self.exposed.min_stateful_len()) - } - - /// Stateful vecs pushed per block. Mirrors [`Self::push_height`] and - /// [`Self::min_stateful_len`]. Used by the stamped write path. - pub(crate) fn par_iter_stateful_height_mut( - &mut self, - ) -> impl ParallelIterator { - self.funded - .par_iter_height_mut() - .chain(self.empty.par_iter_height_mut()) - .chain(self.activity.par_iter_height_mut()) - .chain(self.reused.par_iter_stateful_height_mut()) - .chain(self.respent.par_iter_stateful_height_mut()) - .chain(self.exposed.par_iter_stateful_height_mut()) - } - - /// All height-indexed vecs including derived (`avg_amount`). Used for - /// bulk truncation, where derived vecs must follow the stateful ones. - pub(crate) fn par_iter_height_mut( - &mut self, - ) -> impl ParallelIterator { - self.funded - .par_iter_height_mut() - .chain(self.empty.par_iter_height_mut()) - .chain(self.activity.par_iter_height_mut()) - .chain(self.total.par_iter_height_mut()) - .chain(self.reused.par_iter_height_mut()) - .chain(self.respent.par_iter_height_mut()) - .chain(self.exposed.par_iter_height_mut()) - .chain(self.avg_amount.par_iter_height_mut()) - } - - /// Push one block's worth of per-addr-type running totals to all - /// height-indexed vecs. `active_addr_count` is the block-level total - /// of active addresses (sending + receiving - bidirectional). - #[inline(always)] - pub(crate) fn push_height(&mut self, state: &AddrMetricsState, active_addr_count: u32) { - self.funded.push_counts(&state.funded); - self.empty.push_counts(&state.empty); - self.activity.push_height(&state.activity); - self.exposed.push_height(&state.exposed); - self.reused.push_height(&state.reused, active_addr_count); - self.respent.push_height(&state.respent, active_addr_count); - } -} - #[derive(Traversable)] pub struct Vecs { #[traversable(skip)] @@ -140,13 +51,11 @@ pub struct Vecs { pub any_addr_indexes: AnyAddrIndexesVecs, #[traversable(wrap = "addrs", rename = "data")] pub addrs_data: AddrsDataVecs, - #[traversable(wrap = "cohorts", rename = "utxo")] - pub utxo_cohorts: UTXOCohorts, - #[traversable(wrap = "cohorts", rename = "addr")] - pub addr_cohorts: AddrCohorts, + #[traversable(wrap = "cohorts")] + pub cohorts: CohortMetrics, #[traversable(wrap = "cointime/activity")] pub coinblocks_destroyed: PerBlockCumulativeRolling, - pub addrs: AddrMetricsVecs, + pub addrs: AddrVecs, /// In-memory state that does NOT survive rollback. /// Grouped so that adding a new field automatically gets it reset. @@ -175,9 +84,9 @@ const SAVED_STAMPED_CHANGES: u16 = 10; const FUNDED_ADDR_DATA_VERSION: Version = Version::ONE; impl Vecs { - pub(crate) fn all_chain_cache(&self, prices: &price::Vecs) -> super::AllChainCache { - super::AllChainCache::new( - self.utxo_cohorts.all_supply_cache(), + pub(crate) fn all_chain_cache(&self, prices: &price::Vecs) -> AllChainCache { + AllChainCache::new( + self.cohorts.all_supply_cache(), &prices.spot.cents.height.read_only_cached_boxed_clone(), ) } @@ -191,33 +100,17 @@ impl Vecs { inputs_by_type: &inputs::ByTypeVecs, outputs_by_type: &outputs::ByTypeVecs, ) -> Result { - let db_path = parent.join(super::DB_NAME); + let db_path = parent.join(DB_NAME); let states_path = db_path.join("states"); - let db = open_db(parent, super::DB_NAME, 20_000_000)?; + let db = open_db(parent, DB_NAME, 20_000_000)?; db.set_min_regions(50_000)?; let version = parent_version + VERSION; let spot_price = prices.spot.cents.height.read_only_cached_boxed_clone(); - let utxo_cohorts = UTXOCohorts::forced_import( - &db, - version, - indexes, - &states_path, - cached_starts, - &spot_price, - )?; - - let addr_cohorts = AddrCohorts::forced_import( - &db, - version, - indexes, - &states_path, - cached_starts, - &spot_price, - utxo_cohorts.all_supply_cache(), - )?; + let cohorts = + CohortMetrics::forced_import(&db, version, indexes, cached_starts, &spot_price)?; // Create address data BytesVecs first so we can also use them for identity mappings let funded_addr_data_version = version + FUNDED_ADDR_DATA_VERSION; @@ -244,7 +137,8 @@ impl Vecs { |index, _| index, ); - let addr_count = AddrCountsVecs::forced_import(&db, "addr_count", version, indexes)?; + let funded_addr_count = + FundedAddrCountsVecs::forced_import(&db, version, indexes, cached_starts)?; let empty_addr_count = AddrCountsVecs::forced_import(&db, "empty_addr_count", version, indexes)?; let addr_activity = AddrActivityVecs::forced_import(&db, version, indexes, cached_starts)?; @@ -269,7 +163,7 @@ impl Vecs { &spot_price, outputs_by_type, inputs_by_type, - utxo_cohorts.all_supply_cache(), + cohorts.all_supply_cache(), )?; let respent_addr_count = ReusedAddrVecs::forced_import( &db, @@ -280,7 +174,7 @@ impl Vecs { &spot_price, outputs_by_type, inputs_by_type, - utxo_cohorts.all_supply_cache(), + cohorts.all_supply_cache(), )?; // Exposed address tracking (counts + supply) - quantum / pubkey-exposure sense @@ -289,22 +183,22 @@ impl Vecs { version, indexes, &spot_price, - utxo_cohorts.all_supply_cache(), + cohorts.all_supply_cache(), )?; // Growth rate: delta change + rate (global + per-type) - let delta = DeltaVecs::new(version, &addr_count, cached_starts, indexes); + let delta = DeltaVecs::new(version, &funded_addr_count.counts, cached_starts, indexes); // Average amount (supply / utxo_count, supply / funded_addr_count) for `all` and per addr type. - let all_chain = super::AllChainCache::new(utxo_cohorts.all_supply_cache(), &spot_price); + let all_chain = AllChainCache::new(cohorts.all_supply_cache(), &spot_price); let avg_amount = AvgAmountVecs::forced_import( &db, version, indexes, &spot_price, &all_chain, - &utxo_cohorts.all.metrics.outputs.unspent_count.height, - &addr_count.all.height, + &cohorts.outputs.unspent_count.cohorts.all.height, + &funded_addr_count.counts.all.height, )?; let this = Self { @@ -313,8 +207,8 @@ impl Vecs { .with_saved_stamped_changes(SAVED_STAMPED_CHANGES), )?, - addrs: AddrMetricsVecs { - funded: addr_count, + addrs: AddrVecs { + funded: funded_addr_count, empty: empty_addr_count, activity: addr_activity, total: total_addr_count, @@ -328,8 +222,7 @@ impl Vecs { empty_index: empty_addr_index, }, - utxo_cohorts, - addr_cohorts, + cohorts, coinblocks_destroyed: PerBlockCumulativeRolling::forced_import( &db, @@ -356,7 +249,7 @@ impl Vecs { /// Reset in-memory caches that become stale after rollback. fn reset_in_memory_caches(&mut self) { - self.utxo_cohorts.reset_caches(); + self.cohorts.reset_caches(); self.caches = DistributionTransientState::default(); } @@ -378,8 +271,10 @@ impl Vecs { transactions: &transactions::Vecs, prices: &price::Vecs, exit: &Exit, - ) -> Result<()> { + ) -> Result { self.db.sync_bg_tasks()?; + let mut utxo_states = UTXOStates::new(&self.states_path); + let mut addr_states = AddrStates::new(&self.states_path); let base_version = VERSION + [ @@ -415,8 +310,7 @@ impl Vecs { debug!("validating computed versions"); self.supply_state .validate_computed_version_or_reset(base_version)?; - self.utxo_cohorts.validate_computed_versions(base_version)?; - self.addr_cohorts.validate_computed_versions(base_version)?; + self.cohorts.validate_computed_versions(base_version)?; debug!("computed versions validated"); let starting_lengths = indexer.safe_lengths(); @@ -446,13 +340,11 @@ impl Vecs { let chain_state_rollback = (height < current_height) .then(|| self.supply_state.rollback_before(Stamp::from(height))); - let recovered = recover_state( + let recovered = self.recover_state( height, chain_state_rollback, - &mut self.any_addr_indexes, - &mut self.addrs_data, - &mut self.utxo_cohorts, - &mut self.addr_cohorts, + &mut utxo_states, + &mut addr_states, )?; debug!( @@ -479,8 +371,8 @@ impl Vecs { reset_state( &mut self.any_addr_indexes, &mut self.addrs_data, - &mut self.utxo_cohorts, - &mut self.addr_cohorts, + &mut utxo_states, + &mut addr_states, )?; info!("State recovery: fresh start"); } @@ -515,8 +407,8 @@ impl Vecs { self.caches.price_range_max.extend(&self.caches.prices); // Take chain_state and tx_index_to_height out of self to avoid borrow conflicts - let mut chain_state = std::mem::take(&mut self.caches.chain_state); - let mut tx_index_to_height = std::mem::take(&mut self.caches.tx_index_to_height); + let mut chain_state = mem::take(&mut self.caches.chain_state); + let mut tx_index_to_height = mem::take(&mut self.caches.tx_index_to_height); // Recover or reuse chain_state let starting_height = if recovered_height.is_zero() { @@ -535,12 +427,11 @@ impl Vecs { debug!("building supply_state vec for {} heights", recovered_height); let supply_state_data: Vec<_> = self.supply_state.collect_range_at(0, end); let capitalized_price_data: Vec<_> = self - .utxo_cohorts - .all - .metrics + .cohorts .realized - .capitalized - .price + .capitalized_price + .series + .all .cents .height .collect_range_at(0, end); @@ -583,18 +474,17 @@ impl Vecs { if starting_height <= last_height { debug!("calling process_blocks"); - let prices = std::mem::take(&mut self.caches.prices); - let timestamps = std::mem::take(&mut self.caches.timestamps); - let price_range_max = std::mem::take(&mut self.caches.price_range_max); + let prices = mem::take(&mut self.caches.prices); + let timestamps = mem::take(&mut self.caches.timestamps); + let price_range_max = mem::take(&mut self.caches.price_range_max); let entry_anchor = starting_height .decremented() .and_then(|height| { - self.utxo_cohorts - .all - .metrics + self.cohorts .realized - .capitalized - .price + .capitalized_price + .series + .all .cents .height .collect_one(height) @@ -603,6 +493,8 @@ impl Vecs { process_blocks( self, + &mut utxo_states, + &mut addr_states, indexer, indexes, inputs, @@ -628,52 +520,17 @@ impl Vecs { self.caches.chain_state = chain_state; self.caches.tx_index_to_height = tx_index_to_height; - // 5. Compute aggregates (overlapping cohorts from separate cohorts) - info!("Computing overlapping cohorts..."); - { - let (r1, r2) = rayon::join( - || { - self.utxo_cohorts - .compute_overlapping_vecs(&starting_lengths, exit) - }, - || { - self.addr_cohorts - .compute_overlapping_vecs(&starting_lengths, exit) - }, - ); - r1?; - r2?; - } - - // 6. Compute rest part1 (day1 mappings) + // 5. Compute rest part1 (day1 mappings) info!("Computing rest part 1..."); - { - let (r1, r2) = rayon::join( - || { - self.utxo_cohorts - .compute_rest_part1(prices, &starting_lengths, exit) - }, - || { - self.addr_cohorts - .compute_rest_part1(prices, &starting_lengths, exit) - }, - ); - r1?; - r2?; - } + self.cohorts.compute_rest_part1(&starting_lengths, exit)?; // 6b. Compute address metrics derived from stored per-type sources. - let t = &self.utxo_cohorts.type_; - let type_supply_sats = AddrTypeId::series(|column, _| { - &t.get(column.output_type()).metrics.supply.total.sats.height - }); - let type_utxo_counts = AddrTypeId::series(|column, _| { - &t.get(column.output_type()) - .metrics - .outputs - .unspent_count - .height - }); + let type_supply = &self.cohorts.supply.total.cohorts.type_; + let type_outputs = &self.cohorts.outputs.unspent_count.cohorts.type_; + let type_supply_sats = + AddrTypeId::series(|column, _| &type_supply.get(column.output_type()).sats.height); + let type_utxo_counts = + AddrTypeId::series(|column, _| &type_outputs.get(column.output_type()).height); self.addrs .reused .compute_rest(&starting_lengths, &type_supply_sats, exit)?; @@ -684,8 +541,9 @@ impl Vecs { .exposed .compute_rest(&starting_lengths, &type_supply_sats, exit)?; - let type_funded_addr_counts = - AddrTypeId::series(|column, _| &column.select(&self.addrs.funded.by_addr_type).height); + let type_funded_addr_counts = AddrTypeId::series(|column, _| { + &column.select(&self.addrs.funded.counts.by_addr_type).height + }); self.addrs.avg_amount.compute( &type_supply_sats, &type_utxo_counts, @@ -697,22 +555,21 @@ impl Vecs { // 6c. Compute total_addr_count = addr_count + empty_addr_count self.addrs.total.compute( starting_lengths.height, - &self.addrs.funded, + &self.addrs.funded.counts, &self.addrs.empty, exit, )?; // 7. Compute rest part2 (relative metrics) info!("Computing rest part 2..."); - self.utxo_cohorts - .compute_rest_part2(prices, &starting_lengths, exit)?; + self.cohorts.compute_rest_part2(&starting_lengths, exit)?; let exit = exit.clone(); self.db.run_bg(move |db| { let _lock = exit.lock(); db.compact_deferred_default() }); - Ok(()) + Ok(utxo_states) } pub(crate) fn flush(&self) -> Result<()> { @@ -721,9 +578,8 @@ impl Vecs { } fn min_stateful_len(&self) -> Height { - self.utxo_cohorts + self.cohorts .min_stateful_len() - .min(self.addr_cohorts.min_stateful_len()) .min(Height::from(self.supply_state.len())) .min(self.any_addr_indexes.min_stamped_len()) .min(self.addrs_data.min_stamped_len()) diff --git a/crates/brk_computer/src/frameworks/coinflow/compute.rs b/crates/brk_computer/src/frameworks/coinflow/compute.rs index 877b4cf33..d8abed6f9 100644 --- a/crates/brk_computer/src/frameworks/coinflow/compute.rs +++ b/crates/brk_computer/src/frameworks/coinflow/compute.rs @@ -3,11 +3,11 @@ use brk_indexer::{Indexer, Lengths}; use brk_types::{Bitcoin, Cents, Height, Sats, StoredF64, Timestamp, Version}; use vecdb::{AnyStoredVec, ColumnId, Exit, ReadableVec, WritableVec}; -use brk_cohort::{AgeRange, AgeRangeId, ByTerm, TERM_FILTERS}; +use brk_cohort::{AgeRange, AgeRangeId, ByTerm, TERM_FILTERS, UTXOAggregate}; use super::super::cointime; use super::{ - AGE_COHORT_COUNT, AgeBand, AggregateVecs, Horizons, MINIMUM_DURATION_DAYS, Vecs, + AGE_COHORT_COUNT, AgeBand, AggregateSources, HorizonId, Horizons, MINIMUM_DURATION_DAYS, Vecs, age_bounds_days, horizon_mobility, mobility, }; use crate::{ @@ -38,7 +38,7 @@ impl Default for AggregateState { fn default() -> Self { Self { weighted: WeightedCohortState::default(), - horizon_supply_in_loss: Horizons::from_fn(|_, _| WeightedRatio::default()), + horizon_supply_in_loss: HorizonId::from_fn(|_| WeightedRatio::default()), } } } @@ -58,11 +58,9 @@ impl AggregateState { .add(total_supply, loss_supply, total_cap, mobility); let total = total_supply.as_u128() as f64; let loss = loss_supply.as_u128() as f64; - for (ratio, weights) in self - .horizon_supply_in_loss - .iter_mut() - .zip(horizon_mobilities.iter()) - { + for horizon in HorizonId::ALL { + let ratio = horizon.select_mut(&mut self.horizon_supply_in_loss); + let weights = horizon.select(horizon_mobilities); ratio.add(loss, total, *age.select(weights)); } contribution @@ -70,12 +68,10 @@ impl AggregateState { fn merged(mut self, other: Self) -> Self { self.weighted = self.weighted.merged(other.weighted); - for (ratio, other) in self - .horizon_supply_in_loss - .iter_mut() - .zip(other.horizon_supply_in_loss.iter()) - { - ratio.merge(*other); + for horizon in HorizonId::ALL { + horizon + .select_mut(&mut self.horizon_supply_in_loss) + .merge(*horizon.select(&other.horizon_supply_in_loss)); } self } @@ -93,35 +89,31 @@ impl Vecs { ) -> Result<()> { let starting_lengths = indexer.safe_lengths(); let transfer_volumes = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .activity - .transfer_volume - .cumulative - .sats - .height + &id.select( + &distribution + .cohorts + .activity + .transfer_volume + .cohorts + .age + .range, + ) + .cumulative + .sats + .height }); let supplies = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .supply - .total + &id.select(&distribution.cohorts.supply.total.cohorts.age.range) .sats .height }); let loss_supplies = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .supply - .in_loss + &id.select(&distribution.cohorts.supply.in_loss.cohorts.age.range) .sats .height }); let realized_caps = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .realized - .cap + &id.select(&distribution.cohorts.realized.cap.cohorts.age.range) .cents .height }); @@ -142,30 +134,33 @@ impl Vecs { } #[allow(clippy::too_many_arguments)] - fn compute_primary( + fn compute_primary( &mut self, starting_lengths: &Lengths, timestamps: &T, - transfer_volumes: &AgeRange<&S>, + transfer_volumes: &AgeRange<&V>, coindays_created: &D, supplies: &AgeRange<&S>, - loss_supplies: &AgeRange<&S>, + loss_supplies: &AgeRange<&L>, realized_caps: &AgeRange<&C>, exit: &Exit, ) -> Result where T: ReadableVec, - D: ReadableVec, + D: ReadableVec>, + V: ReadableVec, S: ReadableVec, + L: ReadableVec, C: ReadableVec, { - let source_version: Version = std::iter::once(timestamps.version()) - .chain(transfer_volumes.iter().map(|vec| vec.version())) - .chain(std::iter::once(coindays_created.version())) - .chain(supplies.iter().map(|vec| vec.version())) - .chain(loss_supplies.iter().map(|vec| vec.version())) - .chain(realized_caps.iter().map(|vec| vec.version())) - .sum(); + let source_version = Version::combine_all( + std::iter::once(timestamps.version()) + .chain(transfer_volumes.iter().map(|vec| vec.version())) + .chain(std::iter::once(coindays_created.version())) + .chain(supplies.iter().map(|vec| vec.version())) + .chain(loss_supplies.iter().map(|vec| vec.version())) + .chain(realized_caps.iter().map(|vec| vec.version())), + ); for vec in self.primary_vecs_mut() { validate_any_computed_version_or_reset(vec, source_version)?; @@ -234,10 +229,10 @@ impl Vecs { .max(MINIMUM_DURATION_DAYS); let exposures = DecayFit::exposures(&hazards, network_age, &bounds); let mobilities = AgeRange::from_fn(|id| mobility(*id.select(&exposures))); - let horizon_mobilities: Horizons> = - Horizons::from_fn(|_, horizon| { - AgeRange::from_fn(|age| horizon_mobility(&hazards, age, horizon, &bounds)) - }); + let horizon_mobilities: Horizons> = HorizonId::from_fn(|horizon| { + let horizon = horizon.days(); + AgeRange::from_fn(|age| horizon_mobility(&hazards, age, horizon, &bounds)) + }); self.age_range.spending_rate.push(AgeRangeId::from_fn(|id| { StoredF64::from(*id.select(&hazards)) })); @@ -284,9 +279,8 @@ impl Vecs { .immobile .push(AgeRangeId::from_fn(|id| *id.select(&immobile_supply))); - self.all.push(terms.short.merged(terms.long)); - self.sth.push(terms.short); - self.lth.push(terms.long); + let all = terms.short.merged(terms.long); + self.aggregate_sources.push(terms, all); } { @@ -309,54 +303,63 @@ impl Vecs { self.age_range.supply.immobile.stored_mut(), ] .into_iter() - .chain(self.all.primary_vecs_mut()) - .chain(self.sth.primary_vecs_mut()) - .chain(self.lth.primary_vecs_mut()) + .chain(self.aggregate_sources.primary_vecs_mut()) } } -impl AggregateVecs { - fn push(&mut self, state: AggregateState) { - self.supply - .mobile - .sats - .height - .push(state.weighted.weighted_supply); - self.supply - .immobile - .sats - .height - .push(state.weighted.complement_supply); - self.supply_in_loss_share - .height - .push(state.weighted.supply_in_loss.value()); - for (output, ratio) in self - .horizon - .iter_mut() - .zip(state.horizon_supply_in_loss.iter()) - { - output.supply_in_loss_share.height.push(ratio.value()); +impl AggregateSources { + fn push(&mut self, terms: ByTerm, all: AggregateState) { + self.supply.mobile.push(ByTerm { + short: terms.short.weighted.weighted_supply, + long: terms.long.weighted.weighted_supply, + }); + self.supply.immobile.push(ByTerm { + short: terms.short.weighted.complement_supply, + long: terms.long.weighted.complement_supply, + }); + self.supply_in_loss_share.push(UTXOAggregate { + all: all.weighted.supply_in_loss.value(), + sth: terms.short.weighted.supply_in_loss.value(), + lth: terms.long.weighted.supply_in_loss.value(), + }); + for horizon in HorizonId::ALL { + horizon.select_mut(&mut self.horizon).push(UTXOAggregate { + all: horizon.select(&all.horizon_supply_in_loss).value(), + sth: horizon.select(&terms.short.horizon_supply_in_loss).value(), + lth: horizon.select(&terms.long.horizon_supply_in_loss).value(), + }); } - self.cap.cents.height.push(state.weighted.weighted_cap); - self.price - .cents - .height - .push(state.weighted.realized_price()); + self.cap.push(ByTerm { + short: terms.short.weighted.weighted_cap, + long: terms.long.weighted.weighted_cap, + }); + self.price.push(UTXOAggregate { + all: all.weighted.realized_price(), + sth: terms.short.weighted.realized_price(), + lth: terms.long.weighted.realized_price(), + }); } fn primary_vecs_mut(&mut self) -> impl Iterator { + let Self { + supply, + supply_in_loss_share, + horizon, + cap, + price, + } = self; [ - &mut self.supply.mobile.sats.height as &mut dyn AnyStoredVec, - &mut self.supply.immobile.sats.height, - &mut self.supply_in_loss_share.height, - &mut self.cap.cents.height, - &mut self.price.cents.height, + &mut supply.mobile as &mut dyn AnyStoredVec, + &mut supply.immobile, + supply_in_loss_share, + cap, + price, ] .into_iter() .chain( - self.horizon + horizon .iter_mut() - .map(|horizon| &mut horizon.supply_in_loss_share.height as &mut dyn AnyStoredVec), + .map(|horizon| horizon as &mut dyn AnyStoredVec), ) } } @@ -580,7 +583,7 @@ mod tests { #[test] fn term_aggregates_merge_into_all() { - let horizons = Horizons::from_fn(|_, _| AgeRange::from_fn(|_| 0.25)); + let horizons = HorizonId::from_fn(|_| AgeRange::from_fn(|_| 0.25)); let mut direct = AggregateState::default(); direct.add( Sats::from(100_u64), @@ -632,12 +635,11 @@ mod tests { merged.weighted.supply_in_loss.value(), direct.weighted.supply_in_loss.value() ); - for (merged, direct) in merged - .horizon_supply_in_loss - .iter() - .zip(direct.horizon_supply_in_loss.iter()) - { - assert_eq!(merged.value(), direct.value()); + for horizon in HorizonId::ALL { + assert_eq!( + horizon.select(&merged.horizon_supply_in_loss).value(), + horizon.select(&direct.horizon_supply_in_loss).value(), + ); } } diff --git a/crates/brk_computer/src/frameworks/coinflow/horizon.rs b/crates/brk_computer/src/frameworks/coinflow/horizon.rs new file mode 100644 index 000000000..6b83e8c40 --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/horizon.rs @@ -0,0 +1,124 @@ +use brk_traversable::Traversable; + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum HorizonId { + Y8, + Y4, + Y2, + Y1, + M6, + M3, + M1, +} + +impl HorizonId { + pub const ALL: [Self; 7] = [ + Self::Y8, + Self::Y4, + Self::Y2, + Self::Y1, + Self::M6, + Self::M3, + Self::M1, + ]; + + pub const fn name(self) -> &'static str { + match self { + Self::Y8 => "8y", + Self::Y4 => "4y", + Self::Y2 => "2y", + Self::Y1 => "1y", + Self::M6 => "6m", + Self::M3 => "3m", + Self::M1 => "1m", + } + } + + pub const fn days(self) -> f64 { + match self { + Self::Y8 => 8.0 * 365.0, + Self::Y4 => 4.0 * 365.0, + Self::Y2 => 2.0 * 365.0, + Self::Y1 => 365.0, + Self::M6 => 180.0, + Self::M3 => 90.0, + Self::M1 => 30.0, + } + } + + pub fn select(self, horizons: &Horizons) -> &T { + match self { + Self::Y8 => &horizons._8y, + Self::Y4 => &horizons._4y, + Self::Y2 => &horizons._2y, + Self::Y1 => &horizons._1y, + Self::M6 => &horizons._6m, + Self::M3 => &horizons._3m, + Self::M1 => &horizons._1m, + } + } + + pub fn select_mut(self, horizons: &mut Horizons) -> &mut T { + match self { + Self::Y8 => &mut horizons._8y, + Self::Y4 => &mut horizons._4y, + Self::Y2 => &mut horizons._2y, + Self::Y1 => &mut horizons._1y, + Self::M6 => &mut horizons._6m, + Self::M3 => &mut horizons._3m, + Self::M1 => &mut horizons._1m, + } + } + + pub fn from_fn(mut create: impl FnMut(Self) -> T) -> Horizons { + Horizons { + _8y: create(Self::Y8), + _4y: create(Self::Y4), + _2y: create(Self::Y2), + _1y: create(Self::Y1), + _6m: create(Self::M6), + _3m: create(Self::M3), + _1m: create(Self::M1), + } + } + + pub fn try_from_fn( + mut create: impl FnMut(Self) -> Result, + ) -> Result, E> { + Ok(Horizons { + _8y: create(Self::Y8)?, + _4y: create(Self::Y4)?, + _2y: create(Self::Y2)?, + _1y: create(Self::Y1)?, + _6m: create(Self::M6)?, + _3m: create(Self::M3)?, + _1m: create(Self::M1)?, + }) + } +} + +#[derive(Clone, Copy, Traversable)] +pub struct Horizons { + pub _8y: T, + pub _4y: T, + pub _2y: T, + pub _1y: T, + pub _6m: T, + pub _3m: T, + pub _1m: T, +} + +impl Horizons { + pub(crate) fn iter_mut(&mut self) -> impl Iterator { + let Self { + _8y, + _4y, + _2y, + _1y, + _6m, + _3m, + _1m, + } = self; + [_8y, _4y, _2y, _1y, _6m, _3m, _1m].into_iter() + } +} diff --git a/crates/brk_computer/src/frameworks/coinflow/import.rs b/crates/brk_computer/src/frameworks/coinflow/import.rs index 80952e272..82e524229 100644 --- a/crates/brk_computer/src/frameworks/coinflow/import.rs +++ b/crates/brk_computer/src/frameworks/coinflow/import.rs @@ -1,23 +1,27 @@ -use brk_cohort::{AgeRangeId, CohortContext, TERM_NAMES}; +use std::ops::AddAssign; + +use brk_cohort::{AgeRangeId, CohortContext, TermId, UTXOAggregateId}; use brk_error::Result; use brk_types::{Cents, Height, StoredF64, Version}; use vecdb::{ - CachedBoxedVec, Database, PcoVec, ReadOnlyColumnarVec, ReadableCloneableVec, UnaryTransform, + CachedBoxedVec, ColumnId, Database, ImportableVec, PcoVec, PcoVecValue, ReadOnlyClone, + ReadOnlyColumnarVec, ReadableBoxedVec, ReadableCloneableVec, ReadableColumnarVec, + UnaryTransform, }; use super::{ - AgeRangeVecs, AggregateVecs, HorizonVecs, Horizons, SpendingExposureSeries, Split, Vecs, - mobility, + AgeRangeVecs, AggregateSources, AggregateVecs, HorizonId, HorizonVecs, Mobility, MobilityId, + SpendingExposureSeries, Vecs, mobility, }; use crate::{ indexes, internal::{ - ColumnarPerBlock, FiatPerBlock, LazyColumnPerBlock, LazyColumnSpotValuePerBlock, - LazyPerBlock, PerBlock, PriceWithRatioPerBlock, SpotValuePerBlock, + ColumnarPerBlock, Identity, LazyColumnPerBlock, LazyColumnSpotValuePerBlock, + LazyFiatPerBlock, LazyPerBlock, LazyPriceWithRatioPerBlock, LazySpotValuePerBlock, }, }; -const VERSION: Version = Version::new(4); +const VERSION: Version = Version::new(5); struct ExposureToMobility; @@ -60,60 +64,169 @@ impl SpendingExposureSeries { } } -impl AggregateVecs { - fn forced_import( - db: &Database, +impl AggregateSources { + fn forced_import(db: &Database, version: Version) -> Result { + Ok(Self { + supply: MobilityId::try_from_fn(|side| { + ImportableVec::forced_import( + db, + &format!("coinflow_{}_supply_sats_by_term", side.name()), + version, + ) + })?, + supply_in_loss_share: ImportableVec::forced_import( + db, + "coinflow_supply_in_loss_share_by_aggregate", + version, + )?, + horizon: HorizonId::try_from_fn(|horizon| { + ImportableVec::forced_import( + db, + &format!( + "coinflow_{}_supply_in_loss_share_by_aggregate", + horizon.name() + ), + version, + ) + })?, + cap: ImportableVec::forced_import(db, "coinflow_cap_cents_by_term", version)?, + price: ImportableVec::forced_import(db, "coinflow_price_cents_by_aggregate", version)?, + }) + } + + fn additive_source( + source: &ReadOnlyColumnarVec, TermId>, name: &str, version: Version, + aggregate: UTXOAggregateId, + ) -> ReadableBoxedVec + where + T: PcoVecValue + AddAssign, + { + match aggregate.term() { + Some(term) => source.column(name, version, term).read_only_boxed_clone(), + None => source + .sum_columns(name, version, TermId::ALL.iter().copied()) + .read_only_boxed_clone(), + } + } + + fn exact_source( + source: &ReadOnlyColumnarVec, UTXOAggregateId>, + name: &str, + version: Version, + aggregate: UTXOAggregateId, + ) -> ReadableBoxedVec + where + T: PcoVecValue, + { + source + .column(name, version, aggregate) + .read_only_boxed_clone() + } +} + +impl AggregateVecs { + fn new( + aggregate: UTXOAggregateId, + version: Version, + sources: &AggregateSources, indexes: &indexes::Vecs, spot_price: &CachedBoxedVec, - ) -> Result { + ) -> Self { + let name = aggregate.cohort_name().id; let prefix = if name.is_empty() { String::new() } else { format!("{name}_") }; - - Ok(Self { - supply: Split::try_from_fn(|side| { - SpotValuePerBlock::forced_import( - db, - &format!("{prefix}{side}_supply"), + let supply = Mobility { + mobile: LazySpotValuePerBlock::from_boxed_sats_source( + &format!("{prefix}mobile_supply"), + version, + AggregateSources::additive_source( + &sources.supply.mobile.read_only_clone(), + &format!("{prefix}mobile_supply_sats"), version, - indexes, - spot_price, - ) - })?, - supply_in_loss_share: PerBlock::forced_import( - db, - &format!("{prefix}coinflow_supply_in_loss_share"), - version, - indexes, - )?, - horizon: Horizons::try_from_fn(|horizon, _| -> Result<_> { - Ok(HorizonVecs { - supply_in_loss_share: PerBlock::forced_import( - db, - &format!("{prefix}coinflow_{horizon}_supply_in_loss_share"), - version, - indexes, - )?, - }) - })?, - cap: FiatPerBlock::forced_import( - db, - &format!("{prefix}coinflow_cap"), - version, - indexes, - )?, - price: PriceWithRatioPerBlock::forced_import( - db, - &format!("{prefix}coinflow_price"), - version, + aggregate, + ), indexes, spot_price, - )?, - }) + ), + immobile: LazySpotValuePerBlock::from_boxed_sats_source( + &format!("{prefix}immobile_supply"), + version, + AggregateSources::additive_source( + &sources.supply.immobile.read_only_clone(), + &format!("{prefix}immobile_supply_sats"), + version, + aggregate, + ), + indexes, + spot_price, + ), + }; + let supply_in_loss_share = + LazyPerBlock::from_uncached_boxed_height_source::>( + &format!("{prefix}coinflow_supply_in_loss_share"), + version, + AggregateSources::exact_source( + &sources.supply_in_loss_share.read_only_clone(), + &format!("{prefix}coinflow_supply_in_loss_share"), + version, + aggregate, + ), + indexes, + ); + let horizon = HorizonId::from_fn(|horizon| { + let name = format!("{prefix}coinflow_{}_supply_in_loss_share", horizon.name()); + HorizonVecs { + supply_in_loss_share: LazyPerBlock::from_uncached_boxed_height_source::< + Identity, + >( + &name, + version, + AggregateSources::exact_source( + &horizon.select(&sources.horizon).read_only_clone(), + &name, + version, + aggregate, + ), + indexes, + ), + } + }); + let cap = LazyFiatPerBlock::from_boxed_cents_source( + &format!("{prefix}coinflow_cap"), + version, + AggregateSources::additive_source( + &sources.cap.read_only_clone(), + &format!("{prefix}coinflow_cap_cents"), + version, + aggregate, + ), + indexes, + ); + let price = LazyPriceWithRatioPerBlock::from_boxed_height_source( + &format!("{prefix}coinflow_price"), + version, + AggregateSources::exact_source( + &sources.price.read_only_clone(), + &format!("{prefix}coinflow_price_cents"), + version, + aggregate, + ), + indexes, + spot_price, + ); + + Self { + supply, + supply_in_loss_share, + horizon, + cap, + price, + } } } @@ -125,7 +238,6 @@ impl Vecs { prices: &crate::price::Vecs, ) -> Result { let version = parent_version + VERSION; - let aggregate_version = version + Version::ONE; let spot_price = prices.spot.cents.height.read_only_cached_boxed_clone(); let spending_rate = ColumnarPerBlock::forced_import( db, @@ -149,7 +261,8 @@ impl Vecs { version, |source| SpendingExposureSeries::new(version, source, indexes), )?; - let supply = Split::try_from_fn(|side| { + let supply = MobilityId::try_from_fn(|side| { + let side = side.name(); ColumnarPerBlock::forced_import( db, &CohortContext::Utxo.prefixed(&format!("age_range_{side}_supply_sats")), @@ -169,29 +282,39 @@ impl Vecs { ) })?; - let this = Self { + let aggregate_sources = AggregateSources::forced_import(db, version)?; + let all = AggregateVecs::new( + UTXOAggregateId::All, + version, + &aggregate_sources, + indexes, + &spot_price, + ); + let sth = AggregateVecs::new( + UTXOAggregateId::Sth, + version, + &aggregate_sources, + indexes, + &spot_price, + ); + let lth = AggregateVecs::new( + UTXOAggregateId::Lth, + version, + &aggregate_sources, + indexes, + &spot_price, + ); + + Ok(Self { age_range: AgeRangeVecs { spending_rate, spending_exposure, supply, }, - all: AggregateVecs::forced_import(db, "", version, indexes, &spot_price)?, - sth: AggregateVecs::forced_import( - db, - TERM_NAMES.short.id, - aggregate_version, - indexes, - &spot_price, - )?, - lth: AggregateVecs::forced_import( - db, - TERM_NAMES.long.id, - aggregate_version, - indexes, - &spot_price, - )?, - }; - - Ok(this) + all, + sth, + lth, + aggregate_sources, + }) } } diff --git a/crates/brk_computer/src/frameworks/coinflow/mod.rs b/crates/brk_computer/src/frameworks/coinflow/mod.rs index 45a045281..70bbd6aa5 100644 --- a/crates/brk_computer/src/frameworks/coinflow/mod.rs +++ b/crates/brk_computer/src/frameworks/coinflow/mod.rs @@ -1,4 +1,5 @@ mod compute; +mod horizon; mod import; mod vecs; @@ -6,12 +7,13 @@ use brk_cohort::{AgeRange, AgeRangeId}; use vecdb::ColumnId; pub(crate) use brk_cohort::AGE_RANGE_COUNT as AGE_COHORT_COUNT; -pub(crate) use vecs::HORIZON_DAYS; +pub use horizon::{HorizonId, Horizons}; pub use vecs::{ - AgeRangeVecs, AggregateVecs, HorizonVecs, Horizons, SpendingExposureSeries, Split, Vecs, + AgeRangeVecs, AggregateSources, AggregateVecs, HorizonVecs, Mobility, MobilityId, + SpendingExposureSeries, Vecs, }; -pub(crate) const HORIZON_COUNT: usize = 7; +pub(crate) const HORIZON_COUNT: usize = HorizonId::ALL.len(); pub(crate) const HOURS_PER_DAY: f64 = 24.0; pub(crate) const MINIMUM_DURATION_DAYS: f64 = 1.0 / HOURS_PER_DAY; diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs.rs b/crates/brk_computer/src/frameworks/coinflow/vecs.rs deleted file mode 100644 index 9c4ebe6ad..000000000 --- a/crates/brk_computer/src/frameworks/coinflow/vecs.rs +++ /dev/null @@ -1,162 +0,0 @@ -use brk_cohort::{AgeRange, AgeRangeId}; -use brk_traversable::Traversable; -use brk_types::{Cents, Sats, StoredF64}; -use derive_more::{Deref, DerefMut}; -use vecdb::{Rw, StorageMode}; - -use crate::internal::{ - ColumnarPerBlock, FiatPerBlock, LazyColumnPerBlock, LazyColumnSpotValuePerBlock, LazyPerBlock, - PerBlock, PriceWithRatioPerBlock, SpotValuePerBlock, -}; - -#[derive(Clone, Copy, Traversable)] -pub struct Horizons { - pub _8y: T, - pub _4y: T, - pub _2y: T, - pub _1y: T, - pub _6m: T, - pub _3m: T, - pub _1m: T, -} - -pub(crate) const HORIZON_NAMES: Horizons<&str> = Horizons { - _8y: "8y", - _4y: "4y", - _2y: "2y", - _1y: "1y", - _6m: "6m", - _3m: "3m", - _1m: "1m", -}; - -pub(crate) const HORIZON_DAYS: Horizons = Horizons { - _8y: 8.0 * 365.0, - _4y: 4.0 * 365.0, - _2y: 2.0 * 365.0, - _1y: 365.0, - _6m: 180.0, - _3m: 90.0, - _1m: 30.0, -}; - -impl Horizons { - pub(crate) fn from_fn(mut create: impl FnMut(&'static str, f64) -> T) -> Self { - let names = HORIZON_NAMES; - let days = HORIZON_DAYS; - Self { - _8y: create(names._8y, days._8y), - _4y: create(names._4y, days._4y), - _2y: create(names._2y, days._2y), - _1y: create(names._1y, days._1y), - _6m: create(names._6m, days._6m), - _3m: create(names._3m, days._3m), - _1m: create(names._1m, days._1m), - } - } - - pub(crate) fn try_from_fn( - mut create: impl FnMut(&'static str, f64) -> Result, - ) -> Result { - let names = HORIZON_NAMES; - let days = HORIZON_DAYS; - Ok(Self { - _8y: create(names._8y, days._8y)?, - _4y: create(names._4y, days._4y)?, - _2y: create(names._2y, days._2y)?, - _1y: create(names._1y, days._1y)?, - _6m: create(names._6m, days._6m)?, - _3m: create(names._3m, days._3m)?, - _1m: create(names._1m, days._1m)?, - }) - } - - pub(crate) fn as_array(&self) -> [&T; 7] { - [ - &self._8y, &self._4y, &self._2y, &self._1y, &self._6m, &self._3m, &self._1m, - ] - } - - pub(crate) fn as_mut_array(&mut self) -> [&mut T; 7] { - [ - &mut self._8y, - &mut self._4y, - &mut self._2y, - &mut self._1y, - &mut self._6m, - &mut self._3m, - &mut self._1m, - ] - } - - pub(crate) fn iter(&self) -> impl Iterator { - self.as_array().into_iter() - } - - pub(crate) fn iter_mut(&mut self) -> impl Iterator { - self.as_mut_array().into_iter() - } -} - -#[derive(Traversable)] -pub struct HorizonVecs { - #[traversable(wrap = "supply/in_loss", rename = "share")] - pub supply_in_loss_share: PerBlock, -} - -#[derive(Traversable)] -pub struct Split { - pub mobile: T, - pub immobile: T, -} - -impl Split { - pub(crate) fn try_from_fn(mut create: impl FnMut(&str) -> Result) -> Result { - Ok(Self { - mobile: create("mobile")?, - immobile: create("immobile")?, - }) - } -} - -#[derive(Clone, Deref, DerefMut, Traversable)] -pub struct SpendingExposureSeries { - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub age_range: AgeRange>, - pub mobility: AgeRange>, -} - -#[derive(Traversable)] -pub struct AgeRangeVecs { - pub spending_rate: ColumnarPerBlock< - StoredF64, - AgeRangeId, - AgeRange>, - M, - >, - pub spending_exposure: ColumnarPerBlock, - pub supply: Split< - ColumnarPerBlock>, M>, - >, -} - -#[derive(Traversable)] -pub struct AggregateVecs { - pub supply: Split>, - #[traversable(wrap = "supply/mobile/in_loss", rename = "share")] - pub supply_in_loss_share: PerBlock, - pub horizon: Horizons>, - pub cap: FiatPerBlock, - pub price: PriceWithRatioPerBlock, -} - -#[derive(Traversable)] -pub struct Vecs { - pub age_range: AgeRangeVecs, - #[traversable(flatten)] - pub all: AggregateVecs, - pub sth: AggregateVecs, - pub lth: AggregateVecs, -} diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs/age_range.rs b/crates/brk_computer/src/frameworks/coinflow/vecs/age_range.rs new file mode 100644 index 000000000..b9ae6d6e0 --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/vecs/age_range.rs @@ -0,0 +1,22 @@ +use brk_cohort::{AgeRange, AgeRangeId}; +use brk_traversable::Traversable; +use brk_types::{Sats, StoredF64}; +use vecdb::{Rw, StorageMode}; + +use crate::internal::{ColumnarPerBlock, LazyColumnPerBlock, LazyColumnSpotValuePerBlock}; + +use super::{Mobility, SpendingExposureSeries}; + +#[derive(Traversable)] +pub struct AgeRangeVecs { + pub spending_rate: ColumnarPerBlock< + StoredF64, + AgeRangeId, + AgeRange>, + M, + >, + pub spending_exposure: ColumnarPerBlock, + pub supply: Mobility< + ColumnarPerBlock>, M>, + >, +} diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs/aggregate/mod.rs b/crates/brk_computer/src/frameworks/coinflow/vecs/aggregate/mod.rs new file mode 100644 index 000000000..7c54553cb --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/vecs/aggregate/mod.rs @@ -0,0 +1,22 @@ +use brk_traversable::Traversable; +use brk_types::{Cents, StoredF64}; + +mod sources; + +pub use sources::AggregateSources; + +use crate::internal::{ + LazyFiatPerBlock, LazyPerBlock, LazyPriceWithRatioPerBlock, LazySpotValuePerBlock, +}; + +use super::{super::Horizons, HorizonVecs, Mobility}; + +#[derive(Clone, Traversable)] +pub struct AggregateVecs { + pub supply: Mobility, + #[traversable(wrap = "supply/mobile/in_loss", rename = "share")] + pub supply_in_loss_share: LazyPerBlock, + pub horizon: Horizons, + pub cap: LazyFiatPerBlock, + pub price: LazyPriceWithRatioPerBlock, +} diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs/aggregate/sources.rs b/crates/brk_computer/src/frameworks/coinflow/vecs/aggregate/sources.rs new file mode 100644 index 000000000..06dd6b4a1 --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/vecs/aggregate/sources.rs @@ -0,0 +1,17 @@ +use brk_cohort::{TermId, UTXOAggregateId}; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, StoredF64}; +use vecdb::{ColumnarVec, EagerVec, PcoVec, Rw, StorageMode}; + +use super::super::{super::Horizons, Mobility}; + +#[derive(Traversable)] +pub struct AggregateSources { + pub supply: Mobility, TermId>>>>, + pub supply_in_loss_share: + M::Stored, UTXOAggregateId>>>, + pub horizon: + Horizons, UTXOAggregateId>>>>, + pub cap: M::Stored, TermId>>>, + pub price: M::Stored, UTXOAggregateId>>>, +} diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs/collection.rs b/crates/brk_computer/src/frameworks/coinflow/vecs/collection.rs new file mode 100644 index 000000000..c38cc1600 --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/vecs/collection.rs @@ -0,0 +1,14 @@ +use brk_traversable::Traversable; +use vecdb::{Rw, StorageMode}; + +use super::{AgeRangeVecs, AggregateSources, AggregateVecs}; + +#[derive(Traversable)] +pub struct Vecs { + pub age_range: AgeRangeVecs, + #[traversable(flatten)] + pub all: AggregateVecs, + pub sth: AggregateVecs, + pub lth: AggregateVecs, + pub aggregate_sources: AggregateSources, +} diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs/horizon.rs b/crates/brk_computer/src/frameworks/coinflow/vecs/horizon.rs new file mode 100644 index 000000000..7ff8526e5 --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/vecs/horizon.rs @@ -0,0 +1,10 @@ +use brk_traversable::Traversable; +use brk_types::StoredF64; + +use crate::internal::LazyPerBlock; + +#[derive(Clone, Traversable)] +pub struct HorizonVecs { + #[traversable(wrap = "supply/in_loss", rename = "share")] + pub supply_in_loss_share: LazyPerBlock, +} diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs/mobility.rs b/crates/brk_computer/src/frameworks/coinflow/vecs/mobility.rs new file mode 100644 index 000000000..ee9498e64 --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/vecs/mobility.rs @@ -0,0 +1,7 @@ +use brk_traversable::Traversable; + +#[derive(Clone, Traversable)] +pub struct Mobility { + pub mobile: T, + pub immobile: T, +} diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs/mobility_id.rs b/crates/brk_computer/src/frameworks/coinflow/vecs/mobility_id.rs new file mode 100644 index 000000000..41d5e1e28 --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/vecs/mobility_id.rs @@ -0,0 +1,25 @@ +use super::Mobility; + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum MobilityId { + Mobile, + Immobile, +} + +impl MobilityId { + pub const fn name(self) -> &'static str { + match self { + Self::Mobile => "mobile", + Self::Immobile => "immobile", + } + } + + pub fn try_from_fn( + mut create: impl FnMut(Self) -> Result, + ) -> Result, E> { + Ok(Mobility { + mobile: create(Self::Mobile)?, + immobile: create(Self::Immobile)?, + }) + } +} diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs/mod.rs b/crates/brk_computer/src/frameworks/coinflow/vecs/mod.rs new file mode 100644 index 000000000..a4dc63d91 --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/vecs/mod.rs @@ -0,0 +1,15 @@ +mod age_range; +mod aggregate; +mod collection; +mod horizon; +mod mobility; +mod mobility_id; +mod spending_exposure; + +pub use age_range::AgeRangeVecs; +pub use aggregate::{AggregateSources, AggregateVecs}; +pub use collection::Vecs; +pub use horizon::HorizonVecs; +pub use mobility::Mobility; +pub use mobility_id::MobilityId; +pub use spending_exposure::SpendingExposureSeries; diff --git a/crates/brk_computer/src/frameworks/coinflow/vecs/spending_exposure.rs b/crates/brk_computer/src/frameworks/coinflow/vecs/spending_exposure.rs new file mode 100644 index 000000000..ff6532fbc --- /dev/null +++ b/crates/brk_computer/src/frameworks/coinflow/vecs/spending_exposure.rs @@ -0,0 +1,15 @@ +use brk_cohort::{AgeRange, AgeRangeId}; +use brk_traversable::Traversable; +use brk_types::StoredF64; +use derive_more::{Deref, DerefMut}; + +use crate::internal::{LazyColumnPerBlock, LazyPerBlock}; + +#[derive(Clone, Deref, DerefMut, Traversable)] +pub struct SpendingExposureSeries { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub age_range: AgeRange>, + pub mobility: AgeRange>, +} diff --git a/crates/brk_computer/src/frameworks/cointime/activity/compute.rs b/crates/brk_computer/src/frameworks/cointime/activity/compute.rs index db7b6c035..d022376b8 100644 --- a/crates/brk_computer/src/frameworks/cointime/activity/compute.rs +++ b/crates/brk_computer/src/frameworks/cointime/activity/compute.rs @@ -42,8 +42,7 @@ impl Vecs { exit: &Exit, ) -> Result<()> { let starting_height = indexer.safe_lengths().height; - let all_metrics = &distribution.utxo_cohorts.all.metrics; - let circulating_supply = &all_metrics.supply.total.sats.height; + let circulating_supply = &distribution.cohorts.supply.total.cohorts.all.sats.height; self.coinblocks_created.compute_cumulative_transformed( starting_height, diff --git a/crates/brk_computer/src/frameworks/cointime/activity/vecs.rs b/crates/brk_computer/src/frameworks/cointime/activity/vecs/collection.rs similarity index 61% rename from crates/brk_computer/src/frameworks/cointime/activity/vecs.rs rename to crates/brk_computer/src/frameworks/cointime/activity/vecs/collection.rs index 11074a02e..f7b19b8ba 100644 --- a/crates/brk_computer/src/frameworks/cointime/activity/vecs.rs +++ b/crates/brk_computer/src/frameworks/cointime/activity/vecs/collection.rs @@ -3,14 +3,9 @@ use brk_types::StoredF64; use derive_more::{Deref, DerefMut}; use vecdb::{Rw, StorageMode}; -use crate::internal::{LazyPerBlock, PerBlock, PerBlockCumulativeRolling}; +use crate::internal::PerBlockCumulativeRolling; -#[derive(Traversable)] -pub struct DerivedVecs { - pub liveliness: PerBlock, - pub vaultedness: LazyPerBlock, - pub ratio: LazyPerBlock, -} +use super::DerivedVecs; #[derive(Deref, DerefMut, Traversable)] pub struct Vecs { diff --git a/crates/brk_computer/src/frameworks/cointime/activity/vecs/derived.rs b/crates/brk_computer/src/frameworks/cointime/activity/vecs/derived.rs new file mode 100644 index 000000000..83f7c23df --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/activity/vecs/derived.rs @@ -0,0 +1,12 @@ +use brk_traversable::Traversable; +use brk_types::StoredF64; +use vecdb::{Rw, StorageMode}; + +use crate::internal::{LazyPerBlock, PerBlock}; + +#[derive(Traversable)] +pub struct DerivedVecs { + pub liveliness: PerBlock, + pub vaultedness: LazyPerBlock, + pub ratio: LazyPerBlock, +} diff --git a/crates/brk_computer/src/frameworks/cointime/activity/vecs/mod.rs b/crates/brk_computer/src/frameworks/cointime/activity/vecs/mod.rs new file mode 100644 index 000000000..343cefd62 --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/activity/vecs/mod.rs @@ -0,0 +1,5 @@ +mod collection; +mod derived; + +pub use collection::Vecs; +pub use derived::DerivedVecs; diff --git a/crates/brk_computer/src/frameworks/cointime/age_range/compute.rs b/crates/brk_computer/src/frameworks/cointime/age_range/compute.rs index 13a94ab92..f268fed6d 100644 --- a/crates/brk_computer/src/frameworks/cointime/age_range/compute.rs +++ b/crates/brk_computer/src/frameworks/cointime/age_range/compute.rs @@ -20,27 +20,34 @@ impl Vecs { ) -> Result<()> { let starting_height = indexer.safe_lengths().height; let supplies = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .supply - .total + &id.select(&distribution.cohorts.supply.total.cohorts.age.range) .sats .height }); let transfer_volumes = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .activity - .transfer_volume - .block - .sats + &id.select( + &distribution + .cohorts + .activity + .transfer_volume + .cohorts + .age + .range, + ) + .block + .sats }); let coindays_destroyed = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .activity - .coindays_destroyed - .block + &id.select( + &distribution + .cohorts + .activity + .coindays_destroyed + .cohorts + .age + .range, + ) + .block }); self.compute_created( @@ -69,9 +76,9 @@ impl Vecs { T: ReadableVec, S: ReadableVec, { - let version: Version = std::iter::once(timestamps.version()) - .chain(supplies.iter().map(|vec| vec.version())) - .sum(); + let version = Version::combine_all( + std::iter::once(timestamps.version()).chain(supplies.iter().map(|vec| vec.version())), + ); let source_end = supplies .iter() .map(|vec| vec.len()) @@ -124,11 +131,12 @@ impl Vecs { V: ReadableVec, D: ReadableVec, { - let version: Version = transfer_volumes - .iter() - .map(|vec| vec.version()) - .chain(source_coindays_destroyed.iter().map(|vec| vec.version())) - .sum(); + let version = Version::combine_all( + transfer_volumes + .iter() + .map(|vec| vec.version()) + .chain(source_coindays_destroyed.iter().map(|vec| vec.version())), + ); let source_end = transfer_volumes .iter() .map(|vec| vec.len()) @@ -231,9 +239,9 @@ impl Vecs { S: ReadableVec, { let wakefulness = self.activity.height.read_only_clone(); - let source_version: Version = std::iter::once(wakefulness.version()) - .chain(supplies.iter().map(|vec| vec.version())) - .sum(); + let source_version = Version::combine_all( + std::iter::once(wakefulness.version()).chain(supplies.iter().map(|vec| vec.version())), + ); let supply = &mut self.supply; supply .awake diff --git a/crates/brk_computer/src/frameworks/cointime/age_range/vecs/activity_series.rs b/crates/brk_computer/src/frameworks/cointime/age_range/vecs/activity_series.rs new file mode 100644 index 000000000..5657cea5b --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/age_range/vecs/activity_series.rs @@ -0,0 +1,12 @@ +use brk_cohort::{AgeRange, AgeRangeId}; +use brk_traversable::Traversable; +use brk_types::StoredF64; + +use crate::internal::{LazyColumnPerBlock, LazyPerBlock}; + +#[derive(Clone, Traversable)] +pub struct ActivitySeries { + pub wakefulness: AgeRange>, + pub dormancy: AgeRange>, + pub wakefulness_to_dormancy: AgeRange>, +} diff --git a/crates/brk_computer/src/frameworks/cointime/age_range/vecs.rs b/crates/brk_computer/src/frameworks/cointime/age_range/vecs/collection.rs similarity index 71% rename from crates/brk_computer/src/frameworks/cointime/age_range/vecs.rs rename to crates/brk_computer/src/frameworks/cointime/age_range/vecs/collection.rs index 5304b70d0..060b65d63 100644 --- a/crates/brk_computer/src/frameworks/cointime/age_range/vecs.rs +++ b/crates/brk_computer/src/frameworks/cointime/age_range/vecs/collection.rs @@ -4,22 +4,11 @@ use brk_types::{Sats, StoredF64}; use vecdb::{Rw, StorageMode}; use crate::internal::{ - ColumnarPerBlock, ColumnarPerBlockCumulativeRolling, LazyColumnPerBlock, - LazyColumnPerBlockCumulativeRolling, LazyColumnSpotValuePerBlock, LazyPerBlock, + ColumnarPerBlock, ColumnarPerBlockCumulativeRolling, LazyColumnPerBlockCumulativeRolling, + LazyColumnSpotValuePerBlock, }; -#[derive(Clone, Traversable)] -pub struct ActivitySeries { - pub wakefulness: AgeRange>, - pub dormancy: AgeRange>, - pub wakefulness_to_dormancy: AgeRange>, -} - -#[derive(Traversable)] -pub struct SupplyVecs { - pub awake: T, - pub dormant: T, -} +use super::{ActivitySeries, SupplyVecs}; #[derive(Traversable)] pub struct Vecs { diff --git a/crates/brk_computer/src/frameworks/cointime/age_range/vecs/mod.rs b/crates/brk_computer/src/frameworks/cointime/age_range/vecs/mod.rs new file mode 100644 index 000000000..1f3585ff3 --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/age_range/vecs/mod.rs @@ -0,0 +1,7 @@ +mod activity_series; +mod collection; +mod supply; + +pub use activity_series::ActivitySeries; +pub use collection::Vecs; +pub use supply::SupplyVecs; diff --git a/crates/brk_computer/src/frameworks/cointime/age_range/vecs/supply.rs b/crates/brk_computer/src/frameworks/cointime/age_range/vecs/supply.rs new file mode 100644 index 000000000..c3ed6ce23 --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/age_range/vecs/supply.rs @@ -0,0 +1,7 @@ +use brk_traversable::Traversable; + +#[derive(Traversable)] +pub struct SupplyVecs { + pub awake: T, + pub dormant: T, +} diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/compute.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/compute.rs index 204af151e..176bdcb1a 100644 --- a/crates/brk_computer/src/frameworks/cointime/aggregate/compute.rs +++ b/crates/brk_computer/src/frameworks/cointime/aggregate/compute.rs @@ -1,10 +1,10 @@ -use brk_cohort::{AGE_RANGE_COUNT, AgeRange, AgeRangeId, ByTerm, TERM_FILTERS}; +use brk_cohort::{AgeRange, AgeRangeId, ByTerm, TERM_FILTERS, UTXOAggregate}; use brk_error::Result; use brk_indexer::Indexer; use brk_types::{Cents, Height, Sats, StoredF64, Version}; use vecdb::{AnyStoredVec, AnyVec, ColumnId, Exit, ReadableVec, WritableVec}; -use super::{AllCohortVecs, StoredCohortVecs, Vecs}; +use super::{Sources, Vecs}; use crate::{ distribution, frameworks::WeightedCohortState, @@ -12,8 +12,6 @@ use crate::{ }; const WRITE_INTERVAL: usize = 10_000; -const ALL_PRIMARY_VEC_COUNT: usize = 4; -const STORED_PRIMARY_VEC_COUNT: usize = 5; impl Vecs { pub(crate) fn compute( @@ -26,26 +24,17 @@ impl Vecs { ) -> Result<()> { let starting_height = indexer.safe_lengths().height; let supplies = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .supply - .total + &id.select(&distribution.cohorts.supply.total.cohorts.age.range) .sats .height }); let loss_supplies = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .supply - .in_loss + &id.select(&distribution.cohorts.supply.in_loss.cohorts.age.range) .sats .height }); let realized_caps = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .realized - .cap + &id.select(&distribution.cohorts.realized.cap.cohorts.age.range) .cents .height }); @@ -63,11 +52,11 @@ impl Vecs { } #[allow(clippy::too_many_arguments)] - fn compute_primary( + fn compute_primary( &mut self, starting_height: Height, supplies: &AgeRange<&S>, - loss_supplies: &AgeRange<&S>, + loss_supplies: &AgeRange<&L>, realized_caps: &AgeRange<&C>, weights: &W, all_supply_in_loss_share: &mut PerBlock, @@ -75,16 +64,18 @@ impl Vecs { ) -> Result<()> where S: ReadableVec, + L: ReadableVec, C: ReadableVec, - W: ReadableVec, + W: ReadableVec>, { - let source_version: Version = supplies - .iter() - .map(|vec| vec.version()) - .chain(loss_supplies.iter().map(|vec| vec.version())) - .chain(realized_caps.iter().map(|vec| vec.version())) - .chain(std::iter::once(weights.version())) - .sum(); + let source_version = Version::combine_all( + supplies + .iter() + .map(|vec| vec.version()) + .chain(loss_supplies.iter().map(|vec| vec.version())) + .chain(realized_caps.iter().map(|vec| vec.version())) + .chain(std::iter::once(weights.version())), + ); for vec in self.primary_vecs_mut() { validate_any_computed_version_or_reset(vec, source_version)?; @@ -147,9 +138,7 @@ impl Vecs { } let all = terms.short.merged(terms.long); all_supply_in_loss_share.push(all.supply_in_loss.value()); - self.all.push(all); - self.sth.push(terms.short); - self.lth.push(terms.long); + self.sources.push(terms, all); } { @@ -166,59 +155,42 @@ impl Vecs { } fn primary_vecs_mut(&mut self) -> impl Iterator { - self.all - .primary_vecs_mut() - .into_iter() - .chain(self.sth.primary_vecs_mut()) - .chain(self.lth.primary_vecs_mut()) + self.sources.primary_vecs_mut().into_iter() } } -impl AllCohortVecs { - fn push(&mut self, state: WeightedCohortState) { - self.awake.supply.sats.height.push(state.weighted_supply); - self.dormant - .supply - .sats - .height - .push(state.complement_supply); - self.awake.cap.cents.height.push(state.weighted_cap); - self.awake.price.cents.height.push(state.realized_price()); +impl Sources { + fn push(&mut self, terms: ByTerm, all: WeightedCohortState) { + self.awake_supply.push(ByTerm { + short: terms.short.weighted_supply, + long: terms.long.weighted_supply, + }); + self.dormant_supply.push(ByTerm { + short: terms.short.complement_supply, + long: terms.long.complement_supply, + }); + self.awake_cap.push(ByTerm { + short: terms.short.weighted_cap, + long: terms.long.weighted_cap, + }); + self.awake_price.push(UTXOAggregate { + all: all.realized_price(), + sth: terms.short.realized_price(), + lth: terms.long.realized_price(), + }); + self.supply_in_loss_share.push(ByTerm { + short: terms.short.supply_in_loss.value(), + long: terms.long.supply_in_loss.value(), + }); } - fn primary_vecs_mut(&mut self) -> [&mut dyn AnyStoredVec; ALL_PRIMARY_VEC_COUNT] { + fn primary_vecs_mut(&mut self) -> [&mut dyn AnyStoredVec; 5] { [ - &mut self.awake.supply.sats.height, - &mut self.dormant.supply.sats.height, - &mut self.awake.cap.cents.height, - &mut self.awake.price.cents.height, - ] - } -} - -impl StoredCohortVecs { - fn push(&mut self, state: WeightedCohortState) { - self.awake.supply.sats.height.push(state.weighted_supply); - self.dormant - .supply - .sats - .height - .push(state.complement_supply); - self.awake - .supply_in_loss_share - .height - .push(state.supply_in_loss.value()); - self.awake.cap.cents.height.push(state.weighted_cap); - self.awake.price.cents.height.push(state.realized_price()); - } - - fn primary_vecs_mut(&mut self) -> [&mut dyn AnyStoredVec; STORED_PRIMARY_VEC_COUNT] { - [ - &mut self.awake.supply.sats.height, - &mut self.dormant.supply.sats.height, - &mut self.awake.supply_in_loss_share.height, - &mut self.awake.cap.cents.height, - &mut self.awake.price.cents.height, + &mut self.awake_supply, + &mut self.dormant_supply, + &mut self.awake_cap, + &mut self.awake_price, + &mut self.supply_in_loss_share, ] } } diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/import.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/import.rs index aec81c803..eab41d64b 100644 --- a/crates/brk_computer/src/frameworks/cointime/aggregate/import.rs +++ b/crates/brk_computer/src/frameworks/cointime/aggregate/import.rs @@ -1,61 +1,151 @@ -use brk_cohort::TERM_NAMES; +use std::ops::AddAssign; + +use brk_cohort::{TermId, UTXOAggregateId}; use brk_error::Result; use brk_types::{Cents, Height, StoredF64, Version}; -use vecdb::{CachedBoxedVec, Database, ReadableCloneableVec}; +use vecdb::{ + CachedBoxedVec, ColumnId, Database, ImportableVec, PcoVec, PcoVecValue, ReadOnlyClone, + ReadableBoxedVec, ReadableCloneableVec, ReadableColumnarVec, +}; -use super::{AllAwakeVecs, AllCohortVecs, DormantVecs, StoredAwakeVecs, StoredCohortVecs, Vecs}; +use super::{AwakeVecs, CohortVecs, DormantVecs, Sources, Vecs}; use crate::{ indexes, internal::{ - FiatPerBlock, Identity, LazyPerBlock, PerBlock, PriceWithRatioPerBlock, SpotValuePerBlock, + Identity, LazyFiatPerBlock, LazyPerBlock, LazyPriceWithRatioPerBlock, + LazySpotValuePerBlock, PerBlock, }, }; -struct CommonVecs { - supply: SpotValuePerBlock, - dormant_supply: SpotValuePerBlock, - cap: FiatPerBlock, - price: PriceWithRatioPerBlock, -} +impl Sources { + fn forced_import(db: &Database, version: Version) -> Result { + Ok(Self { + awake_supply: ImportableVec::forced_import( + db, + "cointime_awake_supply_sats_by_term", + version, + )?, + dormant_supply: ImportableVec::forced_import( + db, + "cointime_dormant_supply_sats_by_term", + version, + )?, + awake_cap: ImportableVec::forced_import( + db, + "cointime_awake_cap_cents_by_term", + version, + )?, + awake_price: ImportableVec::forced_import( + db, + "cointime_awake_price_cents_by_aggregate", + version, + )?, + supply_in_loss_share: ImportableVec::forced_import( + db, + "cointime_awake_supply_in_loss_share_by_term", + version, + )?, + }) + } -impl CommonVecs { - fn forced_import( - db: &Database, + fn additive_source( + source: &vecdb::ReadOnlyColumnarVec, TermId>, name: &str, version: Version, + aggregate: UTXOAggregateId, + ) -> ReadableBoxedVec + where + T: PcoVecValue + AddAssign, + { + match aggregate.term() { + Some(term) => source.column(name, version, term).read_only_boxed_clone(), + None => source + .sum_columns(name, version, TermId::ALL.iter().copied()) + .read_only_boxed_clone(), + } + } +} + +impl CohortVecs { + fn new( + aggregate: UTXOAggregateId, + version: Version, + sources: &Sources, + supply_in_loss_share: ReadableBoxedVec, indexes: &indexes::Vecs, spot_price: &CachedBoxedVec, - ) -> Result { + ) -> Self { + let name = aggregate.cohort_name().id; let prefix = if name.is_empty() { String::new() } else { format!("{name}_") }; + let awake_supply = Sources::additive_source( + &sources.awake_supply.read_only_clone(), + &format!("{prefix}awake_supply_sats"), + version, + aggregate, + ); + let dormant_supply = Sources::additive_source( + &sources.dormant_supply.read_only_clone(), + &format!("{prefix}dormant_supply_sats"), + version, + aggregate, + ); + let awake_cap = Sources::additive_source( + &sources.awake_cap.read_only_clone(), + &format!("{prefix}awake_cap_cents"), + version, + aggregate, + ); + let awake_price = sources + .awake_price + .read_only_clone() + .column(&format!("{prefix}awake_price_cents"), version, aggregate) + .read_only_boxed_clone(); - Ok(CommonVecs { - supply: SpotValuePerBlock::forced_import( - db, - &format!("{prefix}awake_supply"), - version, - indexes, - spot_price, - )?, - dormant_supply: SpotValuePerBlock::forced_import( - db, - &format!("{prefix}dormant_supply"), - version, - indexes, - spot_price, - )?, - cap: FiatPerBlock::forced_import(db, &format!("{prefix}awake_cap"), version, indexes)?, - price: PriceWithRatioPerBlock::forced_import( - db, - &format!("{prefix}awake_price"), - version, - indexes, - spot_price, - )?, - }) + Self { + awake: AwakeVecs { + supply: LazySpotValuePerBlock::from_boxed_sats_source( + &format!("{prefix}awake_supply"), + version, + awake_supply, + indexes, + spot_price, + ), + supply_in_loss_share: LazyPerBlock::from_uncached_boxed_height_source::< + Identity, + >( + &format!("{prefix}awake_supply_in_loss_share"), + version, + supply_in_loss_share, + indexes, + ), + cap: LazyFiatPerBlock::from_boxed_cents_source( + &format!("{prefix}awake_cap"), + version, + awake_cap, + indexes, + ), + price: LazyPriceWithRatioPerBlock::from_boxed_height_source( + &format!("{prefix}awake_price"), + version, + awake_price, + indexes, + spot_price, + ), + }, + dormant: DormantVecs { + supply: LazySpotValuePerBlock::from_boxed_sats_source( + &format!("{prefix}dormant_supply"), + version, + dormant_supply, + indexes, + spot_price, + ), + }, + } } } @@ -67,60 +157,49 @@ impl Vecs { spot_price: &CachedBoxedVec, all_supply_in_loss_share: &PerBlock, ) -> Result { - let all_supply_in_loss_share = LazyPerBlock::from_computed::>( - "awake_supply_in_loss_share", - version, - all_supply_in_loss_share.height.read_only_boxed_clone(), - all_supply_in_loss_share, - ); - let stored = |name: &str| { - PerBlock::forced_import( - db, + let version = version + Version::ONE; + let sources = Sources::forced_import(db, version)?; + let all_loss_share = all_supply_in_loss_share.height.read_only_boxed_clone(); + let term_loss_share = |aggregate: UTXOAggregateId| { + let name = aggregate.cohort_name().id; + debug_assert!(aggregate.term().is_some()); + Sources::additive_source( + &sources.supply_in_loss_share.read_only_clone(), &format!("{name}_awake_supply_in_loss_share"), version, - indexes, + aggregate, ) }; - let all_common = CommonVecs::forced_import(db, "", version, indexes, spot_price)?; - let sth_common = - CommonVecs::forced_import(db, TERM_NAMES.short.id, version, indexes, spot_price)?; - let lth_common = - CommonVecs::forced_import(db, TERM_NAMES.long.id, version, indexes, spot_price)?; + let all = CohortVecs::new( + UTXOAggregateId::All, + version, + &sources, + all_loss_share, + indexes, + spot_price, + ); + let sth = CohortVecs::new( + UTXOAggregateId::Sth, + version, + &sources, + term_loss_share(UTXOAggregateId::Sth), + indexes, + spot_price, + ); + let lth = CohortVecs::new( + UTXOAggregateId::Lth, + version, + &sources, + term_loss_share(UTXOAggregateId::Lth), + indexes, + spot_price, + ); Ok(Self { - all: AllCohortVecs { - awake: AllAwakeVecs { - supply: all_common.supply, - supply_in_loss_share: all_supply_in_loss_share, - cap: all_common.cap, - price: all_common.price, - }, - dormant: DormantVecs { - supply: all_common.dormant_supply, - }, - }, - sth: StoredCohortVecs { - awake: StoredAwakeVecs { - supply: sth_common.supply, - supply_in_loss_share: stored(TERM_NAMES.short.id)?, - cap: sth_common.cap, - price: sth_common.price, - }, - dormant: DormantVecs { - supply: sth_common.dormant_supply, - }, - }, - lth: StoredCohortVecs { - awake: StoredAwakeVecs { - supply: lth_common.supply, - supply_in_loss_share: stored(TERM_NAMES.long.id)?, - cap: lth_common.cap, - price: lth_common.price, - }, - dormant: DormantVecs { - supply: lth_common.dormant_supply, - }, - }, + all, + sth, + lth, + sources, }) } } diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/mod.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/mod.rs index b0336f121..aed1f5d2a 100644 --- a/crates/brk_computer/src/frameworks/cointime/aggregate/mod.rs +++ b/crates/brk_computer/src/frameworks/cointime/aggregate/mod.rs @@ -2,4 +2,4 @@ mod compute; mod import; mod vecs; -pub use vecs::{AllAwakeVecs, AllCohortVecs, DormantVecs, StoredAwakeVecs, StoredCohortVecs, Vecs}; +pub use vecs::{AwakeVecs, CohortVecs, DormantVecs, Sources, Vecs}; diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/vecs.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs.rs deleted file mode 100644 index 5d3095ed0..000000000 --- a/crates/brk_computer/src/frameworks/cointime/aggregate/vecs.rs +++ /dev/null @@ -1,50 +0,0 @@ -use brk_traversable::Traversable; -use brk_types::{Cents, StoredF64}; -use vecdb::{Rw, StorageMode}; - -use crate::internal::{ - FiatPerBlock, LazyPerBlock, PerBlock, PriceWithRatioPerBlock, SpotValuePerBlock, -}; - -#[derive(Traversable)] -pub struct AllAwakeVecs { - pub supply: SpotValuePerBlock, - #[traversable(wrap = "supply/in_loss", rename = "share")] - pub supply_in_loss_share: LazyPerBlock, - pub cap: FiatPerBlock, - pub price: PriceWithRatioPerBlock, -} - -#[derive(Traversable)] -pub struct StoredAwakeVecs { - pub supply: SpotValuePerBlock, - #[traversable(wrap = "supply/in_loss", rename = "share")] - pub supply_in_loss_share: PerBlock, - pub cap: FiatPerBlock, - pub price: PriceWithRatioPerBlock, -} - -#[derive(Traversable)] -pub struct DormantVecs { - pub supply: SpotValuePerBlock, -} - -#[derive(Traversable)] -pub struct AllCohortVecs { - pub awake: AllAwakeVecs, - pub dormant: DormantVecs, -} - -#[derive(Traversable)] -pub struct StoredCohortVecs { - pub awake: StoredAwakeVecs, - pub dormant: DormantVecs, -} - -#[derive(Traversable)] -pub struct Vecs { - #[traversable(flatten)] - pub all: AllCohortVecs, - pub sth: StoredCohortVecs, - pub lth: StoredCohortVecs, -} diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/awake.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/awake.rs new file mode 100644 index 000000000..ab42239c4 --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/awake.rs @@ -0,0 +1,15 @@ +use brk_traversable::Traversable; +use brk_types::{Cents, StoredF64}; + +use crate::internal::{ + LazyFiatPerBlock, LazyPerBlock, LazyPriceWithRatioPerBlock, LazySpotValuePerBlock, +}; + +#[derive(Clone, Traversable)] +pub struct AwakeVecs { + pub supply: LazySpotValuePerBlock, + #[traversable(wrap = "supply/in_loss", rename = "share")] + pub supply_in_loss_share: LazyPerBlock, + pub cap: LazyFiatPerBlock, + pub price: LazyPriceWithRatioPerBlock, +} diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/cohort.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/cohort.rs new file mode 100644 index 000000000..32062c0b1 --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/cohort.rs @@ -0,0 +1,9 @@ +use brk_traversable::Traversable; + +use super::{AwakeVecs, DormantVecs}; + +#[derive(Clone, Traversable)] +pub struct CohortVecs { + pub awake: AwakeVecs, + pub dormant: DormantVecs, +} diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/collection.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/collection.rs new file mode 100644 index 000000000..12eccea4b --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/collection.rs @@ -0,0 +1,13 @@ +use brk_traversable::Traversable; +use vecdb::{Rw, StorageMode}; + +use super::{CohortVecs, Sources}; + +#[derive(Traversable)] +pub struct Vecs { + #[traversable(flatten)] + pub all: CohortVecs, + pub sth: CohortVecs, + pub lth: CohortVecs, + pub sources: Sources, +} diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/dormant.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/dormant.rs new file mode 100644 index 000000000..3c7c31b3d --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/dormant.rs @@ -0,0 +1,8 @@ +use brk_traversable::Traversable; + +use crate::internal::LazySpotValuePerBlock; + +#[derive(Clone, Traversable)] +pub struct DormantVecs { + pub supply: LazySpotValuePerBlock, +} diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/mod.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/mod.rs new file mode 100644 index 000000000..f4a81ae6e --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/mod.rs @@ -0,0 +1,11 @@ +mod awake; +mod cohort; +mod collection; +mod dormant; +mod sources; + +pub use awake::AwakeVecs; +pub use cohort::CohortVecs; +pub use collection::Vecs; +pub use dormant::DormantVecs; +pub use sources::Sources; diff --git a/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/sources.rs b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/sources.rs new file mode 100644 index 000000000..022a707c4 --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/aggregate/vecs/sources.rs @@ -0,0 +1,13 @@ +use brk_cohort::{TermId, UTXOAggregateId}; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, StoredF64}; +use vecdb::{ColumnarVec, EagerVec, PcoVec, Rw, StorageMode}; + +#[derive(Traversable)] +pub struct Sources { + pub awake_supply: M::Stored, TermId>>>, + pub dormant_supply: M::Stored, TermId>>>, + pub awake_cap: M::Stored, TermId>>>, + pub awake_price: M::Stored, UTXOAggregateId>>>, + pub supply_in_loss_share: M::Stored, TermId>>>, +} diff --git a/crates/brk_computer/src/frameworks/cointime/cap/compute.rs b/crates/brk_computer/src/frameworks/cointime/cap/compute.rs index b2d69181a..3db0dfc6a 100644 --- a/crates/brk_computer/src/frameworks/cointime/cap/compute.rs +++ b/crates/brk_computer/src/frameworks/cointime/cap/compute.rs @@ -17,9 +17,8 @@ impl Vecs { exit: &Exit, ) -> Result<()> { let starting_lengths = indexer.safe_lengths(); - let all_metrics = &distribution.utxo_cohorts.all.metrics; - let realized_cap_cents = &all_metrics.realized.cap.cents.height; - let circulating_supply = &all_metrics.supply.total.btc.height; + let realized_cap_cents = &distribution.cohorts.realized.cap.cohorts.all.cents.height; + let circulating_supply = &distribution.cohorts.supply.total.cohorts.all.btc.height; self.investor.cents.height.compute_subtract( starting_lengths.height, diff --git a/crates/brk_computer/src/frameworks/cointime/prices/compute.rs b/crates/brk_computer/src/frameworks/cointime/prices/compute.rs index 924bf16b2..f01f82b5c 100644 --- a/crates/brk_computer/src/frameworks/cointime/prices/compute.rs +++ b/crates/brk_computer/src/frameworks/cointime/prices/compute.rs @@ -20,8 +20,7 @@ impl Vecs { exit: &Exit, ) -> Result<()> { let starting_lengths = indexer.safe_lengths(); - let all_metrics = &distribution.utxo_cohorts.all.metrics; - let realized_price = &all_metrics.realized.price.cents.height; + let realized_price = &distribution.cohorts.realized.price.cohorts.all.cents.height; self.vaulted.cents.height.compute_transform2( starting_lengths.height, diff --git a/crates/brk_computer/src/frameworks/cointime/supply/vecs.rs b/crates/brk_computer/src/frameworks/cointime/supply/vecs/collection.rs similarity index 68% rename from crates/brk_computer/src/frameworks/cointime/supply/vecs.rs rename to crates/brk_computer/src/frameworks/cointime/supply/vecs/collection.rs index d850e7dc0..3550c32d6 100644 --- a/crates/brk_computer/src/frameworks/cointime/supply/vecs.rs +++ b/crates/brk_computer/src/frameworks/cointime/supply/vecs/collection.rs @@ -3,13 +3,9 @@ use brk_types::StoredF64; use derive_more::{Deref, DerefMut}; use vecdb::{Rw, StorageMode}; -use crate::internal::{LazySpotValuePerBlock, PerBlock}; +use crate::internal::PerBlock; -#[derive(Clone, Traversable)] -pub struct LazyBaseVecs { - pub vaulted: LazySpotValuePerBlock, - pub active: LazySpotValuePerBlock, -} +use super::LazyBaseVecs; #[derive(Deref, DerefMut, Traversable)] pub struct Vecs { diff --git a/crates/brk_computer/src/frameworks/cointime/supply/vecs/lazy_base.rs b/crates/brk_computer/src/frameworks/cointime/supply/vecs/lazy_base.rs new file mode 100644 index 000000000..ca3d31385 --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/supply/vecs/lazy_base.rs @@ -0,0 +1,9 @@ +use brk_traversable::Traversable; + +use crate::internal::LazySpotValuePerBlock; + +#[derive(Clone, Traversable)] +pub struct LazyBaseVecs { + pub vaulted: LazySpotValuePerBlock, + pub active: LazySpotValuePerBlock, +} diff --git a/crates/brk_computer/src/frameworks/cointime/supply/vecs/mod.rs b/crates/brk_computer/src/frameworks/cointime/supply/vecs/mod.rs new file mode 100644 index 000000000..82b9dee27 --- /dev/null +++ b/crates/brk_computer/src/frameworks/cointime/supply/vecs/mod.rs @@ -0,0 +1,5 @@ +mod collection; +mod lazy_base; + +pub use collection::Vecs; +pub(crate) use lazy_base::LazyBaseVecs; diff --git a/crates/brk_computer/src/frameworks/cointime/value/compute.rs b/crates/brk_computer/src/frameworks/cointime/value/compute.rs index 9aeda8555..d66573a63 100644 --- a/crates/brk_computer/src/frameworks/cointime/value/compute.rs +++ b/crates/brk_computer/src/frameworks/cointime/value/compute.rs @@ -17,10 +17,9 @@ impl Vecs { exit: &Exit, ) -> Result<()> { let starting_height = indexer.safe_lengths().height; - let all_metrics = &distribution.utxo_cohorts.all.metrics; let coinblocks_destroyed = &distribution.coinblocks_destroyed; - let coindays_destroyed = &all_metrics.activity.coindays_destroyed; - let circulating_supply = &all_metrics.supply.total.btc.height; + let coindays_destroyed = &distribution.cohorts.activity.coindays_destroyed.cohorts.all; + let circulating_supply = &distribution.cohorts.supply.total.cohorts.all.btc.height; self.destroyed .cumulative diff --git a/crates/brk_computer/src/frameworks/mod.rs b/crates/brk_computer/src/frameworks/mod.rs index 9eab224aa..8b94a3104 100644 --- a/crates/brk_computer/src/frameworks/mod.rs +++ b/crates/brk_computer/src/frameworks/mod.rs @@ -1,148 +1,11 @@ -use brk_types::{Cents, Sats, StoredF64}; -use vecdb::unlikely; - pub(crate) mod coinflow; pub(crate) mod cointime; mod compute; mod import; mod vecs; +mod weighted; pub use vecs::Vecs; +pub(crate) use weighted::{WeightedCohortContribution, WeightedCohortState, WeightedRatio}; pub const DB_NAME: &str = "frameworks"; - -#[derive(Clone, Copy, Default)] -pub(crate) struct WeightedRatio { - numerator: f64, - denominator: f64, -} - -impl WeightedRatio { - #[inline] - pub(crate) fn add(&mut self, numerator: f64, denominator: f64, weight: f64) { - if weight.is_finite() && weight > 0.0 { - self.numerator += numerator * weight; - self.denominator += denominator * weight; - } - } - - #[inline] - pub(crate) fn merge(&mut self, other: Self) { - self.numerator += other.numerator; - self.denominator += other.denominator; - } - - #[inline] - pub(crate) fn value(&self) -> StoredF64 { - if self.denominator > 0.0 { - StoredF64::from((self.numerator / self.denominator).clamp(0.0, 1.0)) - } else { - StoredF64::NAN - } - } -} - -#[derive(Clone, Copy)] -pub(crate) struct WeightedCohortContribution { - pub weighted_supply: Sats, - pub complement_supply: Sats, - pub weighted_cap: Cents, -} - -#[derive(Clone, Copy, Default)] -pub(crate) struct WeightedCohortState { - pub weighted_supply: Sats, - pub complement_supply: Sats, - pub weighted_cap: Cents, - pub supply_in_loss: WeightedRatio, -} - -impl WeightedCohortState { - #[inline] - pub(crate) fn split_supply(total: Sats, weight: StoredF64) -> (Sats, Sats) { - (weight * total, (StoredF64::from(1.0) - weight) * total) - } - - #[inline] - pub(crate) fn add( - &mut self, - total_supply: Sats, - loss_supply: Sats, - total_cap: Cents, - weight: StoredF64, - ) -> WeightedCohortContribution { - let (weighted_supply, complement_supply) = Self::split_supply(total_supply, weight); - let contribution = WeightedCohortContribution { - weighted_supply, - complement_supply, - weighted_cap: if total_supply.is_zero() { - Cents::ZERO - } else { - weight * total_cap - }, - }; - - self.weighted_supply += contribution.weighted_supply; - self.complement_supply += contribution.complement_supply; - self.weighted_cap += contribution.weighted_cap; - self.supply_in_loss.add( - loss_supply.as_u128() as f64, - total_supply.as_u128() as f64, - f64::from(weight), - ); - - contribution - } - - #[inline] - pub(crate) fn merged(mut self, other: Self) -> Self { - self.weighted_supply += other.weighted_supply; - self.complement_supply += other.complement_supply; - self.weighted_cap += other.weighted_cap; - self.supply_in_loss.merge(other.supply_in_loss); - self - } - - #[inline] - pub(crate) fn realized_price(&self) -> Cents { - if unlikely(self.weighted_cap.is_nan()) { - return Cents::NAN; - } - - (self.weighted_cap.as_u128() * Sats::ONE_BTC_U128) - .checked_div(self.weighted_supply.as_u128()) - .map(Cents::from) - .unwrap_or(Cents::ZERO) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn empty_nan_cap_contributes_zero() { - let mut state = WeightedCohortState::default(); - - let contribution = state.add(Sats::ZERO, Sats::ZERO, Cents::NAN, StoredF64::from(0.5)); - - assert_eq!(contribution.weighted_cap, Cents::ZERO); - assert_eq!(state.weighted_cap, Cents::ZERO); - assert_eq!(state.realized_price(), Cents::ZERO); - } - - #[test] - fn nonempty_nan_cap_remains_nan() { - let mut state = WeightedCohortState::default(); - - state.add( - Sats::from(100_u64), - Sats::ZERO, - Cents::NAN, - StoredF64::from(0.5), - ); - - assert!(state.weighted_cap.is_nan()); - assert!(state.realized_price().is_nan()); - } -} diff --git a/crates/brk_computer/src/frameworks/weighted/cohort_contribution.rs b/crates/brk_computer/src/frameworks/weighted/cohort_contribution.rs new file mode 100644 index 000000000..d0e77fb55 --- /dev/null +++ b/crates/brk_computer/src/frameworks/weighted/cohort_contribution.rs @@ -0,0 +1,8 @@ +use brk_types::{Cents, Sats}; + +#[derive(Clone, Copy)] +pub(crate) struct WeightedCohortContribution { + pub weighted_supply: Sats, + pub complement_supply: Sats, + pub weighted_cap: Cents, +} diff --git a/crates/brk_computer/src/frameworks/weighted/cohort_state.rs b/crates/brk_computer/src/frameworks/weighted/cohort_state.rs new file mode 100644 index 000000000..dc6b4661f --- /dev/null +++ b/crates/brk_computer/src/frameworks/weighted/cohort_state.rs @@ -0,0 +1,102 @@ +use brk_types::{Cents, Sats, StoredF64}; +use vecdb::unlikely; + +use super::{WeightedCohortContribution, WeightedRatio}; + +#[derive(Clone, Copy, Default)] +pub(crate) struct WeightedCohortState { + pub weighted_supply: Sats, + pub complement_supply: Sats, + pub weighted_cap: Cents, + pub supply_in_loss: WeightedRatio, +} + +impl WeightedCohortState { + #[inline] + pub(crate) fn split_supply(total: Sats, weight: StoredF64) -> (Sats, Sats) { + (weight * total, (StoredF64::from(1.0) - weight) * total) + } + + #[inline] + pub(crate) fn add( + &mut self, + total_supply: Sats, + loss_supply: Sats, + total_cap: Cents, + weight: StoredF64, + ) -> WeightedCohortContribution { + let (weighted_supply, complement_supply) = Self::split_supply(total_supply, weight); + let contribution = WeightedCohortContribution { + weighted_supply, + complement_supply, + weighted_cap: if total_supply.is_zero() { + Cents::ZERO + } else { + weight * total_cap + }, + }; + + self.weighted_supply += contribution.weighted_supply; + self.complement_supply += contribution.complement_supply; + self.weighted_cap += contribution.weighted_cap; + self.supply_in_loss.add( + loss_supply.as_u128() as f64, + total_supply.as_u128() as f64, + f64::from(weight), + ); + + contribution + } + + #[inline] + pub(crate) fn merged(mut self, other: Self) -> Self { + self.weighted_supply += other.weighted_supply; + self.complement_supply += other.complement_supply; + self.weighted_cap += other.weighted_cap; + self.supply_in_loss.merge(other.supply_in_loss); + self + } + + #[inline] + pub(crate) fn realized_price(&self) -> Cents { + if unlikely(self.weighted_cap.is_nan()) { + return Cents::NAN; + } + + (self.weighted_cap.as_u128() * Sats::ONE_BTC_U128) + .checked_div(self.weighted_supply.as_u128()) + .map(Cents::from) + .unwrap_or(Cents::ZERO) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn empty_nan_cap_contributes_zero() { + let mut state = WeightedCohortState::default(); + + let contribution = state.add(Sats::ZERO, Sats::ZERO, Cents::NAN, StoredF64::from(0.5)); + + assert_eq!(contribution.weighted_cap, Cents::ZERO); + assert_eq!(state.weighted_cap, Cents::ZERO); + assert_eq!(state.realized_price(), Cents::ZERO); + } + + #[test] + fn nonempty_nan_cap_remains_nan() { + let mut state = WeightedCohortState::default(); + + state.add( + Sats::from(100_u64), + Sats::ZERO, + Cents::NAN, + StoredF64::from(0.5), + ); + + assert!(state.weighted_cap.is_nan()); + assert!(state.realized_price().is_nan()); + } +} diff --git a/crates/brk_computer/src/frameworks/weighted/mod.rs b/crates/brk_computer/src/frameworks/weighted/mod.rs new file mode 100644 index 000000000..498288959 --- /dev/null +++ b/crates/brk_computer/src/frameworks/weighted/mod.rs @@ -0,0 +1,7 @@ +mod cohort_contribution; +mod cohort_state; +mod ratio; + +pub(crate) use cohort_contribution::WeightedCohortContribution; +pub(crate) use cohort_state::WeightedCohortState; +pub(crate) use ratio::WeightedRatio; diff --git a/crates/brk_computer/src/frameworks/weighted/ratio.rs b/crates/brk_computer/src/frameworks/weighted/ratio.rs new file mode 100644 index 000000000..82ad0579d --- /dev/null +++ b/crates/brk_computer/src/frameworks/weighted/ratio.rs @@ -0,0 +1,32 @@ +use brk_types::StoredF64; + +#[derive(Clone, Copy, Default)] +pub(crate) struct WeightedRatio { + numerator: f64, + denominator: f64, +} + +impl WeightedRatio { + #[inline] + pub(crate) fn add(&mut self, numerator: f64, denominator: f64, weight: f64) { + if weight.is_finite() && weight > 0.0 { + self.numerator += numerator * weight; + self.denominator += denominator * weight; + } + } + + #[inline] + pub(crate) fn merge(&mut self, other: Self) { + self.numerator += other.numerator; + self.denominator += other.denominator; + } + + #[inline] + pub(crate) fn value(&self) -> StoredF64 { + if self.denominator > 0.0 { + StoredF64::from((self.numerator / self.denominator).clamp(0.0, 1.0)) + } else { + StoredF64::NAN + } + } +} diff --git a/crates/brk_computer/src/indicators/compute.rs b/crates/brk_computer/src/indicators/compute.rs index f168e29c5..e6bfd029b 100644 --- a/crates/brk_computer/src/indicators/compute.rs +++ b/crates/brk_computer/src/indicators/compute.rs @@ -37,30 +37,33 @@ impl Vecs { self.rhodl_ratio.ppm.height.compute_transform3( starting_lengths.height, &distribution - .utxo_cohorts - .age_range + .cohorts + .realized + .cap + .cohorts + .age + .range ._1d_to_1w - .metrics - .realized - .cap .usd .height, &distribution - .utxo_cohorts - .age_range + .cohorts + .realized + .cap + .cohorts + .age + .range ._1y_to_18m - .metrics - .realized - .cap .usd .height, &distribution - .utxo_cohorts - .age_range - ._18m_to_2y - .metrics + .cohorts .realized .cap + .cohorts + .age + .range + ._18m_to_2y .usd .height, |(i, young_cap, year1_cap, month18_cap, ..)| { @@ -78,13 +81,13 @@ impl Vecs { exit, )?; - let all_metrics = &distribution.utxo_cohorts.all.metrics; - let supply_total_sats = &all_metrics.supply.total.sats.height; + let supply = &distribution.cohorts.supply; + let supply_total_sats = &supply.total.cohorts.all.sats.height; // Seller Exhaustion Constant: % supply_in_profit × 30d_volatility self.seller_exhaustion.height.compute_transform3( starting_lengths.height, - &all_metrics.supply.in_profit.sats.height, + &supply.in_profit.cohorts.all.sats.height, &market.volatility._1m.height, supply_total_sats, |(i, profit_sats, volatility, total_sats, ..)| { diff --git a/crates/brk_computer/src/indicators/gini.rs b/crates/brk_computer/src/indicators/gini.rs index 55dc9104e..c00acbcc3 100644 --- a/crates/brk_computer/src/indicators/gini.rs +++ b/crates/brk_computer/src/indicators/gini.rs @@ -12,16 +12,17 @@ pub(super) fn compute( exit: &Exit, ) -> Result<()> { let starting_height = indexer.safe_lengths().height; - let amount_range = &distribution.utxo_cohorts.amount_range; + let supply = &distribution.cohorts.supply.total.cohorts.utxo_amount.range; + let count = &distribution + .cohorts + .outputs + .unspent_count + .cohorts + .utxo_amount + .range; - let supply_vecs: Vec<&_> = amount_range - .iter() - .map(|c| &c.metrics.supply.total.sats.height) - .collect(); - let count_vecs: Vec<&_> = amount_range - .iter() - .map(|c| &c.metrics.outputs.unspent_count.height) - .collect(); + let supply_vecs: Vec<&_> = supply.iter().map(|cohort| &cohort.sats.height).collect(); + let count_vecs: Vec<&_> = count.iter().map(|cohort| &cohort.height).collect(); if supply_vecs.is_empty() || supply_vecs.len() != count_vecs.len() { return Ok(()); diff --git a/crates/brk_computer/src/indicators/import.rs b/crates/brk_computer/src/indicators/import.rs index 61c95a92a..80fc1d819 100644 --- a/crates/brk_computer/src/indicators/import.rs +++ b/crates/brk_computer/src/indicators/import.rs @@ -52,11 +52,11 @@ impl Vecs { indexes, ); - let all_activity = &distribution.utxo_cohorts.all.metrics.activity; + let activity = &distribution.cohorts.activity; let cdd_source = all_chain.with_supply( "coindays_destroyed_supply_adj_source", v, - &all_activity.coindays_destroyed.sum._24h.height, + &activity.coindays_destroyed.cohorts.all.sum._24h.height, |_, cdd, supply| Self::supply_adjusted(f64::from(cdd), supply), ); let coindays_destroyed_supply_adj = @@ -69,7 +69,7 @@ impl Vecs { let cyd_source = all_chain.with_supply( "coinyears_destroyed_supply_adj_source", v, - &all_activity.coinyears_destroyed.height, + &activity.coinyears_destroyed.all.height, |_, cyd, supply| Self::supply_adjusted(f64::from(cyd), supply), ); let coinyears_destroyed_supply_adj = @@ -79,7 +79,7 @@ impl Vecs { cyd_source, indexes, ); - let dormancy_24h = &all_activity.dormancy._24h.height; + let dormancy_24h = &activity.dormancy.all._24h.height; let dormancy_supply_source = all_chain.with_supply( "dormancy_supply_adj_source", v, diff --git a/crates/brk_computer/src/inputs/by_type/with_input_types.rs b/crates/brk_computer/src/inputs/by_type/with_input_types.rs index 15f17427b..066737aa5 100644 --- a/crates/brk_computer/src/inputs/by_type/with_input_types.rs +++ b/crates/brk_computer/src/inputs/by_type/with_input_types.rs @@ -5,8 +5,8 @@ use brk_cohort::{ByAddrType, Filter, SpendableType, SpendableTypeId}; use brk_traversable::Traversable; use brk_types::{Height, PartsPerMillion32, StoredU16, StoredU64, Version}; use vecdb::{ - CachedBoxedVec, CachedReadableVec, PcoVec, ReadOnlyColumnarVec, ReadableCloneableVec, - ReadableVec, TypedVec, + CachedBoxedVec, CachedReadableVec, CachedVec, PcoVec, ReadOnlyColumnarVec, + ReadableCloneableVec, ReadableVec, TypedVec, }; use crate::{ @@ -25,8 +25,6 @@ pub struct WithInputTypes { pub all: LazyPerBlockCumulativeRolling, #[traversable(skip)] cached_all: CachedBoxedVec, - #[traversable(skip)] - all_transform: fn(Height, StoredU64) -> StoredU64, #[traversable(flatten)] pub by_type: SpendableType, } @@ -47,18 +45,18 @@ impl WithInputTypes { + Clone + 'static, { - let cached_all = all_source.cached_boxed_clone(); - Self { - all: LazyPerBlockCumulativeRolling::from_uncached_indexed_source( - all_name, - version, - &all_source, - all_transform, - cached_starts, - indexes, - ), - cached_all, + let all = LazyPerBlockCumulativeRolling::from_uncached_indexed_source( + all_name, + version, + &all_source, all_transform, + cached_starts, + indexes, + ); + let cached_all = CachedVec::wrap(all.cumulative.height.clone()).cached_boxed_clone(); + Self { + all, + cached_all, by_type, } } @@ -71,7 +69,7 @@ impl WithInputTypes { cached_starts: &Windows<&CachedWindowStartVec>, indexes: &indexes::Vecs, ) -> LazyPercentCumulativeRolling { - LazyPercentCumulativeRolling::from_cumulative_ratio_with_denominator_transform::< + LazyPercentCumulativeRolling::from_cumulative_ratio::< StoredU64, StoredU64, RatioU64, @@ -80,7 +78,6 @@ impl WithInputTypes { version, numerator, self.cached_all.clone(), - self.all_transform, cached_starts, indexes, ) diff --git a/crates/brk_computer/src/internal/containers/mod.rs b/crates/brk_computer/src/internal/containers/mod.rs index 91e0aa0b6..94dffe15d 100644 --- a/crates/brk_computer/src/internal/containers/mod.rs +++ b/crates/brk_computer/src/internal/containers/mod.rs @@ -2,7 +2,6 @@ mod constant; mod distribution_stats; mod per_resolution; mod percent; -mod window_24h; mod windows; mod windows_from_1w; mod windows_to_1m; @@ -11,7 +10,6 @@ pub use constant::*; pub use distribution_stats::*; pub use per_resolution::*; pub use percent::*; -pub use window_24h::*; pub use windows::*; pub use windows_from_1w::*; pub use windows_to_1m::*; diff --git a/crates/brk_computer/src/internal/containers/window_24h.rs b/crates/brk_computer/src/internal/containers/window_24h.rs deleted file mode 100644 index 5f6069997..000000000 --- a/crates/brk_computer/src/internal/containers/window_24h.rs +++ /dev/null @@ -1,7 +0,0 @@ -use brk_traversable::Traversable; - -/// Generic single-24h-window container. -#[derive(Traversable)] -pub struct RollingWindow24h { - pub _24h: Inner, -} diff --git a/crates/brk_computer/src/internal/per_block/computed/columnar/base.rs b/crates/brk_computer/src/internal/per_block/computed/columnar/base.rs index dda8aebb0..2652ceadb 100644 --- a/crates/brk_computer/src/internal/per_block/computed/columnar/base.rs +++ b/crates/brk_computer/src/internal/per_block/computed/columnar/base.rs @@ -82,10 +82,11 @@ where V1: ReadableVec + 'a, V2: ReadableVec + 'a, { - let dependency_version = C::ALL - .iter() - .flat_map(|&column| [source1(column).version(), source2(column).version()]) - .sum(); + let dependency_version = Version::combine_all( + C::ALL + .iter() + .flat_map(|&column| [source1(column).version(), source2(column).version()]), + ); let source_end = C::ALL .iter() .flat_map(|&column| [source1(column).len(), source2(column).len()]) @@ -141,11 +142,12 @@ where V1: ReadableVec>, V2: ReadableVec + 'a, { - let dependency_version = C::ALL - .iter() - .map(|&column| source2(column).version()) - .sum::() - + source1.version(); + let dependency_version = Version::combine_all( + C::ALL + .iter() + .map(|&column| source2(column).version()) + .chain(std::iter::once(source1.version())), + ); let source_end = C::ALL .iter() .map(|&column| source2(column).len()) diff --git a/crates/brk_computer/src/internal/per_block/computed/columnar/cumulative_rolling.rs b/crates/brk_computer/src/internal/per_block/computed/columnar/cumulative_rolling.rs index b9e505b04..6a34960cb 100644 --- a/crates/brk_computer/src/internal/per_block/computed/columnar/cumulative_rolling.rs +++ b/crates/brk_computer/src/internal/per_block/computed/columnar/cumulative_rolling.rs @@ -100,7 +100,8 @@ where V: ReadableVec + 'a, U: VecValue + Into, { - let dependency_version = C::ALL.iter().map(|&column| source(column).version()).sum(); + let dependency_version = + Version::combine_all(C::ALL.iter().map(|&column| source(column).version())); let source_end = C::ALL .iter() .map(|&column| source(column).len()) @@ -146,6 +147,67 @@ where .map(|row| (len, row)); Ok(()) } + + /// Computes one cumulative matrix from two scalar sources per column. + pub(crate) fn compute_columns2<'a, A, B, V1, V2>( + &mut self, + max_from: Height, + source1: impl Fn(C) -> &'a V1, + source2: impl Fn(C) -> &'a V2, + mut transform: impl FnMut(C, A, B) -> T, + exit: &Exit, + ) -> Result<()> + where + A: VecValue, + B: VecValue, + V1: ReadableVec + 'a, + V2: ReadableVec + 'a, + { + let dependency_version = Version::combine_all( + C::ALL + .iter() + .flat_map(|&column| [source1(column).version(), source2(column).version()]), + ); + let source_end = C::ALL + .iter() + .flat_map(|&column| [source1(column).len(), source2(column).len()]) + .min() + .unwrap_or_default(); + + self.cumulative + .validate_computed_version_or_reset(dependency_version)?; + self.cumulative.truncate_if_needed(max_from)?; + self.last_cumulative = None; + self.cumulative.repeat_until_complete(exit, |target| { + let start = target.len(); + let end = target.batch_end(source_end); + if start >= end { + return Ok(()); + } + + let source1_batches: Vec<_> = C::ALL + .iter() + .map(|&column| source1(column).collect_range_at(start, end)) + .collect(); + let source2_batches: Vec<_> = C::ALL + .iter() + .map(|&column| source2(column).collect_range_at(start, end)) + .collect(); + for offset in 0..(end - start) { + target.push(C::from_fn(|column| { + transform( + column, + source1_batches[column.index()][offset].clone(), + source2_batches[column.index()][offset].clone(), + ) + })); + } + + Ok(()) + })?; + + Ok(()) + } } #[cfg(test)] diff --git a/crates/brk_computer/src/internal/per_block/computed/lazy_cumulative_rolling.rs b/crates/brk_computer/src/internal/per_block/computed/lazy_cumulative_rolling.rs index f87f11d8b..a7904592e 100644 --- a/crates/brk_computer/src/internal/per_block/computed/lazy_cumulative_rolling.rs +++ b/crates/brk_computer/src/internal/per_block/computed/lazy_cumulative_rolling.rs @@ -3,7 +3,7 @@ use brk_traversable::Traversable; use brk_types::{Height, Version}; use schemars::JsonSchema; -use vecdb::{ColumnId, ReadableCloneableVec, ReadableVec, TypedVec, VecValue}; +use vecdb::{ColumnId, ReadableBoxedVec, ReadableCloneableVec, ReadableVec, TypedVec, VecValue}; use crate::{ indexes, @@ -99,6 +99,23 @@ where Self::from_cumulative(name, version, cumulative, cached_starts, indexes) } + pub(crate) fn from_boxed_cumulative_source( + name: &str, + version: Version, + source: ReadableBoxedVec, + cached_starts: &Windows<&CachedWindowStartVec>, + indexes: &indexes::Vecs, + ) -> Self { + let cumulative = LazyPerBlock::from_uncached_boxed_height_source::>( + &format!("{name}_cumulative"), + version, + source, + indexes, + ); + + Self::from_cumulative(name, version, cumulative, cached_starts, indexes) + } + pub(crate) fn from_lazy_source( name: &str, version: Version, diff --git a/crates/brk_computer/src/internal/per_block/computed/resolutions.rs b/crates/brk_computer/src/internal/per_block/computed/resolutions.rs index 169f96467..4a87ebd55 100644 --- a/crates/brk_computer/src/internal/per_block/computed/resolutions.rs +++ b/crates/brk_computer/src/internal/per_block/computed/resolutions.rs @@ -153,6 +153,15 @@ where ) } + pub(crate) fn forced_import_uncached_boxed( + name: &str, + height_source: ReadableBoxedVec, + version: Version, + indexes: &indexes::Vecs, + ) -> Self { + Self::from_boxed_height_source(name, height_source, version, indexes) + } + fn from_boxed_height_source( name: &str, height_source: ReadableBoxedVec, diff --git a/crates/brk_computer/src/internal/per_block/computed/with_deltas.rs b/crates/brk_computer/src/internal/per_block/computed/with_deltas.rs index dccdbcf40..0a1b4d506 100644 --- a/crates/brk_computer/src/internal/per_block/computed/with_deltas.rs +++ b/crates/brk_computer/src/internal/per_block/computed/with_deltas.rs @@ -1,20 +1,19 @@ -use brk_error::Result; use brk_traversable::Traversable; -use brk_types::Version; +use brk_types::{Height, Version}; use derive_more::{Deref, DerefMut}; use schemars::JsonSchema; -use vecdb::{Rw, StorageMode}; +use vecdb::ReadableBoxedVec; use crate::{ indexes, internal::{ - CachedWindowStartVec, FixedRatio, LazyRollingDeltasFromHeight, NumericValue, PerBlock, - Windows, + CachedWindowStartVec, FixedRatio, Identity, LazyPerBlock, LazyRollingDeltasFromHeight, + NumericValue, Windows, }, }; -#[derive(Deref, DerefMut, Traversable)] -pub struct PerBlockWithDeltas +#[derive(Clone, Deref, DerefMut, Traversable)] +pub struct LazyPerBlockWithDeltas where S: NumericValue + JsonSchema + Into, C: NumericValue + JsonSchema + From, @@ -22,26 +21,27 @@ where { #[deref] #[deref_mut] - pub base: PerBlock, + pub base: LazyPerBlock, pub delta: LazyRollingDeltasFromHeight, } -impl PerBlockWithDeltas +impl LazyPerBlockWithDeltas where S: NumericValue + JsonSchema + Into, C: NumericValue + JsonSchema + From, B: FixedRatio + From, { - pub(crate) fn forced_import( - db: &vecdb::Database, + pub(crate) fn from_boxed_height_source( name: &str, version: Version, + source: ReadableBoxedVec, delta_version_offset: Version, indexes: &indexes::Vecs, cached_starts: &Windows<&CachedWindowStartVec>, - ) -> Result { - let base = PerBlock::forced_import(db, name, version, indexes)?; - + ) -> Self { + let base = LazyPerBlock::from_uncached_boxed_height_source::>( + name, version, source, indexes, + ); let delta = LazyRollingDeltasFromHeight::new( &format!("{name}_delta"), version + delta_version_offset, @@ -49,7 +49,6 @@ where cached_starts, indexes, ); - - Ok(Self { base, delta }) + Self { base, delta } } } diff --git a/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum.rs b/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum.rs deleted file mode 100644 index 3af5047ec..000000000 --- a/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum.rs +++ /dev/null @@ -1,124 +0,0 @@ -use brk_error::Result; -use brk_traversable::Traversable; -use brk_types::{Height, Version}; -use vecdb::{ - AnyStoredVec, AnyVec, Database, Exit, ReadableVec, Rw, StorageMode, VecValue, WritableVec, -}; - -use crate::{ - indexes, - internal::{ - CachedWindowStartVec, FiatPerBlock, FiatType, LazyFiatBlock, LazyRollingSumsFiatFromHeight, - Windows, - }, -}; - -#[derive(Traversable)] -pub struct FiatPerBlockCumulativeWithSums { - pub block: LazyFiatBlock, - pub cumulative: FiatPerBlock, - pub sum: LazyRollingSumsFiatFromHeight, - #[traversable(skip)] - last_cumulative: Option<(usize, C)>, -} - -const VERSION: Version = Version::ONE; - -impl FiatPerBlockCumulativeWithSums { - pub(crate) fn forced_import( - db: &Database, - name: &str, - version: Version, - indexes: &indexes::Vecs, - cached_starts: &Windows<&CachedWindowStartVec>, - ) -> Result { - let v = version + VERSION; - let cumulative = - FiatPerBlock::forced_import(db, &format!("{name}_cumulative"), v, indexes)?; - let last_cumulative = cumulative - .cents - .height - .collect_last() - .map(|value| (cumulative.cents.height.len(), value)); - let block = LazyFiatBlock::from_cumulative(name, v, &cumulative); - let sum = LazyRollingSumsFiatFromHeight::new( - &format!("{name}_sum"), - v, - &cumulative.cents.height, - cached_starts, - indexes, - ); - Ok(Self { - block, - cumulative, - sum, - last_cumulative, - }) - } - - #[inline(always)] - pub(crate) fn push_block(&mut self, value: C) - where - C: Copy, - { - let len = self.cumulative.cents.height.len(); - let mut cumulative = match self.last_cumulative { - Some((cached_len, value)) if cached_len == len => value, - _ => self - .cumulative - .cents - .height - .collect_last() - .unwrap_or_default(), - }; - cumulative += value; - self.cumulative.cents.height.push(cumulative); - self.last_cumulative = Some((len + 1, cumulative)); - } - - pub(crate) fn compute_from_cumulative_pair( - &mut self, - max_from: Height, - source1: &impl ReadableVec, - source2: &impl ReadableVec, - mut transform: impl FnMut(Height, S1, S2) -> C, - exit: &Exit, - ) -> Result<()> - where - S1: VecValue, - S2: VecValue, - { - self.cumulative.cents.height.compute_transform2( - max_from, - source1, - source2, - |(height, value1, value2, ..)| (height, transform(height, value1, value2)), - exit, - )?; - self.last_cumulative = None; - Ok(()) - } - - pub(crate) fn compute_sum_of_others( - &mut self, - max_from: Height, - others: &[&Self], - exit: &Exit, - ) -> Result<()> { - self.cumulative.cents.height.compute_sum_of_others( - max_from, - &others - .iter() - .map(|v| &v.cumulative.cents.height) - .collect::>(), - exit, - )?; - self.last_cumulative = None; - Ok(()) - } - - pub(crate) fn stored_mut(&mut self) -> &mut dyn AnyStoredVec { - self.last_cumulative = None; - &mut self.cumulative.cents.height - } -} diff --git a/crates/brk_computer/src/internal/per_block/fiat/lazy.rs b/crates/brk_computer/src/internal/per_block/fiat/lazy.rs index 0ef29d1d8..7dd3a19be 100644 --- a/crates/brk_computer/src/internal/per_block/fiat/lazy.rs +++ b/crates/brk_computer/src/internal/per_block/fiat/lazy.rs @@ -1,7 +1,11 @@ use brk_traversable::Traversable; -use brk_types::{Dollars, Version}; +use brk_types::{Dollars, Height, Version}; +use vecdb::ReadableBoxedVec; -use crate::internal::{FiatType, Identity, LazyPerBlock, NumericValue}; +use crate::{ + indexes, + internal::{FiatType, Identity, LazyPerBlock, NumericValue}, +}; /// Lazy fiat: both cents and usd are lazy views of a stored source. /// Zero extra stored vecs. @@ -21,4 +25,22 @@ impl LazyFiatPerBlock { let usd = LazyPerBlock::from_lazy::(name, version, source); Self { usd, cents } } + + pub(crate) fn from_boxed_cents_source( + name: &str, + version: Version, + source: ReadableBoxedVec, + indexes: &indexes::Vecs, + ) -> Self + where + C: NumericValue, + { + let source = LazyPerBlock::from_uncached_boxed_height_source::>( + &format!("{name}_cents"), + version, + source, + indexes, + ); + Self::from_lazy(name, version, &source) + } } diff --git a/crates/brk_computer/src/internal/per_block/fiat/lazy_block.rs b/crates/brk_computer/src/internal/per_block/fiat/lazy_block.rs index 8428b74c4..41969f487 100644 --- a/crates/brk_computer/src/internal/per_block/fiat/lazy_block.rs +++ b/crates/brk_computer/src/internal/per_block/fiat/lazy_block.rs @@ -2,7 +2,7 @@ use brk_traversable::Traversable; use brk_types::{Dollars, Height, Version}; use vecdb::{LazyVec, ReadableCloneableVec}; -use crate::internal::{FiatPerBlock, FiatType, LazyPreviousDeltaVec}; +use crate::internal::{FiatType, LazyPerBlock, LazyPreviousDeltaVec}; /// Per-block fiat data derived from stored cumulative cents. #[derive(Clone, Traversable)] @@ -12,19 +12,18 @@ pub struct LazyFiatBlock { } impl LazyFiatBlock { - pub(crate) fn from_cumulative( + pub(crate) fn from_cumulative_source( name: &str, version: Version, - cumulative: &FiatPerBlock, + cumulative: &LazyPerBlock, ) -> Self { let cents = LazyPreviousDeltaVec::new( &format!("{name}_cents"), version, - cumulative.cents.height.read_only_boxed_clone(), + cumulative.height.read_only_boxed_clone(), ); let usd = LazyVec::transformed::(name, version, cents.read_only_boxed_clone()); - Self { usd, cents } } } diff --git a/crates/brk_computer/src/internal/per_block/fiat/lazy_cumulative_sum.rs b/crates/brk_computer/src/internal/per_block/fiat/lazy_cumulative_sum.rs new file mode 100644 index 000000000..94a39e3d3 --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/fiat/lazy_cumulative_sum.rs @@ -0,0 +1,50 @@ +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use vecdb::ReadableBoxedVec; + +use crate::{ + indexes, + internal::{ + CachedWindowStartVec, FiatType, Identity, LazyFiatBlock, LazyFiatPerBlock, LazyPerBlock, + LazyRollingSumsFiatFromHeight, Windows, + }, +}; + +#[derive(Clone, Traversable)] +pub struct LazyFiatPerBlockCumulativeWithSums { + pub block: LazyFiatBlock, + pub cumulative: LazyFiatPerBlock, + pub sum: LazyRollingSumsFiatFromHeight, +} + +impl LazyFiatPerBlockCumulativeWithSums { + pub(crate) fn from_boxed_cumulative_cents_source( + name: &str, + version: Version, + source: ReadableBoxedVec, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Self { + let source = LazyPerBlock::from_uncached_boxed_height_source::>( + &format!("{name}_cumulative_cents"), + version, + source, + indexes, + ); + let cumulative = + LazyFiatPerBlock::from_lazy(&format!("{name}_cumulative"), version, &source); + let block = LazyFiatBlock::from_cumulative_source(name, version, &source); + let sum = LazyRollingSumsFiatFromHeight::new( + &format!("{name}_sum"), + version, + &source.height, + cached_starts, + indexes, + ); + Self { + block, + cumulative, + sum, + } + } +} diff --git a/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum_with_deltas.rs b/crates/brk_computer/src/internal/per_block/fiat/lazy_cumulative_sum_with_deltas.rs similarity index 56% rename from crates/brk_computer/src/internal/per_block/fiat/cumulative_sum_with_deltas.rs rename to crates/brk_computer/src/internal/per_block/fiat/lazy_cumulative_sum_with_deltas.rs index c2ab8bb6d..ec3e1a408 100644 --- a/crates/brk_computer/src/internal/per_block/fiat/cumulative_sum_with_deltas.rs +++ b/crates/brk_computer/src/internal/per_block/fiat/lazy_cumulative_sum_with_deltas.rs @@ -1,18 +1,18 @@ -use brk_error::Result; use brk_traversable::Traversable; -use brk_types::Version; +use brk_types::{Height, Version}; use derive_more::{Deref, DerefMut}; -use vecdb::{Database, Rw, StorageMode}; +use vecdb::ReadableBoxedVec; use crate::{ indexes, - internal::{CachedWindowStartVec, FixedRatio, LazyRollingDeltasFiatFromHeight, Windows}, + internal::{ + CachedWindowStartVec, FiatType, FixedRatio, LazyFiatPerBlockCumulativeWithSums, + LazyRollingDeltasFiatFromHeight, Windows, + }, }; -use super::{FiatPerBlockCumulativeWithSums, FiatType}; - -#[derive(Deref, DerefMut, Traversable)] -pub struct FiatPerBlockCumulativeWithSumsAndDeltas +#[derive(Clone, Deref, DerefMut, Traversable)] +pub struct LazyFiatPerBlockCumulativeWithSumsAndDeltas where C: FiatType + Into, CS: FiatType + From, @@ -21,32 +21,31 @@ where #[deref] #[deref_mut] #[traversable(flatten)] - pub inner: FiatPerBlockCumulativeWithSums, + pub inner: LazyFiatPerBlockCumulativeWithSums, pub delta: LazyRollingDeltasFiatFromHeight, } -impl FiatPerBlockCumulativeWithSumsAndDeltas +impl LazyFiatPerBlockCumulativeWithSumsAndDeltas where C: FiatType + Into, CS: FiatType + From, B: FixedRatio + From, { - pub(crate) fn forced_import( - db: &Database, + pub(crate) fn from_boxed_cumulative_cents_source( name: &str, version: Version, + source: ReadableBoxedVec, delta_version_offset: Version, indexes: &indexes::Vecs, cached_starts: &Windows<&CachedWindowStartVec>, - ) -> Result { - let inner = FiatPerBlockCumulativeWithSums::forced_import( - db, + ) -> Self { + let inner = LazyFiatPerBlockCumulativeWithSums::from_boxed_cumulative_cents_source( name, version, + source, indexes, cached_starts, - )?; - + ); let delta = LazyRollingDeltasFiatFromHeight::new( &format!("{name}_delta"), version + delta_version_offset, @@ -54,7 +53,6 @@ where cached_starts, indexes, ); - - Ok(Self { inner, delta }) + Self { inner, delta } } } diff --git a/crates/brk_computer/src/internal/per_block/fiat/lazy_with_deltas.rs b/crates/brk_computer/src/internal/per_block/fiat/lazy_with_deltas.rs new file mode 100644 index 000000000..f943313d0 --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/fiat/lazy_with_deltas.rs @@ -0,0 +1,59 @@ +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use derive_more::{Deref, DerefMut}; +use schemars::JsonSchema; +use vecdb::ReadableBoxedVec; + +use crate::{ + indexes, + internal::{ + CachedWindowStartVec, FiatType, FixedRatio, Identity, LazyFiatPerBlock, LazyPerBlock, + LazyRollingDeltasFiatFromHeight, Windows, + }, +}; + +#[derive(Clone, Deref, DerefMut, Traversable)] +pub struct LazyFiatPerBlockWithDeltas +where + C: FiatType + Into, + CS: FiatType + From, + B: FixedRatio + From, +{ + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub inner: LazyFiatPerBlock, + pub delta: LazyRollingDeltasFiatFromHeight, +} + +impl LazyFiatPerBlockWithDeltas +where + C: FiatType + JsonSchema + Into, + CS: FiatType + From, + B: FixedRatio + From, +{ + pub(crate) fn from_boxed_cents_source( + name: &str, + version: Version, + source: ReadableBoxedVec, + delta_version_offset: Version, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Self { + let source = LazyPerBlock::from_uncached_boxed_height_source::>( + &format!("{name}_cents"), + version, + source, + indexes, + ); + let inner = LazyFiatPerBlock::from_lazy(name, version, &source); + let delta = LazyRollingDeltasFiatFromHeight::new( + &format!("{name}_delta"), + version + delta_version_offset, + &source.height, + cached_starts, + indexes, + ); + Self { inner, delta } + } +} diff --git a/crates/brk_computer/src/internal/per_block/fiat/mod.rs b/crates/brk_computer/src/internal/per_block/fiat/mod.rs index 0c69d1a01..445adc101 100644 --- a/crates/brk_computer/src/internal/per_block/fiat/mod.rs +++ b/crates/brk_computer/src/internal/per_block/fiat/mod.rs @@ -1,14 +1,14 @@ mod base; -mod cumulative_sum; -mod cumulative_sum_with_deltas; mod lazy; mod lazy_block; +mod lazy_cumulative_sum; +mod lazy_cumulative_sum_with_deltas; mod lazy_rolling_sum; -mod with_deltas; +mod lazy_with_deltas; pub use base::*; -pub use cumulative_sum::*; -pub use cumulative_sum_with_deltas::*; pub use lazy::*; pub use lazy_block::*; +pub use lazy_cumulative_sum::*; +pub use lazy_cumulative_sum_with_deltas::*; pub use lazy_rolling_sum::*; -pub use with_deltas::*; +pub use lazy_with_deltas::*; diff --git a/crates/brk_computer/src/internal/per_block/fiat/with_deltas.rs b/crates/brk_computer/src/internal/per_block/fiat/with_deltas.rs deleted file mode 100644 index cbf99f63e..000000000 --- a/crates/brk_computer/src/internal/per_block/fiat/with_deltas.rs +++ /dev/null @@ -1,55 +0,0 @@ -use brk_error::Result; -use brk_traversable::Traversable; -use brk_types::Version; -use derive_more::{Deref, DerefMut}; -use schemars::JsonSchema; -use vecdb::{Database, Rw, StorageMode}; - -use crate::{ - indexes, - internal::{CachedWindowStartVec, FixedRatio, LazyRollingDeltasFiatFromHeight, Windows}, -}; - -use super::{FiatPerBlock, FiatType}; - -#[derive(Deref, DerefMut, Traversable)] -pub struct FiatPerBlockWithDeltas -where - C: FiatType + Into, - CS: FiatType + From, - B: FixedRatio + From, -{ - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub inner: FiatPerBlock, - pub delta: LazyRollingDeltasFiatFromHeight, -} - -impl FiatPerBlockWithDeltas -where - C: FiatType + JsonSchema + Into, - CS: FiatType + From, - B: FixedRatio + From, -{ - pub(crate) fn forced_import( - db: &Database, - name: &str, - version: Version, - delta_version_offset: Version, - indexes: &indexes::Vecs, - cached_starts: &Windows<&CachedWindowStartVec>, - ) -> Result { - let inner = FiatPerBlock::forced_import(db, name, version, indexes)?; - - let delta = LazyRollingDeltasFiatFromHeight::new( - &format!("{name}_delta"), - version + delta_version_offset, - &inner.cents.height, - cached_starts, - indexes, - ); - - Ok(Self { inner, delta }) - } -} diff --git a/crates/brk_computer/src/internal/per_block/lazy/base.rs b/crates/brk_computer/src/internal/per_block/lazy/base.rs index 8ecdb779c..a374c0f65 100644 --- a/crates/brk_computer/src/internal/per_block/lazy/base.rs +++ b/crates/brk_computer/src/internal/per_block/lazy/base.rs @@ -119,6 +119,32 @@ where } } + pub(crate) fn from_uncached_boxed_height_source>( + name: &str, + version: Version, + height_source: ReadableBoxedVec, + indexes: &indexes::Vecs, + ) -> Self + where + S1T: NumericValue, + { + let resolutions = Resolutions::forced_import_uncached_boxed( + name, + height_source.clone(), + version, + indexes, + ); + + Self { + height: LazyVec::transformed::(name, version, height_source), + resolutions: Box::new(DerivedResolutions::from_derived_computed::( + name, + version, + &resolutions, + )), + } + } + /// Create by unary-transforming a LazyPerBlock source (chaining lazy vecs). pub(crate) fn from_lazy( name: &str, diff --git a/crates/brk_computer/src/internal/per_block/percent/lazy.rs b/crates/brk_computer/src/internal/per_block/percent/lazy.rs index 07be09874..6b112b720 100644 --- a/crates/brk_computer/src/internal/per_block/percent/lazy.rs +++ b/crates/brk_computer/src/internal/per_block/percent/lazy.rs @@ -47,31 +47,6 @@ impl LazyPercentPerBlock { Self::from_height_source(name, version, source, indexes) } - pub(crate) fn from_cached_ratio_with_denominator_transform( - name: &str, - version: Version, - numerator: &(impl ReadableCloneableVec + 'static), - denominator: CachedBoxedVec, - denominator_transform: fn(Height, D) -> D, - indexes: &indexes::Vecs, - ) -> Self - where - S: NumericValue, - D: NumericValue, - F: BinaryTransform + Send + Sync + 'static, - { - let source = LazyIndexedVec::new( - &format!("{name}_{}_source", B::SUFFIX), - version, - numerator.read_only_boxed_clone(), - denominator, - move |height, numerator, denominator| { - F::apply(numerator, denominator_transform(height, denominator)) - }, - ); - Self::from_height_source(name, version, source, indexes) - } - pub(crate) fn from_ratio_with_cached_numerator( name: &str, version: Version, diff --git a/crates/brk_computer/src/internal/per_block/percent/lazy_cumulative_rolling.rs b/crates/brk_computer/src/internal/per_block/percent/lazy_cumulative_rolling.rs index 3280321ad..4d71c0842 100644 --- a/crates/brk_computer/src/internal/per_block/percent/lazy_cumulative_rolling.rs +++ b/crates/brk_computer/src/internal/per_block/percent/lazy_cumulative_rolling.rs @@ -106,44 +106,6 @@ impl LazyPercentCumulativeRolling { } } - pub(crate) fn from_cumulative_ratio_with_denominator_transform( - name: &str, - version: Version, - numerator: &(impl ReadableCloneableVec + 'static), - denominator: CachedBoxedVec, - denominator_transform: fn(Height, D) -> D, - cached_starts: &Windows<&CachedWindowStartVec>, - indexes: &indexes::Vecs, - ) -> Self - where - S: NumericValue, - D: NumericValue, - F: BinaryTransform + Send + Sync + 'static, - { - let cumulative = LazyPercentPerBlock::from_cached_ratio_with_denominator_transform::( - name, - version, - numerator, - denominator.clone(), - denominator_transform, - indexes, - ); - let rolling = - LazyPercentRollingWindows::from_cumulative_ratio_with_denominator_transform::( - name, - version, - numerator, - denominator, - denominator_transform, - cached_starts, - indexes, - ); - Self { - cumulative, - rolling, - } - } - /// Same ratio, with the pinned value as numerator and the sole /// potentially disk-backed source as denominator. pub(crate) fn from_cumulative_ratio_with_cached_numerator( diff --git a/crates/brk_computer/src/internal/per_block/percent/lazy_windows.rs b/crates/brk_computer/src/internal/per_block/percent/lazy_windows.rs index e95a79aa9..fa9c7e776 100644 --- a/crates/brk_computer/src/internal/per_block/percent/lazy_windows.rs +++ b/crates/brk_computer/src/internal/per_block/percent/lazy_windows.rs @@ -60,36 +60,6 @@ impl LazyPercentRollingWindows { ) } - pub(crate) fn from_cumulative_ratio_with_denominator_transform( - name: &str, - version: Version, - numerator: &(impl ReadableCloneableVec + 'static), - denominator: CachedBoxedVec, - denominator_transform: fn(Height, D) -> D, - cached_starts: &Windows<&CachedWindowStartVec>, - indexes: &indexes::Vecs, - ) -> Self - where - S: NumericValue, - D: NumericValue, - F: BinaryTransform + Send + Sync + 'static, - { - let source = numerator.read_only_boxed_clone(); - - Self(cached_starts.map_with_suffix(|suffix, cached_start| { - let full_name = format!("{name}_{suffix}"); - let ratio = LazyRollingRatioVec::::with_cached_transform( - &format!("{full_name}_{}_source", B::SUFFIX), - version, - source.clone(), - denominator.clone(), - cached_start.read_only_cached_boxed_clone(), - denominator_transform, - ); - LazyPercentPerBlock::from_height_source(&full_name, version, ratio, indexes) - })) - } - pub(crate) fn from_cumulative_ratio_with_cached_numerator( name: &str, version: Version, diff --git a/crates/brk_computer/src/internal/per_block/ratio/lazy_price.rs b/crates/brk_computer/src/internal/per_block/ratio/lazy_price.rs index 9ec229083..bb2f19cca 100644 --- a/crates/brk_computer/src/internal/per_block/ratio/lazy_price.rs +++ b/crates/brk_computer/src/internal/per_block/ratio/lazy_price.rs @@ -1,10 +1,10 @@ use brk_traversable::Traversable; use brk_types::{Cents, Dollars, Height, PartsPerMillion64, SatsFract, StoredF32, Version}; -use vecdb::{CachedBoxedVec, ReadableCloneableVec, ReadableVec, TypedVec}; +use vecdb::{CachedBoxedVec, ReadableBoxedVec, ReadableCloneableVec, ReadableVec, TypedVec}; use crate::{ indexes, - internal::{LazyIndexedVec, LazyPerBlock, LazyRatioPerBlock, Price}, + internal::{Identity, LazyIndexedVec, LazyPerBlock, LazyRatioPerBlock, Price}, }; use super::price::price_ratio; @@ -19,6 +19,44 @@ pub struct LazyPriceWithRatioPerBlock { } impl LazyPriceWithRatioPerBlock { + pub(crate) fn from_boxed_height_source( + name: &str, + version: Version, + source: ReadableBoxedVec, + indexes: &indexes::Vecs, + spot_price: &CachedBoxedVec, + ) -> Self { + let source = LazyPerBlock::from_uncached_boxed_height_source::>( + &format!("{name}_cents"), + version, + source, + indexes, + ); + let price = Price::from_lazy_cents_source::, Cents>(name, version, &source); + let ratio_version = version + Version::new(4); + let ppm_source = LazyIndexedVec::new( + &format!("{name}_ratio_ppm_source"), + ratio_version, + price.cents.height.read_only_boxed_clone(), + spot_price.clone(), + |_, price, spot| price_ratio(spot, price), + ); + let ratio = LazyRatioPerBlock::from_uncached_height_source( + &format!("{name}_ratio"), + ratio_version, + ppm_source, + indexes, + ); + + Self { + usd: price.usd, + cents: price.cents, + sats: price.sats, + ppm: ratio.ppm, + ratio: ratio.ratio, + } + } + pub(crate) fn from_uncached_height_source( name: &str, version: Version, diff --git a/crates/brk_computer/src/internal/per_block/rolling/windows.rs b/crates/brk_computer/src/internal/per_block/rolling/windows.rs index 056234621..41f48ee43 100644 --- a/crates/brk_computer/src/internal/per_block/rolling/windows.rs +++ b/crates/brk_computer/src/internal/per_block/rolling/windows.rs @@ -16,7 +16,7 @@ use crate::{ indexes, internal::{ ColumnarPerBlock, ComputedVecValue, LazyColumnPerBlock, NumericValue, PerBlock, - RollingWindow24h, WindowFrom1wId, WindowId, Windows, WindowsFrom1w, + WindowFrom1wId, WindowId, Windows, WindowsFrom1w, }, }; @@ -87,29 +87,6 @@ where } } -/// Single 24h rolling window backed by PerBlock (1 stored vec). -#[derive(Deref, DerefMut, Traversable)] -#[traversable(transparent)] -pub struct RollingWindow24hPerBlock(pub RollingWindow24h>) -where - T: ComputedVecValue + PartialOrd + JsonSchema; - -impl RollingWindow24hPerBlock -where - T: NumericValue + JsonSchema, -{ - pub(crate) fn forced_import( - db: &Database, - name: &str, - version: Version, - indexes: &indexes::Vecs, - ) -> Result { - Ok(Self(RollingWindow24h { - _24h: PerBlock::forced_import(db, &format!("{name}_24h"), version, indexes)?, - })) - } -} - /// The 1w, 1m, and 1y views backed by one columnar source. #[derive(Deref, DerefMut, Traversable)] #[traversable(transparent)] diff --git a/crates/brk_computer/src/internal/per_block/value/columnar.rs b/crates/brk_computer/src/internal/per_block/value/columnar.rs deleted file mode 100644 index e610c49f4..000000000 --- a/crates/brk_computer/src/internal/per_block/value/columnar.rs +++ /dev/null @@ -1,239 +0,0 @@ -use brk_traversable::Traversable; -use brk_types::{ - Bitcoin, Cents, Dollars, Height, PartsPerMillionSigned64, Sats, SatsSigned, Version, -}; -use derive_more::{Deref, DerefMut}; -use vecdb::{ - BinaryTransform, CachedBoxedVec, ColumnId, PcoVec, ReadOnlyColumnarVec, ReadableCloneableVec, -}; - -use crate::{ - indexes, - internal::{ - CachedWindowStartVec, CentsUnsignedToDollars, Identity, LazyColumnPerBlock, LazyIndexedVec, - LazyPerBlock, LazyRollingAvgsAmountFromHeight, LazyRollingDeltasAmountFromHeight, - LazyRollingSumsAmountFromHeight, LazyValueBlock, SatsToBitcoin, SatsToCents, Windows, - }, -}; - -#[derive(Clone, Traversable)] -pub struct LazyColumnValuePerBlock -where - C: ColumnId, -{ - pub btc: LazyPerBlock, - pub sats: LazyColumnPerBlock, - pub usd: LazyPerBlock, - pub cents: LazyColumnPerBlock, -} - -#[derive(Clone, Traversable)] -pub struct LazyColumnSpotValuePerBlock -where - C: ColumnId, -{ - pub btc: LazyPerBlock, - pub sats: LazyColumnPerBlock, - pub usd: LazyPerBlock, - pub cents: LazyPerBlock, -} - -impl LazyColumnSpotValuePerBlock -where - C: ColumnId, -{ - pub(crate) fn new( - name: &str, - version: Version, - source: &ReadOnlyColumnarVec, C>, - column: C, - indexes: &indexes::Vecs, - spot_price: &CachedBoxedVec, - ) -> Self { - let sats = - LazyColumnPerBlock::new(&format!("{name}_sats"), version, source, column, indexes); - let btc = LazyPerBlock::from_resolutions::( - name, - version, - sats.height.read_only_boxed_clone(), - &sats.resolutions, - ); - let cents_source = LazyIndexedVec::new( - &format!("{name}_cents_source"), - version, - sats.height.read_only_boxed_clone(), - spot_price.clone(), - |_, sats, spot| SatsToCents::apply(sats, spot), - ); - let cents = LazyPerBlock::from_height_source::, _>( - &format!("{name}_cents"), - version, - cents_source, - indexes, - ); - let usd = LazyPerBlock::from_lazy::( - &format!("{name}_usd"), - version, - ¢s, - ); - - Self { - btc, - sats, - usd, - cents, - } - } -} - -#[derive(Clone, Deref, DerefMut, Traversable)] -pub struct LazyColumnSpotValuePerBlockWithDeltas -where - C: ColumnId, -{ - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub inner: LazyColumnSpotValuePerBlock, - pub delta: LazyRollingDeltasAmountFromHeight, -} - -impl LazyColumnSpotValuePerBlockWithDeltas -where - C: ColumnId, -{ - pub(crate) fn new( - name: &str, - version: Version, - source: &ReadOnlyColumnarVec, C>, - column: C, - indexes: &indexes::Vecs, - cached_starts: &Windows<&CachedWindowStartVec>, - spot_price: &CachedBoxedVec, - ) -> Self { - let inner = - LazyColumnSpotValuePerBlock::new(name, version, source, column, indexes, spot_price); - let delta = LazyRollingDeltasAmountFromHeight::new( - &format!("{name}_delta"), - version + Version::TWO, - &inner.sats.height, - cached_starts, - indexes, - ); - - Self { inner, delta } - } -} - -impl LazyColumnValuePerBlock -where - C: ColumnId, -{ - pub(crate) fn new( - name: &str, - version: Version, - sats_source: &ReadOnlyColumnarVec, C>, - cents_source: &ReadOnlyColumnarVec, C>, - column: C, - indexes: &indexes::Vecs, - ) -> Self { - let sats = LazyColumnPerBlock::new( - &format!("{name}_sats"), - version, - sats_source, - column, - indexes, - ); - let btc = LazyPerBlock::from_resolutions::( - name, - version, - sats.height.read_only_boxed_clone(), - &sats.resolutions, - ); - let cents = LazyColumnPerBlock::new( - &format!("{name}_cents"), - version, - cents_source, - column, - indexes, - ); - let usd = LazyPerBlock::from_resolutions::( - &format!("{name}_usd"), - version, - cents.height.read_only_boxed_clone(), - ¢s.resolutions, - ); - - Self { - btc, - sats, - usd, - cents, - } - } -} - -#[derive(Clone, Traversable)] -pub struct LazyColumnValuePerBlockCumulativeRolling -where - C: ColumnId, -{ - pub block: LazyValueBlock, - pub cumulative: LazyColumnValuePerBlock, - pub sum: LazyRollingSumsAmountFromHeight, - pub average: LazyRollingAvgsAmountFromHeight, -} - -impl LazyColumnValuePerBlockCumulativeRolling -where - C: ColumnId, -{ - #[allow(clippy::too_many_arguments)] - pub(crate) fn new( - name: &str, - version: Version, - cumulative_sats: &ReadOnlyColumnarVec, C>, - cumulative_cents: &ReadOnlyColumnarVec, C>, - column: C, - indexes: &indexes::Vecs, - cached_starts: &Windows<&CachedWindowStartVec>, - ) -> Self { - let cumulative = LazyColumnValuePerBlock::new( - &format!("{name}_cumulative"), - version, - cumulative_sats, - cumulative_cents, - column, - indexes, - ); - let block = LazyValueBlock::from_cumulative_sources( - name, - version, - &cumulative.sats.height, - &cumulative.cents.height, - ); - let sum = LazyRollingSumsAmountFromHeight::new( - &format!("{name}_sum"), - version, - &cumulative.sats.height, - &cumulative.cents.height, - cached_starts, - indexes, - ); - let average = LazyRollingAvgsAmountFromHeight::new( - &format!("{name}_average"), - version, - &cumulative.sats.height, - &cumulative.cents.height, - cached_starts, - indexes, - ); - - Self { - block, - cumulative, - sum, - average, - } - } -} diff --git a/crates/brk_computer/src/internal/per_block/value/columnar_cumulative_rolling.rs b/crates/brk_computer/src/internal/per_block/value/columnar_cumulative_rolling.rs new file mode 100644 index 000000000..0ed370433 --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/value/columnar_cumulative_rolling.rs @@ -0,0 +1,261 @@ +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, StoredU64, Version}; +use derive_more::{Deref, DerefMut}; +use vecdb::{ + AnyStoredVec, AnyVec, ColumnId, Database, LazyVec, PcoVec, ReadOnlyClone, ReadOnlyColumnarVec, + ReadableBoxedVec, ReadableCloneableVec, ReadableColumnarVec, Rw, StorageMode, UnaryTransform, + VecValue, +}; + +use crate::internal::{ColumnarPerBlockCumulativeRolling, StoredU64ToCents, StoredU64ToSats}; + +#[derive(Deref, DerefMut, Traversable)] +pub struct ColumnarValuePerBlockCumulativeRolling +where + C: ColumnId, +{ + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub series: S, + pub sats: ColumnarPerBlockCumulativeRolling, + pub cents: ColumnarPerBlockCumulativeRolling, +} + +impl ColumnarValuePerBlockCumulativeRolling +where + C: ColumnId, +{ + pub(crate) fn forced_import( + db: &Database, + name: &str, + version: Version, + build_series: impl FnOnce( + &ReadOnlyColumnarVec, C>, + &ReadOnlyColumnarVec, C>, + ) -> S, + ) -> Result { + let sats = ColumnarPerBlockCumulativeRolling::forced_import( + db, + &format!("{name}_sats"), + version, + |_| (), + )?; + let cents = ColumnarPerBlockCumulativeRolling::forced_import( + db, + &format!("{name}_cents"), + version, + |_| (), + )?; + let series = build_series( + &sats.cumulative.read_only_clone(), + ¢s.cumulative.read_only_clone(), + ); + + Ok(Self { + series, + sats, + cents, + }) + } + + pub(crate) fn sources( + &self, + name: &str, + version: Version, + columns: impl IntoIterator, + ) -> ( + ReadableBoxedVec, + ReadableBoxedVec, + ) { + Self::sources_from( + &self.sats.cumulative.read_only_clone(), + &self.cents.cumulative.read_only_clone(), + name, + version, + columns, + ) + } + + pub(crate) fn sources_from( + sats: &ReadOnlyColumnarVec, C>, + cents: &ReadOnlyColumnarVec, C>, + name: &str, + version: Version, + columns: impl IntoIterator, + ) -> ( + ReadableBoxedVec, + ReadableBoxedVec, + ) { + let columns: Vec<_> = columns.into_iter().collect(); + let sats = Self::typed_source::( + sats, + &format!("{name}_sats"), + version, + columns.iter().copied(), + ); + let cents = Self::typed_source::( + cents, + &format!("{name}_cents"), + version, + columns, + ); + (sats, cents) + } + + fn typed_source( + source: &ReadOnlyColumnarVec, C>, + name: &str, + version: Version, + columns: impl IntoIterator, + ) -> ReadableBoxedVec + where + F: UnaryTransform, + T: VecValue, + { + let columns: Vec<_> = columns.into_iter().collect(); + let raw = if columns.len() == 1 { + source + .column(name, version, columns[0]) + .read_only_boxed_clone() + } else { + source + .sum_columns(name, version, columns) + .read_only_boxed_clone() + }; + LazyVec::transformed::(name, version, raw).read_only_boxed_clone() + } + + #[inline(always)] + pub(crate) fn push_block(&mut self, sats: C::Row, cents: C::Row) { + self.sats + .push_block(C::map(sats, |value| StoredU64::from(u64::from(value)))); + self.cents + .push_block(C::map(cents, |value| StoredU64::from(u64::from(value)))); + } + + pub(crate) fn len(&self) -> usize { + self.sats.cumulative.len().min(self.cents.cumulative.len()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let Self { sats, cents, .. } = self; + vec![sats.stored_mut(), cents.stored_mut()] + } +} + +#[cfg(test)] +mod tests { + use std::{ + env, fs, process, + time::{SystemTime, UNIX_EPOCH}, + }; + + use brk_types::{Cents, Sats, Version}; + use vecdb::{AnyVec, ColumnId, Database, VecValue}; + + use super::ColumnarValuePerBlockCumulativeRolling; + + #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] + enum Column { + A, + B, + } + + impl ColumnId for Column { + type Row + = [T; 2] + where + T: VecValue; + + const VERSION: Version = Version::ONE; + const ALL: &'static [Self] = &[Self::A, Self::B]; + + fn index(self) -> usize { + self as usize + } + + fn get(self, row: &Self::Row) -> &T { + &row[self.index()] + } + + fn get_mut(self, row: &mut Self::Row) -> &mut T { + &mut row[self.index()] + } + + fn from_fn(mut create: F) -> Self::Row + where + T: VecValue, + F: FnMut(Self) -> T, + { + [create(Self::A), create(Self::B)] + } + + fn map(row: Self::Row, mut map: F) -> Self::Row + where + T: VecValue, + U: VecValue, + F: FnMut(T) -> U, + { + let [a, b] = row; + [map(a), map(b)] + } + } + + #[test] + fn stores_units_in_separate_cohort_matrices() { + let suffix = SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap() + .as_nanos(); + let path = env::temp_dir().join(format!( + "brk-columnar-value-cumulative-{}-{suffix}", + process::id() + )); + let db = Database::open(&path).unwrap(); + let mut values = ColumnarValuePerBlockCumulativeRolling::::forced_import( + &db, + "values", + Version::ONE, + |_, _| (), + ) + .unwrap(); + + assert_eq!(values.sats.cumulative.name(), "values_sats"); + assert_eq!(values.cents.cumulative.name(), "values_cents"); + + values.push_block( + [Sats::new(1), Sats::new(2)], + [Cents::new(10), Cents::new(20)], + ); + values.push_block( + [Sats::new(3), Sats::new(4)], + [Cents::new(30), Cents::new(40)], + ); + values.sats.write().unwrap(); + values.cents.write().unwrap(); + + let (sats, cents) = values.sources("values_cumulative", Version::ONE, [Column::A]); + assert_eq!(sats.collect_range_dyn(0, 2), [Sats::new(1), Sats::new(4)]); + assert_eq!( + cents.collect_range_dyn(0, 2), + [Cents::new(10), Cents::new(40)] + ); + + let (sats, cents) = values.sources( + "all_values_cumulative", + Version::ONE, + Column::ALL.iter().copied(), + ); + assert_eq!(sats.collect_range_dyn(0, 2), [Sats::new(3), Sats::new(10)]); + assert_eq!( + cents.collect_range_dyn(0, 2), + [Cents::new(30), Cents::new(100)] + ); + + drop(values); + drop(db); + fs::remove_dir_all(path).unwrap(); + } +} diff --git a/crates/brk_computer/src/internal/per_block/value/spot.rs b/crates/brk_computer/src/internal/per_block/value/columnar_spot.rs similarity index 60% rename from crates/brk_computer/src/internal/per_block/value/spot.rs rename to crates/brk_computer/src/internal/per_block/value/columnar_spot.rs index 56896cfa3..1a0a7b315 100644 --- a/crates/brk_computer/src/internal/per_block/value/spot.rs +++ b/crates/brk_computer/src/internal/per_block/value/columnar_spot.rs @@ -1,42 +1,48 @@ -use brk_error::Result; use brk_traversable::Traversable; use brk_types::{Bitcoin, Cents, Dollars, Height, Sats, Version}; -use vecdb::{BinaryTransform, CachedBoxedVec, Database, ReadableCloneableVec, Rw, StorageMode}; +use vecdb::{ + BinaryTransform, CachedBoxedVec, ColumnId, PcoVec, ReadOnlyColumnarVec, ReadableCloneableVec, +}; use crate::{ indexes, internal::{ - CentsUnsignedToDollars, Identity, LazyIndexedVec, LazyPerBlock, PerBlock, SatsToBitcoin, - SatsToCents, + CentsUnsignedToDollars, Identity, LazyColumnPerBlock, LazyIndexedVec, LazyPerBlock, + SatsToBitcoin, SatsToCents, }, }; -/// A point-in-time value whose fiat amount is derived from sats and same-height spot price. -#[derive(Traversable)] -pub struct SpotValuePerBlock { +#[derive(Clone, Traversable)] +pub struct LazyColumnSpotValuePerBlock +where + C: ColumnId, +{ pub btc: LazyPerBlock, - pub sats: PerBlock, + pub sats: LazyColumnPerBlock, pub usd: LazyPerBlock, pub cents: LazyPerBlock, } -impl SpotValuePerBlock { - pub(crate) fn forced_import( - db: &Database, +impl LazyColumnSpotValuePerBlock +where + C: ColumnId, +{ + pub(crate) fn new( name: &str, version: Version, + source: &ReadOnlyColumnarVec, C>, + column: C, indexes: &indexes::Vecs, spot_price: &CachedBoxedVec, - ) -> Result { - let sats = PerBlock::forced_import(db, &format!("{name}_sats"), version, indexes)?; - - let btc = LazyPerBlock::from_computed::( + ) -> Self { + let sats = + LazyColumnPerBlock::new(&format!("{name}_sats"), version, source, column, indexes); + let btc = LazyPerBlock::from_resolutions::( name, version, sats.height.read_only_boxed_clone(), - &sats, + &sats.resolutions, ); - let cents_source = LazyIndexedVec::new( &format!("{name}_cents_source"), version, @@ -50,18 +56,17 @@ impl SpotValuePerBlock { cents_source, indexes, ); - let usd = LazyPerBlock::from_lazy::( &format!("{name}_usd"), version, ¢s, ); - Ok(Self { + Self { btc, sats, usd, cents, - }) + } } } diff --git a/crates/brk_computer/src/internal/per_block/value/cumulative.rs b/crates/brk_computer/src/internal/per_block/value/cumulative.rs index e3bf2ceb1..16f53b3ed 100644 --- a/crates/brk_computer/src/internal/per_block/value/cumulative.rs +++ b/crates/brk_computer/src/internal/per_block/value/cumulative.rs @@ -46,23 +46,6 @@ impl ValuePerBlockCumulative { }) } - #[inline(always)] - pub(crate) fn push_block_sats(&mut self, value: Sats) { - let len = self.cumulative.sats.height.len(); - let mut cumulative = match self.last_cumulative_sats { - Some((cached_len, value)) if cached_len == len => value, - _ => self - .cumulative - .sats - .height - .collect_last() - .unwrap_or_default(), - }; - cumulative += value; - self.cumulative.sats.height.push(cumulative); - self.last_cumulative_sats = Some((len + 1, cumulative)); - } - pub(crate) fn compute_from( &mut self, max_from: Height, diff --git a/crates/brk_computer/src/internal/per_block/value/cumulative_rolling.rs b/crates/brk_computer/src/internal/per_block/value/cumulative_rolling.rs index b47bca36a..125db92af 100644 --- a/crates/brk_computer/src/internal/per_block/value/cumulative_rolling.rs +++ b/crates/brk_computer/src/internal/per_block/value/cumulative_rolling.rs @@ -1,8 +1,8 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Height, Version}; +use brk_types::Version; use derive_more::{Deref, DerefMut}; -use vecdb::{Database, Exit, Rw, StorageMode}; +use vecdb::{Database, Rw, StorageMode}; use crate::{ indexes, @@ -10,7 +10,6 @@ use crate::{ CachedWindowStartVec, LazyRollingAvgsAmountFromHeight, LazyRollingSumsAmountFromHeight, ValuePerBlockCumulative, Windows, }, - price, }; #[derive(Deref, DerefMut, Traversable)] @@ -59,13 +58,4 @@ impl ValuePerBlockCumulativeRolling { average, }) } - - pub(crate) fn compute_rest( - &mut self, - max_from: Height, - prices: &price::Vecs, - exit: &Exit, - ) -> Result<()> { - self.inner.compute_cents(max_from, prices, exit) - } } diff --git a/crates/brk_computer/src/internal/per_block/value/lazy.rs b/crates/brk_computer/src/internal/per_block/value/lazy.rs index 9cfb1bf07..49b0223b6 100644 --- a/crates/brk_computer/src/internal/per_block/value/lazy.rs +++ b/crates/brk_computer/src/internal/per_block/value/lazy.rs @@ -6,7 +6,7 @@ use derive_more::{Deref, DerefMut}; use vecdb::UnaryTransform; use crate::internal::{ - Identity, LazyValue, LazyValueDerivedResolutions, SatsToBitcoin, SpotValuePerBlock, + Identity, LazyValue, LazyValueDerivedResolutions, SatsToBitcoin, SpotValueSource, }; /// Lazy value wrapper with height + all derived last transforms. @@ -22,7 +22,11 @@ pub struct LazyValuePerBlock { } impl LazyValuePerBlock { - pub(crate) fn spot_identity(name: &str, source: &SpotValuePerBlock, version: Version) -> Self { + pub(crate) fn spot_identity( + name: &str, + source: &impl SpotValueSource, + version: Version, + ) -> Self { Self::from_spot_block_source::< Identity, SatsToBitcoin, @@ -38,7 +42,7 @@ impl LazyValuePerBlock { DollarsTransform, >( name: &str, - source: &SpotValuePerBlock, + source: &impl SpotValueSource, version: Version, ) -> Self where diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_cumulative.rs b/crates/brk_computer/src/internal/per_block/value/lazy_cumulative.rs new file mode 100644 index 000000000..c48c47ff7 --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/value/lazy_cumulative.rs @@ -0,0 +1,12 @@ +use brk_traversable::Traversable; +use brk_types::{Bitcoin, Cents, Dollars, Sats}; + +use crate::internal::LazyPerBlock; + +#[derive(Clone, Traversable)] +pub struct LazyCumulativeValuePerBlock { + pub btc: LazyPerBlock, + pub sats: LazyPerBlock, + pub usd: LazyPerBlock, + pub cents: LazyPerBlock, +} diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_cumulative_rolling.rs b/crates/brk_computer/src/internal/per_block/value/lazy_cumulative_rolling.rs new file mode 100644 index 000000000..f5f1bdf76 --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/value/lazy_cumulative_rolling.rs @@ -0,0 +1,86 @@ +use brk_traversable::Traversable; +use brk_types::{Cents, Height, Sats, Version}; +use vecdb::ReadableBoxedVec; + +use crate::{ + indexes, + internal::{ + CachedWindowStartVec, CentsUnsignedToDollars, Identity, LazyCumulativeValuePerBlock, + LazyPerBlock, LazyRollingAvgsAmountFromHeight, LazyRollingSumsAmountFromHeight, + LazyValueBlock, SatsToBitcoin, Windows, + }, +}; + +#[derive(Clone, Traversable)] +pub struct LazyValuePerBlockCumulativeRolling { + pub block: LazyValueBlock, + pub cumulative: LazyCumulativeValuePerBlock, + pub sum: LazyRollingSumsAmountFromHeight, + pub average: LazyRollingAvgsAmountFromHeight, +} + +impl LazyValuePerBlockCumulativeRolling { + pub(crate) fn from_boxed_cumulative_sources( + name: &str, + version: Version, + cumulative_sats: ReadableBoxedVec, + cumulative_cents: ReadableBoxedVec, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + ) -> Self { + let cumulative_name = format!("{name}_cumulative"); + let sats = LazyPerBlock::from_uncached_boxed_height_source::>( + &format!("{cumulative_name}_sats"), + version, + cumulative_sats, + indexes, + ); + let btc = LazyPerBlock::from_lazy::(&cumulative_name, version, &sats); + let cents = LazyPerBlock::from_uncached_boxed_height_source::>( + &format!("{cumulative_name}_cents"), + version, + cumulative_cents, + indexes, + ); + let usd = LazyPerBlock::from_lazy::( + &format!("{cumulative_name}_usd"), + version, + ¢s, + ); + let cumulative = LazyCumulativeValuePerBlock { + btc, + sats, + usd, + cents, + }; + let block = LazyValueBlock::from_cumulative_sources( + name, + version, + &cumulative.sats.height, + &cumulative.cents.height, + ); + let sum = LazyRollingSumsAmountFromHeight::new( + &format!("{name}_sum"), + version, + &cumulative.sats.height, + &cumulative.cents.height, + cached_starts, + indexes, + ); + let average = LazyRollingAvgsAmountFromHeight::new( + &format!("{name}_average"), + version, + &cumulative.sats.height, + &cumulative.cents.height, + cached_starts, + indexes, + ); + + Self { + block, + cumulative, + sum, + average, + } + } +} diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_derived_resolutions.rs b/crates/brk_computer/src/internal/per_block/value/lazy_derived_resolutions.rs index 6bf68b91f..7d71865a3 100644 --- a/crates/brk_computer/src/internal/per_block/value/lazy_derived_resolutions.rs +++ b/crates/brk_computer/src/internal/per_block/value/lazy_derived_resolutions.rs @@ -1,8 +1,46 @@ use brk_traversable::Traversable; use brk_types::{Bitcoin, Cents, Dollars, Sats, Version}; +use schemars::JsonSchema; use vecdb::UnaryTransform; -use crate::internal::{DerivedResolutions, SpotValuePerBlock}; +use crate::internal::{ComputedVecValue, DerivedResolutions, Resolutions, SpotValueSource}; + +pub(crate) trait ReadableResolutions +where + T: ComputedVecValue + JsonSchema, +{ + fn transformed(&self, name: &str, version: Version) -> DerivedResolutions + where + O: ComputedVecValue + JsonSchema, + F: UnaryTransform; +} + +impl ReadableResolutions for Resolutions +where + T: ComputedVecValue + JsonSchema + 'static, +{ + fn transformed(&self, name: &str, version: Version) -> DerivedResolutions + where + O: ComputedVecValue + JsonSchema, + F: UnaryTransform, + { + DerivedResolutions::from_derived_computed::(name, version, self) + } +} + +impl ReadableResolutions for DerivedResolutions +where + T: ComputedVecValue + JsonSchema + 'static, + S: ComputedVecValue + JsonSchema, +{ + fn transformed(&self, name: &str, version: Version) -> DerivedResolutions + where + O: ComputedVecValue + JsonSchema, + F: UnaryTransform, + { + DerivedResolutions::from_lazy::(name, version, self) + } +} #[derive(Clone, Traversable)] pub struct LazyValueDerivedResolutions { @@ -20,7 +58,7 @@ impl LazyValueDerivedResolutions { DollarsTransform, >( name: &str, - source: &SpotValuePerBlock, + source: &impl SpotValueSource, version: Version, ) -> Self where @@ -29,29 +67,21 @@ impl LazyValueDerivedResolutions { CentsTransform: UnaryTransform, DollarsTransform: UnaryTransform, { - let sats = DerivedResolutions::from_derived_computed::( - &format!("{name}_sats"), - version, - &source.sats.resolutions, - ); + let sats = source + .sats_resolutions() + .transformed::(&format!("{name}_sats"), version); - let btc = DerivedResolutions::from_derived_computed::( - name, - version, - &source.sats.resolutions, - ); + let btc = source + .sats_resolutions() + .transformed::(name, version); - let cents = DerivedResolutions::from_lazy::( - &format!("{name}_cents"), - version, - &source.cents.resolutions, - ); + let cents = source + .cents_resolutions() + .transformed::(&format!("{name}_cents"), version); - let usd = DerivedResolutions::from_lazy::( - &format!("{name}_usd"), - version, - &source.usd.resolutions, - ); + let usd = source + .usd_resolutions() + .transformed::(&format!("{name}_usd"), version); Self { btc, diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_rolling_avg.rs b/crates/brk_computer/src/internal/per_block/value/lazy_rolling_avg.rs index 8669c927a..e2aafa330 100644 --- a/crates/brk_computer/src/internal/per_block/value/lazy_rolling_avg.rs +++ b/crates/brk_computer/src/internal/per_block/value/lazy_rolling_avg.rs @@ -1,5 +1,5 @@ use brk_traversable::Traversable; -use brk_types::{Bitcoin, Cents, Dollars, Height, Sats, StoredF32, Version}; +use brk_types::{Cents, Height, Sats, StoredF32, Version}; use derive_more::{Deref, DerefMut}; use vecdb::{DeltaAvg, LazyDeltaVec, LazyVec, ReadOnlyClone, ReadableCloneableVec}; @@ -7,19 +7,10 @@ use crate::{ indexes, internal::{ AvgCentsToUsd, AvgSatsToBtc, CachedWindowStartVec, DerivedResolutions, LazyPerBlock, - LazyRollingAvgFromHeight, Resolutions, Windows, + LazyRollingAvgAmountFromHeight, LazyRollingAvgFromHeight, Resolutions, Windows, }, }; -/// Single window slot: lazy rolling average for Amount (sats + btc + cents + usd), all as f64. -#[derive(Clone, Traversable)] -pub struct LazyRollingAvgAmountFromHeight { - pub btc: LazyPerBlock, - pub sats: LazyRollingAvgFromHeight, - pub usd: LazyPerBlock, - pub cents: LazyRollingAvgFromHeight, -} - /// Lazy rolling averages for all 4 windows, for Amount (sats + btc + cents + usd), all as f64. #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(transparent)] diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_rolling_avg_amount.rs b/crates/brk_computer/src/internal/per_block/value/lazy_rolling_avg_amount.rs new file mode 100644 index 000000000..3050c6d55 --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/value/lazy_rolling_avg_amount.rs @@ -0,0 +1,12 @@ +use brk_traversable::Traversable; +use brk_types::{Bitcoin, Cents, Dollars, Sats, StoredF32}; + +use crate::internal::{LazyPerBlock, LazyRollingAvgFromHeight}; + +#[derive(Clone, Traversable)] +pub struct LazyRollingAvgAmountFromHeight { + pub btc: LazyPerBlock, + pub sats: LazyRollingAvgFromHeight, + pub usd: LazyPerBlock, + pub cents: LazyRollingAvgFromHeight, +} diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_rolling_sum.rs b/crates/brk_computer/src/internal/per_block/value/lazy_rolling_sum.rs index 95f59bb9a..3eecbd2a5 100644 --- a/crates/brk_computer/src/internal/per_block/value/lazy_rolling_sum.rs +++ b/crates/brk_computer/src/internal/per_block/value/lazy_rolling_sum.rs @@ -1,5 +1,5 @@ use brk_traversable::Traversable; -use brk_types::{Bitcoin, Cents, Dollars, Height, Sats, Version}; +use brk_types::{Cents, Height, Sats, Version}; use derive_more::{Deref, DerefMut}; use vecdb::{DeltaSub, LazyDeltaVec, LazyVec, ReadOnlyClone, ReadableCloneableVec}; @@ -7,19 +7,11 @@ use crate::{ indexes, internal::{ CachedWindowStartVec, CentsUnsignedToDollars, DerivedResolutions, LazyPerBlock, - LazyRollingSumFromHeight, Resolutions, SatsToBitcoin, Windows, + LazyRollingSumAmountFromHeight, LazyRollingSumFromHeight, Resolutions, SatsToBitcoin, + Windows, }, }; -/// Single window slot: lazy rolling sum for Amount (sats + btc + cents + usd). -#[derive(Clone, Traversable)] -pub struct LazyRollingSumAmountFromHeight { - pub btc: LazyPerBlock, - pub sats: LazyRollingSumFromHeight, - pub usd: LazyPerBlock, - pub cents: LazyRollingSumFromHeight, -} - /// Lazy rolling sums for all 4 windows, for Amount (sats + btc + cents + usd). #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(transparent)] diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_rolling_sum_amount.rs b/crates/brk_computer/src/internal/per_block/value/lazy_rolling_sum_amount.rs new file mode 100644 index 000000000..9baba8b0d --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/value/lazy_rolling_sum_amount.rs @@ -0,0 +1,12 @@ +use brk_traversable::Traversable; +use brk_types::{Bitcoin, Cents, Dollars, Sats}; + +use crate::internal::{LazyPerBlock, LazyRollingSumFromHeight}; + +#[derive(Clone, Traversable)] +pub struct LazyRollingSumAmountFromHeight { + pub btc: LazyPerBlock, + pub sats: LazyRollingSumFromHeight, + pub usd: LazyPerBlock, + pub cents: LazyRollingSumFromHeight, +} diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_spot.rs b/crates/brk_computer/src/internal/per_block/value/lazy_spot.rs index b99bef32d..bb8712bab 100644 --- a/crates/brk_computer/src/internal/per_block/value/lazy_spot.rs +++ b/crates/brk_computer/src/internal/per_block/value/lazy_spot.rs @@ -1,11 +1,14 @@ use brk_traversable::Traversable; use brk_types::{Bitcoin, Cents, Dollars, Height, Sats, Version}; -use vecdb::{BinaryTransform, CachedBoxedVec, ReadableCloneableVec, ReadableVec, TypedVec}; +use vecdb::{ + BinaryTransform, CachedBoxedVec, ReadableBoxedVec, ReadableCloneableVec, ReadableVec, TypedVec, +}; use crate::{ indexes, internal::{ - CentsUnsignedToDollars, Identity, LazyIndexedVec, LazyPerBlock, SatsToBitcoin, SatsToCents, + CentsUnsignedToDollars, DerivedResolutions, Identity, LazyIndexedVec, LazyPerBlock, + ReadableResolutions, SatsToBitcoin, SatsToCents, }, }; @@ -18,6 +21,49 @@ pub struct LazySpotValuePerBlock { pub cents: LazyPerBlock, } +pub(crate) trait SpotValueSource { + type SatsResolutions: ReadableResolutions; + type CentsResolutions: ReadableResolutions; + type DollarsResolutions: ReadableResolutions; + + fn sats_height(&self) -> ReadableBoxedVec; + fn cents_height(&self) -> ReadableBoxedVec; + fn usd_height(&self) -> ReadableBoxedVec; + fn sats_resolutions(&self) -> &Self::SatsResolutions; + fn cents_resolutions(&self) -> &Self::CentsResolutions; + fn usd_resolutions(&self) -> &Self::DollarsResolutions; +} + +impl SpotValueSource for LazySpotValuePerBlock { + type SatsResolutions = DerivedResolutions; + type CentsResolutions = DerivedResolutions; + type DollarsResolutions = DerivedResolutions; + + fn sats_height(&self) -> ReadableBoxedVec { + self.sats.height.read_only_boxed_clone() + } + + fn cents_height(&self) -> ReadableBoxedVec { + self.cents.height.read_only_boxed_clone() + } + + fn usd_height(&self) -> ReadableBoxedVec { + self.usd.height.read_only_boxed_clone() + } + + fn sats_resolutions(&self) -> &Self::SatsResolutions { + &self.sats.resolutions + } + + fn cents_resolutions(&self) -> &Self::CentsResolutions { + &self.cents.resolutions + } + + fn usd_resolutions(&self) -> &Self::DollarsResolutions { + &self.usd.resolutions + } +} + impl LazySpotValuePerBlock { pub(crate) fn identity(name: &str, version: Version, source: &Self) -> Self { let sats = LazyPerBlock::from_lazy::, Sats>( @@ -88,4 +134,45 @@ impl LazySpotValuePerBlock { cents, } } + + pub(crate) fn from_boxed_sats_source( + name: &str, + version: Version, + source: ReadableBoxedVec, + indexes: &indexes::Vecs, + spot_price: &CachedBoxedVec, + ) -> Self { + let sats = LazyPerBlock::from_uncached_boxed_height_source::>( + &format!("{name}_sats"), + version, + source, + indexes, + ); + let btc = LazyPerBlock::from_lazy::(name, version, &sats); + let cents_source = LazyIndexedVec::new( + &format!("{name}_cents_source"), + version, + sats.height.read_only_boxed_clone(), + spot_price.clone(), + |_, sats, spot| SatsToCents::apply(sats, spot), + ); + let cents = LazyPerBlock::from_uncached_height_source::, _>( + &format!("{name}_cents"), + version, + cents_source, + indexes, + ); + let usd = LazyPerBlock::from_lazy::( + &format!("{name}_usd"), + version, + ¢s, + ); + + Self { + btc, + sats, + usd, + cents, + } + } } diff --git a/crates/brk_computer/src/internal/per_block/value/lazy_spot_with_deltas.rs b/crates/brk_computer/src/internal/per_block/value/lazy_spot_with_deltas.rs new file mode 100644 index 000000000..563d063db --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/value/lazy_spot_with_deltas.rs @@ -0,0 +1,43 @@ +use brk_traversable::Traversable; +use brk_types::{Cents, Height, PartsPerMillionSigned64, Sats, SatsSigned, Version}; +use derive_more::{Deref, DerefMut}; +use vecdb::{CachedBoxedVec, ReadableBoxedVec}; + +use crate::{ + indexes, + internal::{CachedWindowStartVec, LazyRollingDeltasAmountFromHeight, Windows}, +}; + +use super::LazySpotValuePerBlock; + +#[derive(Clone, Deref, DerefMut, Traversable)] +pub struct LazySpotValuePerBlockWithDeltas { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub inner: LazySpotValuePerBlock, + pub delta: LazyRollingDeltasAmountFromHeight, +} + +impl LazySpotValuePerBlockWithDeltas { + pub(crate) fn from_boxed_sats_source( + name: &str, + version: Version, + source: ReadableBoxedVec, + indexes: &indexes::Vecs, + cached_starts: &Windows<&CachedWindowStartVec>, + spot_price: &CachedBoxedVec, + ) -> Self { + let inner = LazySpotValuePerBlock::from_boxed_sats_source( + name, version, source, indexes, spot_price, + ); + let delta = LazyRollingDeltasAmountFromHeight::new( + &format!("{name}_delta"), + version + Version::TWO, + &inner.sats.height, + cached_starts, + indexes, + ); + Self { inner, delta } + } +} diff --git a/crates/brk_computer/src/internal/per_block/value/mod.rs b/crates/brk_computer/src/internal/per_block/value/mod.rs index 9bc1e8379..576c3958d 100644 --- a/crates/brk_computer/src/internal/per_block/value/mod.rs +++ b/crates/brk_computer/src/internal/per_block/value/mod.rs @@ -1,29 +1,39 @@ mod base; mod cached; mod cached_full; -mod columnar; +mod columnar_cumulative_rolling; +mod columnar_spot; mod cumulative; mod cumulative_rolling; mod lazy; mod lazy_block; +mod lazy_cumulative; +mod lazy_cumulative_rolling; mod lazy_derived_resolutions; mod lazy_rolling_avg; +mod lazy_rolling_avg_amount; mod lazy_rolling_sum; +mod lazy_rolling_sum_amount; mod lazy_spot; +mod lazy_spot_with_deltas; mod rolling_distribution; -mod spot; pub use base::*; pub use cached::*; pub use cached_full::*; -pub use columnar::*; +pub use columnar_cumulative_rolling::*; +pub use columnar_spot::*; pub use cumulative::*; pub use cumulative_rolling::*; pub use lazy::*; pub use lazy_block::*; +pub use lazy_cumulative::*; +pub use lazy_cumulative_rolling::*; pub use lazy_derived_resolutions::*; pub use lazy_rolling_avg::*; +pub use lazy_rolling_avg_amount::*; pub use lazy_rolling_sum::*; +pub use lazy_rolling_sum_amount::*; pub use lazy_spot::*; +pub use lazy_spot_with_deltas::*; pub use rolling_distribution::*; -pub use spot::*; diff --git a/crates/brk_computer/src/internal/transform/currency.rs b/crates/brk_computer/src/internal/transform/currency.rs index 6ad2e2136..fcbf29235 100644 --- a/crates/brk_computer/src/internal/transform/currency.rs +++ b/crates/brk_computer/src/internal/transform/currency.rs @@ -1,4 +1,6 @@ -use brk_types::{Bitcoin, Cents, CentsSigned, Dollars, Sats, SatsFract, SatsSigned, StoredF32}; +use brk_types::{ + Bitcoin, Cents, CentsSigned, Dollars, Sats, SatsFract, SatsSigned, StoredF32, StoredU64, +}; use vecdb::{BinaryTransform, UnaryTransform, unlikely}; pub struct SatsToBitcoin; @@ -10,6 +12,24 @@ impl UnaryTransform for SatsToBitcoin { } } +pub struct StoredU64ToSats; + +impl UnaryTransform for StoredU64ToSats { + #[inline(always)] + fn apply(value: StoredU64) -> Sats { + Sats::new(value.into()) + } +} + +pub struct StoredU64ToCents; + +impl UnaryTransform for StoredU64ToCents { + #[inline(always)] + fn apply(value: StoredU64) -> Cents { + Cents::new(value.into()) + } +} + pub struct SatsSignedToBitcoin; impl UnaryTransform for SatsSignedToBitcoin { @@ -94,21 +114,6 @@ impl UnaryTransform for CentsUnsignedToSats { } } -pub struct CentsSubtractToCentsSigned; - -impl BinaryTransform for CentsSubtractToCentsSigned { - #[inline(always)] - fn apply(a: Cents, b: Cents) -> CentsSigned { - if unlikely(a.is_nan() || b.is_nan()) { - panic!("Cents::NAN cannot be converted to CentsSigned"); - } - let difference = i128::from(a.inner()) - i128::from(b.inner()); - CentsSigned::new( - i64::try_from(difference).expect("Cents subtraction overflowed CentsSigned"), - ) - } -} - pub struct CentsTimesTenths; impl UnaryTransform for CentsTimesTenths { @@ -146,10 +151,4 @@ mod tests { fn whole_sats_reject_nan() { CentsUnsignedToSats::apply(Cents::NAN); } - - #[test] - #[should_panic(expected = "Cents::NAN cannot be converted to CentsSigned")] - fn signed_cents_reject_nan() { - CentsSubtractToCentsSigned::apply(Cents::NAN, Cents::ZERO); - } } diff --git a/crates/brk_computer/src/internal/transform/mod.rs b/crates/brk_computer/src/internal/transform/mod.rs index dd2beeb99..b5a2bcaf6 100644 --- a/crates/brk_computer/src/internal/transform/mod.rs +++ b/crates/brk_computer/src/internal/transform/mod.rs @@ -12,9 +12,9 @@ pub use arithmetic::{ WeightToVSize, }; pub use currency::{ - AvgCentsToUsd, AvgSatsToBtc, CentsSignedToDollars, CentsSubtractToCentsSigned, - CentsTimesTenths, CentsUnsignedToDollars, CentsUnsignedToSats, DollarsToSatsFract, - NegCentsUnsignedToDollars, SatsSignedToBitcoin, SatsToBitcoin, SatsToCents, + AvgCentsToUsd, AvgSatsToBtc, CentsSignedToDollars, CentsTimesTenths, CentsUnsignedToDollars, + CentsUnsignedToSats, DollarsToSatsFract, NegCentsUnsignedToDollars, SatsSignedToBitcoin, + SatsToBitcoin, SatsToCents, StoredU64ToCents, StoredU64ToSats, }; pub use derived::{ Cagr, Days1, Days7, Days30, Days365, DaysToYears, PriceTimesRatio, RatioCents64, TimesSqrt, diff --git a/crates/brk_computer/src/internal/value.rs b/crates/brk_computer/src/internal/value.rs index 10c2eff5f..781dc6335 100644 --- a/crates/brk_computer/src/internal/value.rs +++ b/crates/brk_computer/src/internal/value.rs @@ -1,8 +1,8 @@ use brk_traversable::Traversable; use brk_types::{Bitcoin, Cents, Dollars, Height, Sats, Version}; -use vecdb::{LazyVec, ReadableCloneableVec, UnaryTransform, VecIndex}; +use vecdb::{LazyVec, UnaryTransform, VecIndex}; -use crate::internal::SpotValuePerBlock; +use crate::internal::SpotValueSource; /// Fully lazy value type at height level. /// @@ -23,7 +23,7 @@ impl LazyValue { DollarsTransform, >( name: &str, - source: &SpotValuePerBlock, + source: &impl SpotValueSource, version: Version, ) -> Self where @@ -35,25 +35,21 @@ impl LazyValue { let sats = LazyVec::transformed::( &format!("{name}_sats"), version, - source.sats.height.read_only_boxed_clone(), + source.sats_height(), ); - let btc = LazyVec::transformed::( - name, - version, - source.sats.height.read_only_boxed_clone(), - ); + let btc = LazyVec::transformed::(name, version, source.sats_height()); let cents = LazyVec::transformed::( &format!("{name}_cents"), version, - source.cents.height.read_only_boxed_clone(), + source.cents_height(), ); let usd = LazyVec::transformed::( &format!("{name}_usd"), version, - source.usd.height.read_only_boxed_clone(), + source.usd_height(), ); Self { diff --git a/crates/brk_computer/src/lib.rs b/crates/brk_computer/src/lib.rs index ab192a237..18c8c4b03 100644 --- a/crates/brk_computer/src/lib.rs +++ b/crates/brk_computer/src/lib.rs @@ -10,6 +10,8 @@ use brk_types::{Height, Version}; use tracing::info; use vecdb::{AnyExportableVec, Exit, Ro, Rw, StorageMode}; +use distribution::UTXOStates; + mod blocks; mod constants; mod distribution; @@ -407,7 +409,7 @@ impl Computer { self.investing.invalidate_cache(); - thread::scope(|scope| -> Result<()> { + let utxo_states = thread::scope(|scope| -> Result { let pools = scope.spawn(|| { timed("Computed pools", || { self.pools @@ -415,7 +417,7 @@ impl Computer { }) }); - timed("Computed distribution", || { + let utxo_states = timed("Computed distribution", || { self.distribution.compute( indexer, &self.indexes, @@ -428,7 +430,7 @@ impl Computer { })?; pools.join().unwrap()?; - Ok(()) + Ok(utxo_states) })?; // Indicators doesn't depend on supply or either framework — run it in @@ -469,6 +471,7 @@ impl Computer { &self.indexes, &self.price, &self.distribution, + &utxo_states, &self.frameworks, &self.market.moving_average, exit, diff --git a/crates/brk_computer/src/models/bedrock/compute.rs b/crates/brk_computer/src/models/bedrock/compute.rs index e23ad1853..ec7ec9cd2 100644 --- a/crates/brk_computer/src/models/bedrock/compute.rs +++ b/crates/brk_computer/src/models/bedrock/compute.rs @@ -22,10 +22,10 @@ use super::{ weighted_urpd_name, }; use crate::{ - distribution, + distribution::{self, UTXOStates}, frameworks::{ - coinflow::{self, AgeBand, HORIZON_COUNT, HORIZON_DAYS, age_bounds_days}, - cointime, + self, + coinflow::{AgeBand, HORIZON_COUNT, HorizonId, age_bounds_days, horizon_mobility}, }, indexes, internal::db_utils::validate_any_computed_version_or_reset, @@ -145,7 +145,7 @@ struct Calibration { impl Calibration { fn from_sources( raw: &impl ReadableVec>, - weighted: &WeightedModes<&impl ReadableVec>>, + weighted: &WeightedModes<&dyn ReadableVec>>, end: usize, ) -> Self where @@ -204,19 +204,19 @@ impl Vecs { indexer: &Indexer, indexes: &indexes::Vecs, distribution: &distribution::Vecs, - cointime: &cointime::Vecs, - coinflow: &coinflow::Vecs, + utxo_states: &UTXOStates, + frameworks: &frameworks::Vecs, exit: &Exit, ) -> Result<()> { + let cointime = &frameworks.cointime; + let coinflow = &frameworks.coinflow; let cointime_wakefulness = AgeRange::from_fn(|id| &id.select(&cointime.age_range.activity.wakefulness).day1); let age_supplies = AgeRange::from_fn(|id| { - &id.select(&distribution.utxo_cohorts.age_range) - .metrics - .supply - .total + &id.select(&distribution.cohorts.supply.total.cohorts.age.range) .sats .day1 + .0 }); let coinflow_mobility = AgeRange::from_fn(|id| { &id.select(&coinflow.age_range.spending_exposure.mobility) @@ -226,24 +226,42 @@ impl Vecs { let coinflow_spending_rate = AgeRange::from_fn(|id| &id.select(&coinflow.age_range.spending_rate).day1); let raw_loss_share = &distribution - .utxo_cohorts - .all - .metrics + .cohorts .relative + .supply_profitability_shares .supply_in_loss_share + .all .ppm - .day1; - let weighted_loss_shares = WeightedModes { - cointime: &cointime.supply.active_supply_in_loss_share.day1, - coinflow: &coinflow.all.supply_in_loss_share.day1, - coinflow_8y: &coinflow.all.horizon._8y.supply_in_loss_share.day1, - coinflow_4y: &coinflow.all.horizon._4y.supply_in_loss_share.day1, - coinflow_2y: &coinflow.all.horizon._2y.supply_in_loss_share.day1, - coinflow_1y: &coinflow.all.horizon._1y.supply_in_loss_share.day1, - coinflow_6m: &coinflow.all.horizon._6m.supply_in_loss_share.day1, - coinflow_3m: &coinflow.all.horizon._3m.supply_in_loss_share.day1, - coinflow_1m: &coinflow.all.horizon._1m.supply_in_loss_share.day1, - }; + .day1 + .0; + let weighted_loss_shares = + WeightedModes::from_fn(|mode| -> &dyn ReadableVec> { + match mode { + WeightedModeId::Cointime => &cointime.supply.active_supply_in_loss_share.day1, + WeightedModeId::Coinflow => &coinflow.all.supply_in_loss_share.day1.0, + WeightedModeId::Coinflow8Y => { + &coinflow.all.horizon._8y.supply_in_loss_share.day1.0 + } + WeightedModeId::Coinflow4Y => { + &coinflow.all.horizon._4y.supply_in_loss_share.day1.0 + } + WeightedModeId::Coinflow2Y => { + &coinflow.all.horizon._2y.supply_in_loss_share.day1.0 + } + WeightedModeId::Coinflow1Y => { + &coinflow.all.horizon._1y.supply_in_loss_share.day1.0 + } + WeightedModeId::Coinflow6M => { + &coinflow.all.horizon._6m.supply_in_loss_share.day1.0 + } + WeightedModeId::Coinflow3M => { + &coinflow.all.horizon._3m.supply_in_loss_share.day1.0 + } + WeightedModeId::Coinflow1M => { + &coinflow.all.horizon._1m.supply_in_loss_share.day1.0 + } + } + }); let weighted_urpd_names = weighted_urpd_names(); let weighted_urpd_source_version: Version = std::iter::once(WEIGHTED_URPD_VERSION) @@ -253,11 +271,12 @@ impl Vecs { .chain(cointime_wakefulness.iter().map(|vec| vec.version())) .chain(coinflow_mobility.iter().map(|vec| vec.version())) .sum(); - let source_version: Version = std::iter::once(weighted_urpd_source_version) - .chain(coinflow_spending_rate.iter().map(|vec| vec.version())) - .chain(std::iter::once(raw_loss_share.version())) - .chain(weighted_loss_shares.iter().map(|vec| vec.version())) - .sum(); + let source_version = Version::combine_all( + std::iter::once(weighted_urpd_source_version) + .chain(coinflow_spending_rate.iter().map(|vec| vec.version())) + .chain(std::iter::once(raw_loss_share.version())) + .chain(weighted_loss_shares.iter().map(|vec| vec.version())), + ); for vec in self.stored_vecs_mut() { validate_any_computed_version_or_reset(vec, source_version)?; @@ -319,10 +338,7 @@ impl Vecs { &bounds, ); let urpds = if day_index + 1 == source_end { - Some(build_current_day_urpds( - &distribution.utxo_cohorts, - &weights, - )) + Some(build_current_day_urpds(utxo_states, &weights)) } else if UrpdRaw::path(&distribution.states_path, UTXO_ALL_NAME.id, date) .try_exists()? { @@ -383,23 +399,28 @@ impl Vecs { } } -fn collect_loss_history(source: &impl ReadableVec>, end: usize) -> Vec +fn collect_loss_history( + source: &(impl ReadableVec> + ?Sized), + end: usize, +) -> Vec where T: VecValue, f64: From, { - let mut history: Vec<_> = source - .collect_range_at(0, end) - .into_iter() - .flatten() - .map(f64::from) - .filter(|value| value.is_finite()) - .collect(); + let mut history = Vec::with_capacity(end); + source.for_each_range_dyn_at(0, end, &mut |value| { + if let Some(value) = value.map(f64::from).filter(|value| value.is_finite()) { + history.push(value); + } + }); history.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap_or(Ordering::Equal)); history } -fn collect_loss_share(source: &impl ReadableVec>, day: Day1) -> Option +fn collect_loss_share( + source: &(impl ReadableVec> + ?Sized), + day: Day1, +) -> Option where T: VecValue, f64: From, @@ -413,7 +434,7 @@ where fn collect_loss_shares( raw: &impl ReadableVec>, - weighted: &WeightedModes<&impl ReadableVec>>, + weighted: &WeightedModes<&dyn ReadableVec>>, day: Day1, ) -> Modes> where @@ -463,10 +484,10 @@ fn mode_weights( let hazards = AgeRange::from_fn(|id| (*id.select(&hazards)).max(0.0)); for (id, horizon) in WeightedModeId::COINFLOW_HORIZONS .into_iter() - .zip(HORIZON_DAYS.iter().copied()) + .zip(HorizonId::ALL.into_iter().map(HorizonId::days)) { *weights.select_mut(id.mode()) = Some(AgeRange::from_fn(|age| { - coinflow::horizon_mobility(&hazards, age, horizon, bounds) + horizon_mobility(&hazards, age, horizon, bounds) })); } } @@ -558,7 +579,7 @@ fn read_day_urpds( Ok(finalize_day_urpds(raw, weighted)) } -fn build_current_day_urpds(utxos: &distribution::UTXOCohorts, weights: &ModeWeights) -> DayUrpds { +fn build_current_day_urpds(utxos: &UTXOStates, weights: &ModeWeights) -> DayUrpds { build_urpds_from_age_entries(utxos.age_range_urpd_entries(), weights) } diff --git a/crates/brk_computer/src/models/bedrock/levels.rs b/crates/brk_computer/src/models/bedrock/levels.rs new file mode 100644 index 000000000..5c47f317c --- /dev/null +++ b/crates/brk_computer/src/models/bedrock/levels.rs @@ -0,0 +1,16 @@ +use brk_traversable::Traversable; +use schemars::JsonSchema; +use serde::Serialize; + +#[derive(Debug, Clone, Copy, PartialEq, Traversable, Serialize, JsonSchema)] +pub struct Levels { + pub pct10: T, + pub pct20: T, + pub pct30: T, + pub pct40: T, + pub pct50: T, + pub pct60: T, + pub pct70: T, + pub pct80: T, + pub pct90: T, +} diff --git a/crates/brk_computer/src/models/bedrock/mod.rs b/crates/brk_computer/src/models/bedrock/mod.rs index 2d21c51fc..32f2f0c53 100644 --- a/crates/brk_computer/src/models/bedrock/mod.rs +++ b/crates/brk_computer/src/models/bedrock/mod.rs @@ -1,7 +1,20 @@ mod compute; mod import; +mod levels; +mod mode_vecs; +mod modes; +mod percentiles; mod price; +mod price_bands; mod vecs; +mod weighted; + +pub(super) use levels::Levels; +pub(super) use mode_vecs::ModeVecs; +pub(super) use modes::Modes; +pub(super) use percentiles::Percentiles; +pub(super) use price_bands::PriceBands; +pub(super) use weighted::WeightedModes; use std::path::PathBuf; @@ -64,16 +77,8 @@ impl Computer { return Some(1.0); } - let supplies = &self.distribution.utxo_cohorts.age_range; - let supply = age - .select(supplies) - .metrics - .supply - .total - .sats - .day1 - .collect_one(day) - .flatten()?; + let supplies = &self.distribution.cohorts.supply.total.cohorts.age.range; + let supply = age.select(supplies).sats.day1.collect_one(day).flatten()?; match weight { UrpdWeight::Raw => Some(1.0), diff --git a/crates/brk_computer/src/models/bedrock/mode_vecs.rs b/crates/brk_computer/src/models/bedrock/mode_vecs.rs new file mode 100644 index 000000000..d8f89c41d --- /dev/null +++ b/crates/brk_computer/src/models/bedrock/mode_vecs.rs @@ -0,0 +1,26 @@ +use brk_traversable::Traversable; +use brk_types::{Cents, StoredF64}; +use derive_more::{Deref, DerefMut}; +use vecdb::{Rw, StorageMode}; + +use super::{ + Percentiles, PriceBands, + price::LazyColumnPrice, + vecs::{LossPercentileId, PriceBandId}, +}; +use crate::internal::{ColumnarDailyMetric, LazyColumnDailyMetric}; + +#[derive(Deref, DerefMut, Traversable)] +pub struct ModeVecs { + pub loss_threshold: ColumnarDailyMetric< + StoredF64, + LossPercentileId, + Percentiles>, + M, + >, + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub prices: + ColumnarDailyMetric>, M>, +} diff --git a/crates/brk_computer/src/models/bedrock/modes.rs b/crates/brk_computer/src/models/bedrock/modes.rs new file mode 100644 index 000000000..74c5cf27f --- /dev/null +++ b/crates/brk_computer/src/models/bedrock/modes.rs @@ -0,0 +1,13 @@ +use brk_traversable::Traversable; +use derive_more::{Deref, DerefMut}; + +use super::WeightedModes; + +#[derive(Deref, DerefMut, Traversable)] +pub struct Modes { + pub raw: T, + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub weighted: WeightedModes, +} diff --git a/crates/brk_computer/src/models/bedrock/percentiles.rs b/crates/brk_computer/src/models/bedrock/percentiles.rs new file mode 100644 index 000000000..7f51fc61a --- /dev/null +++ b/crates/brk_computer/src/models/bedrock/percentiles.rs @@ -0,0 +1,12 @@ +use brk_traversable::Traversable; +use schemars::JsonSchema; +use serde::Serialize; + +#[derive(Debug, Clone, Copy, PartialEq, Traversable, Serialize, JsonSchema)] +pub struct Percentiles { + pub pct95: T, + pub pct98: T, + pub pct99: T, + pub pct99_5: T, + pub pct99_9: T, +} diff --git a/crates/brk_computer/src/models/bedrock/price_bands.rs b/crates/brk_computer/src/models/bedrock/price_bands.rs new file mode 100644 index 000000000..68e408296 --- /dev/null +++ b/crates/brk_computer/src/models/bedrock/price_bands.rs @@ -0,0 +1,11 @@ +use brk_traversable::Traversable; +use schemars::JsonSchema; +use serde::Serialize; + +use super::{Levels, Percentiles}; + +#[derive(Debug, Clone, Copy, PartialEq, Traversable, Serialize, JsonSchema)] +pub struct PriceBands { + pub floor: Percentiles, + pub level: Levels, +} diff --git a/crates/brk_computer/src/models/bedrock/vecs.rs b/crates/brk_computer/src/models/bedrock/vecs.rs index b9210b35a..18c2ccb1d 100644 --- a/crates/brk_computer/src/models/bedrock/vecs.rs +++ b/crates/brk_computer/src/models/bedrock/vecs.rs @@ -1,12 +1,48 @@ use std::path::PathBuf; use brk_traversable::Traversable; -use brk_types::{Cents, StoredF64, Version}; +use brk_types::Version; use derive_more::{Deref, DerefMut}; -use vecdb::{ColumnId, Rw, StorageMode, VecValue}; +use vecdb::{ColumnId, Formattable, Rw, StorageMode, VecValue}; -use super::price::LazyColumnPrice; -use crate::internal::{ColumnarDailyMetric, LazyColumnDailyMetric}; +pub(super) use super::{Levels, ModeVecs, Modes, Percentiles, PriceBands, WeightedModes}; + +macro_rules! impl_named_row_formattable { + ($row:ident { $($field:ident),+ $(,)? }) => { + impl Formattable for $row { + fn write_to(&self, output: &mut Vec) { + output.push(b'{'); + let mut first = true; + $( + if !first { + output.push(b','); + } + first = false; + output.extend_from_slice(concat!("\"", stringify!($field), "\":").as_bytes()); + self.$field.fmt_json(output); + )+ + let _ = first; + output.push(b'}'); + } + + fn fmt_csv(&self, output: &mut String) -> std::fmt::Result { + let mut json = Vec::new(); + self.write_to(&mut json); + let json = std::str::from_utf8(&json).map_err(|_| std::fmt::Error)?; + + output.push('"'); + for character in json.chars() { + if character == '"' { + output.push('"'); + } + output.push(character); + } + output.push('"'); + Ok(()) + } + } + }; +} pub(crate) const MODE_COUNT: usize = 10; pub(crate) const PERCENTILE_COUNT: usize = 5; @@ -175,7 +211,7 @@ const LOSS_PERCENTILE_IDS: [LossPercentileId; PERCENTILE_COUNT] = [ impl ColumnId for LossPercentileId { type Row - = [T; PERCENTILE_COUNT] + = Percentiles where T: VecValue; @@ -189,21 +225,21 @@ impl ColumnId for LossPercentileId { #[inline] fn get(self, row: &Self::Row) -> &T { - &row[self.index()] + self.select(row) } #[inline] fn get_mut(self, row: &mut Self::Row) -> &mut T { - &mut row[self.index()] + self.select_mut(row) } #[inline] - fn from_fn(mut create: F) -> Self::Row + fn from_fn(create: F) -> Self::Row where T: VecValue, F: FnMut(Self) -> T, { - std::array::from_fn(|index| create(LOSS_PERCENTILE_IDS[index])) + Percentiles::from_fn(create) } #[inline] @@ -273,6 +309,25 @@ impl PriceBandId { Self::LevelPct90 => &values.level.pct90, } } + + pub(super) fn select_mut(self, values: &mut PriceBands) -> &mut T { + match self { + Self::FloorPct95 => &mut values.floor.pct95, + Self::FloorPct98 => &mut values.floor.pct98, + Self::FloorPct99 => &mut values.floor.pct99, + Self::FloorPct99_5 => &mut values.floor.pct99_5, + Self::FloorPct99_9 => &mut values.floor.pct99_9, + Self::LevelPct10 => &mut values.level.pct10, + Self::LevelPct20 => &mut values.level.pct20, + Self::LevelPct30 => &mut values.level.pct30, + Self::LevelPct40 => &mut values.level.pct40, + Self::LevelPct50 => &mut values.level.pct50, + Self::LevelPct60 => &mut values.level.pct60, + Self::LevelPct70 => &mut values.level.pct70, + Self::LevelPct80 => &mut values.level.pct80, + Self::LevelPct90 => &mut values.level.pct90, + } + } } #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -364,7 +419,7 @@ pub(super) const LEVEL_IDS: [LevelId; LEVEL_COUNT] = [ impl ColumnId for PriceBandId { type Row - = [T; PRICE_BAND_COUNT] + = PriceBands where T: VecValue; @@ -378,21 +433,21 @@ impl ColumnId for PriceBandId { #[inline] fn get(self, row: &Self::Row) -> &T { - &row[self.index()] + self.select(row) } #[inline] fn get_mut(self, row: &mut Self::Row) -> &mut T { - &mut row[self.index()] + self.select_mut(row) } #[inline] - fn from_fn(mut create: F) -> Self::Row + fn from_fn(create: F) -> Self::Row where T: VecValue, F: FnMut(Self) -> T, { - std::array::from_fn(|index| create(PRICE_BAND_IDS[index])) + PriceBands::from_fn(create) } #[inline] @@ -406,14 +461,13 @@ impl ColumnId for PriceBandId { } } -#[derive(Debug, Clone, Copy, PartialEq, Traversable)] -pub struct Percentiles { - pub pct95: T, - pub pct98: T, - pub pct99: T, - pub pct99_5: T, - pub pct99_9: T, -} +impl_named_row_formattable!(Percentiles { + pct95, + pct98, + pct99, + pct99_5, + pct99_9, +}); impl Percentiles { pub(super) fn from_fn(mut create: impl FnMut(LossPercentileId) -> T) -> Self { @@ -436,20 +490,29 @@ impl Percentiles { ] .into_iter() } + + fn map(self, mut map: impl FnMut(T) -> U) -> Percentiles { + Percentiles { + pct95: map(self.pct95), + pct98: map(self.pct98), + pct99: map(self.pct99), + pct99_5: map(self.pct99_5), + pct99_9: map(self.pct99_9), + } + } } -#[derive(Debug, Clone, Copy, PartialEq, Traversable)] -pub struct Levels { - pub pct10: T, - pub pct20: T, - pub pct30: T, - pub pct40: T, - pub pct50: T, - pub pct60: T, - pub pct70: T, - pub pct80: T, - pub pct90: T, -} +impl_named_row_formattable!(Levels { + pct10, + pct20, + pct30, + pct40, + pct50, + pct60, + pct70, + pct80, + pct90, +}); impl Levels { pub(super) fn from_fn(mut create: impl FnMut(LevelId) -> T) -> Self { @@ -465,13 +528,23 @@ impl Levels { pct90: create(LevelId::Pct90), } } + + fn map(self, mut map: impl FnMut(T) -> U) -> Levels { + Levels { + pct10: map(self.pct10), + pct20: map(self.pct20), + pct30: map(self.pct30), + pct40: map(self.pct40), + pct50: map(self.pct50), + pct60: map(self.pct60), + pct70: map(self.pct70), + pct80: map(self.pct80), + pct90: map(self.pct90), + } + } } -#[derive(Debug, Clone, Copy, PartialEq, Traversable)] -pub struct PriceBands { - pub floor: Percentiles, - pub level: Levels, -} +impl_named_row_formattable!(PriceBands { floor, level }); impl PriceBands { pub(super) fn from_fn(mut create: impl FnMut(PriceBandId) -> T) -> Self { @@ -486,6 +559,13 @@ impl PriceBands { level: Levels::from_fn(|id| create(id.price_band())), } } + + fn map(self, mut map: impl FnMut(T) -> U) -> PriceBands { + PriceBands { + floor: self.floor.map(&mut map), + level: self.level.map(map), + } + } } impl LossPercentileId { @@ -500,34 +580,6 @@ impl PriceBandId { } } -#[derive(Deref, DerefMut, Traversable)] -pub struct ModeVecs { - pub loss_threshold: ColumnarDailyMetric< - StoredF64, - LossPercentileId, - Percentiles>, - M, - >, - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub prices: - ColumnarDailyMetric>, M>, -} - -#[derive(Traversable)] -pub struct WeightedModes { - pub cointime: T, - pub coinflow: T, - pub coinflow_8y: T, - pub coinflow_4y: T, - pub coinflow_2y: T, - pub coinflow_1y: T, - pub coinflow_6m: T, - pub coinflow_3m: T, - pub coinflow_1m: T, -} - impl WeightedModes { pub(super) fn from_fn(mut create: impl FnMut(WeightedModeId) -> T) -> Self { Self { @@ -618,15 +670,6 @@ impl WeightedModes { } } -#[derive(Deref, DerefMut, Traversable)] -pub struct Modes { - pub raw: T, - #[deref] - #[deref_mut] - #[traversable(flatten)] - pub weighted: WeightedModes, -} - impl Modes { pub(super) fn from_fn(mut create: impl FnMut(ModeId) -> T) -> Self { Self { @@ -687,41 +730,83 @@ mod tests { use vecdb::ColumnId; use super::{ - LOSS_PERCENTILE_IDS, LossPercentileId, ModeId, Modes, PRICE_BAND_IDS, PriceBandId, - WeightedModeId, + LOSS_PERCENTILE_IDS, Levels, LossPercentileId, ModeId, Modes, PRICE_BAND_IDS, Percentiles, + PriceBandId, PriceBands, WeightedModeId, }; #[test] fn bedrock_columns_match_public_band_order() { assert_eq!(LossPercentileId::ALL, LOSS_PERCENTILE_IDS); + let percentiles = LossPercentileId::from_fn(|percentile| percentile); assert_eq!( - LossPercentileId::from_fn(|percentile| percentile), - LOSS_PERCENTILE_IDS + percentiles, + Percentiles { + pct95: LossPercentileId::Pct95, + pct98: LossPercentileId::Pct98, + pct99: LossPercentileId::Pct99, + pct99_5: LossPercentileId::Pct99_5, + pct99_9: LossPercentileId::Pct99_9, + }, ); assert_eq!(PriceBandId::ALL, PRICE_BAND_IDS); - assert_eq!(PriceBandId::from_fn(|band| band), PRICE_BAND_IDS); + let bands = PriceBandId::from_fn(|band| band); assert_eq!( - LossPercentileId::from_fn(LossPercentileId::suffix), - ["pct95", "pct98", "pct99", "pct99_5", "pct99_9"] + bands, + PriceBands { + floor: Percentiles { + pct95: PriceBandId::FloorPct95, + pct98: PriceBandId::FloorPct98, + pct99: PriceBandId::FloorPct99, + pct99_5: PriceBandId::FloorPct99_5, + pct99_9: PriceBandId::FloorPct99_9, + }, + level: Levels { + pct10: PriceBandId::LevelPct10, + pct20: PriceBandId::LevelPct20, + pct30: PriceBandId::LevelPct30, + pct40: PriceBandId::LevelPct40, + pct50: PriceBandId::LevelPct50, + pct60: PriceBandId::LevelPct60, + pct70: PriceBandId::LevelPct70, + pct80: PriceBandId::LevelPct80, + pct90: PriceBandId::LevelPct90, + }, + }, ); + let suffixes = LossPercentileId::from_fn(LossPercentileId::suffix); assert_eq!( - PriceBandId::from_fn(PriceBandId::suffix), - [ - "floor_pct95", - "floor_pct98", - "floor_pct99", - "floor_pct99_5", - "floor_pct99_9", - "level_pct10", - "level_pct20", - "level_pct30", - "level_pct40", - "level_pct50", - "level_pct60", - "level_pct70", - "level_pct80", - "level_pct90", - ] + suffixes, + Percentiles { + pct95: "pct95", + pct98: "pct98", + pct99: "pct99", + pct99_5: "pct99_5", + pct99_9: "pct99_9", + }, + ); + let suffixes = PriceBandId::from_fn(PriceBandId::suffix); + assert_eq!( + suffixes, + PriceBands { + floor: Percentiles { + pct95: "floor_pct95", + pct98: "floor_pct98", + pct99: "floor_pct99", + pct99_5: "floor_pct99_5", + pct99_9: "floor_pct99_9", + }, + level: Levels { + pct10: "level_pct10", + pct20: "level_pct20", + pct30: "level_pct30", + pct40: "level_pct40", + pct50: "level_pct50", + pct60: "level_pct60", + pct70: "level_pct70", + pct80: "level_pct80", + pct90: "level_pct90", + }, + }, ); } diff --git a/crates/brk_computer/src/models/bedrock/weighted/mod.rs b/crates/brk_computer/src/models/bedrock/weighted/mod.rs new file mode 100644 index 000000000..0d4e66d6b --- /dev/null +++ b/crates/brk_computer/src/models/bedrock/weighted/mod.rs @@ -0,0 +1,3 @@ +mod modes; + +pub(crate) use modes::WeightedModes; diff --git a/crates/brk_computer/src/models/bedrock/weighted/modes.rs b/crates/brk_computer/src/models/bedrock/weighted/modes.rs new file mode 100644 index 000000000..d0d4edbd7 --- /dev/null +++ b/crates/brk_computer/src/models/bedrock/weighted/modes.rs @@ -0,0 +1,14 @@ +use brk_traversable::Traversable; + +#[derive(Traversable)] +pub struct WeightedModes { + pub cointime: T, + pub coinflow: T, + pub coinflow_8y: T, + pub coinflow_4y: T, + pub coinflow_2y: T, + pub coinflow_1y: T, + pub coinflow_6m: T, + pub coinflow_3m: T, + pub coinflow_1m: T, +} diff --git a/crates/brk_computer/src/models/capital_sentiment/compute.rs b/crates/brk_computer/src/models/capital_sentiment/compute.rs index bc537c214..9b8348a24 100644 --- a/crates/brk_computer/src/models/capital_sentiment/compute.rs +++ b/crates/brk_computer/src/models/capital_sentiment/compute.rs @@ -24,30 +24,27 @@ impl Vecs { let spot = &prices.spot.cents.height; let sma = &moving_average.sma._1y.cents.height; let all = &distribution - .utxo_cohorts - .all - .metrics + .cohorts .realized - .capitalized - .price + .capitalized_price + .series + .all .cents .height; let sth = &distribution - .utxo_cohorts - .sth - .metrics + .cohorts .realized - .capitalized - .price + .capitalized_price + .series + .sth .cents .height; let lth = &distribution - .utxo_cohorts - .lth - .metrics + .cohorts .realized - .capitalized - .price + .capitalized_price + .series + .lth .cents .height; let first_height = &indexes.day1.first_height; diff --git a/crates/brk_computer/src/models/compute.rs b/crates/brk_computer/src/models/compute.rs index 2ea555ea4..e600a1e3a 100644 --- a/crates/brk_computer/src/models/compute.rs +++ b/crates/brk_computer/src/models/compute.rs @@ -3,7 +3,10 @@ use brk_indexer::Indexer; use vecdb::Exit; use super::Vecs; -use crate::{distribution, frameworks, indexes, market, price}; +use crate::{ + distribution::{self, UTXOStates}, + frameworks, indexes, market, price, +}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -13,6 +16,7 @@ impl Vecs { indexes: &indexes::Vecs, prices: &price::Vecs, distribution: &distribution::Vecs, + utxo_states: &UTXOStates, frameworks: &frameworks::Vecs, moving_average: &market::MovingAverageVecs, exit: &Exit, @@ -23,8 +27,8 @@ impl Vecs { indexer, indexes, distribution, - &frameworks.cointime, - &frameworks.coinflow, + utxo_states, + frameworks, exit, )?; self.capital_sentiment.compute( diff --git a/crates/brk_computer/src/models/rarity_meter/components.rs b/crates/brk_computer/src/models/rarity_meter/components.rs index e7493746b..fe3a6e974 100644 --- a/crates/brk_computer/src/models/rarity_meter/components.rs +++ b/crates/brk_computer/src/models/rarity_meter/components.rs @@ -185,10 +185,9 @@ impl Components { cointime: &cointime::Vecs, coinflow: &coinflow::Vecs, ) -> Result { - let utxos = &distribution.utxo_cohorts; - let all = &utxos.all.metrics.realized; - let sth = &utxos.sth.metrics.realized; - let lth = &utxos.lth.metrics.realized; + let utxos = &distribution.cohorts; + let realized_price = &utxos.realized.price.cohorts; + let capitalized_price = &utxos.realized.capitalized_price.series; macro_rules! import { ($name:expr, $source:expr) => { @@ -197,27 +196,21 @@ impl Components { } Ok(Self { - realized_price: import!("realized_price", all.price), - capitalized_price: import!("capitalized_price", all.capitalized.price), - sth_realized_price: import!("sth_realized_price", sth.price), - sth_capitalized_price: import!("sth_capitalized_price", sth.capitalized.price), - lth_realized_price: import!("lth_realized_price", lth.price), - lth_capitalized_price: import!("lth_capitalized_price", lth.capitalized.price), - over_6m_realized_price: import!( - "over_6m_realized_price", - utxos.over_age._6m.metrics.realized.price - ), - over_4m_realized_price: import!( - "over_4m_realized_price", - utxos.over_age._4m.metrics.realized.price - ), + realized_price: import!("realized_price", realized_price.all), + capitalized_price: import!("capitalized_price", capitalized_price.all), + sth_realized_price: import!("sth_realized_price", realized_price.term.short), + sth_capitalized_price: import!("sth_capitalized_price", capitalized_price.sth), + lth_realized_price: import!("lth_realized_price", realized_price.term.long), + lth_capitalized_price: import!("lth_capitalized_price", capitalized_price.lth), + over_6m_realized_price: import!("over_6m_realized_price", realized_price.age.over._6m), + over_4m_realized_price: import!("over_4m_realized_price", realized_price.age.over._4m), under_4m_realized_price: import!( "under_4m_realized_price", - utxos.under_age._4m.metrics.realized.price + realized_price.age.under._4m ), under_6m_realized_price: import!( "under_6m_realized_price", - utxos.under_age._6m.metrics.realized.price + realized_price.age.under._6m ), vaulted_price: import!("vaulted_price", cointime.prices.vaulted), active_price: import!("active_price", cointime.prices.active), @@ -239,10 +232,9 @@ impl Components { exit: &Exit, ) -> Result<()> { let starting_lengths = indexer.safe_lengths(); - let utxos = &distribution.utxo_cohorts; - let all = &utxos.all.metrics.realized; - let sth = &utxos.sth.metrics.realized; - let lth = &utxos.lth.metrics.realized; + let utxos = &distribution.cohorts; + let realized_price = &utxos.realized.price.cohorts; + let capitalized_price = &utxos.realized.capitalized_price.series; macro_rules! compute { ($component:ident, $source:expr) => { @@ -251,28 +243,16 @@ impl Components { }; } - compute!(realized_price, &all.price); - compute!(capitalized_price, &all.capitalized.price); - compute!(sth_realized_price, &sth.price); - compute!(sth_capitalized_price, &sth.capitalized.price); - compute!(lth_realized_price, <h.price); - compute!(lth_capitalized_price, <h.capitalized.price); - compute!( - over_6m_realized_price, - &utxos.over_age._6m.metrics.realized.price - ); - compute!( - over_4m_realized_price, - &utxos.over_age._4m.metrics.realized.price - ); - compute!( - under_4m_realized_price, - &utxos.under_age._4m.metrics.realized.price - ); - compute!( - under_6m_realized_price, - &utxos.under_age._6m.metrics.realized.price - ); + compute!(realized_price, &realized_price.all); + compute!(capitalized_price, &capitalized_price.all); + compute!(sth_realized_price, &realized_price.term.short); + compute!(sth_capitalized_price, &capitalized_price.sth); + compute!(lth_realized_price, &realized_price.term.long); + compute!(lth_capitalized_price, &capitalized_price.lth); + compute!(over_6m_realized_price, &realized_price.age.over._6m); + compute!(over_4m_realized_price, &realized_price.age.over._4m); + compute!(under_4m_realized_price, &realized_price.age.under._4m); + compute!(under_6m_realized_price, &realized_price.age.under._6m); compute!(vaulted_price, &cointime.prices.vaulted); compute!(active_price, &cointime.prices.active); compute!(true_market_mean_price, &cointime.prices.true_market_mean); diff --git a/crates/brk_computer/src/models/rarity_meter/mod.rs b/crates/brk_computer/src/models/rarity_meter/mod.rs index b0a3fdee7..7504fae36 100644 --- a/crates/brk_computer/src/models/rarity_meter/mod.rs +++ b/crates/brk_computer/src/models/rarity_meter/mod.rs @@ -68,18 +68,18 @@ impl RarityMeter { exit: &Exit, ) -> Result<()> { let spot = &prices.spot.cents.height; - let all = &distribution.utxo_cohorts.all.metrics; - let realized = &all.realized; + let metrics = &distribution.cohorts; + let realized = &metrics.realized; self.components .compute(indexer, distribution, cointime, coinflow, exit)?; self.extremes.compute( indexer, - &all.supply.in_loss.btc.height, - &realized.profit.sum._24h.usd.height, - &realized.loss.sum._24h.usd.height, - &realized.peak_regret.value.sum._24h.usd.height, - &realized.sell_side_risk_ratio._24h.percent.height, + &metrics.supply.in_loss.cohorts.all.btc.height, + &realized.profit.cohorts.all.sum._24h.usd.height, + &realized.loss.cohorts.all.sum._24h.usd.height, + &realized.peak_regret.series.all.sum._24h.usd.height, + &realized.sell_side_risk_ratio.all._24h.percent.height, exit, )?; diff --git a/crates/brk_computer/src/supply/import.rs b/crates/brk_computer/src/supply/import.rs index 68adc6a60..e767681a9 100644 --- a/crates/brk_computer/src/supply/import.rs +++ b/crates/brk_computer/src/supply/import.rs @@ -30,10 +30,10 @@ impl Vecs { let db = open_db(parent, super::DB_NAME, 1_000_000)?; let version = parent_version + VERSION; - let supply_metrics = &sources.distribution().utxo_cohorts.all.metrics.supply; + let supply_metrics = &sources.distribution().cohorts.supply.total.cohorts.all; let circulating = - LazyValuePerBlock::spot_identity("circulating_supply", &supply_metrics.total, version); + LazyValuePerBlock::spot_identity("circulating_supply", supply_metrics, version); let burned = burned::Vecs::forced_import(&db, version, indexes)?; @@ -41,7 +41,7 @@ impl Vecs { let inflation_source = LazyWindowVec::::new( "inflation_rate_ppm_source", inflation_version, - supply_metrics.total.sats.height.read_only_boxed_clone(), + supply_metrics.sats.height.read_only_boxed_clone(), cached_starts._1y.read_only_cached_boxed_clone(), false, |current, previous, _| { @@ -68,8 +68,7 @@ impl Vecs { )?; // Market cap - lazy fiat (cents + usd) from distribution supply - let market_cap = - LazyFiatPerBlock::from_lazy("market_cap", version, &supply_metrics.total.cents); + let market_cap = LazyFiatPerBlock::from_lazy("market_cap", version, &supply_metrics.cents); // Market cap delta (change + rate across 4 windows) let market_cap_delta = LazyRollingDeltasFiatFromHeight::new( @@ -83,11 +82,11 @@ impl Vecs { let growth_version = version + Version::new(3); let realized_cap = &sources .distribution() - .utxo_cohorts - .all - .metrics + .cohorts .realized .cap + .cohorts + .all .cents .height; let market_minus_realized_cap_growth_rate = diff --git a/crates/brk_traversable_derive/src/lib.rs b/crates/brk_traversable_derive/src/lib.rs index ac5577d12..53d70de07 100644 --- a/crates/brk_traversable_derive/src/lib.rs +++ b/crates/brk_traversable_derive/src/lib.rs @@ -131,6 +131,15 @@ fn is_box_type(ty: &Type) -> bool { ) } +fn is_phantom_data_type(ty: &Type) -> bool { + matches!( + ty, + Type::Path(type_path) + if type_path.path.segments.last() + .is_some_and(|segment| segment.ident == "PhantomData") + ) +} + /// Extract the inner type from `Option`, returning `Some(&T)`. fn extract_option_inner(ty: &Type) -> Option<&Type> { if let Type::Path(type_path) = ty @@ -741,6 +750,9 @@ fn gen_roc_field_value( if is_option_type(&field.ty) { return quote! { None }; } + if is_phantom_data_type(&field.ty) { + return quote! { std::marker::PhantomData }; + } return quote! { #self_access.clone() }; } diff --git a/crates/vecdb/src/traits/printable.rs b/crates/vecdb/src/traits/printable.rs index bb76708f0..bf2a2a848 100644 --- a/crates/vecdb/src/traits/printable.rs +++ b/crates/vecdb/src/traits/printable.rs @@ -64,19 +64,6 @@ fn shorten_type_name(full: &str) -> String { } } -#[cfg(test)] -mod tests { - use super::shorten_type_name; - - #[test] - fn shortens_array_element_paths_without_dropping_brackets() { - assert_eq!( - shorten_type_name("[some::module::Value; 23]"), - "[Value; 23]" - ); - } -} - /// Split generic parameters respecting nested angle brackets. /// `A, B, E` -> ["A", "B", "E"] fn split_generic_params(params: &str) -> Vec<&str> { @@ -118,3 +105,16 @@ impl PrintableIndex for usize { &["usize"] } } + +#[cfg(test)] +mod tests { + use super::shorten_type_name; + + #[test] + fn shortens_array_element_paths_without_dropping_brackets() { + assert_eq!( + shorten_type_name("[some::module::Value; 23]"), + "[Value; 23]" + ); + } +} diff --git a/crates/vecdb/src/variants/columnar/column.rs b/crates/vecdb/src/variants/columnar/column.rs new file mode 100644 index 000000000..6c8a75c25 --- /dev/null +++ b/crates/vecdb/src/variants/columnar/column.rs @@ -0,0 +1,32 @@ +use std::sync::Arc; + +use crate::Version; + +use super::{ColumnId, ReadableColumnarVec}; + +/// Lazy scalar projection of one columnar source. +pub struct LazyColumnVec +where + C: ColumnId, + S: ReadableColumnarVec, +{ + pub(super) name: Arc, + pub(super) base_version: Version, + pub(super) source: S, + pub(super) column: C, +} + +impl Clone for LazyColumnVec +where + C: ColumnId, + S: ReadableColumnarVec, +{ + fn clone(&self) -> Self { + Self { + name: Arc::clone(&self.name), + base_version: self.base_version, + source: self.source.clone(), + column: self.column, + } + } +} diff --git a/crates/vecdb/src/variants/columnar/lazy.rs b/crates/vecdb/src/variants/columnar/lazy.rs index 8cb4fdb6f..51a034f48 100644 --- a/crates/vecdb/src/variants/columnar/lazy.rs +++ b/crates/vecdb/src/variants/columnar/lazy.rs @@ -66,7 +66,7 @@ where T: VecValue, { fn version(&self) -> Version { - self.base_version + self.source.version() + self.base_version.combine(self.source.version()) } fn name(&self) -> &str { diff --git a/crates/vecdb/src/variants/columnar/mod.rs b/crates/vecdb/src/variants/columnar/mod.rs index 78d5acace..59a2e043a 100644 --- a/crates/vecdb/src/variants/columnar/mod.rs +++ b/crates/vecdb/src/variants/columnar/mod.rs @@ -1,4 +1,4 @@ -use std::{marker::PhantomData, sync::Arc}; +use std::sync::Arc; use parking_lot::RwLock; @@ -7,20 +7,24 @@ use crate::{ Version, }; +mod column; mod lazy; mod read; +mod read_only; mod schema; mod sum; mod traits; +pub use column::*; pub use lazy::*; +pub use read_only::*; pub use schema::*; pub use sum::*; use read::read_rows; use schema::validate_schema; -const VERSION: Version = Version::new(7); +const VERSION: Version = Version::new(8); #[inline] pub(super) const fn rows_per_block() -> usize { @@ -53,60 +57,6 @@ where gate: Arc>, } -/// Lean read-only clone of a [`ColumnarVec`]. -pub struct ReadOnlyColumnarVec -where - V: StoredVec, - C: ColumnId, -{ - vec: V::ReadOnly, - visible_rows: SharedLen, - gate: Arc>, - columns: PhantomData, -} - -impl Clone for ReadOnlyColumnarVec -where - V: StoredVec, - C: ColumnId, -{ - fn clone(&self) -> Self { - Self { - vec: self.vec.clone(), - visible_rows: self.visible_rows.clone(), - gate: Arc::clone(&self.gate), - columns: PhantomData, - } - } -} - -/// Lazy scalar projection of one columnar source. -pub struct LazyColumnVec -where - C: ColumnId, - S: ReadableColumnarVec, -{ - name: Arc, - base_version: Version, - source: S, - column: C, -} - -impl Clone for LazyColumnVec -where - C: ColumnId, - S: ReadableColumnarVec, -{ - fn clone(&self) -> Self { - Self { - name: Arc::clone(&self.name), - base_version: self.base_version, - source: self.source.clone(), - column: self.column, - } - } -} - impl ColumnarVec where V: StoredVec, @@ -139,7 +89,11 @@ where fn import_inner(mut options: ImportOptions, forced: bool) -> Result { Self::validate_layout()?; let columns = u32::try_from(Self::COLUMN_COUNT).map_err(|_| Error::Overflow)?; - options.version = options.version + VERSION + C::VERSION + Version::new(columns); + options.version = options + .version + .combine(VERSION) + .combine(C::VERSION) + .combine(Version::new(columns)); options.initial_capacity = Some( options .initial_capacity @@ -176,7 +130,7 @@ where vec: self.vec.read_only_clone(), visible_rows: self.visible_rows.clone(), gate: Arc::clone(&self.gate), - columns: PhantomData, + columns: std::marker::PhantomData, } } diff --git a/crates/vecdb/src/variants/columnar/read_only.rs b/crates/vecdb/src/variants/columnar/read_only.rs new file mode 100644 index 000000000..af5731ce2 --- /dev/null +++ b/crates/vecdb/src/variants/columnar/read_only.rs @@ -0,0 +1,34 @@ +use std::{marker::PhantomData, sync::Arc}; + +use parking_lot::RwLock; + +use crate::{SharedLen, StoredVec}; + +use super::ColumnId; + +/// Lean read-only clone of a columnar vector. +pub struct ReadOnlyColumnarVec +where + V: StoredVec, + C: ColumnId, +{ + pub(super) vec: V::ReadOnly, + pub(super) visible_rows: SharedLen, + pub(super) gate: Arc>, + pub(super) columns: PhantomData, +} + +impl Clone for ReadOnlyColumnarVec +where + V: StoredVec, + C: ColumnId, +{ + fn clone(&self) -> Self { + Self { + vec: self.vec.clone(), + visible_rows: self.visible_rows.clone(), + gate: Arc::clone(&self.gate), + columns: PhantomData, + } + } +} diff --git a/crates/vecdb/src/variants/columnar/schema.rs b/crates/vecdb/src/variants/columnar/schema.rs index d631377d5..baa4aa5cf 100644 --- a/crates/vecdb/src/variants/columnar/schema.rs +++ b/crates/vecdb/src/variants/columnar/schema.rs @@ -32,6 +32,15 @@ pub trait ColumnId: Copy + Debug + Eq + Ord + Send + Sync + 'static { T: VecValue, U: VecValue, F: FnMut(T) -> U; + + fn map_ref(row: &Self::Row, mut f: F) -> Self::Row + where + T: VecValue, + U: VecValue, + F: FnMut(&T) -> U, + { + Self::from_fn(|column| f(column.get(row))) + } } /// Read-only access to a source that preserves typed column boundaries. diff --git a/crates/vecdb/src/variants/columnar/sum.rs b/crates/vecdb/src/variants/columnar/sum.rs index c40b8c30f..4e6736738 100644 --- a/crates/vecdb/src/variants/columnar/sum.rs +++ b/crates/vecdb/src/variants/columnar/sum.rs @@ -75,7 +75,12 @@ where S: ReadableColumnarVec, { fn version(&self) -> Version { - self.base_version + self.source.version() + Version::from(self.columns.len()) + self.columns.iter().fold( + self.base_version + .combine(self.source.version()) + .combine(Version::from(self.columns.len())), + |version, column| version.combine(Version::from(column.index() + 1)), + ) } fn name(&self) -> &str { diff --git a/crates/vecdb/src/variants/columnar/traits.rs b/crates/vecdb/src/variants/columnar/traits.rs index 2134f88c8..151790dc7 100644 --- a/crates/vecdb/src/variants/columnar/traits.rs +++ b/crates/vecdb/src/variants/columnar/traits.rs @@ -106,7 +106,9 @@ where S: ReadableColumnarVec, { fn version(&self) -> Version { - self.base_version + self.source.version() + Version::ONE + self.base_version + .combine(self.source.version()) + .combine(Version::from(self.column.index() + 1)) } fn name(&self) -> &str { diff --git a/crates/vecdb/src/version/add.rs b/crates/vecdb/src/version/add.rs index 07bfce053..55bec4ca5 100644 --- a/crates/vecdb/src/version/add.rs +++ b/crates/vecdb/src/version/add.rs @@ -5,6 +5,16 @@ use super::Version; impl Add for Version { type Output = Self; fn add(self, rhs: Version) -> Self::Output { - Self(self.0 + rhs.0) + Self(self.0.wrapping_add(rhs.0)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn addition_has_identical_debug_and_release_semantics() { + assert_eq!(Version::new(u32::MAX) + Version::ONE, Version::ZERO); } } diff --git a/crates/vecdb/src/version/mod.rs b/crates/vecdb/src/version/mod.rs index fe97352e9..0f93bf6e3 100644 --- a/crates/vecdb/src/version/mod.rs +++ b/crates/vecdb/src/version/mod.rs @@ -29,6 +29,23 @@ impl Version { Self(v) } + /// Combines ordered version components without component cancellation from addition. + pub const fn combine(self, other: Self) -> Self { + Self( + self.0 + ^ other + .0 + .wrapping_add(0x9e37_79b9) + .wrapping_add(self.0 << 6) + .wrapping_add(self.0 >> 2), + ) + } + + #[inline] + pub fn combine_all(versions: impl IntoIterator) -> Self { + versions.into_iter().fold(Self::ZERO, Self::combine) + } + pub fn write(&self, path: &Path) -> Result<(), io::Error> { fs::write(path, self.to_bytes().as_ref()) } diff --git a/crates/vecdb/tests/columnar.rs b/crates/vecdb/tests/columnar.rs index 3507cb97e..44025f091 100644 --- a/crates/vecdb/tests/columnar.rs +++ b/crates/vecdb/tests/columnar.rs @@ -67,6 +67,7 @@ macro_rules! column_ids { column_ids!(TestColumn, 3, Version::ONE, [First, Second, Third]); column_ids!(ChangedTestColumn, 3, Version::TWO, [First, Second, Third]); +column_ids!(TwoColumn, 2, Version::TWO, [First, Second]); column_ids!( FiveColumn, 5, @@ -348,7 +349,7 @@ fn columnar_sum_accepts_stored_and_lazy_sources() -> Result<()> { source.clone(), [TestColumn::First, TestColumn::Second], ); - assert_eq!(stored_sum.version(), same_length_sum.version()); + assert_ne!(stored_sum.version(), same_length_sum.version()); let shorter_sum = LazyColumnSumVec::new( "shorter_sum", Version::ONE, @@ -459,6 +460,23 @@ fn column_count_is_part_of_storage_version() -> Result<()> { Ok(()) } +#[test] +fn column_schema_and_count_cannot_cancel_each_other() -> Result<()> { + type ThreeColumns = ColumnarVec, TestColumn>; + type TwoChangedColumns = ColumnarVec, TwoColumn>; + + let temp = tempdir()?; + let db = Database::open(temp.path())?; + let mut vec = ThreeColumns::forced_import(&db, "schema_count_collision", Version::ONE)?; + vec.push(row(0)); + vec.push(row(1)); + vec.write()?; + drop(vec); + + assert!(TwoChangedColumns::import(&db, "schema_count_collision", Version::ONE).is_err()); + Ok(()) +} + #[test] fn column_schema_version_is_part_of_storage_version() -> Result<()> { type Original = ColumnarVec, TestColumn>; @@ -620,11 +638,25 @@ fn pco_repeated_small_writes_compress_completed_pages_and_keep_tail_raw() -> Res #[test] fn concurrent_projection_reads_survive_incremental_writes() -> Result<()> { - type V = ColumnarVec, TestColumn>; + run_concurrent_projection_reads::>() +} + +#[cfg(feature = "pco")] +#[test] +fn pco_concurrent_projection_reads_survive_incremental_writes() -> Result<()> { + run_concurrent_projection_reads::>() +} + +fn run_concurrent_projection_reads() -> Result<()> +where + V: StoredVec + 'static, + V::ReadOnly: Send + Sync, +{ + type C = TestColumn; let temp = tempdir()?; let db = Database::open(temp.path())?; - let mut vec = V::forced_import(&db, "concurrent", Version::ONE)?; + let mut vec = ColumnarVec::::forced_import(&db, "concurrent", Version::ONE)?; for index in 0..1_000 { vec.push(row(index)); } diff --git a/experiments/brk/index.html b/experiments/brk/index.html new file mode 100644 index 000000000..7cfb62b16 --- /dev/null +++ b/experiments/brk/index.html @@ -0,0 +1,2668 @@ + + + + + + + +Brk Landing Story + + + + + + diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 7d2868352..a4f6a1d4a 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -716,6 +716,22 @@ ancestors and no descendants (matches mempool.space). * * @typedef {number} Limit */ +/** + * 9 "at least X% loss" aggregate thresholds. + * + * Each is a suffix sum over the profitability ranges, from most loss-making up. + * + * @typedef {Object} Loss + * @property {PartsPerMillionSigned32} all + * @property {PartsPerMillionSigned32} _10pct + * @property {PartsPerMillionSigned32} _20pct + * @property {PartsPerMillionSigned32} _30pct + * @property {PartsPerMillionSigned32} _40pct + * @property {PartsPerMillionSigned32} _50pct + * @property {PartsPerMillionSigned32} _60pct + * @property {PartsPerMillionSigned32} _70pct + * @property {PartsPerMillionSigned32} _80pct + */ /** * Lowest price value for a time period * @@ -994,6 +1010,70 @@ ancestors and no descendants (matches mempool.space). * @property {Timestamp} time - Unix timestamp * @property {Dollars} uSD - BTC/USD price */ +/** + * 14 "at least X% profit" aggregate thresholds. + * + * Each is a prefix sum over the profitability ranges, from most profitable down. + * + * @typedef {Object} Profit + * @property {PartsPerMillionSigned32} all + * @property {PartsPerMillionSigned32} _10pct + * @property {PartsPerMillionSigned32} _20pct + * @property {PartsPerMillionSigned32} _30pct + * @property {PartsPerMillionSigned32} _40pct + * @property {PartsPerMillionSigned32} _50pct + * @property {PartsPerMillionSigned32} _60pct + * @property {PartsPerMillionSigned32} _70pct + * @property {PartsPerMillionSigned32} _80pct + * @property {PartsPerMillionSigned32} _90pct + * @property {PartsPerMillionSigned32} _100pct + * @property {PartsPerMillionSigned32} _200pct + * @property {PartsPerMillionSigned32} _300pct + * @property {PartsPerMillionSigned32} _500pct + */ +/** + * 25 profitability range buckets ordered from most profitable to most in loss. + * + * During the k-way merge (ascending price order), the cursor starts at bucket 0 + * (over_1000pct_in_profit, lowest cost basis) and advances as price crosses each boundary. + * + * @typedef {Object} ProfitabilityRange + * @property {Sats} over1000pctInProfit + * @property {Sats} _500pctTo1000pctInProfit + * @property {Sats} _300pctTo500pctInProfit + * @property {Sats} _200pctTo300pctInProfit + * @property {Sats} _100pctTo200pctInProfit + * @property {Sats} _90pctTo100pctInProfit + * @property {Sats} _80pctTo90pctInProfit + * @property {Sats} _70pctTo80pctInProfit + * @property {Sats} _60pctTo70pctInProfit + * @property {Sats} _50pctTo60pctInProfit + * @property {Sats} _40pctTo50pctInProfit + * @property {Sats} _30pctTo40pctInProfit + * @property {Sats} _20pctTo30pctInProfit + * @property {Sats} _10pctTo20pctInProfit + * @property {Sats} _0pctTo10pctInProfit + * @property {Sats} _0pctTo10pctInLoss + * @property {Sats} _10pctTo20pctInLoss + * @property {Sats} _20pctTo30pctInLoss + * @property {Sats} _30pctTo40pctInLoss + * @property {Sats} _40pctTo50pctInLoss + * @property {Sats} _50pctTo60pctInLoss + * @property {Sats} _60pctTo70pctInLoss + * @property {Sats} _70pctTo80pctInLoss + * @property {Sats} _80pctTo90pctInLoss + * @property {Sats} _90pctTo100pctInLoss + */ +/** + * @typedef {Object} ProfitabilityRange + * @property {ProfitabilityRange} short + * @property {ProfitabilityRange} long + */ +/** + * @typedef {Object} ProfitabilityRange + * @property {ProfitabilityRange} short + * @property {ProfitabilityRange} long + */ /** * A range boundary: integer index, date, or timestamp. * @@ -1492,7 +1572,6 @@ on serialization otherwise. /** @typedef {Bytes[]} [Bytes; 4] */ /** @typedef {Cents[]} [Cents; 16] */ /** @typedef {Cents[]} [Cents; 19] */ -/** @typedef {Cents[]} [Cents; 23] */ /** @typedef {Dollars[]} [Dollars; 3] */ /** @typedef {PartsPerMillion32[]} [PartsPerMillion32; 19] */ /** @typedef {PartsPerMillion32[]} [PartsPerMillion32; 4] */ @@ -1501,12 +1580,9 @@ on serialization otherwise. /** @typedef {Sats[]} [Sats; 8] */ /** @typedef {StoredF32[]} [StoredF32; 3] */ /** @typedef {StoredF32[]} [StoredF32; 4] */ -/** @typedef {StoredF64[]} [StoredF64; 23] */ /** @typedef {StoredF64[]} [StoredF64; 3] */ /** @typedef {StoredF64[]} [StoredF64; 4] */ -/** @typedef {StoredU16[]} [StoredU16; 11] */ /** @typedef {StoredU16[]} [StoredU16; 12] */ -/** @typedef {StoredU64[]} [StoredU64; 11] */ /** @typedef {StoredU64[]} [StoredU64; 12] */ /** @typedef {StoredU64[]} [StoredU64; 23] */ /** @typedef {StoredU64[]} [StoredU64; 4] */ @@ -2532,6 +2608,35 @@ function createSeriesPattern35(client, name) { return /** @type {SeriesPattern35 // Reusable structural pattern factories +/** + * @typedef {Object} _0pct100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctOverPattern2 + * @property {AllLthSthPattern} _0pctTo10pctInLoss + * @property {AllLthSthPattern} _0pctTo10pctInProfit + * @property {AllLthSthPattern} _100pctTo200pctInProfit + * @property {AllLthSthPattern} _10pctTo20pctInLoss + * @property {AllLthSthPattern} _10pctTo20pctInProfit + * @property {AllLthSthPattern} _200pctTo300pctInProfit + * @property {AllLthSthPattern} _20pctTo30pctInLoss + * @property {AllLthSthPattern} _20pctTo30pctInProfit + * @property {AllLthSthPattern} _300pctTo500pctInProfit + * @property {AllLthSthPattern} _30pctTo40pctInLoss + * @property {AllLthSthPattern} _30pctTo40pctInProfit + * @property {AllLthSthPattern} _40pctTo50pctInLoss + * @property {AllLthSthPattern} _40pctTo50pctInProfit + * @property {AllLthSthPattern} _500pctTo1000pctInProfit + * @property {AllLthSthPattern} _50pctTo60pctInLoss + * @property {AllLthSthPattern} _50pctTo60pctInProfit + * @property {AllLthSthPattern} _60pctTo70pctInLoss + * @property {AllLthSthPattern} _60pctTo70pctInProfit + * @property {AllLthSthPattern} _70pctTo80pctInLoss + * @property {AllLthSthPattern} _70pctTo80pctInProfit + * @property {AllLthSthPattern} _80pctTo90pctInLoss + * @property {AllLthSthPattern} _80pctTo90pctInProfit + * @property {AllLthSthPattern} _90pctTo100pctInLoss + * @property {AllLthSthPattern} _90pctTo100pctInProfit + * @property {AllLthSthPattern} over1000pctInProfit + */ + /** * @typedef {Object} _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mCumulativeOverUnderPattern * @property {AverageBlockCumulativeSumPattern} _10yTo12y @@ -2555,7 +2660,7 @@ function createSeriesPattern35(client, name) { return /** @type {SeriesPattern35 * @property {AverageBlockCumulativeSumPattern} _7yTo8y * @property {AverageBlockCumulativeSumPattern} _8yTo10y * @property {AverageBlockCumulativeSumPattern} _9mTo1y - * @property {SeriesPattern18<[StoredF64; 23]>} cumulative + * @property {SeriesPattern18} cumulative * @property {AverageBlockCumulativeSumPattern} over15y * @property {AverageBlockCumulativeSumPattern} under1h */ @@ -2583,11 +2688,39 @@ function createSeriesPattern35(client, name) { return /** @type {SeriesPattern35 * @property {BtcCentsSatsUsdPattern} _7yTo8y * @property {BtcCentsSatsUsdPattern} _8yTo10y * @property {BtcCentsSatsUsdPattern} _9mTo1y - * @property {SeriesPattern18<[Sats; 23]>} height + * @property {SeriesPattern18} height * @property {BtcCentsSatsUsdPattern} over15y * @property {BtcCentsSatsUsdPattern} under1h */ +/** + * @typedef {Object} _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mHeightOverUnderPattern + * @property {SeriesPattern1} _10yTo12y + * @property {SeriesPattern1} _12yTo15y + * @property {SeriesPattern1} _18mTo2y + * @property {SeriesPattern1} _1dTo1w + * @property {SeriesPattern1} _1hTo1d + * @property {SeriesPattern1} _1mTo2m + * @property {SeriesPattern1} _1wTo1m + * @property {SeriesPattern1} _1yTo18m + * @property {SeriesPattern1} _2mTo3m + * @property {SeriesPattern1} _2yTo3y + * @property {SeriesPattern1} _3mTo4m + * @property {SeriesPattern1} _3yTo4y + * @property {SeriesPattern1} _4mTo5m + * @property {SeriesPattern1} _4yTo5y + * @property {SeriesPattern1} _5mTo6m + * @property {SeriesPattern1} _5yTo6y + * @property {SeriesPattern1} _6mTo9m + * @property {SeriesPattern1} _6yTo7y + * @property {SeriesPattern1} _7yTo8y + * @property {SeriesPattern1} _8yTo10y + * @property {SeriesPattern1} _9mTo1y + * @property {SeriesPattern18} height + * @property {SeriesPattern1} over15y + * @property {SeriesPattern1} under1h + */ + /** * @template T * @typedef {Object} AscribeBareBitproofBlockstackCoinColuCumulativeDocproofEmptyEpobcEternityFactomKomodoMemoOmniOpenPoetRunesStacksStamperyTextUnknownVeriPattern3 @@ -2618,30 +2751,201 @@ function createSeriesPattern35(client, name) { return /** @type {SeriesPattern35 */ /** - * @typedef {Object} _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern3 - * @property {SeriesPattern1} _10yTo12y - * @property {SeriesPattern1} _12yTo15y - * @property {SeriesPattern1} _18mTo2y - * @property {SeriesPattern1} _1dTo1w - * @property {SeriesPattern1} _1hTo1d - * @property {SeriesPattern1} _1mTo2m - * @property {SeriesPattern1} _1wTo1m - * @property {SeriesPattern1} _1yTo18m - * @property {SeriesPattern1} _2mTo3m - * @property {SeriesPattern1} _2yTo3y - * @property {SeriesPattern1} _3mTo4m - * @property {SeriesPattern1} _3yTo4y - * @property {SeriesPattern1} _4mTo5m - * @property {SeriesPattern1} _4yTo5y - * @property {SeriesPattern1} _5mTo6m - * @property {SeriesPattern1} _5yTo6y - * @property {SeriesPattern1} _6mTo9m - * @property {SeriesPattern1} _6yTo7y - * @property {SeriesPattern1} _7yTo8y - * @property {SeriesPattern1} _8yTo10y - * @property {SeriesPattern1} _9mTo1y - * @property {SeriesPattern1} over15y - * @property {SeriesPattern1} under1h + * @typedef {Object} _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern + * @property {AverageBlockCumulativeSumPattern} _10yTo12y + * @property {AverageBlockCumulativeSumPattern} _12yTo15y + * @property {AverageBlockCumulativeSumPattern} _18mTo2y + * @property {AverageBlockCumulativeSumPattern} _1dTo1w + * @property {AverageBlockCumulativeSumPattern} _1hTo1d + * @property {AverageBlockCumulativeSumPattern} _1mTo2m + * @property {AverageBlockCumulativeSumPattern} _1wTo1m + * @property {AverageBlockCumulativeSumPattern} _1yTo18m + * @property {AverageBlockCumulativeSumPattern} _2mTo3m + * @property {AverageBlockCumulativeSumPattern} _2yTo3y + * @property {AverageBlockCumulativeSumPattern} _3mTo4m + * @property {AverageBlockCumulativeSumPattern} _3yTo4y + * @property {AverageBlockCumulativeSumPattern} _4mTo5m + * @property {AverageBlockCumulativeSumPattern} _4yTo5y + * @property {AverageBlockCumulativeSumPattern} _5mTo6m + * @property {AverageBlockCumulativeSumPattern} _5yTo6y + * @property {AverageBlockCumulativeSumPattern} _6mTo9m + * @property {AverageBlockCumulativeSumPattern} _6yTo7y + * @property {AverageBlockCumulativeSumPattern} _7yTo8y + * @property {AverageBlockCumulativeSumPattern} _8yTo10y + * @property {AverageBlockCumulativeSumPattern} _9mTo1y + * @property {AverageBlockCumulativeSumPattern} over15y + * @property {AverageBlockCumulativeSumPattern} under1h + */ + +/** + * @typedef {Object} _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2 + * @property {AverageBlockCumulativeSumPattern2} _10yTo12y + * @property {AverageBlockCumulativeSumPattern2} _12yTo15y + * @property {AverageBlockCumulativeSumPattern2} _18mTo2y + * @property {AverageBlockCumulativeSumPattern2} _1dTo1w + * @property {AverageBlockCumulativeSumPattern2} _1hTo1d + * @property {AverageBlockCumulativeSumPattern2} _1mTo2m + * @property {AverageBlockCumulativeSumPattern2} _1wTo1m + * @property {AverageBlockCumulativeSumPattern2} _1yTo18m + * @property {AverageBlockCumulativeSumPattern2} _2mTo3m + * @property {AverageBlockCumulativeSumPattern2} _2yTo3y + * @property {AverageBlockCumulativeSumPattern2} _3mTo4m + * @property {AverageBlockCumulativeSumPattern2} _3yTo4y + * @property {AverageBlockCumulativeSumPattern2} _4mTo5m + * @property {AverageBlockCumulativeSumPattern2} _4yTo5y + * @property {AverageBlockCumulativeSumPattern2} _5mTo6m + * @property {AverageBlockCumulativeSumPattern2} _5yTo6y + * @property {AverageBlockCumulativeSumPattern2} _6mTo9m + * @property {AverageBlockCumulativeSumPattern2} _6yTo7y + * @property {AverageBlockCumulativeSumPattern2} _7yTo8y + * @property {AverageBlockCumulativeSumPattern2} _8yTo10y + * @property {AverageBlockCumulativeSumPattern2} _9mTo1y + * @property {AverageBlockCumulativeSumPattern2} over15y + * @property {AverageBlockCumulativeSumPattern2} under1h + */ + +/** + * Create a _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @param {string} disc - Discriminator suffix + * @returns {_10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2} + */ +function create_10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2(client, acc, disc) { + return { + _10yTo12y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '10y_to_12y_old_transfer_volume'), disc)), + _12yTo15y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '12y_to_15y_old_transfer_volume'), disc)), + _18mTo2y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '18m_to_2y_old_transfer_volume'), disc)), + _1dTo1w: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1d_to_1w_old_transfer_volume'), disc)), + _1hTo1d: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1h_to_1d_old_transfer_volume'), disc)), + _1mTo2m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1m_to_2m_old_transfer_volume'), disc)), + _1wTo1m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1w_to_1m_old_transfer_volume'), disc)), + _1yTo18m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1y_to_18m_old_transfer_volume'), disc)), + _2mTo3m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2m_to_3m_old_transfer_volume'), disc)), + _2yTo3y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2y_to_3y_old_transfer_volume'), disc)), + _3mTo4m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '3m_to_4m_old_transfer_volume'), disc)), + _3yTo4y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '3y_to_4y_old_transfer_volume'), disc)), + _4mTo5m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '4m_to_5m_old_transfer_volume'), disc)), + _4yTo5y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '4y_to_5y_old_transfer_volume'), disc)), + _5mTo6m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '5m_to_6m_old_transfer_volume'), disc)), + _5yTo6y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '5y_to_6y_old_transfer_volume'), disc)), + _6mTo9m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '6m_to_9m_old_transfer_volume'), disc)), + _6yTo7y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '6y_to_7y_old_transfer_volume'), disc)), + _7yTo8y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '7y_to_8y_old_transfer_volume'), disc)), + _8yTo10y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '8y_to_10y_old_transfer_volume'), disc)), + _9mTo1y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '9m_to_1y_old_transfer_volume'), disc)), + over15y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, 'over_15y_old_transfer_volume'), disc)), + under1h: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, 'under_1h_old_transfer_volume'), disc)), + }; +} + +/** + * @typedef {Object} _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern5 + * @property {BlockCumulativeSumPattern} _10yTo12y + * @property {BlockCumulativeSumPattern} _12yTo15y + * @property {BlockCumulativeSumPattern} _18mTo2y + * @property {BlockCumulativeSumPattern} _1dTo1w + * @property {BlockCumulativeSumPattern} _1hTo1d + * @property {BlockCumulativeSumPattern} _1mTo2m + * @property {BlockCumulativeSumPattern} _1wTo1m + * @property {BlockCumulativeSumPattern} _1yTo18m + * @property {BlockCumulativeSumPattern} _2mTo3m + * @property {BlockCumulativeSumPattern} _2yTo3y + * @property {BlockCumulativeSumPattern} _3mTo4m + * @property {BlockCumulativeSumPattern} _3yTo4y + * @property {BlockCumulativeSumPattern} _4mTo5m + * @property {BlockCumulativeSumPattern} _4yTo5y + * @property {BlockCumulativeSumPattern} _5mTo6m + * @property {BlockCumulativeSumPattern} _5yTo6y + * @property {BlockCumulativeSumPattern} _6mTo9m + * @property {BlockCumulativeSumPattern} _6yTo7y + * @property {BlockCumulativeSumPattern} _7yTo8y + * @property {BlockCumulativeSumPattern} _8yTo10y + * @property {BlockCumulativeSumPattern} _9mTo1y + * @property {BlockCumulativeSumPattern} over15y + * @property {BlockCumulativeSumPattern} under1h + */ + +/** + * @typedef {Object} _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern12 + * @property {BtcCentsSatsUsdPattern} _10yTo12y + * @property {BtcCentsSatsUsdPattern} _12yTo15y + * @property {BtcCentsSatsUsdPattern} _18mTo2y + * @property {BtcCentsSatsUsdPattern} _1dTo1w + * @property {BtcCentsSatsUsdPattern} _1hTo1d + * @property {BtcCentsSatsUsdPattern} _1mTo2m + * @property {BtcCentsSatsUsdPattern} _1wTo1m + * @property {BtcCentsSatsUsdPattern} _1yTo18m + * @property {BtcCentsSatsUsdPattern} _2mTo3m + * @property {BtcCentsSatsUsdPattern} _2yTo3y + * @property {BtcCentsSatsUsdPattern} _3mTo4m + * @property {BtcCentsSatsUsdPattern} _3yTo4y + * @property {BtcCentsSatsUsdPattern} _4mTo5m + * @property {BtcCentsSatsUsdPattern} _4yTo5y + * @property {BtcCentsSatsUsdPattern} _5mTo6m + * @property {BtcCentsSatsUsdPattern} _5yTo6y + * @property {BtcCentsSatsUsdPattern} _6mTo9m + * @property {BtcCentsSatsUsdPattern} _6yTo7y + * @property {BtcCentsSatsUsdPattern} _7yTo8y + * @property {BtcCentsSatsUsdPattern} _8yTo10y + * @property {BtcCentsSatsUsdPattern} _9mTo1y + * @property {BtcCentsSatsUsdPattern} over15y + * @property {BtcCentsSatsUsdPattern} under1h + */ + +/** + * @typedef {Object} _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern13 + * @property {CentsUsdPattern3} _10yTo12y + * @property {CentsUsdPattern3} _12yTo15y + * @property {CentsUsdPattern3} _18mTo2y + * @property {CentsUsdPattern3} _1dTo1w + * @property {CentsUsdPattern3} _1hTo1d + * @property {CentsUsdPattern3} _1mTo2m + * @property {CentsUsdPattern3} _1wTo1m + * @property {CentsUsdPattern3} _1yTo18m + * @property {CentsUsdPattern3} _2mTo3m + * @property {CentsUsdPattern3} _2yTo3y + * @property {CentsUsdPattern3} _3mTo4m + * @property {CentsUsdPattern3} _3yTo4y + * @property {CentsUsdPattern3} _4mTo5m + * @property {CentsUsdPattern3} _4yTo5y + * @property {CentsUsdPattern3} _5mTo6m + * @property {CentsUsdPattern3} _5yTo6y + * @property {CentsUsdPattern3} _6mTo9m + * @property {CentsUsdPattern3} _6yTo7y + * @property {CentsUsdPattern3} _7yTo8y + * @property {CentsUsdPattern3} _8yTo10y + * @property {CentsUsdPattern3} _9mTo1y + * @property {CentsUsdPattern3} over15y + * @property {CentsUsdPattern3} under1h + */ + +/** + * @template T + * @typedef {Object} _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern7 + * @property {SeriesPattern1} _10yTo12y + * @property {SeriesPattern1} _12yTo15y + * @property {SeriesPattern1} _18mTo2y + * @property {SeriesPattern1} _1dTo1w + * @property {SeriesPattern1} _1hTo1d + * @property {SeriesPattern1} _1mTo2m + * @property {SeriesPattern1} _1wTo1m + * @property {SeriesPattern1} _1yTo18m + * @property {SeriesPattern1} _2mTo3m + * @property {SeriesPattern1} _2yTo3y + * @property {SeriesPattern1} _3mTo4m + * @property {SeriesPattern1} _3yTo4y + * @property {SeriesPattern1} _4mTo5m + * @property {SeriesPattern1} _4yTo5y + * @property {SeriesPattern1} _5mTo6m + * @property {SeriesPattern1} _5yTo6y + * @property {SeriesPattern1} _6mTo9m + * @property {SeriesPattern1} _6yTo7y + * @property {SeriesPattern1} _7yTo8y + * @property {SeriesPattern1} _8yTo10y + * @property {SeriesPattern1} _9mTo1y + * @property {SeriesPattern1} over15y + * @property {SeriesPattern1} under1h */ /** @@ -2704,60 +3008,309 @@ function createHeightIndexPct0Pct1Pct10Pct2Pct20Pct30Pct40Pct5Pct50Pct60Pct70Pct } /** - * @typedef {Object} HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern - * @property {SeriesPattern18<[Cents; 19]>} height - * @property {CentsSatsUsdPattern} pct05 - * @property {CentsSatsUsdPattern} pct10 - * @property {CentsSatsUsdPattern} pct15 - * @property {CentsSatsUsdPattern} pct20 - * @property {CentsSatsUsdPattern} pct25 - * @property {CentsSatsUsdPattern} pct30 - * @property {CentsSatsUsdPattern} pct35 - * @property {CentsSatsUsdPattern} pct40 - * @property {CentsSatsUsdPattern} pct45 - * @property {CentsSatsUsdPattern} pct50 - * @property {CentsSatsUsdPattern} pct55 - * @property {CentsSatsUsdPattern} pct60 - * @property {CentsSatsUsdPattern} pct65 - * @property {CentsSatsUsdPattern} pct70 - * @property {CentsSatsUsdPattern} pct75 - * @property {CentsSatsUsdPattern} pct80 - * @property {CentsSatsUsdPattern} pct85 - * @property {CentsSatsUsdPattern} pct90 - * @property {CentsSatsUsdPattern} pct95 + * @typedef {Object} _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern + * @property {AverageBlockCumulativeSumPattern} _10y + * @property {AverageBlockCumulativeSumPattern} _12y + * @property {AverageBlockCumulativeSumPattern} _15y + * @property {AverageBlockCumulativeSumPattern} _18m + * @property {AverageBlockCumulativeSumPattern} _1m + * @property {AverageBlockCumulativeSumPattern} _1w + * @property {AverageBlockCumulativeSumPattern} _1y + * @property {AverageBlockCumulativeSumPattern} _2m + * @property {AverageBlockCumulativeSumPattern} _2y + * @property {AverageBlockCumulativeSumPattern} _3m + * @property {AverageBlockCumulativeSumPattern} _3y + * @property {AverageBlockCumulativeSumPattern} _4m + * @property {AverageBlockCumulativeSumPattern} _4y + * @property {AverageBlockCumulativeSumPattern} _5m + * @property {AverageBlockCumulativeSumPattern} _5y + * @property {AverageBlockCumulativeSumPattern} _6m + * @property {AverageBlockCumulativeSumPattern} _6y + * @property {AverageBlockCumulativeSumPattern} _7y + * @property {AverageBlockCumulativeSumPattern} _8y + * @property {AverageBlockCumulativeSumPattern} _9m */ /** - * Create a HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern pattern node + * @typedef {Object} _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern + * @property {AverageBlockCumulativeSumPattern} _10y + * @property {AverageBlockCumulativeSumPattern} _12y + * @property {AverageBlockCumulativeSumPattern} _18m + * @property {AverageBlockCumulativeSumPattern} _1d + * @property {AverageBlockCumulativeSumPattern} _1m + * @property {AverageBlockCumulativeSumPattern} _1w + * @property {AverageBlockCumulativeSumPattern} _1y + * @property {AverageBlockCumulativeSumPattern} _2m + * @property {AverageBlockCumulativeSumPattern} _2y + * @property {AverageBlockCumulativeSumPattern} _3m + * @property {AverageBlockCumulativeSumPattern} _3y + * @property {AverageBlockCumulativeSumPattern} _4m + * @property {AverageBlockCumulativeSumPattern} _4y + * @property {AverageBlockCumulativeSumPattern} _5m + * @property {AverageBlockCumulativeSumPattern} _5y + * @property {AverageBlockCumulativeSumPattern} _6m + * @property {AverageBlockCumulativeSumPattern} _6y + * @property {AverageBlockCumulativeSumPattern} _7y + * @property {AverageBlockCumulativeSumPattern} _8y + * @property {AverageBlockCumulativeSumPattern} _9m + */ + +/** + * @typedef {Object} _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 + * @property {AverageBlockCumulativeSumPattern2} _10y + * @property {AverageBlockCumulativeSumPattern2} _12y + * @property {AverageBlockCumulativeSumPattern2} _15y + * @property {AverageBlockCumulativeSumPattern2} _18m + * @property {AverageBlockCumulativeSumPattern2} _1m + * @property {AverageBlockCumulativeSumPattern2} _1w + * @property {AverageBlockCumulativeSumPattern2} _1y + * @property {AverageBlockCumulativeSumPattern2} _2m + * @property {AverageBlockCumulativeSumPattern2} _2y + * @property {AverageBlockCumulativeSumPattern2} _3m + * @property {AverageBlockCumulativeSumPattern2} _3y + * @property {AverageBlockCumulativeSumPattern2} _4m + * @property {AverageBlockCumulativeSumPattern2} _4y + * @property {AverageBlockCumulativeSumPattern2} _5m + * @property {AverageBlockCumulativeSumPattern2} _5y + * @property {AverageBlockCumulativeSumPattern2} _6m + * @property {AverageBlockCumulativeSumPattern2} _6y + * @property {AverageBlockCumulativeSumPattern2} _7y + * @property {AverageBlockCumulativeSumPattern2} _8y + * @property {AverageBlockCumulativeSumPattern2} _9m + */ + +/** + * Create a _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} + * @param {string} disc - Discriminator suffix + * @returns {_10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2} */ -function createHeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, acc) { +function create_10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2(client, acc, disc) { return { - height: createSeriesPattern18(client, _m(acc, 'cents')), - pct05: createCentsSatsUsdPattern(client, _m(acc, 'pct05')), - pct10: createCentsSatsUsdPattern(client, _m(acc, 'pct10')), - pct15: createCentsSatsUsdPattern(client, _m(acc, 'pct15')), - pct20: createCentsSatsUsdPattern(client, _m(acc, 'pct20')), - pct25: createCentsSatsUsdPattern(client, _m(acc, 'pct25')), - pct30: createCentsSatsUsdPattern(client, _m(acc, 'pct30')), - pct35: createCentsSatsUsdPattern(client, _m(acc, 'pct35')), - pct40: createCentsSatsUsdPattern(client, _m(acc, 'pct40')), - pct45: createCentsSatsUsdPattern(client, _m(acc, 'pct45')), - pct50: createCentsSatsUsdPattern(client, _m(acc, 'pct50')), - pct55: createCentsSatsUsdPattern(client, _m(acc, 'pct55')), - pct60: createCentsSatsUsdPattern(client, _m(acc, 'pct60')), - pct65: createCentsSatsUsdPattern(client, _m(acc, 'pct65')), - pct70: createCentsSatsUsdPattern(client, _m(acc, 'pct70')), - pct75: createCentsSatsUsdPattern(client, _m(acc, 'pct75')), - pct80: createCentsSatsUsdPattern(client, _m(acc, 'pct80')), - pct85: createCentsSatsUsdPattern(client, _m(acc, 'pct85')), - pct90: createCentsSatsUsdPattern(client, _m(acc, 'pct90')), - pct95: createCentsSatsUsdPattern(client, _m(acc, 'pct95')), + _10y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '10y_old_transfer_volume'), disc)), + _12y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '12y_old_transfer_volume'), disc)), + _15y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '15y_old_transfer_volume'), disc)), + _18m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '18m_old_transfer_volume'), disc)), + _1m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1m_old_transfer_volume'), disc)), + _1w: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1w_old_transfer_volume'), disc)), + _1y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1y_old_transfer_volume'), disc)), + _2m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2m_old_transfer_volume'), disc)), + _2y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2y_old_transfer_volume'), disc)), + _3m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '3m_old_transfer_volume'), disc)), + _3y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '3y_old_transfer_volume'), disc)), + _4m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '4m_old_transfer_volume'), disc)), + _4y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '4y_old_transfer_volume'), disc)), + _5m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '5m_old_transfer_volume'), disc)), + _5y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '5y_old_transfer_volume'), disc)), + _6m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '6m_old_transfer_volume'), disc)), + _6y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '6y_old_transfer_volume'), disc)), + _7y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '7y_old_transfer_volume'), disc)), + _8y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '8y_old_transfer_volume'), disc)), + _9m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '9m_old_transfer_volume'), disc)), }; } +/** + * @typedef {Object} _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 + * @property {AverageBlockCumulativeSumPattern2} _10y + * @property {AverageBlockCumulativeSumPattern2} _12y + * @property {AverageBlockCumulativeSumPattern2} _18m + * @property {AverageBlockCumulativeSumPattern2} _1d + * @property {AverageBlockCumulativeSumPattern2} _1m + * @property {AverageBlockCumulativeSumPattern2} _1w + * @property {AverageBlockCumulativeSumPattern2} _1y + * @property {AverageBlockCumulativeSumPattern2} _2m + * @property {AverageBlockCumulativeSumPattern2} _2y + * @property {AverageBlockCumulativeSumPattern2} _3m + * @property {AverageBlockCumulativeSumPattern2} _3y + * @property {AverageBlockCumulativeSumPattern2} _4m + * @property {AverageBlockCumulativeSumPattern2} _4y + * @property {AverageBlockCumulativeSumPattern2} _5m + * @property {AverageBlockCumulativeSumPattern2} _5y + * @property {AverageBlockCumulativeSumPattern2} _6m + * @property {AverageBlockCumulativeSumPattern2} _6y + * @property {AverageBlockCumulativeSumPattern2} _7y + * @property {AverageBlockCumulativeSumPattern2} _8y + * @property {AverageBlockCumulativeSumPattern2} _9m + */ + +/** + * Create a _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @param {string} disc - Discriminator suffix + * @returns {_10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2} + */ +function create_10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2(client, acc, disc) { + return { + _10y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '10y_old_transfer_volume'), disc)), + _12y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '12y_old_transfer_volume'), disc)), + _18m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '18m_old_transfer_volume'), disc)), + _1d: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1d_old_transfer_volume'), disc)), + _1m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1m_old_transfer_volume'), disc)), + _1w: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1w_old_transfer_volume'), disc)), + _1y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1y_old_transfer_volume'), disc)), + _2m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2m_old_transfer_volume'), disc)), + _2y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2y_old_transfer_volume'), disc)), + _3m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '3m_old_transfer_volume'), disc)), + _3y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '3y_old_transfer_volume'), disc)), + _4m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '4m_old_transfer_volume'), disc)), + _4y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '4y_old_transfer_volume'), disc)), + _5m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '5m_old_transfer_volume'), disc)), + _5y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '5y_old_transfer_volume'), disc)), + _6m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '6m_old_transfer_volume'), disc)), + _6y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '6y_old_transfer_volume'), disc)), + _7y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '7y_old_transfer_volume'), disc)), + _8y: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '8y_old_transfer_volume'), disc)), + _9m: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '9m_old_transfer_volume'), disc)), + }; +} + +/** + * @typedef {Object} _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5 + * @property {BlockCumulativeSumPattern} _10y + * @property {BlockCumulativeSumPattern} _12y + * @property {BlockCumulativeSumPattern} _15y + * @property {BlockCumulativeSumPattern} _18m + * @property {BlockCumulativeSumPattern} _1m + * @property {BlockCumulativeSumPattern} _1w + * @property {BlockCumulativeSumPattern} _1y + * @property {BlockCumulativeSumPattern} _2m + * @property {BlockCumulativeSumPattern} _2y + * @property {BlockCumulativeSumPattern} _3m + * @property {BlockCumulativeSumPattern} _3y + * @property {BlockCumulativeSumPattern} _4m + * @property {BlockCumulativeSumPattern} _4y + * @property {BlockCumulativeSumPattern} _5m + * @property {BlockCumulativeSumPattern} _5y + * @property {BlockCumulativeSumPattern} _6m + * @property {BlockCumulativeSumPattern} _6y + * @property {BlockCumulativeSumPattern} _7y + * @property {BlockCumulativeSumPattern} _8y + * @property {BlockCumulativeSumPattern} _9m + */ + +/** + * @typedef {Object} _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5 + * @property {BlockCumulativeSumPattern} _10y + * @property {BlockCumulativeSumPattern} _12y + * @property {BlockCumulativeSumPattern} _18m + * @property {BlockCumulativeSumPattern} _1d + * @property {BlockCumulativeSumPattern} _1m + * @property {BlockCumulativeSumPattern} _1w + * @property {BlockCumulativeSumPattern} _1y + * @property {BlockCumulativeSumPattern} _2m + * @property {BlockCumulativeSumPattern} _2y + * @property {BlockCumulativeSumPattern} _3m + * @property {BlockCumulativeSumPattern} _3y + * @property {BlockCumulativeSumPattern} _4m + * @property {BlockCumulativeSumPattern} _4y + * @property {BlockCumulativeSumPattern} _5m + * @property {BlockCumulativeSumPattern} _5y + * @property {BlockCumulativeSumPattern} _6m + * @property {BlockCumulativeSumPattern} _6y + * @property {BlockCumulativeSumPattern} _7y + * @property {BlockCumulativeSumPattern} _8y + * @property {BlockCumulativeSumPattern} _9m + */ + +/** + * @typedef {Object} _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12 + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y + * @property {BtcCentsSatsUsdPattern} _15y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _9m + */ + +/** + * @typedef {Object} _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12 + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _1d + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _9m + */ + +/** + * @typedef {Object} _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13 + * @property {CentsUsdPattern3} _10y + * @property {CentsUsdPattern3} _12y + * @property {CentsUsdPattern3} _15y + * @property {CentsUsdPattern3} _18m + * @property {CentsUsdPattern3} _1m + * @property {CentsUsdPattern3} _1w + * @property {CentsUsdPattern3} _1y + * @property {CentsUsdPattern3} _2m + * @property {CentsUsdPattern3} _2y + * @property {CentsUsdPattern3} _3m + * @property {CentsUsdPattern3} _3y + * @property {CentsUsdPattern3} _4m + * @property {CentsUsdPattern3} _4y + * @property {CentsUsdPattern3} _5m + * @property {CentsUsdPattern3} _5y + * @property {CentsUsdPattern3} _6m + * @property {CentsUsdPattern3} _6y + * @property {CentsUsdPattern3} _7y + * @property {CentsUsdPattern3} _8y + * @property {CentsUsdPattern3} _9m + */ + +/** + * @typedef {Object} _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13 + * @property {CentsUsdPattern3} _10y + * @property {CentsUsdPattern3} _12y + * @property {CentsUsdPattern3} _18m + * @property {CentsUsdPattern3} _1d + * @property {CentsUsdPattern3} _1m + * @property {CentsUsdPattern3} _1w + * @property {CentsUsdPattern3} _1y + * @property {CentsUsdPattern3} _2m + * @property {CentsUsdPattern3} _2y + * @property {CentsUsdPattern3} _3m + * @property {CentsUsdPattern3} _3y + * @property {CentsUsdPattern3} _4m + * @property {CentsUsdPattern3} _4y + * @property {CentsUsdPattern3} _5m + * @property {CentsUsdPattern3} _5y + * @property {CentsUsdPattern3} _6m + * @property {CentsUsdPattern3} _6y + * @property {CentsUsdPattern3} _7y + * @property {CentsUsdPattern3} _8y + * @property {CentsUsdPattern3} _9m + */ + /** * @typedef {Object} Pct0Pct1Pct10Pct2Pct20Pct30Pct40Pct5Pct50Pct60Pct70Pct80Pct90Pct95Pct98Pct99RatiosPattern * @property {PpmPriceRatioPattern} pct01 @@ -2813,6 +3366,1031 @@ function createPct0Pct1Pct10Pct2Pct20Pct30Pct40Pct5Pct50Pct60Pct70Pct80Pct90Pct9 }; } +/** + * @template T + * @typedef {Object} _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7 + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + * @property {SeriesPattern1} _15y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _9m + */ + +/** + * @template T + * @typedef {Object} _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7 + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _1d + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _9m + */ + +/** + * @typedef {Object} Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern + * @property {CentsSatsUsdPattern} pct05 + * @property {CentsSatsUsdPattern} pct10 + * @property {CentsSatsUsdPattern} pct15 + * @property {CentsSatsUsdPattern} pct20 + * @property {CentsSatsUsdPattern} pct25 + * @property {CentsSatsUsdPattern} pct30 + * @property {CentsSatsUsdPattern} pct35 + * @property {CentsSatsUsdPattern} pct40 + * @property {CentsSatsUsdPattern} pct45 + * @property {CentsSatsUsdPattern} pct50 + * @property {CentsSatsUsdPattern} pct55 + * @property {CentsSatsUsdPattern} pct60 + * @property {CentsSatsUsdPattern} pct65 + * @property {CentsSatsUsdPattern} pct70 + * @property {CentsSatsUsdPattern} pct75 + * @property {CentsSatsUsdPattern} pct80 + * @property {CentsSatsUsdPattern} pct85 + * @property {CentsSatsUsdPattern} pct90 + * @property {CentsSatsUsdPattern} pct95 + */ + +/** + * Create a Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} + */ +function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, acc) { + return { + pct05: createCentsSatsUsdPattern(client, _m(acc, 'pct05')), + pct10: createCentsSatsUsdPattern(client, _m(acc, 'pct10')), + pct15: createCentsSatsUsdPattern(client, _m(acc, 'pct15')), + pct20: createCentsSatsUsdPattern(client, _m(acc, 'pct20')), + pct25: createCentsSatsUsdPattern(client, _m(acc, 'pct25')), + pct30: createCentsSatsUsdPattern(client, _m(acc, 'pct30')), + pct35: createCentsSatsUsdPattern(client, _m(acc, 'pct35')), + pct40: createCentsSatsUsdPattern(client, _m(acc, 'pct40')), + pct45: createCentsSatsUsdPattern(client, _m(acc, 'pct45')), + pct50: createCentsSatsUsdPattern(client, _m(acc, 'pct50')), + pct55: createCentsSatsUsdPattern(client, _m(acc, 'pct55')), + pct60: createCentsSatsUsdPattern(client, _m(acc, 'pct60')), + pct65: createCentsSatsUsdPattern(client, _m(acc, 'pct65')), + pct70: createCentsSatsUsdPattern(client, _m(acc, 'pct70')), + pct75: createCentsSatsUsdPattern(client, _m(acc, 'pct75')), + pct80: createCentsSatsUsdPattern(client, _m(acc, 'pct80')), + pct85: createCentsSatsUsdPattern(client, _m(acc, 'pct85')), + pct90: createCentsSatsUsdPattern(client, _m(acc, 'pct90')), + pct95: createCentsSatsUsdPattern(client, _m(acc, 'pct95')), + }; +} + +/** + * @typedef {Object} _200920102011201220132014201520162017201820192020202120222023202420252026Pattern + * @property {AverageBlockCumulativeSumPattern} _2009 + * @property {AverageBlockCumulativeSumPattern} _2010 + * @property {AverageBlockCumulativeSumPattern} _2011 + * @property {AverageBlockCumulativeSumPattern} _2012 + * @property {AverageBlockCumulativeSumPattern} _2013 + * @property {AverageBlockCumulativeSumPattern} _2014 + * @property {AverageBlockCumulativeSumPattern} _2015 + * @property {AverageBlockCumulativeSumPattern} _2016 + * @property {AverageBlockCumulativeSumPattern} _2017 + * @property {AverageBlockCumulativeSumPattern} _2018 + * @property {AverageBlockCumulativeSumPattern} _2019 + * @property {AverageBlockCumulativeSumPattern} _2020 + * @property {AverageBlockCumulativeSumPattern} _2021 + * @property {AverageBlockCumulativeSumPattern} _2022 + * @property {AverageBlockCumulativeSumPattern} _2023 + * @property {AverageBlockCumulativeSumPattern} _2024 + * @property {AverageBlockCumulativeSumPattern} _2025 + * @property {AverageBlockCumulativeSumPattern} _2026 + */ + +/** + * @typedef {Object} _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2 + * @property {AverageBlockCumulativeSumPattern2} _2009 + * @property {AverageBlockCumulativeSumPattern2} _2010 + * @property {AverageBlockCumulativeSumPattern2} _2011 + * @property {AverageBlockCumulativeSumPattern2} _2012 + * @property {AverageBlockCumulativeSumPattern2} _2013 + * @property {AverageBlockCumulativeSumPattern2} _2014 + * @property {AverageBlockCumulativeSumPattern2} _2015 + * @property {AverageBlockCumulativeSumPattern2} _2016 + * @property {AverageBlockCumulativeSumPattern2} _2017 + * @property {AverageBlockCumulativeSumPattern2} _2018 + * @property {AverageBlockCumulativeSumPattern2} _2019 + * @property {AverageBlockCumulativeSumPattern2} _2020 + * @property {AverageBlockCumulativeSumPattern2} _2021 + * @property {AverageBlockCumulativeSumPattern2} _2022 + * @property {AverageBlockCumulativeSumPattern2} _2023 + * @property {AverageBlockCumulativeSumPattern2} _2024 + * @property {AverageBlockCumulativeSumPattern2} _2025 + * @property {AverageBlockCumulativeSumPattern2} _2026 + */ + +/** + * Create a _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @param {string} disc - Discriminator suffix + * @returns {_200920102011201220132014201520162017201820192020202120222023202420252026Pattern2} + */ +function create_200920102011201220132014201520162017201820192020202120222023202420252026Pattern2(client, acc, disc) { + return { + _2009: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2009_transfer_volume'), disc)), + _2010: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2010_transfer_volume'), disc)), + _2011: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2011_transfer_volume'), disc)), + _2012: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2012_transfer_volume'), disc)), + _2013: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2013_transfer_volume'), disc)), + _2014: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2014_transfer_volume'), disc)), + _2015: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2015_transfer_volume'), disc)), + _2016: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2016_transfer_volume'), disc)), + _2017: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2017_transfer_volume'), disc)), + _2018: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2018_transfer_volume'), disc)), + _2019: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2019_transfer_volume'), disc)), + _2020: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2020_transfer_volume'), disc)), + _2021: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2021_transfer_volume'), disc)), + _2022: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2022_transfer_volume'), disc)), + _2023: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2023_transfer_volume'), disc)), + _2024: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2024_transfer_volume'), disc)), + _2025: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2025_transfer_volume'), disc)), + _2026: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2026_transfer_volume'), disc)), + }; +} + +/** + * @typedef {Object} _200920102011201220132014201520162017201820192020202120222023202420252026Pattern5 + * @property {BlockCumulativeSumPattern} _2009 + * @property {BlockCumulativeSumPattern} _2010 + * @property {BlockCumulativeSumPattern} _2011 + * @property {BlockCumulativeSumPattern} _2012 + * @property {BlockCumulativeSumPattern} _2013 + * @property {BlockCumulativeSumPattern} _2014 + * @property {BlockCumulativeSumPattern} _2015 + * @property {BlockCumulativeSumPattern} _2016 + * @property {BlockCumulativeSumPattern} _2017 + * @property {BlockCumulativeSumPattern} _2018 + * @property {BlockCumulativeSumPattern} _2019 + * @property {BlockCumulativeSumPattern} _2020 + * @property {BlockCumulativeSumPattern} _2021 + * @property {BlockCumulativeSumPattern} _2022 + * @property {BlockCumulativeSumPattern} _2023 + * @property {BlockCumulativeSumPattern} _2024 + * @property {BlockCumulativeSumPattern} _2025 + * @property {BlockCumulativeSumPattern} _2026 + */ + +/** + * @typedef {Object} _200920102011201220132014201520162017201820192020202120222023202420252026Pattern12 + * @property {BtcCentsSatsUsdPattern} _2009 + * @property {BtcCentsSatsUsdPattern} _2010 + * @property {BtcCentsSatsUsdPattern} _2011 + * @property {BtcCentsSatsUsdPattern} _2012 + * @property {BtcCentsSatsUsdPattern} _2013 + * @property {BtcCentsSatsUsdPattern} _2014 + * @property {BtcCentsSatsUsdPattern} _2015 + * @property {BtcCentsSatsUsdPattern} _2016 + * @property {BtcCentsSatsUsdPattern} _2017 + * @property {BtcCentsSatsUsdPattern} _2018 + * @property {BtcCentsSatsUsdPattern} _2019 + * @property {BtcCentsSatsUsdPattern} _2020 + * @property {BtcCentsSatsUsdPattern} _2021 + * @property {BtcCentsSatsUsdPattern} _2022 + * @property {BtcCentsSatsUsdPattern} _2023 + * @property {BtcCentsSatsUsdPattern} _2024 + * @property {BtcCentsSatsUsdPattern} _2025 + * @property {BtcCentsSatsUsdPattern} _2026 + */ + +/** + * @typedef {Object} _200920102011201220132014201520162017201820192020202120222023202420252026Pattern13 + * @property {CentsUsdPattern3} _2009 + * @property {CentsUsdPattern3} _2010 + * @property {CentsUsdPattern3} _2011 + * @property {CentsUsdPattern3} _2012 + * @property {CentsUsdPattern3} _2013 + * @property {CentsUsdPattern3} _2014 + * @property {CentsUsdPattern3} _2015 + * @property {CentsUsdPattern3} _2016 + * @property {CentsUsdPattern3} _2017 + * @property {CentsUsdPattern3} _2018 + * @property {CentsUsdPattern3} _2019 + * @property {CentsUsdPattern3} _2020 + * @property {CentsUsdPattern3} _2021 + * @property {CentsUsdPattern3} _2022 + * @property {CentsUsdPattern3} _2023 + * @property {CentsUsdPattern3} _2024 + * @property {CentsUsdPattern3} _2025 + * @property {CentsUsdPattern3} _2026 + */ + +/** + * @template T + * @typedef {Object} _200920102011201220132014201520162017201820192020202120222023202420252026Pattern7 + * @property {SeriesPattern1} _2009 + * @property {SeriesPattern1} _2010 + * @property {SeriesPattern1} _2011 + * @property {SeriesPattern1} _2012 + * @property {SeriesPattern1} _2013 + * @property {SeriesPattern1} _2014 + * @property {SeriesPattern1} _2015 + * @property {SeriesPattern1} _2016 + * @property {SeriesPattern1} _2017 + * @property {SeriesPattern1} _2018 + * @property {SeriesPattern1} _2019 + * @property {SeriesPattern1} _2020 + * @property {SeriesPattern1} _2021 + * @property {SeriesPattern1} _2022 + * @property {SeriesPattern1} _2023 + * @property {SeriesPattern1} _2024 + * @property {SeriesPattern1} _2025 + * @property {SeriesPattern1} _2026 + */ + +/** + * @typedef {Object} _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8 + * @property {AbsoluteRatePattern2} _0sats + * @property {AbsoluteRatePattern2} _100btcTo1kBtc + * @property {AbsoluteRatePattern2} _100kSatsTo1mSats + * @property {AbsoluteRatePattern2} _100satsTo1kSats + * @property {AbsoluteRatePattern2} _10btcTo100btc + * @property {AbsoluteRatePattern2} _10kBtcTo100kBtc + * @property {AbsoluteRatePattern2} _10kSatsTo100kSats + * @property {AbsoluteRatePattern2} _10mSatsTo1btc + * @property {AbsoluteRatePattern2} _10satsTo100sats + * @property {AbsoluteRatePattern2} _1btcTo10btc + * @property {AbsoluteRatePattern2} _1kBtcTo10kBtc + * @property {AbsoluteRatePattern2} _1kSatsTo10kSats + * @property {AbsoluteRatePattern2} _1mSatsTo10mSats + * @property {AbsoluteRatePattern2} _1satTo10sats + * @property {AbsoluteRatePattern2} over100kBtc + */ + +/** + * Create a _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8} + */ +function create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8(client, acc) { + return { + _0sats: createAbsoluteRatePattern2(client, _m(acc, '0sats_supply_delta')), + _100btcTo1kBtc: createAbsoluteRatePattern2(client, _m(acc, '100btc_to_1k_btc_supply_delta')), + _100kSatsTo1mSats: createAbsoluteRatePattern2(client, _m(acc, '100k_sats_to_1m_sats_supply_delta')), + _100satsTo1kSats: createAbsoluteRatePattern2(client, _m(acc, '100sats_to_1k_sats_supply_delta')), + _10btcTo100btc: createAbsoluteRatePattern2(client, _m(acc, '10btc_to_100btc_supply_delta')), + _10kBtcTo100kBtc: createAbsoluteRatePattern2(client, _m(acc, '10k_btc_to_100k_btc_supply_delta')), + _10kSatsTo100kSats: createAbsoluteRatePattern2(client, _m(acc, '10k_sats_to_100k_sats_supply_delta')), + _10mSatsTo1btc: createAbsoluteRatePattern2(client, _m(acc, '10m_sats_to_1btc_supply_delta')), + _10satsTo100sats: createAbsoluteRatePattern2(client, _m(acc, '10sats_to_100sats_supply_delta')), + _1btcTo10btc: createAbsoluteRatePattern2(client, _m(acc, '1btc_to_10btc_supply_delta')), + _1kBtcTo10kBtc: createAbsoluteRatePattern2(client, _m(acc, '1k_btc_to_10k_btc_supply_delta')), + _1kSatsTo10kSats: createAbsoluteRatePattern2(client, _m(acc, '1k_sats_to_10k_sats_supply_delta')), + _1mSatsTo10mSats: createAbsoluteRatePattern2(client, _m(acc, '1m_sats_to_10m_sats_supply_delta')), + _1satTo10sats: createAbsoluteRatePattern2(client, _m(acc, '1sat_to_10sats_supply_delta')), + over100kBtc: createAbsoluteRatePattern2(client, _m(acc, 'over_100k_btc_supply_delta')), + }; +} + +/** + * @typedef {Object} _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2 + * @property {AverageBlockCumulativeSumPattern2} _0sats + * @property {AverageBlockCumulativeSumPattern2} _100btcTo1kBtc + * @property {AverageBlockCumulativeSumPattern2} _100kSatsTo1mSats + * @property {AverageBlockCumulativeSumPattern2} _100satsTo1kSats + * @property {AverageBlockCumulativeSumPattern2} _10btcTo100btc + * @property {AverageBlockCumulativeSumPattern2} _10kBtcTo100kBtc + * @property {AverageBlockCumulativeSumPattern2} _10kSatsTo100kSats + * @property {AverageBlockCumulativeSumPattern2} _10mSatsTo1btc + * @property {AverageBlockCumulativeSumPattern2} _10satsTo100sats + * @property {AverageBlockCumulativeSumPattern2} _1btcTo10btc + * @property {AverageBlockCumulativeSumPattern2} _1kBtcTo10kBtc + * @property {AverageBlockCumulativeSumPattern2} _1kSatsTo10kSats + * @property {AverageBlockCumulativeSumPattern2} _1mSatsTo10mSats + * @property {AverageBlockCumulativeSumPattern2} _1satTo10sats + * @property {AverageBlockCumulativeSumPattern2} over100kBtc + */ + +/** + * Create a _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2} + */ +function create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2(client, acc) { + return { + _0sats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '0sats_transfer_volume')), + _100btcTo1kBtc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100btc_to_1k_btc_transfer_volume')), + _100kSatsTo1mSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100k_sats_to_1m_sats_transfer_volume')), + _100satsTo1kSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100sats_to_1k_sats_transfer_volume')), + _10btcTo100btc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10btc_to_100btc_transfer_volume')), + _10kBtcTo100kBtc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10k_btc_to_100k_btc_transfer_volume')), + _10kSatsTo100kSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10k_sats_to_100k_sats_transfer_volume')), + _10mSatsTo1btc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10m_sats_to_1btc_transfer_volume')), + _10satsTo100sats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10sats_to_100sats_transfer_volume')), + _1btcTo10btc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1btc_to_10btc_transfer_volume')), + _1kBtcTo10kBtc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1k_btc_to_10k_btc_transfer_volume')), + _1kSatsTo10kSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1k_sats_to_10k_sats_transfer_volume')), + _1mSatsTo10mSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1m_sats_to_10m_sats_transfer_volume')), + _1satTo10sats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1sat_to_10sats_transfer_volume')), + over100kBtc: createAverageBlockCumulativeSumPattern2(client, _m(acc, 'over_100k_btc_transfer_volume')), + }; +} + +/** + * @typedef {Object} _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern + * @property {BaseDeltaPattern} _0sats + * @property {BaseDeltaPattern} _100btcTo1kBtc + * @property {BaseDeltaPattern} _100kSatsTo1mSats + * @property {BaseDeltaPattern} _100satsTo1kSats + * @property {BaseDeltaPattern} _10btcTo100btc + * @property {BaseDeltaPattern} _10kBtcTo100kBtc + * @property {BaseDeltaPattern} _10kSatsTo100kSats + * @property {BaseDeltaPattern} _10mSatsTo1btc + * @property {BaseDeltaPattern} _10satsTo100sats + * @property {BaseDeltaPattern} _1btcTo10btc + * @property {BaseDeltaPattern} _1kBtcTo10kBtc + * @property {BaseDeltaPattern} _1kSatsTo10kSats + * @property {BaseDeltaPattern} _1mSatsTo10mSats + * @property {BaseDeltaPattern} _1satTo10sats + * @property {BaseDeltaPattern} over100kBtc + */ + +/** + * @typedef {Object} _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern5 + * @property {BlockCumulativeSumPattern} _0sats + * @property {BlockCumulativeSumPattern} _100btcTo1kBtc + * @property {BlockCumulativeSumPattern} _100kSatsTo1mSats + * @property {BlockCumulativeSumPattern} _100satsTo1kSats + * @property {BlockCumulativeSumPattern} _10btcTo100btc + * @property {BlockCumulativeSumPattern} _10kBtcTo100kBtc + * @property {BlockCumulativeSumPattern} _10kSatsTo100kSats + * @property {BlockCumulativeSumPattern} _10mSatsTo1btc + * @property {BlockCumulativeSumPattern} _10satsTo100sats + * @property {BlockCumulativeSumPattern} _1btcTo10btc + * @property {BlockCumulativeSumPattern} _1kBtcTo10kBtc + * @property {BlockCumulativeSumPattern} _1kSatsTo10kSats + * @property {BlockCumulativeSumPattern} _1mSatsTo10mSats + * @property {BlockCumulativeSumPattern} _1satTo10sats + * @property {BlockCumulativeSumPattern} over100kBtc + */ + +/** + * @typedef {Object} _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10 + * @property {BtcCentsSatsUsdPattern} _0sats + * @property {BtcCentsSatsUsdPattern} _100btcTo1kBtc + * @property {BtcCentsSatsUsdPattern} _100kSatsTo1mSats + * @property {BtcCentsSatsUsdPattern} _100satsTo1kSats + * @property {BtcCentsSatsUsdPattern} _10btcTo100btc + * @property {BtcCentsSatsUsdPattern} _10kBtcTo100kBtc + * @property {BtcCentsSatsUsdPattern} _10kSatsTo100kSats + * @property {BtcCentsSatsUsdPattern} _10mSatsTo1btc + * @property {BtcCentsSatsUsdPattern} _10satsTo100sats + * @property {BtcCentsSatsUsdPattern} _1btcTo10btc + * @property {BtcCentsSatsUsdPattern} _1kBtcTo10kBtc + * @property {BtcCentsSatsUsdPattern} _1kSatsTo10kSats + * @property {BtcCentsSatsUsdPattern} _1mSatsTo10mSats + * @property {BtcCentsSatsUsdPattern} _1satTo10sats + * @property {BtcCentsSatsUsdPattern} over100kBtc + */ + +/** + * Create a _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10} + */ +function create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10(client, acc) { + return { + _0sats: createBtcCentsSatsUsdPattern(client, _m(acc, '0sats_supply')), + _100btcTo1kBtc: createBtcCentsSatsUsdPattern(client, _m(acc, '100btc_to_1k_btc_supply')), + _100kSatsTo1mSats: createBtcCentsSatsUsdPattern(client, _m(acc, '100k_sats_to_1m_sats_supply')), + _100satsTo1kSats: createBtcCentsSatsUsdPattern(client, _m(acc, '100sats_to_1k_sats_supply')), + _10btcTo100btc: createBtcCentsSatsUsdPattern(client, _m(acc, '10btc_to_100btc_supply')), + _10kBtcTo100kBtc: createBtcCentsSatsUsdPattern(client, _m(acc, '10k_btc_to_100k_btc_supply')), + _10kSatsTo100kSats: createBtcCentsSatsUsdPattern(client, _m(acc, '10k_sats_to_100k_sats_supply')), + _10mSatsTo1btc: createBtcCentsSatsUsdPattern(client, _m(acc, '10m_sats_to_1btc_supply')), + _10satsTo100sats: createBtcCentsSatsUsdPattern(client, _m(acc, '10sats_to_100sats_supply')), + _1btcTo10btc: createBtcCentsSatsUsdPattern(client, _m(acc, '1btc_to_10btc_supply')), + _1kBtcTo10kBtc: createBtcCentsSatsUsdPattern(client, _m(acc, '1k_btc_to_10k_btc_supply')), + _1kSatsTo10kSats: createBtcCentsSatsUsdPattern(client, _m(acc, '1k_sats_to_10k_sats_supply')), + _1mSatsTo10mSats: createBtcCentsSatsUsdPattern(client, _m(acc, '1m_sats_to_10m_sats_supply')), + _1satTo10sats: createBtcCentsSatsUsdPattern(client, _m(acc, '1sat_to_10sats_supply')), + over100kBtc: createBtcCentsSatsUsdPattern(client, _m(acc, 'over_100k_btc_supply')), + }; +} + +/** + * @typedef {Object} _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4 + * @property {CentsDeltaUsdPattern} _0sats + * @property {CentsDeltaUsdPattern} _100btcTo1kBtc + * @property {CentsDeltaUsdPattern} _100kSatsTo1mSats + * @property {CentsDeltaUsdPattern} _100satsTo1kSats + * @property {CentsDeltaUsdPattern} _10btcTo100btc + * @property {CentsDeltaUsdPattern} _10kBtcTo100kBtc + * @property {CentsDeltaUsdPattern} _10kSatsTo100kSats + * @property {CentsDeltaUsdPattern} _10mSatsTo1btc + * @property {CentsDeltaUsdPattern} _10satsTo100sats + * @property {CentsDeltaUsdPattern} _1btcTo10btc + * @property {CentsDeltaUsdPattern} _1kBtcTo10kBtc + * @property {CentsDeltaUsdPattern} _1kSatsTo10kSats + * @property {CentsDeltaUsdPattern} _1mSatsTo10mSats + * @property {CentsDeltaUsdPattern} _1satTo10sats + * @property {CentsDeltaUsdPattern} over100kBtc + */ + +/** + * Create a _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4} + */ +function create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4(client, acc) { + return { + _0sats: createCentsDeltaUsdPattern(client, _m(acc, '0sats_realized_cap')), + _100btcTo1kBtc: createCentsDeltaUsdPattern(client, _m(acc, '100btc_to_1k_btc_realized_cap')), + _100kSatsTo1mSats: createCentsDeltaUsdPattern(client, _m(acc, '100k_sats_to_1m_sats_realized_cap')), + _100satsTo1kSats: createCentsDeltaUsdPattern(client, _m(acc, '100sats_to_1k_sats_realized_cap')), + _10btcTo100btc: createCentsDeltaUsdPattern(client, _m(acc, '10btc_to_100btc_realized_cap')), + _10kBtcTo100kBtc: createCentsDeltaUsdPattern(client, _m(acc, '10k_btc_to_100k_btc_realized_cap')), + _10kSatsTo100kSats: createCentsDeltaUsdPattern(client, _m(acc, '10k_sats_to_100k_sats_realized_cap')), + _10mSatsTo1btc: createCentsDeltaUsdPattern(client, _m(acc, '10m_sats_to_1btc_realized_cap')), + _10satsTo100sats: createCentsDeltaUsdPattern(client, _m(acc, '10sats_to_100sats_realized_cap')), + _1btcTo10btc: createCentsDeltaUsdPattern(client, _m(acc, '1btc_to_10btc_realized_cap')), + _1kBtcTo10kBtc: createCentsDeltaUsdPattern(client, _m(acc, '1k_btc_to_10k_btc_realized_cap')), + _1kSatsTo10kSats: createCentsDeltaUsdPattern(client, _m(acc, '1k_sats_to_10k_sats_realized_cap')), + _1mSatsTo10mSats: createCentsDeltaUsdPattern(client, _m(acc, '1m_sats_to_10m_sats_realized_cap')), + _1satTo10sats: createCentsDeltaUsdPattern(client, _m(acc, '1sat_to_10sats_realized_cap')), + over100kBtc: createCentsDeltaUsdPattern(client, _m(acc, 'over_100k_btc_realized_cap')), + }; +} + +/** + * @typedef {Object} _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9 + * @property {PercentPpmRatioPattern2} _0sats + * @property {PercentPpmRatioPattern2} _100btcTo1kBtc + * @property {PercentPpmRatioPattern2} _100kSatsTo1mSats + * @property {PercentPpmRatioPattern2} _100satsTo1kSats + * @property {PercentPpmRatioPattern2} _10btcTo100btc + * @property {PercentPpmRatioPattern2} _10kBtcTo100kBtc + * @property {PercentPpmRatioPattern2} _10kSatsTo100kSats + * @property {PercentPpmRatioPattern2} _10mSatsTo1btc + * @property {PercentPpmRatioPattern2} _10satsTo100sats + * @property {PercentPpmRatioPattern2} _1btcTo10btc + * @property {PercentPpmRatioPattern2} _1kBtcTo10kBtc + * @property {PercentPpmRatioPattern2} _1kSatsTo10kSats + * @property {PercentPpmRatioPattern2} _1mSatsTo10mSats + * @property {PercentPpmRatioPattern2} _1satTo10sats + * @property {PercentPpmRatioPattern2} over100kBtc + */ + +/** + * Create a _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9} + */ +function create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9(client, acc) { + return { + _0sats: createPercentPpmRatioPattern2(client, _m(acc, '0sats_supply_dominance')), + _100btcTo1kBtc: createPercentPpmRatioPattern2(client, _m(acc, '100btc_to_1k_btc_supply_dominance')), + _100kSatsTo1mSats: createPercentPpmRatioPattern2(client, _m(acc, '100k_sats_to_1m_sats_supply_dominance')), + _100satsTo1kSats: createPercentPpmRatioPattern2(client, _m(acc, '100sats_to_1k_sats_supply_dominance')), + _10btcTo100btc: createPercentPpmRatioPattern2(client, _m(acc, '10btc_to_100btc_supply_dominance')), + _10kBtcTo100kBtc: createPercentPpmRatioPattern2(client, _m(acc, '10k_btc_to_100k_btc_supply_dominance')), + _10kSatsTo100kSats: createPercentPpmRatioPattern2(client, _m(acc, '10k_sats_to_100k_sats_supply_dominance')), + _10mSatsTo1btc: createPercentPpmRatioPattern2(client, _m(acc, '10m_sats_to_1btc_supply_dominance')), + _10satsTo100sats: createPercentPpmRatioPattern2(client, _m(acc, '10sats_to_100sats_supply_dominance')), + _1btcTo10btc: createPercentPpmRatioPattern2(client, _m(acc, '1btc_to_10btc_supply_dominance')), + _1kBtcTo10kBtc: createPercentPpmRatioPattern2(client, _m(acc, '1k_btc_to_10k_btc_supply_dominance')), + _1kSatsTo10kSats: createPercentPpmRatioPattern2(client, _m(acc, '1k_sats_to_10k_sats_supply_dominance')), + _1mSatsTo10mSats: createPercentPpmRatioPattern2(client, _m(acc, '1m_sats_to_10m_sats_supply_dominance')), + _1satTo10sats: createPercentPpmRatioPattern2(client, _m(acc, '1sat_to_10sats_supply_dominance')), + over100kBtc: createPercentPpmRatioPattern2(client, _m(acc, 'over_100k_btc_supply_dominance')), + }; +} + +/** + * @typedef {Object} _100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctAllPattern2 + * @property {AllLthSthPattern} _100pct + * @property {AllLthSthPattern} _10pct + * @property {AllLthSthPattern} _200pct + * @property {AllLthSthPattern} _20pct + * @property {AllLthSthPattern} _300pct + * @property {AllLthSthPattern} _30pct + * @property {AllLthSthPattern} _40pct + * @property {AllLthSthPattern} _500pct + * @property {AllLthSthPattern} _50pct + * @property {AllLthSthPattern} _60pct + * @property {AllLthSthPattern} _70pct + * @property {AllLthSthPattern} _80pct + * @property {AllLthSthPattern} _90pct + * @property {AllLthSthPattern} all + */ + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1mPattern8 + * @property {AbsoluteRatePattern2} _100btc + * @property {AbsoluteRatePattern2} _100kBtc + * @property {AbsoluteRatePattern2} _100kSats + * @property {AbsoluteRatePattern2} _100sats + * @property {AbsoluteRatePattern2} _10btc + * @property {AbsoluteRatePattern2} _10kBtc + * @property {AbsoluteRatePattern2} _10kSats + * @property {AbsoluteRatePattern2} _10mSats + * @property {AbsoluteRatePattern2} _10sats + * @property {AbsoluteRatePattern2} _1btc + * @property {AbsoluteRatePattern2} _1kBtc + * @property {AbsoluteRatePattern2} _1kSats + * @property {AbsoluteRatePattern2} _1mSats + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1mPattern8 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern8} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern8(client, acc) { + return { + _100btc: createAbsoluteRatePattern2(client, _m(acc, '100btc_supply_delta')), + _100kBtc: createAbsoluteRatePattern2(client, _m(acc, '100k_btc_supply_delta')), + _100kSats: createAbsoluteRatePattern2(client, _m(acc, '100k_sats_supply_delta')), + _100sats: createAbsoluteRatePattern2(client, _m(acc, '100sats_supply_delta')), + _10btc: createAbsoluteRatePattern2(client, _m(acc, '10btc_supply_delta')), + _10kBtc: createAbsoluteRatePattern2(client, _m(acc, '10k_btc_supply_delta')), + _10kSats: createAbsoluteRatePattern2(client, _m(acc, '10k_sats_supply_delta')), + _10mSats: createAbsoluteRatePattern2(client, _m(acc, '10m_sats_supply_delta')), + _10sats: createAbsoluteRatePattern2(client, _m(acc, '10sats_supply_delta')), + _1btc: createAbsoluteRatePattern2(client, _m(acc, '1btc_supply_delta')), + _1kBtc: createAbsoluteRatePattern2(client, _m(acc, '1k_btc_supply_delta')), + _1kSats: createAbsoluteRatePattern2(client, _m(acc, '1k_sats_supply_delta')), + _1mSats: createAbsoluteRatePattern2(client, _m(acc, '1m_sats_supply_delta')), + }; +} + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8 + * @property {AbsoluteRatePattern2} _100btc + * @property {AbsoluteRatePattern2} _100kSats + * @property {AbsoluteRatePattern2} _100sats + * @property {AbsoluteRatePattern2} _10btc + * @property {AbsoluteRatePattern2} _10kBtc + * @property {AbsoluteRatePattern2} _10kSats + * @property {AbsoluteRatePattern2} _10mSats + * @property {AbsoluteRatePattern2} _10sats + * @property {AbsoluteRatePattern2} _1btc + * @property {AbsoluteRatePattern2} _1kBtc + * @property {AbsoluteRatePattern2} _1kSats + * @property {AbsoluteRatePattern2} _1mSats + * @property {AbsoluteRatePattern2} _1sat + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8(client, acc) { + return { + _100btc: createAbsoluteRatePattern2(client, _m(acc, '100btc_supply_delta')), + _100kSats: createAbsoluteRatePattern2(client, _m(acc, '100k_sats_supply_delta')), + _100sats: createAbsoluteRatePattern2(client, _m(acc, '100sats_supply_delta')), + _10btc: createAbsoluteRatePattern2(client, _m(acc, '10btc_supply_delta')), + _10kBtc: createAbsoluteRatePattern2(client, _m(acc, '10k_btc_supply_delta')), + _10kSats: createAbsoluteRatePattern2(client, _m(acc, '10k_sats_supply_delta')), + _10mSats: createAbsoluteRatePattern2(client, _m(acc, '10m_sats_supply_delta')), + _10sats: createAbsoluteRatePattern2(client, _m(acc, '10sats_supply_delta')), + _1btc: createAbsoluteRatePattern2(client, _m(acc, '1btc_supply_delta')), + _1kBtc: createAbsoluteRatePattern2(client, _m(acc, '1k_btc_supply_delta')), + _1kSats: createAbsoluteRatePattern2(client, _m(acc, '1k_sats_supply_delta')), + _1mSats: createAbsoluteRatePattern2(client, _m(acc, '1m_sats_supply_delta')), + _1sat: createAbsoluteRatePattern2(client, _m(acc, '1sat_supply_delta')), + }; +} + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2 + * @property {AverageBlockCumulativeSumPattern2} _100btc + * @property {AverageBlockCumulativeSumPattern2} _100kBtc + * @property {AverageBlockCumulativeSumPattern2} _100kSats + * @property {AverageBlockCumulativeSumPattern2} _100sats + * @property {AverageBlockCumulativeSumPattern2} _10btc + * @property {AverageBlockCumulativeSumPattern2} _10kBtc + * @property {AverageBlockCumulativeSumPattern2} _10kSats + * @property {AverageBlockCumulativeSumPattern2} _10mSats + * @property {AverageBlockCumulativeSumPattern2} _10sats + * @property {AverageBlockCumulativeSumPattern2} _1btc + * @property {AverageBlockCumulativeSumPattern2} _1kBtc + * @property {AverageBlockCumulativeSumPattern2} _1kSats + * @property {AverageBlockCumulativeSumPattern2} _1mSats + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern2} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern2(client, acc) { + return { + _100btc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100btc_transfer_volume')), + _100kBtc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100k_btc_transfer_volume')), + _100kSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100k_sats_transfer_volume')), + _100sats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100sats_transfer_volume')), + _10btc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10btc_transfer_volume')), + _10kBtc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10k_btc_transfer_volume')), + _10kSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10k_sats_transfer_volume')), + _10mSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10m_sats_transfer_volume')), + _10sats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10sats_transfer_volume')), + _1btc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1btc_transfer_volume')), + _1kBtc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1k_btc_transfer_volume')), + _1kSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1k_sats_transfer_volume')), + _1mSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1m_sats_transfer_volume')), + }; +} + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2 + * @property {AverageBlockCumulativeSumPattern2} _100btc + * @property {AverageBlockCumulativeSumPattern2} _100kSats + * @property {AverageBlockCumulativeSumPattern2} _100sats + * @property {AverageBlockCumulativeSumPattern2} _10btc + * @property {AverageBlockCumulativeSumPattern2} _10kBtc + * @property {AverageBlockCumulativeSumPattern2} _10kSats + * @property {AverageBlockCumulativeSumPattern2} _10mSats + * @property {AverageBlockCumulativeSumPattern2} _10sats + * @property {AverageBlockCumulativeSumPattern2} _1btc + * @property {AverageBlockCumulativeSumPattern2} _1kBtc + * @property {AverageBlockCumulativeSumPattern2} _1kSats + * @property {AverageBlockCumulativeSumPattern2} _1mSats + * @property {AverageBlockCumulativeSumPattern2} _1sat + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2(client, acc) { + return { + _100btc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100btc_transfer_volume')), + _100kSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100k_sats_transfer_volume')), + _100sats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '100sats_transfer_volume')), + _10btc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10btc_transfer_volume')), + _10kBtc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10k_btc_transfer_volume')), + _10kSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10k_sats_transfer_volume')), + _10mSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10m_sats_transfer_volume')), + _10sats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '10sats_transfer_volume')), + _1btc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1btc_transfer_volume')), + _1kBtc: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1k_btc_transfer_volume')), + _1kSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1k_sats_transfer_volume')), + _1mSats: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1m_sats_transfer_volume')), + _1sat: createAverageBlockCumulativeSumPattern2(client, _m(acc, '1sat_transfer_volume')), + }; +} + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1mPattern + * @property {BaseDeltaPattern} _100btc + * @property {BaseDeltaPattern} _100kBtc + * @property {BaseDeltaPattern} _100kSats + * @property {BaseDeltaPattern} _100sats + * @property {BaseDeltaPattern} _10btc + * @property {BaseDeltaPattern} _10kBtc + * @property {BaseDeltaPattern} _10kSats + * @property {BaseDeltaPattern} _10mSats + * @property {BaseDeltaPattern} _10sats + * @property {BaseDeltaPattern} _1btc + * @property {BaseDeltaPattern} _1kBtc + * @property {BaseDeltaPattern} _1kSats + * @property {BaseDeltaPattern} _1mSats + */ + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern + * @property {BaseDeltaPattern} _100btc + * @property {BaseDeltaPattern} _100kSats + * @property {BaseDeltaPattern} _100sats + * @property {BaseDeltaPattern} _10btc + * @property {BaseDeltaPattern} _10kBtc + * @property {BaseDeltaPattern} _10kSats + * @property {BaseDeltaPattern} _10mSats + * @property {BaseDeltaPattern} _10sats + * @property {BaseDeltaPattern} _1btc + * @property {BaseDeltaPattern} _1kBtc + * @property {BaseDeltaPattern} _1kSats + * @property {BaseDeltaPattern} _1mSats + * @property {BaseDeltaPattern} _1sat + */ + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1mPattern5 + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _100kBtc + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _10kBtc + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _1mSats + */ + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern5 + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _10kBtc + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _1mSats + * @property {BlockCumulativeSumPattern} _1sat + */ + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10 + * @property {BtcCentsSatsUsdPattern} _100btc + * @property {BtcCentsSatsUsdPattern} _100kBtc + * @property {BtcCentsSatsUsdPattern} _100kSats + * @property {BtcCentsSatsUsdPattern} _100sats + * @property {BtcCentsSatsUsdPattern} _10btc + * @property {BtcCentsSatsUsdPattern} _10kBtc + * @property {BtcCentsSatsUsdPattern} _10kSats + * @property {BtcCentsSatsUsdPattern} _10mSats + * @property {BtcCentsSatsUsdPattern} _10sats + * @property {BtcCentsSatsUsdPattern} _1btc + * @property {BtcCentsSatsUsdPattern} _1kBtc + * @property {BtcCentsSatsUsdPattern} _1kSats + * @property {BtcCentsSatsUsdPattern} _1mSats + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern10} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern10(client, acc) { + return { + _100btc: createBtcCentsSatsUsdPattern(client, _m(acc, '100btc_supply')), + _100kBtc: createBtcCentsSatsUsdPattern(client, _m(acc, '100k_btc_supply')), + _100kSats: createBtcCentsSatsUsdPattern(client, _m(acc, '100k_sats_supply')), + _100sats: createBtcCentsSatsUsdPattern(client, _m(acc, '100sats_supply')), + _10btc: createBtcCentsSatsUsdPattern(client, _m(acc, '10btc_supply')), + _10kBtc: createBtcCentsSatsUsdPattern(client, _m(acc, '10k_btc_supply')), + _10kSats: createBtcCentsSatsUsdPattern(client, _m(acc, '10k_sats_supply')), + _10mSats: createBtcCentsSatsUsdPattern(client, _m(acc, '10m_sats_supply')), + _10sats: createBtcCentsSatsUsdPattern(client, _m(acc, '10sats_supply')), + _1btc: createBtcCentsSatsUsdPattern(client, _m(acc, '1btc_supply')), + _1kBtc: createBtcCentsSatsUsdPattern(client, _m(acc, '1k_btc_supply')), + _1kSats: createBtcCentsSatsUsdPattern(client, _m(acc, '1k_sats_supply')), + _1mSats: createBtcCentsSatsUsdPattern(client, _m(acc, '1m_sats_supply')), + }; +} + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10 + * @property {BtcCentsSatsUsdPattern} _100btc + * @property {BtcCentsSatsUsdPattern} _100kSats + * @property {BtcCentsSatsUsdPattern} _100sats + * @property {BtcCentsSatsUsdPattern} _10btc + * @property {BtcCentsSatsUsdPattern} _10kBtc + * @property {BtcCentsSatsUsdPattern} _10kSats + * @property {BtcCentsSatsUsdPattern} _10mSats + * @property {BtcCentsSatsUsdPattern} _10sats + * @property {BtcCentsSatsUsdPattern} _1btc + * @property {BtcCentsSatsUsdPattern} _1kBtc + * @property {BtcCentsSatsUsdPattern} _1kSats + * @property {BtcCentsSatsUsdPattern} _1mSats + * @property {BtcCentsSatsUsdPattern} _1sat + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10(client, acc) { + return { + _100btc: createBtcCentsSatsUsdPattern(client, _m(acc, '100btc_supply')), + _100kSats: createBtcCentsSatsUsdPattern(client, _m(acc, '100k_sats_supply')), + _100sats: createBtcCentsSatsUsdPattern(client, _m(acc, '100sats_supply')), + _10btc: createBtcCentsSatsUsdPattern(client, _m(acc, '10btc_supply')), + _10kBtc: createBtcCentsSatsUsdPattern(client, _m(acc, '10k_btc_supply')), + _10kSats: createBtcCentsSatsUsdPattern(client, _m(acc, '10k_sats_supply')), + _10mSats: createBtcCentsSatsUsdPattern(client, _m(acc, '10m_sats_supply')), + _10sats: createBtcCentsSatsUsdPattern(client, _m(acc, '10sats_supply')), + _1btc: createBtcCentsSatsUsdPattern(client, _m(acc, '1btc_supply')), + _1kBtc: createBtcCentsSatsUsdPattern(client, _m(acc, '1k_btc_supply')), + _1kSats: createBtcCentsSatsUsdPattern(client, _m(acc, '1k_sats_supply')), + _1mSats: createBtcCentsSatsUsdPattern(client, _m(acc, '1m_sats_supply')), + _1sat: createBtcCentsSatsUsdPattern(client, _m(acc, '1sat_supply')), + }; +} + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4 + * @property {CentsDeltaUsdPattern} _100btc + * @property {CentsDeltaUsdPattern} _100kBtc + * @property {CentsDeltaUsdPattern} _100kSats + * @property {CentsDeltaUsdPattern} _100sats + * @property {CentsDeltaUsdPattern} _10btc + * @property {CentsDeltaUsdPattern} _10kBtc + * @property {CentsDeltaUsdPattern} _10kSats + * @property {CentsDeltaUsdPattern} _10mSats + * @property {CentsDeltaUsdPattern} _10sats + * @property {CentsDeltaUsdPattern} _1btc + * @property {CentsDeltaUsdPattern} _1kBtc + * @property {CentsDeltaUsdPattern} _1kSats + * @property {CentsDeltaUsdPattern} _1mSats + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern4} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern4(client, acc) { + return { + _100btc: createCentsDeltaUsdPattern(client, _m(acc, '100btc_realized_cap')), + _100kBtc: createCentsDeltaUsdPattern(client, _m(acc, '100k_btc_realized_cap')), + _100kSats: createCentsDeltaUsdPattern(client, _m(acc, '100k_sats_realized_cap')), + _100sats: createCentsDeltaUsdPattern(client, _m(acc, '100sats_realized_cap')), + _10btc: createCentsDeltaUsdPattern(client, _m(acc, '10btc_realized_cap')), + _10kBtc: createCentsDeltaUsdPattern(client, _m(acc, '10k_btc_realized_cap')), + _10kSats: createCentsDeltaUsdPattern(client, _m(acc, '10k_sats_realized_cap')), + _10mSats: createCentsDeltaUsdPattern(client, _m(acc, '10m_sats_realized_cap')), + _10sats: createCentsDeltaUsdPattern(client, _m(acc, '10sats_realized_cap')), + _1btc: createCentsDeltaUsdPattern(client, _m(acc, '1btc_realized_cap')), + _1kBtc: createCentsDeltaUsdPattern(client, _m(acc, '1k_btc_realized_cap')), + _1kSats: createCentsDeltaUsdPattern(client, _m(acc, '1k_sats_realized_cap')), + _1mSats: createCentsDeltaUsdPattern(client, _m(acc, '1m_sats_realized_cap')), + }; +} + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4 + * @property {CentsDeltaUsdPattern} _100btc + * @property {CentsDeltaUsdPattern} _100kSats + * @property {CentsDeltaUsdPattern} _100sats + * @property {CentsDeltaUsdPattern} _10btc + * @property {CentsDeltaUsdPattern} _10kBtc + * @property {CentsDeltaUsdPattern} _10kSats + * @property {CentsDeltaUsdPattern} _10mSats + * @property {CentsDeltaUsdPattern} _10sats + * @property {CentsDeltaUsdPattern} _1btc + * @property {CentsDeltaUsdPattern} _1kBtc + * @property {CentsDeltaUsdPattern} _1kSats + * @property {CentsDeltaUsdPattern} _1mSats + * @property {CentsDeltaUsdPattern} _1sat + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4(client, acc) { + return { + _100btc: createCentsDeltaUsdPattern(client, _m(acc, '100btc_realized_cap')), + _100kSats: createCentsDeltaUsdPattern(client, _m(acc, '100k_sats_realized_cap')), + _100sats: createCentsDeltaUsdPattern(client, _m(acc, '100sats_realized_cap')), + _10btc: createCentsDeltaUsdPattern(client, _m(acc, '10btc_realized_cap')), + _10kBtc: createCentsDeltaUsdPattern(client, _m(acc, '10k_btc_realized_cap')), + _10kSats: createCentsDeltaUsdPattern(client, _m(acc, '10k_sats_realized_cap')), + _10mSats: createCentsDeltaUsdPattern(client, _m(acc, '10m_sats_realized_cap')), + _10sats: createCentsDeltaUsdPattern(client, _m(acc, '10sats_realized_cap')), + _1btc: createCentsDeltaUsdPattern(client, _m(acc, '1btc_realized_cap')), + _1kBtc: createCentsDeltaUsdPattern(client, _m(acc, '1k_btc_realized_cap')), + _1kSats: createCentsDeltaUsdPattern(client, _m(acc, '1k_sats_realized_cap')), + _1mSats: createCentsDeltaUsdPattern(client, _m(acc, '1m_sats_realized_cap')), + _1sat: createCentsDeltaUsdPattern(client, _m(acc, '1sat_realized_cap')), + }; +} + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1mPattern9 + * @property {PercentPpmRatioPattern2} _100btc + * @property {PercentPpmRatioPattern2} _100kBtc + * @property {PercentPpmRatioPattern2} _100kSats + * @property {PercentPpmRatioPattern2} _100sats + * @property {PercentPpmRatioPattern2} _10btc + * @property {PercentPpmRatioPattern2} _10kBtc + * @property {PercentPpmRatioPattern2} _10kSats + * @property {PercentPpmRatioPattern2} _10mSats + * @property {PercentPpmRatioPattern2} _10sats + * @property {PercentPpmRatioPattern2} _1btc + * @property {PercentPpmRatioPattern2} _1kBtc + * @property {PercentPpmRatioPattern2} _1kSats + * @property {PercentPpmRatioPattern2} _1mSats + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1mPattern9 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern9} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern9(client, acc) { + return { + _100btc: createPercentPpmRatioPattern2(client, _m(acc, '100btc_supply_dominance')), + _100kBtc: createPercentPpmRatioPattern2(client, _m(acc, '100k_btc_supply_dominance')), + _100kSats: createPercentPpmRatioPattern2(client, _m(acc, '100k_sats_supply_dominance')), + _100sats: createPercentPpmRatioPattern2(client, _m(acc, '100sats_supply_dominance')), + _10btc: createPercentPpmRatioPattern2(client, _m(acc, '10btc_supply_dominance')), + _10kBtc: createPercentPpmRatioPattern2(client, _m(acc, '10k_btc_supply_dominance')), + _10kSats: createPercentPpmRatioPattern2(client, _m(acc, '10k_sats_supply_dominance')), + _10mSats: createPercentPpmRatioPattern2(client, _m(acc, '10m_sats_supply_dominance')), + _10sats: createPercentPpmRatioPattern2(client, _m(acc, '10sats_supply_dominance')), + _1btc: createPercentPpmRatioPattern2(client, _m(acc, '1btc_supply_dominance')), + _1kBtc: createPercentPpmRatioPattern2(client, _m(acc, '1k_btc_supply_dominance')), + _1kSats: createPercentPpmRatioPattern2(client, _m(acc, '1k_sats_supply_dominance')), + _1mSats: createPercentPpmRatioPattern2(client, _m(acc, '1m_sats_supply_dominance')), + }; +} + +/** + * @typedef {Object} _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9 + * @property {PercentPpmRatioPattern2} _100btc + * @property {PercentPpmRatioPattern2} _100kSats + * @property {PercentPpmRatioPattern2} _100sats + * @property {PercentPpmRatioPattern2} _10btc + * @property {PercentPpmRatioPattern2} _10kBtc + * @property {PercentPpmRatioPattern2} _10kSats + * @property {PercentPpmRatioPattern2} _10mSats + * @property {PercentPpmRatioPattern2} _10sats + * @property {PercentPpmRatioPattern2} _1btc + * @property {PercentPpmRatioPattern2} _1kBtc + * @property {PercentPpmRatioPattern2} _1kSats + * @property {PercentPpmRatioPattern2} _1mSats + * @property {PercentPpmRatioPattern2} _1sat + */ + +/** + * Create a _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9} + */ +function create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9(client, acc) { + return { + _100btc: createPercentPpmRatioPattern2(client, _m(acc, '100btc_supply_dominance')), + _100kSats: createPercentPpmRatioPattern2(client, _m(acc, '100k_sats_supply_dominance')), + _100sats: createPercentPpmRatioPattern2(client, _m(acc, '100sats_supply_dominance')), + _10btc: createPercentPpmRatioPattern2(client, _m(acc, '10btc_supply_dominance')), + _10kBtc: createPercentPpmRatioPattern2(client, _m(acc, '10k_btc_supply_dominance')), + _10kSats: createPercentPpmRatioPattern2(client, _m(acc, '10k_sats_supply_dominance')), + _10mSats: createPercentPpmRatioPattern2(client, _m(acc, '10m_sats_supply_dominance')), + _10sats: createPercentPpmRatioPattern2(client, _m(acc, '10sats_supply_dominance')), + _1btc: createPercentPpmRatioPattern2(client, _m(acc, '1btc_supply_dominance')), + _1kBtc: createPercentPpmRatioPattern2(client, _m(acc, '1k_btc_supply_dominance')), + _1kSats: createPercentPpmRatioPattern2(client, _m(acc, '1k_sats_supply_dominance')), + _1mSats: createPercentPpmRatioPattern2(client, _m(acc, '1m_sats_supply_dominance')), + _1sat: createPercentPpmRatioPattern2(client, _m(acc, '1sat_supply_dominance')), + }; +} + /** * @typedef {Object} _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 * @property {BtcCentsSatsUsdPattern} _10y @@ -2892,44 +4470,21 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, acc) { } /** - * @typedef {Object} CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern - * @property {CentsDeltaToUsdPattern} cap - * @property {PricePattern} capitalized - * @property {BlockCumulativeSumPattern} grossPnl - * @property {BlockCumulativeNegativeSumPattern} loss - * @property {SeriesPattern1} mvrv - * @property {BlockChangeCumulativeDeltaSumPattern} netPnl - * @property {BlockCumulativeSumPattern} peakRegret - * @property {CentsPpmRatioSatsUsdPattern} price - * @property {BlockCumulativeSumPattern} profit - * @property {_1m1w1y24hHeightPattern2} profitToLossRatio - * @property {_1m1w1y24hHeightPattern3} sellSideRiskRatio - * @property {AdjustedRatioValuePattern} sopr + * @typedef {Object} AgeAllClassEntryEpochTermTypePattern2 + * @property {OverRangeUnderPattern21} age + * @property {SeriesPattern18} ageRangeMatrix + * @property {BtcCentsSatsUsdPattern} all + * @property {_200920102011201220132014201520162017201820192020202120222023202420252026Pattern12} class + * @property {SeriesPattern18} classMatrix + * @property {DiscountPremiumPattern12} entry + * @property {SeriesPattern18} entryMatrix + * @property {_01234Pattern12} epoch + * @property {SeriesPattern18} epochMatrix + * @property {LongShortPattern13} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10} type + * @property {SeriesPattern18} typeMatrix */ -/** - * Create a CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern} - */ -function createCapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern(client, acc) { - return { - cap: createCentsDeltaToUsdPattern(client, _m(acc, 'realized_cap')), - capitalized: createPricePattern(client, _m(acc, 'capitalized_price')), - grossPnl: createBlockCumulativeSumPattern(client, _m(acc, 'realized_gross_pnl')), - loss: createBlockCumulativeNegativeSumPattern(client, _m(acc, 'realized_loss')), - mvrv: createSeriesPattern1(client, _m(acc, 'mvrv')), - netPnl: createBlockChangeCumulativeDeltaSumPattern(client, _m(acc, 'net')), - peakRegret: createBlockCumulativeSumPattern(client, _m(acc, 'realized_peak_regret')), - price: createCentsPpmRatioSatsUsdPattern(client, _m(acc, 'realized_price')), - profit: createBlockCumulativeSumPattern(client, _m(acc, 'realized_profit')), - profitToLossRatio: create_1m1w1y24hHeightPattern2(client, _m(acc, 'realized_profit_to_loss_ratio')), - sellSideRiskRatio: create_1m1w1y24hHeightPattern3(client, _m(acc, 'sell_side_risk_ratio')), - sopr: createAdjustedRatioValuePattern(client, acc), - }; -} - /** * @typedef {Object} EmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 * @property {_1m1w1y24hPercentPpmRatioPattern} empty @@ -3022,7 +4577,118 @@ function createAverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern( } /** - * @typedef {Object} EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 + * @typedef {Object} EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5 + * @property {BlockCumulativeSumPattern} empty + * @property {BlockCumulativeSumPattern} p2a + * @property {BlockCumulativeSumPattern} p2ms + * @property {BlockCumulativeSumPattern} p2pk33 + * @property {BlockCumulativeSumPattern} p2pk65 + * @property {BlockCumulativeSumPattern} p2pkh + * @property {BlockCumulativeSumPattern} p2sh + * @property {BlockCumulativeSumPattern} p2tr + * @property {BlockCumulativeSumPattern} p2wpkh + * @property {BlockCumulativeSumPattern} p2wsh + * @property {BlockCumulativeSumPattern} unknown + */ + +/** + * Create a EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5} + */ +function createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5(client, acc) { + return { + empty: createBlockCumulativeSumPattern(client, _p('empty_outputs', acc)), + p2a: createBlockCumulativeSumPattern(client, _p('p2a', acc)), + p2ms: createBlockCumulativeSumPattern(client, _p('p2ms', acc)), + p2pk33: createBlockCumulativeSumPattern(client, _p('p2pk33', acc)), + p2pk65: createBlockCumulativeSumPattern(client, _p('p2pk65', acc)), + p2pkh: createBlockCumulativeSumPattern(client, _p('p2pkh', acc)), + p2sh: createBlockCumulativeSumPattern(client, _p('p2sh', acc)), + p2tr: createBlockCumulativeSumPattern(client, _p('p2tr', acc)), + p2wpkh: createBlockCumulativeSumPattern(client, _p('p2wpkh', acc)), + p2wsh: createBlockCumulativeSumPattern(client, _p('p2wsh', acc)), + unknown: createBlockCumulativeSumPattern(client, _p('unknown_outputs', acc)), + }; +} + +/** + * @typedef {Object} EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10 + * @property {BtcCentsSatsUsdPattern} empty + * @property {BtcCentsSatsUsdPattern} p2a + * @property {BtcCentsSatsUsdPattern} p2ms + * @property {BtcCentsSatsUsdPattern} p2pk33 + * @property {BtcCentsSatsUsdPattern} p2pk65 + * @property {BtcCentsSatsUsdPattern} p2pkh + * @property {BtcCentsSatsUsdPattern} p2sh + * @property {BtcCentsSatsUsdPattern} p2tr + * @property {BtcCentsSatsUsdPattern} p2wpkh + * @property {BtcCentsSatsUsdPattern} p2wsh + * @property {BtcCentsSatsUsdPattern} unknown + */ + +/** + * Create a EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10} + */ +function createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10(client, acc) { + return { + empty: createBtcCentsSatsUsdPattern(client, _p('empty_outputs', acc)), + p2a: createBtcCentsSatsUsdPattern(client, _p('p2a', acc)), + p2ms: createBtcCentsSatsUsdPattern(client, _p('p2ms', acc)), + p2pk33: createBtcCentsSatsUsdPattern(client, _p('p2pk33', acc)), + p2pk65: createBtcCentsSatsUsdPattern(client, _p('p2pk65', acc)), + p2pkh: createBtcCentsSatsUsdPattern(client, _p('p2pkh', acc)), + p2sh: createBtcCentsSatsUsdPattern(client, _p('p2sh', acc)), + p2tr: createBtcCentsSatsUsdPattern(client, _p('p2tr', acc)), + p2wpkh: createBtcCentsSatsUsdPattern(client, _p('p2wpkh', acc)), + p2wsh: createBtcCentsSatsUsdPattern(client, _p('p2wsh', acc)), + unknown: createBtcCentsSatsUsdPattern(client, _p('unknown_outputs', acc)), + }; +} + +/** + * @typedef {Object} EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11 + * @property {CentsUsdPattern3} empty + * @property {CentsUsdPattern3} p2a + * @property {CentsUsdPattern3} p2ms + * @property {CentsUsdPattern3} p2pk33 + * @property {CentsUsdPattern3} p2pk65 + * @property {CentsUsdPattern3} p2pkh + * @property {CentsUsdPattern3} p2sh + * @property {CentsUsdPattern3} p2tr + * @property {CentsUsdPattern3} p2wpkh + * @property {CentsUsdPattern3} p2wsh + * @property {CentsUsdPattern3} unknown + */ + +/** + * Create a EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11} + */ +function createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11(client, acc) { + return { + empty: createCentsUsdPattern3(client, _p('empty_outputs', acc)), + p2a: createCentsUsdPattern3(client, _p('p2a', acc)), + p2ms: createCentsUsdPattern3(client, _p('p2ms', acc)), + p2pk33: createCentsUsdPattern3(client, _p('p2pk33', acc)), + p2pk65: createCentsUsdPattern3(client, _p('p2pk65', acc)), + p2pkh: createCentsUsdPattern3(client, _p('p2pkh', acc)), + p2sh: createCentsUsdPattern3(client, _p('p2sh', acc)), + p2tr: createCentsUsdPattern3(client, _p('p2tr', acc)), + p2wpkh: createCentsUsdPattern3(client, _p('p2wpkh', acc)), + p2wsh: createCentsUsdPattern3(client, _p('p2wsh', acc)), + unknown: createCentsUsdPattern3(client, _p('unknown_outputs', acc)), + }; +} + +/** + * @typedef {Object} EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13 * @property {_1m1w1y24hPercentPpmRatioPattern} empty * @property {_1m1w1y24hPercentPpmRatioPattern} p2a * @property {_1m1w1y24hPercentPpmRatioPattern} p2ms @@ -3037,12 +4703,12 @@ function createAverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern( */ /** - * Create a EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 pattern node + * Create a EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13 pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2} + * @returns {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13} */ -function createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2(client, acc) { +function createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13(client, acc) { return { empty: create_1m1w1y24hPercentPpmRatioPattern(client, _m(acc, 'empty_outputs_prevout')), p2a: create_1m1w1y24hPercentPpmRatioPattern(client, _m(acc, 'p2a_prevout')), @@ -3097,6 +4763,45 @@ function createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(c }; } +/** + * @template T + * @typedef {Object} EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6 + * @property {SeriesPattern1} empty + * @property {SeriesPattern1} p2a + * @property {SeriesPattern1} p2ms + * @property {SeriesPattern1} p2pk33 + * @property {SeriesPattern1} p2pk65 + * @property {SeriesPattern1} p2pkh + * @property {SeriesPattern1} p2sh + * @property {SeriesPattern1} p2tr + * @property {SeriesPattern1} p2wpkh + * @property {SeriesPattern1} p2wsh + * @property {SeriesPattern1} unknown + */ + +/** + * Create a EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6 pattern node + * @template T + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6} + */ +function createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6(client, acc) { + return { + empty: createSeriesPattern1(client, _p('empty_outputs', acc)), + p2a: createSeriesPattern1(client, _p('p2a', acc)), + p2ms: createSeriesPattern1(client, _p('p2ms', acc)), + p2pk33: createSeriesPattern1(client, _p('p2pk33', acc)), + p2pk65: createSeriesPattern1(client, _p('p2pk65', acc)), + p2pkh: createSeriesPattern1(client, _p('p2pkh', acc)), + p2sh: createSeriesPattern1(client, _p('p2sh', acc)), + p2tr: createSeriesPattern1(client, _p('p2tr', acc)), + p2wpkh: createSeriesPattern1(client, _p('p2wpkh', acc)), + p2wsh: createSeriesPattern1(client, _p('p2wsh', acc)), + unknown: createSeriesPattern1(client, _p('unknown_outputs', acc)), + }; +} + /** * @typedef {Object} AllCumulativeP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern * @property {AverageBlockCumulativeSumPattern} all @@ -3125,6 +4830,52 @@ function createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(c * @property {SeriesPattern1} p2wsh */ +/** + * @typedef {Object} _10pct20pct30pct40pct50pct60pct70pct80pctAllPattern2 + * @property {AllLthSthPattern} _10pct + * @property {AllLthSthPattern} _20pct + * @property {AllLthSthPattern} _30pct + * @property {AllLthSthPattern} _40pct + * @property {AllLthSthPattern} _50pct + * @property {AllLthSthPattern} _60pct + * @property {AllLthSthPattern} _70pct + * @property {AllLthSthPattern} _80pct + * @property {AllLthSthPattern} all + */ + +/** + * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2 + * @property {BtcCentsSatsUsdPattern} all + * @property {BtcCentsSatsUsdPattern} p2a + * @property {BtcCentsSatsUsdPattern} p2pk33 + * @property {BtcCentsSatsUsdPattern} p2pk65 + * @property {BtcCentsSatsUsdPattern} p2pkh + * @property {BtcCentsSatsUsdPattern} p2sh + * @property {BtcCentsSatsUsdPattern} p2tr + * @property {BtcCentsSatsUsdPattern} p2wpkh + * @property {BtcCentsSatsUsdPattern} p2wsh + */ + +/** + * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2} + */ +function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2(client, acc) { + return { + all: createBtcCentsSatsUsdPattern(client, acc), + p2a: createBtcCentsSatsUsdPattern(client, _p('p2a', acc)), + p2pk33: createBtcCentsSatsUsdPattern(client, _p('p2pk33', acc)), + p2pk65: createBtcCentsSatsUsdPattern(client, _p('p2pk65', acc)), + p2pkh: createBtcCentsSatsUsdPattern(client, _p('p2pkh', acc)), + p2sh: createBtcCentsSatsUsdPattern(client, _p('p2sh', acc)), + p2tr: createBtcCentsSatsUsdPattern(client, _p('p2tr', acc)), + p2wpkh: createBtcCentsSatsUsdPattern(client, _p('p2wpkh', acc)), + p2wsh: createBtcCentsSatsUsdPattern(client, _p('p2wsh', acc)), + }; +} + /** * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4 * @property {PercentPpmRatioPattern2} all @@ -3158,6 +4909,39 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4(client, acc) { }; } +/** + * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern + * @property {_1m1w1y24hBlockPattern} all + * @property {_1m1w1y24hBlockPattern} p2a + * @property {_1m1w1y24hBlockPattern} p2pk33 + * @property {_1m1w1y24hBlockPattern} p2pk65 + * @property {_1m1w1y24hBlockPattern} p2pkh + * @property {_1m1w1y24hBlockPattern} p2sh + * @property {_1m1w1y24hBlockPattern} p2tr + * @property {_1m1w1y24hBlockPattern} p2wpkh + * @property {_1m1w1y24hBlockPattern} p2wsh + */ + +/** + * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern} + */ +function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(client, acc) { + return { + all: create_1m1w1y24hBlockPattern(client, acc), + p2a: create_1m1w1y24hBlockPattern(client, _p('p2a', acc)), + p2pk33: create_1m1w1y24hBlockPattern(client, _p('p2pk33', acc)), + p2pk65: create_1m1w1y24hBlockPattern(client, _p('p2pk65', acc)), + p2pkh: create_1m1w1y24hBlockPattern(client, _p('p2pkh', acc)), + p2sh: create_1m1w1y24hBlockPattern(client, _p('p2sh', acc)), + p2tr: create_1m1w1y24hBlockPattern(client, _p('p2tr', acc)), + p2wpkh: create_1m1w1y24hBlockPattern(client, _p('p2wpkh', acc)), + p2wsh: create_1m1w1y24hBlockPattern(client, _p('p2wsh', acc)), + }; +} + /** * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6 * @property {_1m1w1y24hPercentPpmRatioPattern} all @@ -3224,39 +5008,6 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) { }; } -/** - * @typedef {Object} CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2 - * @property {SeriesPattern18} capitalizedCapInLossRaw - * @property {SeriesPattern18} capitalizedCapInProfitRaw - * @property {CentsUsdPattern3} grossPnl - * @property {InPattern2} investedCapital - * @property {CentsNegativeToUsdPattern2} loss - * @property {CentsToUsdPattern3} netPnl - * @property {PpmRatioPattern} nupl - * @property {CentsToUsdPattern4} profit - * @property {GreedNetPainPattern} sentiment - */ - -/** - * Create a CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2} - */ -function createCapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(client, acc) { - return { - capitalizedCapInLossRaw: createSeriesPattern18(client, _m(acc, 'capitalized_cap_in_loss_raw')), - capitalizedCapInProfitRaw: createSeriesPattern18(client, _m(acc, 'capitalized_cap_in_profit_raw')), - grossPnl: createCentsUsdPattern3(client, _m(acc, 'unrealized_gross_pnl')), - investedCapital: createInPattern2(client, _m(acc, 'invested_capital_in')), - loss: createCentsNegativeToUsdPattern2(client, _m(acc, 'unrealized_loss')), - netPnl: createCentsToUsdPattern3(client, _m(acc, 'net_unrealized_pnl')), - nupl: createPpmRatioPattern(client, _m(acc, 'nupl')), - profit: createCentsToUsdPattern4(client, _m(acc, 'unrealized_profit')), - sentiment: createGreedNetPainPattern(client, acc), - }; -} - /** * @typedef {Object} Pct10Pct20Pct30Pct40Pct50Pct60Pct70Pct80Pct90Pattern * @property {CentsSatsUsdPattern} pct10 @@ -3349,7 +5100,7 @@ function create_1m1w1y24hPercentPpmRatioPattern(client, acc) { } /** - * @typedef {Object} _1m1y2y3m4y6m8yPattern + * @typedef {Object} _1m1y2y3m4y6m8yPattern2 * @property {SupplyPattern} _1m * @property {SupplyPattern} _1y * @property {SupplyPattern} _2y @@ -3360,12 +5111,12 @@ function create_1m1w1y24hPercentPpmRatioPattern(client, acc) { */ /** - * Create a _1m1y2y3m4y6m8yPattern pattern node + * Create a _1m1y2y3m4y6m8yPattern2 pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {_1m1y2y3m4y6m8yPattern} + * @returns {_1m1y2y3m4y6m8yPattern2} */ -function create_1m1y2y3m4y6m8yPattern(client, acc) { +function create_1m1y2y3m4y6m8yPattern2(client, acc) { return { _1m: createSupplyPattern(client, _m(acc, '1m_supply_in_loss_share')), _1y: createSupplyPattern(client, _m(acc, '1y_supply_in_loss_share')), @@ -3389,42 +5140,24 @@ function create_1m1y2y3m4y6m8yPattern(client, acc) { */ /** - * @typedef {Object} CapLossMvrvNetPriceProfitSoprPattern - * @property {CentsDeltaUsdPattern} cap - * @property {BlockCumulativeNegativeSumPattern} loss - * @property {SeriesPattern1} mvrv - * @property {BlockCumulativeDeltaSumPattern} netPnl - * @property {CentsPpmRatioSatsUsdPattern} price - * @property {BlockCumulativeSumPattern} profit - * @property {RatioValuePattern} sopr + * @typedef {Object} AgeAllClassCumulativeEntryEpochTermPattern + * @property {OverRangeUnderPattern2} age + * @property {AverageBlockCumulativeSumPattern2} all + * @property {_200920102011201220132014201520162017201820192020202120222023202420252026Pattern2} class + * @property {AgeClassEntryEpochPattern} cumulative + * @property {DiscountPremiumPattern2} entry + * @property {_01234Pattern2} epoch + * @property {LongShortPattern2} term */ -/** - * Create a CapLossMvrvNetPriceProfitSoprPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CapLossMvrvNetPriceProfitSoprPattern} - */ -function createCapLossMvrvNetPriceProfitSoprPattern(client, acc) { - return { - cap: createCentsDeltaUsdPattern(client, _m(acc, 'realized_cap')), - loss: createBlockCumulativeNegativeSumPattern(client, _m(acc, 'realized_loss')), - mvrv: createSeriesPattern1(client, _m(acc, 'mvrv')), - netPnl: createBlockCumulativeDeltaSumPattern(client, _m(acc, 'net_realized_pnl')), - price: createCentsPpmRatioSatsUsdPattern(client, _m(acc, 'realized_price')), - profit: createBlockCumulativeSumPattern(client, _m(acc, 'realized_profit')), - sopr: createRatioValuePattern(client, acc), - }; -} - /** * @typedef {Object} InMaxMinPerSupplyPattern * @property {PerPattern} inLoss * @property {PerPattern} inProfit * @property {CentsSatsUsdPattern} max * @property {CentsSatsUsdPattern} min - * @property {HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} perCoin - * @property {HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} perDollar + * @property {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} perCoin + * @property {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} perDollar * @property {PercentPpmRatioPattern2} supplyDensity */ @@ -3440,8 +5173,8 @@ function createInMaxMinPerSupplyPattern(client, acc) { inProfit: createPerPattern(client, _m(acc, 'cost_basis_in_profit_per')), max: createCentsSatsUsdPattern(client, _m(acc, 'cost_basis_max')), min: createCentsSatsUsdPattern(client, _m(acc, 'cost_basis_min')), - perCoin: createHeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis_per_coin')), - perDollar: createHeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis_per_dollar')), + perCoin: createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis_per_coin')), + perDollar: createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis_per_dollar')), supplyDensity: createPercentPpmRatioPattern2(client, _m(acc, 'supply_density')), }; } @@ -3533,114 +5266,6 @@ function createAverageBlockChainCumulativeDataSumPattern(client, acc) { }; } -/** - * @typedef {Object} AverageBlockCumulativeInSumPattern - * @property {_1m1w1y24hPattern3} average - * @property {BtcCentsSatsUsdPattern3} block - * @property {BtcCentsSatsUsdPattern} cumulative - * @property {AverageBlockCumulativeSumPattern2} inLoss - * @property {AverageBlockCumulativeSumPattern2} inProfit - * @property {_1m1w1y24hPattern4} sum - */ - -/** - * Create a AverageBlockCumulativeInSumPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {AverageBlockCumulativeInSumPattern} - */ -function createAverageBlockCumulativeInSumPattern(client, acc) { - return { - average: create_1m1w1y24hPattern3(client, _m(acc, 'average')), - block: createBtcCentsSatsUsdPattern3(client, acc), - cumulative: createBtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')), - inLoss: createAverageBlockCumulativeSumPattern2(client, _m(acc, 'in_loss')), - inProfit: createAverageBlockCumulativeSumPattern2(client, _m(acc, 'in_profit')), - sum: create_1m1w1y24hPattern4(client, _m(acc, 'sum')), - }; -} - -/** - * @typedef {Object} CentsNegativeToUsdPattern2 - * @property {SeriesPattern1} cents - * @property {SeriesPattern1} negative - * @property {PercentPpmRatioPattern2} toMcap - * @property {PercentPpmRatioPattern2} toOwnGrossPnl - * @property {PercentPpmRatioPattern2} toOwnMcap - * @property {SeriesPattern1} usd - */ - -/** - * Create a CentsNegativeToUsdPattern2 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CentsNegativeToUsdPattern2} - */ -function createCentsNegativeToUsdPattern2(client, acc) { - return { - cents: createSeriesPattern1(client, _m(acc, 'cents')), - negative: createSeriesPattern1(client, _m(acc, 'neg')), - toMcap: createPercentPpmRatioPattern2(client, _m(acc, 'to_mcap')), - toOwnGrossPnl: createPercentPpmRatioPattern2(client, _m(acc, 'to_own_gross_pnl')), - toOwnMcap: createPercentPpmRatioPattern2(client, _m(acc, 'to_own_mcap')), - usd: createSeriesPattern1(client, acc), - }; -} - -/** - * @typedef {Object} DeltaDominanceHalfInTotalPattern2 - * @property {AbsoluteRatePattern3} delta - * @property {PercentPpmRatioPattern2} dominance - * @property {BtcCentsSatsUsdPattern} half - * @property {BtcCentsSatsShareUsdPattern} inLoss - * @property {BtcCentsSatsShareUsdPattern} inProfit - * @property {BtcCentsSatsUsdPattern} total - */ - -/** - * Create a DeltaDominanceHalfInTotalPattern2 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {DeltaDominanceHalfInTotalPattern2} - */ -function createDeltaDominanceHalfInTotalPattern2(client, acc) { - return { - delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')), - dominance: createPercentPpmRatioPattern2(client, _m(acc, 'dominance')), - half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')), - inLoss: createBtcCentsSatsShareUsdPattern(client, _m(acc, 'in_loss')), - inProfit: createBtcCentsSatsShareUsdPattern(client, _m(acc, 'in_profit')), - total: createBtcCentsSatsUsdPattern(client, acc), - }; -} - -/** - * @typedef {Object} DeltaDominanceHalfInTotalPattern - * @property {AbsoluteRatePattern3} delta - * @property {PercentPpmRatioPattern2} dominance - * @property {BtcCentsSatsUsdPattern} half - * @property {BtcCentsSatsUsdPattern} inLoss - * @property {BtcCentsSatsUsdPattern} inProfit - * @property {BtcCentsSatsUsdPattern} total - */ - -/** - * Create a DeltaDominanceHalfInTotalPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {DeltaDominanceHalfInTotalPattern} - */ -function createDeltaDominanceHalfInTotalPattern(client, acc) { - return { - delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')), - dominance: createPercentPpmRatioPattern2(client, _m(acc, 'dominance')), - half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')), - inLoss: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_loss')), - inProfit: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_profit')), - total: createBtcCentsSatsUsdPattern(client, acc), - }; -} - /** * @typedef {Object} HeightRankTailThresholdPattern * @property {SeriesPattern18<[Dollars; 3]>} height @@ -3668,6 +5293,68 @@ function createHeightRankTailThresholdPattern(client, acc) { }; } +/** + * @typedef {Object} _01234Pattern + * @property {AverageBlockCumulativeSumPattern} _0 + * @property {AverageBlockCumulativeSumPattern} _1 + * @property {AverageBlockCumulativeSumPattern} _2 + * @property {AverageBlockCumulativeSumPattern} _3 + * @property {AverageBlockCumulativeSumPattern} _4 + */ + +/** + * @typedef {Object} _01234Pattern2 + * @property {AverageBlockCumulativeSumPattern2} _0 + * @property {AverageBlockCumulativeSumPattern2} _1 + * @property {AverageBlockCumulativeSumPattern2} _2 + * @property {AverageBlockCumulativeSumPattern2} _3 + * @property {AverageBlockCumulativeSumPattern2} _4 + */ + +/** + * Create a _01234Pattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @param {string} disc - Discriminator suffix + * @returns {_01234Pattern2} + */ +function create_01234Pattern2(client, acc, disc) { + return { + _0: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '0_transfer_volume'), disc)), + _1: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '1_transfer_volume'), disc)), + _2: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '2_transfer_volume'), disc)), + _3: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '3_transfer_volume'), disc)), + _4: createAverageBlockCumulativeSumPattern2(client, _m(_m(acc, '4_transfer_volume'), disc)), + }; +} + +/** + * @typedef {Object} _01234Pattern5 + * @property {BlockCumulativeSumPattern} _0 + * @property {BlockCumulativeSumPattern} _1 + * @property {BlockCumulativeSumPattern} _2 + * @property {BlockCumulativeSumPattern} _3 + * @property {BlockCumulativeSumPattern} _4 + */ + +/** + * @typedef {Object} _01234Pattern12 + * @property {BtcCentsSatsUsdPattern} _0 + * @property {BtcCentsSatsUsdPattern} _1 + * @property {BtcCentsSatsUsdPattern} _2 + * @property {BtcCentsSatsUsdPattern} _3 + * @property {BtcCentsSatsUsdPattern} _4 + */ + +/** + * @typedef {Object} _01234Pattern13 + * @property {CentsUsdPattern3} _0 + * @property {CentsUsdPattern3} _1 + * @property {CentsUsdPattern3} _2 + * @property {CentsUsdPattern3} _3 + * @property {CentsUsdPattern3} _4 + */ + /** * @typedef {Object} _1m1w1y24hHeightPattern3 * @property {PercentPpmRatioPattern2} _1m @@ -3768,31 +5455,6 @@ function create_1m1w1y24hHeightPattern(client, acc) { }; } -/** - * @typedef {Object} _1m1w1y24hHeightPattern4 - * @property {SeriesPattern1} _1m - * @property {SeriesPattern1} _1w - * @property {SeriesPattern1} _1y - * @property {SeriesPattern1} _24h - * @property {SeriesPattern18<[StoredF64; 3]>} height - */ - -/** - * Create a _1m1w1y24hHeightPattern4 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {_1m1w1y24hHeightPattern4} - */ -function create_1m1w1y24hHeightPattern4(client, acc) { - return { - _1m: createSeriesPattern1(client, _m(acc, '1m')), - _1w: createSeriesPattern1(client, _m(acc, '1w')), - _1y: createSeriesPattern1(client, _m(acc, '1y')), - _24h: createSeriesPattern1(client, _m(acc, '24h')), - height: createSeriesPattern18(client, acc), - }; -} - /** * @typedef {Object} _1m1w1y24hHeightPattern2 * @property {SeriesPattern1} _1m @@ -3818,131 +5480,6 @@ function create_1m1w1y24hHeightPattern2(client, acc) { }; } -/** - * @typedef {Object} ActiveBidirectionalReactivatedReceivingSendingPattern - * @property {_1m1w1y24hBlockPattern} active - * @property {_1m1w1y24hBlockPattern} bidirectional - * @property {_1m1w1y24hBlockPattern} reactivated - * @property {_1m1w1y24hBlockPattern} receiving - * @property {_1m1w1y24hBlockPattern} sending - */ - -/** - * Create a ActiveBidirectionalReactivatedReceivingSendingPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {ActiveBidirectionalReactivatedReceivingSendingPattern} - */ -function createActiveBidirectionalReactivatedReceivingSendingPattern(client, acc) { - return { - active: create_1m1w1y24hBlockPattern(client, _m(acc, 'active_addrs')), - bidirectional: create_1m1w1y24hBlockPattern(client, _m(acc, 'bidirectional_addrs')), - reactivated: create_1m1w1y24hBlockPattern(client, _m(acc, 'reactivated_addrs')), - receiving: create_1m1w1y24hBlockPattern(client, _m(acc, 'receiving_addrs')), - sending: create_1m1w1y24hBlockPattern(client, _m(acc, 'sending_addrs')), - }; -} - -/** - * @typedef {Object} ActivityOutputsRealizedSupplyUnrealizedPattern - * @property {CoindaysTransferPattern} activity - * @property {SpentUnspentPattern} outputs - * @property {CapLossMvrvNetPriceProfitSoprPattern} realized - * @property {DeltaDominanceHalfInTotalPattern} supply - * @property {LossNetNuplProfitPattern} unrealized - */ - -/** - * Create a ActivityOutputsRealizedSupplyUnrealizedPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {ActivityOutputsRealizedSupplyUnrealizedPattern} - */ -function createActivityOutputsRealizedSupplyUnrealizedPattern(client, acc) { - return { - activity: createCoindaysTransferPattern(client, acc), - outputs: createSpentUnspentPattern(client, acc), - realized: createCapLossMvrvNetPriceProfitSoprPattern(client, acc), - supply: createDeltaDominanceHalfInTotalPattern(client, _m(acc, 'supply')), - unrealized: createLossNetNuplProfitPattern(client, acc), - }; -} - -/** - * @typedef {Object} ActivityAddrOutputsRealizedSupplyPattern - * @property {TransferPattern} activity - * @property {BaseDeltaPattern} addrCount - * @property {UnspentPattern} outputs - * @property {CapLossProfitPattern} realized - * @property {DeltaDominanceTotalPattern} supply - */ - -/** - * Create a ActivityAddrOutputsRealizedSupplyPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {ActivityAddrOutputsRealizedSupplyPattern} - */ -function createActivityAddrOutputsRealizedSupplyPattern(client, acc) { - return { - activity: createTransferPattern(client, _m(acc, 'transfer_volume')), - addrCount: createBaseDeltaPattern(client, _m(acc, 'addr_count')), - outputs: createUnspentPattern(client, _m(acc, 'utxo_count')), - realized: createCapLossProfitPattern(client, _m(acc, 'realized')), - supply: createDeltaDominanceTotalPattern(client, _m(acc, 'supply')), - }; -} - -/** - * @typedef {Object} ActivityOutputsRealizedSupplyUnrealizedPattern3 - * @property {TransferPattern} activity - * @property {SpentUnspentPattern} outputs - * @property {CapLossMvrvPriceProfitPattern} realized - * @property {DeltaDominanceHalfInTotalPattern} supply - * @property {LossNuplProfitPattern} unrealized - */ - -/** - * Create a ActivityOutputsRealizedSupplyUnrealizedPattern3 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {ActivityOutputsRealizedSupplyUnrealizedPattern3} - */ -function createActivityOutputsRealizedSupplyUnrealizedPattern3(client, acc) { - return { - activity: createTransferPattern(client, _m(acc, 'transfer_volume')), - outputs: createSpentUnspentPattern(client, acc), - realized: createCapLossMvrvPriceProfitPattern(client, acc), - supply: createDeltaDominanceHalfInTotalPattern(client, _m(acc, 'supply')), - unrealized: createLossNuplProfitPattern(client, acc), - }; -} - -/** - * @typedef {Object} ActivityOutputsRealizedSupplyUnrealizedPattern2 - * @property {TransferPattern} activity - * @property {SpentUnspentPattern} outputs - * @property {CapLossMvrvPriceProfitPattern} realized - * @property {DeltaDominanceTotalPattern} supply - * @property {NuplPattern} unrealized - */ - -/** - * Create a ActivityOutputsRealizedSupplyUnrealizedPattern2 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {ActivityOutputsRealizedSupplyUnrealizedPattern2} - */ -function createActivityOutputsRealizedSupplyUnrealizedPattern2(client, acc) { - return { - activity: createTransferPattern(client, _m(acc, 'transfer_volume')), - outputs: createSpentUnspentPattern(client, acc), - realized: createCapLossMvrvPriceProfitPattern(client, acc), - supply: createDeltaDominanceTotalPattern(client, _m(acc, 'supply')), - unrealized: createNuplPattern(client, _m(acc, 'nupl')), - }; -} - /** * @typedef {Object} AverageBlockCumulativeFeeSumPattern * @property {_1m1w1y24hPattern} average @@ -3968,36 +5505,11 @@ function createAverageBlockCumulativeFeeSumPattern(client, acc) { }; } -/** - * @typedef {Object} BlockChangeCumulativeDeltaSumPattern - * @property {CentsUsdPattern4} block - * @property {ToPattern} change1m - * @property {CentsUsdPattern} cumulative - * @property {AbsoluteRatePattern2} delta - * @property {_1m1w1y24hPattern5} sum - */ - -/** - * Create a BlockChangeCumulativeDeltaSumPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {BlockChangeCumulativeDeltaSumPattern} - */ -function createBlockChangeCumulativeDeltaSumPattern(client, acc) { - return { - block: createCentsUsdPattern4(client, _m(acc, 'realized_pnl')), - change1m: createToPattern(client, _m(acc, 'pnl_change_1m_to')), - cumulative: createCentsUsdPattern(client, _m(acc, 'realized_pnl_cumulative')), - delta: createAbsoluteRatePattern2(client, _m(acc, 'realized_pnl_delta')), - sum: create_1m1w1y24hPattern5(client, _m(acc, 'realized_pnl_sum')), - }; -} - /** * @typedef {Object} BtcCentsDeltaSatsUsdPattern * @property {SeriesPattern1} btc * @property {SeriesPattern1} cents - * @property {AbsoluteRatePattern3} delta + * @property {AbsoluteRatePattern2} delta * @property {SeriesPattern1} sats * @property {SeriesPattern1} usd */ @@ -4012,7 +5524,7 @@ function createBtcCentsDeltaSatsUsdPattern(client, acc) { return { btc: createSeriesPattern1(client, acc), cents: createSeriesPattern1(client, _m(acc, 'cents')), - delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')), + delta: createAbsoluteRatePattern2(client, _m(acc, 'delta')), sats: createSeriesPattern1(client, _m(acc, 'sats')), usd: createSeriesPattern1(client, _m(acc, 'usd')), }; @@ -4022,61 +5534,11 @@ function createBtcCentsDeltaSatsUsdPattern(client, acc) { * @typedef {Object} BtcCentsInSatsUsdPattern * @property {SeriesPattern1} btc * @property {SeriesPattern1} cents - * @property {SharePattern2} inLoss + * @property {SharePattern3} inLoss * @property {SeriesPattern1} sats * @property {SeriesPattern1} usd */ -/** - * @typedef {Object} BtcCentsSatsShareUsdPattern - * @property {SeriesPattern1} btc - * @property {SeriesPattern1} cents - * @property {SeriesPattern1} sats - * @property {PercentPpmRatioPattern2} share - * @property {SeriesPattern1} usd - */ - -/** - * Create a BtcCentsSatsShareUsdPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {BtcCentsSatsShareUsdPattern} - */ -function createBtcCentsSatsShareUsdPattern(client, acc) { - return { - btc: createSeriesPattern1(client, acc), - cents: createSeriesPattern1(client, _m(acc, 'cents')), - sats: createSeriesPattern1(client, _m(acc, 'sats')), - share: createPercentPpmRatioPattern2(client, _m(acc, 'share')), - usd: createSeriesPattern1(client, _m(acc, 'usd')), - }; -} - -/** - * @typedef {Object} CapLossMvrvPriceProfitPattern - * @property {CentsDeltaUsdPattern} cap - * @property {BlockCumulativeSumPattern} loss - * @property {SeriesPattern1} mvrv - * @property {CentsPpmRatioSatsUsdPattern} price - * @property {BlockCumulativeSumPattern} profit - */ - -/** - * Create a CapLossMvrvPriceProfitPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CapLossMvrvPriceProfitPattern} - */ -function createCapLossMvrvPriceProfitPattern(client, acc) { - return { - cap: createCentsDeltaUsdPattern(client, _m(acc, 'realized_cap')), - loss: createBlockCumulativeSumPattern(client, _m(acc, 'realized_loss')), - mvrv: createSeriesPattern1(client, _m(acc, 'mvrv')), - price: createCentsPpmRatioSatsUsdPattern(client, _m(acc, 'realized_price')), - profit: createBlockCumulativeSumPattern(client, _m(acc, 'realized_profit')), - }; -} - /** * @typedef {Object} CentsPpmRatioSatsUsdPattern * @property {SeriesPattern1} cents @@ -4102,31 +5564,6 @@ function createCentsPpmRatioSatsUsdPattern(client, acc) { }; } -/** - * @typedef {Object} CentsToUsdPattern4 - * @property {SeriesPattern1} cents - * @property {PercentPpmRatioPattern2} toMcap - * @property {PercentPpmRatioPattern2} toOwnGrossPnl - * @property {PercentPpmRatioPattern2} toOwnMcap - * @property {SeriesPattern1} usd - */ - -/** - * Create a CentsToUsdPattern4 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CentsToUsdPattern4} - */ -function createCentsToUsdPattern4(client, acc) { - return { - cents: createSeriesPattern1(client, _m(acc, 'cents')), - toMcap: createPercentPpmRatioPattern2(client, _m(acc, 'to_mcap')), - toOwnGrossPnl: createPercentPpmRatioPattern2(client, _m(acc, 'to_own_gross_pnl')), - toOwnMcap: createPercentPpmRatioPattern2(client, _m(acc, 'to_own_mcap')), - usd: createSeriesPattern1(client, acc), - }; -} - /** * @typedef {Object} EmaHistogramLineSignalPattern * @property {SeriesPattern1} emaFast @@ -4211,6 +5648,16 @@ function createPhsReboundThsPattern(client, acc) { }; } +/** + * @template T + * @typedef {Object} _01234Pattern7 + * @property {SeriesPattern1} _0 + * @property {SeriesPattern1} _1 + * @property {SeriesPattern1} _2 + * @property {SeriesPattern1} _3 + * @property {SeriesPattern1} _4 + */ + /** * @template T * @typedef {Object} CumulativeMultipleOversizedPrePattern3 @@ -4268,7 +5715,7 @@ function create_1m1w1y24hPattern3(client, acc) { } /** - * @typedef {Object} _1m1w1y24hPattern7 + * @typedef {Object} _1m1w1y24hPattern5 * @property {BtcSatsPattern} _1m * @property {BtcSatsPattern} _1w * @property {BtcSatsPattern} _1y @@ -4276,12 +5723,12 @@ function create_1m1w1y24hPattern3(client, acc) { */ /** - * Create a _1m1w1y24hPattern7 pattern node + * Create a _1m1w1y24hPattern5 pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {_1m1w1y24hPattern7} + * @returns {_1m1w1y24hPattern5} */ -function create_1m1w1y24hPattern7(client, acc) { +function create_1m1w1y24hPattern5(client, acc) { return { _1m: createBtcSatsPattern(client, _m(acc, '1m')), _1w: createBtcSatsPattern(client, _m(acc, '1w')), @@ -4314,36 +5761,13 @@ function create_1m1w1y2wPattern(client, acc) { } /** - * @typedef {Object} _1m1w1y24hPattern5 + * @typedef {Object} _1m1w1y24hPattern6 * @property {CentsUsdPattern} _1m * @property {CentsUsdPattern} _1w * @property {CentsUsdPattern} _1y * @property {CentsUsdPattern} _24h */ -/** - * Create a _1m1w1y24hPattern5 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {_1m1w1y24hPattern5} - */ -function create_1m1w1y24hPattern5(client, acc) { - return { - _1m: createCentsUsdPattern(client, _m(acc, '1m')), - _1w: createCentsUsdPattern(client, _m(acc, '1w')), - _1y: createCentsUsdPattern(client, _m(acc, '1y')), - _24h: createCentsUsdPattern(client, _m(acc, '24h')), - }; -} - -/** - * @typedef {Object} _1m1w1y24hPattern6 - * @property {CentsUsdPattern3} _1m - * @property {CentsUsdPattern3} _1w - * @property {CentsUsdPattern3} _1y - * @property {CentsUsdPattern3} _24h - */ - /** * Create a _1m1w1y24hPattern6 pattern node * @param {BrkClient} client @@ -4351,6 +5775,29 @@ function create_1m1w1y24hPattern5(client, acc) { * @returns {_1m1w1y24hPattern6} */ function create_1m1w1y24hPattern6(client, acc) { + return { + _1m: createCentsUsdPattern(client, _m(acc, '1m')), + _1w: createCentsUsdPattern(client, _m(acc, '1w')), + _1y: createCentsUsdPattern(client, _m(acc, '1y')), + _24h: createCentsUsdPattern(client, _m(acc, '24h')), + }; +} + +/** + * @typedef {Object} _1m1w1y24hPattern7 + * @property {CentsUsdPattern3} _1m + * @property {CentsUsdPattern3} _1w + * @property {CentsUsdPattern3} _1y + * @property {CentsUsdPattern3} _24h + */ + +/** + * Create a _1m1w1y24hPattern7 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_1m1w1y24hPattern7} + */ +function create_1m1w1y24hPattern7(client, acc) { return { _1m: createCentsUsdPattern3(client, _m(acc, '1m')), _1w: createCentsUsdPattern3(client, _m(acc, '1w')), @@ -4382,6 +5829,53 @@ function create_1m1w1y24hPattern2(client, acc) { }; } +/** + * @typedef {Object} _1m1w1yHeightPattern + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1y + * @property {SeriesPattern18<[StoredF64; 3]>} height + */ + +/** + * Create a _1m1w1yHeightPattern pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {_1m1w1yHeightPattern} + */ +function create_1m1w1yHeightPattern(client, acc) { + return { + _1m: createSeriesPattern1(client, _m(acc, '1m')), + _1w: createSeriesPattern1(client, _m(acc, '1w')), + _1y: createSeriesPattern1(client, _m(acc, '1y')), + height: createSeriesPattern18(client, acc), + }; +} + +/** + * @typedef {Object} AgeClassEntryEpochPattern + * @property {CentsSatsPattern} ageRange + * @property {CentsSatsPattern} class + * @property {CentsSatsPattern} entry + * @property {CentsSatsPattern} epoch + */ + +/** + * @typedef {Object} AllCumulativeLthSthPattern + * @property {BlockCumulativeSumPattern} all + * @property {SeriesPattern18} cumulative + * @property {BlockCumulativeSumPattern} lth + * @property {BlockCumulativeSumPattern} sth + */ + +/** + * @typedef {Object} AllHeightLthSthPattern4 + * @property {PercentPpmRatioPattern2} all + * @property {SeriesPattern18} height + * @property {PercentPpmRatioPattern2} lth + * @property {PercentPpmRatioPattern2} sth + */ + /** * @typedef {Object} AverageBlockCumulativeSumPattern2 * @property {_1m1w1y24hPattern3} average @@ -4405,35 +5899,12 @@ function createAverageBlockCumulativeSumPattern2(client, acc) { }; } -/** - * @typedef {Object} BlockCumulativeNegativeSumPattern - * @property {CentsUsdPattern2} block - * @property {CentsUsdPattern3} cumulative - * @property {BaseSumPattern} negative - * @property {_1m1w1y24hPattern6} sum - */ - -/** - * Create a BlockCumulativeNegativeSumPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {BlockCumulativeNegativeSumPattern} - */ -function createBlockCumulativeNegativeSumPattern(client, acc) { - return { - block: createCentsUsdPattern2(client, acc), - cumulative: createCentsUsdPattern3(client, _m(acc, 'cumulative')), - negative: createBaseSumPattern(client, _m(acc, 'neg')), - sum: create_1m1w1y24hPattern6(client, _m(acc, 'sum')), - }; -} - /** * @typedef {Object} BlockCumulativeDeltaSumPattern * @property {CentsUsdPattern4} block * @property {CentsUsdPattern} cumulative - * @property {AbsoluteRatePattern2} delta - * @property {_1m1w1y24hPattern5} sum + * @property {AbsoluteRatePattern3} delta + * @property {_1m1w1y24hPattern6} sum */ /** @@ -4446,8 +5917,8 @@ function createBlockCumulativeDeltaSumPattern(client, acc) { return { block: createCentsUsdPattern4(client, acc), cumulative: createCentsUsdPattern(client, _m(acc, 'cumulative')), - delta: createAbsoluteRatePattern2(client, _m(acc, 'delta')), - sum: create_1m1w1y24hPattern5(client, _m(acc, 'sum')), + delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')), + sum: create_1m1w1y24hPattern6(client, _m(acc, 'sum')), }; } @@ -4521,127 +5992,36 @@ function createBtcCentsSatsUsdPattern3(client, acc) { } /** - * @typedef {Object} CapHorizonPriceSupplyPattern + * @typedef {Object} CapHorizonPriceSupplyPattern2 * @property {CentsUsdPattern3} cap - * @property {_1m1y2y3m4y6m8yPattern} horizon + * @property {_1m1y2y3m4y6m8yPattern2} horizon * @property {CentsPpmRatioSatsUsdPattern} price - * @property {ImmobileMobilePattern2} supply + * @property {ImmobileMobilePattern3} supply */ /** - * @typedef {Object} CentsDeltaToUsdPattern - * @property {SeriesPattern1} cents - * @property {AbsoluteRatePattern2} delta - * @property {PercentPpmRatioPattern2} toOwnMcap - * @property {SeriesPattern1} usd + * @typedef {Object} HeightLossProfitRangePattern2 + * @property {SeriesPattern18} height + * @property {_10pct20pct30pct40pct50pct60pct70pct80pctAllPattern2} loss + * @property {_100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctAllPattern2} profit + * @property {_0pct100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctOverPattern2} range */ /** - * Create a CentsDeltaToUsdPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CentsDeltaToUsdPattern} - */ -function createCentsDeltaToUsdPattern(client, acc) { - return { - cents: createSeriesPattern1(client, _m(acc, 'cents')), - delta: createAbsoluteRatePattern2(client, _m(acc, 'delta')), - toOwnMcap: createPercentPpmRatioPattern2(client, _m(acc, 'to_own_mcap')), - usd: createSeriesPattern1(client, acc), - }; -} - -/** - * @typedef {Object} CentsToUsdPattern3 - * @property {SeriesPattern1} cents - * @property {PercentPpmRatioPattern3} toOwnGrossPnl - * @property {PercentPpmRatioPattern3} toOwnMcap - * @property {SeriesPattern1} usd + * @typedef {Object} MatrixOverRangeUnderPattern3 + * @property {SeriesPattern18} matrix + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern5} over + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern5} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern5} under */ /** - * Create a CentsToUsdPattern3 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CentsToUsdPattern3} + * @typedef {Object} MatrixOverRangeUnderPattern + * @property {SeriesPattern18} matrix + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern} over + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern} under */ -function createCentsToUsdPattern3(client, acc) { - return { - cents: createSeriesPattern1(client, _m(acc, 'cents')), - toOwnGrossPnl: createPercentPpmRatioPattern3(client, _m(acc, 'to_own_gross_pnl')), - toOwnMcap: createPercentPpmRatioPattern3(client, _m(acc, 'to_own_mcap')), - usd: createSeriesPattern1(client, acc), - }; -} - -/** - * @typedef {Object} CoindaysCoinyearsDormancyTransferPattern - * @property {AverageBlockCumulativeSumPattern} coindaysDestroyed - * @property {SeriesPattern1} coinyearsDestroyed - * @property {_1m1w1y24hHeightPattern} dormancy - * @property {AverageBlockCumulativeInSumPattern} transferVolume - */ - -/** - * Create a CoindaysCoinyearsDormancyTransferPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CoindaysCoinyearsDormancyTransferPattern} - */ -function createCoindaysCoinyearsDormancyTransferPattern(client, acc) { - return { - coindaysDestroyed: createAverageBlockCumulativeSumPattern(client, _m(acc, 'coindays_destroyed')), - coinyearsDestroyed: createSeriesPattern1(client, _m(acc, 'coinyears_destroyed')), - dormancy: create_1m1w1y24hHeightPattern(client, _m(acc, 'dormancy')), - transferVolume: createAverageBlockCumulativeInSumPattern(client, _m(acc, 'transfer_volume')), - }; -} - -/** - * @typedef {Object} LossNetNuplProfitPattern - * @property {CentsNegativeUsdPattern} loss - * @property {CentsUsdPattern} netPnl - * @property {PpmRatioPattern} nupl - * @property {CentsUsdPattern3} profit - */ - -/** - * Create a LossNetNuplProfitPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {LossNetNuplProfitPattern} - */ -function createLossNetNuplProfitPattern(client, acc) { - return { - loss: createCentsNegativeUsdPattern(client, _m(acc, 'unrealized_loss')), - netPnl: createCentsUsdPattern(client, _m(acc, 'net_unrealized_pnl')), - nupl: createPpmRatioPattern(client, _m(acc, 'nupl')), - profit: createCentsUsdPattern3(client, _m(acc, 'unrealized_profit')), - }; -} - -/** - * @typedef {Object} NuplRealizedSupplyUnrealizedPattern - * @property {PpmRatioPattern} nupl - * @property {AllSthPattern} realizedCap - * @property {AllSthPattern2} supply - * @property {AllSthPattern} unrealizedPnl - */ - -/** - * Create a NuplRealizedSupplyUnrealizedPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {NuplRealizedSupplyUnrealizedPattern} - */ -function createNuplRealizedSupplyUnrealizedPattern(client, acc) { - return { - nupl: createPpmRatioPattern(client, _m(acc, 'nupl')), - realizedCap: createAllSthPattern(client, acc, 'realized_cap'), - supply: createAllSthPattern2(client, acc), - unrealizedPnl: createAllSthPattern(client, acc, 'unrealized_pnl'), - }; -} /** * @template T @@ -4668,6 +6048,15 @@ function create_1m1w1y24hPattern(client, acc) { }; } +/** + * @template T + * @typedef {Object} AllHeightLthSthPattern5 + * @property {CentsUsdPattern3} all + * @property {SeriesPattern18} height + * @property {CentsUsdPattern3} lth + * @property {CentsUsdPattern3} sth + */ + /** * @template T * @typedef {Object} AverageBlockCumulativeSumPattern @@ -4694,23 +6083,51 @@ function createAverageBlockCumulativeSumPattern(client, acc) { } /** - * @typedef {Object} AdjustedRatioValuePattern - * @property {RatioTransferValuePattern} adjusted - * @property {_1m1w1y24hHeightPattern4} ratio - * @property {AverageBlockCumulativeSumPattern} valueDestroyed + * @typedef {Object} AllCumulativeSthPattern + * @property {AverageBlockCumulativeSumPattern} all + * @property {SeriesPattern18} cumulative + * @property {AverageBlockCumulativeSumPattern} sth */ /** - * Create a AdjustedRatioValuePattern pattern node + * @typedef {Object} AllLthSthPattern4 + * @property {BtcCentsDeltaSatsUsdPattern} all + * @property {BtcCentsDeltaSatsUsdPattern} lth + * @property {BtcCentsDeltaSatsUsdPattern} sth + */ + +/** + * Create a AllLthSthPattern4 pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {AdjustedRatioValuePattern} + * @returns {AllLthSthPattern4} */ -function createAdjustedRatioValuePattern(client, acc) { +function createAllLthSthPattern4(client, acc) { return { - adjusted: createRatioTransferValuePattern(client, acc), - ratio: create_1m1w1y24hHeightPattern4(client, _m(acc, 'sopr')), - valueDestroyed: createAverageBlockCumulativeSumPattern(client, _m(acc, 'value_destroyed')), + all: createBtcCentsDeltaSatsUsdPattern(client, _m(acc, 'supply')), + lth: createBtcCentsDeltaSatsUsdPattern(client, _m(acc, 'lth_supply')), + sth: createBtcCentsDeltaSatsUsdPattern(client, _m(acc, 'sth_supply')), + }; +} + +/** + * @typedef {Object} AllLthSthPattern5 + * @property {PercentPpmRatioPattern2} all + * @property {PercentPpmRatioPattern2} lth + * @property {PercentPpmRatioPattern2} sth + */ + +/** + * Create a AllLthSthPattern5 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {AllLthSthPattern5} + */ +function createAllLthSthPattern5(client, acc) { + return { + all: createPercentPpmRatioPattern2(client, _p('all', acc)), + lth: createPercentPpmRatioPattern2(client, _p('lth', acc)), + sth: createPercentPpmRatioPattern2(client, _p('sth', acc)), }; } @@ -4718,7 +6135,7 @@ function createAdjustedRatioValuePattern(client, acc) { * @typedef {Object} BlockCumulativeSumPattern * @property {CentsUsdPattern2} block * @property {CentsUsdPattern3} cumulative - * @property {_1m1w1y24hPattern6} sum + * @property {_1m1w1y24hPattern7} sum */ /** @@ -4731,7 +6148,7 @@ function createBlockCumulativeSumPattern(client, acc) { return { block: createCentsUsdPattern2(client, acc), cumulative: createCentsUsdPattern3(client, _m(acc, 'cumulative')), - sum: create_1m1w1y24hPattern6(client, _m(acc, 'sum')), + sum: create_1m1w1y24hPattern7(client, _m(acc, 'sum')), }; } @@ -4777,27 +6194,6 @@ function createBlocksDominanceRewardsPattern(client, acc) { }; } -/** - * @typedef {Object} CapLossProfitPattern - * @property {CentsDeltaUsdPattern} cap - * @property {BlockCumulativeSumPattern} loss - * @property {BlockCumulativeSumPattern} profit - */ - -/** - * Create a CapLossProfitPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CapLossProfitPattern} - */ -function createCapLossProfitPattern(client, acc) { - return { - cap: createCentsDeltaUsdPattern(client, _m(acc, 'cap')), - loss: createBlockCumulativeSumPattern(client, _m(acc, 'loss')), - profit: createBlockCumulativeSumPattern(client, _m(acc, 'profit')), - }; -} - /** * @typedef {Object} CapPriceSupplyPattern * @property {CentsUsdPattern3} cap @@ -4829,7 +6225,7 @@ function createCentsSatsUsdPattern3(client, acc) { /** * @typedef {Object} CentsDeltaUsdPattern * @property {SeriesPattern1} cents - * @property {AbsoluteRatePattern2} delta + * @property {AbsoluteRatePattern3} delta * @property {SeriesPattern1} usd */ @@ -4842,28 +6238,7 @@ function createCentsSatsUsdPattern3(client, acc) { function createCentsDeltaUsdPattern(client, acc) { return { cents: createSeriesPattern1(client, _m(acc, 'cents')), - delta: createAbsoluteRatePattern2(client, _m(acc, 'delta')), - usd: createSeriesPattern1(client, acc), - }; -} - -/** - * @typedef {Object} CentsNegativeUsdPattern - * @property {SeriesPattern1} cents - * @property {SeriesPattern1} negative - * @property {SeriesPattern1} usd - */ - -/** - * Create a CentsNegativeUsdPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {CentsNegativeUsdPattern} - */ -function createCentsNegativeUsdPattern(client, acc) { - return { - cents: createSeriesPattern1(client, _m(acc, 'cents')), - negative: createSeriesPattern1(client, _m(acc, 'neg')), + delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')), usd: createSeriesPattern1(client, acc), }; } @@ -4917,27 +6292,6 @@ function createCumulativeRollingSumPattern(client, acc) { }; } -/** - * @typedef {Object} DeltaDominanceTotalPattern - * @property {AbsoluteRatePattern3} delta - * @property {PercentPpmRatioPattern2} dominance - * @property {BtcCentsSatsUsdPattern} total - */ - -/** - * Create a DeltaDominanceTotalPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {DeltaDominanceTotalPattern} - */ -function createDeltaDominanceTotalPattern(client, acc) { - return { - delta: createAbsoluteRatePattern3(client, _m(acc, 'delta')), - dominance: createPercentPpmRatioPattern2(client, _m(acc, 'dominance')), - total: createBtcCentsSatsUsdPattern(client, acc), - }; -} - /** * @typedef {Object} FloorLevelLossPattern * @property {Pct95Pct98Pct99Pattern} floor @@ -4960,47 +6314,117 @@ function createFloorLevelLossPattern(client, acc) { } /** - * @typedef {Object} GreedNetPainPattern - * @property {CentsUsdPattern3} greedIndex - * @property {CentsUsdPattern} net - * @property {CentsUsdPattern3} painIndex + * @typedef {Object} HeightLongShortPattern + * @property {SeriesPattern18} height + * @property {PercentPpmRatioPattern2} long + * @property {PercentPpmRatioPattern2} short */ /** - * Create a GreedNetPainPattern pattern node + * @typedef {Object} OverRangeUnderPattern11 + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern5} over + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern5} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern5} under + */ + +/** + * @typedef {Object} OverRangeUnderPattern17 + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8} over + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern8} under + */ + +/** + * Create a OverRangeUnderPattern17 pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {GreedNetPainPattern} + * @returns {OverRangeUnderPattern17} */ -function createGreedNetPainPattern(client, acc) { +function createOverRangeUnderPattern17(client, acc) { return { - greedIndex: createCentsUsdPattern3(client, _m(acc, 'greed_index')), - net: createCentsUsdPattern(client, _m(acc, 'net_sentiment')), - painIndex: createCentsUsdPattern3(client, _m(acc, 'pain_index')), + over: create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8(client, _m(acc, 'over')), + range: create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8(client, acc), + under: create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern8(client, _m(acc, 'under')), }; } /** - * @typedef {Object} LossNuplProfitPattern - * @property {CentsNegativeUsdPattern} loss - * @property {PpmRatioPattern} nupl - * @property {CentsUsdPattern3} profit + * @typedef {Object} OverRangeUnderPattern19 + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9} over + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern9} under */ /** - * Create a LossNuplProfitPattern pattern node + * Create a OverRangeUnderPattern19 pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {LossNuplProfitPattern} + * @returns {OverRangeUnderPattern19} */ -function createLossNuplProfitPattern(client, acc) { +function createOverRangeUnderPattern19(client, acc) { return { - loss: createCentsNegativeUsdPattern(client, _m(acc, 'unrealized_loss')), - nupl: createPpmRatioPattern(client, _m(acc, 'nupl')), - profit: createCentsUsdPattern3(client, _m(acc, 'unrealized_profit')), + over: create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9(client, _m(acc, 'over')), + range: create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9(client, acc), + under: create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern9(client, _m(acc, 'under')), }; } +/** + * @typedef {Object} OverRangeUnderPattern + * @property {_10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern} over + * @property {_10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern} range + * @property {_10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern} under + */ + +/** + * @typedef {Object} OverRangeUnderPattern21 + * @property {_10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12} over + * @property {_10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern12} range + * @property {_10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12} under + */ + +/** + * @typedef {Object} OverRangeUnderPattern23 + * @property {_10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13} over + * @property {_10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern13} range + * @property {_10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13} under + */ + +/** + * @typedef {Object} OverRangeUnderPattern2 + * @property {_10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2} over + * @property {_10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2} range + * @property {_10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2} under + */ + +/** + * Create a OverRangeUnderPattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {OverRangeUnderPattern2} + */ +function createOverRangeUnderPattern2(client, acc) { + return { + over: create_10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2(client, acc, 'over'), + range: create_10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2(client, acc, ''), + under: create_10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2(client, acc, 'under'), + }; +} + +/** + * @typedef {Object} OverRangeUnderPattern9 + * @property {_10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5} over + * @property {_10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern5} range + * @property {_10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5} under + */ + +/** + * @typedef {Object} OverRangeUnderPattern12 + * @property {_10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7} over + * @property {_10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern7} range + * @property {_10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7} under + */ + /** * @typedef {Object} PercentPpmRatioPattern2 * @property {SeriesPattern1} percent @@ -5107,27 +6531,6 @@ function createPpmPriceRatioPattern(client, acc, disc) { }; } -/** - * @typedef {Object} RatioTransferValuePattern - * @property {_1m1w1y24hHeightPattern2} ratio - * @property {AverageBlockCumulativeSumPattern} transferVolume - * @property {AverageBlockCumulativeSumPattern} valueDestroyed - */ - -/** - * Create a RatioTransferValuePattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {RatioTransferValuePattern} - */ -function createRatioTransferValuePattern(client, acc) { - return { - ratio: create_1m1w1y24hHeightPattern2(client, _m(acc, 'asopr')), - transferVolume: createAverageBlockCumulativeSumPattern(client, _m(acc, 'adj_value_created')), - valueDestroyed: createAverageBlockCumulativeSumPattern(client, _m(acc, 'adj_value_destroyed')), - }; -} - /** * @typedef {Object} RsiStochPattern * @property {PercentPpmRatioPattern2} rsi @@ -5150,6 +6553,13 @@ function createRsiStochPattern(client, acc, disc) { }; } +/** + * @typedef {Object} ToPattern2 + * @property {AllLthSthPattern5} toMcap + * @property {AllLthSthPattern5} toOwnGrossPnl + * @property {HeightLongShortPattern} toOwnMcap + */ + /** * @template T * @typedef {Object} _6bBlockTxPattern @@ -5173,6 +6583,14 @@ function create_6bBlockTxPattern(client, acc) { }; } +/** + * @template T + * @typedef {Object} AllLthSthPattern + * @property {SeriesPattern1} all + * @property {SeriesPattern1} lth + * @property {SeriesPattern1} sth + */ + /** * @typedef {Object} AbsoluteRatePattern * @property {_1m1w1y24hPattern} absolute @@ -5213,7 +6631,7 @@ function createAbsoluteRatePattern2(client, acc) { /** * @typedef {Object} AbsoluteRatePattern3 - * @property {_1m1w1y24hPattern7} absolute + * @property {_1m1w1y24hPattern6} absolute * @property {_1m1w1y24hPattern2} rate */ @@ -5225,69 +6643,11 @@ function createAbsoluteRatePattern2(client, acc) { */ function createAbsoluteRatePattern3(client, acc) { return { - absolute: create_1m1w1y24hPattern7(client, acc), + absolute: create_1m1w1y24hPattern6(client, acc), rate: create_1m1w1y24hPattern2(client, acc), }; } -/** - * @typedef {Object} AddrUtxoPattern - * @property {BtcCentsSatsUsdPattern} addr - * @property {BtcCentsSatsUsdPattern} utxo - */ - -/** - * Create a AddrUtxoPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {AddrUtxoPattern} - */ -function createAddrUtxoPattern(client, acc) { - return { - addr: createBtcCentsSatsUsdPattern(client, _m(acc, 'addr_amount')), - utxo: createBtcCentsSatsUsdPattern(client, _m(acc, 'utxo_amount')), - }; -} - -/** - * @typedef {Object} AllSthPattern2 - * @property {BtcCentsDeltaSatsUsdPattern} all - * @property {BtcCentsSatsUsdPattern} sth - */ - -/** - * Create a AllSthPattern2 pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {AllSthPattern2} - */ -function createAllSthPattern2(client, acc) { - return { - all: createBtcCentsDeltaSatsUsdPattern(client, _m(acc, 'supply')), - sth: createBtcCentsSatsUsdPattern(client, _m(acc, 'sth_supply')), - }; -} - -/** - * @typedef {Object} AllSthPattern - * @property {SeriesPattern1} all - * @property {SeriesPattern1} sth - */ - -/** - * Create a AllSthPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @param {string} disc - Discriminator suffix - * @returns {AllSthPattern} - */ -function createAllSthPattern(client, acc, disc) { - return { - all: createSeriesPattern1(client, _m(acc, disc)), - sth: createSeriesPattern1(client, _m(_m(acc, 'sth'), disc)), - }; -} - /** * @typedef {Object} AwakeDormantPattern2 * @property {CapPriceSupplyPattern} awake @@ -5466,21 +6826,116 @@ function createCentsUsdPattern4(client, acc) { } /** - * @typedef {Object} CoindaysTransferPattern - * @property {AverageBlockCumulativeSumPattern} coindaysDestroyed - * @property {AverageBlockCumulativeInSumPattern} transferVolume + * @typedef {Object} CentsSatsPattern + * @property {CumulativePattern} cents + * @property {CumulativePattern} sats */ /** - * Create a CoindaysTransferPattern pattern node + * Create a CentsSatsPattern pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {CoindaysTransferPattern} + * @returns {CentsSatsPattern} */ -function createCoindaysTransferPattern(client, acc) { +function createCentsSatsPattern(client, acc) { return { - coindaysDestroyed: createAverageBlockCumulativeSumPattern(client, _m(acc, 'coindays_destroyed')), - transferVolume: createAverageBlockCumulativeInSumPattern(client, _m(acc, 'transfer_volume')), + cents: createCumulativePattern(client, _m(acc, 'cents')), + sats: createCumulativePattern(client, _m(acc, 'sats')), + }; +} + +/** + * @typedef {Object} DiscountPremiumPattern + * @property {AverageBlockCumulativeSumPattern} discount + * @property {AverageBlockCumulativeSumPattern} premium + */ + +/** + * Create a DiscountPremiumPattern pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {DiscountPremiumPattern} + */ +function createDiscountPremiumPattern(client, acc) { + return { + discount: createAverageBlockCumulativeSumPattern(client, _p('veteran', acc)), + premium: createAverageBlockCumulativeSumPattern(client, _p('rookie', acc)), + }; +} + +/** + * @typedef {Object} DiscountPremiumPattern2 + * @property {AverageBlockCumulativeSumPattern2} discount + * @property {AverageBlockCumulativeSumPattern2} premium + */ + +/** + * Create a DiscountPremiumPattern2 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {DiscountPremiumPattern2} + */ +function createDiscountPremiumPattern2(client, acc) { + return { + discount: createAverageBlockCumulativeSumPattern2(client, _p('veteran', acc)), + premium: createAverageBlockCumulativeSumPattern2(client, _p('rookie', acc)), + }; +} + +/** + * @typedef {Object} DiscountPremiumPattern5 + * @property {BlockCumulativeSumPattern} discount + * @property {BlockCumulativeSumPattern} premium + */ + +/** + * Create a DiscountPremiumPattern5 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {DiscountPremiumPattern5} + */ +function createDiscountPremiumPattern5(client, acc) { + return { + discount: createBlockCumulativeSumPattern(client, _p('veteran', acc)), + premium: createBlockCumulativeSumPattern(client, _p('rookie', acc)), + }; +} + +/** + * @typedef {Object} DiscountPremiumPattern12 + * @property {BtcCentsSatsUsdPattern} discount + * @property {BtcCentsSatsUsdPattern} premium + */ + +/** + * Create a DiscountPremiumPattern12 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {DiscountPremiumPattern12} + */ +function createDiscountPremiumPattern12(client, acc) { + return { + discount: createBtcCentsSatsUsdPattern(client, _p('veteran', acc)), + premium: createBtcCentsSatsUsdPattern(client, _p('rookie', acc)), + }; +} + +/** + * @typedef {Object} DiscountPremiumPattern13 + * @property {CentsUsdPattern3} discount + * @property {CentsUsdPattern3} premium + */ + +/** + * Create a DiscountPremiumPattern13 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {DiscountPremiumPattern13} + */ +function createDiscountPremiumPattern13(client, acc) { + return { + discount: createCentsUsdPattern3(client, _p('veteran', acc)), + premium: createCentsUsdPattern3(client, _p('rookie', acc)), }; } @@ -5491,46 +6946,103 @@ function createCoindaysTransferPattern(client, acc) { */ /** - * @typedef {Object} ImmobileMobilePattern2 + * @typedef {Object} ImmobileMobilePattern3 * @property {BtcCentsSatsUsdPattern} immobile * @property {BtcCentsInSatsUsdPattern} mobile */ /** - * @typedef {Object} InPattern2 - * @property {CentsUsdPattern3} inLoss - * @property {CentsUsdPattern3} inProfit + * @typedef {Object} LongShortPattern + * @property {AverageBlockCumulativeSumPattern} long + * @property {AverageBlockCumulativeSumPattern} short */ /** - * Create a InPattern2 pattern node + * Create a LongShortPattern pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {InPattern2} + * @returns {LongShortPattern} */ -function createInPattern2(client, acc) { +function createLongShortPattern(client, acc) { return { - inLoss: createCentsUsdPattern3(client, _m(acc, 'loss')), - inProfit: createCentsUsdPattern3(client, _m(acc, 'profit')), + long: createAverageBlockCumulativeSumPattern(client, _p('lth', acc)), + short: createAverageBlockCumulativeSumPattern(client, _p('sth', acc)), }; } /** - * @typedef {Object} InPattern - * @property {SharePattern} inLoss - * @property {SharePattern} inProfit + * @typedef {Object} LongShortPattern2 + * @property {AverageBlockCumulativeSumPattern2} long + * @property {AverageBlockCumulativeSumPattern2} short */ /** - * Create a InPattern pattern node + * Create a LongShortPattern2 pattern node * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {InPattern} + * @returns {LongShortPattern2} */ -function createInPattern(client, acc) { +function createLongShortPattern2(client, acc) { return { - inLoss: createSharePattern(client, _m(acc, 'loss_share')), - inProfit: createSharePattern(client, _m(acc, 'profit_share')), + long: createAverageBlockCumulativeSumPattern2(client, _p('lth', acc)), + short: createAverageBlockCumulativeSumPattern2(client, _p('sth', acc)), + }; +} + +/** + * @typedef {Object} LongShortPattern6 + * @property {BlockCumulativeSumPattern} long + * @property {BlockCumulativeSumPattern} short + */ + +/** + * Create a LongShortPattern6 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {LongShortPattern6} + */ +function createLongShortPattern6(client, acc) { + return { + long: createBlockCumulativeSumPattern(client, _p('lth', acc)), + short: createBlockCumulativeSumPattern(client, _p('sth', acc)), + }; +} + +/** + * @typedef {Object} LongShortPattern13 + * @property {BtcCentsSatsUsdPattern} long + * @property {BtcCentsSatsUsdPattern} short + */ + +/** + * Create a LongShortPattern13 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {LongShortPattern13} + */ +function createLongShortPattern13(client, acc) { + return { + long: createBtcCentsSatsUsdPattern(client, _p('lth', acc)), + short: createBtcCentsSatsUsdPattern(client, _p('sth', acc)), + }; +} + +/** + * @typedef {Object} LongShortPattern14 + * @property {CentsUsdPattern3} long + * @property {CentsUsdPattern3} short + */ + +/** + * Create a LongShortPattern14 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {LongShortPattern14} + */ +function createLongShortPattern14(client, acc) { + return { + long: createCentsUsdPattern3(client, _p('lth', acc)), + short: createCentsUsdPattern3(client, _p('sth', acc)), }; } @@ -5610,25 +7122,6 @@ function createPpmRatioPattern(client, acc) { }; } -/** - * @typedef {Object} RatioValuePattern - * @property {_24hPattern} ratio - * @property {AverageBlockCumulativeSumPattern} valueDestroyed - */ - -/** - * Create a RatioValuePattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {RatioValuePattern} - */ -function createRatioValuePattern(client, acc) { - return { - ratio: create_24hPattern(client, _m(acc, 'sopr_24h')), - valueDestroyed: createAverageBlockCumulativeSumPattern(client, _m(acc, 'value_destroyed')), - }; -} - /** * @typedef {Object} SdSmaPattern * @property {SeriesPattern1} sd @@ -5636,63 +7129,50 @@ function createRatioValuePattern(client, acc) { */ /** - * @typedef {Object} SpentUnspentPattern - * @property {AverageBlockCumulativeSumPattern} spentCount - * @property {BaseDeltaPattern} unspentCount + * @template T + * @typedef {Object} DiscountPremiumPattern7 + * @property {SeriesPattern1} discount + * @property {SeriesPattern1} premium */ /** - * Create a SpentUnspentPattern pattern node + * Create a DiscountPremiumPattern7 pattern node + * @template T * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {SpentUnspentPattern} + * @returns {DiscountPremiumPattern7} */ -function createSpentUnspentPattern(client, acc) { +function createDiscountPremiumPattern7(client, acc) { return { - spentCount: createAverageBlockCumulativeSumPattern(client, _m(acc, 'spent_utxo_count')), - unspentCount: createBaseDeltaPattern(client, _m(acc, 'utxo_count')), + discount: createSeriesPattern1(client, _p('veteran', acc)), + premium: createSeriesPattern1(client, _p('rookie', acc)), }; } /** - * @typedef {Object} ToPattern - * @property {PercentPpmRatioPattern} toMcap - * @property {PercentPpmRatioPattern} toRcap + * @template T + * @typedef {Object} LongShortPattern7 + * @property {SeriesPattern1} long + * @property {SeriesPattern1} short */ /** - * Create a ToPattern pattern node + * Create a LongShortPattern7 pattern node + * @template T * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {ToPattern} + * @returns {LongShortPattern7} */ -function createToPattern(client, acc) { +function createLongShortPattern7(client, acc) { return { - toMcap: createPercentPpmRatioPattern(client, _m(acc, 'mcap')), - toRcap: createPercentPpmRatioPattern(client, _m(acc, 'rcap')), - }; -} - -/** - * @typedef {Object} _24hPattern - * @property {SeriesPattern1} _24h - */ - -/** - * Create a _24hPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {_24hPattern} - */ -function create_24hPattern(client, acc) { - return { - _24h: createSeriesPattern1(client, acc), + long: createSeriesPattern1(client, _p('lth', acc)), + short: createSeriesPattern1(client, _p('sth', acc)), }; } /** * @typedef {Object} InPattern3 - * @property {SharePattern2} inLoss + * @property {SharePattern3} inLoss */ /** @@ -5703,64 +7183,18 @@ function create_24hPattern(client, acc) { */ function createInPattern3(client, acc) { return { - inLoss: createSharePattern2(client, acc), - }; -} - -/** - * @typedef {Object} NuplPattern - * @property {PpmRatioPattern} nupl - */ - -/** - * Create a NuplPattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {NuplPattern} - */ -function createNuplPattern(client, acc) { - return { - nupl: createPpmRatioPattern(client, acc), - }; -} - -/** - * @typedef {Object} PricePattern - * @property {CentsPpmRatioSatsUsdPattern} price - */ - -/** - * Create a PricePattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {PricePattern} - */ -function createPricePattern(client, acc) { - return { - price: createCentsPpmRatioSatsUsdPattern(client, acc), + inLoss: createSharePattern3(client, acc), }; } /** * @typedef {Object} SharePattern - * @property {PercentPpmRatioPattern2} share + * @property {AllHeightLthSthPattern4} share */ -/** - * Create a SharePattern pattern node - * @param {BrkClient} client - * @param {string} acc - Accumulated series name - * @returns {SharePattern} - */ -function createSharePattern(client, acc) { - return { - share: createPercentPpmRatioPattern2(client, acc), - }; -} - /** * @typedef {Object} SharePattern2 - * @property {SeriesPattern1} share + * @property {AllLthSthPattern5} share */ /** @@ -5770,6 +7204,23 @@ function createSharePattern(client, acc) { * @returns {SharePattern2} */ function createSharePattern2(client, acc) { + return { + share: createAllLthSthPattern5(client, acc), + }; +} + +/** + * @typedef {Object} SharePattern3 + * @property {SeriesPattern1} share + */ + +/** + * Create a SharePattern3 pattern node + * @param {BrkClient} client + * @param {string} acc - Accumulated series name + * @returns {SharePattern3} + */ +function createSharePattern3(client, acc) { return { share: createSeriesPattern1(client, acc), }; @@ -5810,36 +7261,40 @@ function createSupplyPattern(client, acc) { } /** - * @typedef {Object} TransferPattern - * @property {AverageBlockCumulativeSumPattern2} transferVolume + * @template T + * @typedef {Object} CumulativePattern + * @property {SeriesPattern18} cumulative */ /** - * Create a TransferPattern pattern node + * Create a CumulativePattern pattern node + * @template T * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {TransferPattern} + * @returns {CumulativePattern} */ -function createTransferPattern(client, acc) { +function createCumulativePattern(client, acc) { return { - transferVolume: createAverageBlockCumulativeSumPattern2(client, acc), + cumulative: createSeriesPattern18(client, acc), }; } /** - * @typedef {Object} UnspentPattern - * @property {BaseDeltaPattern} unspentCount + * @template T + * @typedef {Object} MatrixPattern + * @property {SeriesPattern18} matrix */ /** - * Create a UnspentPattern pattern node + * Create a MatrixPattern pattern node + * @template T * @param {BrkClient} client * @param {string} acc - Accumulated series name - * @returns {UnspentPattern} + * @returns {MatrixPattern} */ -function createUnspentPattern(client, acc) { +function createMatrixPattern(client, acc) { return { - unspentCount: createBaseDeltaPattern(client, acc), + matrix: createSeriesPattern18(client, acc), }; } @@ -6191,7 +7646,7 @@ function createUnspentPattern(client, acc) { * @property {SeriesTree_Inputs_ByType_InputCount} inputCount * @property {SeriesTree_Inputs_ByType_InputShare} inputShare * @property {SeriesTree_Inputs_ByType_TxCount} txCount - * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2} txShare + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13} txShare */ /** @@ -6208,7 +7663,7 @@ function createUnspentPattern(client, acc) { * @property {AverageBlockCumulativeSumPattern} p2a * @property {AverageBlockCumulativeSumPattern} unknown * @property {AverageBlockCumulativeSumPattern} empty - * @property {SeriesPattern18<[StoredU16; 11]>} height + * @property {SeriesPattern18} height */ /** @@ -6240,7 +7695,7 @@ function createUnspentPattern(client, acc) { * @property {AverageBlockCumulativeSumPattern} p2a * @property {AverageBlockCumulativeSumPattern} unknown * @property {AverageBlockCumulativeSumPattern} empty - * @property {SeriesPattern18<[StoredU64; 11]>} cumulative + * @property {SeriesPattern18} cumulative */ /** @@ -6452,6 +7907,68 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} p2tr * @property {SeriesPattern1} p2a * @property {SeriesPattern18<[StoredU64; 8]>} height + * @property {SeriesTree_Addrs_Funded_Balance} balance + */ + +/** + * @typedef {Object} SeriesTree_Addrs_Funded_Balance + * @property {SeriesTree_Addrs_Funded_Balance_Range} range + * @property {SeriesTree_Addrs_Funded_Balance_Under} under + * @property {SeriesTree_Addrs_Funded_Balance_Over} over + * @property {SeriesPattern18} matrix + */ + +/** + * @typedef {Object} SeriesTree_Addrs_Funded_Balance_Range + * @property {BaseDeltaPattern} _0sats + * @property {BaseDeltaPattern} _1satTo10sats + * @property {BaseDeltaPattern} _10satsTo100sats + * @property {BaseDeltaPattern} _100satsTo1kSats + * @property {BaseDeltaPattern} _1kSatsTo10kSats + * @property {BaseDeltaPattern} _10kSatsTo100kSats + * @property {BaseDeltaPattern} _100kSatsTo1mSats + * @property {BaseDeltaPattern} _1mSatsTo10mSats + * @property {BaseDeltaPattern} _10mSatsTo1btc + * @property {BaseDeltaPattern} _1btcTo10btc + * @property {BaseDeltaPattern} _10btcTo100btc + * @property {BaseDeltaPattern} _100btcTo1kBtc + * @property {BaseDeltaPattern} _1kBtcTo10kBtc + * @property {BaseDeltaPattern} _10kBtcTo100kBtc + * @property {BaseDeltaPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Addrs_Funded_Balance_Under + * @property {BaseDeltaPattern} _10sats + * @property {BaseDeltaPattern} _100sats + * @property {BaseDeltaPattern} _1kSats + * @property {BaseDeltaPattern} _10kSats + * @property {BaseDeltaPattern} _100kSats + * @property {BaseDeltaPattern} _1mSats + * @property {BaseDeltaPattern} _10mSats + * @property {BaseDeltaPattern} _1btc + * @property {BaseDeltaPattern} _10btc + * @property {BaseDeltaPattern} _100btc + * @property {BaseDeltaPattern} _1kBtc + * @property {BaseDeltaPattern} _10kBtc + * @property {BaseDeltaPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Addrs_Funded_Balance_Over + * @property {BaseDeltaPattern} _1sat + * @property {BaseDeltaPattern} _10sats + * @property {BaseDeltaPattern} _100sats + * @property {BaseDeltaPattern} _1kSats + * @property {BaseDeltaPattern} _10kSats + * @property {BaseDeltaPattern} _100kSats + * @property {BaseDeltaPattern} _1mSats + * @property {BaseDeltaPattern} _10mSats + * @property {BaseDeltaPattern} _1btc + * @property {BaseDeltaPattern} _10btc + * @property {BaseDeltaPattern} _100btc + * @property {BaseDeltaPattern} _1kBtc + * @property {BaseDeltaPattern} _10kBtc */ /** @@ -6470,24 +7987,11 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} SeriesTree_Addrs_Activity - * @property {SeriesTree_Addrs_Activity_All} all - * @property {ActiveBidirectionalReactivatedReceivingSendingPattern} p2pk65 - * @property {ActiveBidirectionalReactivatedReceivingSendingPattern} p2pk33 - * @property {ActiveBidirectionalReactivatedReceivingSendingPattern} p2pkh - * @property {ActiveBidirectionalReactivatedReceivingSendingPattern} p2sh - * @property {ActiveBidirectionalReactivatedReceivingSendingPattern} p2wpkh - * @property {ActiveBidirectionalReactivatedReceivingSendingPattern} p2wsh - * @property {ActiveBidirectionalReactivatedReceivingSendingPattern} p2tr - * @property {ActiveBidirectionalReactivatedReceivingSendingPattern} p2a - */ - -/** - * @typedef {Object} SeriesTree_Addrs_Activity_All - * @property {_1m1w1y24hBlockPattern} reactivated - * @property {_1m1w1y24hBlockPattern} sending - * @property {_1m1w1y24hBlockPattern} receiving - * @property {_1m1w1y24hBlockPattern} bidirectional - * @property {_1m1w1y24hBlockPattern} active + * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern} reactivated + * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern} sending + * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern} receiving + * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern} bidirectional + * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern} active */ /** @@ -6777,15 +8281,8 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} SeriesTree_Addrs_AvgAmount - * @property {AddrUtxoPattern} all - * @property {AddrUtxoPattern} p2pk65 - * @property {AddrUtxoPattern} p2pk33 - * @property {AddrUtxoPattern} p2pkh - * @property {AddrUtxoPattern} p2sh - * @property {AddrUtxoPattern} p2wpkh - * @property {AddrUtxoPattern} p2wsh - * @property {AddrUtxoPattern} p2tr - * @property {AddrUtxoPattern} p2a + * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2} utxo + * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2} addr */ /** @@ -7135,6 +8632,7 @@ function createUnspentPattern(client, acc) { * @property {SupplyPattern2} dormant * @property {SeriesTree_Frameworks_Cointime_Sth} sth * @property {SeriesTree_Frameworks_Cointime_Lth} lth + * @property {SeriesTree_Frameworks_Cointime_Sources} sources * @property {SeriesTree_Frameworks_Cointime_Supply} supply * @property {SeriesTree_Frameworks_Cointime_Value} value * @property {SeriesTree_Frameworks_Cointime_Cap} cap @@ -7186,7 +8684,7 @@ function createUnspentPattern(client, acc) { * @property {AverageBlockCumulativeSumPattern} _10yTo12y * @property {AverageBlockCumulativeSumPattern} _12yTo15y * @property {AverageBlockCumulativeSumPattern} over15y - * @property {SeriesPattern18<[StoredF64; 23]>} cumulative + * @property {SeriesPattern18} cumulative */ /** @@ -7214,7 +8712,7 @@ function createUnspentPattern(client, acc) { * @property {AverageBlockCumulativeSumPattern} _10yTo12y * @property {AverageBlockCumulativeSumPattern} _12yTo15y * @property {AverageBlockCumulativeSumPattern} over15y - * @property {SeriesPattern18<[StoredF64; 23]>} cumulative + * @property {SeriesPattern18} cumulative */ /** @@ -7242,7 +8740,7 @@ function createUnspentPattern(client, acc) { * @property {AverageBlockCumulativeSumPattern} _10yTo12y * @property {AverageBlockCumulativeSumPattern} _12yTo15y * @property {AverageBlockCumulativeSumPattern} over15y - * @property {SeriesPattern18<[StoredF64; 23]>} cumulative + * @property {SeriesPattern18} cumulative */ /** @@ -7250,7 +8748,7 @@ function createUnspentPattern(client, acc) { * @property {SeriesTree_Frameworks_Cointime_AgeRange_Activity_Wakefulness} wakefulness * @property {SeriesTree_Frameworks_Cointime_AgeRange_Activity_Dormancy} dormancy * @property {SeriesTree_Frameworks_Cointime_AgeRange_Activity_WakefulnessToDormancy} wakefulnessToDormancy - * @property {SeriesPattern18<[StoredF64; 23]>} height + * @property {SeriesPattern18} height */ /** @@ -7365,7 +8863,7 @@ function createUnspentPattern(client, acc) { * @property {BtcCentsSatsUsdPattern} _10yTo12y * @property {BtcCentsSatsUsdPattern} _12yTo15y * @property {BtcCentsSatsUsdPattern} over15y - * @property {SeriesPattern18<[Sats; 23]>} height + * @property {SeriesPattern18} height */ /** @@ -7393,7 +8891,7 @@ function createUnspentPattern(client, acc) { * @property {BtcCentsSatsUsdPattern} _10yTo12y * @property {BtcCentsSatsUsdPattern} _12yTo15y * @property {BtcCentsSatsUsdPattern} over15y - * @property {SeriesPattern18<[Sats; 23]>} height + * @property {SeriesPattern18} height */ /** @@ -7409,7 +8907,7 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} sats * @property {SeriesPattern1} usd * @property {SeriesPattern1} cents - * @property {SharePattern2} inLoss + * @property {SharePattern3} inLoss */ /** @@ -7431,7 +8929,7 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} sats * @property {SeriesPattern1} usd * @property {SeriesPattern1} cents - * @property {SharePattern2} inLoss + * @property {SharePattern3} inLoss */ /** @@ -7453,7 +8951,16 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} sats * @property {SeriesPattern1} usd * @property {SeriesPattern1} cents - * @property {SharePattern2} inLoss + * @property {SharePattern3} inLoss + */ + +/** + * @typedef {Object} SeriesTree_Frameworks_Cointime_Sources + * @property {SeriesPattern18} awakeSupply + * @property {SeriesPattern18} dormantSupply + * @property {SeriesPattern18} awakeCap + * @property {SeriesPattern18} awakePrice + * @property {SeriesPattern18} supplyInLossShare */ /** @@ -7468,7 +8975,7 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} sats * @property {SeriesPattern1} usd * @property {SeriesPattern1} cents - * @property {SharePattern2} inLoss + * @property {SharePattern3} inLoss */ /** @@ -7515,11 +9022,12 @@ function createUnspentPattern(client, acc) { * @typedef {Object} SeriesTree_Frameworks_Coinflow * @property {SeriesTree_Frameworks_Coinflow_AgeRange} ageRange * @property {SeriesTree_Frameworks_Coinflow_Supply} supply - * @property {_1m1y2y3m4y6m8yPattern} horizon + * @property {_1m1y2y3m4y6m8yPattern2} horizon * @property {CentsUsdPattern3} cap * @property {CentsPpmRatioSatsUsdPattern} price * @property {SeriesTree_Frameworks_Coinflow_Sth} sth * @property {SeriesTree_Frameworks_Coinflow_Lth} lth + * @property {SeriesTree_Frameworks_Coinflow_AggregateSources} aggregateSources */ /** @@ -7554,7 +9062,7 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} _10yTo12y * @property {SeriesPattern1} _12yTo15y * @property {SeriesPattern1} over15y - * @property {SeriesPattern18<[StoredF64; 23]>} height + * @property {SeriesPattern18} height */ /** @@ -7583,7 +9091,7 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} _12yTo15y * @property {SeriesPattern1} over15y * @property {SeriesTree_Frameworks_Coinflow_AgeRange_SpendingExposure_Mobility} mobility - * @property {SeriesPattern18<[StoredF64; 23]>} height + * @property {SeriesPattern18} height */ /** @@ -7644,7 +9152,7 @@ function createUnspentPattern(client, acc) { * @property {BtcCentsSatsUsdPattern} _10yTo12y * @property {BtcCentsSatsUsdPattern} _12yTo15y * @property {BtcCentsSatsUsdPattern} over15y - * @property {SeriesPattern18<[Sats; 23]>} height + * @property {SeriesPattern18} height */ /** @@ -7672,7 +9180,7 @@ function createUnspentPattern(client, acc) { * @property {BtcCentsSatsUsdPattern} _10yTo12y * @property {BtcCentsSatsUsdPattern} _12yTo15y * @property {BtcCentsSatsUsdPattern} over15y - * @property {SeriesPattern18<[Sats; 23]>} height + * @property {SeriesPattern18} height */ /** @@ -7687,13 +9195,13 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} sats * @property {SeriesPattern1} usd * @property {SeriesPattern1} cents - * @property {SharePattern2} inLoss + * @property {SharePattern3} inLoss */ /** * @typedef {Object} SeriesTree_Frameworks_Coinflow_Sth * @property {SeriesTree_Frameworks_Coinflow_Sth_Supply} supply - * @property {_1m1y2y3m4y6m8yPattern} horizon + * @property {_1m1y2y3m4y6m8yPattern2} horizon * @property {CentsUsdPattern3} cap * @property {CentsPpmRatioSatsUsdPattern} price */ @@ -7710,13 +9218,13 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} sats * @property {SeriesPattern1} usd * @property {SeriesPattern1} cents - * @property {SharePattern2} inLoss + * @property {SharePattern3} inLoss */ /** * @typedef {Object} SeriesTree_Frameworks_Coinflow_Lth * @property {SeriesTree_Frameworks_Coinflow_Lth_Supply} supply - * @property {_1m1y2y3m4y6m8yPattern} horizon + * @property {_1m1y2y3m4y6m8yPattern2} horizon * @property {CentsUsdPattern3} cap * @property {CentsPpmRatioSatsUsdPattern} price */ @@ -7733,7 +9241,33 @@ function createUnspentPattern(client, acc) { * @property {SeriesPattern1} sats * @property {SeriesPattern1} usd * @property {SeriesPattern1} cents - * @property {SharePattern2} inLoss + * @property {SharePattern3} inLoss + */ + +/** + * @typedef {Object} SeriesTree_Frameworks_Coinflow_AggregateSources + * @property {SeriesTree_Frameworks_Coinflow_AggregateSources_Supply} supply + * @property {SeriesPattern18} supplyInLossShare + * @property {SeriesTree_Frameworks_Coinflow_AggregateSources_Horizon} horizon + * @property {SeriesPattern18} cap + * @property {SeriesPattern18} price + */ + +/** + * @typedef {Object} SeriesTree_Frameworks_Coinflow_AggregateSources_Supply + * @property {SeriesPattern18} mobile + * @property {SeriesPattern18} immobile + */ + +/** + * @typedef {Object} SeriesTree_Frameworks_Coinflow_AggregateSources_Horizon + * @property {SeriesPattern18} _8y + * @property {SeriesPattern18} _4y + * @property {SeriesPattern18} _2y + * @property {SeriesPattern18} _1y + * @property {SeriesPattern18} _6m + * @property {SeriesPattern18} _3m + * @property {SeriesPattern18} _1m */ /** @@ -8636,441 +10170,181 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} SeriesTree_Cohorts - * @property {SeriesTree_Cohorts_Utxo} utxo - * @property {SeriesTree_Cohorts_Addr} addr + * @property {SeriesTree_Cohorts_Cohorts} cohorts */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo - * @property {SeriesTree_Cohorts_Utxo_All} all - * @property {SeriesTree_Cohorts_Utxo_Sth} sth - * @property {SeriesTree_Cohorts_Utxo_Lth} lth - * @property {SeriesTree_Cohorts_Utxo_AgeRange} ageRange - * @property {SeriesTree_Cohorts_Utxo_UnderAge} underAge - * @property {SeriesTree_Cohorts_Utxo_OverAge} overAge - * @property {SeriesTree_Cohorts_Utxo_Epoch} epoch - * @property {SeriesTree_Cohorts_Utxo_Class} class - * @property {SeriesTree_Cohorts_Utxo_Entry} entry - * @property {SeriesTree_Cohorts_Utxo_OverAmount} overAmount - * @property {SeriesTree_Cohorts_Utxo_AmountRange} amountRange - * @property {SeriesTree_Cohorts_Utxo_UnderAmount} underAmount - * @property {SeriesTree_Cohorts_Utxo_Type} type - * @property {SeriesTree_Cohorts_Utxo_Profitability} profitability - * @property {SeriesTree_Cohorts_Utxo_Matured} matured - * @property {SeriesPattern18<[Sats; 23]>} cumulativeMaturedSats - * @property {SeriesPattern18<[Cents; 23]>} cumulativeMaturedCents + * @typedef {Object} SeriesTree_Cohorts_Cohorts + * @property {SeriesTree_Cohorts_Cohorts_Supply} supply + * @property {SeriesTree_Cohorts_Cohorts_Outputs} outputs + * @property {SeriesTree_Cohorts_Cohorts_Activity} activity + * @property {SeriesTree_Cohorts_Cohorts_Realized} realized + * @property {SeriesTree_Cohorts_Cohorts_Unrealized} unrealized + * @property {SeriesTree_Cohorts_Cohorts_CostBasis} costBasis + * @property {SeriesTree_Cohorts_Cohorts_Relative} relative + * @property {SeriesTree_Cohorts_Cohorts_Profitability} profitability */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All - * @property {DeltaDominanceHalfInTotalPattern2} supply - * @property {SeriesTree_Cohorts_Utxo_All_Outputs} outputs - * @property {SeriesTree_Cohorts_Utxo_All_Activity} activity - * @property {SeriesTree_Cohorts_Utxo_All_Realized} realized - * @property {SeriesTree_Cohorts_Utxo_All_CostBasis} costBasis - * @property {SeriesTree_Cohorts_Utxo_All_Unrealized} unrealized - * @property {InPattern} investedCapital + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply + * @property {SeriesTree_Cohorts_Cohorts_Supply_Total} total + * @property {SeriesTree_Cohorts_Cohorts_Supply_Matured} matured + * @property {SeriesTree_Cohorts_Cohorts_Supply_Half} half + * @property {SeriesTree_Cohorts_Cohorts_Supply_InProfit} inProfit + * @property {SeriesTree_Cohorts_Cohorts_Supply_InLoss} inLoss + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta} delta + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance} dominance */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Outputs - * @property {BaseDeltaPattern} unspentCount - * @property {AverageBlockCumulativeSumPattern} spentCount + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Total + * @property {BtcCentsSatsUsdPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Supply_Total_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Supply_Total_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Supply_Total_Class} class + * @property {DiscountPremiumPattern12} entry + * @property {SeriesTree_Cohorts_Cohorts_Supply_Total_UtxoAmount} utxoAmount + * @property {LongShortPattern13} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + * @property {SeriesPattern18} amountRangeMatrix + * @property {SeriesTree_Cohorts_Cohorts_Supply_Total_AddrBalance} addrBalance */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Activity - * @property {AverageBlockCumulativeInSumPattern} transferVolume - * @property {AverageBlockCumulativeSumPattern} coindaysDestroyed - * @property {SeriesPattern1} coinyearsDestroyed - * @property {_1m1w1y24hHeightPattern} dormancy + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Total_Age + * @property {SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Over} over */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized - * @property {CentsDeltaToUsdPattern} cap - * @property {BlockCumulativeSumPattern} profit - * @property {BlockCumulativeNegativeSumPattern} loss - * @property {CentsPpmRatioSatsUsdPattern} price - * @property {SeriesPattern1} mvrv - * @property {BlockChangeCumulativeDeltaSumPattern} netPnl - * @property {SeriesTree_Cohorts_Utxo_All_Realized_Sopr} sopr - * @property {BlockCumulativeSumPattern} grossPnl - * @property {_1m1w1y24hHeightPattern3} sellSideRiskRatio - * @property {BlockCumulativeSumPattern} peakRegret - * @property {PricePattern} capitalized - * @property {_1m1w1y24hHeightPattern2} profitToLossRatio + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Range + * @property {BtcCentsSatsUsdPattern} under1h + * @property {BtcCentsSatsUsdPattern} _1hTo1d + * @property {BtcCentsSatsUsdPattern} _1dTo1w + * @property {BtcCentsSatsUsdPattern} _1wTo1m + * @property {BtcCentsSatsUsdPattern} _1mTo2m + * @property {BtcCentsSatsUsdPattern} _2mTo3m + * @property {BtcCentsSatsUsdPattern} _3mTo4m + * @property {BtcCentsSatsUsdPattern} _4mTo5m + * @property {BtcCentsSatsUsdPattern} _5mTo6m + * @property {BtcCentsSatsUsdPattern} _6mTo9m + * @property {BtcCentsSatsUsdPattern} _9mTo1y + * @property {BtcCentsSatsUsdPattern} _1yTo18m + * @property {BtcCentsSatsUsdPattern} _18mTo2y + * @property {BtcCentsSatsUsdPattern} _2yTo3y + * @property {BtcCentsSatsUsdPattern} _3yTo4y + * @property {BtcCentsSatsUsdPattern} _4yTo5y + * @property {BtcCentsSatsUsdPattern} _5yTo6y + * @property {BtcCentsSatsUsdPattern} _6yTo7y + * @property {BtcCentsSatsUsdPattern} _7yTo8y + * @property {BtcCentsSatsUsdPattern} _8yTo10y + * @property {BtcCentsSatsUsdPattern} _10yTo12y + * @property {BtcCentsSatsUsdPattern} _12yTo15y + * @property {BtcCentsSatsUsdPattern} over15y */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Sopr - * @property {AverageBlockCumulativeSumPattern} valueDestroyed - * @property {_1m1w1y24hHeightPattern4} ratio - * @property {SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted} adjusted + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Under + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _9m + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y + * @property {BtcCentsSatsUsdPattern} _15y */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted - * @property {_1m1w1y24hHeightPattern2} ratio - * @property {AverageBlockCumulativeSumPattern} transferVolume - * @property {AverageBlockCumulativeSumPattern} valueDestroyed + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Over + * @property {BtcCentsSatsUsdPattern} _1d + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _9m + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_CostBasis - * @property {PerPattern} inProfit - * @property {PerPattern} inLoss - * @property {CentsSatsUsdPattern} min - * @property {CentsSatsUsdPattern} max - * @property {HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} perCoin - * @property {HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} perDollar - * @property {PercentPpmRatioPattern2} supplyDensity + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Total_Epoch + * @property {BtcCentsSatsUsdPattern} _0 + * @property {BtcCentsSatsUsdPattern} _1 + * @property {BtcCentsSatsUsdPattern} _2 + * @property {BtcCentsSatsUsdPattern} _3 + * @property {BtcCentsSatsUsdPattern} _4 */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized - * @property {PpmRatioPattern} nupl - * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_Profit} profit - * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_Loss} loss - * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl} netPnl - * @property {CentsUsdPattern3} grossPnl - * @property {InPattern2} investedCapital - * @property {SeriesPattern18} capitalizedCapInProfitRaw - * @property {SeriesPattern18} capitalizedCapInLossRaw - * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment} sentiment + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Total_Class + * @property {BtcCentsSatsUsdPattern} _2009 + * @property {BtcCentsSatsUsdPattern} _2010 + * @property {BtcCentsSatsUsdPattern} _2011 + * @property {BtcCentsSatsUsdPattern} _2012 + * @property {BtcCentsSatsUsdPattern} _2013 + * @property {BtcCentsSatsUsdPattern} _2014 + * @property {BtcCentsSatsUsdPattern} _2015 + * @property {BtcCentsSatsUsdPattern} _2016 + * @property {BtcCentsSatsUsdPattern} _2017 + * @property {BtcCentsSatsUsdPattern} _2018 + * @property {BtcCentsSatsUsdPattern} _2019 + * @property {BtcCentsSatsUsdPattern} _2020 + * @property {BtcCentsSatsUsdPattern} _2021 + * @property {BtcCentsSatsUsdPattern} _2022 + * @property {BtcCentsSatsUsdPattern} _2023 + * @property {BtcCentsSatsUsdPattern} _2024 + * @property {BtcCentsSatsUsdPattern} _2025 + * @property {BtcCentsSatsUsdPattern} _2026 */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized_Profit - * @property {SeriesPattern1} usd - * @property {SeriesPattern1} cents - * @property {PercentPpmRatioPattern2} toMcap - * @property {PercentPpmRatioPattern2} toOwnGrossPnl + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Total_UtxoAmount + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern10} under + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10} over */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized_Loss - * @property {SeriesPattern1} usd - * @property {SeriesPattern1} cents - * @property {SeriesPattern1} negative - * @property {PercentPpmRatioPattern2} toMcap - * @property {PercentPpmRatioPattern2} toOwnGrossPnl + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Total_AddrBalance + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern10} under + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10} over + * @property {SeriesPattern18} matrix */ /** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl - * @property {SeriesPattern1} usd - * @property {SeriesPattern1} cents - * @property {PercentPpmRatioPattern3} toOwnGrossPnl - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment - * @property {CentsUsdPattern3} painIndex - * @property {CentsUsdPattern3} greedIndex - * @property {CentsUsdPattern} net - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth - * @property {DeltaDominanceHalfInTotalPattern2} supply - * @property {SpentUnspentPattern} outputs - * @property {CoindaysCoinyearsDormancyTransferPattern} activity - * @property {CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern} realized - * @property {InMaxMinPerSupplyPattern} costBasis - * @property {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2} unrealized - * @property {InPattern} investedCapital - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth - * @property {DeltaDominanceHalfInTotalPattern2} supply - * @property {SpentUnspentPattern} outputs - * @property {CoindaysCoinyearsDormancyTransferPattern} activity - * @property {SeriesTree_Cohorts_Utxo_Lth_Realized} realized - * @property {InMaxMinPerSupplyPattern} costBasis - * @property {CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2} unrealized - * @property {InPattern} investedCapital - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized - * @property {CentsDeltaToUsdPattern} cap - * @property {BlockCumulativeSumPattern} profit - * @property {BlockCumulativeNegativeSumPattern} loss - * @property {CentsPpmRatioSatsUsdPattern} price - * @property {SeriesPattern1} mvrv - * @property {BlockChangeCumulativeDeltaSumPattern} netPnl - * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr} sopr - * @property {BlockCumulativeSumPattern} grossPnl - * @property {_1m1w1y24hHeightPattern3} sellSideRiskRatio - * @property {BlockCumulativeSumPattern} peakRegret - * @property {PricePattern} capitalized - * @property {_1m1w1y24hHeightPattern2} profitToLossRatio - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr - * @property {AverageBlockCumulativeSumPattern} valueDestroyed - * @property {_1m1w1y24hHeightPattern4} ratio - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_AgeRange - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} under1h - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1hTo1d - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1dTo1w - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1wTo1m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1mTo2m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2mTo3m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _3mTo4m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _4mTo5m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _5mTo6m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _6mTo9m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _9mTo1y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1yTo18m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _18mTo2y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2yTo3y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _3yTo4y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _4yTo5y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _5yTo6y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _6yTo7y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _7yTo8y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _8yTo10y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _10yTo12y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _12yTo15y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} over15y - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_UnderAge - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1w - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _3m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _4m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _5m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _6m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _9m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _18m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _3y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _4y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _5y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _6y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _7y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _8y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _10y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _12y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _15y - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_OverAge - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1d - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1w - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _3m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _4m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _5m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _6m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _9m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _18m - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _3y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _4y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _5y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _6y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _7y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _8y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _10y - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _12y - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Epoch - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _0 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _3 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _4 - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Class - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2009 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2010 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2011 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2012 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2013 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2014 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2015 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2016 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2017 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2018 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2019 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2020 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2021 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2022 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2023 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2024 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2025 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2026 - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Entry - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} discount - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} premium - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_OverAmount - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1sat - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10sats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100sats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1kSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10kSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100kSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1mSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10mSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1btc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10btc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100btc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1kBtc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10kBtc - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_AmountRange - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _0sats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1satTo10sats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10satsTo100sats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100satsTo1kSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1kSatsTo10kSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10kSatsTo100kSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100kSatsTo1mSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1mSatsTo10mSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10mSatsTo1btc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1btcTo10btc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10btcTo100btc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100btcTo1kBtc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1kBtcTo10kBtc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10kBtcTo100kBtc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} over100kBtc - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_UnderAmount - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10sats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100sats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1kSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10kSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100kSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1mSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10mSats - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1btc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10btc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100btc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _1kBtc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _10kBtc - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern2} _100kBtc - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Type - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} p2pk65 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} p2pk33 - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} p2pkh - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} p2ms - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} p2sh - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} p2wpkh - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} p2wsh - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} p2tr - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} p2a - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} unknown - * @property {ActivityOutputsRealizedSupplyUnrealizedPattern3} empty - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Profitability - * @property {SeriesTree_Cohorts_Utxo_Profitability_Range} range - * @property {SeriesTree_Cohorts_Utxo_Profitability_Profit} profit - * @property {SeriesTree_Cohorts_Utxo_Profitability_Loss} loss - * @property {SeriesPattern18} allSupplySats - * @property {SeriesPattern18} sthSupplySats - * @property {SeriesPattern18} allRealizedCap - * @property {SeriesPattern18} sthRealizedCap - * @property {SeriesPattern18} allUnrealizedPnl - * @property {SeriesPattern18} sthUnrealizedPnl - * @property {SeriesPattern18} nupl - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Profitability_Range - * @property {NuplRealizedSupplyUnrealizedPattern} over1000pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _500pctTo1000pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _300pctTo500pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _200pctTo300pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _100pctTo200pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _90pctTo100pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _80pctTo90pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _70pctTo80pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _60pctTo70pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _50pctTo60pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _40pctTo50pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _30pctTo40pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _20pctTo30pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _10pctTo20pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _0pctTo10pctInProfit - * @property {NuplRealizedSupplyUnrealizedPattern} _0pctTo10pctInLoss - * @property {NuplRealizedSupplyUnrealizedPattern} _10pctTo20pctInLoss - * @property {NuplRealizedSupplyUnrealizedPattern} _20pctTo30pctInLoss - * @property {NuplRealizedSupplyUnrealizedPattern} _30pctTo40pctInLoss - * @property {NuplRealizedSupplyUnrealizedPattern} _40pctTo50pctInLoss - * @property {NuplRealizedSupplyUnrealizedPattern} _50pctTo60pctInLoss - * @property {NuplRealizedSupplyUnrealizedPattern} _60pctTo70pctInLoss - * @property {NuplRealizedSupplyUnrealizedPattern} _70pctTo80pctInLoss - * @property {NuplRealizedSupplyUnrealizedPattern} _80pctTo90pctInLoss - * @property {NuplRealizedSupplyUnrealizedPattern} _90pctTo100pctInLoss - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Profitability_Profit - * @property {NuplRealizedSupplyUnrealizedPattern} all - * @property {NuplRealizedSupplyUnrealizedPattern} _10pct - * @property {NuplRealizedSupplyUnrealizedPattern} _20pct - * @property {NuplRealizedSupplyUnrealizedPattern} _30pct - * @property {NuplRealizedSupplyUnrealizedPattern} _40pct - * @property {NuplRealizedSupplyUnrealizedPattern} _50pct - * @property {NuplRealizedSupplyUnrealizedPattern} _60pct - * @property {NuplRealizedSupplyUnrealizedPattern} _70pct - * @property {NuplRealizedSupplyUnrealizedPattern} _80pct - * @property {NuplRealizedSupplyUnrealizedPattern} _90pct - * @property {NuplRealizedSupplyUnrealizedPattern} _100pct - * @property {NuplRealizedSupplyUnrealizedPattern} _200pct - * @property {NuplRealizedSupplyUnrealizedPattern} _300pct - * @property {NuplRealizedSupplyUnrealizedPattern} _500pct - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Profitability_Loss - * @property {NuplRealizedSupplyUnrealizedPattern} all - * @property {NuplRealizedSupplyUnrealizedPattern} _10pct - * @property {NuplRealizedSupplyUnrealizedPattern} _20pct - * @property {NuplRealizedSupplyUnrealizedPattern} _30pct - * @property {NuplRealizedSupplyUnrealizedPattern} _40pct - * @property {NuplRealizedSupplyUnrealizedPattern} _50pct - * @property {NuplRealizedSupplyUnrealizedPattern} _60pct - * @property {NuplRealizedSupplyUnrealizedPattern} _70pct - * @property {NuplRealizedSupplyUnrealizedPattern} _80pct - */ - -/** - * @typedef {Object} SeriesTree_Cohorts_Utxo_Matured + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Matured * @property {AverageBlockCumulativeSumPattern2} under1h * @property {AverageBlockCumulativeSumPattern2} _1hTo1d * @property {AverageBlockCumulativeSumPattern2} _1dTo1w @@ -9094,66 +10368,5180 @@ function createUnspentPattern(client, acc) { * @property {AverageBlockCumulativeSumPattern2} _10yTo12y * @property {AverageBlockCumulativeSumPattern2} _12yTo15y * @property {AverageBlockCumulativeSumPattern2} over15y + * @property {CumulativePattern} sats + * @property {CumulativePattern} cents */ /** - * @typedef {Object} SeriesTree_Cohorts_Addr - * @property {SeriesTree_Cohorts_Addr_OverAmount} overAmount - * @property {SeriesTree_Cohorts_Addr_AmountRange} amountRange - * @property {SeriesTree_Cohorts_Addr_UnderAmount} underAmount + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Half + * @property {BtcCentsSatsUsdPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Supply_Half_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Supply_Half_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Supply_Half_Class} class + * @property {DiscountPremiumPattern12} entry + * @property {LongShortPattern13} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10} type */ /** - * @typedef {Object} SeriesTree_Cohorts_Addr_OverAmount - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1sat - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10sats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100sats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1kSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10kSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100kSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1mSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10mSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1btc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10btc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100btc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1kBtc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10kBtc + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Half_Age + * @property {SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Over} over */ /** - * @typedef {Object} SeriesTree_Cohorts_Addr_AmountRange - * @property {ActivityAddrOutputsRealizedSupplyPattern} _0sats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1satTo10sats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10satsTo100sats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100satsTo1kSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1kSatsTo10kSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10kSatsTo100kSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100kSatsTo1mSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1mSatsTo10mSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10mSatsTo1btc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1btcTo10btc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10btcTo100btc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100btcTo1kBtc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1kBtcTo10kBtc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10kBtcTo100kBtc - * @property {ActivityAddrOutputsRealizedSupplyPattern} over100kBtc + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Range + * @property {BtcCentsSatsUsdPattern} under1h + * @property {BtcCentsSatsUsdPattern} _1hTo1d + * @property {BtcCentsSatsUsdPattern} _1dTo1w + * @property {BtcCentsSatsUsdPattern} _1wTo1m + * @property {BtcCentsSatsUsdPattern} _1mTo2m + * @property {BtcCentsSatsUsdPattern} _2mTo3m + * @property {BtcCentsSatsUsdPattern} _3mTo4m + * @property {BtcCentsSatsUsdPattern} _4mTo5m + * @property {BtcCentsSatsUsdPattern} _5mTo6m + * @property {BtcCentsSatsUsdPattern} _6mTo9m + * @property {BtcCentsSatsUsdPattern} _9mTo1y + * @property {BtcCentsSatsUsdPattern} _1yTo18m + * @property {BtcCentsSatsUsdPattern} _18mTo2y + * @property {BtcCentsSatsUsdPattern} _2yTo3y + * @property {BtcCentsSatsUsdPattern} _3yTo4y + * @property {BtcCentsSatsUsdPattern} _4yTo5y + * @property {BtcCentsSatsUsdPattern} _5yTo6y + * @property {BtcCentsSatsUsdPattern} _6yTo7y + * @property {BtcCentsSatsUsdPattern} _7yTo8y + * @property {BtcCentsSatsUsdPattern} _8yTo10y + * @property {BtcCentsSatsUsdPattern} _10yTo12y + * @property {BtcCentsSatsUsdPattern} _12yTo15y + * @property {BtcCentsSatsUsdPattern} over15y */ /** - * @typedef {Object} SeriesTree_Cohorts_Addr_UnderAmount - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10sats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100sats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1kSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10kSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100kSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1mSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10mSats - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1btc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10btc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100btc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _1kBtc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _10kBtc - * @property {ActivityAddrOutputsRealizedSupplyPattern} _100kBtc + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Under + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _9m + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y + * @property {BtcCentsSatsUsdPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Over + * @property {BtcCentsSatsUsdPattern} _1d + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _9m + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Half_Epoch + * @property {BtcCentsSatsUsdPattern} _0 + * @property {BtcCentsSatsUsdPattern} _1 + * @property {BtcCentsSatsUsdPattern} _2 + * @property {BtcCentsSatsUsdPattern} _3 + * @property {BtcCentsSatsUsdPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Half_Class + * @property {BtcCentsSatsUsdPattern} _2009 + * @property {BtcCentsSatsUsdPattern} _2010 + * @property {BtcCentsSatsUsdPattern} _2011 + * @property {BtcCentsSatsUsdPattern} _2012 + * @property {BtcCentsSatsUsdPattern} _2013 + * @property {BtcCentsSatsUsdPattern} _2014 + * @property {BtcCentsSatsUsdPattern} _2015 + * @property {BtcCentsSatsUsdPattern} _2016 + * @property {BtcCentsSatsUsdPattern} _2017 + * @property {BtcCentsSatsUsdPattern} _2018 + * @property {BtcCentsSatsUsdPattern} _2019 + * @property {BtcCentsSatsUsdPattern} _2020 + * @property {BtcCentsSatsUsdPattern} _2021 + * @property {BtcCentsSatsUsdPattern} _2022 + * @property {BtcCentsSatsUsdPattern} _2023 + * @property {BtcCentsSatsUsdPattern} _2024 + * @property {BtcCentsSatsUsdPattern} _2025 + * @property {BtcCentsSatsUsdPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InProfit + * @property {BtcCentsSatsUsdPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Supply_InProfit_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Supply_InProfit_Class} class + * @property {DiscountPremiumPattern12} entry + * @property {LongShortPattern13} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age + * @property {SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Range + * @property {BtcCentsSatsUsdPattern} under1h + * @property {BtcCentsSatsUsdPattern} _1hTo1d + * @property {BtcCentsSatsUsdPattern} _1dTo1w + * @property {BtcCentsSatsUsdPattern} _1wTo1m + * @property {BtcCentsSatsUsdPattern} _1mTo2m + * @property {BtcCentsSatsUsdPattern} _2mTo3m + * @property {BtcCentsSatsUsdPattern} _3mTo4m + * @property {BtcCentsSatsUsdPattern} _4mTo5m + * @property {BtcCentsSatsUsdPattern} _5mTo6m + * @property {BtcCentsSatsUsdPattern} _6mTo9m + * @property {BtcCentsSatsUsdPattern} _9mTo1y + * @property {BtcCentsSatsUsdPattern} _1yTo18m + * @property {BtcCentsSatsUsdPattern} _18mTo2y + * @property {BtcCentsSatsUsdPattern} _2yTo3y + * @property {BtcCentsSatsUsdPattern} _3yTo4y + * @property {BtcCentsSatsUsdPattern} _4yTo5y + * @property {BtcCentsSatsUsdPattern} _5yTo6y + * @property {BtcCentsSatsUsdPattern} _6yTo7y + * @property {BtcCentsSatsUsdPattern} _7yTo8y + * @property {BtcCentsSatsUsdPattern} _8yTo10y + * @property {BtcCentsSatsUsdPattern} _10yTo12y + * @property {BtcCentsSatsUsdPattern} _12yTo15y + * @property {BtcCentsSatsUsdPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Under + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _9m + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y + * @property {BtcCentsSatsUsdPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Over + * @property {BtcCentsSatsUsdPattern} _1d + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _9m + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InProfit_Epoch + * @property {BtcCentsSatsUsdPattern} _0 + * @property {BtcCentsSatsUsdPattern} _1 + * @property {BtcCentsSatsUsdPattern} _2 + * @property {BtcCentsSatsUsdPattern} _3 + * @property {BtcCentsSatsUsdPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InProfit_Class + * @property {BtcCentsSatsUsdPattern} _2009 + * @property {BtcCentsSatsUsdPattern} _2010 + * @property {BtcCentsSatsUsdPattern} _2011 + * @property {BtcCentsSatsUsdPattern} _2012 + * @property {BtcCentsSatsUsdPattern} _2013 + * @property {BtcCentsSatsUsdPattern} _2014 + * @property {BtcCentsSatsUsdPattern} _2015 + * @property {BtcCentsSatsUsdPattern} _2016 + * @property {BtcCentsSatsUsdPattern} _2017 + * @property {BtcCentsSatsUsdPattern} _2018 + * @property {BtcCentsSatsUsdPattern} _2019 + * @property {BtcCentsSatsUsdPattern} _2020 + * @property {BtcCentsSatsUsdPattern} _2021 + * @property {BtcCentsSatsUsdPattern} _2022 + * @property {BtcCentsSatsUsdPattern} _2023 + * @property {BtcCentsSatsUsdPattern} _2024 + * @property {BtcCentsSatsUsdPattern} _2025 + * @property {BtcCentsSatsUsdPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InLoss + * @property {BtcCentsSatsUsdPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Supply_InLoss_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Supply_InLoss_Class} class + * @property {DiscountPremiumPattern12} entry + * @property {LongShortPattern13} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age + * @property {SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Range + * @property {BtcCentsSatsUsdPattern} under1h + * @property {BtcCentsSatsUsdPattern} _1hTo1d + * @property {BtcCentsSatsUsdPattern} _1dTo1w + * @property {BtcCentsSatsUsdPattern} _1wTo1m + * @property {BtcCentsSatsUsdPattern} _1mTo2m + * @property {BtcCentsSatsUsdPattern} _2mTo3m + * @property {BtcCentsSatsUsdPattern} _3mTo4m + * @property {BtcCentsSatsUsdPattern} _4mTo5m + * @property {BtcCentsSatsUsdPattern} _5mTo6m + * @property {BtcCentsSatsUsdPattern} _6mTo9m + * @property {BtcCentsSatsUsdPattern} _9mTo1y + * @property {BtcCentsSatsUsdPattern} _1yTo18m + * @property {BtcCentsSatsUsdPattern} _18mTo2y + * @property {BtcCentsSatsUsdPattern} _2yTo3y + * @property {BtcCentsSatsUsdPattern} _3yTo4y + * @property {BtcCentsSatsUsdPattern} _4yTo5y + * @property {BtcCentsSatsUsdPattern} _5yTo6y + * @property {BtcCentsSatsUsdPattern} _6yTo7y + * @property {BtcCentsSatsUsdPattern} _7yTo8y + * @property {BtcCentsSatsUsdPattern} _8yTo10y + * @property {BtcCentsSatsUsdPattern} _10yTo12y + * @property {BtcCentsSatsUsdPattern} _12yTo15y + * @property {BtcCentsSatsUsdPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Under + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _9m + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y + * @property {BtcCentsSatsUsdPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Over + * @property {BtcCentsSatsUsdPattern} _1d + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _2m + * @property {BtcCentsSatsUsdPattern} _3m + * @property {BtcCentsSatsUsdPattern} _4m + * @property {BtcCentsSatsUsdPattern} _5m + * @property {BtcCentsSatsUsdPattern} _6m + * @property {BtcCentsSatsUsdPattern} _9m + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _18m + * @property {BtcCentsSatsUsdPattern} _2y + * @property {BtcCentsSatsUsdPattern} _3y + * @property {BtcCentsSatsUsdPattern} _4y + * @property {BtcCentsSatsUsdPattern} _5y + * @property {BtcCentsSatsUsdPattern} _6y + * @property {BtcCentsSatsUsdPattern} _7y + * @property {BtcCentsSatsUsdPattern} _8y + * @property {BtcCentsSatsUsdPattern} _10y + * @property {BtcCentsSatsUsdPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InLoss_Epoch + * @property {BtcCentsSatsUsdPattern} _0 + * @property {BtcCentsSatsUsdPattern} _1 + * @property {BtcCentsSatsUsdPattern} _2 + * @property {BtcCentsSatsUsdPattern} _3 + * @property {BtcCentsSatsUsdPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_InLoss_Class + * @property {BtcCentsSatsUsdPattern} _2009 + * @property {BtcCentsSatsUsdPattern} _2010 + * @property {BtcCentsSatsUsdPattern} _2011 + * @property {BtcCentsSatsUsdPattern} _2012 + * @property {BtcCentsSatsUsdPattern} _2013 + * @property {BtcCentsSatsUsdPattern} _2014 + * @property {BtcCentsSatsUsdPattern} _2015 + * @property {BtcCentsSatsUsdPattern} _2016 + * @property {BtcCentsSatsUsdPattern} _2017 + * @property {BtcCentsSatsUsdPattern} _2018 + * @property {BtcCentsSatsUsdPattern} _2019 + * @property {BtcCentsSatsUsdPattern} _2020 + * @property {BtcCentsSatsUsdPattern} _2021 + * @property {BtcCentsSatsUsdPattern} _2022 + * @property {BtcCentsSatsUsdPattern} _2023 + * @property {BtcCentsSatsUsdPattern} _2024 + * @property {BtcCentsSatsUsdPattern} _2025 + * @property {BtcCentsSatsUsdPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta + * @property {AbsoluteRatePattern2} all + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta_Class} class + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta_Entry} entry + * @property {OverRangeUnderPattern17} utxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta_Term} term + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta_Type} type + * @property {OverRangeUnderPattern17} addrBalance + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta_Age + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Range + * @property {AbsoluteRatePattern2} under1h + * @property {AbsoluteRatePattern2} _1hTo1d + * @property {AbsoluteRatePattern2} _1dTo1w + * @property {AbsoluteRatePattern2} _1wTo1m + * @property {AbsoluteRatePattern2} _1mTo2m + * @property {AbsoluteRatePattern2} _2mTo3m + * @property {AbsoluteRatePattern2} _3mTo4m + * @property {AbsoluteRatePattern2} _4mTo5m + * @property {AbsoluteRatePattern2} _5mTo6m + * @property {AbsoluteRatePattern2} _6mTo9m + * @property {AbsoluteRatePattern2} _9mTo1y + * @property {AbsoluteRatePattern2} _1yTo18m + * @property {AbsoluteRatePattern2} _18mTo2y + * @property {AbsoluteRatePattern2} _2yTo3y + * @property {AbsoluteRatePattern2} _3yTo4y + * @property {AbsoluteRatePattern2} _4yTo5y + * @property {AbsoluteRatePattern2} _5yTo6y + * @property {AbsoluteRatePattern2} _6yTo7y + * @property {AbsoluteRatePattern2} _7yTo8y + * @property {AbsoluteRatePattern2} _8yTo10y + * @property {AbsoluteRatePattern2} _10yTo12y + * @property {AbsoluteRatePattern2} _12yTo15y + * @property {AbsoluteRatePattern2} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Under + * @property {AbsoluteRatePattern2} _1w + * @property {AbsoluteRatePattern2} _1m + * @property {AbsoluteRatePattern2} _2m + * @property {AbsoluteRatePattern2} _3m + * @property {AbsoluteRatePattern2} _4m + * @property {AbsoluteRatePattern2} _5m + * @property {AbsoluteRatePattern2} _6m + * @property {AbsoluteRatePattern2} _9m + * @property {AbsoluteRatePattern2} _1y + * @property {AbsoluteRatePattern2} _18m + * @property {AbsoluteRatePattern2} _2y + * @property {AbsoluteRatePattern2} _3y + * @property {AbsoluteRatePattern2} _4y + * @property {AbsoluteRatePattern2} _5y + * @property {AbsoluteRatePattern2} _6y + * @property {AbsoluteRatePattern2} _7y + * @property {AbsoluteRatePattern2} _8y + * @property {AbsoluteRatePattern2} _10y + * @property {AbsoluteRatePattern2} _12y + * @property {AbsoluteRatePattern2} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Over + * @property {AbsoluteRatePattern2} _1d + * @property {AbsoluteRatePattern2} _1w + * @property {AbsoluteRatePattern2} _1m + * @property {AbsoluteRatePattern2} _2m + * @property {AbsoluteRatePattern2} _3m + * @property {AbsoluteRatePattern2} _4m + * @property {AbsoluteRatePattern2} _5m + * @property {AbsoluteRatePattern2} _6m + * @property {AbsoluteRatePattern2} _9m + * @property {AbsoluteRatePattern2} _1y + * @property {AbsoluteRatePattern2} _18m + * @property {AbsoluteRatePattern2} _2y + * @property {AbsoluteRatePattern2} _3y + * @property {AbsoluteRatePattern2} _4y + * @property {AbsoluteRatePattern2} _5y + * @property {AbsoluteRatePattern2} _6y + * @property {AbsoluteRatePattern2} _7y + * @property {AbsoluteRatePattern2} _8y + * @property {AbsoluteRatePattern2} _10y + * @property {AbsoluteRatePattern2} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta_Epoch + * @property {AbsoluteRatePattern2} _0 + * @property {AbsoluteRatePattern2} _1 + * @property {AbsoluteRatePattern2} _2 + * @property {AbsoluteRatePattern2} _3 + * @property {AbsoluteRatePattern2} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta_Class + * @property {AbsoluteRatePattern2} _2009 + * @property {AbsoluteRatePattern2} _2010 + * @property {AbsoluteRatePattern2} _2011 + * @property {AbsoluteRatePattern2} _2012 + * @property {AbsoluteRatePattern2} _2013 + * @property {AbsoluteRatePattern2} _2014 + * @property {AbsoluteRatePattern2} _2015 + * @property {AbsoluteRatePattern2} _2016 + * @property {AbsoluteRatePattern2} _2017 + * @property {AbsoluteRatePattern2} _2018 + * @property {AbsoluteRatePattern2} _2019 + * @property {AbsoluteRatePattern2} _2020 + * @property {AbsoluteRatePattern2} _2021 + * @property {AbsoluteRatePattern2} _2022 + * @property {AbsoluteRatePattern2} _2023 + * @property {AbsoluteRatePattern2} _2024 + * @property {AbsoluteRatePattern2} _2025 + * @property {AbsoluteRatePattern2} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta_Entry + * @property {AbsoluteRatePattern2} discount + * @property {AbsoluteRatePattern2} premium + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta_Term + * @property {AbsoluteRatePattern2} short + * @property {AbsoluteRatePattern2} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Delta_Type + * @property {AbsoluteRatePattern2} p2pk65 + * @property {AbsoluteRatePattern2} p2pk33 + * @property {AbsoluteRatePattern2} p2pkh + * @property {AbsoluteRatePattern2} p2ms + * @property {AbsoluteRatePattern2} p2sh + * @property {AbsoluteRatePattern2} p2wpkh + * @property {AbsoluteRatePattern2} p2wsh + * @property {AbsoluteRatePattern2} p2tr + * @property {AbsoluteRatePattern2} p2a + * @property {AbsoluteRatePattern2} unknown + * @property {AbsoluteRatePattern2} empty + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance + * @property {PercentPpmRatioPattern2} all + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance_Class} class + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance_Entry} entry + * @property {OverRangeUnderPattern19} utxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance_Term} term + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance_Type} type + * @property {OverRangeUnderPattern19} addrBalance + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Range + * @property {PercentPpmRatioPattern2} under1h + * @property {PercentPpmRatioPattern2} _1hTo1d + * @property {PercentPpmRatioPattern2} _1dTo1w + * @property {PercentPpmRatioPattern2} _1wTo1m + * @property {PercentPpmRatioPattern2} _1mTo2m + * @property {PercentPpmRatioPattern2} _2mTo3m + * @property {PercentPpmRatioPattern2} _3mTo4m + * @property {PercentPpmRatioPattern2} _4mTo5m + * @property {PercentPpmRatioPattern2} _5mTo6m + * @property {PercentPpmRatioPattern2} _6mTo9m + * @property {PercentPpmRatioPattern2} _9mTo1y + * @property {PercentPpmRatioPattern2} _1yTo18m + * @property {PercentPpmRatioPattern2} _18mTo2y + * @property {PercentPpmRatioPattern2} _2yTo3y + * @property {PercentPpmRatioPattern2} _3yTo4y + * @property {PercentPpmRatioPattern2} _4yTo5y + * @property {PercentPpmRatioPattern2} _5yTo6y + * @property {PercentPpmRatioPattern2} _6yTo7y + * @property {PercentPpmRatioPattern2} _7yTo8y + * @property {PercentPpmRatioPattern2} _8yTo10y + * @property {PercentPpmRatioPattern2} _10yTo12y + * @property {PercentPpmRatioPattern2} _12yTo15y + * @property {PercentPpmRatioPattern2} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Under + * @property {PercentPpmRatioPattern2} _1w + * @property {PercentPpmRatioPattern2} _1m + * @property {PercentPpmRatioPattern2} _2m + * @property {PercentPpmRatioPattern2} _3m + * @property {PercentPpmRatioPattern2} _4m + * @property {PercentPpmRatioPattern2} _5m + * @property {PercentPpmRatioPattern2} _6m + * @property {PercentPpmRatioPattern2} _9m + * @property {PercentPpmRatioPattern2} _1y + * @property {PercentPpmRatioPattern2} _18m + * @property {PercentPpmRatioPattern2} _2y + * @property {PercentPpmRatioPattern2} _3y + * @property {PercentPpmRatioPattern2} _4y + * @property {PercentPpmRatioPattern2} _5y + * @property {PercentPpmRatioPattern2} _6y + * @property {PercentPpmRatioPattern2} _7y + * @property {PercentPpmRatioPattern2} _8y + * @property {PercentPpmRatioPattern2} _10y + * @property {PercentPpmRatioPattern2} _12y + * @property {PercentPpmRatioPattern2} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Over + * @property {PercentPpmRatioPattern2} _1d + * @property {PercentPpmRatioPattern2} _1w + * @property {PercentPpmRatioPattern2} _1m + * @property {PercentPpmRatioPattern2} _2m + * @property {PercentPpmRatioPattern2} _3m + * @property {PercentPpmRatioPattern2} _4m + * @property {PercentPpmRatioPattern2} _5m + * @property {PercentPpmRatioPattern2} _6m + * @property {PercentPpmRatioPattern2} _9m + * @property {PercentPpmRatioPattern2} _1y + * @property {PercentPpmRatioPattern2} _18m + * @property {PercentPpmRatioPattern2} _2y + * @property {PercentPpmRatioPattern2} _3y + * @property {PercentPpmRatioPattern2} _4y + * @property {PercentPpmRatioPattern2} _5y + * @property {PercentPpmRatioPattern2} _6y + * @property {PercentPpmRatioPattern2} _7y + * @property {PercentPpmRatioPattern2} _8y + * @property {PercentPpmRatioPattern2} _10y + * @property {PercentPpmRatioPattern2} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance_Epoch + * @property {PercentPpmRatioPattern2} _0 + * @property {PercentPpmRatioPattern2} _1 + * @property {PercentPpmRatioPattern2} _2 + * @property {PercentPpmRatioPattern2} _3 + * @property {PercentPpmRatioPattern2} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance_Class + * @property {PercentPpmRatioPattern2} _2009 + * @property {PercentPpmRatioPattern2} _2010 + * @property {PercentPpmRatioPattern2} _2011 + * @property {PercentPpmRatioPattern2} _2012 + * @property {PercentPpmRatioPattern2} _2013 + * @property {PercentPpmRatioPattern2} _2014 + * @property {PercentPpmRatioPattern2} _2015 + * @property {PercentPpmRatioPattern2} _2016 + * @property {PercentPpmRatioPattern2} _2017 + * @property {PercentPpmRatioPattern2} _2018 + * @property {PercentPpmRatioPattern2} _2019 + * @property {PercentPpmRatioPattern2} _2020 + * @property {PercentPpmRatioPattern2} _2021 + * @property {PercentPpmRatioPattern2} _2022 + * @property {PercentPpmRatioPattern2} _2023 + * @property {PercentPpmRatioPattern2} _2024 + * @property {PercentPpmRatioPattern2} _2025 + * @property {PercentPpmRatioPattern2} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance_Entry + * @property {PercentPpmRatioPattern2} discount + * @property {PercentPpmRatioPattern2} premium + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance_Term + * @property {PercentPpmRatioPattern2} short + * @property {PercentPpmRatioPattern2} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Supply_Dominance_Type + * @property {PercentPpmRatioPattern2} p2pk65 + * @property {PercentPpmRatioPattern2} p2pk33 + * @property {PercentPpmRatioPattern2} p2pkh + * @property {PercentPpmRatioPattern2} p2ms + * @property {PercentPpmRatioPattern2} p2sh + * @property {PercentPpmRatioPattern2} p2wpkh + * @property {PercentPpmRatioPattern2} p2wsh + * @property {PercentPpmRatioPattern2} p2tr + * @property {PercentPpmRatioPattern2} p2a + * @property {PercentPpmRatioPattern2} unknown + * @property {PercentPpmRatioPattern2} empty + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount} unspentCount + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount} spentCount + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount + * @property {BaseDeltaPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Class} class + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Entry} entry + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount} utxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Term} term + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Type} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + * @property {SeriesPattern18} amountRangeMatrix + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance} addrBalance + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Range + * @property {BaseDeltaPattern} under1h + * @property {BaseDeltaPattern} _1hTo1d + * @property {BaseDeltaPattern} _1dTo1w + * @property {BaseDeltaPattern} _1wTo1m + * @property {BaseDeltaPattern} _1mTo2m + * @property {BaseDeltaPattern} _2mTo3m + * @property {BaseDeltaPattern} _3mTo4m + * @property {BaseDeltaPattern} _4mTo5m + * @property {BaseDeltaPattern} _5mTo6m + * @property {BaseDeltaPattern} _6mTo9m + * @property {BaseDeltaPattern} _9mTo1y + * @property {BaseDeltaPattern} _1yTo18m + * @property {BaseDeltaPattern} _18mTo2y + * @property {BaseDeltaPattern} _2yTo3y + * @property {BaseDeltaPattern} _3yTo4y + * @property {BaseDeltaPattern} _4yTo5y + * @property {BaseDeltaPattern} _5yTo6y + * @property {BaseDeltaPattern} _6yTo7y + * @property {BaseDeltaPattern} _7yTo8y + * @property {BaseDeltaPattern} _8yTo10y + * @property {BaseDeltaPattern} _10yTo12y + * @property {BaseDeltaPattern} _12yTo15y + * @property {BaseDeltaPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Under + * @property {BaseDeltaPattern} _1w + * @property {BaseDeltaPattern} _1m + * @property {BaseDeltaPattern} _2m + * @property {BaseDeltaPattern} _3m + * @property {BaseDeltaPattern} _4m + * @property {BaseDeltaPattern} _5m + * @property {BaseDeltaPattern} _6m + * @property {BaseDeltaPattern} _9m + * @property {BaseDeltaPattern} _1y + * @property {BaseDeltaPattern} _18m + * @property {BaseDeltaPattern} _2y + * @property {BaseDeltaPattern} _3y + * @property {BaseDeltaPattern} _4y + * @property {BaseDeltaPattern} _5y + * @property {BaseDeltaPattern} _6y + * @property {BaseDeltaPattern} _7y + * @property {BaseDeltaPattern} _8y + * @property {BaseDeltaPattern} _10y + * @property {BaseDeltaPattern} _12y + * @property {BaseDeltaPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Over + * @property {BaseDeltaPattern} _1d + * @property {BaseDeltaPattern} _1w + * @property {BaseDeltaPattern} _1m + * @property {BaseDeltaPattern} _2m + * @property {BaseDeltaPattern} _3m + * @property {BaseDeltaPattern} _4m + * @property {BaseDeltaPattern} _5m + * @property {BaseDeltaPattern} _6m + * @property {BaseDeltaPattern} _9m + * @property {BaseDeltaPattern} _1y + * @property {BaseDeltaPattern} _18m + * @property {BaseDeltaPattern} _2y + * @property {BaseDeltaPattern} _3y + * @property {BaseDeltaPattern} _4y + * @property {BaseDeltaPattern} _5y + * @property {BaseDeltaPattern} _6y + * @property {BaseDeltaPattern} _7y + * @property {BaseDeltaPattern} _8y + * @property {BaseDeltaPattern} _10y + * @property {BaseDeltaPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Epoch + * @property {BaseDeltaPattern} _0 + * @property {BaseDeltaPattern} _1 + * @property {BaseDeltaPattern} _2 + * @property {BaseDeltaPattern} _3 + * @property {BaseDeltaPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Class + * @property {BaseDeltaPattern} _2009 + * @property {BaseDeltaPattern} _2010 + * @property {BaseDeltaPattern} _2011 + * @property {BaseDeltaPattern} _2012 + * @property {BaseDeltaPattern} _2013 + * @property {BaseDeltaPattern} _2014 + * @property {BaseDeltaPattern} _2015 + * @property {BaseDeltaPattern} _2016 + * @property {BaseDeltaPattern} _2017 + * @property {BaseDeltaPattern} _2018 + * @property {BaseDeltaPattern} _2019 + * @property {BaseDeltaPattern} _2020 + * @property {BaseDeltaPattern} _2021 + * @property {BaseDeltaPattern} _2022 + * @property {BaseDeltaPattern} _2023 + * @property {BaseDeltaPattern} _2024 + * @property {BaseDeltaPattern} _2025 + * @property {BaseDeltaPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Entry + * @property {BaseDeltaPattern} discount + * @property {BaseDeltaPattern} premium + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Range + * @property {BaseDeltaPattern} _0sats + * @property {BaseDeltaPattern} _1satTo10sats + * @property {BaseDeltaPattern} _10satsTo100sats + * @property {BaseDeltaPattern} _100satsTo1kSats + * @property {BaseDeltaPattern} _1kSatsTo10kSats + * @property {BaseDeltaPattern} _10kSatsTo100kSats + * @property {BaseDeltaPattern} _100kSatsTo1mSats + * @property {BaseDeltaPattern} _1mSatsTo10mSats + * @property {BaseDeltaPattern} _10mSatsTo1btc + * @property {BaseDeltaPattern} _1btcTo10btc + * @property {BaseDeltaPattern} _10btcTo100btc + * @property {BaseDeltaPattern} _100btcTo1kBtc + * @property {BaseDeltaPattern} _1kBtcTo10kBtc + * @property {BaseDeltaPattern} _10kBtcTo100kBtc + * @property {BaseDeltaPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Under + * @property {BaseDeltaPattern} _10sats + * @property {BaseDeltaPattern} _100sats + * @property {BaseDeltaPattern} _1kSats + * @property {BaseDeltaPattern} _10kSats + * @property {BaseDeltaPattern} _100kSats + * @property {BaseDeltaPattern} _1mSats + * @property {BaseDeltaPattern} _10mSats + * @property {BaseDeltaPattern} _1btc + * @property {BaseDeltaPattern} _10btc + * @property {BaseDeltaPattern} _100btc + * @property {BaseDeltaPattern} _1kBtc + * @property {BaseDeltaPattern} _10kBtc + * @property {BaseDeltaPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Over + * @property {BaseDeltaPattern} _1sat + * @property {BaseDeltaPattern} _10sats + * @property {BaseDeltaPattern} _100sats + * @property {BaseDeltaPattern} _1kSats + * @property {BaseDeltaPattern} _10kSats + * @property {BaseDeltaPattern} _100kSats + * @property {BaseDeltaPattern} _1mSats + * @property {BaseDeltaPattern} _10mSats + * @property {BaseDeltaPattern} _1btc + * @property {BaseDeltaPattern} _10btc + * @property {BaseDeltaPattern} _100btc + * @property {BaseDeltaPattern} _1kBtc + * @property {BaseDeltaPattern} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Term + * @property {BaseDeltaPattern} short + * @property {BaseDeltaPattern} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Type + * @property {BaseDeltaPattern} p2pk65 + * @property {BaseDeltaPattern} p2pk33 + * @property {BaseDeltaPattern} p2pkh + * @property {BaseDeltaPattern} p2ms + * @property {BaseDeltaPattern} p2sh + * @property {BaseDeltaPattern} p2wpkh + * @property {BaseDeltaPattern} p2wsh + * @property {BaseDeltaPattern} p2tr + * @property {BaseDeltaPattern} p2a + * @property {BaseDeltaPattern} unknown + * @property {BaseDeltaPattern} empty + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Over} over + * @property {SeriesPattern18} matrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Range + * @property {BaseDeltaPattern} _0sats + * @property {BaseDeltaPattern} _1satTo10sats + * @property {BaseDeltaPattern} _10satsTo100sats + * @property {BaseDeltaPattern} _100satsTo1kSats + * @property {BaseDeltaPattern} _1kSatsTo10kSats + * @property {BaseDeltaPattern} _10kSatsTo100kSats + * @property {BaseDeltaPattern} _100kSatsTo1mSats + * @property {BaseDeltaPattern} _1mSatsTo10mSats + * @property {BaseDeltaPattern} _10mSatsTo1btc + * @property {BaseDeltaPattern} _1btcTo10btc + * @property {BaseDeltaPattern} _10btcTo100btc + * @property {BaseDeltaPattern} _100btcTo1kBtc + * @property {BaseDeltaPattern} _1kBtcTo10kBtc + * @property {BaseDeltaPattern} _10kBtcTo100kBtc + * @property {BaseDeltaPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Under + * @property {BaseDeltaPattern} _10sats + * @property {BaseDeltaPattern} _100sats + * @property {BaseDeltaPattern} _1kSats + * @property {BaseDeltaPattern} _10kSats + * @property {BaseDeltaPattern} _100kSats + * @property {BaseDeltaPattern} _1mSats + * @property {BaseDeltaPattern} _10mSats + * @property {BaseDeltaPattern} _1btc + * @property {BaseDeltaPattern} _10btc + * @property {BaseDeltaPattern} _100btc + * @property {BaseDeltaPattern} _1kBtc + * @property {BaseDeltaPattern} _10kBtc + * @property {BaseDeltaPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Over + * @property {BaseDeltaPattern} _1sat + * @property {BaseDeltaPattern} _10sats + * @property {BaseDeltaPattern} _100sats + * @property {BaseDeltaPattern} _1kSats + * @property {BaseDeltaPattern} _10kSats + * @property {BaseDeltaPattern} _100kSats + * @property {BaseDeltaPattern} _1mSats + * @property {BaseDeltaPattern} _10mSats + * @property {BaseDeltaPattern} _1btc + * @property {BaseDeltaPattern} _10btc + * @property {BaseDeltaPattern} _100btc + * @property {BaseDeltaPattern} _1kBtc + * @property {BaseDeltaPattern} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount + * @property {AverageBlockCumulativeSumPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Class} class + * @property {DiscountPremiumPattern} entry + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount} utxoAmount + * @property {LongShortPattern} term + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Type} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + * @property {SeriesPattern18} amountRangeMatrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Range + * @property {AverageBlockCumulativeSumPattern} under1h + * @property {AverageBlockCumulativeSumPattern} _1hTo1d + * @property {AverageBlockCumulativeSumPattern} _1dTo1w + * @property {AverageBlockCumulativeSumPattern} _1wTo1m + * @property {AverageBlockCumulativeSumPattern} _1mTo2m + * @property {AverageBlockCumulativeSumPattern} _2mTo3m + * @property {AverageBlockCumulativeSumPattern} _3mTo4m + * @property {AverageBlockCumulativeSumPattern} _4mTo5m + * @property {AverageBlockCumulativeSumPattern} _5mTo6m + * @property {AverageBlockCumulativeSumPattern} _6mTo9m + * @property {AverageBlockCumulativeSumPattern} _9mTo1y + * @property {AverageBlockCumulativeSumPattern} _1yTo18m + * @property {AverageBlockCumulativeSumPattern} _18mTo2y + * @property {AverageBlockCumulativeSumPattern} _2yTo3y + * @property {AverageBlockCumulativeSumPattern} _3yTo4y + * @property {AverageBlockCumulativeSumPattern} _4yTo5y + * @property {AverageBlockCumulativeSumPattern} _5yTo6y + * @property {AverageBlockCumulativeSumPattern} _6yTo7y + * @property {AverageBlockCumulativeSumPattern} _7yTo8y + * @property {AverageBlockCumulativeSumPattern} _8yTo10y + * @property {AverageBlockCumulativeSumPattern} _10yTo12y + * @property {AverageBlockCumulativeSumPattern} _12yTo15y + * @property {AverageBlockCumulativeSumPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Under + * @property {AverageBlockCumulativeSumPattern} _1w + * @property {AverageBlockCumulativeSumPattern} _1m + * @property {AverageBlockCumulativeSumPattern} _2m + * @property {AverageBlockCumulativeSumPattern} _3m + * @property {AverageBlockCumulativeSumPattern} _4m + * @property {AverageBlockCumulativeSumPattern} _5m + * @property {AverageBlockCumulativeSumPattern} _6m + * @property {AverageBlockCumulativeSumPattern} _9m + * @property {AverageBlockCumulativeSumPattern} _1y + * @property {AverageBlockCumulativeSumPattern} _18m + * @property {AverageBlockCumulativeSumPattern} _2y + * @property {AverageBlockCumulativeSumPattern} _3y + * @property {AverageBlockCumulativeSumPattern} _4y + * @property {AverageBlockCumulativeSumPattern} _5y + * @property {AverageBlockCumulativeSumPattern} _6y + * @property {AverageBlockCumulativeSumPattern} _7y + * @property {AverageBlockCumulativeSumPattern} _8y + * @property {AverageBlockCumulativeSumPattern} _10y + * @property {AverageBlockCumulativeSumPattern} _12y + * @property {AverageBlockCumulativeSumPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Over + * @property {AverageBlockCumulativeSumPattern} _1d + * @property {AverageBlockCumulativeSumPattern} _1w + * @property {AverageBlockCumulativeSumPattern} _1m + * @property {AverageBlockCumulativeSumPattern} _2m + * @property {AverageBlockCumulativeSumPattern} _3m + * @property {AverageBlockCumulativeSumPattern} _4m + * @property {AverageBlockCumulativeSumPattern} _5m + * @property {AverageBlockCumulativeSumPattern} _6m + * @property {AverageBlockCumulativeSumPattern} _9m + * @property {AverageBlockCumulativeSumPattern} _1y + * @property {AverageBlockCumulativeSumPattern} _18m + * @property {AverageBlockCumulativeSumPattern} _2y + * @property {AverageBlockCumulativeSumPattern} _3y + * @property {AverageBlockCumulativeSumPattern} _4y + * @property {AverageBlockCumulativeSumPattern} _5y + * @property {AverageBlockCumulativeSumPattern} _6y + * @property {AverageBlockCumulativeSumPattern} _7y + * @property {AverageBlockCumulativeSumPattern} _8y + * @property {AverageBlockCumulativeSumPattern} _10y + * @property {AverageBlockCumulativeSumPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Epoch + * @property {AverageBlockCumulativeSumPattern} _0 + * @property {AverageBlockCumulativeSumPattern} _1 + * @property {AverageBlockCumulativeSumPattern} _2 + * @property {AverageBlockCumulativeSumPattern} _3 + * @property {AverageBlockCumulativeSumPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Class + * @property {AverageBlockCumulativeSumPattern} _2009 + * @property {AverageBlockCumulativeSumPattern} _2010 + * @property {AverageBlockCumulativeSumPattern} _2011 + * @property {AverageBlockCumulativeSumPattern} _2012 + * @property {AverageBlockCumulativeSumPattern} _2013 + * @property {AverageBlockCumulativeSumPattern} _2014 + * @property {AverageBlockCumulativeSumPattern} _2015 + * @property {AverageBlockCumulativeSumPattern} _2016 + * @property {AverageBlockCumulativeSumPattern} _2017 + * @property {AverageBlockCumulativeSumPattern} _2018 + * @property {AverageBlockCumulativeSumPattern} _2019 + * @property {AverageBlockCumulativeSumPattern} _2020 + * @property {AverageBlockCumulativeSumPattern} _2021 + * @property {AverageBlockCumulativeSumPattern} _2022 + * @property {AverageBlockCumulativeSumPattern} _2023 + * @property {AverageBlockCumulativeSumPattern} _2024 + * @property {AverageBlockCumulativeSumPattern} _2025 + * @property {AverageBlockCumulativeSumPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Range + * @property {AverageBlockCumulativeSumPattern} _0sats + * @property {AverageBlockCumulativeSumPattern} _1satTo10sats + * @property {AverageBlockCumulativeSumPattern} _10satsTo100sats + * @property {AverageBlockCumulativeSumPattern} _100satsTo1kSats + * @property {AverageBlockCumulativeSumPattern} _1kSatsTo10kSats + * @property {AverageBlockCumulativeSumPattern} _10kSatsTo100kSats + * @property {AverageBlockCumulativeSumPattern} _100kSatsTo1mSats + * @property {AverageBlockCumulativeSumPattern} _1mSatsTo10mSats + * @property {AverageBlockCumulativeSumPattern} _10mSatsTo1btc + * @property {AverageBlockCumulativeSumPattern} _1btcTo10btc + * @property {AverageBlockCumulativeSumPattern} _10btcTo100btc + * @property {AverageBlockCumulativeSumPattern} _100btcTo1kBtc + * @property {AverageBlockCumulativeSumPattern} _1kBtcTo10kBtc + * @property {AverageBlockCumulativeSumPattern} _10kBtcTo100kBtc + * @property {AverageBlockCumulativeSumPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Under + * @property {AverageBlockCumulativeSumPattern} _10sats + * @property {AverageBlockCumulativeSumPattern} _100sats + * @property {AverageBlockCumulativeSumPattern} _1kSats + * @property {AverageBlockCumulativeSumPattern} _10kSats + * @property {AverageBlockCumulativeSumPattern} _100kSats + * @property {AverageBlockCumulativeSumPattern} _1mSats + * @property {AverageBlockCumulativeSumPattern} _10mSats + * @property {AverageBlockCumulativeSumPattern} _1btc + * @property {AverageBlockCumulativeSumPattern} _10btc + * @property {AverageBlockCumulativeSumPattern} _100btc + * @property {AverageBlockCumulativeSumPattern} _1kBtc + * @property {AverageBlockCumulativeSumPattern} _10kBtc + * @property {AverageBlockCumulativeSumPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Over + * @property {AverageBlockCumulativeSumPattern} _1sat + * @property {AverageBlockCumulativeSumPattern} _10sats + * @property {AverageBlockCumulativeSumPattern} _100sats + * @property {AverageBlockCumulativeSumPattern} _1kSats + * @property {AverageBlockCumulativeSumPattern} _10kSats + * @property {AverageBlockCumulativeSumPattern} _100kSats + * @property {AverageBlockCumulativeSumPattern} _1mSats + * @property {AverageBlockCumulativeSumPattern} _10mSats + * @property {AverageBlockCumulativeSumPattern} _1btc + * @property {AverageBlockCumulativeSumPattern} _10btc + * @property {AverageBlockCumulativeSumPattern} _100btc + * @property {AverageBlockCumulativeSumPattern} _1kBtc + * @property {AverageBlockCumulativeSumPattern} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Type + * @property {AverageBlockCumulativeSumPattern} p2pk65 + * @property {AverageBlockCumulativeSumPattern} p2pk33 + * @property {AverageBlockCumulativeSumPattern} p2pkh + * @property {AverageBlockCumulativeSumPattern} p2ms + * @property {AverageBlockCumulativeSumPattern} p2sh + * @property {AverageBlockCumulativeSumPattern} p2wpkh + * @property {AverageBlockCumulativeSumPattern} p2wsh + * @property {AverageBlockCumulativeSumPattern} p2tr + * @property {AverageBlockCumulativeSumPattern} p2a + * @property {AverageBlockCumulativeSumPattern} unknown + * @property {AverageBlockCumulativeSumPattern} empty + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume} transferVolume + * @property {SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed} coindaysDestroyed + * @property {SeriesTree_Cohorts_Cohorts_Activity_CoinyearsDestroyed} coinyearsDestroyed + * @property {SeriesTree_Cohorts_Cohorts_Activity_Dormancy} dormancy + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume + * @property {AverageBlockCumulativeSumPattern2} all + * @property {OverRangeUnderPattern2} age + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Class} class + * @property {DiscountPremiumPattern2} entry + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_UtxoAmount} utxoAmount + * @property {LongShortPattern2} term + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Type} type + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Cumulative} cumulative + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_AddrBalance} addrBalance + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit} inProfit + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss} inLoss + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Epoch + * @property {AverageBlockCumulativeSumPattern2} _0 + * @property {AverageBlockCumulativeSumPattern2} _1 + * @property {AverageBlockCumulativeSumPattern2} _2 + * @property {AverageBlockCumulativeSumPattern2} _3 + * @property {AverageBlockCumulativeSumPattern2} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Class + * @property {AverageBlockCumulativeSumPattern2} _2009 + * @property {AverageBlockCumulativeSumPattern2} _2010 + * @property {AverageBlockCumulativeSumPattern2} _2011 + * @property {AverageBlockCumulativeSumPattern2} _2012 + * @property {AverageBlockCumulativeSumPattern2} _2013 + * @property {AverageBlockCumulativeSumPattern2} _2014 + * @property {AverageBlockCumulativeSumPattern2} _2015 + * @property {AverageBlockCumulativeSumPattern2} _2016 + * @property {AverageBlockCumulativeSumPattern2} _2017 + * @property {AverageBlockCumulativeSumPattern2} _2018 + * @property {AverageBlockCumulativeSumPattern2} _2019 + * @property {AverageBlockCumulativeSumPattern2} _2020 + * @property {AverageBlockCumulativeSumPattern2} _2021 + * @property {AverageBlockCumulativeSumPattern2} _2022 + * @property {AverageBlockCumulativeSumPattern2} _2023 + * @property {AverageBlockCumulativeSumPattern2} _2024 + * @property {AverageBlockCumulativeSumPattern2} _2025 + * @property {AverageBlockCumulativeSumPattern2} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_UtxoAmount + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern2} under + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Type + * @property {AverageBlockCumulativeSumPattern2} p2pk65 + * @property {AverageBlockCumulativeSumPattern2} p2pk33 + * @property {AverageBlockCumulativeSumPattern2} p2pkh + * @property {AverageBlockCumulativeSumPattern2} p2ms + * @property {AverageBlockCumulativeSumPattern2} p2sh + * @property {AverageBlockCumulativeSumPattern2} p2wpkh + * @property {AverageBlockCumulativeSumPattern2} p2wsh + * @property {AverageBlockCumulativeSumPattern2} p2tr + * @property {AverageBlockCumulativeSumPattern2} p2a + * @property {AverageBlockCumulativeSumPattern2} unknown + * @property {AverageBlockCumulativeSumPattern2} empty + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Cumulative + * @property {CentsSatsPattern} ageRange + * @property {CentsSatsPattern} epoch + * @property {CentsSatsPattern} class + * @property {CentsSatsPattern} entry + * @property {CentsSatsPattern} amountRange + * @property {CentsSatsPattern} type + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_AddrBalance + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern2} under + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2} over + * @property {CentsSatsPattern} values + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit + * @property {AverageBlockCumulativeSumPattern2} all + * @property {OverRangeUnderPattern2} age + * @property {_01234Pattern2} epoch + * @property {_200920102011201220132014201520162017201820192020202120222023202420252026Pattern2} class + * @property {DiscountPremiumPattern2} entry + * @property {LongShortPattern2} term + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit_Cumulative} cumulative + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit_Cumulative + * @property {CentsSatsPattern} ageRange + * @property {CentsSatsPattern} epoch + * @property {CentsSatsPattern} class + * @property {CentsSatsPattern} entry + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss + * @property {AverageBlockCumulativeSumPattern2} all + * @property {OverRangeUnderPattern2} age + * @property {_01234Pattern2} epoch + * @property {_200920102011201220132014201520162017201820192020202120222023202420252026Pattern2} class + * @property {DiscountPremiumPattern2} entry + * @property {LongShortPattern2} term + * @property {SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss_Cumulative} cumulative + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss_Cumulative + * @property {CentsSatsPattern} ageRange + * @property {CentsSatsPattern} epoch + * @property {CentsSatsPattern} class + * @property {CentsSatsPattern} entry + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed + * @property {AverageBlockCumulativeSumPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Class} class + * @property {DiscountPremiumPattern} entry + * @property {LongShortPattern} term + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age + * @property {SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Range + * @property {AverageBlockCumulativeSumPattern} under1h + * @property {AverageBlockCumulativeSumPattern} _1hTo1d + * @property {AverageBlockCumulativeSumPattern} _1dTo1w + * @property {AverageBlockCumulativeSumPattern} _1wTo1m + * @property {AverageBlockCumulativeSumPattern} _1mTo2m + * @property {AverageBlockCumulativeSumPattern} _2mTo3m + * @property {AverageBlockCumulativeSumPattern} _3mTo4m + * @property {AverageBlockCumulativeSumPattern} _4mTo5m + * @property {AverageBlockCumulativeSumPattern} _5mTo6m + * @property {AverageBlockCumulativeSumPattern} _6mTo9m + * @property {AverageBlockCumulativeSumPattern} _9mTo1y + * @property {AverageBlockCumulativeSumPattern} _1yTo18m + * @property {AverageBlockCumulativeSumPattern} _18mTo2y + * @property {AverageBlockCumulativeSumPattern} _2yTo3y + * @property {AverageBlockCumulativeSumPattern} _3yTo4y + * @property {AverageBlockCumulativeSumPattern} _4yTo5y + * @property {AverageBlockCumulativeSumPattern} _5yTo6y + * @property {AverageBlockCumulativeSumPattern} _6yTo7y + * @property {AverageBlockCumulativeSumPattern} _7yTo8y + * @property {AverageBlockCumulativeSumPattern} _8yTo10y + * @property {AverageBlockCumulativeSumPattern} _10yTo12y + * @property {AverageBlockCumulativeSumPattern} _12yTo15y + * @property {AverageBlockCumulativeSumPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Under + * @property {AverageBlockCumulativeSumPattern} _1w + * @property {AverageBlockCumulativeSumPattern} _1m + * @property {AverageBlockCumulativeSumPattern} _2m + * @property {AverageBlockCumulativeSumPattern} _3m + * @property {AverageBlockCumulativeSumPattern} _4m + * @property {AverageBlockCumulativeSumPattern} _5m + * @property {AverageBlockCumulativeSumPattern} _6m + * @property {AverageBlockCumulativeSumPattern} _9m + * @property {AverageBlockCumulativeSumPattern} _1y + * @property {AverageBlockCumulativeSumPattern} _18m + * @property {AverageBlockCumulativeSumPattern} _2y + * @property {AverageBlockCumulativeSumPattern} _3y + * @property {AverageBlockCumulativeSumPattern} _4y + * @property {AverageBlockCumulativeSumPattern} _5y + * @property {AverageBlockCumulativeSumPattern} _6y + * @property {AverageBlockCumulativeSumPattern} _7y + * @property {AverageBlockCumulativeSumPattern} _8y + * @property {AverageBlockCumulativeSumPattern} _10y + * @property {AverageBlockCumulativeSumPattern} _12y + * @property {AverageBlockCumulativeSumPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Over + * @property {AverageBlockCumulativeSumPattern} _1d + * @property {AverageBlockCumulativeSumPattern} _1w + * @property {AverageBlockCumulativeSumPattern} _1m + * @property {AverageBlockCumulativeSumPattern} _2m + * @property {AverageBlockCumulativeSumPattern} _3m + * @property {AverageBlockCumulativeSumPattern} _4m + * @property {AverageBlockCumulativeSumPattern} _5m + * @property {AverageBlockCumulativeSumPattern} _6m + * @property {AverageBlockCumulativeSumPattern} _9m + * @property {AverageBlockCumulativeSumPattern} _1y + * @property {AverageBlockCumulativeSumPattern} _18m + * @property {AverageBlockCumulativeSumPattern} _2y + * @property {AverageBlockCumulativeSumPattern} _3y + * @property {AverageBlockCumulativeSumPattern} _4y + * @property {AverageBlockCumulativeSumPattern} _5y + * @property {AverageBlockCumulativeSumPattern} _6y + * @property {AverageBlockCumulativeSumPattern} _7y + * @property {AverageBlockCumulativeSumPattern} _8y + * @property {AverageBlockCumulativeSumPattern} _10y + * @property {AverageBlockCumulativeSumPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Epoch + * @property {AverageBlockCumulativeSumPattern} _0 + * @property {AverageBlockCumulativeSumPattern} _1 + * @property {AverageBlockCumulativeSumPattern} _2 + * @property {AverageBlockCumulativeSumPattern} _3 + * @property {AverageBlockCumulativeSumPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Class + * @property {AverageBlockCumulativeSumPattern} _2009 + * @property {AverageBlockCumulativeSumPattern} _2010 + * @property {AverageBlockCumulativeSumPattern} _2011 + * @property {AverageBlockCumulativeSumPattern} _2012 + * @property {AverageBlockCumulativeSumPattern} _2013 + * @property {AverageBlockCumulativeSumPattern} _2014 + * @property {AverageBlockCumulativeSumPattern} _2015 + * @property {AverageBlockCumulativeSumPattern} _2016 + * @property {AverageBlockCumulativeSumPattern} _2017 + * @property {AverageBlockCumulativeSumPattern} _2018 + * @property {AverageBlockCumulativeSumPattern} _2019 + * @property {AverageBlockCumulativeSumPattern} _2020 + * @property {AverageBlockCumulativeSumPattern} _2021 + * @property {AverageBlockCumulativeSumPattern} _2022 + * @property {AverageBlockCumulativeSumPattern} _2023 + * @property {AverageBlockCumulativeSumPattern} _2024 + * @property {AverageBlockCumulativeSumPattern} _2025 + * @property {AverageBlockCumulativeSumPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_CoinyearsDestroyed + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Activity_Dormancy + * @property {_1m1w1y24hHeightPattern} all + * @property {_1m1w1y24hHeightPattern} sth + * @property {_1m1w1y24hHeightPattern} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap} cap + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price} price + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit} profit + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss} loss + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl} netPnl + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr} sopr + * @property {SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr} adjustedSopr + * @property {SeriesTree_Cohorts_Cohorts_Realized_GrossPnl} grossPnl + * @property {SeriesTree_Cohorts_Cohorts_Realized_CapitalizedPrice} capitalizedPrice + * @property {MatrixPattern} capRaw + * @property {MatrixPattern} capitalizedCapRaw + * @property {SeriesTree_Cohorts_Cohorts_Realized_PeakRegret} peakRegret + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnlChange1mToRcap} netPnlChange1mToRcap + * @property {SeriesTree_Cohorts_Cohorts_Realized_SellSideRiskRatio} sellSideRiskRatio + * @property {SeriesTree_Cohorts_Cohorts_Realized_SoprRatioExtended} soprRatioExtended + * @property {SeriesTree_Cohorts_Cohorts_Realized_ProfitToLossRatio} profitToLossRatio + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv} mvrv + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap + * @property {CentsDeltaUsdPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_Class} class + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_Entry} entry + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_UtxoAmount} utxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_Term} term + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_Type} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + * @property {SeriesPattern18} amountRangeMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_AddrBalance} addrBalance + * @property {AllLthSthPattern5} toOwnMcap + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_Age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Range + * @property {CentsDeltaUsdPattern} under1h + * @property {CentsDeltaUsdPattern} _1hTo1d + * @property {CentsDeltaUsdPattern} _1dTo1w + * @property {CentsDeltaUsdPattern} _1wTo1m + * @property {CentsDeltaUsdPattern} _1mTo2m + * @property {CentsDeltaUsdPattern} _2mTo3m + * @property {CentsDeltaUsdPattern} _3mTo4m + * @property {CentsDeltaUsdPattern} _4mTo5m + * @property {CentsDeltaUsdPattern} _5mTo6m + * @property {CentsDeltaUsdPattern} _6mTo9m + * @property {CentsDeltaUsdPattern} _9mTo1y + * @property {CentsDeltaUsdPattern} _1yTo18m + * @property {CentsDeltaUsdPattern} _18mTo2y + * @property {CentsDeltaUsdPattern} _2yTo3y + * @property {CentsDeltaUsdPattern} _3yTo4y + * @property {CentsDeltaUsdPattern} _4yTo5y + * @property {CentsDeltaUsdPattern} _5yTo6y + * @property {CentsDeltaUsdPattern} _6yTo7y + * @property {CentsDeltaUsdPattern} _7yTo8y + * @property {CentsDeltaUsdPattern} _8yTo10y + * @property {CentsDeltaUsdPattern} _10yTo12y + * @property {CentsDeltaUsdPattern} _12yTo15y + * @property {CentsDeltaUsdPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Under + * @property {CentsDeltaUsdPattern} _1w + * @property {CentsDeltaUsdPattern} _1m + * @property {CentsDeltaUsdPattern} _2m + * @property {CentsDeltaUsdPattern} _3m + * @property {CentsDeltaUsdPattern} _4m + * @property {CentsDeltaUsdPattern} _5m + * @property {CentsDeltaUsdPattern} _6m + * @property {CentsDeltaUsdPattern} _9m + * @property {CentsDeltaUsdPattern} _1y + * @property {CentsDeltaUsdPattern} _18m + * @property {CentsDeltaUsdPattern} _2y + * @property {CentsDeltaUsdPattern} _3y + * @property {CentsDeltaUsdPattern} _4y + * @property {CentsDeltaUsdPattern} _5y + * @property {CentsDeltaUsdPattern} _6y + * @property {CentsDeltaUsdPattern} _7y + * @property {CentsDeltaUsdPattern} _8y + * @property {CentsDeltaUsdPattern} _10y + * @property {CentsDeltaUsdPattern} _12y + * @property {CentsDeltaUsdPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Over + * @property {CentsDeltaUsdPattern} _1d + * @property {CentsDeltaUsdPattern} _1w + * @property {CentsDeltaUsdPattern} _1m + * @property {CentsDeltaUsdPattern} _2m + * @property {CentsDeltaUsdPattern} _3m + * @property {CentsDeltaUsdPattern} _4m + * @property {CentsDeltaUsdPattern} _5m + * @property {CentsDeltaUsdPattern} _6m + * @property {CentsDeltaUsdPattern} _9m + * @property {CentsDeltaUsdPattern} _1y + * @property {CentsDeltaUsdPattern} _18m + * @property {CentsDeltaUsdPattern} _2y + * @property {CentsDeltaUsdPattern} _3y + * @property {CentsDeltaUsdPattern} _4y + * @property {CentsDeltaUsdPattern} _5y + * @property {CentsDeltaUsdPattern} _6y + * @property {CentsDeltaUsdPattern} _7y + * @property {CentsDeltaUsdPattern} _8y + * @property {CentsDeltaUsdPattern} _10y + * @property {CentsDeltaUsdPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_Epoch + * @property {CentsDeltaUsdPattern} _0 + * @property {CentsDeltaUsdPattern} _1 + * @property {CentsDeltaUsdPattern} _2 + * @property {CentsDeltaUsdPattern} _3 + * @property {CentsDeltaUsdPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_Class + * @property {CentsDeltaUsdPattern} _2009 + * @property {CentsDeltaUsdPattern} _2010 + * @property {CentsDeltaUsdPattern} _2011 + * @property {CentsDeltaUsdPattern} _2012 + * @property {CentsDeltaUsdPattern} _2013 + * @property {CentsDeltaUsdPattern} _2014 + * @property {CentsDeltaUsdPattern} _2015 + * @property {CentsDeltaUsdPattern} _2016 + * @property {CentsDeltaUsdPattern} _2017 + * @property {CentsDeltaUsdPattern} _2018 + * @property {CentsDeltaUsdPattern} _2019 + * @property {CentsDeltaUsdPattern} _2020 + * @property {CentsDeltaUsdPattern} _2021 + * @property {CentsDeltaUsdPattern} _2022 + * @property {CentsDeltaUsdPattern} _2023 + * @property {CentsDeltaUsdPattern} _2024 + * @property {CentsDeltaUsdPattern} _2025 + * @property {CentsDeltaUsdPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_Entry + * @property {CentsDeltaUsdPattern} discount + * @property {CentsDeltaUsdPattern} premium + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_UtxoAmount + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern4} under + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_Term + * @property {CentsDeltaUsdPattern} short + * @property {CentsDeltaUsdPattern} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_Type + * @property {CentsDeltaUsdPattern} p2pk65 + * @property {CentsDeltaUsdPattern} p2pk33 + * @property {CentsDeltaUsdPattern} p2pkh + * @property {CentsDeltaUsdPattern} p2ms + * @property {CentsDeltaUsdPattern} p2sh + * @property {CentsDeltaUsdPattern} p2wpkh + * @property {CentsDeltaUsdPattern} p2wsh + * @property {CentsDeltaUsdPattern} p2tr + * @property {CentsDeltaUsdPattern} p2a + * @property {CentsDeltaUsdPattern} unknown + * @property {CentsDeltaUsdPattern} empty + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Cap_AddrBalance + * @property {_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4} range + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1mPattern4} under + * @property {_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4} over + * @property {SeriesPattern18} matrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price + * @property {CentsPpmRatioSatsUsdPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_Class} class + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_Entry} entry + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount} utxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_Term} term + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_Type} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + * @property {SeriesPattern18} amountRangeMatrix + * @property {SeriesPattern18} aggregateMatrix + * @property {SeriesPattern18} underAgeMatrix + * @property {SeriesPattern18} overAgeMatrix + * @property {SeriesPattern18} underAmountMatrix + * @property {SeriesPattern18} overAmountMatrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_Age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Range + * @property {CentsPpmRatioSatsUsdPattern} under1h + * @property {CentsPpmRatioSatsUsdPattern} _1hTo1d + * @property {CentsPpmRatioSatsUsdPattern} _1dTo1w + * @property {CentsPpmRatioSatsUsdPattern} _1wTo1m + * @property {CentsPpmRatioSatsUsdPattern} _1mTo2m + * @property {CentsPpmRatioSatsUsdPattern} _2mTo3m + * @property {CentsPpmRatioSatsUsdPattern} _3mTo4m + * @property {CentsPpmRatioSatsUsdPattern} _4mTo5m + * @property {CentsPpmRatioSatsUsdPattern} _5mTo6m + * @property {CentsPpmRatioSatsUsdPattern} _6mTo9m + * @property {CentsPpmRatioSatsUsdPattern} _9mTo1y + * @property {CentsPpmRatioSatsUsdPattern} _1yTo18m + * @property {CentsPpmRatioSatsUsdPattern} _18mTo2y + * @property {CentsPpmRatioSatsUsdPattern} _2yTo3y + * @property {CentsPpmRatioSatsUsdPattern} _3yTo4y + * @property {CentsPpmRatioSatsUsdPattern} _4yTo5y + * @property {CentsPpmRatioSatsUsdPattern} _5yTo6y + * @property {CentsPpmRatioSatsUsdPattern} _6yTo7y + * @property {CentsPpmRatioSatsUsdPattern} _7yTo8y + * @property {CentsPpmRatioSatsUsdPattern} _8yTo10y + * @property {CentsPpmRatioSatsUsdPattern} _10yTo12y + * @property {CentsPpmRatioSatsUsdPattern} _12yTo15y + * @property {CentsPpmRatioSatsUsdPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Under + * @property {CentsPpmRatioSatsUsdPattern} _1w + * @property {CentsPpmRatioSatsUsdPattern} _1m + * @property {CentsPpmRatioSatsUsdPattern} _2m + * @property {CentsPpmRatioSatsUsdPattern} _3m + * @property {CentsPpmRatioSatsUsdPattern} _4m + * @property {CentsPpmRatioSatsUsdPattern} _5m + * @property {CentsPpmRatioSatsUsdPattern} _6m + * @property {CentsPpmRatioSatsUsdPattern} _9m + * @property {CentsPpmRatioSatsUsdPattern} _1y + * @property {CentsPpmRatioSatsUsdPattern} _18m + * @property {CentsPpmRatioSatsUsdPattern} _2y + * @property {CentsPpmRatioSatsUsdPattern} _3y + * @property {CentsPpmRatioSatsUsdPattern} _4y + * @property {CentsPpmRatioSatsUsdPattern} _5y + * @property {CentsPpmRatioSatsUsdPattern} _6y + * @property {CentsPpmRatioSatsUsdPattern} _7y + * @property {CentsPpmRatioSatsUsdPattern} _8y + * @property {CentsPpmRatioSatsUsdPattern} _10y + * @property {CentsPpmRatioSatsUsdPattern} _12y + * @property {CentsPpmRatioSatsUsdPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Over + * @property {CentsPpmRatioSatsUsdPattern} _1d + * @property {CentsPpmRatioSatsUsdPattern} _1w + * @property {CentsPpmRatioSatsUsdPattern} _1m + * @property {CentsPpmRatioSatsUsdPattern} _2m + * @property {CentsPpmRatioSatsUsdPattern} _3m + * @property {CentsPpmRatioSatsUsdPattern} _4m + * @property {CentsPpmRatioSatsUsdPattern} _5m + * @property {CentsPpmRatioSatsUsdPattern} _6m + * @property {CentsPpmRatioSatsUsdPattern} _9m + * @property {CentsPpmRatioSatsUsdPattern} _1y + * @property {CentsPpmRatioSatsUsdPattern} _18m + * @property {CentsPpmRatioSatsUsdPattern} _2y + * @property {CentsPpmRatioSatsUsdPattern} _3y + * @property {CentsPpmRatioSatsUsdPattern} _4y + * @property {CentsPpmRatioSatsUsdPattern} _5y + * @property {CentsPpmRatioSatsUsdPattern} _6y + * @property {CentsPpmRatioSatsUsdPattern} _7y + * @property {CentsPpmRatioSatsUsdPattern} _8y + * @property {CentsPpmRatioSatsUsdPattern} _10y + * @property {CentsPpmRatioSatsUsdPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_Epoch + * @property {CentsPpmRatioSatsUsdPattern} _0 + * @property {CentsPpmRatioSatsUsdPattern} _1 + * @property {CentsPpmRatioSatsUsdPattern} _2 + * @property {CentsPpmRatioSatsUsdPattern} _3 + * @property {CentsPpmRatioSatsUsdPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_Class + * @property {CentsPpmRatioSatsUsdPattern} _2009 + * @property {CentsPpmRatioSatsUsdPattern} _2010 + * @property {CentsPpmRatioSatsUsdPattern} _2011 + * @property {CentsPpmRatioSatsUsdPattern} _2012 + * @property {CentsPpmRatioSatsUsdPattern} _2013 + * @property {CentsPpmRatioSatsUsdPattern} _2014 + * @property {CentsPpmRatioSatsUsdPattern} _2015 + * @property {CentsPpmRatioSatsUsdPattern} _2016 + * @property {CentsPpmRatioSatsUsdPattern} _2017 + * @property {CentsPpmRatioSatsUsdPattern} _2018 + * @property {CentsPpmRatioSatsUsdPattern} _2019 + * @property {CentsPpmRatioSatsUsdPattern} _2020 + * @property {CentsPpmRatioSatsUsdPattern} _2021 + * @property {CentsPpmRatioSatsUsdPattern} _2022 + * @property {CentsPpmRatioSatsUsdPattern} _2023 + * @property {CentsPpmRatioSatsUsdPattern} _2024 + * @property {CentsPpmRatioSatsUsdPattern} _2025 + * @property {CentsPpmRatioSatsUsdPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_Entry + * @property {CentsPpmRatioSatsUsdPattern} discount + * @property {CentsPpmRatioSatsUsdPattern} premium + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Range + * @property {CentsPpmRatioSatsUsdPattern} _0sats + * @property {CentsPpmRatioSatsUsdPattern} _1satTo10sats + * @property {CentsPpmRatioSatsUsdPattern} _10satsTo100sats + * @property {CentsPpmRatioSatsUsdPattern} _100satsTo1kSats + * @property {CentsPpmRatioSatsUsdPattern} _1kSatsTo10kSats + * @property {CentsPpmRatioSatsUsdPattern} _10kSatsTo100kSats + * @property {CentsPpmRatioSatsUsdPattern} _100kSatsTo1mSats + * @property {CentsPpmRatioSatsUsdPattern} _1mSatsTo10mSats + * @property {CentsPpmRatioSatsUsdPattern} _10mSatsTo1btc + * @property {CentsPpmRatioSatsUsdPattern} _1btcTo10btc + * @property {CentsPpmRatioSatsUsdPattern} _10btcTo100btc + * @property {CentsPpmRatioSatsUsdPattern} _100btcTo1kBtc + * @property {CentsPpmRatioSatsUsdPattern} _1kBtcTo10kBtc + * @property {CentsPpmRatioSatsUsdPattern} _10kBtcTo100kBtc + * @property {CentsPpmRatioSatsUsdPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Under + * @property {CentsPpmRatioSatsUsdPattern} _10sats + * @property {CentsPpmRatioSatsUsdPattern} _100sats + * @property {CentsPpmRatioSatsUsdPattern} _1kSats + * @property {CentsPpmRatioSatsUsdPattern} _10kSats + * @property {CentsPpmRatioSatsUsdPattern} _100kSats + * @property {CentsPpmRatioSatsUsdPattern} _1mSats + * @property {CentsPpmRatioSatsUsdPattern} _10mSats + * @property {CentsPpmRatioSatsUsdPattern} _1btc + * @property {CentsPpmRatioSatsUsdPattern} _10btc + * @property {CentsPpmRatioSatsUsdPattern} _100btc + * @property {CentsPpmRatioSatsUsdPattern} _1kBtc + * @property {CentsPpmRatioSatsUsdPattern} _10kBtc + * @property {CentsPpmRatioSatsUsdPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Over + * @property {CentsPpmRatioSatsUsdPattern} _1sat + * @property {CentsPpmRatioSatsUsdPattern} _10sats + * @property {CentsPpmRatioSatsUsdPattern} _100sats + * @property {CentsPpmRatioSatsUsdPattern} _1kSats + * @property {CentsPpmRatioSatsUsdPattern} _10kSats + * @property {CentsPpmRatioSatsUsdPattern} _100kSats + * @property {CentsPpmRatioSatsUsdPattern} _1mSats + * @property {CentsPpmRatioSatsUsdPattern} _10mSats + * @property {CentsPpmRatioSatsUsdPattern} _1btc + * @property {CentsPpmRatioSatsUsdPattern} _10btc + * @property {CentsPpmRatioSatsUsdPattern} _100btc + * @property {CentsPpmRatioSatsUsdPattern} _1kBtc + * @property {CentsPpmRatioSatsUsdPattern} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_Term + * @property {CentsPpmRatioSatsUsdPattern} short + * @property {CentsPpmRatioSatsUsdPattern} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Price_Type + * @property {CentsPpmRatioSatsUsdPattern} p2pk65 + * @property {CentsPpmRatioSatsUsdPattern} p2pk33 + * @property {CentsPpmRatioSatsUsdPattern} p2pkh + * @property {CentsPpmRatioSatsUsdPattern} p2ms + * @property {CentsPpmRatioSatsUsdPattern} p2sh + * @property {CentsPpmRatioSatsUsdPattern} p2wpkh + * @property {CentsPpmRatioSatsUsdPattern} p2wsh + * @property {CentsPpmRatioSatsUsdPattern} p2tr + * @property {CentsPpmRatioSatsUsdPattern} p2a + * @property {CentsPpmRatioSatsUsdPattern} unknown + * @property {CentsPpmRatioSatsUsdPattern} empty + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit + * @property {BlockCumulativeSumPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_Class} class + * @property {DiscountPremiumPattern5} entry + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount} utxoAmount + * @property {LongShortPattern6} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + * @property {SeriesPattern18} amountRangeMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance} addrBalance + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_Age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Range + * @property {BlockCumulativeSumPattern} under1h + * @property {BlockCumulativeSumPattern} _1hTo1d + * @property {BlockCumulativeSumPattern} _1dTo1w + * @property {BlockCumulativeSumPattern} _1wTo1m + * @property {BlockCumulativeSumPattern} _1mTo2m + * @property {BlockCumulativeSumPattern} _2mTo3m + * @property {BlockCumulativeSumPattern} _3mTo4m + * @property {BlockCumulativeSumPattern} _4mTo5m + * @property {BlockCumulativeSumPattern} _5mTo6m + * @property {BlockCumulativeSumPattern} _6mTo9m + * @property {BlockCumulativeSumPattern} _9mTo1y + * @property {BlockCumulativeSumPattern} _1yTo18m + * @property {BlockCumulativeSumPattern} _18mTo2y + * @property {BlockCumulativeSumPattern} _2yTo3y + * @property {BlockCumulativeSumPattern} _3yTo4y + * @property {BlockCumulativeSumPattern} _4yTo5y + * @property {BlockCumulativeSumPattern} _5yTo6y + * @property {BlockCumulativeSumPattern} _6yTo7y + * @property {BlockCumulativeSumPattern} _7yTo8y + * @property {BlockCumulativeSumPattern} _8yTo10y + * @property {BlockCumulativeSumPattern} _10yTo12y + * @property {BlockCumulativeSumPattern} _12yTo15y + * @property {BlockCumulativeSumPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Under + * @property {BlockCumulativeSumPattern} _1w + * @property {BlockCumulativeSumPattern} _1m + * @property {BlockCumulativeSumPattern} _2m + * @property {BlockCumulativeSumPattern} _3m + * @property {BlockCumulativeSumPattern} _4m + * @property {BlockCumulativeSumPattern} _5m + * @property {BlockCumulativeSumPattern} _6m + * @property {BlockCumulativeSumPattern} _9m + * @property {BlockCumulativeSumPattern} _1y + * @property {BlockCumulativeSumPattern} _18m + * @property {BlockCumulativeSumPattern} _2y + * @property {BlockCumulativeSumPattern} _3y + * @property {BlockCumulativeSumPattern} _4y + * @property {BlockCumulativeSumPattern} _5y + * @property {BlockCumulativeSumPattern} _6y + * @property {BlockCumulativeSumPattern} _7y + * @property {BlockCumulativeSumPattern} _8y + * @property {BlockCumulativeSumPattern} _10y + * @property {BlockCumulativeSumPattern} _12y + * @property {BlockCumulativeSumPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Over + * @property {BlockCumulativeSumPattern} _1d + * @property {BlockCumulativeSumPattern} _1w + * @property {BlockCumulativeSumPattern} _1m + * @property {BlockCumulativeSumPattern} _2m + * @property {BlockCumulativeSumPattern} _3m + * @property {BlockCumulativeSumPattern} _4m + * @property {BlockCumulativeSumPattern} _5m + * @property {BlockCumulativeSumPattern} _6m + * @property {BlockCumulativeSumPattern} _9m + * @property {BlockCumulativeSumPattern} _1y + * @property {BlockCumulativeSumPattern} _18m + * @property {BlockCumulativeSumPattern} _2y + * @property {BlockCumulativeSumPattern} _3y + * @property {BlockCumulativeSumPattern} _4y + * @property {BlockCumulativeSumPattern} _5y + * @property {BlockCumulativeSumPattern} _6y + * @property {BlockCumulativeSumPattern} _7y + * @property {BlockCumulativeSumPattern} _8y + * @property {BlockCumulativeSumPattern} _10y + * @property {BlockCumulativeSumPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_Epoch + * @property {BlockCumulativeSumPattern} _0 + * @property {BlockCumulativeSumPattern} _1 + * @property {BlockCumulativeSumPattern} _2 + * @property {BlockCumulativeSumPattern} _3 + * @property {BlockCumulativeSumPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_Class + * @property {BlockCumulativeSumPattern} _2009 + * @property {BlockCumulativeSumPattern} _2010 + * @property {BlockCumulativeSumPattern} _2011 + * @property {BlockCumulativeSumPattern} _2012 + * @property {BlockCumulativeSumPattern} _2013 + * @property {BlockCumulativeSumPattern} _2014 + * @property {BlockCumulativeSumPattern} _2015 + * @property {BlockCumulativeSumPattern} _2016 + * @property {BlockCumulativeSumPattern} _2017 + * @property {BlockCumulativeSumPattern} _2018 + * @property {BlockCumulativeSumPattern} _2019 + * @property {BlockCumulativeSumPattern} _2020 + * @property {BlockCumulativeSumPattern} _2021 + * @property {BlockCumulativeSumPattern} _2022 + * @property {BlockCumulativeSumPattern} _2023 + * @property {BlockCumulativeSumPattern} _2024 + * @property {BlockCumulativeSumPattern} _2025 + * @property {BlockCumulativeSumPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Range + * @property {BlockCumulativeSumPattern} _0sats + * @property {BlockCumulativeSumPattern} _1satTo10sats + * @property {BlockCumulativeSumPattern} _10satsTo100sats + * @property {BlockCumulativeSumPattern} _100satsTo1kSats + * @property {BlockCumulativeSumPattern} _1kSatsTo10kSats + * @property {BlockCumulativeSumPattern} _10kSatsTo100kSats + * @property {BlockCumulativeSumPattern} _100kSatsTo1mSats + * @property {BlockCumulativeSumPattern} _1mSatsTo10mSats + * @property {BlockCumulativeSumPattern} _10mSatsTo1btc + * @property {BlockCumulativeSumPattern} _1btcTo10btc + * @property {BlockCumulativeSumPattern} _10btcTo100btc + * @property {BlockCumulativeSumPattern} _100btcTo1kBtc + * @property {BlockCumulativeSumPattern} _1kBtcTo10kBtc + * @property {BlockCumulativeSumPattern} _10kBtcTo100kBtc + * @property {BlockCumulativeSumPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Under + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _1mSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _10kBtc + * @property {BlockCumulativeSumPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Over + * @property {BlockCumulativeSumPattern} _1sat + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _1mSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Over} over + * @property {SeriesPattern18} matrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Range + * @property {BlockCumulativeSumPattern} _0sats + * @property {BlockCumulativeSumPattern} _1satTo10sats + * @property {BlockCumulativeSumPattern} _10satsTo100sats + * @property {BlockCumulativeSumPattern} _100satsTo1kSats + * @property {BlockCumulativeSumPattern} _1kSatsTo10kSats + * @property {BlockCumulativeSumPattern} _10kSatsTo100kSats + * @property {BlockCumulativeSumPattern} _100kSatsTo1mSats + * @property {BlockCumulativeSumPattern} _1mSatsTo10mSats + * @property {BlockCumulativeSumPattern} _10mSatsTo1btc + * @property {BlockCumulativeSumPattern} _1btcTo10btc + * @property {BlockCumulativeSumPattern} _10btcTo100btc + * @property {BlockCumulativeSumPattern} _100btcTo1kBtc + * @property {BlockCumulativeSumPattern} _1kBtcTo10kBtc + * @property {BlockCumulativeSumPattern} _10kBtcTo100kBtc + * @property {BlockCumulativeSumPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Under + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _1mSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _10kBtc + * @property {BlockCumulativeSumPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Over + * @property {BlockCumulativeSumPattern} _1sat + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _1mSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss + * @property {BlockCumulativeSumPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Class} class + * @property {DiscountPremiumPattern5} entry + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount} utxoAmount + * @property {LongShortPattern6} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + * @property {SeriesPattern18} amountRangeMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance} addrBalance + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative} negative + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Range + * @property {BlockCumulativeSumPattern} under1h + * @property {BlockCumulativeSumPattern} _1hTo1d + * @property {BlockCumulativeSumPattern} _1dTo1w + * @property {BlockCumulativeSumPattern} _1wTo1m + * @property {BlockCumulativeSumPattern} _1mTo2m + * @property {BlockCumulativeSumPattern} _2mTo3m + * @property {BlockCumulativeSumPattern} _3mTo4m + * @property {BlockCumulativeSumPattern} _4mTo5m + * @property {BlockCumulativeSumPattern} _5mTo6m + * @property {BlockCumulativeSumPattern} _6mTo9m + * @property {BlockCumulativeSumPattern} _9mTo1y + * @property {BlockCumulativeSumPattern} _1yTo18m + * @property {BlockCumulativeSumPattern} _18mTo2y + * @property {BlockCumulativeSumPattern} _2yTo3y + * @property {BlockCumulativeSumPattern} _3yTo4y + * @property {BlockCumulativeSumPattern} _4yTo5y + * @property {BlockCumulativeSumPattern} _5yTo6y + * @property {BlockCumulativeSumPattern} _6yTo7y + * @property {BlockCumulativeSumPattern} _7yTo8y + * @property {BlockCumulativeSumPattern} _8yTo10y + * @property {BlockCumulativeSumPattern} _10yTo12y + * @property {BlockCumulativeSumPattern} _12yTo15y + * @property {BlockCumulativeSumPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Under + * @property {BlockCumulativeSumPattern} _1w + * @property {BlockCumulativeSumPattern} _1m + * @property {BlockCumulativeSumPattern} _2m + * @property {BlockCumulativeSumPattern} _3m + * @property {BlockCumulativeSumPattern} _4m + * @property {BlockCumulativeSumPattern} _5m + * @property {BlockCumulativeSumPattern} _6m + * @property {BlockCumulativeSumPattern} _9m + * @property {BlockCumulativeSumPattern} _1y + * @property {BlockCumulativeSumPattern} _18m + * @property {BlockCumulativeSumPattern} _2y + * @property {BlockCumulativeSumPattern} _3y + * @property {BlockCumulativeSumPattern} _4y + * @property {BlockCumulativeSumPattern} _5y + * @property {BlockCumulativeSumPattern} _6y + * @property {BlockCumulativeSumPattern} _7y + * @property {BlockCumulativeSumPattern} _8y + * @property {BlockCumulativeSumPattern} _10y + * @property {BlockCumulativeSumPattern} _12y + * @property {BlockCumulativeSumPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Over + * @property {BlockCumulativeSumPattern} _1d + * @property {BlockCumulativeSumPattern} _1w + * @property {BlockCumulativeSumPattern} _1m + * @property {BlockCumulativeSumPattern} _2m + * @property {BlockCumulativeSumPattern} _3m + * @property {BlockCumulativeSumPattern} _4m + * @property {BlockCumulativeSumPattern} _5m + * @property {BlockCumulativeSumPattern} _6m + * @property {BlockCumulativeSumPattern} _9m + * @property {BlockCumulativeSumPattern} _1y + * @property {BlockCumulativeSumPattern} _18m + * @property {BlockCumulativeSumPattern} _2y + * @property {BlockCumulativeSumPattern} _3y + * @property {BlockCumulativeSumPattern} _4y + * @property {BlockCumulativeSumPattern} _5y + * @property {BlockCumulativeSumPattern} _6y + * @property {BlockCumulativeSumPattern} _7y + * @property {BlockCumulativeSumPattern} _8y + * @property {BlockCumulativeSumPattern} _10y + * @property {BlockCumulativeSumPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Epoch + * @property {BlockCumulativeSumPattern} _0 + * @property {BlockCumulativeSumPattern} _1 + * @property {BlockCumulativeSumPattern} _2 + * @property {BlockCumulativeSumPattern} _3 + * @property {BlockCumulativeSumPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Class + * @property {BlockCumulativeSumPattern} _2009 + * @property {BlockCumulativeSumPattern} _2010 + * @property {BlockCumulativeSumPattern} _2011 + * @property {BlockCumulativeSumPattern} _2012 + * @property {BlockCumulativeSumPattern} _2013 + * @property {BlockCumulativeSumPattern} _2014 + * @property {BlockCumulativeSumPattern} _2015 + * @property {BlockCumulativeSumPattern} _2016 + * @property {BlockCumulativeSumPattern} _2017 + * @property {BlockCumulativeSumPattern} _2018 + * @property {BlockCumulativeSumPattern} _2019 + * @property {BlockCumulativeSumPattern} _2020 + * @property {BlockCumulativeSumPattern} _2021 + * @property {BlockCumulativeSumPattern} _2022 + * @property {BlockCumulativeSumPattern} _2023 + * @property {BlockCumulativeSumPattern} _2024 + * @property {BlockCumulativeSumPattern} _2025 + * @property {BlockCumulativeSumPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Range + * @property {BlockCumulativeSumPattern} _0sats + * @property {BlockCumulativeSumPattern} _1satTo10sats + * @property {BlockCumulativeSumPattern} _10satsTo100sats + * @property {BlockCumulativeSumPattern} _100satsTo1kSats + * @property {BlockCumulativeSumPattern} _1kSatsTo10kSats + * @property {BlockCumulativeSumPattern} _10kSatsTo100kSats + * @property {BlockCumulativeSumPattern} _100kSatsTo1mSats + * @property {BlockCumulativeSumPattern} _1mSatsTo10mSats + * @property {BlockCumulativeSumPattern} _10mSatsTo1btc + * @property {BlockCumulativeSumPattern} _1btcTo10btc + * @property {BlockCumulativeSumPattern} _10btcTo100btc + * @property {BlockCumulativeSumPattern} _100btcTo1kBtc + * @property {BlockCumulativeSumPattern} _1kBtcTo10kBtc + * @property {BlockCumulativeSumPattern} _10kBtcTo100kBtc + * @property {BlockCumulativeSumPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Under + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _1mSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _10kBtc + * @property {BlockCumulativeSumPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Over + * @property {BlockCumulativeSumPattern} _1sat + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _1mSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Over} over + * @property {SeriesPattern18} matrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Range + * @property {BlockCumulativeSumPattern} _0sats + * @property {BlockCumulativeSumPattern} _1satTo10sats + * @property {BlockCumulativeSumPattern} _10satsTo100sats + * @property {BlockCumulativeSumPattern} _100satsTo1kSats + * @property {BlockCumulativeSumPattern} _1kSatsTo10kSats + * @property {BlockCumulativeSumPattern} _10kSatsTo100kSats + * @property {BlockCumulativeSumPattern} _100kSatsTo1mSats + * @property {BlockCumulativeSumPattern} _1mSatsTo10mSats + * @property {BlockCumulativeSumPattern} _10mSatsTo1btc + * @property {BlockCumulativeSumPattern} _1btcTo10btc + * @property {BlockCumulativeSumPattern} _10btcTo100btc + * @property {BlockCumulativeSumPattern} _100btcTo1kBtc + * @property {BlockCumulativeSumPattern} _1kBtcTo10kBtc + * @property {BlockCumulativeSumPattern} _10kBtcTo100kBtc + * @property {BlockCumulativeSumPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Under + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _1mSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _10kBtc + * @property {BlockCumulativeSumPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Over + * @property {BlockCumulativeSumPattern} _1sat + * @property {BlockCumulativeSumPattern} _10sats + * @property {BlockCumulativeSumPattern} _100sats + * @property {BlockCumulativeSumPattern} _1kSats + * @property {BlockCumulativeSumPattern} _10kSats + * @property {BlockCumulativeSumPattern} _100kSats + * @property {BlockCumulativeSumPattern} _1mSats + * @property {BlockCumulativeSumPattern} _10mSats + * @property {BlockCumulativeSumPattern} _1btc + * @property {BlockCumulativeSumPattern} _10btc + * @property {BlockCumulativeSumPattern} _100btc + * @property {BlockCumulativeSumPattern} _1kBtc + * @property {BlockCumulativeSumPattern} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative + * @property {BaseSumPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Class} class + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Entry} entry + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Term} term + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Range + * @property {BaseSumPattern} under1h + * @property {BaseSumPattern} _1hTo1d + * @property {BaseSumPattern} _1dTo1w + * @property {BaseSumPattern} _1wTo1m + * @property {BaseSumPattern} _1mTo2m + * @property {BaseSumPattern} _2mTo3m + * @property {BaseSumPattern} _3mTo4m + * @property {BaseSumPattern} _4mTo5m + * @property {BaseSumPattern} _5mTo6m + * @property {BaseSumPattern} _6mTo9m + * @property {BaseSumPattern} _9mTo1y + * @property {BaseSumPattern} _1yTo18m + * @property {BaseSumPattern} _18mTo2y + * @property {BaseSumPattern} _2yTo3y + * @property {BaseSumPattern} _3yTo4y + * @property {BaseSumPattern} _4yTo5y + * @property {BaseSumPattern} _5yTo6y + * @property {BaseSumPattern} _6yTo7y + * @property {BaseSumPattern} _7yTo8y + * @property {BaseSumPattern} _8yTo10y + * @property {BaseSumPattern} _10yTo12y + * @property {BaseSumPattern} _12yTo15y + * @property {BaseSumPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Under + * @property {BaseSumPattern} _1w + * @property {BaseSumPattern} _1m + * @property {BaseSumPattern} _2m + * @property {BaseSumPattern} _3m + * @property {BaseSumPattern} _4m + * @property {BaseSumPattern} _5m + * @property {BaseSumPattern} _6m + * @property {BaseSumPattern} _9m + * @property {BaseSumPattern} _1y + * @property {BaseSumPattern} _18m + * @property {BaseSumPattern} _2y + * @property {BaseSumPattern} _3y + * @property {BaseSumPattern} _4y + * @property {BaseSumPattern} _5y + * @property {BaseSumPattern} _6y + * @property {BaseSumPattern} _7y + * @property {BaseSumPattern} _8y + * @property {BaseSumPattern} _10y + * @property {BaseSumPattern} _12y + * @property {BaseSumPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Over + * @property {BaseSumPattern} _1d + * @property {BaseSumPattern} _1w + * @property {BaseSumPattern} _1m + * @property {BaseSumPattern} _2m + * @property {BaseSumPattern} _3m + * @property {BaseSumPattern} _4m + * @property {BaseSumPattern} _5m + * @property {BaseSumPattern} _6m + * @property {BaseSumPattern} _9m + * @property {BaseSumPattern} _1y + * @property {BaseSumPattern} _18m + * @property {BaseSumPattern} _2y + * @property {BaseSumPattern} _3y + * @property {BaseSumPattern} _4y + * @property {BaseSumPattern} _5y + * @property {BaseSumPattern} _6y + * @property {BaseSumPattern} _7y + * @property {BaseSumPattern} _8y + * @property {BaseSumPattern} _10y + * @property {BaseSumPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Epoch + * @property {BaseSumPattern} _0 + * @property {BaseSumPattern} _1 + * @property {BaseSumPattern} _2 + * @property {BaseSumPattern} _3 + * @property {BaseSumPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Class + * @property {BaseSumPattern} _2009 + * @property {BaseSumPattern} _2010 + * @property {BaseSumPattern} _2011 + * @property {BaseSumPattern} _2012 + * @property {BaseSumPattern} _2013 + * @property {BaseSumPattern} _2014 + * @property {BaseSumPattern} _2015 + * @property {BaseSumPattern} _2016 + * @property {BaseSumPattern} _2017 + * @property {BaseSumPattern} _2018 + * @property {BaseSumPattern} _2019 + * @property {BaseSumPattern} _2020 + * @property {BaseSumPattern} _2021 + * @property {BaseSumPattern} _2022 + * @property {BaseSumPattern} _2023 + * @property {BaseSumPattern} _2024 + * @property {BaseSumPattern} _2025 + * @property {BaseSumPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Entry + * @property {BaseSumPattern} discount + * @property {BaseSumPattern} premium + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Term + * @property {BaseSumPattern} short + * @property {BaseSumPattern} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl + * @property {BlockCumulativeDeltaSumPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Class} class + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Entry} entry + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Term} term + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m} change1m + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Range + * @property {BlockCumulativeDeltaSumPattern} under1h + * @property {BlockCumulativeDeltaSumPattern} _1hTo1d + * @property {BlockCumulativeDeltaSumPattern} _1dTo1w + * @property {BlockCumulativeDeltaSumPattern} _1wTo1m + * @property {BlockCumulativeDeltaSumPattern} _1mTo2m + * @property {BlockCumulativeDeltaSumPattern} _2mTo3m + * @property {BlockCumulativeDeltaSumPattern} _3mTo4m + * @property {BlockCumulativeDeltaSumPattern} _4mTo5m + * @property {BlockCumulativeDeltaSumPattern} _5mTo6m + * @property {BlockCumulativeDeltaSumPattern} _6mTo9m + * @property {BlockCumulativeDeltaSumPattern} _9mTo1y + * @property {BlockCumulativeDeltaSumPattern} _1yTo18m + * @property {BlockCumulativeDeltaSumPattern} _18mTo2y + * @property {BlockCumulativeDeltaSumPattern} _2yTo3y + * @property {BlockCumulativeDeltaSumPattern} _3yTo4y + * @property {BlockCumulativeDeltaSumPattern} _4yTo5y + * @property {BlockCumulativeDeltaSumPattern} _5yTo6y + * @property {BlockCumulativeDeltaSumPattern} _6yTo7y + * @property {BlockCumulativeDeltaSumPattern} _7yTo8y + * @property {BlockCumulativeDeltaSumPattern} _8yTo10y + * @property {BlockCumulativeDeltaSumPattern} _10yTo12y + * @property {BlockCumulativeDeltaSumPattern} _12yTo15y + * @property {BlockCumulativeDeltaSumPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Under + * @property {BlockCumulativeDeltaSumPattern} _1w + * @property {BlockCumulativeDeltaSumPattern} _1m + * @property {BlockCumulativeDeltaSumPattern} _2m + * @property {BlockCumulativeDeltaSumPattern} _3m + * @property {BlockCumulativeDeltaSumPattern} _4m + * @property {BlockCumulativeDeltaSumPattern} _5m + * @property {BlockCumulativeDeltaSumPattern} _6m + * @property {BlockCumulativeDeltaSumPattern} _9m + * @property {BlockCumulativeDeltaSumPattern} _1y + * @property {BlockCumulativeDeltaSumPattern} _18m + * @property {BlockCumulativeDeltaSumPattern} _2y + * @property {BlockCumulativeDeltaSumPattern} _3y + * @property {BlockCumulativeDeltaSumPattern} _4y + * @property {BlockCumulativeDeltaSumPattern} _5y + * @property {BlockCumulativeDeltaSumPattern} _6y + * @property {BlockCumulativeDeltaSumPattern} _7y + * @property {BlockCumulativeDeltaSumPattern} _8y + * @property {BlockCumulativeDeltaSumPattern} _10y + * @property {BlockCumulativeDeltaSumPattern} _12y + * @property {BlockCumulativeDeltaSumPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Over + * @property {BlockCumulativeDeltaSumPattern} _1d + * @property {BlockCumulativeDeltaSumPattern} _1w + * @property {BlockCumulativeDeltaSumPattern} _1m + * @property {BlockCumulativeDeltaSumPattern} _2m + * @property {BlockCumulativeDeltaSumPattern} _3m + * @property {BlockCumulativeDeltaSumPattern} _4m + * @property {BlockCumulativeDeltaSumPattern} _5m + * @property {BlockCumulativeDeltaSumPattern} _6m + * @property {BlockCumulativeDeltaSumPattern} _9m + * @property {BlockCumulativeDeltaSumPattern} _1y + * @property {BlockCumulativeDeltaSumPattern} _18m + * @property {BlockCumulativeDeltaSumPattern} _2y + * @property {BlockCumulativeDeltaSumPattern} _3y + * @property {BlockCumulativeDeltaSumPattern} _4y + * @property {BlockCumulativeDeltaSumPattern} _5y + * @property {BlockCumulativeDeltaSumPattern} _6y + * @property {BlockCumulativeDeltaSumPattern} _7y + * @property {BlockCumulativeDeltaSumPattern} _8y + * @property {BlockCumulativeDeltaSumPattern} _10y + * @property {BlockCumulativeDeltaSumPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Epoch + * @property {BlockCumulativeDeltaSumPattern} _0 + * @property {BlockCumulativeDeltaSumPattern} _1 + * @property {BlockCumulativeDeltaSumPattern} _2 + * @property {BlockCumulativeDeltaSumPattern} _3 + * @property {BlockCumulativeDeltaSumPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Class + * @property {BlockCumulativeDeltaSumPattern} _2009 + * @property {BlockCumulativeDeltaSumPattern} _2010 + * @property {BlockCumulativeDeltaSumPattern} _2011 + * @property {BlockCumulativeDeltaSumPattern} _2012 + * @property {BlockCumulativeDeltaSumPattern} _2013 + * @property {BlockCumulativeDeltaSumPattern} _2014 + * @property {BlockCumulativeDeltaSumPattern} _2015 + * @property {BlockCumulativeDeltaSumPattern} _2016 + * @property {BlockCumulativeDeltaSumPattern} _2017 + * @property {BlockCumulativeDeltaSumPattern} _2018 + * @property {BlockCumulativeDeltaSumPattern} _2019 + * @property {BlockCumulativeDeltaSumPattern} _2020 + * @property {BlockCumulativeDeltaSumPattern} _2021 + * @property {BlockCumulativeDeltaSumPattern} _2022 + * @property {BlockCumulativeDeltaSumPattern} _2023 + * @property {BlockCumulativeDeltaSumPattern} _2024 + * @property {BlockCumulativeDeltaSumPattern} _2025 + * @property {BlockCumulativeDeltaSumPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Entry + * @property {BlockCumulativeDeltaSumPattern} discount + * @property {BlockCumulativeDeltaSumPattern} premium + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Term + * @property {BlockCumulativeDeltaSumPattern} short + * @property {BlockCumulativeDeltaSumPattern} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m + * @property {SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m_ToMcap} toMcap + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m_ToMcap + * @property {PercentPpmRatioPattern} all + * @property {PercentPpmRatioPattern} sth + * @property {PercentPpmRatioPattern} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed} valueDestroyed + * @property {SeriesPattern1} all + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_Class} class + * @property {DiscountPremiumPattern7} entry + * @property {LongShortPattern7} term + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_AggregateMatrix} aggregateMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_AgeRangeMatrix} ageRangeMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_UnderAgeMatrix} underAgeMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_OverAgeMatrix} overAgeMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_EpochMatrix} epochMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_ClassMatrix} classMatrix + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_EntryMatrix} entryMatrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed + * @property {BlockCumulativeSumPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Class} class + * @property {DiscountPremiumPattern5} entry + * @property {LongShortPattern6} term + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Range + * @property {BlockCumulativeSumPattern} under1h + * @property {BlockCumulativeSumPattern} _1hTo1d + * @property {BlockCumulativeSumPattern} _1dTo1w + * @property {BlockCumulativeSumPattern} _1wTo1m + * @property {BlockCumulativeSumPattern} _1mTo2m + * @property {BlockCumulativeSumPattern} _2mTo3m + * @property {BlockCumulativeSumPattern} _3mTo4m + * @property {BlockCumulativeSumPattern} _4mTo5m + * @property {BlockCumulativeSumPattern} _5mTo6m + * @property {BlockCumulativeSumPattern} _6mTo9m + * @property {BlockCumulativeSumPattern} _9mTo1y + * @property {BlockCumulativeSumPattern} _1yTo18m + * @property {BlockCumulativeSumPattern} _18mTo2y + * @property {BlockCumulativeSumPattern} _2yTo3y + * @property {BlockCumulativeSumPattern} _3yTo4y + * @property {BlockCumulativeSumPattern} _4yTo5y + * @property {BlockCumulativeSumPattern} _5yTo6y + * @property {BlockCumulativeSumPattern} _6yTo7y + * @property {BlockCumulativeSumPattern} _7yTo8y + * @property {BlockCumulativeSumPattern} _8yTo10y + * @property {BlockCumulativeSumPattern} _10yTo12y + * @property {BlockCumulativeSumPattern} _12yTo15y + * @property {BlockCumulativeSumPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Under + * @property {BlockCumulativeSumPattern} _1w + * @property {BlockCumulativeSumPattern} _1m + * @property {BlockCumulativeSumPattern} _2m + * @property {BlockCumulativeSumPattern} _3m + * @property {BlockCumulativeSumPattern} _4m + * @property {BlockCumulativeSumPattern} _5m + * @property {BlockCumulativeSumPattern} _6m + * @property {BlockCumulativeSumPattern} _9m + * @property {BlockCumulativeSumPattern} _1y + * @property {BlockCumulativeSumPattern} _18m + * @property {BlockCumulativeSumPattern} _2y + * @property {BlockCumulativeSumPattern} _3y + * @property {BlockCumulativeSumPattern} _4y + * @property {BlockCumulativeSumPattern} _5y + * @property {BlockCumulativeSumPattern} _6y + * @property {BlockCumulativeSumPattern} _7y + * @property {BlockCumulativeSumPattern} _8y + * @property {BlockCumulativeSumPattern} _10y + * @property {BlockCumulativeSumPattern} _12y + * @property {BlockCumulativeSumPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Over + * @property {BlockCumulativeSumPattern} _1d + * @property {BlockCumulativeSumPattern} _1w + * @property {BlockCumulativeSumPattern} _1m + * @property {BlockCumulativeSumPattern} _2m + * @property {BlockCumulativeSumPattern} _3m + * @property {BlockCumulativeSumPattern} _4m + * @property {BlockCumulativeSumPattern} _5m + * @property {BlockCumulativeSumPattern} _6m + * @property {BlockCumulativeSumPattern} _9m + * @property {BlockCumulativeSumPattern} _1y + * @property {BlockCumulativeSumPattern} _18m + * @property {BlockCumulativeSumPattern} _2y + * @property {BlockCumulativeSumPattern} _3y + * @property {BlockCumulativeSumPattern} _4y + * @property {BlockCumulativeSumPattern} _5y + * @property {BlockCumulativeSumPattern} _6y + * @property {BlockCumulativeSumPattern} _7y + * @property {BlockCumulativeSumPattern} _8y + * @property {BlockCumulativeSumPattern} _10y + * @property {BlockCumulativeSumPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Epoch + * @property {BlockCumulativeSumPattern} _0 + * @property {BlockCumulativeSumPattern} _1 + * @property {BlockCumulativeSumPattern} _2 + * @property {BlockCumulativeSumPattern} _3 + * @property {BlockCumulativeSumPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Class + * @property {BlockCumulativeSumPattern} _2009 + * @property {BlockCumulativeSumPattern} _2010 + * @property {BlockCumulativeSumPattern} _2011 + * @property {BlockCumulativeSumPattern} _2012 + * @property {BlockCumulativeSumPattern} _2013 + * @property {BlockCumulativeSumPattern} _2014 + * @property {BlockCumulativeSumPattern} _2015 + * @property {BlockCumulativeSumPattern} _2016 + * @property {BlockCumulativeSumPattern} _2017 + * @property {BlockCumulativeSumPattern} _2018 + * @property {BlockCumulativeSumPattern} _2019 + * @property {BlockCumulativeSumPattern} _2020 + * @property {BlockCumulativeSumPattern} _2021 + * @property {BlockCumulativeSumPattern} _2022 + * @property {BlockCumulativeSumPattern} _2023 + * @property {BlockCumulativeSumPattern} _2024 + * @property {BlockCumulativeSumPattern} _2025 + * @property {BlockCumulativeSumPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Range + * @property {SeriesPattern1} under1h + * @property {SeriesPattern1} _1hTo1d + * @property {SeriesPattern1} _1dTo1w + * @property {SeriesPattern1} _1wTo1m + * @property {SeriesPattern1} _1mTo2m + * @property {SeriesPattern1} _2mTo3m + * @property {SeriesPattern1} _3mTo4m + * @property {SeriesPattern1} _4mTo5m + * @property {SeriesPattern1} _5mTo6m + * @property {SeriesPattern1} _6mTo9m + * @property {SeriesPattern1} _9mTo1y + * @property {SeriesPattern1} _1yTo18m + * @property {SeriesPattern1} _18mTo2y + * @property {SeriesPattern1} _2yTo3y + * @property {SeriesPattern1} _3yTo4y + * @property {SeriesPattern1} _4yTo5y + * @property {SeriesPattern1} _5yTo6y + * @property {SeriesPattern1} _6yTo7y + * @property {SeriesPattern1} _7yTo8y + * @property {SeriesPattern1} _8yTo10y + * @property {SeriesPattern1} _10yTo12y + * @property {SeriesPattern1} _12yTo15y + * @property {SeriesPattern1} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Under + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _9m + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + * @property {SeriesPattern1} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Over + * @property {SeriesPattern1} _1d + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _9m + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_Epoch + * @property {SeriesPattern1} _0 + * @property {SeriesPattern1} _1 + * @property {SeriesPattern1} _2 + * @property {SeriesPattern1} _3 + * @property {SeriesPattern1} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_Class + * @property {SeriesPattern1} _2009 + * @property {SeriesPattern1} _2010 + * @property {SeriesPattern1} _2011 + * @property {SeriesPattern1} _2012 + * @property {SeriesPattern1} _2013 + * @property {SeriesPattern1} _2014 + * @property {SeriesPattern1} _2015 + * @property {SeriesPattern1} _2016 + * @property {SeriesPattern1} _2017 + * @property {SeriesPattern1} _2018 + * @property {SeriesPattern1} _2019 + * @property {SeriesPattern1} _2020 + * @property {SeriesPattern1} _2021 + * @property {SeriesPattern1} _2022 + * @property {SeriesPattern1} _2023 + * @property {SeriesPattern1} _2024 + * @property {SeriesPattern1} _2025 + * @property {SeriesPattern1} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_AggregateMatrix + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_AgeRangeMatrix + * @property {SeriesPattern1} under1h + * @property {SeriesPattern1} _1hTo1d + * @property {SeriesPattern1} _1dTo1w + * @property {SeriesPattern1} _1wTo1m + * @property {SeriesPattern1} _1mTo2m + * @property {SeriesPattern1} _2mTo3m + * @property {SeriesPattern1} _3mTo4m + * @property {SeriesPattern1} _4mTo5m + * @property {SeriesPattern1} _5mTo6m + * @property {SeriesPattern1} _6mTo9m + * @property {SeriesPattern1} _9mTo1y + * @property {SeriesPattern1} _1yTo18m + * @property {SeriesPattern1} _18mTo2y + * @property {SeriesPattern1} _2yTo3y + * @property {SeriesPattern1} _3yTo4y + * @property {SeriesPattern1} _4yTo5y + * @property {SeriesPattern1} _5yTo6y + * @property {SeriesPattern1} _6yTo7y + * @property {SeriesPattern1} _7yTo8y + * @property {SeriesPattern1} _8yTo10y + * @property {SeriesPattern1} _10yTo12y + * @property {SeriesPattern1} _12yTo15y + * @property {SeriesPattern1} over15y + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_UnderAgeMatrix + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _9m + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + * @property {SeriesPattern1} _15y + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_OverAgeMatrix + * @property {SeriesPattern1} _1d + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _9m + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_EpochMatrix + * @property {SeriesPattern1} _0 + * @property {SeriesPattern1} _1 + * @property {SeriesPattern1} _2 + * @property {SeriesPattern1} _3 + * @property {SeriesPattern1} _4 + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_ClassMatrix + * @property {SeriesPattern1} _2009 + * @property {SeriesPattern1} _2010 + * @property {SeriesPattern1} _2011 + * @property {SeriesPattern1} _2012 + * @property {SeriesPattern1} _2013 + * @property {SeriesPattern1} _2014 + * @property {SeriesPattern1} _2015 + * @property {SeriesPattern1} _2016 + * @property {SeriesPattern1} _2017 + * @property {SeriesPattern1} _2018 + * @property {SeriesPattern1} _2019 + * @property {SeriesPattern1} _2020 + * @property {SeriesPattern1} _2021 + * @property {SeriesPattern1} _2022 + * @property {SeriesPattern1} _2023 + * @property {SeriesPattern1} _2024 + * @property {SeriesPattern1} _2025 + * @property {SeriesPattern1} _2026 + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Sopr_EntryMatrix + * @property {SeriesPattern1} discount + * @property {SeriesPattern1} premium + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr + * @property {SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_Ratio} ratio + * @property {SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_TransferVolume} transferVolume + * @property {SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_ValueDestroyed} valueDestroyed + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_Ratio + * @property {_1m1w1y24hHeightPattern2} all + * @property {_1m1w1y24hHeightPattern2} sth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_TransferVolume + * @property {AverageBlockCumulativeSumPattern} all + * @property {AverageBlockCumulativeSumPattern} sth + * @property {SeriesPattern18} cumulative + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_ValueDestroyed + * @property {AverageBlockCumulativeSumPattern} all + * @property {AverageBlockCumulativeSumPattern} sth + * @property {SeriesPattern18} cumulative + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_GrossPnl + * @property {BlockCumulativeSumPattern} all + * @property {BlockCumulativeSumPattern} sth + * @property {BlockCumulativeSumPattern} lth + * @property {SeriesPattern18} cumulative + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_CapitalizedPrice + * @property {CentsPpmRatioSatsUsdPattern} all + * @property {CentsPpmRatioSatsUsdPattern} sth + * @property {CentsPpmRatioSatsUsdPattern} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_PeakRegret + * @property {BlockCumulativeSumPattern} all + * @property {BlockCumulativeSumPattern} sth + * @property {BlockCumulativeSumPattern} lth + * @property {SeriesPattern18} cumulative + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_NetPnlChange1mToRcap + * @property {PercentPpmRatioPattern} all + * @property {PercentPpmRatioPattern} sth + * @property {PercentPpmRatioPattern} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_SellSideRiskRatio + * @property {_1m1w1y24hHeightPattern3} all + * @property {_1m1w1y24hHeightPattern3} sth + * @property {_1m1w1y24hHeightPattern3} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_SoprRatioExtended + * @property {_1m1w1yHeightPattern} all + * @property {_1m1w1yHeightPattern} sth + * @property {_1m1w1yHeightPattern} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_ProfitToLossRatio + * @property {_1m1w1y24hHeightPattern2} all + * @property {_1m1w1y24hHeightPattern2} sth + * @property {_1m1w1y24hHeightPattern2} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv + * @property {SeriesPattern1} all + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Class} class + * @property {DiscountPremiumPattern7} entry + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount} utxoAmount + * @property {LongShortPattern7} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6} type + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Range + * @property {SeriesPattern1} under1h + * @property {SeriesPattern1} _1hTo1d + * @property {SeriesPattern1} _1dTo1w + * @property {SeriesPattern1} _1wTo1m + * @property {SeriesPattern1} _1mTo2m + * @property {SeriesPattern1} _2mTo3m + * @property {SeriesPattern1} _3mTo4m + * @property {SeriesPattern1} _4mTo5m + * @property {SeriesPattern1} _5mTo6m + * @property {SeriesPattern1} _6mTo9m + * @property {SeriesPattern1} _9mTo1y + * @property {SeriesPattern1} _1yTo18m + * @property {SeriesPattern1} _18mTo2y + * @property {SeriesPattern1} _2yTo3y + * @property {SeriesPattern1} _3yTo4y + * @property {SeriesPattern1} _4yTo5y + * @property {SeriesPattern1} _5yTo6y + * @property {SeriesPattern1} _6yTo7y + * @property {SeriesPattern1} _7yTo8y + * @property {SeriesPattern1} _8yTo10y + * @property {SeriesPattern1} _10yTo12y + * @property {SeriesPattern1} _12yTo15y + * @property {SeriesPattern1} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Under + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _9m + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + * @property {SeriesPattern1} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Over + * @property {SeriesPattern1} _1d + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _9m + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Epoch + * @property {SeriesPattern1} _0 + * @property {SeriesPattern1} _1 + * @property {SeriesPattern1} _2 + * @property {SeriesPattern1} _3 + * @property {SeriesPattern1} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Class + * @property {SeriesPattern1} _2009 + * @property {SeriesPattern1} _2010 + * @property {SeriesPattern1} _2011 + * @property {SeriesPattern1} _2012 + * @property {SeriesPattern1} _2013 + * @property {SeriesPattern1} _2014 + * @property {SeriesPattern1} _2015 + * @property {SeriesPattern1} _2016 + * @property {SeriesPattern1} _2017 + * @property {SeriesPattern1} _2018 + * @property {SeriesPattern1} _2019 + * @property {SeriesPattern1} _2020 + * @property {SeriesPattern1} _2021 + * @property {SeriesPattern1} _2022 + * @property {SeriesPattern1} _2023 + * @property {SeriesPattern1} _2024 + * @property {SeriesPattern1} _2025 + * @property {SeriesPattern1} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Range + * @property {SeriesPattern1} _0sats + * @property {SeriesPattern1} _1satTo10sats + * @property {SeriesPattern1} _10satsTo100sats + * @property {SeriesPattern1} _100satsTo1kSats + * @property {SeriesPattern1} _1kSatsTo10kSats + * @property {SeriesPattern1} _10kSatsTo100kSats + * @property {SeriesPattern1} _100kSatsTo1mSats + * @property {SeriesPattern1} _1mSatsTo10mSats + * @property {SeriesPattern1} _10mSatsTo1btc + * @property {SeriesPattern1} _1btcTo10btc + * @property {SeriesPattern1} _10btcTo100btc + * @property {SeriesPattern1} _100btcTo1kBtc + * @property {SeriesPattern1} _1kBtcTo10kBtc + * @property {SeriesPattern1} _10kBtcTo100kBtc + * @property {SeriesPattern1} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Under + * @property {SeriesPattern1} _10sats + * @property {SeriesPattern1} _100sats + * @property {SeriesPattern1} _1kSats + * @property {SeriesPattern1} _10kSats + * @property {SeriesPattern1} _100kSats + * @property {SeriesPattern1} _1mSats + * @property {SeriesPattern1} _10mSats + * @property {SeriesPattern1} _1btc + * @property {SeriesPattern1} _10btc + * @property {SeriesPattern1} _100btc + * @property {SeriesPattern1} _1kBtc + * @property {SeriesPattern1} _10kBtc + * @property {SeriesPattern1} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Over + * @property {SeriesPattern1} _1sat + * @property {SeriesPattern1} _10sats + * @property {SeriesPattern1} _100sats + * @property {SeriesPattern1} _1kSats + * @property {SeriesPattern1} _10kSats + * @property {SeriesPattern1} _100kSats + * @property {SeriesPattern1} _1mSats + * @property {SeriesPattern1} _10mSats + * @property {SeriesPattern1} _1btc + * @property {SeriesPattern1} _10btc + * @property {SeriesPattern1} _100btc + * @property {SeriesPattern1} _1kBtc + * @property {SeriesPattern1} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Profit} profit + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss} loss + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl} netPnl + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_GrossPnl} grossPnl + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInProfit} investedCapitalInProfit + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInLoss} investedCapitalInLoss + * @property {MatrixPattern} capitalizedCapInProfitRaw + * @property {MatrixPattern} capitalizedCapInLossRaw + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_PainIndex} painIndex + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_GreedIndex} greedIndex + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetSentiment} netSentiment + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl} nupl + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Profit + * @property {CentsUsdPattern3} all + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Class} class + * @property {DiscountPremiumPattern13} entry + * @property {LongShortPattern14} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Range + * @property {CentsUsdPattern3} under1h + * @property {CentsUsdPattern3} _1hTo1d + * @property {CentsUsdPattern3} _1dTo1w + * @property {CentsUsdPattern3} _1wTo1m + * @property {CentsUsdPattern3} _1mTo2m + * @property {CentsUsdPattern3} _2mTo3m + * @property {CentsUsdPattern3} _3mTo4m + * @property {CentsUsdPattern3} _4mTo5m + * @property {CentsUsdPattern3} _5mTo6m + * @property {CentsUsdPattern3} _6mTo9m + * @property {CentsUsdPattern3} _9mTo1y + * @property {CentsUsdPattern3} _1yTo18m + * @property {CentsUsdPattern3} _18mTo2y + * @property {CentsUsdPattern3} _2yTo3y + * @property {CentsUsdPattern3} _3yTo4y + * @property {CentsUsdPattern3} _4yTo5y + * @property {CentsUsdPattern3} _5yTo6y + * @property {CentsUsdPattern3} _6yTo7y + * @property {CentsUsdPattern3} _7yTo8y + * @property {CentsUsdPattern3} _8yTo10y + * @property {CentsUsdPattern3} _10yTo12y + * @property {CentsUsdPattern3} _12yTo15y + * @property {CentsUsdPattern3} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Under + * @property {CentsUsdPattern3} _1w + * @property {CentsUsdPattern3} _1m + * @property {CentsUsdPattern3} _2m + * @property {CentsUsdPattern3} _3m + * @property {CentsUsdPattern3} _4m + * @property {CentsUsdPattern3} _5m + * @property {CentsUsdPattern3} _6m + * @property {CentsUsdPattern3} _9m + * @property {CentsUsdPattern3} _1y + * @property {CentsUsdPattern3} _18m + * @property {CentsUsdPattern3} _2y + * @property {CentsUsdPattern3} _3y + * @property {CentsUsdPattern3} _4y + * @property {CentsUsdPattern3} _5y + * @property {CentsUsdPattern3} _6y + * @property {CentsUsdPattern3} _7y + * @property {CentsUsdPattern3} _8y + * @property {CentsUsdPattern3} _10y + * @property {CentsUsdPattern3} _12y + * @property {CentsUsdPattern3} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Over + * @property {CentsUsdPattern3} _1d + * @property {CentsUsdPattern3} _1w + * @property {CentsUsdPattern3} _1m + * @property {CentsUsdPattern3} _2m + * @property {CentsUsdPattern3} _3m + * @property {CentsUsdPattern3} _4m + * @property {CentsUsdPattern3} _5m + * @property {CentsUsdPattern3} _6m + * @property {CentsUsdPattern3} _9m + * @property {CentsUsdPattern3} _1y + * @property {CentsUsdPattern3} _18m + * @property {CentsUsdPattern3} _2y + * @property {CentsUsdPattern3} _3y + * @property {CentsUsdPattern3} _4y + * @property {CentsUsdPattern3} _5y + * @property {CentsUsdPattern3} _6y + * @property {CentsUsdPattern3} _7y + * @property {CentsUsdPattern3} _8y + * @property {CentsUsdPattern3} _10y + * @property {CentsUsdPattern3} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Epoch + * @property {CentsUsdPattern3} _0 + * @property {CentsUsdPattern3} _1 + * @property {CentsUsdPattern3} _2 + * @property {CentsUsdPattern3} _3 + * @property {CentsUsdPattern3} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Class + * @property {CentsUsdPattern3} _2009 + * @property {CentsUsdPattern3} _2010 + * @property {CentsUsdPattern3} _2011 + * @property {CentsUsdPattern3} _2012 + * @property {CentsUsdPattern3} _2013 + * @property {CentsUsdPattern3} _2014 + * @property {CentsUsdPattern3} _2015 + * @property {CentsUsdPattern3} _2016 + * @property {CentsUsdPattern3} _2017 + * @property {CentsUsdPattern3} _2018 + * @property {CentsUsdPattern3} _2019 + * @property {CentsUsdPattern3} _2020 + * @property {CentsUsdPattern3} _2021 + * @property {CentsUsdPattern3} _2022 + * @property {CentsUsdPattern3} _2023 + * @property {CentsUsdPattern3} _2024 + * @property {CentsUsdPattern3} _2025 + * @property {CentsUsdPattern3} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss + * @property {CentsUsdPattern3} all + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Class} class + * @property {DiscountPremiumPattern13} entry + * @property {LongShortPattern14} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11} type + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + * @property {SeriesPattern18} typeMatrix + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative} negative + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Range + * @property {CentsUsdPattern3} under1h + * @property {CentsUsdPattern3} _1hTo1d + * @property {CentsUsdPattern3} _1dTo1w + * @property {CentsUsdPattern3} _1wTo1m + * @property {CentsUsdPattern3} _1mTo2m + * @property {CentsUsdPattern3} _2mTo3m + * @property {CentsUsdPattern3} _3mTo4m + * @property {CentsUsdPattern3} _4mTo5m + * @property {CentsUsdPattern3} _5mTo6m + * @property {CentsUsdPattern3} _6mTo9m + * @property {CentsUsdPattern3} _9mTo1y + * @property {CentsUsdPattern3} _1yTo18m + * @property {CentsUsdPattern3} _18mTo2y + * @property {CentsUsdPattern3} _2yTo3y + * @property {CentsUsdPattern3} _3yTo4y + * @property {CentsUsdPattern3} _4yTo5y + * @property {CentsUsdPattern3} _5yTo6y + * @property {CentsUsdPattern3} _6yTo7y + * @property {CentsUsdPattern3} _7yTo8y + * @property {CentsUsdPattern3} _8yTo10y + * @property {CentsUsdPattern3} _10yTo12y + * @property {CentsUsdPattern3} _12yTo15y + * @property {CentsUsdPattern3} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Under + * @property {CentsUsdPattern3} _1w + * @property {CentsUsdPattern3} _1m + * @property {CentsUsdPattern3} _2m + * @property {CentsUsdPattern3} _3m + * @property {CentsUsdPattern3} _4m + * @property {CentsUsdPattern3} _5m + * @property {CentsUsdPattern3} _6m + * @property {CentsUsdPattern3} _9m + * @property {CentsUsdPattern3} _1y + * @property {CentsUsdPattern3} _18m + * @property {CentsUsdPattern3} _2y + * @property {CentsUsdPattern3} _3y + * @property {CentsUsdPattern3} _4y + * @property {CentsUsdPattern3} _5y + * @property {CentsUsdPattern3} _6y + * @property {CentsUsdPattern3} _7y + * @property {CentsUsdPattern3} _8y + * @property {CentsUsdPattern3} _10y + * @property {CentsUsdPattern3} _12y + * @property {CentsUsdPattern3} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Over + * @property {CentsUsdPattern3} _1d + * @property {CentsUsdPattern3} _1w + * @property {CentsUsdPattern3} _1m + * @property {CentsUsdPattern3} _2m + * @property {CentsUsdPattern3} _3m + * @property {CentsUsdPattern3} _4m + * @property {CentsUsdPattern3} _5m + * @property {CentsUsdPattern3} _6m + * @property {CentsUsdPattern3} _9m + * @property {CentsUsdPattern3} _1y + * @property {CentsUsdPattern3} _18m + * @property {CentsUsdPattern3} _2y + * @property {CentsUsdPattern3} _3y + * @property {CentsUsdPattern3} _4y + * @property {CentsUsdPattern3} _5y + * @property {CentsUsdPattern3} _6y + * @property {CentsUsdPattern3} _7y + * @property {CentsUsdPattern3} _8y + * @property {CentsUsdPattern3} _10y + * @property {CentsUsdPattern3} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Epoch + * @property {CentsUsdPattern3} _0 + * @property {CentsUsdPattern3} _1 + * @property {CentsUsdPattern3} _2 + * @property {CentsUsdPattern3} _3 + * @property {CentsUsdPattern3} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Class + * @property {CentsUsdPattern3} _2009 + * @property {CentsUsdPattern3} _2010 + * @property {CentsUsdPattern3} _2011 + * @property {CentsUsdPattern3} _2012 + * @property {CentsUsdPattern3} _2013 + * @property {CentsUsdPattern3} _2014 + * @property {CentsUsdPattern3} _2015 + * @property {CentsUsdPattern3} _2016 + * @property {CentsUsdPattern3} _2017 + * @property {CentsUsdPattern3} _2018 + * @property {CentsUsdPattern3} _2019 + * @property {CentsUsdPattern3} _2020 + * @property {CentsUsdPattern3} _2021 + * @property {CentsUsdPattern3} _2022 + * @property {CentsUsdPattern3} _2023 + * @property {CentsUsdPattern3} _2024 + * @property {CentsUsdPattern3} _2025 + * @property {CentsUsdPattern3} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative + * @property {SeriesPattern1} all + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Class} class + * @property {DiscountPremiumPattern7} entry + * @property {LongShortPattern7} term + * @property {EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6} type + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Range + * @property {SeriesPattern1} under1h + * @property {SeriesPattern1} _1hTo1d + * @property {SeriesPattern1} _1dTo1w + * @property {SeriesPattern1} _1wTo1m + * @property {SeriesPattern1} _1mTo2m + * @property {SeriesPattern1} _2mTo3m + * @property {SeriesPattern1} _3mTo4m + * @property {SeriesPattern1} _4mTo5m + * @property {SeriesPattern1} _5mTo6m + * @property {SeriesPattern1} _6mTo9m + * @property {SeriesPattern1} _9mTo1y + * @property {SeriesPattern1} _1yTo18m + * @property {SeriesPattern1} _18mTo2y + * @property {SeriesPattern1} _2yTo3y + * @property {SeriesPattern1} _3yTo4y + * @property {SeriesPattern1} _4yTo5y + * @property {SeriesPattern1} _5yTo6y + * @property {SeriesPattern1} _6yTo7y + * @property {SeriesPattern1} _7yTo8y + * @property {SeriesPattern1} _8yTo10y + * @property {SeriesPattern1} _10yTo12y + * @property {SeriesPattern1} _12yTo15y + * @property {SeriesPattern1} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Under + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _9m + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + * @property {SeriesPattern1} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Over + * @property {SeriesPattern1} _1d + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _3m + * @property {SeriesPattern1} _4m + * @property {SeriesPattern1} _5m + * @property {SeriesPattern1} _6m + * @property {SeriesPattern1} _9m + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _18m + * @property {SeriesPattern1} _2y + * @property {SeriesPattern1} _3y + * @property {SeriesPattern1} _4y + * @property {SeriesPattern1} _5y + * @property {SeriesPattern1} _6y + * @property {SeriesPattern1} _7y + * @property {SeriesPattern1} _8y + * @property {SeriesPattern1} _10y + * @property {SeriesPattern1} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Epoch + * @property {SeriesPattern1} _0 + * @property {SeriesPattern1} _1 + * @property {SeriesPattern1} _2 + * @property {SeriesPattern1} _3 + * @property {SeriesPattern1} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Class + * @property {SeriesPattern1} _2009 + * @property {SeriesPattern1} _2010 + * @property {SeriesPattern1} _2011 + * @property {SeriesPattern1} _2012 + * @property {SeriesPattern1} _2013 + * @property {SeriesPattern1} _2014 + * @property {SeriesPattern1} _2015 + * @property {SeriesPattern1} _2016 + * @property {SeriesPattern1} _2017 + * @property {SeriesPattern1} _2018 + * @property {SeriesPattern1} _2019 + * @property {SeriesPattern1} _2020 + * @property {SeriesPattern1} _2021 + * @property {SeriesPattern1} _2022 + * @property {SeriesPattern1} _2023 + * @property {SeriesPattern1} _2024 + * @property {SeriesPattern1} _2025 + * @property {SeriesPattern1} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl + * @property {CentsUsdPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Class} class + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Entry} entry + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Term} term + * @property {SeriesPattern18} ageRangeMatrix + * @property {SeriesPattern18} epochMatrix + * @property {SeriesPattern18} classMatrix + * @property {SeriesPattern18} entryMatrix + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Range + * @property {CentsUsdPattern} under1h + * @property {CentsUsdPattern} _1hTo1d + * @property {CentsUsdPattern} _1dTo1w + * @property {CentsUsdPattern} _1wTo1m + * @property {CentsUsdPattern} _1mTo2m + * @property {CentsUsdPattern} _2mTo3m + * @property {CentsUsdPattern} _3mTo4m + * @property {CentsUsdPattern} _4mTo5m + * @property {CentsUsdPattern} _5mTo6m + * @property {CentsUsdPattern} _6mTo9m + * @property {CentsUsdPattern} _9mTo1y + * @property {CentsUsdPattern} _1yTo18m + * @property {CentsUsdPattern} _18mTo2y + * @property {CentsUsdPattern} _2yTo3y + * @property {CentsUsdPattern} _3yTo4y + * @property {CentsUsdPattern} _4yTo5y + * @property {CentsUsdPattern} _5yTo6y + * @property {CentsUsdPattern} _6yTo7y + * @property {CentsUsdPattern} _7yTo8y + * @property {CentsUsdPattern} _8yTo10y + * @property {CentsUsdPattern} _10yTo12y + * @property {CentsUsdPattern} _12yTo15y + * @property {CentsUsdPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Under + * @property {CentsUsdPattern} _1w + * @property {CentsUsdPattern} _1m + * @property {CentsUsdPattern} _2m + * @property {CentsUsdPattern} _3m + * @property {CentsUsdPattern} _4m + * @property {CentsUsdPattern} _5m + * @property {CentsUsdPattern} _6m + * @property {CentsUsdPattern} _9m + * @property {CentsUsdPattern} _1y + * @property {CentsUsdPattern} _18m + * @property {CentsUsdPattern} _2y + * @property {CentsUsdPattern} _3y + * @property {CentsUsdPattern} _4y + * @property {CentsUsdPattern} _5y + * @property {CentsUsdPattern} _6y + * @property {CentsUsdPattern} _7y + * @property {CentsUsdPattern} _8y + * @property {CentsUsdPattern} _10y + * @property {CentsUsdPattern} _12y + * @property {CentsUsdPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Over + * @property {CentsUsdPattern} _1d + * @property {CentsUsdPattern} _1w + * @property {CentsUsdPattern} _1m + * @property {CentsUsdPattern} _2m + * @property {CentsUsdPattern} _3m + * @property {CentsUsdPattern} _4m + * @property {CentsUsdPattern} _5m + * @property {CentsUsdPattern} _6m + * @property {CentsUsdPattern} _9m + * @property {CentsUsdPattern} _1y + * @property {CentsUsdPattern} _18m + * @property {CentsUsdPattern} _2y + * @property {CentsUsdPattern} _3y + * @property {CentsUsdPattern} _4y + * @property {CentsUsdPattern} _5y + * @property {CentsUsdPattern} _6y + * @property {CentsUsdPattern} _7y + * @property {CentsUsdPattern} _8y + * @property {CentsUsdPattern} _10y + * @property {CentsUsdPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Epoch + * @property {CentsUsdPattern} _0 + * @property {CentsUsdPattern} _1 + * @property {CentsUsdPattern} _2 + * @property {CentsUsdPattern} _3 + * @property {CentsUsdPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Class + * @property {CentsUsdPattern} _2009 + * @property {CentsUsdPattern} _2010 + * @property {CentsUsdPattern} _2011 + * @property {CentsUsdPattern} _2012 + * @property {CentsUsdPattern} _2013 + * @property {CentsUsdPattern} _2014 + * @property {CentsUsdPattern} _2015 + * @property {CentsUsdPattern} _2016 + * @property {CentsUsdPattern} _2017 + * @property {CentsUsdPattern} _2018 + * @property {CentsUsdPattern} _2019 + * @property {CentsUsdPattern} _2020 + * @property {CentsUsdPattern} _2021 + * @property {CentsUsdPattern} _2022 + * @property {CentsUsdPattern} _2023 + * @property {CentsUsdPattern} _2024 + * @property {CentsUsdPattern} _2025 + * @property {CentsUsdPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Entry + * @property {CentsUsdPattern} discount + * @property {CentsUsdPattern} premium + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Term + * @property {CentsUsdPattern} short + * @property {CentsUsdPattern} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_GrossPnl + * @property {CentsUsdPattern3} all + * @property {CentsUsdPattern3} sth + * @property {CentsUsdPattern3} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInProfit + * @property {CentsUsdPattern3} all + * @property {CentsUsdPattern3} sth + * @property {CentsUsdPattern3} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInLoss + * @property {CentsUsdPattern3} all + * @property {CentsUsdPattern3} sth + * @property {CentsUsdPattern3} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_PainIndex + * @property {CentsUsdPattern3} all + * @property {CentsUsdPattern3} sth + * @property {CentsUsdPattern3} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_GreedIndex + * @property {CentsUsdPattern3} all + * @property {CentsUsdPattern3} sth + * @property {CentsUsdPattern3} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_NetSentiment + * @property {CentsUsdPattern} all + * @property {CentsUsdPattern} sth + * @property {CentsUsdPattern} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl + * @property {PpmRatioPattern} all + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age} age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Epoch} epoch + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Class} class + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Entry} entry + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount} utxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Term} term + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Type} type + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Range + * @property {PpmRatioPattern} under1h + * @property {PpmRatioPattern} _1hTo1d + * @property {PpmRatioPattern} _1dTo1w + * @property {PpmRatioPattern} _1wTo1m + * @property {PpmRatioPattern} _1mTo2m + * @property {PpmRatioPattern} _2mTo3m + * @property {PpmRatioPattern} _3mTo4m + * @property {PpmRatioPattern} _4mTo5m + * @property {PpmRatioPattern} _5mTo6m + * @property {PpmRatioPattern} _6mTo9m + * @property {PpmRatioPattern} _9mTo1y + * @property {PpmRatioPattern} _1yTo18m + * @property {PpmRatioPattern} _18mTo2y + * @property {PpmRatioPattern} _2yTo3y + * @property {PpmRatioPattern} _3yTo4y + * @property {PpmRatioPattern} _4yTo5y + * @property {PpmRatioPattern} _5yTo6y + * @property {PpmRatioPattern} _6yTo7y + * @property {PpmRatioPattern} _7yTo8y + * @property {PpmRatioPattern} _8yTo10y + * @property {PpmRatioPattern} _10yTo12y + * @property {PpmRatioPattern} _12yTo15y + * @property {PpmRatioPattern} over15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Under + * @property {PpmRatioPattern} _1w + * @property {PpmRatioPattern} _1m + * @property {PpmRatioPattern} _2m + * @property {PpmRatioPattern} _3m + * @property {PpmRatioPattern} _4m + * @property {PpmRatioPattern} _5m + * @property {PpmRatioPattern} _6m + * @property {PpmRatioPattern} _9m + * @property {PpmRatioPattern} _1y + * @property {PpmRatioPattern} _18m + * @property {PpmRatioPattern} _2y + * @property {PpmRatioPattern} _3y + * @property {PpmRatioPattern} _4y + * @property {PpmRatioPattern} _5y + * @property {PpmRatioPattern} _6y + * @property {PpmRatioPattern} _7y + * @property {PpmRatioPattern} _8y + * @property {PpmRatioPattern} _10y + * @property {PpmRatioPattern} _12y + * @property {PpmRatioPattern} _15y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Over + * @property {PpmRatioPattern} _1d + * @property {PpmRatioPattern} _1w + * @property {PpmRatioPattern} _1m + * @property {PpmRatioPattern} _2m + * @property {PpmRatioPattern} _3m + * @property {PpmRatioPattern} _4m + * @property {PpmRatioPattern} _5m + * @property {PpmRatioPattern} _6m + * @property {PpmRatioPattern} _9m + * @property {PpmRatioPattern} _1y + * @property {PpmRatioPattern} _18m + * @property {PpmRatioPattern} _2y + * @property {PpmRatioPattern} _3y + * @property {PpmRatioPattern} _4y + * @property {PpmRatioPattern} _5y + * @property {PpmRatioPattern} _6y + * @property {PpmRatioPattern} _7y + * @property {PpmRatioPattern} _8y + * @property {PpmRatioPattern} _10y + * @property {PpmRatioPattern} _12y + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Epoch + * @property {PpmRatioPattern} _0 + * @property {PpmRatioPattern} _1 + * @property {PpmRatioPattern} _2 + * @property {PpmRatioPattern} _3 + * @property {PpmRatioPattern} _4 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Class + * @property {PpmRatioPattern} _2009 + * @property {PpmRatioPattern} _2010 + * @property {PpmRatioPattern} _2011 + * @property {PpmRatioPattern} _2012 + * @property {PpmRatioPattern} _2013 + * @property {PpmRatioPattern} _2014 + * @property {PpmRatioPattern} _2015 + * @property {PpmRatioPattern} _2016 + * @property {PpmRatioPattern} _2017 + * @property {PpmRatioPattern} _2018 + * @property {PpmRatioPattern} _2019 + * @property {PpmRatioPattern} _2020 + * @property {PpmRatioPattern} _2021 + * @property {PpmRatioPattern} _2022 + * @property {PpmRatioPattern} _2023 + * @property {PpmRatioPattern} _2024 + * @property {PpmRatioPattern} _2025 + * @property {PpmRatioPattern} _2026 + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Entry + * @property {PpmRatioPattern} discount + * @property {PpmRatioPattern} premium + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Under} under + * @property {SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Over} over + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Range + * @property {PpmRatioPattern} _0sats + * @property {PpmRatioPattern} _1satTo10sats + * @property {PpmRatioPattern} _10satsTo100sats + * @property {PpmRatioPattern} _100satsTo1kSats + * @property {PpmRatioPattern} _1kSatsTo10kSats + * @property {PpmRatioPattern} _10kSatsTo100kSats + * @property {PpmRatioPattern} _100kSatsTo1mSats + * @property {PpmRatioPattern} _1mSatsTo10mSats + * @property {PpmRatioPattern} _10mSatsTo1btc + * @property {PpmRatioPattern} _1btcTo10btc + * @property {PpmRatioPattern} _10btcTo100btc + * @property {PpmRatioPattern} _100btcTo1kBtc + * @property {PpmRatioPattern} _1kBtcTo10kBtc + * @property {PpmRatioPattern} _10kBtcTo100kBtc + * @property {PpmRatioPattern} over100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Under + * @property {PpmRatioPattern} _10sats + * @property {PpmRatioPattern} _100sats + * @property {PpmRatioPattern} _1kSats + * @property {PpmRatioPattern} _10kSats + * @property {PpmRatioPattern} _100kSats + * @property {PpmRatioPattern} _1mSats + * @property {PpmRatioPattern} _10mSats + * @property {PpmRatioPattern} _1btc + * @property {PpmRatioPattern} _10btc + * @property {PpmRatioPattern} _100btc + * @property {PpmRatioPattern} _1kBtc + * @property {PpmRatioPattern} _10kBtc + * @property {PpmRatioPattern} _100kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Over + * @property {PpmRatioPattern} _1sat + * @property {PpmRatioPattern} _10sats + * @property {PpmRatioPattern} _100sats + * @property {PpmRatioPattern} _1kSats + * @property {PpmRatioPattern} _10kSats + * @property {PpmRatioPattern} _100kSats + * @property {PpmRatioPattern} _1mSats + * @property {PpmRatioPattern} _10mSats + * @property {PpmRatioPattern} _1btc + * @property {PpmRatioPattern} _10btc + * @property {PpmRatioPattern} _100btc + * @property {PpmRatioPattern} _1kBtc + * @property {PpmRatioPattern} _10kBtc + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Term + * @property {PpmRatioPattern} short + * @property {PpmRatioPattern} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Type + * @property {PpmRatioPattern} p2pk65 + * @property {PpmRatioPattern} p2pk33 + * @property {PpmRatioPattern} p2pkh + * @property {PpmRatioPattern} p2ms + * @property {PpmRatioPattern} p2sh + * @property {PpmRatioPattern} p2wpkh + * @property {PpmRatioPattern} p2wsh + * @property {PpmRatioPattern} p2tr + * @property {PpmRatioPattern} p2a + * @property {PpmRatioPattern} unknown + * @property {PpmRatioPattern} empty + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_CostBasis + * @property {InMaxMinPerSupplyPattern} all + * @property {InMaxMinPerSupplyPattern} sth + * @property {InMaxMinPerSupplyPattern} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative + * @property {SeriesTree_Cohorts_Cohorts_Relative_Supply} supply + * @property {SeriesTree_Cohorts_Cohorts_Relative_Unrealized} unrealized + * @property {SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital} investedCapital + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_Supply + * @property {SharePattern2} inProfit + * @property {SharePattern2} inLoss + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_Unrealized + * @property {SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit} profit + * @property {SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss} loss + * @property {SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl} netPnl + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit + * @property {AllLthSthPattern5} toMcap + * @property {SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit_ToOwnMcap} toOwnMcap + * @property {AllLthSthPattern5} toOwnGrossPnl + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit_ToOwnMcap + * @property {PercentPpmRatioPattern2} short + * @property {PercentPpmRatioPattern2} long + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss + * @property {AllLthSthPattern5} toMcap + * @property {SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss_ToOwnMcap} toOwnMcap + * @property {AllLthSthPattern5} toOwnGrossPnl + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss_ToOwnMcap + * @property {PercentPpmRatioPattern2} short + * @property {PercentPpmRatioPattern2} long + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl + * @property {SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnMcap} toOwnMcap + * @property {SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnGrossPnl} toOwnGrossPnl + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnMcap + * @property {PercentPpmRatioPattern3} short + * @property {PercentPpmRatioPattern3} long + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnGrossPnl + * @property {PercentPpmRatioPattern3} all + * @property {PercentPpmRatioPattern3} sth + * @property {PercentPpmRatioPattern3} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital + * @property {SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit} inProfit + * @property {SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss} inLoss + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit + * @property {SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit_Share} share + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit_Share + * @property {PercentPpmRatioPattern2} all + * @property {PercentPpmRatioPattern2} sth + * @property {PercentPpmRatioPattern2} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss + * @property {SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss_Share} share + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss_Share + * @property {PercentPpmRatioPattern2} all + * @property {PercentPpmRatioPattern2} sth + * @property {PercentPpmRatioPattern2} lth + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability + * @property {SeriesTree_Cohorts_Cohorts_Profitability_Supply} supply + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap} realizedCap + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl} unrealizedPnl + * @property {SeriesTree_Cohorts_Cohorts_Profitability_Nupl} nupl + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_Supply + * @property {SeriesTree_Cohorts_Cohorts_Profitability_Supply_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Profitability_Supply_Profit} profit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_Supply_Loss} loss + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_Supply_Range + * @property {AllLthSthPattern4} over1000pctInProfit + * @property {AllLthSthPattern4} _500pctTo1000pctInProfit + * @property {AllLthSthPattern4} _300pctTo500pctInProfit + * @property {AllLthSthPattern4} _200pctTo300pctInProfit + * @property {AllLthSthPattern4} _100pctTo200pctInProfit + * @property {AllLthSthPattern4} _90pctTo100pctInProfit + * @property {AllLthSthPattern4} _80pctTo90pctInProfit + * @property {AllLthSthPattern4} _70pctTo80pctInProfit + * @property {AllLthSthPattern4} _60pctTo70pctInProfit + * @property {AllLthSthPattern4} _50pctTo60pctInProfit + * @property {AllLthSthPattern4} _40pctTo50pctInProfit + * @property {AllLthSthPattern4} _30pctTo40pctInProfit + * @property {AllLthSthPattern4} _20pctTo30pctInProfit + * @property {AllLthSthPattern4} _10pctTo20pctInProfit + * @property {AllLthSthPattern4} _0pctTo10pctInProfit + * @property {AllLthSthPattern4} _0pctTo10pctInLoss + * @property {AllLthSthPattern4} _10pctTo20pctInLoss + * @property {AllLthSthPattern4} _20pctTo30pctInLoss + * @property {AllLthSthPattern4} _30pctTo40pctInLoss + * @property {AllLthSthPattern4} _40pctTo50pctInLoss + * @property {AllLthSthPattern4} _50pctTo60pctInLoss + * @property {AllLthSthPattern4} _60pctTo70pctInLoss + * @property {AllLthSthPattern4} _70pctTo80pctInLoss + * @property {AllLthSthPattern4} _80pctTo90pctInLoss + * @property {AllLthSthPattern4} _90pctTo100pctInLoss + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_Supply_Profit + * @property {AllLthSthPattern4} all + * @property {AllLthSthPattern4} _10pct + * @property {AllLthSthPattern4} _20pct + * @property {AllLthSthPattern4} _30pct + * @property {AllLthSthPattern4} _40pct + * @property {AllLthSthPattern4} _50pct + * @property {AllLthSthPattern4} _60pct + * @property {AllLthSthPattern4} _70pct + * @property {AllLthSthPattern4} _80pct + * @property {AllLthSthPattern4} _90pct + * @property {AllLthSthPattern4} _100pct + * @property {AllLthSthPattern4} _200pct + * @property {AllLthSthPattern4} _300pct + * @property {AllLthSthPattern4} _500pct + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_Supply_Loss + * @property {AllLthSthPattern4} all + * @property {AllLthSthPattern4} _10pct + * @property {AllLthSthPattern4} _20pct + * @property {AllLthSthPattern4} _30pct + * @property {AllLthSthPattern4} _40pct + * @property {AllLthSthPattern4} _50pct + * @property {AllLthSthPattern4} _60pct + * @property {AllLthSthPattern4} _70pct + * @property {AllLthSthPattern4} _80pct + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit} profit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss} loss + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_Over1000pctInProfit} over1000pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_500pctTo1000pctInProfit} _500pctTo1000pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_300pctTo500pctInProfit} _300pctTo500pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_200pctTo300pctInProfit} _200pctTo300pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_100pctTo200pctInProfit} _100pctTo200pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInProfit} _90pctTo100pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInProfit} _80pctTo90pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInProfit} _70pctTo80pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInProfit} _60pctTo70pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInProfit} _50pctTo60pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInProfit} _40pctTo50pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInProfit} _30pctTo40pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInProfit} _20pctTo30pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInProfit} _10pctTo20pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInProfit} _0pctTo10pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInLoss} _0pctTo10pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInLoss} _10pctTo20pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInLoss} _20pctTo30pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInLoss} _30pctTo40pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInLoss} _40pctTo50pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInLoss} _50pctTo60pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInLoss} _60pctTo70pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInLoss} _70pctTo80pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInLoss} _80pctTo90pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInLoss} _90pctTo100pctInLoss + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_Over1000pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_500pctTo1000pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_300pctTo500pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_200pctTo300pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_100pctTo200pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_All} all + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_10pct} _10pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_20pct} _20pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_30pct} _30pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_40pct} _40pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_50pct} _50pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_60pct} _60pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_70pct} _70pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_80pct} _80pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_90pct} _90pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_100pct} _100pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_200pct} _200pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_300pct} _300pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_500pct} _500pct + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_All + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_10pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_20pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_30pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_40pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_50pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_60pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_70pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_80pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_90pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_100pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_200pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_300pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_500pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_All} all + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_10pct} _10pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_20pct} _20pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_30pct} _30pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_40pct} _40pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_50pct} _50pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_60pct} _60pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_70pct} _70pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_80pct} _80pct + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_All + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_10pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_20pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_30pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_40pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_50pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_60pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_70pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_80pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit} profit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss} loss + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_Over1000pctInProfit} over1000pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_500pctTo1000pctInProfit} _500pctTo1000pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_300pctTo500pctInProfit} _300pctTo500pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_200pctTo300pctInProfit} _200pctTo300pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_100pctTo200pctInProfit} _100pctTo200pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInProfit} _90pctTo100pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInProfit} _80pctTo90pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInProfit} _70pctTo80pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInProfit} _60pctTo70pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInProfit} _50pctTo60pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInProfit} _40pctTo50pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInProfit} _30pctTo40pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInProfit} _20pctTo30pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInProfit} _10pctTo20pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInProfit} _0pctTo10pctInProfit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInLoss} _0pctTo10pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInLoss} _10pctTo20pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInLoss} _20pctTo30pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInLoss} _30pctTo40pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInLoss} _40pctTo50pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInLoss} _50pctTo60pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInLoss} _60pctTo70pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInLoss} _70pctTo80pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInLoss} _80pctTo90pctInLoss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInLoss} _90pctTo100pctInLoss + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_Over1000pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_500pctTo1000pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_300pctTo500pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_200pctTo300pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_100pctTo200pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInProfit + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInLoss + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_All} all + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_10pct} _10pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_20pct} _20pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_30pct} _30pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_40pct} _40pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_50pct} _50pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_60pct} _60pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_70pct} _70pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_80pct} _80pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_90pct} _90pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_100pct} _100pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_200pct} _200pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_300pct} _300pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_500pct} _500pct + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_All + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_10pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_20pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_30pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_40pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_50pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_60pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_70pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_80pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_90pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_100pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_200pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_300pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_500pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_All} all + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_10pct} _10pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_20pct} _20pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_30pct} _30pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_40pct} _40pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_50pct} _50pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_60pct} _60pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_70pct} _70pct + * @property {SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_80pct} _80pct + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_All + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_10pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_20pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_30pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_40pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_50pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_60pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_70pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_80pct + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth + * @property {SeriesPattern1} lth + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_Nupl + * @property {SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Range} range + * @property {SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Profit} profit + * @property {SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Loss} loss + * @property {SeriesPattern18} height + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Range + * @property {PpmRatioPattern} over1000pctInProfit + * @property {PpmRatioPattern} _500pctTo1000pctInProfit + * @property {PpmRatioPattern} _300pctTo500pctInProfit + * @property {PpmRatioPattern} _200pctTo300pctInProfit + * @property {PpmRatioPattern} _100pctTo200pctInProfit + * @property {PpmRatioPattern} _90pctTo100pctInProfit + * @property {PpmRatioPattern} _80pctTo90pctInProfit + * @property {PpmRatioPattern} _70pctTo80pctInProfit + * @property {PpmRatioPattern} _60pctTo70pctInProfit + * @property {PpmRatioPattern} _50pctTo60pctInProfit + * @property {PpmRatioPattern} _40pctTo50pctInProfit + * @property {PpmRatioPattern} _30pctTo40pctInProfit + * @property {PpmRatioPattern} _20pctTo30pctInProfit + * @property {PpmRatioPattern} _10pctTo20pctInProfit + * @property {PpmRatioPattern} _0pctTo10pctInProfit + * @property {PpmRatioPattern} _0pctTo10pctInLoss + * @property {PpmRatioPattern} _10pctTo20pctInLoss + * @property {PpmRatioPattern} _20pctTo30pctInLoss + * @property {PpmRatioPattern} _30pctTo40pctInLoss + * @property {PpmRatioPattern} _40pctTo50pctInLoss + * @property {PpmRatioPattern} _50pctTo60pctInLoss + * @property {PpmRatioPattern} _60pctTo70pctInLoss + * @property {PpmRatioPattern} _70pctTo80pctInLoss + * @property {PpmRatioPattern} _80pctTo90pctInLoss + * @property {PpmRatioPattern} _90pctTo100pctInLoss + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Profit + * @property {PpmRatioPattern} all + * @property {PpmRatioPattern} _10pct + * @property {PpmRatioPattern} _20pct + * @property {PpmRatioPattern} _30pct + * @property {PpmRatioPattern} _40pct + * @property {PpmRatioPattern} _50pct + * @property {PpmRatioPattern} _60pct + * @property {PpmRatioPattern} _70pct + * @property {PpmRatioPattern} _80pct + * @property {PpmRatioPattern} _90pct + * @property {PpmRatioPattern} _100pct + * @property {PpmRatioPattern} _200pct + * @property {PpmRatioPattern} _300pct + * @property {PpmRatioPattern} _500pct + */ + +/** + * @typedef {Object} SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Loss + * @property {PpmRatioPattern} all + * @property {PpmRatioPattern} _10pct + * @property {PpmRatioPattern} _20pct + * @property {PpmRatioPattern} _30pct + * @property {PpmRatioPattern} _40pct + * @property {PpmRatioPattern} _50pct + * @property {PpmRatioPattern} _60pct + * @property {PpmRatioPattern} _70pct + * @property {PpmRatioPattern} _80pct */ /** @@ -10708,7 +17096,7 @@ class BrkClient extends BrkClientBase { empty: createAverageBlockCumulativeSumPattern(this, 'tx_count_with_empty_outputs_prevout'), cumulative: createSeriesPattern18(this, 'tx_count_with_prevout_by_type_cumulative'), }, - txShare: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2(this, 'tx_share_with'), + txShare: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13(this, 'tx_share_with'), }, }, outputs: { @@ -10844,6 +17232,56 @@ class BrkClient extends BrkClientBase { p2tr: createSeriesPattern1(this, 'p2tr_addr_count'), p2a: createSeriesPattern1(this, 'p2a_addr_count'), height: createSeriesPattern18(this, 'addr_count_by_type'), + balance: { + range: { + _0sats: createBaseDeltaPattern(this, 'addrs_0sats_addr_count'), + _1satTo10sats: createBaseDeltaPattern(this, 'addrs_1sat_to_10sats_addr_count'), + _10satsTo100sats: createBaseDeltaPattern(this, 'addrs_10sats_to_100sats_addr_count'), + _100satsTo1kSats: createBaseDeltaPattern(this, 'addrs_100sats_to_1k_sats_addr_count'), + _1kSatsTo10kSats: createBaseDeltaPattern(this, 'addrs_1k_sats_to_10k_sats_addr_count'), + _10kSatsTo100kSats: createBaseDeltaPattern(this, 'addrs_10k_sats_to_100k_sats_addr_count'), + _100kSatsTo1mSats: createBaseDeltaPattern(this, 'addrs_100k_sats_to_1m_sats_addr_count'), + _1mSatsTo10mSats: createBaseDeltaPattern(this, 'addrs_1m_sats_to_10m_sats_addr_count'), + _10mSatsTo1btc: createBaseDeltaPattern(this, 'addrs_10m_sats_to_1btc_addr_count'), + _1btcTo10btc: createBaseDeltaPattern(this, 'addrs_1btc_to_10btc_addr_count'), + _10btcTo100btc: createBaseDeltaPattern(this, 'addrs_10btc_to_100btc_addr_count'), + _100btcTo1kBtc: createBaseDeltaPattern(this, 'addrs_100btc_to_1k_btc_addr_count'), + _1kBtcTo10kBtc: createBaseDeltaPattern(this, 'addrs_1k_btc_to_10k_btc_addr_count'), + _10kBtcTo100kBtc: createBaseDeltaPattern(this, 'addrs_10k_btc_to_100k_btc_addr_count'), + over100kBtc: createBaseDeltaPattern(this, 'addrs_over_100k_btc_addr_count'), + }, + under: { + _10sats: createBaseDeltaPattern(this, 'addrs_under_10sats_addr_count'), + _100sats: createBaseDeltaPattern(this, 'addrs_under_100sats_addr_count'), + _1kSats: createBaseDeltaPattern(this, 'addrs_under_1k_sats_addr_count'), + _10kSats: createBaseDeltaPattern(this, 'addrs_under_10k_sats_addr_count'), + _100kSats: createBaseDeltaPattern(this, 'addrs_under_100k_sats_addr_count'), + _1mSats: createBaseDeltaPattern(this, 'addrs_under_1m_sats_addr_count'), + _10mSats: createBaseDeltaPattern(this, 'addrs_under_10m_sats_addr_count'), + _1btc: createBaseDeltaPattern(this, 'addrs_under_1btc_addr_count'), + _10btc: createBaseDeltaPattern(this, 'addrs_under_10btc_addr_count'), + _100btc: createBaseDeltaPattern(this, 'addrs_under_100btc_addr_count'), + _1kBtc: createBaseDeltaPattern(this, 'addrs_under_1k_btc_addr_count'), + _10kBtc: createBaseDeltaPattern(this, 'addrs_under_10k_btc_addr_count'), + _100kBtc: createBaseDeltaPattern(this, 'addrs_under_100k_btc_addr_count'), + }, + over: { + _1sat: createBaseDeltaPattern(this, 'addrs_over_1sat_addr_count'), + _10sats: createBaseDeltaPattern(this, 'addrs_over_10sats_addr_count'), + _100sats: createBaseDeltaPattern(this, 'addrs_over_100sats_addr_count'), + _1kSats: createBaseDeltaPattern(this, 'addrs_over_1k_sats_addr_count'), + _10kSats: createBaseDeltaPattern(this, 'addrs_over_10k_sats_addr_count'), + _100kSats: createBaseDeltaPattern(this, 'addrs_over_100k_sats_addr_count'), + _1mSats: createBaseDeltaPattern(this, 'addrs_over_1m_sats_addr_count'), + _10mSats: createBaseDeltaPattern(this, 'addrs_over_10m_sats_addr_count'), + _1btc: createBaseDeltaPattern(this, 'addrs_over_1btc_addr_count'), + _10btc: createBaseDeltaPattern(this, 'addrs_over_10btc_addr_count'), + _100btc: createBaseDeltaPattern(this, 'addrs_over_100btc_addr_count'), + _1kBtc: createBaseDeltaPattern(this, 'addrs_over_1k_btc_addr_count'), + _10kBtc: createBaseDeltaPattern(this, 'addrs_over_10k_btc_addr_count'), + }, + matrix: createSeriesPattern18(this, 'addrs_addr_count_by_balance_range'), + }, }, empty: { all: createSeriesPattern1(this, 'empty_addr_count'), @@ -10858,21 +17296,11 @@ class BrkClient extends BrkClientBase { height: createSeriesPattern18(this, 'empty_addr_count_by_type'), }, activity: { - all: { - reactivated: create_1m1w1y24hBlockPattern(this, 'reactivated_addrs'), - sending: create_1m1w1y24hBlockPattern(this, 'sending_addrs'), - receiving: create_1m1w1y24hBlockPattern(this, 'receiving_addrs'), - bidirectional: create_1m1w1y24hBlockPattern(this, 'bidirectional_addrs'), - active: create_1m1w1y24hBlockPattern(this, 'active_addrs'), - }, - p2pk65: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2pk65'), - p2pk33: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2pk33'), - p2pkh: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2pkh'), - p2sh: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2sh'), - p2wpkh: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2wpkh'), - p2wsh: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2wsh'), - p2tr: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2tr'), - p2a: createActiveBidirectionalReactivatedReceivingSendingPattern(this, 'p2a'), + reactivated: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(this, 'reactivated_addrs'), + sending: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(this, 'sending_addrs'), + receiving: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(this, 'receiving_addrs'), + bidirectional: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(this, 'bidirectional_addrs'), + active: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(this, 'active_addrs'), }, total: { all: createSeriesPattern1(this, 'total_addr_count'), @@ -11094,15 +17522,8 @@ class BrkClient extends BrkClientBase { p2a: createAbsoluteRatePattern(this, 'p2a_addr_count'), }, avgAmount: { - all: createAddrUtxoPattern(this, 'avg'), - p2pk65: createAddrUtxoPattern(this, 'p2pk65_avg'), - p2pk33: createAddrUtxoPattern(this, 'p2pk33_avg'), - p2pkh: createAddrUtxoPattern(this, 'p2pkh_avg'), - p2sh: createAddrUtxoPattern(this, 'p2sh_avg'), - p2wpkh: createAddrUtxoPattern(this, 'p2wpkh_avg'), - p2wsh: createAddrUtxoPattern(this, 'p2wsh_avg'), - p2tr: createAddrUtxoPattern(this, 'p2tr_avg'), - p2a: createAddrUtxoPattern(this, 'p2a_avg'), + utxo: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2(this, 'avg_utxo_amount'), + addr: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2(this, 'avg_addr_amount'), }, }, scripts: { @@ -11580,16 +18001,16 @@ class BrkClient extends BrkClientBase { }, awake: { supply: { - btc: createSeriesPattern1(this, 'awake_supply'), - sats: createSeriesPattern1(this, 'awake_supply_sats'), - usd: createSeriesPattern1(this, 'awake_supply_usd'), - cents: createSeriesPattern1(this, 'awake_supply_cents'), - inLoss: createSharePattern2(this, 'awake_supply_in_loss_share'), + btc: createSeriesPattern1(this, 'all_awake_supply'), + sats: createSeriesPattern1(this, 'all_awake_supply_sats'), + usd: createSeriesPattern1(this, 'all_awake_supply_usd'), + cents: createSeriesPattern1(this, 'all_awake_supply_cents'), + inLoss: createSharePattern3(this, 'all_awake_supply_in_loss_share'), }, - cap: createCentsUsdPattern3(this, 'awake_cap'), - price: createCentsPpmRatioSatsUsdPattern(this, 'awake_price'), + cap: createCentsUsdPattern3(this, 'all_awake_cap'), + price: createCentsPpmRatioSatsUsdPattern(this, 'all_awake_price'), }, - dormant: createSupplyPattern2(this, 'dormant_supply'), + dormant: createSupplyPattern2(this, 'all_dormant_supply'), sth: { awake: { supply: { @@ -11597,7 +18018,7 @@ class BrkClient extends BrkClientBase { sats: createSeriesPattern1(this, 'sth_awake_supply_sats'), usd: createSeriesPattern1(this, 'sth_awake_supply_usd'), cents: createSeriesPattern1(this, 'sth_awake_supply_cents'), - inLoss: createSharePattern2(this, 'sth_awake_supply_in_loss_share'), + inLoss: createSharePattern3(this, 'sth_awake_supply_in_loss_share'), }, cap: createCentsUsdPattern3(this, 'sth_awake_cap'), price: createCentsPpmRatioSatsUsdPattern(this, 'sth_awake_price'), @@ -11611,13 +18032,20 @@ class BrkClient extends BrkClientBase { sats: createSeriesPattern1(this, 'lth_awake_supply_sats'), usd: createSeriesPattern1(this, 'lth_awake_supply_usd'), cents: createSeriesPattern1(this, 'lth_awake_supply_cents'), - inLoss: createSharePattern2(this, 'lth_awake_supply_in_loss_share'), + inLoss: createSharePattern3(this, 'lth_awake_supply_in_loss_share'), }, cap: createCentsUsdPattern3(this, 'lth_awake_cap'), price: createCentsPpmRatioSatsUsdPattern(this, 'lth_awake_price'), }, dormant: createSupplyPattern2(this, 'lth_dormant_supply'), }, + sources: { + awakeSupply: createSeriesPattern18(this, 'cointime_awake_supply_sats_by_term'), + dormantSupply: createSeriesPattern18(this, 'cointime_dormant_supply_sats_by_term'), + awakeCap: createSeriesPattern18(this, 'cointime_awake_cap_cents_by_term'), + awakePrice: createSeriesPattern18(this, 'cointime_awake_price_cents_by_aggregate'), + supplyInLossShare: createSeriesPattern18(this, 'cointime_awake_supply_in_loss_share_by_term'), + }, supply: { vaulted: createBtcCentsSatsUsdPattern(this, 'vaulted_supply'), active: { @@ -11625,7 +18053,7 @@ class BrkClient extends BrkClientBase { sats: createSeriesPattern1(this, 'active_supply_sats'), usd: createSeriesPattern1(this, 'active_supply_usd'), cents: createSeriesPattern1(this, 'active_supply_cents'), - inLoss: createSharePattern2(this, 'cointime_supply_in_loss_share'), + inLoss: createSharePattern3(this, 'cointime_supply_in_loss_share'), }, }, value: { @@ -11795,17 +18223,17 @@ class BrkClient extends BrkClientBase { }, supply: { mobile: { - btc: createSeriesPattern1(this, 'mobile_supply'), - sats: createSeriesPattern1(this, 'mobile_supply_sats'), - usd: createSeriesPattern1(this, 'mobile_supply_usd'), - cents: createSeriesPattern1(this, 'mobile_supply_cents'), - inLoss: createSharePattern2(this, 'coinflow_supply_in_loss_share'), + btc: createSeriesPattern1(this, 'all_mobile_supply'), + sats: createSeriesPattern1(this, 'all_mobile_supply_sats'), + usd: createSeriesPattern1(this, 'all_mobile_supply_usd'), + cents: createSeriesPattern1(this, 'all_mobile_supply_cents'), + inLoss: createSharePattern3(this, 'all_coinflow_supply_in_loss_share'), }, - immobile: createBtcCentsSatsUsdPattern(this, 'immobile_supply'), + immobile: createBtcCentsSatsUsdPattern(this, 'all_immobile_supply'), }, - horizon: create_1m1y2y3m4y6m8yPattern(this, 'coinflow'), - cap: createCentsUsdPattern3(this, 'coinflow_cap'), - price: createCentsPpmRatioSatsUsdPattern(this, 'coinflow_price'), + horizon: create_1m1y2y3m4y6m8yPattern2(this, 'all_coinflow'), + cap: createCentsUsdPattern3(this, 'all_coinflow_cap'), + price: createCentsPpmRatioSatsUsdPattern(this, 'all_coinflow_price'), sth: { supply: { mobile: { @@ -11813,11 +18241,11 @@ class BrkClient extends BrkClientBase { sats: createSeriesPattern1(this, 'sth_mobile_supply_sats'), usd: createSeriesPattern1(this, 'sth_mobile_supply_usd'), cents: createSeriesPattern1(this, 'sth_mobile_supply_cents'), - inLoss: createSharePattern2(this, 'sth_coinflow_supply_in_loss_share'), + inLoss: createSharePattern3(this, 'sth_coinflow_supply_in_loss_share'), }, immobile: createBtcCentsSatsUsdPattern(this, 'sth_immobile_supply'), }, - horizon: create_1m1y2y3m4y6m8yPattern(this, 'sth_coinflow'), + horizon: create_1m1y2y3m4y6m8yPattern2(this, 'sth_coinflow'), cap: createCentsUsdPattern3(this, 'sth_coinflow_cap'), price: createCentsPpmRatioSatsUsdPattern(this, 'sth_coinflow_price'), }, @@ -11828,14 +18256,32 @@ class BrkClient extends BrkClientBase { sats: createSeriesPattern1(this, 'lth_mobile_supply_sats'), usd: createSeriesPattern1(this, 'lth_mobile_supply_usd'), cents: createSeriesPattern1(this, 'lth_mobile_supply_cents'), - inLoss: createSharePattern2(this, 'lth_coinflow_supply_in_loss_share'), + inLoss: createSharePattern3(this, 'lth_coinflow_supply_in_loss_share'), }, immobile: createBtcCentsSatsUsdPattern(this, 'lth_immobile_supply'), }, - horizon: create_1m1y2y3m4y6m8yPattern(this, 'lth_coinflow'), + horizon: create_1m1y2y3m4y6m8yPattern2(this, 'lth_coinflow'), cap: createCentsUsdPattern3(this, 'lth_coinflow_cap'), price: createCentsPpmRatioSatsUsdPattern(this, 'lth_coinflow_price'), }, + aggregateSources: { + supply: { + mobile: createSeriesPattern18(this, 'coinflow_mobile_supply_sats_by_term'), + immobile: createSeriesPattern18(this, 'coinflow_immobile_supply_sats_by_term'), + }, + supplyInLossShare: createSeriesPattern18(this, 'coinflow_supply_in_loss_share_by_aggregate'), + horizon: { + _8y: createSeriesPattern18(this, 'coinflow_8y_supply_in_loss_share_by_aggregate'), + _4y: createSeriesPattern18(this, 'coinflow_4y_supply_in_loss_share_by_aggregate'), + _2y: createSeriesPattern18(this, 'coinflow_2y_supply_in_loss_share_by_aggregate'), + _1y: createSeriesPattern18(this, 'coinflow_1y_supply_in_loss_share_by_aggregate'), + _6m: createSeriesPattern18(this, 'coinflow_6m_supply_in_loss_share_by_aggregate'), + _3m: createSeriesPattern18(this, 'coinflow_3m_supply_in_loss_share_by_aggregate'), + _1m: createSeriesPattern18(this, 'coinflow_1m_supply_in_loss_share_by_aggregate'), + }, + cap: createSeriesPattern18(this, 'coinflow_cap_cents_by_term'), + price: createSeriesPattern18(this, 'coinflow_price_cents_by_aggregate'), + }, }, }, models: { @@ -12497,414 +18943,4161 @@ class BrkClient extends BrkClientBase { hodledOrLost: createBtcCentsSatsUsdPattern(this, 'hodled_or_lost_supply'), }, cohorts: { - utxo: { - all: { - supply: createDeltaDominanceHalfInTotalPattern2(this, 'supply'), - outputs: { - unspentCount: createBaseDeltaPattern(this, 'utxo_count'), - spentCount: createAverageBlockCumulativeSumPattern(this, 'spent_utxo_count'), - }, - activity: { - transferVolume: createAverageBlockCumulativeInSumPattern(this, 'transfer_volume'), - coindaysDestroyed: createAverageBlockCumulativeSumPattern(this, 'coindays_destroyed'), - coinyearsDestroyed: createSeriesPattern1(this, 'coinyears_destroyed'), - dormancy: create_1m1w1y24hHeightPattern(this, 'dormancy'), - }, - realized: { - cap: createCentsDeltaToUsdPattern(this, 'realized_cap'), - profit: createBlockCumulativeSumPattern(this, 'realized_profit'), - loss: createBlockCumulativeNegativeSumPattern(this, 'realized_loss'), - price: createCentsPpmRatioSatsUsdPattern(this, 'realized_price'), - mvrv: createSeriesPattern1(this, 'mvrv'), - netPnl: createBlockChangeCumulativeDeltaSumPattern(this, 'net'), - sopr: { - valueDestroyed: createAverageBlockCumulativeSumPattern(this, 'value_destroyed'), - ratio: create_1m1w1y24hHeightPattern4(this, 'sopr'), - adjusted: { - ratio: create_1m1w1y24hHeightPattern2(this, 'asopr'), - transferVolume: createAverageBlockCumulativeSumPattern(this, 'adj_value_created'), - valueDestroyed: createAverageBlockCumulativeSumPattern(this, 'adj_value_destroyed'), + cohorts: { + supply: { + total: { + all: createBtcCentsSatsUsdPattern(this, 'supply'), + age: { + range: { + under1h: createBtcCentsSatsUsdPattern(this, 'utxos_under_1h_old_supply'), + _1hTo1d: createBtcCentsSatsUsdPattern(this, 'utxos_1h_to_1d_old_supply'), + _1dTo1w: createBtcCentsSatsUsdPattern(this, 'utxos_1d_to_1w_old_supply'), + _1wTo1m: createBtcCentsSatsUsdPattern(this, 'utxos_1w_to_1m_old_supply'), + _1mTo2m: createBtcCentsSatsUsdPattern(this, 'utxos_1m_to_2m_old_supply'), + _2mTo3m: createBtcCentsSatsUsdPattern(this, 'utxos_2m_to_3m_old_supply'), + _3mTo4m: createBtcCentsSatsUsdPattern(this, 'utxos_3m_to_4m_old_supply'), + _4mTo5m: createBtcCentsSatsUsdPattern(this, 'utxos_4m_to_5m_old_supply'), + _5mTo6m: createBtcCentsSatsUsdPattern(this, 'utxos_5m_to_6m_old_supply'), + _6mTo9m: createBtcCentsSatsUsdPattern(this, 'utxos_6m_to_9m_old_supply'), + _9mTo1y: createBtcCentsSatsUsdPattern(this, 'utxos_9m_to_1y_old_supply'), + _1yTo18m: createBtcCentsSatsUsdPattern(this, 'utxos_1y_to_18m_old_supply'), + _18mTo2y: createBtcCentsSatsUsdPattern(this, 'utxos_18m_to_2y_old_supply'), + _2yTo3y: createBtcCentsSatsUsdPattern(this, 'utxos_2y_to_3y_old_supply'), + _3yTo4y: createBtcCentsSatsUsdPattern(this, 'utxos_3y_to_4y_old_supply'), + _4yTo5y: createBtcCentsSatsUsdPattern(this, 'utxos_4y_to_5y_old_supply'), + _5yTo6y: createBtcCentsSatsUsdPattern(this, 'utxos_5y_to_6y_old_supply'), + _6yTo7y: createBtcCentsSatsUsdPattern(this, 'utxos_6y_to_7y_old_supply'), + _7yTo8y: createBtcCentsSatsUsdPattern(this, 'utxos_7y_to_8y_old_supply'), + _8yTo10y: createBtcCentsSatsUsdPattern(this, 'utxos_8y_to_10y_old_supply'), + _10yTo12y: createBtcCentsSatsUsdPattern(this, 'utxos_10y_to_12y_old_supply'), + _12yTo15y: createBtcCentsSatsUsdPattern(this, 'utxos_12y_to_15y_old_supply'), + over15y: createBtcCentsSatsUsdPattern(this, 'utxos_over_15y_old_supply'), + }, + under: { + _1w: createBtcCentsSatsUsdPattern(this, 'utxos_under_1w_old_supply'), + _1m: createBtcCentsSatsUsdPattern(this, 'utxos_under_1m_old_supply'), + _2m: createBtcCentsSatsUsdPattern(this, 'utxos_under_2m_old_supply'), + _3m: createBtcCentsSatsUsdPattern(this, 'utxos_under_3m_old_supply'), + _4m: createBtcCentsSatsUsdPattern(this, 'utxos_under_4m_old_supply'), + _5m: createBtcCentsSatsUsdPattern(this, 'utxos_under_5m_old_supply'), + _6m: createBtcCentsSatsUsdPattern(this, 'utxos_under_6m_old_supply'), + _9m: createBtcCentsSatsUsdPattern(this, 'utxos_under_9m_old_supply'), + _1y: createBtcCentsSatsUsdPattern(this, 'utxos_under_1y_old_supply'), + _18m: createBtcCentsSatsUsdPattern(this, 'utxos_under_18m_old_supply'), + _2y: createBtcCentsSatsUsdPattern(this, 'utxos_under_2y_old_supply'), + _3y: createBtcCentsSatsUsdPattern(this, 'utxos_under_3y_old_supply'), + _4y: createBtcCentsSatsUsdPattern(this, 'utxos_under_4y_old_supply'), + _5y: createBtcCentsSatsUsdPattern(this, 'utxos_under_5y_old_supply'), + _6y: createBtcCentsSatsUsdPattern(this, 'utxos_under_6y_old_supply'), + _7y: createBtcCentsSatsUsdPattern(this, 'utxos_under_7y_old_supply'), + _8y: createBtcCentsSatsUsdPattern(this, 'utxos_under_8y_old_supply'), + _10y: createBtcCentsSatsUsdPattern(this, 'utxos_under_10y_old_supply'), + _12y: createBtcCentsSatsUsdPattern(this, 'utxos_under_12y_old_supply'), + _15y: createBtcCentsSatsUsdPattern(this, 'utxos_under_15y_old_supply'), + }, + over: { + _1d: createBtcCentsSatsUsdPattern(this, 'utxos_over_1d_old_supply'), + _1w: createBtcCentsSatsUsdPattern(this, 'utxos_over_1w_old_supply'), + _1m: createBtcCentsSatsUsdPattern(this, 'utxos_over_1m_old_supply'), + _2m: createBtcCentsSatsUsdPattern(this, 'utxos_over_2m_old_supply'), + _3m: createBtcCentsSatsUsdPattern(this, 'utxos_over_3m_old_supply'), + _4m: createBtcCentsSatsUsdPattern(this, 'utxos_over_4m_old_supply'), + _5m: createBtcCentsSatsUsdPattern(this, 'utxos_over_5m_old_supply'), + _6m: createBtcCentsSatsUsdPattern(this, 'utxos_over_6m_old_supply'), + _9m: createBtcCentsSatsUsdPattern(this, 'utxos_over_9m_old_supply'), + _1y: createBtcCentsSatsUsdPattern(this, 'utxos_over_1y_old_supply'), + _18m: createBtcCentsSatsUsdPattern(this, 'utxos_over_18m_old_supply'), + _2y: createBtcCentsSatsUsdPattern(this, 'utxos_over_2y_old_supply'), + _3y: createBtcCentsSatsUsdPattern(this, 'utxos_over_3y_old_supply'), + _4y: createBtcCentsSatsUsdPattern(this, 'utxos_over_4y_old_supply'), + _5y: createBtcCentsSatsUsdPattern(this, 'utxos_over_5y_old_supply'), + _6y: createBtcCentsSatsUsdPattern(this, 'utxos_over_6y_old_supply'), + _7y: createBtcCentsSatsUsdPattern(this, 'utxos_over_7y_old_supply'), + _8y: createBtcCentsSatsUsdPattern(this, 'utxos_over_8y_old_supply'), + _10y: createBtcCentsSatsUsdPattern(this, 'utxos_over_10y_old_supply'), + _12y: createBtcCentsSatsUsdPattern(this, 'utxos_over_12y_old_supply'), }, }, - grossPnl: createBlockCumulativeSumPattern(this, 'realized_gross_pnl'), - sellSideRiskRatio: create_1m1w1y24hHeightPattern3(this, 'sell_side_risk_ratio'), - peakRegret: createBlockCumulativeSumPattern(this, 'realized_peak_regret'), - capitalized: createPricePattern(this, 'capitalized_price'), - profitToLossRatio: create_1m1w1y24hHeightPattern2(this, 'realized_profit_to_loss_ratio'), - }, - costBasis: { - inProfit: createPerPattern(this, 'cost_basis_in_profit_per'), - inLoss: createPerPattern(this, 'cost_basis_in_loss_per'), - min: createCentsSatsUsdPattern(this, 'cost_basis_min'), - max: createCentsSatsUsdPattern(this, 'cost_basis_max'), - perCoin: createHeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(this, 'cost_basis_per_coin'), - perDollar: createHeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(this, 'cost_basis_per_dollar'), - supplyDensity: createPercentPpmRatioPattern2(this, 'supply_density'), - }, - unrealized: { - nupl: createPpmRatioPattern(this, 'nupl'), - profit: { - usd: createSeriesPattern1(this, 'unrealized_profit'), - cents: createSeriesPattern1(this, 'unrealized_profit_cents'), - toMcap: createPercentPpmRatioPattern2(this, 'unrealized_profit_to_mcap'), - toOwnGrossPnl: createPercentPpmRatioPattern2(this, 'unrealized_profit_to_own_gross_pnl'), + epoch: { + _0: createBtcCentsSatsUsdPattern(this, 'epoch_0_supply'), + _1: createBtcCentsSatsUsdPattern(this, 'epoch_1_supply'), + _2: createBtcCentsSatsUsdPattern(this, 'epoch_2_supply'), + _3: createBtcCentsSatsUsdPattern(this, 'epoch_3_supply'), + _4: createBtcCentsSatsUsdPattern(this, 'epoch_4_supply'), }, - loss: { - usd: createSeriesPattern1(this, 'unrealized_loss'), - cents: createSeriesPattern1(this, 'unrealized_loss_cents'), - negative: createSeriesPattern1(this, 'unrealized_loss_neg'), - toMcap: createPercentPpmRatioPattern2(this, 'unrealized_loss_to_mcap'), - toOwnGrossPnl: createPercentPpmRatioPattern2(this, 'unrealized_loss_to_own_gross_pnl'), + class: { + _2009: createBtcCentsSatsUsdPattern(this, 'class_2009_supply'), + _2010: createBtcCentsSatsUsdPattern(this, 'class_2010_supply'), + _2011: createBtcCentsSatsUsdPattern(this, 'class_2011_supply'), + _2012: createBtcCentsSatsUsdPattern(this, 'class_2012_supply'), + _2013: createBtcCentsSatsUsdPattern(this, 'class_2013_supply'), + _2014: createBtcCentsSatsUsdPattern(this, 'class_2014_supply'), + _2015: createBtcCentsSatsUsdPattern(this, 'class_2015_supply'), + _2016: createBtcCentsSatsUsdPattern(this, 'class_2016_supply'), + _2017: createBtcCentsSatsUsdPattern(this, 'class_2017_supply'), + _2018: createBtcCentsSatsUsdPattern(this, 'class_2018_supply'), + _2019: createBtcCentsSatsUsdPattern(this, 'class_2019_supply'), + _2020: createBtcCentsSatsUsdPattern(this, 'class_2020_supply'), + _2021: createBtcCentsSatsUsdPattern(this, 'class_2021_supply'), + _2022: createBtcCentsSatsUsdPattern(this, 'class_2022_supply'), + _2023: createBtcCentsSatsUsdPattern(this, 'class_2023_supply'), + _2024: createBtcCentsSatsUsdPattern(this, 'class_2024_supply'), + _2025: createBtcCentsSatsUsdPattern(this, 'class_2025_supply'), + _2026: createBtcCentsSatsUsdPattern(this, 'class_2026_supply'), }, - netPnl: { - usd: createSeriesPattern1(this, 'net_unrealized_pnl'), - cents: createSeriesPattern1(this, 'net_unrealized_pnl_cents'), - toOwnGrossPnl: createPercentPpmRatioPattern3(this, 'net_unrealized_pnl_to_own_gross_pnl'), + entry: createDiscountPremiumPattern12(this, 'supply'), + utxoAmount: { + range: create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10(this, 'utxos'), + under: create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern10(this, 'utxos_under'), + over: create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10(this, 'utxos_over'), }, - grossPnl: createCentsUsdPattern3(this, 'unrealized_gross_pnl'), - investedCapital: createInPattern2(this, 'invested_capital_in'), - capitalizedCapInProfitRaw: createSeriesPattern18(this, 'capitalized_cap_in_profit_raw'), - capitalizedCapInLossRaw: createSeriesPattern18(this, 'capitalized_cap_in_loss_raw'), - sentiment: { - painIndex: createCentsUsdPattern3(this, 'pain_index'), - greedIndex: createCentsUsdPattern3(this, 'greed_index'), - net: createCentsUsdPattern(this, 'net_sentiment'), + term: createLongShortPattern13(this, 'supply'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10(this, 'supply'), + ageRangeMatrix: createSeriesPattern18(this, 'utxos_supply_sats_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'supply_sats_by_epoch'), + classMatrix: createSeriesPattern18(this, 'supply_sats_by_class'), + entryMatrix: createSeriesPattern18(this, 'supply_sats_by_entry'), + typeMatrix: createSeriesPattern18(this, 'supply_sats_by_type'), + amountRangeMatrix: createSeriesPattern18(this, 'utxos_supply_sats_by_amount_range'), + addrBalance: { + range: create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10(this, 'addrs'), + under: create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern10(this, 'addrs_under'), + over: create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10(this, 'addrs_over'), + matrix: createSeriesPattern18(this, 'addrs_supply_sats_by_balance_range'), }, }, - investedCapital: createInPattern(this, 'invested_capital_in'), - }, - sth: { - supply: createDeltaDominanceHalfInTotalPattern2(this, 'sth_supply'), - outputs: createSpentUnspentPattern(this, 'sth'), - activity: createCoindaysCoinyearsDormancyTransferPattern(this, 'sth'), - realized: createCapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern(this, 'sth'), - costBasis: createInMaxMinPerSupplyPattern(this, 'sth'), - unrealized: createCapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(this, 'sth'), - investedCapital: createInPattern(this, 'sth_invested_capital_in'), - }, - lth: { - supply: createDeltaDominanceHalfInTotalPattern2(this, 'lth_supply'), - outputs: createSpentUnspentPattern(this, 'lth'), - activity: createCoindaysCoinyearsDormancyTransferPattern(this, 'lth'), - realized: { - cap: createCentsDeltaToUsdPattern(this, 'lth_realized_cap'), - profit: createBlockCumulativeSumPattern(this, 'lth_realized_profit'), - loss: createBlockCumulativeNegativeSumPattern(this, 'lth_realized_loss'), - price: createCentsPpmRatioSatsUsdPattern(this, 'lth_realized_price'), - mvrv: createSeriesPattern1(this, 'lth_mvrv'), - netPnl: createBlockChangeCumulativeDeltaSumPattern(this, 'lth_net'), - sopr: { - valueDestroyed: createAverageBlockCumulativeSumPattern(this, 'lth_value_destroyed'), - ratio: create_1m1w1y24hHeightPattern4(this, 'lth_sopr'), - }, - grossPnl: createBlockCumulativeSumPattern(this, 'lth_realized_gross_pnl'), - sellSideRiskRatio: create_1m1w1y24hHeightPattern3(this, 'lth_sell_side_risk_ratio'), - peakRegret: createBlockCumulativeSumPattern(this, 'lth_realized_peak_regret'), - capitalized: createPricePattern(this, 'lth_capitalized_price'), - profitToLossRatio: create_1m1w1y24hHeightPattern2(this, 'lth_realized_profit_to_loss_ratio'), + matured: { + under1h: createAverageBlockCumulativeSumPattern2(this, 'utxos_under_1h_old_matured_supply'), + _1hTo1d: createAverageBlockCumulativeSumPattern2(this, 'utxos_1h_to_1d_old_matured_supply'), + _1dTo1w: createAverageBlockCumulativeSumPattern2(this, 'utxos_1d_to_1w_old_matured_supply'), + _1wTo1m: createAverageBlockCumulativeSumPattern2(this, 'utxos_1w_to_1m_old_matured_supply'), + _1mTo2m: createAverageBlockCumulativeSumPattern2(this, 'utxos_1m_to_2m_old_matured_supply'), + _2mTo3m: createAverageBlockCumulativeSumPattern2(this, 'utxos_2m_to_3m_old_matured_supply'), + _3mTo4m: createAverageBlockCumulativeSumPattern2(this, 'utxos_3m_to_4m_old_matured_supply'), + _4mTo5m: createAverageBlockCumulativeSumPattern2(this, 'utxos_4m_to_5m_old_matured_supply'), + _5mTo6m: createAverageBlockCumulativeSumPattern2(this, 'utxos_5m_to_6m_old_matured_supply'), + _6mTo9m: createAverageBlockCumulativeSumPattern2(this, 'utxos_6m_to_9m_old_matured_supply'), + _9mTo1y: createAverageBlockCumulativeSumPattern2(this, 'utxos_9m_to_1y_old_matured_supply'), + _1yTo18m: createAverageBlockCumulativeSumPattern2(this, 'utxos_1y_to_18m_old_matured_supply'), + _18mTo2y: createAverageBlockCumulativeSumPattern2(this, 'utxos_18m_to_2y_old_matured_supply'), + _2yTo3y: createAverageBlockCumulativeSumPattern2(this, 'utxos_2y_to_3y_old_matured_supply'), + _3yTo4y: createAverageBlockCumulativeSumPattern2(this, 'utxos_3y_to_4y_old_matured_supply'), + _4yTo5y: createAverageBlockCumulativeSumPattern2(this, 'utxos_4y_to_5y_old_matured_supply'), + _5yTo6y: createAverageBlockCumulativeSumPattern2(this, 'utxos_5y_to_6y_old_matured_supply'), + _6yTo7y: createAverageBlockCumulativeSumPattern2(this, 'utxos_6y_to_7y_old_matured_supply'), + _7yTo8y: createAverageBlockCumulativeSumPattern2(this, 'utxos_7y_to_8y_old_matured_supply'), + _8yTo10y: createAverageBlockCumulativeSumPattern2(this, 'utxos_8y_to_10y_old_matured_supply'), + _10yTo12y: createAverageBlockCumulativeSumPattern2(this, 'utxos_10y_to_12y_old_matured_supply'), + _12yTo15y: createAverageBlockCumulativeSumPattern2(this, 'utxos_12y_to_15y_old_matured_supply'), + over15y: createAverageBlockCumulativeSumPattern2(this, 'utxos_over_15y_old_matured_supply'), + sats: createCumulativePattern(this, 'utxos_age_range_matured_supply_cumulative_sats'), + cents: createCumulativePattern(this, 'utxos_age_range_matured_supply_cumulative_cents'), + }, + half: { + all: createBtcCentsSatsUsdPattern(this, 'supply_half'), + age: { + range: { + under1h: createBtcCentsSatsUsdPattern(this, 'utxos_under_1h_old_supply_half'), + _1hTo1d: createBtcCentsSatsUsdPattern(this, 'utxos_1h_to_1d_old_supply_half'), + _1dTo1w: createBtcCentsSatsUsdPattern(this, 'utxos_1d_to_1w_old_supply_half'), + _1wTo1m: createBtcCentsSatsUsdPattern(this, 'utxos_1w_to_1m_old_supply_half'), + _1mTo2m: createBtcCentsSatsUsdPattern(this, 'utxos_1m_to_2m_old_supply_half'), + _2mTo3m: createBtcCentsSatsUsdPattern(this, 'utxos_2m_to_3m_old_supply_half'), + _3mTo4m: createBtcCentsSatsUsdPattern(this, 'utxos_3m_to_4m_old_supply_half'), + _4mTo5m: createBtcCentsSatsUsdPattern(this, 'utxos_4m_to_5m_old_supply_half'), + _5mTo6m: createBtcCentsSatsUsdPattern(this, 'utxos_5m_to_6m_old_supply_half'), + _6mTo9m: createBtcCentsSatsUsdPattern(this, 'utxos_6m_to_9m_old_supply_half'), + _9mTo1y: createBtcCentsSatsUsdPattern(this, 'utxos_9m_to_1y_old_supply_half'), + _1yTo18m: createBtcCentsSatsUsdPattern(this, 'utxos_1y_to_18m_old_supply_half'), + _18mTo2y: createBtcCentsSatsUsdPattern(this, 'utxos_18m_to_2y_old_supply_half'), + _2yTo3y: createBtcCentsSatsUsdPattern(this, 'utxos_2y_to_3y_old_supply_half'), + _3yTo4y: createBtcCentsSatsUsdPattern(this, 'utxos_3y_to_4y_old_supply_half'), + _4yTo5y: createBtcCentsSatsUsdPattern(this, 'utxos_4y_to_5y_old_supply_half'), + _5yTo6y: createBtcCentsSatsUsdPattern(this, 'utxos_5y_to_6y_old_supply_half'), + _6yTo7y: createBtcCentsSatsUsdPattern(this, 'utxos_6y_to_7y_old_supply_half'), + _7yTo8y: createBtcCentsSatsUsdPattern(this, 'utxos_7y_to_8y_old_supply_half'), + _8yTo10y: createBtcCentsSatsUsdPattern(this, 'utxos_8y_to_10y_old_supply_half'), + _10yTo12y: createBtcCentsSatsUsdPattern(this, 'utxos_10y_to_12y_old_supply_half'), + _12yTo15y: createBtcCentsSatsUsdPattern(this, 'utxos_12y_to_15y_old_supply_half'), + over15y: createBtcCentsSatsUsdPattern(this, 'utxos_over_15y_old_supply_half'), + }, + under: { + _1w: createBtcCentsSatsUsdPattern(this, 'utxos_under_1w_old_supply_half'), + _1m: createBtcCentsSatsUsdPattern(this, 'utxos_under_1m_old_supply_half'), + _2m: createBtcCentsSatsUsdPattern(this, 'utxos_under_2m_old_supply_half'), + _3m: createBtcCentsSatsUsdPattern(this, 'utxos_under_3m_old_supply_half'), + _4m: createBtcCentsSatsUsdPattern(this, 'utxos_under_4m_old_supply_half'), + _5m: createBtcCentsSatsUsdPattern(this, 'utxos_under_5m_old_supply_half'), + _6m: createBtcCentsSatsUsdPattern(this, 'utxos_under_6m_old_supply_half'), + _9m: createBtcCentsSatsUsdPattern(this, 'utxos_under_9m_old_supply_half'), + _1y: createBtcCentsSatsUsdPattern(this, 'utxos_under_1y_old_supply_half'), + _18m: createBtcCentsSatsUsdPattern(this, 'utxos_under_18m_old_supply_half'), + _2y: createBtcCentsSatsUsdPattern(this, 'utxos_under_2y_old_supply_half'), + _3y: createBtcCentsSatsUsdPattern(this, 'utxos_under_3y_old_supply_half'), + _4y: createBtcCentsSatsUsdPattern(this, 'utxos_under_4y_old_supply_half'), + _5y: createBtcCentsSatsUsdPattern(this, 'utxos_under_5y_old_supply_half'), + _6y: createBtcCentsSatsUsdPattern(this, 'utxos_under_6y_old_supply_half'), + _7y: createBtcCentsSatsUsdPattern(this, 'utxos_under_7y_old_supply_half'), + _8y: createBtcCentsSatsUsdPattern(this, 'utxos_under_8y_old_supply_half'), + _10y: createBtcCentsSatsUsdPattern(this, 'utxos_under_10y_old_supply_half'), + _12y: createBtcCentsSatsUsdPattern(this, 'utxos_under_12y_old_supply_half'), + _15y: createBtcCentsSatsUsdPattern(this, 'utxos_under_15y_old_supply_half'), + }, + over: { + _1d: createBtcCentsSatsUsdPattern(this, 'utxos_over_1d_old_supply_half'), + _1w: createBtcCentsSatsUsdPattern(this, 'utxos_over_1w_old_supply_half'), + _1m: createBtcCentsSatsUsdPattern(this, 'utxos_over_1m_old_supply_half'), + _2m: createBtcCentsSatsUsdPattern(this, 'utxos_over_2m_old_supply_half'), + _3m: createBtcCentsSatsUsdPattern(this, 'utxos_over_3m_old_supply_half'), + _4m: createBtcCentsSatsUsdPattern(this, 'utxos_over_4m_old_supply_half'), + _5m: createBtcCentsSatsUsdPattern(this, 'utxos_over_5m_old_supply_half'), + _6m: createBtcCentsSatsUsdPattern(this, 'utxos_over_6m_old_supply_half'), + _9m: createBtcCentsSatsUsdPattern(this, 'utxos_over_9m_old_supply_half'), + _1y: createBtcCentsSatsUsdPattern(this, 'utxos_over_1y_old_supply_half'), + _18m: createBtcCentsSatsUsdPattern(this, 'utxos_over_18m_old_supply_half'), + _2y: createBtcCentsSatsUsdPattern(this, 'utxos_over_2y_old_supply_half'), + _3y: createBtcCentsSatsUsdPattern(this, 'utxos_over_3y_old_supply_half'), + _4y: createBtcCentsSatsUsdPattern(this, 'utxos_over_4y_old_supply_half'), + _5y: createBtcCentsSatsUsdPattern(this, 'utxos_over_5y_old_supply_half'), + _6y: createBtcCentsSatsUsdPattern(this, 'utxos_over_6y_old_supply_half'), + _7y: createBtcCentsSatsUsdPattern(this, 'utxos_over_7y_old_supply_half'), + _8y: createBtcCentsSatsUsdPattern(this, 'utxos_over_8y_old_supply_half'), + _10y: createBtcCentsSatsUsdPattern(this, 'utxos_over_10y_old_supply_half'), + _12y: createBtcCentsSatsUsdPattern(this, 'utxos_over_12y_old_supply_half'), + }, + }, + epoch: { + _0: createBtcCentsSatsUsdPattern(this, 'epoch_0_supply_half'), + _1: createBtcCentsSatsUsdPattern(this, 'epoch_1_supply_half'), + _2: createBtcCentsSatsUsdPattern(this, 'epoch_2_supply_half'), + _3: createBtcCentsSatsUsdPattern(this, 'epoch_3_supply_half'), + _4: createBtcCentsSatsUsdPattern(this, 'epoch_4_supply_half'), + }, + class: { + _2009: createBtcCentsSatsUsdPattern(this, 'class_2009_supply_half'), + _2010: createBtcCentsSatsUsdPattern(this, 'class_2010_supply_half'), + _2011: createBtcCentsSatsUsdPattern(this, 'class_2011_supply_half'), + _2012: createBtcCentsSatsUsdPattern(this, 'class_2012_supply_half'), + _2013: createBtcCentsSatsUsdPattern(this, 'class_2013_supply_half'), + _2014: createBtcCentsSatsUsdPattern(this, 'class_2014_supply_half'), + _2015: createBtcCentsSatsUsdPattern(this, 'class_2015_supply_half'), + _2016: createBtcCentsSatsUsdPattern(this, 'class_2016_supply_half'), + _2017: createBtcCentsSatsUsdPattern(this, 'class_2017_supply_half'), + _2018: createBtcCentsSatsUsdPattern(this, 'class_2018_supply_half'), + _2019: createBtcCentsSatsUsdPattern(this, 'class_2019_supply_half'), + _2020: createBtcCentsSatsUsdPattern(this, 'class_2020_supply_half'), + _2021: createBtcCentsSatsUsdPattern(this, 'class_2021_supply_half'), + _2022: createBtcCentsSatsUsdPattern(this, 'class_2022_supply_half'), + _2023: createBtcCentsSatsUsdPattern(this, 'class_2023_supply_half'), + _2024: createBtcCentsSatsUsdPattern(this, 'class_2024_supply_half'), + _2025: createBtcCentsSatsUsdPattern(this, 'class_2025_supply_half'), + _2026: createBtcCentsSatsUsdPattern(this, 'class_2026_supply_half'), + }, + entry: createDiscountPremiumPattern12(this, 'supply_half'), + term: createLongShortPattern13(this, 'supply_half'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10(this, 'supply_half'), + }, + inProfit: { + all: createBtcCentsSatsUsdPattern(this, 'supply_in_profit'), + age: { + range: { + under1h: createBtcCentsSatsUsdPattern(this, 'utxos_under_1h_old_supply_in_profit'), + _1hTo1d: createBtcCentsSatsUsdPattern(this, 'utxos_1h_to_1d_old_supply_in_profit'), + _1dTo1w: createBtcCentsSatsUsdPattern(this, 'utxos_1d_to_1w_old_supply_in_profit'), + _1wTo1m: createBtcCentsSatsUsdPattern(this, 'utxos_1w_to_1m_old_supply_in_profit'), + _1mTo2m: createBtcCentsSatsUsdPattern(this, 'utxos_1m_to_2m_old_supply_in_profit'), + _2mTo3m: createBtcCentsSatsUsdPattern(this, 'utxos_2m_to_3m_old_supply_in_profit'), + _3mTo4m: createBtcCentsSatsUsdPattern(this, 'utxos_3m_to_4m_old_supply_in_profit'), + _4mTo5m: createBtcCentsSatsUsdPattern(this, 'utxos_4m_to_5m_old_supply_in_profit'), + _5mTo6m: createBtcCentsSatsUsdPattern(this, 'utxos_5m_to_6m_old_supply_in_profit'), + _6mTo9m: createBtcCentsSatsUsdPattern(this, 'utxos_6m_to_9m_old_supply_in_profit'), + _9mTo1y: createBtcCentsSatsUsdPattern(this, 'utxos_9m_to_1y_old_supply_in_profit'), + _1yTo18m: createBtcCentsSatsUsdPattern(this, 'utxos_1y_to_18m_old_supply_in_profit'), + _18mTo2y: createBtcCentsSatsUsdPattern(this, 'utxos_18m_to_2y_old_supply_in_profit'), + _2yTo3y: createBtcCentsSatsUsdPattern(this, 'utxos_2y_to_3y_old_supply_in_profit'), + _3yTo4y: createBtcCentsSatsUsdPattern(this, 'utxos_3y_to_4y_old_supply_in_profit'), + _4yTo5y: createBtcCentsSatsUsdPattern(this, 'utxos_4y_to_5y_old_supply_in_profit'), + _5yTo6y: createBtcCentsSatsUsdPattern(this, 'utxos_5y_to_6y_old_supply_in_profit'), + _6yTo7y: createBtcCentsSatsUsdPattern(this, 'utxos_6y_to_7y_old_supply_in_profit'), + _7yTo8y: createBtcCentsSatsUsdPattern(this, 'utxos_7y_to_8y_old_supply_in_profit'), + _8yTo10y: createBtcCentsSatsUsdPattern(this, 'utxos_8y_to_10y_old_supply_in_profit'), + _10yTo12y: createBtcCentsSatsUsdPattern(this, 'utxos_10y_to_12y_old_supply_in_profit'), + _12yTo15y: createBtcCentsSatsUsdPattern(this, 'utxos_12y_to_15y_old_supply_in_profit'), + over15y: createBtcCentsSatsUsdPattern(this, 'utxos_over_15y_old_supply_in_profit'), + }, + under: { + _1w: createBtcCentsSatsUsdPattern(this, 'utxos_under_1w_old_supply_in_profit'), + _1m: createBtcCentsSatsUsdPattern(this, 'utxos_under_1m_old_supply_in_profit'), + _2m: createBtcCentsSatsUsdPattern(this, 'utxos_under_2m_old_supply_in_profit'), + _3m: createBtcCentsSatsUsdPattern(this, 'utxos_under_3m_old_supply_in_profit'), + _4m: createBtcCentsSatsUsdPattern(this, 'utxos_under_4m_old_supply_in_profit'), + _5m: createBtcCentsSatsUsdPattern(this, 'utxos_under_5m_old_supply_in_profit'), + _6m: createBtcCentsSatsUsdPattern(this, 'utxos_under_6m_old_supply_in_profit'), + _9m: createBtcCentsSatsUsdPattern(this, 'utxos_under_9m_old_supply_in_profit'), + _1y: createBtcCentsSatsUsdPattern(this, 'utxos_under_1y_old_supply_in_profit'), + _18m: createBtcCentsSatsUsdPattern(this, 'utxos_under_18m_old_supply_in_profit'), + _2y: createBtcCentsSatsUsdPattern(this, 'utxos_under_2y_old_supply_in_profit'), + _3y: createBtcCentsSatsUsdPattern(this, 'utxos_under_3y_old_supply_in_profit'), + _4y: createBtcCentsSatsUsdPattern(this, 'utxos_under_4y_old_supply_in_profit'), + _5y: createBtcCentsSatsUsdPattern(this, 'utxos_under_5y_old_supply_in_profit'), + _6y: createBtcCentsSatsUsdPattern(this, 'utxos_under_6y_old_supply_in_profit'), + _7y: createBtcCentsSatsUsdPattern(this, 'utxos_under_7y_old_supply_in_profit'), + _8y: createBtcCentsSatsUsdPattern(this, 'utxos_under_8y_old_supply_in_profit'), + _10y: createBtcCentsSatsUsdPattern(this, 'utxos_under_10y_old_supply_in_profit'), + _12y: createBtcCentsSatsUsdPattern(this, 'utxos_under_12y_old_supply_in_profit'), + _15y: createBtcCentsSatsUsdPattern(this, 'utxos_under_15y_old_supply_in_profit'), + }, + over: { + _1d: createBtcCentsSatsUsdPattern(this, 'utxos_over_1d_old_supply_in_profit'), + _1w: createBtcCentsSatsUsdPattern(this, 'utxos_over_1w_old_supply_in_profit'), + _1m: createBtcCentsSatsUsdPattern(this, 'utxos_over_1m_old_supply_in_profit'), + _2m: createBtcCentsSatsUsdPattern(this, 'utxos_over_2m_old_supply_in_profit'), + _3m: createBtcCentsSatsUsdPattern(this, 'utxos_over_3m_old_supply_in_profit'), + _4m: createBtcCentsSatsUsdPattern(this, 'utxos_over_4m_old_supply_in_profit'), + _5m: createBtcCentsSatsUsdPattern(this, 'utxos_over_5m_old_supply_in_profit'), + _6m: createBtcCentsSatsUsdPattern(this, 'utxos_over_6m_old_supply_in_profit'), + _9m: createBtcCentsSatsUsdPattern(this, 'utxos_over_9m_old_supply_in_profit'), + _1y: createBtcCentsSatsUsdPattern(this, 'utxos_over_1y_old_supply_in_profit'), + _18m: createBtcCentsSatsUsdPattern(this, 'utxos_over_18m_old_supply_in_profit'), + _2y: createBtcCentsSatsUsdPattern(this, 'utxos_over_2y_old_supply_in_profit'), + _3y: createBtcCentsSatsUsdPattern(this, 'utxos_over_3y_old_supply_in_profit'), + _4y: createBtcCentsSatsUsdPattern(this, 'utxos_over_4y_old_supply_in_profit'), + _5y: createBtcCentsSatsUsdPattern(this, 'utxos_over_5y_old_supply_in_profit'), + _6y: createBtcCentsSatsUsdPattern(this, 'utxos_over_6y_old_supply_in_profit'), + _7y: createBtcCentsSatsUsdPattern(this, 'utxos_over_7y_old_supply_in_profit'), + _8y: createBtcCentsSatsUsdPattern(this, 'utxos_over_8y_old_supply_in_profit'), + _10y: createBtcCentsSatsUsdPattern(this, 'utxos_over_10y_old_supply_in_profit'), + _12y: createBtcCentsSatsUsdPattern(this, 'utxos_over_12y_old_supply_in_profit'), + }, + }, + epoch: { + _0: createBtcCentsSatsUsdPattern(this, 'epoch_0_supply_in_profit'), + _1: createBtcCentsSatsUsdPattern(this, 'epoch_1_supply_in_profit'), + _2: createBtcCentsSatsUsdPattern(this, 'epoch_2_supply_in_profit'), + _3: createBtcCentsSatsUsdPattern(this, 'epoch_3_supply_in_profit'), + _4: createBtcCentsSatsUsdPattern(this, 'epoch_4_supply_in_profit'), + }, + class: { + _2009: createBtcCentsSatsUsdPattern(this, 'class_2009_supply_in_profit'), + _2010: createBtcCentsSatsUsdPattern(this, 'class_2010_supply_in_profit'), + _2011: createBtcCentsSatsUsdPattern(this, 'class_2011_supply_in_profit'), + _2012: createBtcCentsSatsUsdPattern(this, 'class_2012_supply_in_profit'), + _2013: createBtcCentsSatsUsdPattern(this, 'class_2013_supply_in_profit'), + _2014: createBtcCentsSatsUsdPattern(this, 'class_2014_supply_in_profit'), + _2015: createBtcCentsSatsUsdPattern(this, 'class_2015_supply_in_profit'), + _2016: createBtcCentsSatsUsdPattern(this, 'class_2016_supply_in_profit'), + _2017: createBtcCentsSatsUsdPattern(this, 'class_2017_supply_in_profit'), + _2018: createBtcCentsSatsUsdPattern(this, 'class_2018_supply_in_profit'), + _2019: createBtcCentsSatsUsdPattern(this, 'class_2019_supply_in_profit'), + _2020: createBtcCentsSatsUsdPattern(this, 'class_2020_supply_in_profit'), + _2021: createBtcCentsSatsUsdPattern(this, 'class_2021_supply_in_profit'), + _2022: createBtcCentsSatsUsdPattern(this, 'class_2022_supply_in_profit'), + _2023: createBtcCentsSatsUsdPattern(this, 'class_2023_supply_in_profit'), + _2024: createBtcCentsSatsUsdPattern(this, 'class_2024_supply_in_profit'), + _2025: createBtcCentsSatsUsdPattern(this, 'class_2025_supply_in_profit'), + _2026: createBtcCentsSatsUsdPattern(this, 'class_2026_supply_in_profit'), + }, + entry: createDiscountPremiumPattern12(this, 'supply_in_profit'), + term: createLongShortPattern13(this, 'supply_in_profit'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10(this, 'supply_in_profit'), + ageRangeMatrix: createSeriesPattern18(this, 'utxos_supply_in_profit_sats_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'supply_in_profit_sats_by_epoch'), + classMatrix: createSeriesPattern18(this, 'supply_in_profit_sats_by_class'), + entryMatrix: createSeriesPattern18(this, 'supply_in_profit_sats_by_entry'), + typeMatrix: createSeriesPattern18(this, 'supply_in_profit_sats_by_type'), + }, + inLoss: { + all: createBtcCentsSatsUsdPattern(this, 'supply_in_loss'), + age: { + range: { + under1h: createBtcCentsSatsUsdPattern(this, 'utxos_under_1h_old_supply_in_loss'), + _1hTo1d: createBtcCentsSatsUsdPattern(this, 'utxos_1h_to_1d_old_supply_in_loss'), + _1dTo1w: createBtcCentsSatsUsdPattern(this, 'utxos_1d_to_1w_old_supply_in_loss'), + _1wTo1m: createBtcCentsSatsUsdPattern(this, 'utxos_1w_to_1m_old_supply_in_loss'), + _1mTo2m: createBtcCentsSatsUsdPattern(this, 'utxos_1m_to_2m_old_supply_in_loss'), + _2mTo3m: createBtcCentsSatsUsdPattern(this, 'utxos_2m_to_3m_old_supply_in_loss'), + _3mTo4m: createBtcCentsSatsUsdPattern(this, 'utxos_3m_to_4m_old_supply_in_loss'), + _4mTo5m: createBtcCentsSatsUsdPattern(this, 'utxos_4m_to_5m_old_supply_in_loss'), + _5mTo6m: createBtcCentsSatsUsdPattern(this, 'utxos_5m_to_6m_old_supply_in_loss'), + _6mTo9m: createBtcCentsSatsUsdPattern(this, 'utxos_6m_to_9m_old_supply_in_loss'), + _9mTo1y: createBtcCentsSatsUsdPattern(this, 'utxos_9m_to_1y_old_supply_in_loss'), + _1yTo18m: createBtcCentsSatsUsdPattern(this, 'utxos_1y_to_18m_old_supply_in_loss'), + _18mTo2y: createBtcCentsSatsUsdPattern(this, 'utxos_18m_to_2y_old_supply_in_loss'), + _2yTo3y: createBtcCentsSatsUsdPattern(this, 'utxos_2y_to_3y_old_supply_in_loss'), + _3yTo4y: createBtcCentsSatsUsdPattern(this, 'utxos_3y_to_4y_old_supply_in_loss'), + _4yTo5y: createBtcCentsSatsUsdPattern(this, 'utxos_4y_to_5y_old_supply_in_loss'), + _5yTo6y: createBtcCentsSatsUsdPattern(this, 'utxos_5y_to_6y_old_supply_in_loss'), + _6yTo7y: createBtcCentsSatsUsdPattern(this, 'utxos_6y_to_7y_old_supply_in_loss'), + _7yTo8y: createBtcCentsSatsUsdPattern(this, 'utxos_7y_to_8y_old_supply_in_loss'), + _8yTo10y: createBtcCentsSatsUsdPattern(this, 'utxos_8y_to_10y_old_supply_in_loss'), + _10yTo12y: createBtcCentsSatsUsdPattern(this, 'utxos_10y_to_12y_old_supply_in_loss'), + _12yTo15y: createBtcCentsSatsUsdPattern(this, 'utxos_12y_to_15y_old_supply_in_loss'), + over15y: createBtcCentsSatsUsdPattern(this, 'utxos_over_15y_old_supply_in_loss'), + }, + under: { + _1w: createBtcCentsSatsUsdPattern(this, 'utxos_under_1w_old_supply_in_loss'), + _1m: createBtcCentsSatsUsdPattern(this, 'utxos_under_1m_old_supply_in_loss'), + _2m: createBtcCentsSatsUsdPattern(this, 'utxos_under_2m_old_supply_in_loss'), + _3m: createBtcCentsSatsUsdPattern(this, 'utxos_under_3m_old_supply_in_loss'), + _4m: createBtcCentsSatsUsdPattern(this, 'utxos_under_4m_old_supply_in_loss'), + _5m: createBtcCentsSatsUsdPattern(this, 'utxos_under_5m_old_supply_in_loss'), + _6m: createBtcCentsSatsUsdPattern(this, 'utxos_under_6m_old_supply_in_loss'), + _9m: createBtcCentsSatsUsdPattern(this, 'utxos_under_9m_old_supply_in_loss'), + _1y: createBtcCentsSatsUsdPattern(this, 'utxos_under_1y_old_supply_in_loss'), + _18m: createBtcCentsSatsUsdPattern(this, 'utxos_under_18m_old_supply_in_loss'), + _2y: createBtcCentsSatsUsdPattern(this, 'utxos_under_2y_old_supply_in_loss'), + _3y: createBtcCentsSatsUsdPattern(this, 'utxos_under_3y_old_supply_in_loss'), + _4y: createBtcCentsSatsUsdPattern(this, 'utxos_under_4y_old_supply_in_loss'), + _5y: createBtcCentsSatsUsdPattern(this, 'utxos_under_5y_old_supply_in_loss'), + _6y: createBtcCentsSatsUsdPattern(this, 'utxos_under_6y_old_supply_in_loss'), + _7y: createBtcCentsSatsUsdPattern(this, 'utxos_under_7y_old_supply_in_loss'), + _8y: createBtcCentsSatsUsdPattern(this, 'utxos_under_8y_old_supply_in_loss'), + _10y: createBtcCentsSatsUsdPattern(this, 'utxos_under_10y_old_supply_in_loss'), + _12y: createBtcCentsSatsUsdPattern(this, 'utxos_under_12y_old_supply_in_loss'), + _15y: createBtcCentsSatsUsdPattern(this, 'utxos_under_15y_old_supply_in_loss'), + }, + over: { + _1d: createBtcCentsSatsUsdPattern(this, 'utxos_over_1d_old_supply_in_loss'), + _1w: createBtcCentsSatsUsdPattern(this, 'utxos_over_1w_old_supply_in_loss'), + _1m: createBtcCentsSatsUsdPattern(this, 'utxos_over_1m_old_supply_in_loss'), + _2m: createBtcCentsSatsUsdPattern(this, 'utxos_over_2m_old_supply_in_loss'), + _3m: createBtcCentsSatsUsdPattern(this, 'utxos_over_3m_old_supply_in_loss'), + _4m: createBtcCentsSatsUsdPattern(this, 'utxos_over_4m_old_supply_in_loss'), + _5m: createBtcCentsSatsUsdPattern(this, 'utxos_over_5m_old_supply_in_loss'), + _6m: createBtcCentsSatsUsdPattern(this, 'utxos_over_6m_old_supply_in_loss'), + _9m: createBtcCentsSatsUsdPattern(this, 'utxos_over_9m_old_supply_in_loss'), + _1y: createBtcCentsSatsUsdPattern(this, 'utxos_over_1y_old_supply_in_loss'), + _18m: createBtcCentsSatsUsdPattern(this, 'utxos_over_18m_old_supply_in_loss'), + _2y: createBtcCentsSatsUsdPattern(this, 'utxos_over_2y_old_supply_in_loss'), + _3y: createBtcCentsSatsUsdPattern(this, 'utxos_over_3y_old_supply_in_loss'), + _4y: createBtcCentsSatsUsdPattern(this, 'utxos_over_4y_old_supply_in_loss'), + _5y: createBtcCentsSatsUsdPattern(this, 'utxos_over_5y_old_supply_in_loss'), + _6y: createBtcCentsSatsUsdPattern(this, 'utxos_over_6y_old_supply_in_loss'), + _7y: createBtcCentsSatsUsdPattern(this, 'utxos_over_7y_old_supply_in_loss'), + _8y: createBtcCentsSatsUsdPattern(this, 'utxos_over_8y_old_supply_in_loss'), + _10y: createBtcCentsSatsUsdPattern(this, 'utxos_over_10y_old_supply_in_loss'), + _12y: createBtcCentsSatsUsdPattern(this, 'utxos_over_12y_old_supply_in_loss'), + }, + }, + epoch: { + _0: createBtcCentsSatsUsdPattern(this, 'epoch_0_supply_in_loss'), + _1: createBtcCentsSatsUsdPattern(this, 'epoch_1_supply_in_loss'), + _2: createBtcCentsSatsUsdPattern(this, 'epoch_2_supply_in_loss'), + _3: createBtcCentsSatsUsdPattern(this, 'epoch_3_supply_in_loss'), + _4: createBtcCentsSatsUsdPattern(this, 'epoch_4_supply_in_loss'), + }, + class: { + _2009: createBtcCentsSatsUsdPattern(this, 'class_2009_supply_in_loss'), + _2010: createBtcCentsSatsUsdPattern(this, 'class_2010_supply_in_loss'), + _2011: createBtcCentsSatsUsdPattern(this, 'class_2011_supply_in_loss'), + _2012: createBtcCentsSatsUsdPattern(this, 'class_2012_supply_in_loss'), + _2013: createBtcCentsSatsUsdPattern(this, 'class_2013_supply_in_loss'), + _2014: createBtcCentsSatsUsdPattern(this, 'class_2014_supply_in_loss'), + _2015: createBtcCentsSatsUsdPattern(this, 'class_2015_supply_in_loss'), + _2016: createBtcCentsSatsUsdPattern(this, 'class_2016_supply_in_loss'), + _2017: createBtcCentsSatsUsdPattern(this, 'class_2017_supply_in_loss'), + _2018: createBtcCentsSatsUsdPattern(this, 'class_2018_supply_in_loss'), + _2019: createBtcCentsSatsUsdPattern(this, 'class_2019_supply_in_loss'), + _2020: createBtcCentsSatsUsdPattern(this, 'class_2020_supply_in_loss'), + _2021: createBtcCentsSatsUsdPattern(this, 'class_2021_supply_in_loss'), + _2022: createBtcCentsSatsUsdPattern(this, 'class_2022_supply_in_loss'), + _2023: createBtcCentsSatsUsdPattern(this, 'class_2023_supply_in_loss'), + _2024: createBtcCentsSatsUsdPattern(this, 'class_2024_supply_in_loss'), + _2025: createBtcCentsSatsUsdPattern(this, 'class_2025_supply_in_loss'), + _2026: createBtcCentsSatsUsdPattern(this, 'class_2026_supply_in_loss'), + }, + entry: createDiscountPremiumPattern12(this, 'supply_in_loss'), + term: createLongShortPattern13(this, 'supply_in_loss'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10(this, 'supply_in_loss'), + ageRangeMatrix: createSeriesPattern18(this, 'utxos_supply_in_loss_sats_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'supply_in_loss_sats_by_epoch'), + classMatrix: createSeriesPattern18(this, 'supply_in_loss_sats_by_class'), + entryMatrix: createSeriesPattern18(this, 'supply_in_loss_sats_by_entry'), + typeMatrix: createSeriesPattern18(this, 'supply_in_loss_sats_by_type'), + }, + delta: { + all: createAbsoluteRatePattern2(this, 'supply_delta'), + age: { + range: { + under1h: createAbsoluteRatePattern2(this, 'utxos_under_1h_old_supply_delta'), + _1hTo1d: createAbsoluteRatePattern2(this, 'utxos_1h_to_1d_old_supply_delta'), + _1dTo1w: createAbsoluteRatePattern2(this, 'utxos_1d_to_1w_old_supply_delta'), + _1wTo1m: createAbsoluteRatePattern2(this, 'utxos_1w_to_1m_old_supply_delta'), + _1mTo2m: createAbsoluteRatePattern2(this, 'utxos_1m_to_2m_old_supply_delta'), + _2mTo3m: createAbsoluteRatePattern2(this, 'utxos_2m_to_3m_old_supply_delta'), + _3mTo4m: createAbsoluteRatePattern2(this, 'utxos_3m_to_4m_old_supply_delta'), + _4mTo5m: createAbsoluteRatePattern2(this, 'utxos_4m_to_5m_old_supply_delta'), + _5mTo6m: createAbsoluteRatePattern2(this, 'utxos_5m_to_6m_old_supply_delta'), + _6mTo9m: createAbsoluteRatePattern2(this, 'utxos_6m_to_9m_old_supply_delta'), + _9mTo1y: createAbsoluteRatePattern2(this, 'utxos_9m_to_1y_old_supply_delta'), + _1yTo18m: createAbsoluteRatePattern2(this, 'utxos_1y_to_18m_old_supply_delta'), + _18mTo2y: createAbsoluteRatePattern2(this, 'utxos_18m_to_2y_old_supply_delta'), + _2yTo3y: createAbsoluteRatePattern2(this, 'utxos_2y_to_3y_old_supply_delta'), + _3yTo4y: createAbsoluteRatePattern2(this, 'utxos_3y_to_4y_old_supply_delta'), + _4yTo5y: createAbsoluteRatePattern2(this, 'utxos_4y_to_5y_old_supply_delta'), + _5yTo6y: createAbsoluteRatePattern2(this, 'utxos_5y_to_6y_old_supply_delta'), + _6yTo7y: createAbsoluteRatePattern2(this, 'utxos_6y_to_7y_old_supply_delta'), + _7yTo8y: createAbsoluteRatePattern2(this, 'utxos_7y_to_8y_old_supply_delta'), + _8yTo10y: createAbsoluteRatePattern2(this, 'utxos_8y_to_10y_old_supply_delta'), + _10yTo12y: createAbsoluteRatePattern2(this, 'utxos_10y_to_12y_old_supply_delta'), + _12yTo15y: createAbsoluteRatePattern2(this, 'utxos_12y_to_15y_old_supply_delta'), + over15y: createAbsoluteRatePattern2(this, 'utxos_over_15y_old_supply_delta'), + }, + under: { + _1w: createAbsoluteRatePattern2(this, 'utxos_under_1w_old_supply_delta'), + _1m: createAbsoluteRatePattern2(this, 'utxos_under_1m_old_supply_delta'), + _2m: createAbsoluteRatePattern2(this, 'utxos_under_2m_old_supply_delta'), + _3m: createAbsoluteRatePattern2(this, 'utxos_under_3m_old_supply_delta'), + _4m: createAbsoluteRatePattern2(this, 'utxos_under_4m_old_supply_delta'), + _5m: createAbsoluteRatePattern2(this, 'utxos_under_5m_old_supply_delta'), + _6m: createAbsoluteRatePattern2(this, 'utxos_under_6m_old_supply_delta'), + _9m: createAbsoluteRatePattern2(this, 'utxos_under_9m_old_supply_delta'), + _1y: createAbsoluteRatePattern2(this, 'utxos_under_1y_old_supply_delta'), + _18m: createAbsoluteRatePattern2(this, 'utxos_under_18m_old_supply_delta'), + _2y: createAbsoluteRatePattern2(this, 'utxos_under_2y_old_supply_delta'), + _3y: createAbsoluteRatePattern2(this, 'utxos_under_3y_old_supply_delta'), + _4y: createAbsoluteRatePattern2(this, 'utxos_under_4y_old_supply_delta'), + _5y: createAbsoluteRatePattern2(this, 'utxos_under_5y_old_supply_delta'), + _6y: createAbsoluteRatePattern2(this, 'utxos_under_6y_old_supply_delta'), + _7y: createAbsoluteRatePattern2(this, 'utxos_under_7y_old_supply_delta'), + _8y: createAbsoluteRatePattern2(this, 'utxos_under_8y_old_supply_delta'), + _10y: createAbsoluteRatePattern2(this, 'utxos_under_10y_old_supply_delta'), + _12y: createAbsoluteRatePattern2(this, 'utxos_under_12y_old_supply_delta'), + _15y: createAbsoluteRatePattern2(this, 'utxos_under_15y_old_supply_delta'), + }, + over: { + _1d: createAbsoluteRatePattern2(this, 'utxos_over_1d_old_supply_delta'), + _1w: createAbsoluteRatePattern2(this, 'utxos_over_1w_old_supply_delta'), + _1m: createAbsoluteRatePattern2(this, 'utxos_over_1m_old_supply_delta'), + _2m: createAbsoluteRatePattern2(this, 'utxos_over_2m_old_supply_delta'), + _3m: createAbsoluteRatePattern2(this, 'utxos_over_3m_old_supply_delta'), + _4m: createAbsoluteRatePattern2(this, 'utxos_over_4m_old_supply_delta'), + _5m: createAbsoluteRatePattern2(this, 'utxos_over_5m_old_supply_delta'), + _6m: createAbsoluteRatePattern2(this, 'utxos_over_6m_old_supply_delta'), + _9m: createAbsoluteRatePattern2(this, 'utxos_over_9m_old_supply_delta'), + _1y: createAbsoluteRatePattern2(this, 'utxos_over_1y_old_supply_delta'), + _18m: createAbsoluteRatePattern2(this, 'utxos_over_18m_old_supply_delta'), + _2y: createAbsoluteRatePattern2(this, 'utxos_over_2y_old_supply_delta'), + _3y: createAbsoluteRatePattern2(this, 'utxos_over_3y_old_supply_delta'), + _4y: createAbsoluteRatePattern2(this, 'utxos_over_4y_old_supply_delta'), + _5y: createAbsoluteRatePattern2(this, 'utxos_over_5y_old_supply_delta'), + _6y: createAbsoluteRatePattern2(this, 'utxos_over_6y_old_supply_delta'), + _7y: createAbsoluteRatePattern2(this, 'utxos_over_7y_old_supply_delta'), + _8y: createAbsoluteRatePattern2(this, 'utxos_over_8y_old_supply_delta'), + _10y: createAbsoluteRatePattern2(this, 'utxos_over_10y_old_supply_delta'), + _12y: createAbsoluteRatePattern2(this, 'utxos_over_12y_old_supply_delta'), + }, + }, + epoch: { + _0: createAbsoluteRatePattern2(this, 'epoch_0_supply_delta'), + _1: createAbsoluteRatePattern2(this, 'epoch_1_supply_delta'), + _2: createAbsoluteRatePattern2(this, 'epoch_2_supply_delta'), + _3: createAbsoluteRatePattern2(this, 'epoch_3_supply_delta'), + _4: createAbsoluteRatePattern2(this, 'epoch_4_supply_delta'), + }, + class: { + _2009: createAbsoluteRatePattern2(this, 'class_2009_supply_delta'), + _2010: createAbsoluteRatePattern2(this, 'class_2010_supply_delta'), + _2011: createAbsoluteRatePattern2(this, 'class_2011_supply_delta'), + _2012: createAbsoluteRatePattern2(this, 'class_2012_supply_delta'), + _2013: createAbsoluteRatePattern2(this, 'class_2013_supply_delta'), + _2014: createAbsoluteRatePattern2(this, 'class_2014_supply_delta'), + _2015: createAbsoluteRatePattern2(this, 'class_2015_supply_delta'), + _2016: createAbsoluteRatePattern2(this, 'class_2016_supply_delta'), + _2017: createAbsoluteRatePattern2(this, 'class_2017_supply_delta'), + _2018: createAbsoluteRatePattern2(this, 'class_2018_supply_delta'), + _2019: createAbsoluteRatePattern2(this, 'class_2019_supply_delta'), + _2020: createAbsoluteRatePattern2(this, 'class_2020_supply_delta'), + _2021: createAbsoluteRatePattern2(this, 'class_2021_supply_delta'), + _2022: createAbsoluteRatePattern2(this, 'class_2022_supply_delta'), + _2023: createAbsoluteRatePattern2(this, 'class_2023_supply_delta'), + _2024: createAbsoluteRatePattern2(this, 'class_2024_supply_delta'), + _2025: createAbsoluteRatePattern2(this, 'class_2025_supply_delta'), + _2026: createAbsoluteRatePattern2(this, 'class_2026_supply_delta'), + }, + entry: { + discount: createAbsoluteRatePattern2(this, 'veteran_supply_delta'), + premium: createAbsoluteRatePattern2(this, 'rookie_supply_delta'), + }, + utxoAmount: createOverRangeUnderPattern17(this, 'utxos'), + term: { + short: createAbsoluteRatePattern2(this, 'sth_supply_delta'), + long: createAbsoluteRatePattern2(this, 'lth_supply_delta'), + }, + type: { + p2pk65: createAbsoluteRatePattern2(this, 'p2pk65_supply_delta'), + p2pk33: createAbsoluteRatePattern2(this, 'p2pk33_supply_delta'), + p2pkh: createAbsoluteRatePattern2(this, 'p2pkh_supply_delta'), + p2ms: createAbsoluteRatePattern2(this, 'p2ms_supply_delta'), + p2sh: createAbsoluteRatePattern2(this, 'p2sh_supply_delta'), + p2wpkh: createAbsoluteRatePattern2(this, 'p2wpkh_supply_delta'), + p2wsh: createAbsoluteRatePattern2(this, 'p2wsh_supply_delta'), + p2tr: createAbsoluteRatePattern2(this, 'p2tr_supply_delta'), + p2a: createAbsoluteRatePattern2(this, 'p2a_supply_delta'), + unknown: createAbsoluteRatePattern2(this, 'unknown_outputs_supply_delta'), + empty: createAbsoluteRatePattern2(this, 'empty_outputs_supply_delta'), + }, + addrBalance: createOverRangeUnderPattern17(this, 'addrs'), + }, + dominance: { + all: createPercentPpmRatioPattern2(this, 'supply_dominance'), + age: { + range: { + under1h: createPercentPpmRatioPattern2(this, 'utxos_under_1h_old_supply_dominance'), + _1hTo1d: createPercentPpmRatioPattern2(this, 'utxos_1h_to_1d_old_supply_dominance'), + _1dTo1w: createPercentPpmRatioPattern2(this, 'utxos_1d_to_1w_old_supply_dominance'), + _1wTo1m: createPercentPpmRatioPattern2(this, 'utxos_1w_to_1m_old_supply_dominance'), + _1mTo2m: createPercentPpmRatioPattern2(this, 'utxos_1m_to_2m_old_supply_dominance'), + _2mTo3m: createPercentPpmRatioPattern2(this, 'utxos_2m_to_3m_old_supply_dominance'), + _3mTo4m: createPercentPpmRatioPattern2(this, 'utxos_3m_to_4m_old_supply_dominance'), + _4mTo5m: createPercentPpmRatioPattern2(this, 'utxos_4m_to_5m_old_supply_dominance'), + _5mTo6m: createPercentPpmRatioPattern2(this, 'utxos_5m_to_6m_old_supply_dominance'), + _6mTo9m: createPercentPpmRatioPattern2(this, 'utxos_6m_to_9m_old_supply_dominance'), + _9mTo1y: createPercentPpmRatioPattern2(this, 'utxos_9m_to_1y_old_supply_dominance'), + _1yTo18m: createPercentPpmRatioPattern2(this, 'utxos_1y_to_18m_old_supply_dominance'), + _18mTo2y: createPercentPpmRatioPattern2(this, 'utxos_18m_to_2y_old_supply_dominance'), + _2yTo3y: createPercentPpmRatioPattern2(this, 'utxos_2y_to_3y_old_supply_dominance'), + _3yTo4y: createPercentPpmRatioPattern2(this, 'utxos_3y_to_4y_old_supply_dominance'), + _4yTo5y: createPercentPpmRatioPattern2(this, 'utxos_4y_to_5y_old_supply_dominance'), + _5yTo6y: createPercentPpmRatioPattern2(this, 'utxos_5y_to_6y_old_supply_dominance'), + _6yTo7y: createPercentPpmRatioPattern2(this, 'utxos_6y_to_7y_old_supply_dominance'), + _7yTo8y: createPercentPpmRatioPattern2(this, 'utxos_7y_to_8y_old_supply_dominance'), + _8yTo10y: createPercentPpmRatioPattern2(this, 'utxos_8y_to_10y_old_supply_dominance'), + _10yTo12y: createPercentPpmRatioPattern2(this, 'utxos_10y_to_12y_old_supply_dominance'), + _12yTo15y: createPercentPpmRatioPattern2(this, 'utxos_12y_to_15y_old_supply_dominance'), + over15y: createPercentPpmRatioPattern2(this, 'utxos_over_15y_old_supply_dominance'), + }, + under: { + _1w: createPercentPpmRatioPattern2(this, 'utxos_under_1w_old_supply_dominance'), + _1m: createPercentPpmRatioPattern2(this, 'utxos_under_1m_old_supply_dominance'), + _2m: createPercentPpmRatioPattern2(this, 'utxos_under_2m_old_supply_dominance'), + _3m: createPercentPpmRatioPattern2(this, 'utxos_under_3m_old_supply_dominance'), + _4m: createPercentPpmRatioPattern2(this, 'utxos_under_4m_old_supply_dominance'), + _5m: createPercentPpmRatioPattern2(this, 'utxos_under_5m_old_supply_dominance'), + _6m: createPercentPpmRatioPattern2(this, 'utxos_under_6m_old_supply_dominance'), + _9m: createPercentPpmRatioPattern2(this, 'utxos_under_9m_old_supply_dominance'), + _1y: createPercentPpmRatioPattern2(this, 'utxos_under_1y_old_supply_dominance'), + _18m: createPercentPpmRatioPattern2(this, 'utxos_under_18m_old_supply_dominance'), + _2y: createPercentPpmRatioPattern2(this, 'utxos_under_2y_old_supply_dominance'), + _3y: createPercentPpmRatioPattern2(this, 'utxos_under_3y_old_supply_dominance'), + _4y: createPercentPpmRatioPattern2(this, 'utxos_under_4y_old_supply_dominance'), + _5y: createPercentPpmRatioPattern2(this, 'utxos_under_5y_old_supply_dominance'), + _6y: createPercentPpmRatioPattern2(this, 'utxos_under_6y_old_supply_dominance'), + _7y: createPercentPpmRatioPattern2(this, 'utxos_under_7y_old_supply_dominance'), + _8y: createPercentPpmRatioPattern2(this, 'utxos_under_8y_old_supply_dominance'), + _10y: createPercentPpmRatioPattern2(this, 'utxos_under_10y_old_supply_dominance'), + _12y: createPercentPpmRatioPattern2(this, 'utxos_under_12y_old_supply_dominance'), + _15y: createPercentPpmRatioPattern2(this, 'utxos_under_15y_old_supply_dominance'), + }, + over: { + _1d: createPercentPpmRatioPattern2(this, 'utxos_over_1d_old_supply_dominance'), + _1w: createPercentPpmRatioPattern2(this, 'utxos_over_1w_old_supply_dominance'), + _1m: createPercentPpmRatioPattern2(this, 'utxos_over_1m_old_supply_dominance'), + _2m: createPercentPpmRatioPattern2(this, 'utxos_over_2m_old_supply_dominance'), + _3m: createPercentPpmRatioPattern2(this, 'utxos_over_3m_old_supply_dominance'), + _4m: createPercentPpmRatioPattern2(this, 'utxos_over_4m_old_supply_dominance'), + _5m: createPercentPpmRatioPattern2(this, 'utxos_over_5m_old_supply_dominance'), + _6m: createPercentPpmRatioPattern2(this, 'utxos_over_6m_old_supply_dominance'), + _9m: createPercentPpmRatioPattern2(this, 'utxos_over_9m_old_supply_dominance'), + _1y: createPercentPpmRatioPattern2(this, 'utxos_over_1y_old_supply_dominance'), + _18m: createPercentPpmRatioPattern2(this, 'utxos_over_18m_old_supply_dominance'), + _2y: createPercentPpmRatioPattern2(this, 'utxos_over_2y_old_supply_dominance'), + _3y: createPercentPpmRatioPattern2(this, 'utxos_over_3y_old_supply_dominance'), + _4y: createPercentPpmRatioPattern2(this, 'utxos_over_4y_old_supply_dominance'), + _5y: createPercentPpmRatioPattern2(this, 'utxos_over_5y_old_supply_dominance'), + _6y: createPercentPpmRatioPattern2(this, 'utxos_over_6y_old_supply_dominance'), + _7y: createPercentPpmRatioPattern2(this, 'utxos_over_7y_old_supply_dominance'), + _8y: createPercentPpmRatioPattern2(this, 'utxos_over_8y_old_supply_dominance'), + _10y: createPercentPpmRatioPattern2(this, 'utxos_over_10y_old_supply_dominance'), + _12y: createPercentPpmRatioPattern2(this, 'utxos_over_12y_old_supply_dominance'), + }, + }, + epoch: { + _0: createPercentPpmRatioPattern2(this, 'epoch_0_supply_dominance'), + _1: createPercentPpmRatioPattern2(this, 'epoch_1_supply_dominance'), + _2: createPercentPpmRatioPattern2(this, 'epoch_2_supply_dominance'), + _3: createPercentPpmRatioPattern2(this, 'epoch_3_supply_dominance'), + _4: createPercentPpmRatioPattern2(this, 'epoch_4_supply_dominance'), + }, + class: { + _2009: createPercentPpmRatioPattern2(this, 'class_2009_supply_dominance'), + _2010: createPercentPpmRatioPattern2(this, 'class_2010_supply_dominance'), + _2011: createPercentPpmRatioPattern2(this, 'class_2011_supply_dominance'), + _2012: createPercentPpmRatioPattern2(this, 'class_2012_supply_dominance'), + _2013: createPercentPpmRatioPattern2(this, 'class_2013_supply_dominance'), + _2014: createPercentPpmRatioPattern2(this, 'class_2014_supply_dominance'), + _2015: createPercentPpmRatioPattern2(this, 'class_2015_supply_dominance'), + _2016: createPercentPpmRatioPattern2(this, 'class_2016_supply_dominance'), + _2017: createPercentPpmRatioPattern2(this, 'class_2017_supply_dominance'), + _2018: createPercentPpmRatioPattern2(this, 'class_2018_supply_dominance'), + _2019: createPercentPpmRatioPattern2(this, 'class_2019_supply_dominance'), + _2020: createPercentPpmRatioPattern2(this, 'class_2020_supply_dominance'), + _2021: createPercentPpmRatioPattern2(this, 'class_2021_supply_dominance'), + _2022: createPercentPpmRatioPattern2(this, 'class_2022_supply_dominance'), + _2023: createPercentPpmRatioPattern2(this, 'class_2023_supply_dominance'), + _2024: createPercentPpmRatioPattern2(this, 'class_2024_supply_dominance'), + _2025: createPercentPpmRatioPattern2(this, 'class_2025_supply_dominance'), + _2026: createPercentPpmRatioPattern2(this, 'class_2026_supply_dominance'), + }, + entry: { + discount: createPercentPpmRatioPattern2(this, 'veteran_supply_dominance'), + premium: createPercentPpmRatioPattern2(this, 'rookie_supply_dominance'), + }, + utxoAmount: createOverRangeUnderPattern19(this, 'utxos'), + term: { + short: createPercentPpmRatioPattern2(this, 'sth_supply_dominance'), + long: createPercentPpmRatioPattern2(this, 'lth_supply_dominance'), + }, + type: { + p2pk65: createPercentPpmRatioPattern2(this, 'p2pk65_supply_dominance'), + p2pk33: createPercentPpmRatioPattern2(this, 'p2pk33_supply_dominance'), + p2pkh: createPercentPpmRatioPattern2(this, 'p2pkh_supply_dominance'), + p2ms: createPercentPpmRatioPattern2(this, 'p2ms_supply_dominance'), + p2sh: createPercentPpmRatioPattern2(this, 'p2sh_supply_dominance'), + p2wpkh: createPercentPpmRatioPattern2(this, 'p2wpkh_supply_dominance'), + p2wsh: createPercentPpmRatioPattern2(this, 'p2wsh_supply_dominance'), + p2tr: createPercentPpmRatioPattern2(this, 'p2tr_supply_dominance'), + p2a: createPercentPpmRatioPattern2(this, 'p2a_supply_dominance'), + unknown: createPercentPpmRatioPattern2(this, 'unknown_outputs_supply_dominance'), + empty: createPercentPpmRatioPattern2(this, 'empty_outputs_supply_dominance'), + }, + addrBalance: createOverRangeUnderPattern19(this, 'addrs'), }, - costBasis: createInMaxMinPerSupplyPattern(this, 'lth'), - unrealized: createCapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(this, 'lth'), - investedCapital: createInPattern(this, 'lth_invested_capital_in'), }, - ageRange: { - under1h: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_1h_old'), - _1hTo1d: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_1h_to_1d_old'), - _1dTo1w: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_1d_to_1w_old'), - _1wTo1m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_1w_to_1m_old'), - _1mTo2m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_1m_to_2m_old'), - _2mTo3m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_2m_to_3m_old'), - _3mTo4m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_3m_to_4m_old'), - _4mTo5m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_4m_to_5m_old'), - _5mTo6m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_5m_to_6m_old'), - _6mTo9m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_6m_to_9m_old'), - _9mTo1y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_9m_to_1y_old'), - _1yTo18m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_1y_to_18m_old'), - _18mTo2y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_18m_to_2y_old'), - _2yTo3y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_2y_to_3y_old'), - _3yTo4y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_3y_to_4y_old'), - _4yTo5y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_4y_to_5y_old'), - _5yTo6y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_5y_to_6y_old'), - _6yTo7y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_6y_to_7y_old'), - _7yTo8y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_7y_to_8y_old'), - _8yTo10y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_8y_to_10y_old'), - _10yTo12y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_10y_to_12y_old'), - _12yTo15y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_12y_to_15y_old'), - over15y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_15y_old'), + outputs: { + unspentCount: { + all: createBaseDeltaPattern(this, 'utxo_count'), + age: { + range: { + under1h: createBaseDeltaPattern(this, 'utxos_under_1h_old_utxo_count'), + _1hTo1d: createBaseDeltaPattern(this, 'utxos_1h_to_1d_old_utxo_count'), + _1dTo1w: createBaseDeltaPattern(this, 'utxos_1d_to_1w_old_utxo_count'), + _1wTo1m: createBaseDeltaPattern(this, 'utxos_1w_to_1m_old_utxo_count'), + _1mTo2m: createBaseDeltaPattern(this, 'utxos_1m_to_2m_old_utxo_count'), + _2mTo3m: createBaseDeltaPattern(this, 'utxos_2m_to_3m_old_utxo_count'), + _3mTo4m: createBaseDeltaPattern(this, 'utxos_3m_to_4m_old_utxo_count'), + _4mTo5m: createBaseDeltaPattern(this, 'utxos_4m_to_5m_old_utxo_count'), + _5mTo6m: createBaseDeltaPattern(this, 'utxos_5m_to_6m_old_utxo_count'), + _6mTo9m: createBaseDeltaPattern(this, 'utxos_6m_to_9m_old_utxo_count'), + _9mTo1y: createBaseDeltaPattern(this, 'utxos_9m_to_1y_old_utxo_count'), + _1yTo18m: createBaseDeltaPattern(this, 'utxos_1y_to_18m_old_utxo_count'), + _18mTo2y: createBaseDeltaPattern(this, 'utxos_18m_to_2y_old_utxo_count'), + _2yTo3y: createBaseDeltaPattern(this, 'utxos_2y_to_3y_old_utxo_count'), + _3yTo4y: createBaseDeltaPattern(this, 'utxos_3y_to_4y_old_utxo_count'), + _4yTo5y: createBaseDeltaPattern(this, 'utxos_4y_to_5y_old_utxo_count'), + _5yTo6y: createBaseDeltaPattern(this, 'utxos_5y_to_6y_old_utxo_count'), + _6yTo7y: createBaseDeltaPattern(this, 'utxos_6y_to_7y_old_utxo_count'), + _7yTo8y: createBaseDeltaPattern(this, 'utxos_7y_to_8y_old_utxo_count'), + _8yTo10y: createBaseDeltaPattern(this, 'utxos_8y_to_10y_old_utxo_count'), + _10yTo12y: createBaseDeltaPattern(this, 'utxos_10y_to_12y_old_utxo_count'), + _12yTo15y: createBaseDeltaPattern(this, 'utxos_12y_to_15y_old_utxo_count'), + over15y: createBaseDeltaPattern(this, 'utxos_over_15y_old_utxo_count'), + }, + under: { + _1w: createBaseDeltaPattern(this, 'utxos_under_1w_old_utxo_count'), + _1m: createBaseDeltaPattern(this, 'utxos_under_1m_old_utxo_count'), + _2m: createBaseDeltaPattern(this, 'utxos_under_2m_old_utxo_count'), + _3m: createBaseDeltaPattern(this, 'utxos_under_3m_old_utxo_count'), + _4m: createBaseDeltaPattern(this, 'utxos_under_4m_old_utxo_count'), + _5m: createBaseDeltaPattern(this, 'utxos_under_5m_old_utxo_count'), + _6m: createBaseDeltaPattern(this, 'utxos_under_6m_old_utxo_count'), + _9m: createBaseDeltaPattern(this, 'utxos_under_9m_old_utxo_count'), + _1y: createBaseDeltaPattern(this, 'utxos_under_1y_old_utxo_count'), + _18m: createBaseDeltaPattern(this, 'utxos_under_18m_old_utxo_count'), + _2y: createBaseDeltaPattern(this, 'utxos_under_2y_old_utxo_count'), + _3y: createBaseDeltaPattern(this, 'utxos_under_3y_old_utxo_count'), + _4y: createBaseDeltaPattern(this, 'utxos_under_4y_old_utxo_count'), + _5y: createBaseDeltaPattern(this, 'utxos_under_5y_old_utxo_count'), + _6y: createBaseDeltaPattern(this, 'utxos_under_6y_old_utxo_count'), + _7y: createBaseDeltaPattern(this, 'utxos_under_7y_old_utxo_count'), + _8y: createBaseDeltaPattern(this, 'utxos_under_8y_old_utxo_count'), + _10y: createBaseDeltaPattern(this, 'utxos_under_10y_old_utxo_count'), + _12y: createBaseDeltaPattern(this, 'utxos_under_12y_old_utxo_count'), + _15y: createBaseDeltaPattern(this, 'utxos_under_15y_old_utxo_count'), + }, + over: { + _1d: createBaseDeltaPattern(this, 'utxos_over_1d_old_utxo_count'), + _1w: createBaseDeltaPattern(this, 'utxos_over_1w_old_utxo_count'), + _1m: createBaseDeltaPattern(this, 'utxos_over_1m_old_utxo_count'), + _2m: createBaseDeltaPattern(this, 'utxos_over_2m_old_utxo_count'), + _3m: createBaseDeltaPattern(this, 'utxos_over_3m_old_utxo_count'), + _4m: createBaseDeltaPattern(this, 'utxos_over_4m_old_utxo_count'), + _5m: createBaseDeltaPattern(this, 'utxos_over_5m_old_utxo_count'), + _6m: createBaseDeltaPattern(this, 'utxos_over_6m_old_utxo_count'), + _9m: createBaseDeltaPattern(this, 'utxos_over_9m_old_utxo_count'), + _1y: createBaseDeltaPattern(this, 'utxos_over_1y_old_utxo_count'), + _18m: createBaseDeltaPattern(this, 'utxos_over_18m_old_utxo_count'), + _2y: createBaseDeltaPattern(this, 'utxos_over_2y_old_utxo_count'), + _3y: createBaseDeltaPattern(this, 'utxos_over_3y_old_utxo_count'), + _4y: createBaseDeltaPattern(this, 'utxos_over_4y_old_utxo_count'), + _5y: createBaseDeltaPattern(this, 'utxos_over_5y_old_utxo_count'), + _6y: createBaseDeltaPattern(this, 'utxos_over_6y_old_utxo_count'), + _7y: createBaseDeltaPattern(this, 'utxos_over_7y_old_utxo_count'), + _8y: createBaseDeltaPattern(this, 'utxos_over_8y_old_utxo_count'), + _10y: createBaseDeltaPattern(this, 'utxos_over_10y_old_utxo_count'), + _12y: createBaseDeltaPattern(this, 'utxos_over_12y_old_utxo_count'), + }, + }, + epoch: { + _0: createBaseDeltaPattern(this, 'epoch_0_utxo_count'), + _1: createBaseDeltaPattern(this, 'epoch_1_utxo_count'), + _2: createBaseDeltaPattern(this, 'epoch_2_utxo_count'), + _3: createBaseDeltaPattern(this, 'epoch_3_utxo_count'), + _4: createBaseDeltaPattern(this, 'epoch_4_utxo_count'), + }, + class: { + _2009: createBaseDeltaPattern(this, 'class_2009_utxo_count'), + _2010: createBaseDeltaPattern(this, 'class_2010_utxo_count'), + _2011: createBaseDeltaPattern(this, 'class_2011_utxo_count'), + _2012: createBaseDeltaPattern(this, 'class_2012_utxo_count'), + _2013: createBaseDeltaPattern(this, 'class_2013_utxo_count'), + _2014: createBaseDeltaPattern(this, 'class_2014_utxo_count'), + _2015: createBaseDeltaPattern(this, 'class_2015_utxo_count'), + _2016: createBaseDeltaPattern(this, 'class_2016_utxo_count'), + _2017: createBaseDeltaPattern(this, 'class_2017_utxo_count'), + _2018: createBaseDeltaPattern(this, 'class_2018_utxo_count'), + _2019: createBaseDeltaPattern(this, 'class_2019_utxo_count'), + _2020: createBaseDeltaPattern(this, 'class_2020_utxo_count'), + _2021: createBaseDeltaPattern(this, 'class_2021_utxo_count'), + _2022: createBaseDeltaPattern(this, 'class_2022_utxo_count'), + _2023: createBaseDeltaPattern(this, 'class_2023_utxo_count'), + _2024: createBaseDeltaPattern(this, 'class_2024_utxo_count'), + _2025: createBaseDeltaPattern(this, 'class_2025_utxo_count'), + _2026: createBaseDeltaPattern(this, 'class_2026_utxo_count'), + }, + entry: { + discount: createBaseDeltaPattern(this, 'veteran_utxo_count'), + premium: createBaseDeltaPattern(this, 'rookie_utxo_count'), + }, + utxoAmount: { + range: { + _0sats: createBaseDeltaPattern(this, 'utxos_0sats_utxo_count'), + _1satTo10sats: createBaseDeltaPattern(this, 'utxos_1sat_to_10sats_utxo_count'), + _10satsTo100sats: createBaseDeltaPattern(this, 'utxos_10sats_to_100sats_utxo_count'), + _100satsTo1kSats: createBaseDeltaPattern(this, 'utxos_100sats_to_1k_sats_utxo_count'), + _1kSatsTo10kSats: createBaseDeltaPattern(this, 'utxos_1k_sats_to_10k_sats_utxo_count'), + _10kSatsTo100kSats: createBaseDeltaPattern(this, 'utxos_10k_sats_to_100k_sats_utxo_count'), + _100kSatsTo1mSats: createBaseDeltaPattern(this, 'utxos_100k_sats_to_1m_sats_utxo_count'), + _1mSatsTo10mSats: createBaseDeltaPattern(this, 'utxos_1m_sats_to_10m_sats_utxo_count'), + _10mSatsTo1btc: createBaseDeltaPattern(this, 'utxos_10m_sats_to_1btc_utxo_count'), + _1btcTo10btc: createBaseDeltaPattern(this, 'utxos_1btc_to_10btc_utxo_count'), + _10btcTo100btc: createBaseDeltaPattern(this, 'utxos_10btc_to_100btc_utxo_count'), + _100btcTo1kBtc: createBaseDeltaPattern(this, 'utxos_100btc_to_1k_btc_utxo_count'), + _1kBtcTo10kBtc: createBaseDeltaPattern(this, 'utxos_1k_btc_to_10k_btc_utxo_count'), + _10kBtcTo100kBtc: createBaseDeltaPattern(this, 'utxos_10k_btc_to_100k_btc_utxo_count'), + over100kBtc: createBaseDeltaPattern(this, 'utxos_over_100k_btc_utxo_count'), + }, + under: { + _10sats: createBaseDeltaPattern(this, 'utxos_under_10sats_utxo_count'), + _100sats: createBaseDeltaPattern(this, 'utxos_under_100sats_utxo_count'), + _1kSats: createBaseDeltaPattern(this, 'utxos_under_1k_sats_utxo_count'), + _10kSats: createBaseDeltaPattern(this, 'utxos_under_10k_sats_utxo_count'), + _100kSats: createBaseDeltaPattern(this, 'utxos_under_100k_sats_utxo_count'), + _1mSats: createBaseDeltaPattern(this, 'utxos_under_1m_sats_utxo_count'), + _10mSats: createBaseDeltaPattern(this, 'utxos_under_10m_sats_utxo_count'), + _1btc: createBaseDeltaPattern(this, 'utxos_under_1btc_utxo_count'), + _10btc: createBaseDeltaPattern(this, 'utxos_under_10btc_utxo_count'), + _100btc: createBaseDeltaPattern(this, 'utxos_under_100btc_utxo_count'), + _1kBtc: createBaseDeltaPattern(this, 'utxos_under_1k_btc_utxo_count'), + _10kBtc: createBaseDeltaPattern(this, 'utxos_under_10k_btc_utxo_count'), + _100kBtc: createBaseDeltaPattern(this, 'utxos_under_100k_btc_utxo_count'), + }, + over: { + _1sat: createBaseDeltaPattern(this, 'utxos_over_1sat_utxo_count'), + _10sats: createBaseDeltaPattern(this, 'utxos_over_10sats_utxo_count'), + _100sats: createBaseDeltaPattern(this, 'utxos_over_100sats_utxo_count'), + _1kSats: createBaseDeltaPattern(this, 'utxos_over_1k_sats_utxo_count'), + _10kSats: createBaseDeltaPattern(this, 'utxos_over_10k_sats_utxo_count'), + _100kSats: createBaseDeltaPattern(this, 'utxos_over_100k_sats_utxo_count'), + _1mSats: createBaseDeltaPattern(this, 'utxos_over_1m_sats_utxo_count'), + _10mSats: createBaseDeltaPattern(this, 'utxos_over_10m_sats_utxo_count'), + _1btc: createBaseDeltaPattern(this, 'utxos_over_1btc_utxo_count'), + _10btc: createBaseDeltaPattern(this, 'utxos_over_10btc_utxo_count'), + _100btc: createBaseDeltaPattern(this, 'utxos_over_100btc_utxo_count'), + _1kBtc: createBaseDeltaPattern(this, 'utxos_over_1k_btc_utxo_count'), + _10kBtc: createBaseDeltaPattern(this, 'utxos_over_10k_btc_utxo_count'), + }, + }, + term: { + short: createBaseDeltaPattern(this, 'sth_utxo_count'), + long: createBaseDeltaPattern(this, 'lth_utxo_count'), + }, + type: { + p2pk65: createBaseDeltaPattern(this, 'p2pk65_utxo_count'), + p2pk33: createBaseDeltaPattern(this, 'p2pk33_utxo_count'), + p2pkh: createBaseDeltaPattern(this, 'p2pkh_utxo_count'), + p2ms: createBaseDeltaPattern(this, 'p2ms_utxo_count'), + p2sh: createBaseDeltaPattern(this, 'p2sh_utxo_count'), + p2wpkh: createBaseDeltaPattern(this, 'p2wpkh_utxo_count'), + p2wsh: createBaseDeltaPattern(this, 'p2wsh_utxo_count'), + p2tr: createBaseDeltaPattern(this, 'p2tr_utxo_count'), + p2a: createBaseDeltaPattern(this, 'p2a_utxo_count'), + unknown: createBaseDeltaPattern(this, 'unknown_outputs_utxo_count'), + empty: createBaseDeltaPattern(this, 'empty_outputs_utxo_count'), + }, + ageRangeMatrix: createSeriesPattern18(this, 'utxos_utxo_count_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'utxo_count_by_epoch'), + classMatrix: createSeriesPattern18(this, 'utxo_count_by_class'), + entryMatrix: createSeriesPattern18(this, 'utxo_count_by_entry'), + typeMatrix: createSeriesPattern18(this, 'utxo_count_by_type'), + amountRangeMatrix: createSeriesPattern18(this, 'utxos_utxo_count_by_amount_range'), + addrBalance: { + range: { + _0sats: createBaseDeltaPattern(this, 'addrs_0sats_utxo_count'), + _1satTo10sats: createBaseDeltaPattern(this, 'addrs_1sat_to_10sats_utxo_count'), + _10satsTo100sats: createBaseDeltaPattern(this, 'addrs_10sats_to_100sats_utxo_count'), + _100satsTo1kSats: createBaseDeltaPattern(this, 'addrs_100sats_to_1k_sats_utxo_count'), + _1kSatsTo10kSats: createBaseDeltaPattern(this, 'addrs_1k_sats_to_10k_sats_utxo_count'), + _10kSatsTo100kSats: createBaseDeltaPattern(this, 'addrs_10k_sats_to_100k_sats_utxo_count'), + _100kSatsTo1mSats: createBaseDeltaPattern(this, 'addrs_100k_sats_to_1m_sats_utxo_count'), + _1mSatsTo10mSats: createBaseDeltaPattern(this, 'addrs_1m_sats_to_10m_sats_utxo_count'), + _10mSatsTo1btc: createBaseDeltaPattern(this, 'addrs_10m_sats_to_1btc_utxo_count'), + _1btcTo10btc: createBaseDeltaPattern(this, 'addrs_1btc_to_10btc_utxo_count'), + _10btcTo100btc: createBaseDeltaPattern(this, 'addrs_10btc_to_100btc_utxo_count'), + _100btcTo1kBtc: createBaseDeltaPattern(this, 'addrs_100btc_to_1k_btc_utxo_count'), + _1kBtcTo10kBtc: createBaseDeltaPattern(this, 'addrs_1k_btc_to_10k_btc_utxo_count'), + _10kBtcTo100kBtc: createBaseDeltaPattern(this, 'addrs_10k_btc_to_100k_btc_utxo_count'), + over100kBtc: createBaseDeltaPattern(this, 'addrs_over_100k_btc_utxo_count'), + }, + under: { + _10sats: createBaseDeltaPattern(this, 'addrs_under_10sats_utxo_count'), + _100sats: createBaseDeltaPattern(this, 'addrs_under_100sats_utxo_count'), + _1kSats: createBaseDeltaPattern(this, 'addrs_under_1k_sats_utxo_count'), + _10kSats: createBaseDeltaPattern(this, 'addrs_under_10k_sats_utxo_count'), + _100kSats: createBaseDeltaPattern(this, 'addrs_under_100k_sats_utxo_count'), + _1mSats: createBaseDeltaPattern(this, 'addrs_under_1m_sats_utxo_count'), + _10mSats: createBaseDeltaPattern(this, 'addrs_under_10m_sats_utxo_count'), + _1btc: createBaseDeltaPattern(this, 'addrs_under_1btc_utxo_count'), + _10btc: createBaseDeltaPattern(this, 'addrs_under_10btc_utxo_count'), + _100btc: createBaseDeltaPattern(this, 'addrs_under_100btc_utxo_count'), + _1kBtc: createBaseDeltaPattern(this, 'addrs_under_1k_btc_utxo_count'), + _10kBtc: createBaseDeltaPattern(this, 'addrs_under_10k_btc_utxo_count'), + _100kBtc: createBaseDeltaPattern(this, 'addrs_under_100k_btc_utxo_count'), + }, + over: { + _1sat: createBaseDeltaPattern(this, 'addrs_over_1sat_utxo_count'), + _10sats: createBaseDeltaPattern(this, 'addrs_over_10sats_utxo_count'), + _100sats: createBaseDeltaPattern(this, 'addrs_over_100sats_utxo_count'), + _1kSats: createBaseDeltaPattern(this, 'addrs_over_1k_sats_utxo_count'), + _10kSats: createBaseDeltaPattern(this, 'addrs_over_10k_sats_utxo_count'), + _100kSats: createBaseDeltaPattern(this, 'addrs_over_100k_sats_utxo_count'), + _1mSats: createBaseDeltaPattern(this, 'addrs_over_1m_sats_utxo_count'), + _10mSats: createBaseDeltaPattern(this, 'addrs_over_10m_sats_utxo_count'), + _1btc: createBaseDeltaPattern(this, 'addrs_over_1btc_utxo_count'), + _10btc: createBaseDeltaPattern(this, 'addrs_over_10btc_utxo_count'), + _100btc: createBaseDeltaPattern(this, 'addrs_over_100btc_utxo_count'), + _1kBtc: createBaseDeltaPattern(this, 'addrs_over_1k_btc_utxo_count'), + _10kBtc: createBaseDeltaPattern(this, 'addrs_over_10k_btc_utxo_count'), + }, + matrix: createSeriesPattern18(this, 'addrs_utxo_count_by_balance_range'), + }, + }, + spentCount: { + all: createAverageBlockCumulativeSumPattern(this, 'spent_utxo_count'), + age: { + range: { + under1h: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1h_old_spent_utxo_count'), + _1hTo1d: createAverageBlockCumulativeSumPattern(this, 'utxos_1h_to_1d_old_spent_utxo_count'), + _1dTo1w: createAverageBlockCumulativeSumPattern(this, 'utxos_1d_to_1w_old_spent_utxo_count'), + _1wTo1m: createAverageBlockCumulativeSumPattern(this, 'utxos_1w_to_1m_old_spent_utxo_count'), + _1mTo2m: createAverageBlockCumulativeSumPattern(this, 'utxos_1m_to_2m_old_spent_utxo_count'), + _2mTo3m: createAverageBlockCumulativeSumPattern(this, 'utxos_2m_to_3m_old_spent_utxo_count'), + _3mTo4m: createAverageBlockCumulativeSumPattern(this, 'utxos_3m_to_4m_old_spent_utxo_count'), + _4mTo5m: createAverageBlockCumulativeSumPattern(this, 'utxos_4m_to_5m_old_spent_utxo_count'), + _5mTo6m: createAverageBlockCumulativeSumPattern(this, 'utxos_5m_to_6m_old_spent_utxo_count'), + _6mTo9m: createAverageBlockCumulativeSumPattern(this, 'utxos_6m_to_9m_old_spent_utxo_count'), + _9mTo1y: createAverageBlockCumulativeSumPattern(this, 'utxos_9m_to_1y_old_spent_utxo_count'), + _1yTo18m: createAverageBlockCumulativeSumPattern(this, 'utxos_1y_to_18m_old_spent_utxo_count'), + _18mTo2y: createAverageBlockCumulativeSumPattern(this, 'utxos_18m_to_2y_old_spent_utxo_count'), + _2yTo3y: createAverageBlockCumulativeSumPattern(this, 'utxos_2y_to_3y_old_spent_utxo_count'), + _3yTo4y: createAverageBlockCumulativeSumPattern(this, 'utxos_3y_to_4y_old_spent_utxo_count'), + _4yTo5y: createAverageBlockCumulativeSumPattern(this, 'utxos_4y_to_5y_old_spent_utxo_count'), + _5yTo6y: createAverageBlockCumulativeSumPattern(this, 'utxos_5y_to_6y_old_spent_utxo_count'), + _6yTo7y: createAverageBlockCumulativeSumPattern(this, 'utxos_6y_to_7y_old_spent_utxo_count'), + _7yTo8y: createAverageBlockCumulativeSumPattern(this, 'utxos_7y_to_8y_old_spent_utxo_count'), + _8yTo10y: createAverageBlockCumulativeSumPattern(this, 'utxos_8y_to_10y_old_spent_utxo_count'), + _10yTo12y: createAverageBlockCumulativeSumPattern(this, 'utxos_10y_to_12y_old_spent_utxo_count'), + _12yTo15y: createAverageBlockCumulativeSumPattern(this, 'utxos_12y_to_15y_old_spent_utxo_count'), + over15y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_15y_old_spent_utxo_count'), + }, + under: { + _1w: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1w_old_spent_utxo_count'), + _1m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1m_old_spent_utxo_count'), + _2m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_2m_old_spent_utxo_count'), + _3m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_3m_old_spent_utxo_count'), + _4m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_4m_old_spent_utxo_count'), + _5m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_5m_old_spent_utxo_count'), + _6m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_6m_old_spent_utxo_count'), + _9m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_9m_old_spent_utxo_count'), + _1y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1y_old_spent_utxo_count'), + _18m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_18m_old_spent_utxo_count'), + _2y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_2y_old_spent_utxo_count'), + _3y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_3y_old_spent_utxo_count'), + _4y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_4y_old_spent_utxo_count'), + _5y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_5y_old_spent_utxo_count'), + _6y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_6y_old_spent_utxo_count'), + _7y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_7y_old_spent_utxo_count'), + _8y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_8y_old_spent_utxo_count'), + _10y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_10y_old_spent_utxo_count'), + _12y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_12y_old_spent_utxo_count'), + _15y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_15y_old_spent_utxo_count'), + }, + over: { + _1d: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1d_old_spent_utxo_count'), + _1w: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1w_old_spent_utxo_count'), + _1m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1m_old_spent_utxo_count'), + _2m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_2m_old_spent_utxo_count'), + _3m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_3m_old_spent_utxo_count'), + _4m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_4m_old_spent_utxo_count'), + _5m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_5m_old_spent_utxo_count'), + _6m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_6m_old_spent_utxo_count'), + _9m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_9m_old_spent_utxo_count'), + _1y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1y_old_spent_utxo_count'), + _18m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_18m_old_spent_utxo_count'), + _2y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_2y_old_spent_utxo_count'), + _3y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_3y_old_spent_utxo_count'), + _4y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_4y_old_spent_utxo_count'), + _5y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_5y_old_spent_utxo_count'), + _6y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_6y_old_spent_utxo_count'), + _7y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_7y_old_spent_utxo_count'), + _8y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_8y_old_spent_utxo_count'), + _10y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_10y_old_spent_utxo_count'), + _12y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_12y_old_spent_utxo_count'), + }, + }, + epoch: { + _0: createAverageBlockCumulativeSumPattern(this, 'epoch_0_spent_utxo_count'), + _1: createAverageBlockCumulativeSumPattern(this, 'epoch_1_spent_utxo_count'), + _2: createAverageBlockCumulativeSumPattern(this, 'epoch_2_spent_utxo_count'), + _3: createAverageBlockCumulativeSumPattern(this, 'epoch_3_spent_utxo_count'), + _4: createAverageBlockCumulativeSumPattern(this, 'epoch_4_spent_utxo_count'), + }, + class: { + _2009: createAverageBlockCumulativeSumPattern(this, 'class_2009_spent_utxo_count'), + _2010: createAverageBlockCumulativeSumPattern(this, 'class_2010_spent_utxo_count'), + _2011: createAverageBlockCumulativeSumPattern(this, 'class_2011_spent_utxo_count'), + _2012: createAverageBlockCumulativeSumPattern(this, 'class_2012_spent_utxo_count'), + _2013: createAverageBlockCumulativeSumPattern(this, 'class_2013_spent_utxo_count'), + _2014: createAverageBlockCumulativeSumPattern(this, 'class_2014_spent_utxo_count'), + _2015: createAverageBlockCumulativeSumPattern(this, 'class_2015_spent_utxo_count'), + _2016: createAverageBlockCumulativeSumPattern(this, 'class_2016_spent_utxo_count'), + _2017: createAverageBlockCumulativeSumPattern(this, 'class_2017_spent_utxo_count'), + _2018: createAverageBlockCumulativeSumPattern(this, 'class_2018_spent_utxo_count'), + _2019: createAverageBlockCumulativeSumPattern(this, 'class_2019_spent_utxo_count'), + _2020: createAverageBlockCumulativeSumPattern(this, 'class_2020_spent_utxo_count'), + _2021: createAverageBlockCumulativeSumPattern(this, 'class_2021_spent_utxo_count'), + _2022: createAverageBlockCumulativeSumPattern(this, 'class_2022_spent_utxo_count'), + _2023: createAverageBlockCumulativeSumPattern(this, 'class_2023_spent_utxo_count'), + _2024: createAverageBlockCumulativeSumPattern(this, 'class_2024_spent_utxo_count'), + _2025: createAverageBlockCumulativeSumPattern(this, 'class_2025_spent_utxo_count'), + _2026: createAverageBlockCumulativeSumPattern(this, 'class_2026_spent_utxo_count'), + }, + entry: createDiscountPremiumPattern(this, 'spent_utxo_count'), + utxoAmount: { + range: { + _0sats: createAverageBlockCumulativeSumPattern(this, 'utxos_0sats_spent_utxo_count'), + _1satTo10sats: createAverageBlockCumulativeSumPattern(this, 'utxos_1sat_to_10sats_spent_utxo_count'), + _10satsTo100sats: createAverageBlockCumulativeSumPattern(this, 'utxos_10sats_to_100sats_spent_utxo_count'), + _100satsTo1kSats: createAverageBlockCumulativeSumPattern(this, 'utxos_100sats_to_1k_sats_spent_utxo_count'), + _1kSatsTo10kSats: createAverageBlockCumulativeSumPattern(this, 'utxos_1k_sats_to_10k_sats_spent_utxo_count'), + _10kSatsTo100kSats: createAverageBlockCumulativeSumPattern(this, 'utxos_10k_sats_to_100k_sats_spent_utxo_count'), + _100kSatsTo1mSats: createAverageBlockCumulativeSumPattern(this, 'utxos_100k_sats_to_1m_sats_spent_utxo_count'), + _1mSatsTo10mSats: createAverageBlockCumulativeSumPattern(this, 'utxos_1m_sats_to_10m_sats_spent_utxo_count'), + _10mSatsTo1btc: createAverageBlockCumulativeSumPattern(this, 'utxos_10m_sats_to_1btc_spent_utxo_count'), + _1btcTo10btc: createAverageBlockCumulativeSumPattern(this, 'utxos_1btc_to_10btc_spent_utxo_count'), + _10btcTo100btc: createAverageBlockCumulativeSumPattern(this, 'utxos_10btc_to_100btc_spent_utxo_count'), + _100btcTo1kBtc: createAverageBlockCumulativeSumPattern(this, 'utxos_100btc_to_1k_btc_spent_utxo_count'), + _1kBtcTo10kBtc: createAverageBlockCumulativeSumPattern(this, 'utxos_1k_btc_to_10k_btc_spent_utxo_count'), + _10kBtcTo100kBtc: createAverageBlockCumulativeSumPattern(this, 'utxos_10k_btc_to_100k_btc_spent_utxo_count'), + over100kBtc: createAverageBlockCumulativeSumPattern(this, 'utxos_over_100k_btc_spent_utxo_count'), + }, + under: { + _10sats: createAverageBlockCumulativeSumPattern(this, 'utxos_under_10sats_spent_utxo_count'), + _100sats: createAverageBlockCumulativeSumPattern(this, 'utxos_under_100sats_spent_utxo_count'), + _1kSats: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1k_sats_spent_utxo_count'), + _10kSats: createAverageBlockCumulativeSumPattern(this, 'utxos_under_10k_sats_spent_utxo_count'), + _100kSats: createAverageBlockCumulativeSumPattern(this, 'utxos_under_100k_sats_spent_utxo_count'), + _1mSats: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1m_sats_spent_utxo_count'), + _10mSats: createAverageBlockCumulativeSumPattern(this, 'utxos_under_10m_sats_spent_utxo_count'), + _1btc: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1btc_spent_utxo_count'), + _10btc: createAverageBlockCumulativeSumPattern(this, 'utxos_under_10btc_spent_utxo_count'), + _100btc: createAverageBlockCumulativeSumPattern(this, 'utxos_under_100btc_spent_utxo_count'), + _1kBtc: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1k_btc_spent_utxo_count'), + _10kBtc: createAverageBlockCumulativeSumPattern(this, 'utxos_under_10k_btc_spent_utxo_count'), + _100kBtc: createAverageBlockCumulativeSumPattern(this, 'utxos_under_100k_btc_spent_utxo_count'), + }, + over: { + _1sat: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1sat_spent_utxo_count'), + _10sats: createAverageBlockCumulativeSumPattern(this, 'utxos_over_10sats_spent_utxo_count'), + _100sats: createAverageBlockCumulativeSumPattern(this, 'utxos_over_100sats_spent_utxo_count'), + _1kSats: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1k_sats_spent_utxo_count'), + _10kSats: createAverageBlockCumulativeSumPattern(this, 'utxos_over_10k_sats_spent_utxo_count'), + _100kSats: createAverageBlockCumulativeSumPattern(this, 'utxos_over_100k_sats_spent_utxo_count'), + _1mSats: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1m_sats_spent_utxo_count'), + _10mSats: createAverageBlockCumulativeSumPattern(this, 'utxos_over_10m_sats_spent_utxo_count'), + _1btc: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1btc_spent_utxo_count'), + _10btc: createAverageBlockCumulativeSumPattern(this, 'utxos_over_10btc_spent_utxo_count'), + _100btc: createAverageBlockCumulativeSumPattern(this, 'utxos_over_100btc_spent_utxo_count'), + _1kBtc: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1k_btc_spent_utxo_count'), + _10kBtc: createAverageBlockCumulativeSumPattern(this, 'utxos_over_10k_btc_spent_utxo_count'), + }, + }, + term: createLongShortPattern(this, 'spent_utxo_count'), + type: { + p2pk65: createAverageBlockCumulativeSumPattern(this, 'p2pk65_spent_utxo_count'), + p2pk33: createAverageBlockCumulativeSumPattern(this, 'p2pk33_spent_utxo_count'), + p2pkh: createAverageBlockCumulativeSumPattern(this, 'p2pkh_spent_utxo_count'), + p2ms: createAverageBlockCumulativeSumPattern(this, 'p2ms_spent_utxo_count'), + p2sh: createAverageBlockCumulativeSumPattern(this, 'p2sh_spent_utxo_count'), + p2wpkh: createAverageBlockCumulativeSumPattern(this, 'p2wpkh_spent_utxo_count'), + p2wsh: createAverageBlockCumulativeSumPattern(this, 'p2wsh_spent_utxo_count'), + p2tr: createAverageBlockCumulativeSumPattern(this, 'p2tr_spent_utxo_count'), + p2a: createAverageBlockCumulativeSumPattern(this, 'p2a_spent_utxo_count'), + unknown: createAverageBlockCumulativeSumPattern(this, 'unknown_outputs_spent_utxo_count'), + empty: createAverageBlockCumulativeSumPattern(this, 'empty_outputs_spent_utxo_count'), + }, + ageRangeMatrix: createSeriesPattern18(this, 'utxos_spent_utxo_count_cumulative_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'spent_utxo_count_cumulative_by_epoch'), + classMatrix: createSeriesPattern18(this, 'spent_utxo_count_cumulative_by_class'), + entryMatrix: createSeriesPattern18(this, 'spent_utxo_count_cumulative_by_entry'), + typeMatrix: createSeriesPattern18(this, 'spent_utxo_count_cumulative_by_type'), + amountRangeMatrix: createSeriesPattern18(this, 'utxos_spent_utxo_count_cumulative_by_amount_range'), + }, }, - underAge: { - _1w: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_1w_old'), - _1m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_1m_old'), - _2m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_2m_old'), - _3m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_3m_old'), - _4m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_4m_old'), - _5m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_5m_old'), - _6m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_6m_old'), - _9m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_9m_old'), - _1y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_1y_old'), - _18m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_18m_old'), - _2y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_2y_old'), - _3y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_3y_old'), - _4y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_4y_old'), - _5y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_5y_old'), - _6y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_6y_old'), - _7y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_7y_old'), - _8y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_8y_old'), - _10y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_10y_old'), - _12y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_12y_old'), - _15y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_under_15y_old'), + activity: { + transferVolume: { + all: createAverageBlockCumulativeSumPattern2(this, 'transfer_volume'), + age: createOverRangeUnderPattern2(this, 'utxos'), + epoch: { + _0: createAverageBlockCumulativeSumPattern2(this, 'epoch_0_transfer_volume'), + _1: createAverageBlockCumulativeSumPattern2(this, 'epoch_1_transfer_volume'), + _2: createAverageBlockCumulativeSumPattern2(this, 'epoch_2_transfer_volume'), + _3: createAverageBlockCumulativeSumPattern2(this, 'epoch_3_transfer_volume'), + _4: createAverageBlockCumulativeSumPattern2(this, 'epoch_4_transfer_volume'), + }, + class: { + _2009: createAverageBlockCumulativeSumPattern2(this, 'class_2009_transfer_volume'), + _2010: createAverageBlockCumulativeSumPattern2(this, 'class_2010_transfer_volume'), + _2011: createAverageBlockCumulativeSumPattern2(this, 'class_2011_transfer_volume'), + _2012: createAverageBlockCumulativeSumPattern2(this, 'class_2012_transfer_volume'), + _2013: createAverageBlockCumulativeSumPattern2(this, 'class_2013_transfer_volume'), + _2014: createAverageBlockCumulativeSumPattern2(this, 'class_2014_transfer_volume'), + _2015: createAverageBlockCumulativeSumPattern2(this, 'class_2015_transfer_volume'), + _2016: createAverageBlockCumulativeSumPattern2(this, 'class_2016_transfer_volume'), + _2017: createAverageBlockCumulativeSumPattern2(this, 'class_2017_transfer_volume'), + _2018: createAverageBlockCumulativeSumPattern2(this, 'class_2018_transfer_volume'), + _2019: createAverageBlockCumulativeSumPattern2(this, 'class_2019_transfer_volume'), + _2020: createAverageBlockCumulativeSumPattern2(this, 'class_2020_transfer_volume'), + _2021: createAverageBlockCumulativeSumPattern2(this, 'class_2021_transfer_volume'), + _2022: createAverageBlockCumulativeSumPattern2(this, 'class_2022_transfer_volume'), + _2023: createAverageBlockCumulativeSumPattern2(this, 'class_2023_transfer_volume'), + _2024: createAverageBlockCumulativeSumPattern2(this, 'class_2024_transfer_volume'), + _2025: createAverageBlockCumulativeSumPattern2(this, 'class_2025_transfer_volume'), + _2026: createAverageBlockCumulativeSumPattern2(this, 'class_2026_transfer_volume'), + }, + entry: createDiscountPremiumPattern2(this, 'transfer_volume'), + utxoAmount: { + range: create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2(this, 'utxos'), + under: create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern2(this, 'utxos_under'), + over: create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2(this, 'utxos_over'), + }, + term: createLongShortPattern2(this, 'transfer_volume'), + type: { + p2pk65: createAverageBlockCumulativeSumPattern2(this, 'p2pk65_transfer_volume'), + p2pk33: createAverageBlockCumulativeSumPattern2(this, 'p2pk33_transfer_volume'), + p2pkh: createAverageBlockCumulativeSumPattern2(this, 'p2pkh_transfer_volume'), + p2ms: createAverageBlockCumulativeSumPattern2(this, 'p2ms_transfer_volume'), + p2sh: createAverageBlockCumulativeSumPattern2(this, 'p2sh_transfer_volume'), + p2wpkh: createAverageBlockCumulativeSumPattern2(this, 'p2wpkh_transfer_volume'), + p2wsh: createAverageBlockCumulativeSumPattern2(this, 'p2wsh_transfer_volume'), + p2tr: createAverageBlockCumulativeSumPattern2(this, 'p2tr_transfer_volume'), + p2a: createAverageBlockCumulativeSumPattern2(this, 'p2a_transfer_volume'), + unknown: createAverageBlockCumulativeSumPattern2(this, 'unknown_outputs_transfer_volume'), + empty: createAverageBlockCumulativeSumPattern2(this, 'empty_outputs_transfer_volume'), + }, + cumulative: { + ageRange: createCentsSatsPattern(this, 'utxos_transfer_volume_cumulative_by_age_range'), + epoch: createCentsSatsPattern(this, 'transfer_volume_cumulative_by_epoch'), + class: createCentsSatsPattern(this, 'transfer_volume_cumulative_by_class'), + entry: createCentsSatsPattern(this, 'transfer_volume_cumulative_by_entry'), + amountRange: createCentsSatsPattern(this, 'utxos_transfer_volume_cumulative_by_amount_range'), + type: createCentsSatsPattern(this, 'transfer_volume_cumulative_by_type'), + }, + addrBalance: { + range: create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2(this, 'addrs'), + under: create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern2(this, 'addrs_under'), + over: create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2(this, 'addrs_over'), + values: createCentsSatsPattern(this, 'addrs_transfer_volume_cumulative_by_balance_range'), + }, + inProfit: { + all: createAverageBlockCumulativeSumPattern2(this, 'transfer_volume_in_profit'), + age: createOverRangeUnderPattern2(this, 'utxos'), + epoch: create_01234Pattern2(this, 'epoch', 'in_profit'), + class: create_200920102011201220132014201520162017201820192020202120222023202420252026Pattern2(this, 'class', 'in_profit'), + entry: createDiscountPremiumPattern2(this, 'transfer_volume_in_profit'), + term: createLongShortPattern2(this, 'transfer_volume_in_profit'), + cumulative: { + ageRange: createCentsSatsPattern(this, 'utxos_transfer_volume_in_profit_cumulative_by_age_range'), + epoch: createCentsSatsPattern(this, 'transfer_volume_in_profit_cumulative_by_epoch'), + class: createCentsSatsPattern(this, 'transfer_volume_in_profit_cumulative_by_class'), + entry: createCentsSatsPattern(this, 'transfer_volume_in_profit_cumulative_by_entry'), + }, + }, + inLoss: { + all: createAverageBlockCumulativeSumPattern2(this, 'transfer_volume_in_loss'), + age: createOverRangeUnderPattern2(this, 'utxos'), + epoch: create_01234Pattern2(this, 'epoch', 'in_loss'), + class: create_200920102011201220132014201520162017201820192020202120222023202420252026Pattern2(this, 'class', 'in_loss'), + entry: createDiscountPremiumPattern2(this, 'transfer_volume_in_loss'), + term: createLongShortPattern2(this, 'transfer_volume_in_loss'), + cumulative: { + ageRange: createCentsSatsPattern(this, 'utxos_transfer_volume_in_loss_cumulative_by_age_range'), + epoch: createCentsSatsPattern(this, 'transfer_volume_in_loss_cumulative_by_epoch'), + class: createCentsSatsPattern(this, 'transfer_volume_in_loss_cumulative_by_class'), + entry: createCentsSatsPattern(this, 'transfer_volume_in_loss_cumulative_by_entry'), + }, + }, + }, + coindaysDestroyed: { + all: createAverageBlockCumulativeSumPattern(this, 'coindays_destroyed'), + age: { + range: { + under1h: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1h_old_coindays_destroyed'), + _1hTo1d: createAverageBlockCumulativeSumPattern(this, 'utxos_1h_to_1d_old_coindays_destroyed'), + _1dTo1w: createAverageBlockCumulativeSumPattern(this, 'utxos_1d_to_1w_old_coindays_destroyed'), + _1wTo1m: createAverageBlockCumulativeSumPattern(this, 'utxos_1w_to_1m_old_coindays_destroyed'), + _1mTo2m: createAverageBlockCumulativeSumPattern(this, 'utxos_1m_to_2m_old_coindays_destroyed'), + _2mTo3m: createAverageBlockCumulativeSumPattern(this, 'utxos_2m_to_3m_old_coindays_destroyed'), + _3mTo4m: createAverageBlockCumulativeSumPattern(this, 'utxos_3m_to_4m_old_coindays_destroyed'), + _4mTo5m: createAverageBlockCumulativeSumPattern(this, 'utxos_4m_to_5m_old_coindays_destroyed'), + _5mTo6m: createAverageBlockCumulativeSumPattern(this, 'utxos_5m_to_6m_old_coindays_destroyed'), + _6mTo9m: createAverageBlockCumulativeSumPattern(this, 'utxos_6m_to_9m_old_coindays_destroyed'), + _9mTo1y: createAverageBlockCumulativeSumPattern(this, 'utxos_9m_to_1y_old_coindays_destroyed'), + _1yTo18m: createAverageBlockCumulativeSumPattern(this, 'utxos_1y_to_18m_old_coindays_destroyed'), + _18mTo2y: createAverageBlockCumulativeSumPattern(this, 'utxos_18m_to_2y_old_coindays_destroyed'), + _2yTo3y: createAverageBlockCumulativeSumPattern(this, 'utxos_2y_to_3y_old_coindays_destroyed'), + _3yTo4y: createAverageBlockCumulativeSumPattern(this, 'utxos_3y_to_4y_old_coindays_destroyed'), + _4yTo5y: createAverageBlockCumulativeSumPattern(this, 'utxos_4y_to_5y_old_coindays_destroyed'), + _5yTo6y: createAverageBlockCumulativeSumPattern(this, 'utxos_5y_to_6y_old_coindays_destroyed'), + _6yTo7y: createAverageBlockCumulativeSumPattern(this, 'utxos_6y_to_7y_old_coindays_destroyed'), + _7yTo8y: createAverageBlockCumulativeSumPattern(this, 'utxos_7y_to_8y_old_coindays_destroyed'), + _8yTo10y: createAverageBlockCumulativeSumPattern(this, 'utxos_8y_to_10y_old_coindays_destroyed'), + _10yTo12y: createAverageBlockCumulativeSumPattern(this, 'utxos_10y_to_12y_old_coindays_destroyed'), + _12yTo15y: createAverageBlockCumulativeSumPattern(this, 'utxos_12y_to_15y_old_coindays_destroyed'), + over15y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_15y_old_coindays_destroyed'), + }, + under: { + _1w: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1w_old_coindays_destroyed'), + _1m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1m_old_coindays_destroyed'), + _2m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_2m_old_coindays_destroyed'), + _3m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_3m_old_coindays_destroyed'), + _4m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_4m_old_coindays_destroyed'), + _5m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_5m_old_coindays_destroyed'), + _6m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_6m_old_coindays_destroyed'), + _9m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_9m_old_coindays_destroyed'), + _1y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_1y_old_coindays_destroyed'), + _18m: createAverageBlockCumulativeSumPattern(this, 'utxos_under_18m_old_coindays_destroyed'), + _2y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_2y_old_coindays_destroyed'), + _3y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_3y_old_coindays_destroyed'), + _4y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_4y_old_coindays_destroyed'), + _5y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_5y_old_coindays_destroyed'), + _6y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_6y_old_coindays_destroyed'), + _7y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_7y_old_coindays_destroyed'), + _8y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_8y_old_coindays_destroyed'), + _10y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_10y_old_coindays_destroyed'), + _12y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_12y_old_coindays_destroyed'), + _15y: createAverageBlockCumulativeSumPattern(this, 'utxos_under_15y_old_coindays_destroyed'), + }, + over: { + _1d: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1d_old_coindays_destroyed'), + _1w: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1w_old_coindays_destroyed'), + _1m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1m_old_coindays_destroyed'), + _2m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_2m_old_coindays_destroyed'), + _3m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_3m_old_coindays_destroyed'), + _4m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_4m_old_coindays_destroyed'), + _5m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_5m_old_coindays_destroyed'), + _6m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_6m_old_coindays_destroyed'), + _9m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_9m_old_coindays_destroyed'), + _1y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_1y_old_coindays_destroyed'), + _18m: createAverageBlockCumulativeSumPattern(this, 'utxos_over_18m_old_coindays_destroyed'), + _2y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_2y_old_coindays_destroyed'), + _3y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_3y_old_coindays_destroyed'), + _4y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_4y_old_coindays_destroyed'), + _5y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_5y_old_coindays_destroyed'), + _6y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_6y_old_coindays_destroyed'), + _7y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_7y_old_coindays_destroyed'), + _8y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_8y_old_coindays_destroyed'), + _10y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_10y_old_coindays_destroyed'), + _12y: createAverageBlockCumulativeSumPattern(this, 'utxos_over_12y_old_coindays_destroyed'), + }, + }, + epoch: { + _0: createAverageBlockCumulativeSumPattern(this, 'epoch_0_coindays_destroyed'), + _1: createAverageBlockCumulativeSumPattern(this, 'epoch_1_coindays_destroyed'), + _2: createAverageBlockCumulativeSumPattern(this, 'epoch_2_coindays_destroyed'), + _3: createAverageBlockCumulativeSumPattern(this, 'epoch_3_coindays_destroyed'), + _4: createAverageBlockCumulativeSumPattern(this, 'epoch_4_coindays_destroyed'), + }, + class: { + _2009: createAverageBlockCumulativeSumPattern(this, 'class_2009_coindays_destroyed'), + _2010: createAverageBlockCumulativeSumPattern(this, 'class_2010_coindays_destroyed'), + _2011: createAverageBlockCumulativeSumPattern(this, 'class_2011_coindays_destroyed'), + _2012: createAverageBlockCumulativeSumPattern(this, 'class_2012_coindays_destroyed'), + _2013: createAverageBlockCumulativeSumPattern(this, 'class_2013_coindays_destroyed'), + _2014: createAverageBlockCumulativeSumPattern(this, 'class_2014_coindays_destroyed'), + _2015: createAverageBlockCumulativeSumPattern(this, 'class_2015_coindays_destroyed'), + _2016: createAverageBlockCumulativeSumPattern(this, 'class_2016_coindays_destroyed'), + _2017: createAverageBlockCumulativeSumPattern(this, 'class_2017_coindays_destroyed'), + _2018: createAverageBlockCumulativeSumPattern(this, 'class_2018_coindays_destroyed'), + _2019: createAverageBlockCumulativeSumPattern(this, 'class_2019_coindays_destroyed'), + _2020: createAverageBlockCumulativeSumPattern(this, 'class_2020_coindays_destroyed'), + _2021: createAverageBlockCumulativeSumPattern(this, 'class_2021_coindays_destroyed'), + _2022: createAverageBlockCumulativeSumPattern(this, 'class_2022_coindays_destroyed'), + _2023: createAverageBlockCumulativeSumPattern(this, 'class_2023_coindays_destroyed'), + _2024: createAverageBlockCumulativeSumPattern(this, 'class_2024_coindays_destroyed'), + _2025: createAverageBlockCumulativeSumPattern(this, 'class_2025_coindays_destroyed'), + _2026: createAverageBlockCumulativeSumPattern(this, 'class_2026_coindays_destroyed'), + }, + entry: createDiscountPremiumPattern(this, 'coindays_destroyed'), + term: createLongShortPattern(this, 'coindays_destroyed'), + ageRangeMatrix: createSeriesPattern18(this, 'utxos_coindays_destroyed_cumulative_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'coindays_destroyed_cumulative_by_epoch'), + classMatrix: createSeriesPattern18(this, 'coindays_destroyed_cumulative_by_class'), + entryMatrix: createSeriesPattern18(this, 'coindays_destroyed_cumulative_by_entry'), + }, + coinyearsDestroyed: { + all: createSeriesPattern1(this, 'all_coinyears_destroyed'), + sth: createSeriesPattern1(this, 'sth_coinyears_destroyed'), + lth: createSeriesPattern1(this, 'lth_coinyears_destroyed'), + }, + dormancy: { + all: create_1m1w1y24hHeightPattern(this, 'all_dormancy'), + sth: create_1m1w1y24hHeightPattern(this, 'sth_dormancy'), + lth: create_1m1w1y24hHeightPattern(this, 'lth_dormancy'), + }, }, - overAge: { - _1d: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_1d_old'), - _1w: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_1w_old'), - _1m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_1m_old'), - _2m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_2m_old'), - _3m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_3m_old'), - _4m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_4m_old'), - _5m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_5m_old'), - _6m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_6m_old'), - _9m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_9m_old'), - _1y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_1y_old'), - _18m: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_18m_old'), - _2y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_2y_old'), - _3y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_3y_old'), - _4y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_4y_old'), - _5y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_5y_old'), - _6y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_6y_old'), - _7y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_7y_old'), - _8y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_8y_old'), - _10y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_10y_old'), - _12y: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'utxos_over_12y_old'), - }, - epoch: { - _0: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'epoch_0'), - _1: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'epoch_1'), - _2: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'epoch_2'), - _3: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'epoch_3'), - _4: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'epoch_4'), - }, - class: { - _2009: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2009'), - _2010: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2010'), - _2011: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2011'), - _2012: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2012'), - _2013: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2013'), - _2014: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2014'), - _2015: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2015'), - _2016: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2016'), - _2017: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2017'), - _2018: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2018'), - _2019: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2019'), - _2020: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2020'), - _2021: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2021'), - _2022: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2022'), - _2023: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2023'), - _2024: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2024'), - _2025: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2025'), - _2026: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'class_2026'), - }, - entry: { - discount: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'veteran'), - premium: createActivityOutputsRealizedSupplyUnrealizedPattern(this, 'rookie'), - }, - overAmount: { - _1sat: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_1sat'), - _10sats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_10sats'), - _100sats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_100sats'), - _1kSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_1k_sats'), - _10kSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_10k_sats'), - _100kSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_100k_sats'), - _1mSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_1m_sats'), - _10mSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_10m_sats'), - _1btc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_1btc'), - _10btc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_10btc'), - _100btc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_100btc'), - _1kBtc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_1k_btc'), - _10kBtc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_10k_btc'), - }, - amountRange: { - _0sats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_0sats'), - _1satTo10sats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_1sat_to_10sats'), - _10satsTo100sats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_10sats_to_100sats'), - _100satsTo1kSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_100sats_to_1k_sats'), - _1kSatsTo10kSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_1k_sats_to_10k_sats'), - _10kSatsTo100kSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_10k_sats_to_100k_sats'), - _100kSatsTo1mSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_100k_sats_to_1m_sats'), - _1mSatsTo10mSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_1m_sats_to_10m_sats'), - _10mSatsTo1btc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_10m_sats_to_1btc'), - _1btcTo10btc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_1btc_to_10btc'), - _10btcTo100btc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_10btc_to_100btc'), - _100btcTo1kBtc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_100btc_to_1k_btc'), - _1kBtcTo10kBtc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_1k_btc_to_10k_btc'), - _10kBtcTo100kBtc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_10k_btc_to_100k_btc'), - over100kBtc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_over_100k_btc'), - }, - underAmount: { - _10sats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_10sats'), - _100sats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_100sats'), - _1kSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_1k_sats'), - _10kSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_10k_sats'), - _100kSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_100k_sats'), - _1mSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_1m_sats'), - _10mSats: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_10m_sats'), - _1btc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_1btc'), - _10btc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_10btc'), - _100btc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_100btc'), - _1kBtc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_1k_btc'), - _10kBtc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_10k_btc'), - _100kBtc: createActivityOutputsRealizedSupplyUnrealizedPattern2(this, 'utxos_under_100k_btc'), - }, - type: { - p2pk65: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'p2pk65'), - p2pk33: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'p2pk33'), - p2pkh: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'p2pkh'), - p2ms: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'p2ms'), - p2sh: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'p2sh'), - p2wpkh: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'p2wpkh'), - p2wsh: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'p2wsh'), - p2tr: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'p2tr'), - p2a: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'p2a'), - unknown: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'unknown_outputs'), - empty: createActivityOutputsRealizedSupplyUnrealizedPattern3(this, 'empty_outputs'), - }, - profitability: { - range: { - over1000pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_1000pct_in_profit'), - _500pctTo1000pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_500pct_to_1000pct_in_profit'), - _300pctTo500pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_300pct_to_500pct_in_profit'), - _200pctTo300pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_200pct_to_300pct_in_profit'), - _100pctTo200pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_100pct_to_200pct_in_profit'), - _90pctTo100pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_90pct_to_100pct_in_profit'), - _80pctTo90pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_80pct_to_90pct_in_profit'), - _70pctTo80pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_70pct_to_80pct_in_profit'), - _60pctTo70pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_60pct_to_70pct_in_profit'), - _50pctTo60pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_50pct_to_60pct_in_profit'), - _40pctTo50pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_40pct_to_50pct_in_profit'), - _30pctTo40pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_30pct_to_40pct_in_profit'), - _20pctTo30pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_20pct_to_30pct_in_profit'), - _10pctTo20pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_10pct_to_20pct_in_profit'), - _0pctTo10pctInProfit: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_0pct_to_10pct_in_profit'), - _0pctTo10pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_0pct_to_10pct_in_loss'), - _10pctTo20pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_10pct_to_20pct_in_loss'), - _20pctTo30pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_20pct_to_30pct_in_loss'), - _30pctTo40pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_30pct_to_40pct_in_loss'), - _40pctTo50pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_40pct_to_50pct_in_loss'), - _50pctTo60pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_50pct_to_60pct_in_loss'), - _60pctTo70pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_60pct_to_70pct_in_loss'), - _70pctTo80pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_70pct_to_80pct_in_loss'), - _80pctTo90pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_80pct_to_90pct_in_loss'), - _90pctTo100pctInLoss: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_90pct_to_100pct_in_loss'), + realized: { + cap: { + all: createCentsDeltaUsdPattern(this, 'realized_cap'), + age: { + range: { + under1h: createCentsDeltaUsdPattern(this, 'utxos_under_1h_old_realized_cap'), + _1hTo1d: createCentsDeltaUsdPattern(this, 'utxos_1h_to_1d_old_realized_cap'), + _1dTo1w: createCentsDeltaUsdPattern(this, 'utxos_1d_to_1w_old_realized_cap'), + _1wTo1m: createCentsDeltaUsdPattern(this, 'utxos_1w_to_1m_old_realized_cap'), + _1mTo2m: createCentsDeltaUsdPattern(this, 'utxos_1m_to_2m_old_realized_cap'), + _2mTo3m: createCentsDeltaUsdPattern(this, 'utxos_2m_to_3m_old_realized_cap'), + _3mTo4m: createCentsDeltaUsdPattern(this, 'utxos_3m_to_4m_old_realized_cap'), + _4mTo5m: createCentsDeltaUsdPattern(this, 'utxos_4m_to_5m_old_realized_cap'), + _5mTo6m: createCentsDeltaUsdPattern(this, 'utxos_5m_to_6m_old_realized_cap'), + _6mTo9m: createCentsDeltaUsdPattern(this, 'utxos_6m_to_9m_old_realized_cap'), + _9mTo1y: createCentsDeltaUsdPattern(this, 'utxos_9m_to_1y_old_realized_cap'), + _1yTo18m: createCentsDeltaUsdPattern(this, 'utxos_1y_to_18m_old_realized_cap'), + _18mTo2y: createCentsDeltaUsdPattern(this, 'utxos_18m_to_2y_old_realized_cap'), + _2yTo3y: createCentsDeltaUsdPattern(this, 'utxos_2y_to_3y_old_realized_cap'), + _3yTo4y: createCentsDeltaUsdPattern(this, 'utxos_3y_to_4y_old_realized_cap'), + _4yTo5y: createCentsDeltaUsdPattern(this, 'utxos_4y_to_5y_old_realized_cap'), + _5yTo6y: createCentsDeltaUsdPattern(this, 'utxos_5y_to_6y_old_realized_cap'), + _6yTo7y: createCentsDeltaUsdPattern(this, 'utxos_6y_to_7y_old_realized_cap'), + _7yTo8y: createCentsDeltaUsdPattern(this, 'utxos_7y_to_8y_old_realized_cap'), + _8yTo10y: createCentsDeltaUsdPattern(this, 'utxos_8y_to_10y_old_realized_cap'), + _10yTo12y: createCentsDeltaUsdPattern(this, 'utxos_10y_to_12y_old_realized_cap'), + _12yTo15y: createCentsDeltaUsdPattern(this, 'utxos_12y_to_15y_old_realized_cap'), + over15y: createCentsDeltaUsdPattern(this, 'utxos_over_15y_old_realized_cap'), + }, + under: { + _1w: createCentsDeltaUsdPattern(this, 'utxos_under_1w_old_realized_cap'), + _1m: createCentsDeltaUsdPattern(this, 'utxos_under_1m_old_realized_cap'), + _2m: createCentsDeltaUsdPattern(this, 'utxos_under_2m_old_realized_cap'), + _3m: createCentsDeltaUsdPattern(this, 'utxos_under_3m_old_realized_cap'), + _4m: createCentsDeltaUsdPattern(this, 'utxos_under_4m_old_realized_cap'), + _5m: createCentsDeltaUsdPattern(this, 'utxos_under_5m_old_realized_cap'), + _6m: createCentsDeltaUsdPattern(this, 'utxos_under_6m_old_realized_cap'), + _9m: createCentsDeltaUsdPattern(this, 'utxos_under_9m_old_realized_cap'), + _1y: createCentsDeltaUsdPattern(this, 'utxos_under_1y_old_realized_cap'), + _18m: createCentsDeltaUsdPattern(this, 'utxos_under_18m_old_realized_cap'), + _2y: createCentsDeltaUsdPattern(this, 'utxos_under_2y_old_realized_cap'), + _3y: createCentsDeltaUsdPattern(this, 'utxos_under_3y_old_realized_cap'), + _4y: createCentsDeltaUsdPattern(this, 'utxos_under_4y_old_realized_cap'), + _5y: createCentsDeltaUsdPattern(this, 'utxos_under_5y_old_realized_cap'), + _6y: createCentsDeltaUsdPattern(this, 'utxos_under_6y_old_realized_cap'), + _7y: createCentsDeltaUsdPattern(this, 'utxos_under_7y_old_realized_cap'), + _8y: createCentsDeltaUsdPattern(this, 'utxos_under_8y_old_realized_cap'), + _10y: createCentsDeltaUsdPattern(this, 'utxos_under_10y_old_realized_cap'), + _12y: createCentsDeltaUsdPattern(this, 'utxos_under_12y_old_realized_cap'), + _15y: createCentsDeltaUsdPattern(this, 'utxos_under_15y_old_realized_cap'), + }, + over: { + _1d: createCentsDeltaUsdPattern(this, 'utxos_over_1d_old_realized_cap'), + _1w: createCentsDeltaUsdPattern(this, 'utxos_over_1w_old_realized_cap'), + _1m: createCentsDeltaUsdPattern(this, 'utxos_over_1m_old_realized_cap'), + _2m: createCentsDeltaUsdPattern(this, 'utxos_over_2m_old_realized_cap'), + _3m: createCentsDeltaUsdPattern(this, 'utxos_over_3m_old_realized_cap'), + _4m: createCentsDeltaUsdPattern(this, 'utxos_over_4m_old_realized_cap'), + _5m: createCentsDeltaUsdPattern(this, 'utxos_over_5m_old_realized_cap'), + _6m: createCentsDeltaUsdPattern(this, 'utxos_over_6m_old_realized_cap'), + _9m: createCentsDeltaUsdPattern(this, 'utxos_over_9m_old_realized_cap'), + _1y: createCentsDeltaUsdPattern(this, 'utxos_over_1y_old_realized_cap'), + _18m: createCentsDeltaUsdPattern(this, 'utxos_over_18m_old_realized_cap'), + _2y: createCentsDeltaUsdPattern(this, 'utxos_over_2y_old_realized_cap'), + _3y: createCentsDeltaUsdPattern(this, 'utxos_over_3y_old_realized_cap'), + _4y: createCentsDeltaUsdPattern(this, 'utxos_over_4y_old_realized_cap'), + _5y: createCentsDeltaUsdPattern(this, 'utxos_over_5y_old_realized_cap'), + _6y: createCentsDeltaUsdPattern(this, 'utxos_over_6y_old_realized_cap'), + _7y: createCentsDeltaUsdPattern(this, 'utxos_over_7y_old_realized_cap'), + _8y: createCentsDeltaUsdPattern(this, 'utxos_over_8y_old_realized_cap'), + _10y: createCentsDeltaUsdPattern(this, 'utxos_over_10y_old_realized_cap'), + _12y: createCentsDeltaUsdPattern(this, 'utxos_over_12y_old_realized_cap'), + }, + }, + epoch: { + _0: createCentsDeltaUsdPattern(this, 'epoch_0_realized_cap'), + _1: createCentsDeltaUsdPattern(this, 'epoch_1_realized_cap'), + _2: createCentsDeltaUsdPattern(this, 'epoch_2_realized_cap'), + _3: createCentsDeltaUsdPattern(this, 'epoch_3_realized_cap'), + _4: createCentsDeltaUsdPattern(this, 'epoch_4_realized_cap'), + }, + class: { + _2009: createCentsDeltaUsdPattern(this, 'class_2009_realized_cap'), + _2010: createCentsDeltaUsdPattern(this, 'class_2010_realized_cap'), + _2011: createCentsDeltaUsdPattern(this, 'class_2011_realized_cap'), + _2012: createCentsDeltaUsdPattern(this, 'class_2012_realized_cap'), + _2013: createCentsDeltaUsdPattern(this, 'class_2013_realized_cap'), + _2014: createCentsDeltaUsdPattern(this, 'class_2014_realized_cap'), + _2015: createCentsDeltaUsdPattern(this, 'class_2015_realized_cap'), + _2016: createCentsDeltaUsdPattern(this, 'class_2016_realized_cap'), + _2017: createCentsDeltaUsdPattern(this, 'class_2017_realized_cap'), + _2018: createCentsDeltaUsdPattern(this, 'class_2018_realized_cap'), + _2019: createCentsDeltaUsdPattern(this, 'class_2019_realized_cap'), + _2020: createCentsDeltaUsdPattern(this, 'class_2020_realized_cap'), + _2021: createCentsDeltaUsdPattern(this, 'class_2021_realized_cap'), + _2022: createCentsDeltaUsdPattern(this, 'class_2022_realized_cap'), + _2023: createCentsDeltaUsdPattern(this, 'class_2023_realized_cap'), + _2024: createCentsDeltaUsdPattern(this, 'class_2024_realized_cap'), + _2025: createCentsDeltaUsdPattern(this, 'class_2025_realized_cap'), + _2026: createCentsDeltaUsdPattern(this, 'class_2026_realized_cap'), + }, + entry: { + discount: createCentsDeltaUsdPattern(this, 'veteran_realized_cap'), + premium: createCentsDeltaUsdPattern(this, 'rookie_realized_cap'), + }, + utxoAmount: { + range: create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4(this, 'utxos'), + under: create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern4(this, 'utxos_under'), + over: create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4(this, 'utxos_over'), + }, + term: { + short: createCentsDeltaUsdPattern(this, 'sth_realized_cap'), + long: createCentsDeltaUsdPattern(this, 'lth_realized_cap'), + }, + type: { + p2pk65: createCentsDeltaUsdPattern(this, 'p2pk65_realized_cap'), + p2pk33: createCentsDeltaUsdPattern(this, 'p2pk33_realized_cap'), + p2pkh: createCentsDeltaUsdPattern(this, 'p2pkh_realized_cap'), + p2ms: createCentsDeltaUsdPattern(this, 'p2ms_realized_cap'), + p2sh: createCentsDeltaUsdPattern(this, 'p2sh_realized_cap'), + p2wpkh: createCentsDeltaUsdPattern(this, 'p2wpkh_realized_cap'), + p2wsh: createCentsDeltaUsdPattern(this, 'p2wsh_realized_cap'), + p2tr: createCentsDeltaUsdPattern(this, 'p2tr_realized_cap'), + p2a: createCentsDeltaUsdPattern(this, 'p2a_realized_cap'), + unknown: createCentsDeltaUsdPattern(this, 'unknown_outputs_realized_cap'), + empty: createCentsDeltaUsdPattern(this, 'empty_outputs_realized_cap'), + }, + ageRangeMatrix: createSeriesPattern18(this, 'utxos_realized_cap_cents_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'realized_cap_cents_by_epoch'), + classMatrix: createSeriesPattern18(this, 'realized_cap_cents_by_class'), + entryMatrix: createSeriesPattern18(this, 'realized_cap_cents_by_entry'), + typeMatrix: createSeriesPattern18(this, 'realized_cap_cents_by_type'), + amountRangeMatrix: createSeriesPattern18(this, 'utxos_realized_cap_cents_by_amount_range'), + addrBalance: { + range: create_0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4(this, 'addrs'), + under: create_100btc100k100sats10btc10k10m10sats1btc1k1mPattern4(this, 'addrs_under'), + over: create_100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4(this, 'addrs_over'), + matrix: createSeriesPattern18(this, 'addrs_realized_cap_cents_by_balance_range'), + }, + toOwnMcap: createAllLthSthPattern5(this, 'realized_cap_to_own_mcap'), + }, + price: { + all: createCentsPpmRatioSatsUsdPattern(this, 'realized_price'), + age: { + range: { + under1h: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_1h_old_realized_price'), + _1hTo1d: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1h_to_1d_old_realized_price'), + _1dTo1w: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1d_to_1w_old_realized_price'), + _1wTo1m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1w_to_1m_old_realized_price'), + _1mTo2m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1m_to_2m_old_realized_price'), + _2mTo3m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_2m_to_3m_old_realized_price'), + _3mTo4m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_3m_to_4m_old_realized_price'), + _4mTo5m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_4m_to_5m_old_realized_price'), + _5mTo6m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_5m_to_6m_old_realized_price'), + _6mTo9m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_6m_to_9m_old_realized_price'), + _9mTo1y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_9m_to_1y_old_realized_price'), + _1yTo18m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1y_to_18m_old_realized_price'), + _18mTo2y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_18m_to_2y_old_realized_price'), + _2yTo3y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_2y_to_3y_old_realized_price'), + _3yTo4y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_3y_to_4y_old_realized_price'), + _4yTo5y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_4y_to_5y_old_realized_price'), + _5yTo6y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_5y_to_6y_old_realized_price'), + _6yTo7y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_6y_to_7y_old_realized_price'), + _7yTo8y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_7y_to_8y_old_realized_price'), + _8yTo10y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_8y_to_10y_old_realized_price'), + _10yTo12y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_10y_to_12y_old_realized_price'), + _12yTo15y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_12y_to_15y_old_realized_price'), + over15y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_15y_old_realized_price'), + }, + under: { + _1w: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_1w_old_realized_price'), + _1m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_1m_old_realized_price'), + _2m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_2m_old_realized_price'), + _3m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_3m_old_realized_price'), + _4m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_4m_old_realized_price'), + _5m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_5m_old_realized_price'), + _6m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_6m_old_realized_price'), + _9m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_9m_old_realized_price'), + _1y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_1y_old_realized_price'), + _18m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_18m_old_realized_price'), + _2y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_2y_old_realized_price'), + _3y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_3y_old_realized_price'), + _4y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_4y_old_realized_price'), + _5y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_5y_old_realized_price'), + _6y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_6y_old_realized_price'), + _7y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_7y_old_realized_price'), + _8y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_8y_old_realized_price'), + _10y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_10y_old_realized_price'), + _12y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_12y_old_realized_price'), + _15y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_15y_old_realized_price'), + }, + over: { + _1d: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_1d_old_realized_price'), + _1w: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_1w_old_realized_price'), + _1m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_1m_old_realized_price'), + _2m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_2m_old_realized_price'), + _3m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_3m_old_realized_price'), + _4m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_4m_old_realized_price'), + _5m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_5m_old_realized_price'), + _6m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_6m_old_realized_price'), + _9m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_9m_old_realized_price'), + _1y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_1y_old_realized_price'), + _18m: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_18m_old_realized_price'), + _2y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_2y_old_realized_price'), + _3y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_3y_old_realized_price'), + _4y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_4y_old_realized_price'), + _5y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_5y_old_realized_price'), + _6y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_6y_old_realized_price'), + _7y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_7y_old_realized_price'), + _8y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_8y_old_realized_price'), + _10y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_10y_old_realized_price'), + _12y: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_12y_old_realized_price'), + }, + }, + epoch: { + _0: createCentsPpmRatioSatsUsdPattern(this, 'epoch_0_realized_price'), + _1: createCentsPpmRatioSatsUsdPattern(this, 'epoch_1_realized_price'), + _2: createCentsPpmRatioSatsUsdPattern(this, 'epoch_2_realized_price'), + _3: createCentsPpmRatioSatsUsdPattern(this, 'epoch_3_realized_price'), + _4: createCentsPpmRatioSatsUsdPattern(this, 'epoch_4_realized_price'), + }, + class: { + _2009: createCentsPpmRatioSatsUsdPattern(this, 'class_2009_realized_price'), + _2010: createCentsPpmRatioSatsUsdPattern(this, 'class_2010_realized_price'), + _2011: createCentsPpmRatioSatsUsdPattern(this, 'class_2011_realized_price'), + _2012: createCentsPpmRatioSatsUsdPattern(this, 'class_2012_realized_price'), + _2013: createCentsPpmRatioSatsUsdPattern(this, 'class_2013_realized_price'), + _2014: createCentsPpmRatioSatsUsdPattern(this, 'class_2014_realized_price'), + _2015: createCentsPpmRatioSatsUsdPattern(this, 'class_2015_realized_price'), + _2016: createCentsPpmRatioSatsUsdPattern(this, 'class_2016_realized_price'), + _2017: createCentsPpmRatioSatsUsdPattern(this, 'class_2017_realized_price'), + _2018: createCentsPpmRatioSatsUsdPattern(this, 'class_2018_realized_price'), + _2019: createCentsPpmRatioSatsUsdPattern(this, 'class_2019_realized_price'), + _2020: createCentsPpmRatioSatsUsdPattern(this, 'class_2020_realized_price'), + _2021: createCentsPpmRatioSatsUsdPattern(this, 'class_2021_realized_price'), + _2022: createCentsPpmRatioSatsUsdPattern(this, 'class_2022_realized_price'), + _2023: createCentsPpmRatioSatsUsdPattern(this, 'class_2023_realized_price'), + _2024: createCentsPpmRatioSatsUsdPattern(this, 'class_2024_realized_price'), + _2025: createCentsPpmRatioSatsUsdPattern(this, 'class_2025_realized_price'), + _2026: createCentsPpmRatioSatsUsdPattern(this, 'class_2026_realized_price'), + }, + entry: { + discount: createCentsPpmRatioSatsUsdPattern(this, 'veteran_realized_price'), + premium: createCentsPpmRatioSatsUsdPattern(this, 'rookie_realized_price'), + }, + utxoAmount: { + range: { + _0sats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_0sats_realized_price'), + _1satTo10sats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1sat_to_10sats_realized_price'), + _10satsTo100sats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_10sats_to_100sats_realized_price'), + _100satsTo1kSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_100sats_to_1k_sats_realized_price'), + _1kSatsTo10kSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1k_sats_to_10k_sats_realized_price'), + _10kSatsTo100kSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_10k_sats_to_100k_sats_realized_price'), + _100kSatsTo1mSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_100k_sats_to_1m_sats_realized_price'), + _1mSatsTo10mSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1m_sats_to_10m_sats_realized_price'), + _10mSatsTo1btc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_10m_sats_to_1btc_realized_price'), + _1btcTo10btc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1btc_to_10btc_realized_price'), + _10btcTo100btc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_10btc_to_100btc_realized_price'), + _100btcTo1kBtc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_100btc_to_1k_btc_realized_price'), + _1kBtcTo10kBtc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_1k_btc_to_10k_btc_realized_price'), + _10kBtcTo100kBtc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_10k_btc_to_100k_btc_realized_price'), + over100kBtc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_100k_btc_realized_price'), + }, + under: { + _10sats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_10sats_realized_price'), + _100sats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_100sats_realized_price'), + _1kSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_1k_sats_realized_price'), + _10kSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_10k_sats_realized_price'), + _100kSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_100k_sats_realized_price'), + _1mSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_1m_sats_realized_price'), + _10mSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_10m_sats_realized_price'), + _1btc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_1btc_realized_price'), + _10btc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_10btc_realized_price'), + _100btc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_100btc_realized_price'), + _1kBtc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_1k_btc_realized_price'), + _10kBtc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_10k_btc_realized_price'), + _100kBtc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_under_100k_btc_realized_price'), + }, + over: { + _1sat: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_1sat_realized_price'), + _10sats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_10sats_realized_price'), + _100sats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_100sats_realized_price'), + _1kSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_1k_sats_realized_price'), + _10kSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_10k_sats_realized_price'), + _100kSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_100k_sats_realized_price'), + _1mSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_1m_sats_realized_price'), + _10mSats: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_10m_sats_realized_price'), + _1btc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_1btc_realized_price'), + _10btc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_10btc_realized_price'), + _100btc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_100btc_realized_price'), + _1kBtc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_1k_btc_realized_price'), + _10kBtc: createCentsPpmRatioSatsUsdPattern(this, 'utxos_over_10k_btc_realized_price'), + }, + }, + term: { + short: createCentsPpmRatioSatsUsdPattern(this, 'sth_realized_price'), + long: createCentsPpmRatioSatsUsdPattern(this, 'lth_realized_price'), + }, + type: { + p2pk65: createCentsPpmRatioSatsUsdPattern(this, 'p2pk65_realized_price'), + p2pk33: createCentsPpmRatioSatsUsdPattern(this, 'p2pk33_realized_price'), + p2pkh: createCentsPpmRatioSatsUsdPattern(this, 'p2pkh_realized_price'), + p2ms: createCentsPpmRatioSatsUsdPattern(this, 'p2ms_realized_price'), + p2sh: createCentsPpmRatioSatsUsdPattern(this, 'p2sh_realized_price'), + p2wpkh: createCentsPpmRatioSatsUsdPattern(this, 'p2wpkh_realized_price'), + p2wsh: createCentsPpmRatioSatsUsdPattern(this, 'p2wsh_realized_price'), + p2tr: createCentsPpmRatioSatsUsdPattern(this, 'p2tr_realized_price'), + p2a: createCentsPpmRatioSatsUsdPattern(this, 'p2a_realized_price'), + unknown: createCentsPpmRatioSatsUsdPattern(this, 'unknown_outputs_realized_price'), + empty: createCentsPpmRatioSatsUsdPattern(this, 'empty_outputs_realized_price'), + }, + ageRangeMatrix: createSeriesPattern18(this, 'utxos_realized_price_cents_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'realized_price_cents_by_epoch'), + classMatrix: createSeriesPattern18(this, 'realized_price_cents_by_class'), + entryMatrix: createSeriesPattern18(this, 'realized_price_cents_by_entry'), + typeMatrix: createSeriesPattern18(this, 'realized_price_cents_by_type'), + amountRangeMatrix: createSeriesPattern18(this, 'utxos_realized_price_cents_by_amount_range'), + aggregateMatrix: createSeriesPattern18(this, 'realized_price_cents_by_aggregate'), + underAgeMatrix: createSeriesPattern18(this, 'utxos_realized_price_cents_by_under_age'), + overAgeMatrix: createSeriesPattern18(this, 'utxos_realized_price_cents_by_over_age'), + underAmountMatrix: createSeriesPattern18(this, 'utxos_realized_price_cents_by_under_amount'), + overAmountMatrix: createSeriesPattern18(this, 'utxos_realized_price_cents_by_over_amount'), }, profit: { - all: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_in_profit'), - _10pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_10pct_in_profit'), - _20pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_20pct_in_profit'), - _30pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_30pct_in_profit'), - _40pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_40pct_in_profit'), - _50pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_50pct_in_profit'), - _60pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_60pct_in_profit'), - _70pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_70pct_in_profit'), - _80pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_80pct_in_profit'), - _90pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_90pct_in_profit'), - _100pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_100pct_in_profit'), - _200pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_200pct_in_profit'), - _300pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_300pct_in_profit'), - _500pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_500pct_in_profit'), + all: createBlockCumulativeSumPattern(this, 'realized_profit'), + age: { + range: { + under1h: createBlockCumulativeSumPattern(this, 'utxos_under_1h_old_realized_profit'), + _1hTo1d: createBlockCumulativeSumPattern(this, 'utxos_1h_to_1d_old_realized_profit'), + _1dTo1w: createBlockCumulativeSumPattern(this, 'utxos_1d_to_1w_old_realized_profit'), + _1wTo1m: createBlockCumulativeSumPattern(this, 'utxos_1w_to_1m_old_realized_profit'), + _1mTo2m: createBlockCumulativeSumPattern(this, 'utxos_1m_to_2m_old_realized_profit'), + _2mTo3m: createBlockCumulativeSumPattern(this, 'utxos_2m_to_3m_old_realized_profit'), + _3mTo4m: createBlockCumulativeSumPattern(this, 'utxos_3m_to_4m_old_realized_profit'), + _4mTo5m: createBlockCumulativeSumPattern(this, 'utxos_4m_to_5m_old_realized_profit'), + _5mTo6m: createBlockCumulativeSumPattern(this, 'utxos_5m_to_6m_old_realized_profit'), + _6mTo9m: createBlockCumulativeSumPattern(this, 'utxos_6m_to_9m_old_realized_profit'), + _9mTo1y: createBlockCumulativeSumPattern(this, 'utxos_9m_to_1y_old_realized_profit'), + _1yTo18m: createBlockCumulativeSumPattern(this, 'utxos_1y_to_18m_old_realized_profit'), + _18mTo2y: createBlockCumulativeSumPattern(this, 'utxos_18m_to_2y_old_realized_profit'), + _2yTo3y: createBlockCumulativeSumPattern(this, 'utxos_2y_to_3y_old_realized_profit'), + _3yTo4y: createBlockCumulativeSumPattern(this, 'utxos_3y_to_4y_old_realized_profit'), + _4yTo5y: createBlockCumulativeSumPattern(this, 'utxos_4y_to_5y_old_realized_profit'), + _5yTo6y: createBlockCumulativeSumPattern(this, 'utxos_5y_to_6y_old_realized_profit'), + _6yTo7y: createBlockCumulativeSumPattern(this, 'utxos_6y_to_7y_old_realized_profit'), + _7yTo8y: createBlockCumulativeSumPattern(this, 'utxos_7y_to_8y_old_realized_profit'), + _8yTo10y: createBlockCumulativeSumPattern(this, 'utxos_8y_to_10y_old_realized_profit'), + _10yTo12y: createBlockCumulativeSumPattern(this, 'utxos_10y_to_12y_old_realized_profit'), + _12yTo15y: createBlockCumulativeSumPattern(this, 'utxos_12y_to_15y_old_realized_profit'), + over15y: createBlockCumulativeSumPattern(this, 'utxos_over_15y_old_realized_profit'), + }, + under: { + _1w: createBlockCumulativeSumPattern(this, 'utxos_under_1w_old_realized_profit'), + _1m: createBlockCumulativeSumPattern(this, 'utxos_under_1m_old_realized_profit'), + _2m: createBlockCumulativeSumPattern(this, 'utxos_under_2m_old_realized_profit'), + _3m: createBlockCumulativeSumPattern(this, 'utxos_under_3m_old_realized_profit'), + _4m: createBlockCumulativeSumPattern(this, 'utxos_under_4m_old_realized_profit'), + _5m: createBlockCumulativeSumPattern(this, 'utxos_under_5m_old_realized_profit'), + _6m: createBlockCumulativeSumPattern(this, 'utxos_under_6m_old_realized_profit'), + _9m: createBlockCumulativeSumPattern(this, 'utxos_under_9m_old_realized_profit'), + _1y: createBlockCumulativeSumPattern(this, 'utxos_under_1y_old_realized_profit'), + _18m: createBlockCumulativeSumPattern(this, 'utxos_under_18m_old_realized_profit'), + _2y: createBlockCumulativeSumPattern(this, 'utxos_under_2y_old_realized_profit'), + _3y: createBlockCumulativeSumPattern(this, 'utxos_under_3y_old_realized_profit'), + _4y: createBlockCumulativeSumPattern(this, 'utxos_under_4y_old_realized_profit'), + _5y: createBlockCumulativeSumPattern(this, 'utxos_under_5y_old_realized_profit'), + _6y: createBlockCumulativeSumPattern(this, 'utxos_under_6y_old_realized_profit'), + _7y: createBlockCumulativeSumPattern(this, 'utxos_under_7y_old_realized_profit'), + _8y: createBlockCumulativeSumPattern(this, 'utxos_under_8y_old_realized_profit'), + _10y: createBlockCumulativeSumPattern(this, 'utxos_under_10y_old_realized_profit'), + _12y: createBlockCumulativeSumPattern(this, 'utxos_under_12y_old_realized_profit'), + _15y: createBlockCumulativeSumPattern(this, 'utxos_under_15y_old_realized_profit'), + }, + over: { + _1d: createBlockCumulativeSumPattern(this, 'utxos_over_1d_old_realized_profit'), + _1w: createBlockCumulativeSumPattern(this, 'utxos_over_1w_old_realized_profit'), + _1m: createBlockCumulativeSumPattern(this, 'utxos_over_1m_old_realized_profit'), + _2m: createBlockCumulativeSumPattern(this, 'utxos_over_2m_old_realized_profit'), + _3m: createBlockCumulativeSumPattern(this, 'utxos_over_3m_old_realized_profit'), + _4m: createBlockCumulativeSumPattern(this, 'utxos_over_4m_old_realized_profit'), + _5m: createBlockCumulativeSumPattern(this, 'utxos_over_5m_old_realized_profit'), + _6m: createBlockCumulativeSumPattern(this, 'utxos_over_6m_old_realized_profit'), + _9m: createBlockCumulativeSumPattern(this, 'utxos_over_9m_old_realized_profit'), + _1y: createBlockCumulativeSumPattern(this, 'utxos_over_1y_old_realized_profit'), + _18m: createBlockCumulativeSumPattern(this, 'utxos_over_18m_old_realized_profit'), + _2y: createBlockCumulativeSumPattern(this, 'utxos_over_2y_old_realized_profit'), + _3y: createBlockCumulativeSumPattern(this, 'utxos_over_3y_old_realized_profit'), + _4y: createBlockCumulativeSumPattern(this, 'utxos_over_4y_old_realized_profit'), + _5y: createBlockCumulativeSumPattern(this, 'utxos_over_5y_old_realized_profit'), + _6y: createBlockCumulativeSumPattern(this, 'utxos_over_6y_old_realized_profit'), + _7y: createBlockCumulativeSumPattern(this, 'utxos_over_7y_old_realized_profit'), + _8y: createBlockCumulativeSumPattern(this, 'utxos_over_8y_old_realized_profit'), + _10y: createBlockCumulativeSumPattern(this, 'utxos_over_10y_old_realized_profit'), + _12y: createBlockCumulativeSumPattern(this, 'utxos_over_12y_old_realized_profit'), + }, + }, + epoch: { + _0: createBlockCumulativeSumPattern(this, 'epoch_0_realized_profit'), + _1: createBlockCumulativeSumPattern(this, 'epoch_1_realized_profit'), + _2: createBlockCumulativeSumPattern(this, 'epoch_2_realized_profit'), + _3: createBlockCumulativeSumPattern(this, 'epoch_3_realized_profit'), + _4: createBlockCumulativeSumPattern(this, 'epoch_4_realized_profit'), + }, + class: { + _2009: createBlockCumulativeSumPattern(this, 'class_2009_realized_profit'), + _2010: createBlockCumulativeSumPattern(this, 'class_2010_realized_profit'), + _2011: createBlockCumulativeSumPattern(this, 'class_2011_realized_profit'), + _2012: createBlockCumulativeSumPattern(this, 'class_2012_realized_profit'), + _2013: createBlockCumulativeSumPattern(this, 'class_2013_realized_profit'), + _2014: createBlockCumulativeSumPattern(this, 'class_2014_realized_profit'), + _2015: createBlockCumulativeSumPattern(this, 'class_2015_realized_profit'), + _2016: createBlockCumulativeSumPattern(this, 'class_2016_realized_profit'), + _2017: createBlockCumulativeSumPattern(this, 'class_2017_realized_profit'), + _2018: createBlockCumulativeSumPattern(this, 'class_2018_realized_profit'), + _2019: createBlockCumulativeSumPattern(this, 'class_2019_realized_profit'), + _2020: createBlockCumulativeSumPattern(this, 'class_2020_realized_profit'), + _2021: createBlockCumulativeSumPattern(this, 'class_2021_realized_profit'), + _2022: createBlockCumulativeSumPattern(this, 'class_2022_realized_profit'), + _2023: createBlockCumulativeSumPattern(this, 'class_2023_realized_profit'), + _2024: createBlockCumulativeSumPattern(this, 'class_2024_realized_profit'), + _2025: createBlockCumulativeSumPattern(this, 'class_2025_realized_profit'), + _2026: createBlockCumulativeSumPattern(this, 'class_2026_realized_profit'), + }, + entry: createDiscountPremiumPattern5(this, 'realized_profit'), + utxoAmount: { + range: { + _0sats: createBlockCumulativeSumPattern(this, 'utxos_0sats_realized_profit'), + _1satTo10sats: createBlockCumulativeSumPattern(this, 'utxos_1sat_to_10sats_realized_profit'), + _10satsTo100sats: createBlockCumulativeSumPattern(this, 'utxos_10sats_to_100sats_realized_profit'), + _100satsTo1kSats: createBlockCumulativeSumPattern(this, 'utxos_100sats_to_1k_sats_realized_profit'), + _1kSatsTo10kSats: createBlockCumulativeSumPattern(this, 'utxos_1k_sats_to_10k_sats_realized_profit'), + _10kSatsTo100kSats: createBlockCumulativeSumPattern(this, 'utxos_10k_sats_to_100k_sats_realized_profit'), + _100kSatsTo1mSats: createBlockCumulativeSumPattern(this, 'utxos_100k_sats_to_1m_sats_realized_profit'), + _1mSatsTo10mSats: createBlockCumulativeSumPattern(this, 'utxos_1m_sats_to_10m_sats_realized_profit'), + _10mSatsTo1btc: createBlockCumulativeSumPattern(this, 'utxos_10m_sats_to_1btc_realized_profit'), + _1btcTo10btc: createBlockCumulativeSumPattern(this, 'utxos_1btc_to_10btc_realized_profit'), + _10btcTo100btc: createBlockCumulativeSumPattern(this, 'utxos_10btc_to_100btc_realized_profit'), + _100btcTo1kBtc: createBlockCumulativeSumPattern(this, 'utxos_100btc_to_1k_btc_realized_profit'), + _1kBtcTo10kBtc: createBlockCumulativeSumPattern(this, 'utxos_1k_btc_to_10k_btc_realized_profit'), + _10kBtcTo100kBtc: createBlockCumulativeSumPattern(this, 'utxos_10k_btc_to_100k_btc_realized_profit'), + over100kBtc: createBlockCumulativeSumPattern(this, 'utxos_over_100k_btc_realized_profit'), + }, + under: { + _10sats: createBlockCumulativeSumPattern(this, 'utxos_under_10sats_realized_profit'), + _100sats: createBlockCumulativeSumPattern(this, 'utxos_under_100sats_realized_profit'), + _1kSats: createBlockCumulativeSumPattern(this, 'utxos_under_1k_sats_realized_profit'), + _10kSats: createBlockCumulativeSumPattern(this, 'utxos_under_10k_sats_realized_profit'), + _100kSats: createBlockCumulativeSumPattern(this, 'utxos_under_100k_sats_realized_profit'), + _1mSats: createBlockCumulativeSumPattern(this, 'utxos_under_1m_sats_realized_profit'), + _10mSats: createBlockCumulativeSumPattern(this, 'utxos_under_10m_sats_realized_profit'), + _1btc: createBlockCumulativeSumPattern(this, 'utxos_under_1btc_realized_profit'), + _10btc: createBlockCumulativeSumPattern(this, 'utxos_under_10btc_realized_profit'), + _100btc: createBlockCumulativeSumPattern(this, 'utxos_under_100btc_realized_profit'), + _1kBtc: createBlockCumulativeSumPattern(this, 'utxos_under_1k_btc_realized_profit'), + _10kBtc: createBlockCumulativeSumPattern(this, 'utxos_under_10k_btc_realized_profit'), + _100kBtc: createBlockCumulativeSumPattern(this, 'utxos_under_100k_btc_realized_profit'), + }, + over: { + _1sat: createBlockCumulativeSumPattern(this, 'utxos_over_1sat_realized_profit'), + _10sats: createBlockCumulativeSumPattern(this, 'utxos_over_10sats_realized_profit'), + _100sats: createBlockCumulativeSumPattern(this, 'utxos_over_100sats_realized_profit'), + _1kSats: createBlockCumulativeSumPattern(this, 'utxos_over_1k_sats_realized_profit'), + _10kSats: createBlockCumulativeSumPattern(this, 'utxos_over_10k_sats_realized_profit'), + _100kSats: createBlockCumulativeSumPattern(this, 'utxos_over_100k_sats_realized_profit'), + _1mSats: createBlockCumulativeSumPattern(this, 'utxos_over_1m_sats_realized_profit'), + _10mSats: createBlockCumulativeSumPattern(this, 'utxos_over_10m_sats_realized_profit'), + _1btc: createBlockCumulativeSumPattern(this, 'utxos_over_1btc_realized_profit'), + _10btc: createBlockCumulativeSumPattern(this, 'utxos_over_10btc_realized_profit'), + _100btc: createBlockCumulativeSumPattern(this, 'utxos_over_100btc_realized_profit'), + _1kBtc: createBlockCumulativeSumPattern(this, 'utxos_over_1k_btc_realized_profit'), + _10kBtc: createBlockCumulativeSumPattern(this, 'utxos_over_10k_btc_realized_profit'), + }, + }, + term: createLongShortPattern6(this, 'realized_profit'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5(this, 'realized_profit'), + ageRangeMatrix: createSeriesPattern18(this, 'utxos_realized_profit_cumulative_cents_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'realized_profit_cumulative_cents_by_epoch'), + classMatrix: createSeriesPattern18(this, 'realized_profit_cumulative_cents_by_class'), + entryMatrix: createSeriesPattern18(this, 'realized_profit_cumulative_cents_by_entry'), + typeMatrix: createSeriesPattern18(this, 'realized_profit_cumulative_cents_by_type'), + amountRangeMatrix: createSeriesPattern18(this, 'utxos_realized_profit_cumulative_cents_by_amount_range'), + addrBalance: { + range: { + _0sats: createBlockCumulativeSumPattern(this, 'addrs_0sats_realized_profit'), + _1satTo10sats: createBlockCumulativeSumPattern(this, 'addrs_1sat_to_10sats_realized_profit'), + _10satsTo100sats: createBlockCumulativeSumPattern(this, 'addrs_10sats_to_100sats_realized_profit'), + _100satsTo1kSats: createBlockCumulativeSumPattern(this, 'addrs_100sats_to_1k_sats_realized_profit'), + _1kSatsTo10kSats: createBlockCumulativeSumPattern(this, 'addrs_1k_sats_to_10k_sats_realized_profit'), + _10kSatsTo100kSats: createBlockCumulativeSumPattern(this, 'addrs_10k_sats_to_100k_sats_realized_profit'), + _100kSatsTo1mSats: createBlockCumulativeSumPattern(this, 'addrs_100k_sats_to_1m_sats_realized_profit'), + _1mSatsTo10mSats: createBlockCumulativeSumPattern(this, 'addrs_1m_sats_to_10m_sats_realized_profit'), + _10mSatsTo1btc: createBlockCumulativeSumPattern(this, 'addrs_10m_sats_to_1btc_realized_profit'), + _1btcTo10btc: createBlockCumulativeSumPattern(this, 'addrs_1btc_to_10btc_realized_profit'), + _10btcTo100btc: createBlockCumulativeSumPattern(this, 'addrs_10btc_to_100btc_realized_profit'), + _100btcTo1kBtc: createBlockCumulativeSumPattern(this, 'addrs_100btc_to_1k_btc_realized_profit'), + _1kBtcTo10kBtc: createBlockCumulativeSumPattern(this, 'addrs_1k_btc_to_10k_btc_realized_profit'), + _10kBtcTo100kBtc: createBlockCumulativeSumPattern(this, 'addrs_10k_btc_to_100k_btc_realized_profit'), + over100kBtc: createBlockCumulativeSumPattern(this, 'addrs_over_100k_btc_realized_profit'), + }, + under: { + _10sats: createBlockCumulativeSumPattern(this, 'addrs_under_10sats_realized_profit'), + _100sats: createBlockCumulativeSumPattern(this, 'addrs_under_100sats_realized_profit'), + _1kSats: createBlockCumulativeSumPattern(this, 'addrs_under_1k_sats_realized_profit'), + _10kSats: createBlockCumulativeSumPattern(this, 'addrs_under_10k_sats_realized_profit'), + _100kSats: createBlockCumulativeSumPattern(this, 'addrs_under_100k_sats_realized_profit'), + _1mSats: createBlockCumulativeSumPattern(this, 'addrs_under_1m_sats_realized_profit'), + _10mSats: createBlockCumulativeSumPattern(this, 'addrs_under_10m_sats_realized_profit'), + _1btc: createBlockCumulativeSumPattern(this, 'addrs_under_1btc_realized_profit'), + _10btc: createBlockCumulativeSumPattern(this, 'addrs_under_10btc_realized_profit'), + _100btc: createBlockCumulativeSumPattern(this, 'addrs_under_100btc_realized_profit'), + _1kBtc: createBlockCumulativeSumPattern(this, 'addrs_under_1k_btc_realized_profit'), + _10kBtc: createBlockCumulativeSumPattern(this, 'addrs_under_10k_btc_realized_profit'), + _100kBtc: createBlockCumulativeSumPattern(this, 'addrs_under_100k_btc_realized_profit'), + }, + over: { + _1sat: createBlockCumulativeSumPattern(this, 'addrs_over_1sat_realized_profit'), + _10sats: createBlockCumulativeSumPattern(this, 'addrs_over_10sats_realized_profit'), + _100sats: createBlockCumulativeSumPattern(this, 'addrs_over_100sats_realized_profit'), + _1kSats: createBlockCumulativeSumPattern(this, 'addrs_over_1k_sats_realized_profit'), + _10kSats: createBlockCumulativeSumPattern(this, 'addrs_over_10k_sats_realized_profit'), + _100kSats: createBlockCumulativeSumPattern(this, 'addrs_over_100k_sats_realized_profit'), + _1mSats: createBlockCumulativeSumPattern(this, 'addrs_over_1m_sats_realized_profit'), + _10mSats: createBlockCumulativeSumPattern(this, 'addrs_over_10m_sats_realized_profit'), + _1btc: createBlockCumulativeSumPattern(this, 'addrs_over_1btc_realized_profit'), + _10btc: createBlockCumulativeSumPattern(this, 'addrs_over_10btc_realized_profit'), + _100btc: createBlockCumulativeSumPattern(this, 'addrs_over_100btc_realized_profit'), + _1kBtc: createBlockCumulativeSumPattern(this, 'addrs_over_1k_btc_realized_profit'), + _10kBtc: createBlockCumulativeSumPattern(this, 'addrs_over_10k_btc_realized_profit'), + }, + matrix: createSeriesPattern18(this, 'addrs_realized_profit_cumulative_cents_by_balance_range'), + }, }, loss: { - all: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_in_loss'), - _10pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_10pct_in_loss'), - _20pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_20pct_in_loss'), - _30pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_30pct_in_loss'), - _40pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_40pct_in_loss'), - _50pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_50pct_in_loss'), - _60pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_60pct_in_loss'), - _70pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_70pct_in_loss'), - _80pct: createNuplRealizedSupplyUnrealizedPattern(this, 'utxos_over_80pct_in_loss'), + all: createBlockCumulativeSumPattern(this, 'realized_loss'), + age: { + range: { + under1h: createBlockCumulativeSumPattern(this, 'utxos_under_1h_old_realized_loss'), + _1hTo1d: createBlockCumulativeSumPattern(this, 'utxos_1h_to_1d_old_realized_loss'), + _1dTo1w: createBlockCumulativeSumPattern(this, 'utxos_1d_to_1w_old_realized_loss'), + _1wTo1m: createBlockCumulativeSumPattern(this, 'utxos_1w_to_1m_old_realized_loss'), + _1mTo2m: createBlockCumulativeSumPattern(this, 'utxos_1m_to_2m_old_realized_loss'), + _2mTo3m: createBlockCumulativeSumPattern(this, 'utxos_2m_to_3m_old_realized_loss'), + _3mTo4m: createBlockCumulativeSumPattern(this, 'utxos_3m_to_4m_old_realized_loss'), + _4mTo5m: createBlockCumulativeSumPattern(this, 'utxos_4m_to_5m_old_realized_loss'), + _5mTo6m: createBlockCumulativeSumPattern(this, 'utxos_5m_to_6m_old_realized_loss'), + _6mTo9m: createBlockCumulativeSumPattern(this, 'utxos_6m_to_9m_old_realized_loss'), + _9mTo1y: createBlockCumulativeSumPattern(this, 'utxos_9m_to_1y_old_realized_loss'), + _1yTo18m: createBlockCumulativeSumPattern(this, 'utxos_1y_to_18m_old_realized_loss'), + _18mTo2y: createBlockCumulativeSumPattern(this, 'utxos_18m_to_2y_old_realized_loss'), + _2yTo3y: createBlockCumulativeSumPattern(this, 'utxos_2y_to_3y_old_realized_loss'), + _3yTo4y: createBlockCumulativeSumPattern(this, 'utxos_3y_to_4y_old_realized_loss'), + _4yTo5y: createBlockCumulativeSumPattern(this, 'utxos_4y_to_5y_old_realized_loss'), + _5yTo6y: createBlockCumulativeSumPattern(this, 'utxos_5y_to_6y_old_realized_loss'), + _6yTo7y: createBlockCumulativeSumPattern(this, 'utxos_6y_to_7y_old_realized_loss'), + _7yTo8y: createBlockCumulativeSumPattern(this, 'utxos_7y_to_8y_old_realized_loss'), + _8yTo10y: createBlockCumulativeSumPattern(this, 'utxos_8y_to_10y_old_realized_loss'), + _10yTo12y: createBlockCumulativeSumPattern(this, 'utxos_10y_to_12y_old_realized_loss'), + _12yTo15y: createBlockCumulativeSumPattern(this, 'utxos_12y_to_15y_old_realized_loss'), + over15y: createBlockCumulativeSumPattern(this, 'utxos_over_15y_old_realized_loss'), + }, + under: { + _1w: createBlockCumulativeSumPattern(this, 'utxos_under_1w_old_realized_loss'), + _1m: createBlockCumulativeSumPattern(this, 'utxos_under_1m_old_realized_loss'), + _2m: createBlockCumulativeSumPattern(this, 'utxos_under_2m_old_realized_loss'), + _3m: createBlockCumulativeSumPattern(this, 'utxos_under_3m_old_realized_loss'), + _4m: createBlockCumulativeSumPattern(this, 'utxos_under_4m_old_realized_loss'), + _5m: createBlockCumulativeSumPattern(this, 'utxos_under_5m_old_realized_loss'), + _6m: createBlockCumulativeSumPattern(this, 'utxos_under_6m_old_realized_loss'), + _9m: createBlockCumulativeSumPattern(this, 'utxos_under_9m_old_realized_loss'), + _1y: createBlockCumulativeSumPattern(this, 'utxos_under_1y_old_realized_loss'), + _18m: createBlockCumulativeSumPattern(this, 'utxos_under_18m_old_realized_loss'), + _2y: createBlockCumulativeSumPattern(this, 'utxos_under_2y_old_realized_loss'), + _3y: createBlockCumulativeSumPattern(this, 'utxos_under_3y_old_realized_loss'), + _4y: createBlockCumulativeSumPattern(this, 'utxos_under_4y_old_realized_loss'), + _5y: createBlockCumulativeSumPattern(this, 'utxos_under_5y_old_realized_loss'), + _6y: createBlockCumulativeSumPattern(this, 'utxos_under_6y_old_realized_loss'), + _7y: createBlockCumulativeSumPattern(this, 'utxos_under_7y_old_realized_loss'), + _8y: createBlockCumulativeSumPattern(this, 'utxos_under_8y_old_realized_loss'), + _10y: createBlockCumulativeSumPattern(this, 'utxos_under_10y_old_realized_loss'), + _12y: createBlockCumulativeSumPattern(this, 'utxos_under_12y_old_realized_loss'), + _15y: createBlockCumulativeSumPattern(this, 'utxos_under_15y_old_realized_loss'), + }, + over: { + _1d: createBlockCumulativeSumPattern(this, 'utxos_over_1d_old_realized_loss'), + _1w: createBlockCumulativeSumPattern(this, 'utxos_over_1w_old_realized_loss'), + _1m: createBlockCumulativeSumPattern(this, 'utxos_over_1m_old_realized_loss'), + _2m: createBlockCumulativeSumPattern(this, 'utxos_over_2m_old_realized_loss'), + _3m: createBlockCumulativeSumPattern(this, 'utxos_over_3m_old_realized_loss'), + _4m: createBlockCumulativeSumPattern(this, 'utxos_over_4m_old_realized_loss'), + _5m: createBlockCumulativeSumPattern(this, 'utxos_over_5m_old_realized_loss'), + _6m: createBlockCumulativeSumPattern(this, 'utxos_over_6m_old_realized_loss'), + _9m: createBlockCumulativeSumPattern(this, 'utxos_over_9m_old_realized_loss'), + _1y: createBlockCumulativeSumPattern(this, 'utxos_over_1y_old_realized_loss'), + _18m: createBlockCumulativeSumPattern(this, 'utxos_over_18m_old_realized_loss'), + _2y: createBlockCumulativeSumPattern(this, 'utxos_over_2y_old_realized_loss'), + _3y: createBlockCumulativeSumPattern(this, 'utxos_over_3y_old_realized_loss'), + _4y: createBlockCumulativeSumPattern(this, 'utxos_over_4y_old_realized_loss'), + _5y: createBlockCumulativeSumPattern(this, 'utxos_over_5y_old_realized_loss'), + _6y: createBlockCumulativeSumPattern(this, 'utxos_over_6y_old_realized_loss'), + _7y: createBlockCumulativeSumPattern(this, 'utxos_over_7y_old_realized_loss'), + _8y: createBlockCumulativeSumPattern(this, 'utxos_over_8y_old_realized_loss'), + _10y: createBlockCumulativeSumPattern(this, 'utxos_over_10y_old_realized_loss'), + _12y: createBlockCumulativeSumPattern(this, 'utxos_over_12y_old_realized_loss'), + }, + }, + epoch: { + _0: createBlockCumulativeSumPattern(this, 'epoch_0_realized_loss'), + _1: createBlockCumulativeSumPattern(this, 'epoch_1_realized_loss'), + _2: createBlockCumulativeSumPattern(this, 'epoch_2_realized_loss'), + _3: createBlockCumulativeSumPattern(this, 'epoch_3_realized_loss'), + _4: createBlockCumulativeSumPattern(this, 'epoch_4_realized_loss'), + }, + class: { + _2009: createBlockCumulativeSumPattern(this, 'class_2009_realized_loss'), + _2010: createBlockCumulativeSumPattern(this, 'class_2010_realized_loss'), + _2011: createBlockCumulativeSumPattern(this, 'class_2011_realized_loss'), + _2012: createBlockCumulativeSumPattern(this, 'class_2012_realized_loss'), + _2013: createBlockCumulativeSumPattern(this, 'class_2013_realized_loss'), + _2014: createBlockCumulativeSumPattern(this, 'class_2014_realized_loss'), + _2015: createBlockCumulativeSumPattern(this, 'class_2015_realized_loss'), + _2016: createBlockCumulativeSumPattern(this, 'class_2016_realized_loss'), + _2017: createBlockCumulativeSumPattern(this, 'class_2017_realized_loss'), + _2018: createBlockCumulativeSumPattern(this, 'class_2018_realized_loss'), + _2019: createBlockCumulativeSumPattern(this, 'class_2019_realized_loss'), + _2020: createBlockCumulativeSumPattern(this, 'class_2020_realized_loss'), + _2021: createBlockCumulativeSumPattern(this, 'class_2021_realized_loss'), + _2022: createBlockCumulativeSumPattern(this, 'class_2022_realized_loss'), + _2023: createBlockCumulativeSumPattern(this, 'class_2023_realized_loss'), + _2024: createBlockCumulativeSumPattern(this, 'class_2024_realized_loss'), + _2025: createBlockCumulativeSumPattern(this, 'class_2025_realized_loss'), + _2026: createBlockCumulativeSumPattern(this, 'class_2026_realized_loss'), + }, + entry: createDiscountPremiumPattern5(this, 'realized_loss'), + utxoAmount: { + range: { + _0sats: createBlockCumulativeSumPattern(this, 'utxos_0sats_realized_loss'), + _1satTo10sats: createBlockCumulativeSumPattern(this, 'utxos_1sat_to_10sats_realized_loss'), + _10satsTo100sats: createBlockCumulativeSumPattern(this, 'utxos_10sats_to_100sats_realized_loss'), + _100satsTo1kSats: createBlockCumulativeSumPattern(this, 'utxos_100sats_to_1k_sats_realized_loss'), + _1kSatsTo10kSats: createBlockCumulativeSumPattern(this, 'utxos_1k_sats_to_10k_sats_realized_loss'), + _10kSatsTo100kSats: createBlockCumulativeSumPattern(this, 'utxos_10k_sats_to_100k_sats_realized_loss'), + _100kSatsTo1mSats: createBlockCumulativeSumPattern(this, 'utxos_100k_sats_to_1m_sats_realized_loss'), + _1mSatsTo10mSats: createBlockCumulativeSumPattern(this, 'utxos_1m_sats_to_10m_sats_realized_loss'), + _10mSatsTo1btc: createBlockCumulativeSumPattern(this, 'utxos_10m_sats_to_1btc_realized_loss'), + _1btcTo10btc: createBlockCumulativeSumPattern(this, 'utxos_1btc_to_10btc_realized_loss'), + _10btcTo100btc: createBlockCumulativeSumPattern(this, 'utxos_10btc_to_100btc_realized_loss'), + _100btcTo1kBtc: createBlockCumulativeSumPattern(this, 'utxos_100btc_to_1k_btc_realized_loss'), + _1kBtcTo10kBtc: createBlockCumulativeSumPattern(this, 'utxos_1k_btc_to_10k_btc_realized_loss'), + _10kBtcTo100kBtc: createBlockCumulativeSumPattern(this, 'utxos_10k_btc_to_100k_btc_realized_loss'), + over100kBtc: createBlockCumulativeSumPattern(this, 'utxos_over_100k_btc_realized_loss'), + }, + under: { + _10sats: createBlockCumulativeSumPattern(this, 'utxos_under_10sats_realized_loss'), + _100sats: createBlockCumulativeSumPattern(this, 'utxos_under_100sats_realized_loss'), + _1kSats: createBlockCumulativeSumPattern(this, 'utxos_under_1k_sats_realized_loss'), + _10kSats: createBlockCumulativeSumPattern(this, 'utxos_under_10k_sats_realized_loss'), + _100kSats: createBlockCumulativeSumPattern(this, 'utxos_under_100k_sats_realized_loss'), + _1mSats: createBlockCumulativeSumPattern(this, 'utxos_under_1m_sats_realized_loss'), + _10mSats: createBlockCumulativeSumPattern(this, 'utxos_under_10m_sats_realized_loss'), + _1btc: createBlockCumulativeSumPattern(this, 'utxos_under_1btc_realized_loss'), + _10btc: createBlockCumulativeSumPattern(this, 'utxos_under_10btc_realized_loss'), + _100btc: createBlockCumulativeSumPattern(this, 'utxos_under_100btc_realized_loss'), + _1kBtc: createBlockCumulativeSumPattern(this, 'utxos_under_1k_btc_realized_loss'), + _10kBtc: createBlockCumulativeSumPattern(this, 'utxos_under_10k_btc_realized_loss'), + _100kBtc: createBlockCumulativeSumPattern(this, 'utxos_under_100k_btc_realized_loss'), + }, + over: { + _1sat: createBlockCumulativeSumPattern(this, 'utxos_over_1sat_realized_loss'), + _10sats: createBlockCumulativeSumPattern(this, 'utxos_over_10sats_realized_loss'), + _100sats: createBlockCumulativeSumPattern(this, 'utxos_over_100sats_realized_loss'), + _1kSats: createBlockCumulativeSumPattern(this, 'utxos_over_1k_sats_realized_loss'), + _10kSats: createBlockCumulativeSumPattern(this, 'utxos_over_10k_sats_realized_loss'), + _100kSats: createBlockCumulativeSumPattern(this, 'utxos_over_100k_sats_realized_loss'), + _1mSats: createBlockCumulativeSumPattern(this, 'utxos_over_1m_sats_realized_loss'), + _10mSats: createBlockCumulativeSumPattern(this, 'utxos_over_10m_sats_realized_loss'), + _1btc: createBlockCumulativeSumPattern(this, 'utxos_over_1btc_realized_loss'), + _10btc: createBlockCumulativeSumPattern(this, 'utxos_over_10btc_realized_loss'), + _100btc: createBlockCumulativeSumPattern(this, 'utxos_over_100btc_realized_loss'), + _1kBtc: createBlockCumulativeSumPattern(this, 'utxos_over_1k_btc_realized_loss'), + _10kBtc: createBlockCumulativeSumPattern(this, 'utxos_over_10k_btc_realized_loss'), + }, + }, + term: createLongShortPattern6(this, 'realized_loss'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5(this, 'realized_loss'), + ageRangeMatrix: createSeriesPattern18(this, 'utxos_realized_loss_cumulative_cents_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'realized_loss_cumulative_cents_by_epoch'), + classMatrix: createSeriesPattern18(this, 'realized_loss_cumulative_cents_by_class'), + entryMatrix: createSeriesPattern18(this, 'realized_loss_cumulative_cents_by_entry'), + typeMatrix: createSeriesPattern18(this, 'realized_loss_cumulative_cents_by_type'), + amountRangeMatrix: createSeriesPattern18(this, 'utxos_realized_loss_cumulative_cents_by_amount_range'), + addrBalance: { + range: { + _0sats: createBlockCumulativeSumPattern(this, 'addrs_0sats_realized_loss'), + _1satTo10sats: createBlockCumulativeSumPattern(this, 'addrs_1sat_to_10sats_realized_loss'), + _10satsTo100sats: createBlockCumulativeSumPattern(this, 'addrs_10sats_to_100sats_realized_loss'), + _100satsTo1kSats: createBlockCumulativeSumPattern(this, 'addrs_100sats_to_1k_sats_realized_loss'), + _1kSatsTo10kSats: createBlockCumulativeSumPattern(this, 'addrs_1k_sats_to_10k_sats_realized_loss'), + _10kSatsTo100kSats: createBlockCumulativeSumPattern(this, 'addrs_10k_sats_to_100k_sats_realized_loss'), + _100kSatsTo1mSats: createBlockCumulativeSumPattern(this, 'addrs_100k_sats_to_1m_sats_realized_loss'), + _1mSatsTo10mSats: createBlockCumulativeSumPattern(this, 'addrs_1m_sats_to_10m_sats_realized_loss'), + _10mSatsTo1btc: createBlockCumulativeSumPattern(this, 'addrs_10m_sats_to_1btc_realized_loss'), + _1btcTo10btc: createBlockCumulativeSumPattern(this, 'addrs_1btc_to_10btc_realized_loss'), + _10btcTo100btc: createBlockCumulativeSumPattern(this, 'addrs_10btc_to_100btc_realized_loss'), + _100btcTo1kBtc: createBlockCumulativeSumPattern(this, 'addrs_100btc_to_1k_btc_realized_loss'), + _1kBtcTo10kBtc: createBlockCumulativeSumPattern(this, 'addrs_1k_btc_to_10k_btc_realized_loss'), + _10kBtcTo100kBtc: createBlockCumulativeSumPattern(this, 'addrs_10k_btc_to_100k_btc_realized_loss'), + over100kBtc: createBlockCumulativeSumPattern(this, 'addrs_over_100k_btc_realized_loss'), + }, + under: { + _10sats: createBlockCumulativeSumPattern(this, 'addrs_under_10sats_realized_loss'), + _100sats: createBlockCumulativeSumPattern(this, 'addrs_under_100sats_realized_loss'), + _1kSats: createBlockCumulativeSumPattern(this, 'addrs_under_1k_sats_realized_loss'), + _10kSats: createBlockCumulativeSumPattern(this, 'addrs_under_10k_sats_realized_loss'), + _100kSats: createBlockCumulativeSumPattern(this, 'addrs_under_100k_sats_realized_loss'), + _1mSats: createBlockCumulativeSumPattern(this, 'addrs_under_1m_sats_realized_loss'), + _10mSats: createBlockCumulativeSumPattern(this, 'addrs_under_10m_sats_realized_loss'), + _1btc: createBlockCumulativeSumPattern(this, 'addrs_under_1btc_realized_loss'), + _10btc: createBlockCumulativeSumPattern(this, 'addrs_under_10btc_realized_loss'), + _100btc: createBlockCumulativeSumPattern(this, 'addrs_under_100btc_realized_loss'), + _1kBtc: createBlockCumulativeSumPattern(this, 'addrs_under_1k_btc_realized_loss'), + _10kBtc: createBlockCumulativeSumPattern(this, 'addrs_under_10k_btc_realized_loss'), + _100kBtc: createBlockCumulativeSumPattern(this, 'addrs_under_100k_btc_realized_loss'), + }, + over: { + _1sat: createBlockCumulativeSumPattern(this, 'addrs_over_1sat_realized_loss'), + _10sats: createBlockCumulativeSumPattern(this, 'addrs_over_10sats_realized_loss'), + _100sats: createBlockCumulativeSumPattern(this, 'addrs_over_100sats_realized_loss'), + _1kSats: createBlockCumulativeSumPattern(this, 'addrs_over_1k_sats_realized_loss'), + _10kSats: createBlockCumulativeSumPattern(this, 'addrs_over_10k_sats_realized_loss'), + _100kSats: createBlockCumulativeSumPattern(this, 'addrs_over_100k_sats_realized_loss'), + _1mSats: createBlockCumulativeSumPattern(this, 'addrs_over_1m_sats_realized_loss'), + _10mSats: createBlockCumulativeSumPattern(this, 'addrs_over_10m_sats_realized_loss'), + _1btc: createBlockCumulativeSumPattern(this, 'addrs_over_1btc_realized_loss'), + _10btc: createBlockCumulativeSumPattern(this, 'addrs_over_10btc_realized_loss'), + _100btc: createBlockCumulativeSumPattern(this, 'addrs_over_100btc_realized_loss'), + _1kBtc: createBlockCumulativeSumPattern(this, 'addrs_over_1k_btc_realized_loss'), + _10kBtc: createBlockCumulativeSumPattern(this, 'addrs_over_10k_btc_realized_loss'), + }, + matrix: createSeriesPattern18(this, 'addrs_realized_loss_cumulative_cents_by_balance_range'), + }, + negative: { + all: createBaseSumPattern(this, 'realized_loss_neg'), + age: { + range: { + under1h: createBaseSumPattern(this, 'utxos_under_1h_old_realized_loss_neg'), + _1hTo1d: createBaseSumPattern(this, 'utxos_1h_to_1d_old_realized_loss_neg'), + _1dTo1w: createBaseSumPattern(this, 'utxos_1d_to_1w_old_realized_loss_neg'), + _1wTo1m: createBaseSumPattern(this, 'utxos_1w_to_1m_old_realized_loss_neg'), + _1mTo2m: createBaseSumPattern(this, 'utxos_1m_to_2m_old_realized_loss_neg'), + _2mTo3m: createBaseSumPattern(this, 'utxos_2m_to_3m_old_realized_loss_neg'), + _3mTo4m: createBaseSumPattern(this, 'utxos_3m_to_4m_old_realized_loss_neg'), + _4mTo5m: createBaseSumPattern(this, 'utxos_4m_to_5m_old_realized_loss_neg'), + _5mTo6m: createBaseSumPattern(this, 'utxos_5m_to_6m_old_realized_loss_neg'), + _6mTo9m: createBaseSumPattern(this, 'utxos_6m_to_9m_old_realized_loss_neg'), + _9mTo1y: createBaseSumPattern(this, 'utxos_9m_to_1y_old_realized_loss_neg'), + _1yTo18m: createBaseSumPattern(this, 'utxos_1y_to_18m_old_realized_loss_neg'), + _18mTo2y: createBaseSumPattern(this, 'utxos_18m_to_2y_old_realized_loss_neg'), + _2yTo3y: createBaseSumPattern(this, 'utxos_2y_to_3y_old_realized_loss_neg'), + _3yTo4y: createBaseSumPattern(this, 'utxos_3y_to_4y_old_realized_loss_neg'), + _4yTo5y: createBaseSumPattern(this, 'utxos_4y_to_5y_old_realized_loss_neg'), + _5yTo6y: createBaseSumPattern(this, 'utxos_5y_to_6y_old_realized_loss_neg'), + _6yTo7y: createBaseSumPattern(this, 'utxos_6y_to_7y_old_realized_loss_neg'), + _7yTo8y: createBaseSumPattern(this, 'utxos_7y_to_8y_old_realized_loss_neg'), + _8yTo10y: createBaseSumPattern(this, 'utxos_8y_to_10y_old_realized_loss_neg'), + _10yTo12y: createBaseSumPattern(this, 'utxos_10y_to_12y_old_realized_loss_neg'), + _12yTo15y: createBaseSumPattern(this, 'utxos_12y_to_15y_old_realized_loss_neg'), + over15y: createBaseSumPattern(this, 'utxos_over_15y_old_realized_loss_neg'), + }, + under: { + _1w: createBaseSumPattern(this, 'utxos_under_1w_old_realized_loss_neg'), + _1m: createBaseSumPattern(this, 'utxos_under_1m_old_realized_loss_neg'), + _2m: createBaseSumPattern(this, 'utxos_under_2m_old_realized_loss_neg'), + _3m: createBaseSumPattern(this, 'utxos_under_3m_old_realized_loss_neg'), + _4m: createBaseSumPattern(this, 'utxos_under_4m_old_realized_loss_neg'), + _5m: createBaseSumPattern(this, 'utxos_under_5m_old_realized_loss_neg'), + _6m: createBaseSumPattern(this, 'utxos_under_6m_old_realized_loss_neg'), + _9m: createBaseSumPattern(this, 'utxos_under_9m_old_realized_loss_neg'), + _1y: createBaseSumPattern(this, 'utxos_under_1y_old_realized_loss_neg'), + _18m: createBaseSumPattern(this, 'utxos_under_18m_old_realized_loss_neg'), + _2y: createBaseSumPattern(this, 'utxos_under_2y_old_realized_loss_neg'), + _3y: createBaseSumPattern(this, 'utxos_under_3y_old_realized_loss_neg'), + _4y: createBaseSumPattern(this, 'utxos_under_4y_old_realized_loss_neg'), + _5y: createBaseSumPattern(this, 'utxos_under_5y_old_realized_loss_neg'), + _6y: createBaseSumPattern(this, 'utxos_under_6y_old_realized_loss_neg'), + _7y: createBaseSumPattern(this, 'utxos_under_7y_old_realized_loss_neg'), + _8y: createBaseSumPattern(this, 'utxos_under_8y_old_realized_loss_neg'), + _10y: createBaseSumPattern(this, 'utxos_under_10y_old_realized_loss_neg'), + _12y: createBaseSumPattern(this, 'utxos_under_12y_old_realized_loss_neg'), + _15y: createBaseSumPattern(this, 'utxos_under_15y_old_realized_loss_neg'), + }, + over: { + _1d: createBaseSumPattern(this, 'utxos_over_1d_old_realized_loss_neg'), + _1w: createBaseSumPattern(this, 'utxos_over_1w_old_realized_loss_neg'), + _1m: createBaseSumPattern(this, 'utxos_over_1m_old_realized_loss_neg'), + _2m: createBaseSumPattern(this, 'utxos_over_2m_old_realized_loss_neg'), + _3m: createBaseSumPattern(this, 'utxos_over_3m_old_realized_loss_neg'), + _4m: createBaseSumPattern(this, 'utxos_over_4m_old_realized_loss_neg'), + _5m: createBaseSumPattern(this, 'utxos_over_5m_old_realized_loss_neg'), + _6m: createBaseSumPattern(this, 'utxos_over_6m_old_realized_loss_neg'), + _9m: createBaseSumPattern(this, 'utxos_over_9m_old_realized_loss_neg'), + _1y: createBaseSumPattern(this, 'utxos_over_1y_old_realized_loss_neg'), + _18m: createBaseSumPattern(this, 'utxos_over_18m_old_realized_loss_neg'), + _2y: createBaseSumPattern(this, 'utxos_over_2y_old_realized_loss_neg'), + _3y: createBaseSumPattern(this, 'utxos_over_3y_old_realized_loss_neg'), + _4y: createBaseSumPattern(this, 'utxos_over_4y_old_realized_loss_neg'), + _5y: createBaseSumPattern(this, 'utxos_over_5y_old_realized_loss_neg'), + _6y: createBaseSumPattern(this, 'utxos_over_6y_old_realized_loss_neg'), + _7y: createBaseSumPattern(this, 'utxos_over_7y_old_realized_loss_neg'), + _8y: createBaseSumPattern(this, 'utxos_over_8y_old_realized_loss_neg'), + _10y: createBaseSumPattern(this, 'utxos_over_10y_old_realized_loss_neg'), + _12y: createBaseSumPattern(this, 'utxos_over_12y_old_realized_loss_neg'), + }, + }, + epoch: { + _0: createBaseSumPattern(this, 'epoch_0_realized_loss_neg'), + _1: createBaseSumPattern(this, 'epoch_1_realized_loss_neg'), + _2: createBaseSumPattern(this, 'epoch_2_realized_loss_neg'), + _3: createBaseSumPattern(this, 'epoch_3_realized_loss_neg'), + _4: createBaseSumPattern(this, 'epoch_4_realized_loss_neg'), + }, + class: { + _2009: createBaseSumPattern(this, 'class_2009_realized_loss_neg'), + _2010: createBaseSumPattern(this, 'class_2010_realized_loss_neg'), + _2011: createBaseSumPattern(this, 'class_2011_realized_loss_neg'), + _2012: createBaseSumPattern(this, 'class_2012_realized_loss_neg'), + _2013: createBaseSumPattern(this, 'class_2013_realized_loss_neg'), + _2014: createBaseSumPattern(this, 'class_2014_realized_loss_neg'), + _2015: createBaseSumPattern(this, 'class_2015_realized_loss_neg'), + _2016: createBaseSumPattern(this, 'class_2016_realized_loss_neg'), + _2017: createBaseSumPattern(this, 'class_2017_realized_loss_neg'), + _2018: createBaseSumPattern(this, 'class_2018_realized_loss_neg'), + _2019: createBaseSumPattern(this, 'class_2019_realized_loss_neg'), + _2020: createBaseSumPattern(this, 'class_2020_realized_loss_neg'), + _2021: createBaseSumPattern(this, 'class_2021_realized_loss_neg'), + _2022: createBaseSumPattern(this, 'class_2022_realized_loss_neg'), + _2023: createBaseSumPattern(this, 'class_2023_realized_loss_neg'), + _2024: createBaseSumPattern(this, 'class_2024_realized_loss_neg'), + _2025: createBaseSumPattern(this, 'class_2025_realized_loss_neg'), + _2026: createBaseSumPattern(this, 'class_2026_realized_loss_neg'), + }, + entry: { + discount: createBaseSumPattern(this, 'veteran_realized_loss_neg'), + premium: createBaseSumPattern(this, 'rookie_realized_loss_neg'), + }, + term: { + short: createBaseSumPattern(this, 'sth_realized_loss_neg'), + long: createBaseSumPattern(this, 'lth_realized_loss_neg'), + }, + }, + }, + netPnl: { + all: createBlockCumulativeDeltaSumPattern(this, 'net_realized_pnl'), + age: { + range: { + under1h: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_1h_old_net_realized_pnl'), + _1hTo1d: createBlockCumulativeDeltaSumPattern(this, 'utxos_1h_to_1d_old_net_realized_pnl'), + _1dTo1w: createBlockCumulativeDeltaSumPattern(this, 'utxos_1d_to_1w_old_net_realized_pnl'), + _1wTo1m: createBlockCumulativeDeltaSumPattern(this, 'utxos_1w_to_1m_old_net_realized_pnl'), + _1mTo2m: createBlockCumulativeDeltaSumPattern(this, 'utxos_1m_to_2m_old_net_realized_pnl'), + _2mTo3m: createBlockCumulativeDeltaSumPattern(this, 'utxos_2m_to_3m_old_net_realized_pnl'), + _3mTo4m: createBlockCumulativeDeltaSumPattern(this, 'utxos_3m_to_4m_old_net_realized_pnl'), + _4mTo5m: createBlockCumulativeDeltaSumPattern(this, 'utxos_4m_to_5m_old_net_realized_pnl'), + _5mTo6m: createBlockCumulativeDeltaSumPattern(this, 'utxos_5m_to_6m_old_net_realized_pnl'), + _6mTo9m: createBlockCumulativeDeltaSumPattern(this, 'utxos_6m_to_9m_old_net_realized_pnl'), + _9mTo1y: createBlockCumulativeDeltaSumPattern(this, 'utxos_9m_to_1y_old_net_realized_pnl'), + _1yTo18m: createBlockCumulativeDeltaSumPattern(this, 'utxos_1y_to_18m_old_net_realized_pnl'), + _18mTo2y: createBlockCumulativeDeltaSumPattern(this, 'utxos_18m_to_2y_old_net_realized_pnl'), + _2yTo3y: createBlockCumulativeDeltaSumPattern(this, 'utxos_2y_to_3y_old_net_realized_pnl'), + _3yTo4y: createBlockCumulativeDeltaSumPattern(this, 'utxos_3y_to_4y_old_net_realized_pnl'), + _4yTo5y: createBlockCumulativeDeltaSumPattern(this, 'utxos_4y_to_5y_old_net_realized_pnl'), + _5yTo6y: createBlockCumulativeDeltaSumPattern(this, 'utxos_5y_to_6y_old_net_realized_pnl'), + _6yTo7y: createBlockCumulativeDeltaSumPattern(this, 'utxos_6y_to_7y_old_net_realized_pnl'), + _7yTo8y: createBlockCumulativeDeltaSumPattern(this, 'utxos_7y_to_8y_old_net_realized_pnl'), + _8yTo10y: createBlockCumulativeDeltaSumPattern(this, 'utxos_8y_to_10y_old_net_realized_pnl'), + _10yTo12y: createBlockCumulativeDeltaSumPattern(this, 'utxos_10y_to_12y_old_net_realized_pnl'), + _12yTo15y: createBlockCumulativeDeltaSumPattern(this, 'utxos_12y_to_15y_old_net_realized_pnl'), + over15y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_15y_old_net_realized_pnl'), + }, + under: { + _1w: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_1w_old_net_realized_pnl'), + _1m: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_1m_old_net_realized_pnl'), + _2m: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_2m_old_net_realized_pnl'), + _3m: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_3m_old_net_realized_pnl'), + _4m: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_4m_old_net_realized_pnl'), + _5m: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_5m_old_net_realized_pnl'), + _6m: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_6m_old_net_realized_pnl'), + _9m: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_9m_old_net_realized_pnl'), + _1y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_1y_old_net_realized_pnl'), + _18m: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_18m_old_net_realized_pnl'), + _2y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_2y_old_net_realized_pnl'), + _3y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_3y_old_net_realized_pnl'), + _4y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_4y_old_net_realized_pnl'), + _5y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_5y_old_net_realized_pnl'), + _6y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_6y_old_net_realized_pnl'), + _7y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_7y_old_net_realized_pnl'), + _8y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_8y_old_net_realized_pnl'), + _10y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_10y_old_net_realized_pnl'), + _12y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_12y_old_net_realized_pnl'), + _15y: createBlockCumulativeDeltaSumPattern(this, 'utxos_under_15y_old_net_realized_pnl'), + }, + over: { + _1d: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_1d_old_net_realized_pnl'), + _1w: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_1w_old_net_realized_pnl'), + _1m: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_1m_old_net_realized_pnl'), + _2m: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_2m_old_net_realized_pnl'), + _3m: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_3m_old_net_realized_pnl'), + _4m: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_4m_old_net_realized_pnl'), + _5m: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_5m_old_net_realized_pnl'), + _6m: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_6m_old_net_realized_pnl'), + _9m: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_9m_old_net_realized_pnl'), + _1y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_1y_old_net_realized_pnl'), + _18m: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_18m_old_net_realized_pnl'), + _2y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_2y_old_net_realized_pnl'), + _3y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_3y_old_net_realized_pnl'), + _4y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_4y_old_net_realized_pnl'), + _5y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_5y_old_net_realized_pnl'), + _6y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_6y_old_net_realized_pnl'), + _7y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_7y_old_net_realized_pnl'), + _8y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_8y_old_net_realized_pnl'), + _10y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_10y_old_net_realized_pnl'), + _12y: createBlockCumulativeDeltaSumPattern(this, 'utxos_over_12y_old_net_realized_pnl'), + }, + }, + epoch: { + _0: createBlockCumulativeDeltaSumPattern(this, 'epoch_0_net_realized_pnl'), + _1: createBlockCumulativeDeltaSumPattern(this, 'epoch_1_net_realized_pnl'), + _2: createBlockCumulativeDeltaSumPattern(this, 'epoch_2_net_realized_pnl'), + _3: createBlockCumulativeDeltaSumPattern(this, 'epoch_3_net_realized_pnl'), + _4: createBlockCumulativeDeltaSumPattern(this, 'epoch_4_net_realized_pnl'), + }, + class: { + _2009: createBlockCumulativeDeltaSumPattern(this, 'class_2009_net_realized_pnl'), + _2010: createBlockCumulativeDeltaSumPattern(this, 'class_2010_net_realized_pnl'), + _2011: createBlockCumulativeDeltaSumPattern(this, 'class_2011_net_realized_pnl'), + _2012: createBlockCumulativeDeltaSumPattern(this, 'class_2012_net_realized_pnl'), + _2013: createBlockCumulativeDeltaSumPattern(this, 'class_2013_net_realized_pnl'), + _2014: createBlockCumulativeDeltaSumPattern(this, 'class_2014_net_realized_pnl'), + _2015: createBlockCumulativeDeltaSumPattern(this, 'class_2015_net_realized_pnl'), + _2016: createBlockCumulativeDeltaSumPattern(this, 'class_2016_net_realized_pnl'), + _2017: createBlockCumulativeDeltaSumPattern(this, 'class_2017_net_realized_pnl'), + _2018: createBlockCumulativeDeltaSumPattern(this, 'class_2018_net_realized_pnl'), + _2019: createBlockCumulativeDeltaSumPattern(this, 'class_2019_net_realized_pnl'), + _2020: createBlockCumulativeDeltaSumPattern(this, 'class_2020_net_realized_pnl'), + _2021: createBlockCumulativeDeltaSumPattern(this, 'class_2021_net_realized_pnl'), + _2022: createBlockCumulativeDeltaSumPattern(this, 'class_2022_net_realized_pnl'), + _2023: createBlockCumulativeDeltaSumPattern(this, 'class_2023_net_realized_pnl'), + _2024: createBlockCumulativeDeltaSumPattern(this, 'class_2024_net_realized_pnl'), + _2025: createBlockCumulativeDeltaSumPattern(this, 'class_2025_net_realized_pnl'), + _2026: createBlockCumulativeDeltaSumPattern(this, 'class_2026_net_realized_pnl'), + }, + entry: { + discount: createBlockCumulativeDeltaSumPattern(this, 'veteran_net_realized_pnl'), + premium: createBlockCumulativeDeltaSumPattern(this, 'rookie_net_realized_pnl'), + }, + term: { + short: createBlockCumulativeDeltaSumPattern(this, 'sth_net_realized_pnl'), + long: createBlockCumulativeDeltaSumPattern(this, 'lth_net_realized_pnl'), + }, + ageRangeMatrix: createSeriesPattern18(this, 'utxos_net_realized_pnl_cumulative_cents_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'net_realized_pnl_cumulative_cents_by_epoch'), + classMatrix: createSeriesPattern18(this, 'net_realized_pnl_cumulative_cents_by_class'), + entryMatrix: createSeriesPattern18(this, 'net_realized_pnl_cumulative_cents_by_entry'), + change1m: { + toMcap: { + all: createPercentPpmRatioPattern(this, 'all_net_pnl_change_1m_to_mcap'), + sth: createPercentPpmRatioPattern(this, 'sth_net_pnl_change_1m_to_mcap'), + lth: createPercentPpmRatioPattern(this, 'lth_net_pnl_change_1m_to_mcap'), + }, + }, + }, + sopr: { + valueDestroyed: { + all: createBlockCumulativeSumPattern(this, 'value_destroyed'), + age: { + range: { + under1h: createBlockCumulativeSumPattern(this, 'utxos_under_1h_old_value_destroyed'), + _1hTo1d: createBlockCumulativeSumPattern(this, 'utxos_1h_to_1d_old_value_destroyed'), + _1dTo1w: createBlockCumulativeSumPattern(this, 'utxos_1d_to_1w_old_value_destroyed'), + _1wTo1m: createBlockCumulativeSumPattern(this, 'utxos_1w_to_1m_old_value_destroyed'), + _1mTo2m: createBlockCumulativeSumPattern(this, 'utxos_1m_to_2m_old_value_destroyed'), + _2mTo3m: createBlockCumulativeSumPattern(this, 'utxos_2m_to_3m_old_value_destroyed'), + _3mTo4m: createBlockCumulativeSumPattern(this, 'utxos_3m_to_4m_old_value_destroyed'), + _4mTo5m: createBlockCumulativeSumPattern(this, 'utxos_4m_to_5m_old_value_destroyed'), + _5mTo6m: createBlockCumulativeSumPattern(this, 'utxos_5m_to_6m_old_value_destroyed'), + _6mTo9m: createBlockCumulativeSumPattern(this, 'utxos_6m_to_9m_old_value_destroyed'), + _9mTo1y: createBlockCumulativeSumPattern(this, 'utxos_9m_to_1y_old_value_destroyed'), + _1yTo18m: createBlockCumulativeSumPattern(this, 'utxos_1y_to_18m_old_value_destroyed'), + _18mTo2y: createBlockCumulativeSumPattern(this, 'utxos_18m_to_2y_old_value_destroyed'), + _2yTo3y: createBlockCumulativeSumPattern(this, 'utxos_2y_to_3y_old_value_destroyed'), + _3yTo4y: createBlockCumulativeSumPattern(this, 'utxos_3y_to_4y_old_value_destroyed'), + _4yTo5y: createBlockCumulativeSumPattern(this, 'utxos_4y_to_5y_old_value_destroyed'), + _5yTo6y: createBlockCumulativeSumPattern(this, 'utxos_5y_to_6y_old_value_destroyed'), + _6yTo7y: createBlockCumulativeSumPattern(this, 'utxos_6y_to_7y_old_value_destroyed'), + _7yTo8y: createBlockCumulativeSumPattern(this, 'utxos_7y_to_8y_old_value_destroyed'), + _8yTo10y: createBlockCumulativeSumPattern(this, 'utxos_8y_to_10y_old_value_destroyed'), + _10yTo12y: createBlockCumulativeSumPattern(this, 'utxos_10y_to_12y_old_value_destroyed'), + _12yTo15y: createBlockCumulativeSumPattern(this, 'utxos_12y_to_15y_old_value_destroyed'), + over15y: createBlockCumulativeSumPattern(this, 'utxos_over_15y_old_value_destroyed'), + }, + under: { + _1w: createBlockCumulativeSumPattern(this, 'utxos_under_1w_old_value_destroyed'), + _1m: createBlockCumulativeSumPattern(this, 'utxos_under_1m_old_value_destroyed'), + _2m: createBlockCumulativeSumPattern(this, 'utxos_under_2m_old_value_destroyed'), + _3m: createBlockCumulativeSumPattern(this, 'utxos_under_3m_old_value_destroyed'), + _4m: createBlockCumulativeSumPattern(this, 'utxos_under_4m_old_value_destroyed'), + _5m: createBlockCumulativeSumPattern(this, 'utxos_under_5m_old_value_destroyed'), + _6m: createBlockCumulativeSumPattern(this, 'utxos_under_6m_old_value_destroyed'), + _9m: createBlockCumulativeSumPattern(this, 'utxos_under_9m_old_value_destroyed'), + _1y: createBlockCumulativeSumPattern(this, 'utxos_under_1y_old_value_destroyed'), + _18m: createBlockCumulativeSumPattern(this, 'utxos_under_18m_old_value_destroyed'), + _2y: createBlockCumulativeSumPattern(this, 'utxos_under_2y_old_value_destroyed'), + _3y: createBlockCumulativeSumPattern(this, 'utxos_under_3y_old_value_destroyed'), + _4y: createBlockCumulativeSumPattern(this, 'utxos_under_4y_old_value_destroyed'), + _5y: createBlockCumulativeSumPattern(this, 'utxos_under_5y_old_value_destroyed'), + _6y: createBlockCumulativeSumPattern(this, 'utxos_under_6y_old_value_destroyed'), + _7y: createBlockCumulativeSumPattern(this, 'utxos_under_7y_old_value_destroyed'), + _8y: createBlockCumulativeSumPattern(this, 'utxos_under_8y_old_value_destroyed'), + _10y: createBlockCumulativeSumPattern(this, 'utxos_under_10y_old_value_destroyed'), + _12y: createBlockCumulativeSumPattern(this, 'utxos_under_12y_old_value_destroyed'), + _15y: createBlockCumulativeSumPattern(this, 'utxos_under_15y_old_value_destroyed'), + }, + over: { + _1d: createBlockCumulativeSumPattern(this, 'utxos_over_1d_old_value_destroyed'), + _1w: createBlockCumulativeSumPattern(this, 'utxos_over_1w_old_value_destroyed'), + _1m: createBlockCumulativeSumPattern(this, 'utxos_over_1m_old_value_destroyed'), + _2m: createBlockCumulativeSumPattern(this, 'utxos_over_2m_old_value_destroyed'), + _3m: createBlockCumulativeSumPattern(this, 'utxos_over_3m_old_value_destroyed'), + _4m: createBlockCumulativeSumPattern(this, 'utxos_over_4m_old_value_destroyed'), + _5m: createBlockCumulativeSumPattern(this, 'utxos_over_5m_old_value_destroyed'), + _6m: createBlockCumulativeSumPattern(this, 'utxos_over_6m_old_value_destroyed'), + _9m: createBlockCumulativeSumPattern(this, 'utxos_over_9m_old_value_destroyed'), + _1y: createBlockCumulativeSumPattern(this, 'utxos_over_1y_old_value_destroyed'), + _18m: createBlockCumulativeSumPattern(this, 'utxos_over_18m_old_value_destroyed'), + _2y: createBlockCumulativeSumPattern(this, 'utxos_over_2y_old_value_destroyed'), + _3y: createBlockCumulativeSumPattern(this, 'utxos_over_3y_old_value_destroyed'), + _4y: createBlockCumulativeSumPattern(this, 'utxos_over_4y_old_value_destroyed'), + _5y: createBlockCumulativeSumPattern(this, 'utxos_over_5y_old_value_destroyed'), + _6y: createBlockCumulativeSumPattern(this, 'utxos_over_6y_old_value_destroyed'), + _7y: createBlockCumulativeSumPattern(this, 'utxos_over_7y_old_value_destroyed'), + _8y: createBlockCumulativeSumPattern(this, 'utxos_over_8y_old_value_destroyed'), + _10y: createBlockCumulativeSumPattern(this, 'utxos_over_10y_old_value_destroyed'), + _12y: createBlockCumulativeSumPattern(this, 'utxos_over_12y_old_value_destroyed'), + }, + }, + epoch: { + _0: createBlockCumulativeSumPattern(this, 'epoch_0_value_destroyed'), + _1: createBlockCumulativeSumPattern(this, 'epoch_1_value_destroyed'), + _2: createBlockCumulativeSumPattern(this, 'epoch_2_value_destroyed'), + _3: createBlockCumulativeSumPattern(this, 'epoch_3_value_destroyed'), + _4: createBlockCumulativeSumPattern(this, 'epoch_4_value_destroyed'), + }, + class: { + _2009: createBlockCumulativeSumPattern(this, 'class_2009_value_destroyed'), + _2010: createBlockCumulativeSumPattern(this, 'class_2010_value_destroyed'), + _2011: createBlockCumulativeSumPattern(this, 'class_2011_value_destroyed'), + _2012: createBlockCumulativeSumPattern(this, 'class_2012_value_destroyed'), + _2013: createBlockCumulativeSumPattern(this, 'class_2013_value_destroyed'), + _2014: createBlockCumulativeSumPattern(this, 'class_2014_value_destroyed'), + _2015: createBlockCumulativeSumPattern(this, 'class_2015_value_destroyed'), + _2016: createBlockCumulativeSumPattern(this, 'class_2016_value_destroyed'), + _2017: createBlockCumulativeSumPattern(this, 'class_2017_value_destroyed'), + _2018: createBlockCumulativeSumPattern(this, 'class_2018_value_destroyed'), + _2019: createBlockCumulativeSumPattern(this, 'class_2019_value_destroyed'), + _2020: createBlockCumulativeSumPattern(this, 'class_2020_value_destroyed'), + _2021: createBlockCumulativeSumPattern(this, 'class_2021_value_destroyed'), + _2022: createBlockCumulativeSumPattern(this, 'class_2022_value_destroyed'), + _2023: createBlockCumulativeSumPattern(this, 'class_2023_value_destroyed'), + _2024: createBlockCumulativeSumPattern(this, 'class_2024_value_destroyed'), + _2025: createBlockCumulativeSumPattern(this, 'class_2025_value_destroyed'), + _2026: createBlockCumulativeSumPattern(this, 'class_2026_value_destroyed'), + }, + entry: createDiscountPremiumPattern5(this, 'value_destroyed'), + term: createLongShortPattern6(this, 'value_destroyed'), + ageRangeMatrix: createSeriesPattern18(this, 'utxos_value_destroyed_cumulative_cents_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'value_destroyed_cumulative_cents_by_epoch'), + classMatrix: createSeriesPattern18(this, 'value_destroyed_cumulative_cents_by_class'), + entryMatrix: createSeriesPattern18(this, 'value_destroyed_cumulative_cents_by_entry'), + }, + all: createSeriesPattern1(this, 'sopr_24h'), + age: { + range: { + under1h: createSeriesPattern1(this, 'utxos_under_1h_old_sopr_24h'), + _1hTo1d: createSeriesPattern1(this, 'utxos_1h_to_1d_old_sopr_24h'), + _1dTo1w: createSeriesPattern1(this, 'utxos_1d_to_1w_old_sopr_24h'), + _1wTo1m: createSeriesPattern1(this, 'utxos_1w_to_1m_old_sopr_24h'), + _1mTo2m: createSeriesPattern1(this, 'utxos_1m_to_2m_old_sopr_24h'), + _2mTo3m: createSeriesPattern1(this, 'utxos_2m_to_3m_old_sopr_24h'), + _3mTo4m: createSeriesPattern1(this, 'utxos_3m_to_4m_old_sopr_24h'), + _4mTo5m: createSeriesPattern1(this, 'utxos_4m_to_5m_old_sopr_24h'), + _5mTo6m: createSeriesPattern1(this, 'utxos_5m_to_6m_old_sopr_24h'), + _6mTo9m: createSeriesPattern1(this, 'utxos_6m_to_9m_old_sopr_24h'), + _9mTo1y: createSeriesPattern1(this, 'utxos_9m_to_1y_old_sopr_24h'), + _1yTo18m: createSeriesPattern1(this, 'utxos_1y_to_18m_old_sopr_24h'), + _18mTo2y: createSeriesPattern1(this, 'utxos_18m_to_2y_old_sopr_24h'), + _2yTo3y: createSeriesPattern1(this, 'utxos_2y_to_3y_old_sopr_24h'), + _3yTo4y: createSeriesPattern1(this, 'utxos_3y_to_4y_old_sopr_24h'), + _4yTo5y: createSeriesPattern1(this, 'utxos_4y_to_5y_old_sopr_24h'), + _5yTo6y: createSeriesPattern1(this, 'utxos_5y_to_6y_old_sopr_24h'), + _6yTo7y: createSeriesPattern1(this, 'utxos_6y_to_7y_old_sopr_24h'), + _7yTo8y: createSeriesPattern1(this, 'utxos_7y_to_8y_old_sopr_24h'), + _8yTo10y: createSeriesPattern1(this, 'utxos_8y_to_10y_old_sopr_24h'), + _10yTo12y: createSeriesPattern1(this, 'utxos_10y_to_12y_old_sopr_24h'), + _12yTo15y: createSeriesPattern1(this, 'utxos_12y_to_15y_old_sopr_24h'), + over15y: createSeriesPattern1(this, 'utxos_over_15y_old_sopr_24h'), + }, + under: { + _1w: createSeriesPattern1(this, 'utxos_under_1w_old_sopr_24h'), + _1m: createSeriesPattern1(this, 'utxos_under_1m_old_sopr_24h'), + _2m: createSeriesPattern1(this, 'utxos_under_2m_old_sopr_24h'), + _3m: createSeriesPattern1(this, 'utxos_under_3m_old_sopr_24h'), + _4m: createSeriesPattern1(this, 'utxos_under_4m_old_sopr_24h'), + _5m: createSeriesPattern1(this, 'utxos_under_5m_old_sopr_24h'), + _6m: createSeriesPattern1(this, 'utxos_under_6m_old_sopr_24h'), + _9m: createSeriesPattern1(this, 'utxos_under_9m_old_sopr_24h'), + _1y: createSeriesPattern1(this, 'utxos_under_1y_old_sopr_24h'), + _18m: createSeriesPattern1(this, 'utxos_under_18m_old_sopr_24h'), + _2y: createSeriesPattern1(this, 'utxos_under_2y_old_sopr_24h'), + _3y: createSeriesPattern1(this, 'utxos_under_3y_old_sopr_24h'), + _4y: createSeriesPattern1(this, 'utxos_under_4y_old_sopr_24h'), + _5y: createSeriesPattern1(this, 'utxos_under_5y_old_sopr_24h'), + _6y: createSeriesPattern1(this, 'utxos_under_6y_old_sopr_24h'), + _7y: createSeriesPattern1(this, 'utxos_under_7y_old_sopr_24h'), + _8y: createSeriesPattern1(this, 'utxos_under_8y_old_sopr_24h'), + _10y: createSeriesPattern1(this, 'utxos_under_10y_old_sopr_24h'), + _12y: createSeriesPattern1(this, 'utxos_under_12y_old_sopr_24h'), + _15y: createSeriesPattern1(this, 'utxos_under_15y_old_sopr_24h'), + }, + over: { + _1d: createSeriesPattern1(this, 'utxos_over_1d_old_sopr_24h'), + _1w: createSeriesPattern1(this, 'utxos_over_1w_old_sopr_24h'), + _1m: createSeriesPattern1(this, 'utxos_over_1m_old_sopr_24h'), + _2m: createSeriesPattern1(this, 'utxos_over_2m_old_sopr_24h'), + _3m: createSeriesPattern1(this, 'utxos_over_3m_old_sopr_24h'), + _4m: createSeriesPattern1(this, 'utxos_over_4m_old_sopr_24h'), + _5m: createSeriesPattern1(this, 'utxos_over_5m_old_sopr_24h'), + _6m: createSeriesPattern1(this, 'utxos_over_6m_old_sopr_24h'), + _9m: createSeriesPattern1(this, 'utxos_over_9m_old_sopr_24h'), + _1y: createSeriesPattern1(this, 'utxos_over_1y_old_sopr_24h'), + _18m: createSeriesPattern1(this, 'utxos_over_18m_old_sopr_24h'), + _2y: createSeriesPattern1(this, 'utxos_over_2y_old_sopr_24h'), + _3y: createSeriesPattern1(this, 'utxos_over_3y_old_sopr_24h'), + _4y: createSeriesPattern1(this, 'utxos_over_4y_old_sopr_24h'), + _5y: createSeriesPattern1(this, 'utxos_over_5y_old_sopr_24h'), + _6y: createSeriesPattern1(this, 'utxos_over_6y_old_sopr_24h'), + _7y: createSeriesPattern1(this, 'utxos_over_7y_old_sopr_24h'), + _8y: createSeriesPattern1(this, 'utxos_over_8y_old_sopr_24h'), + _10y: createSeriesPattern1(this, 'utxos_over_10y_old_sopr_24h'), + _12y: createSeriesPattern1(this, 'utxos_over_12y_old_sopr_24h'), + }, + }, + epoch: { + _0: createSeriesPattern1(this, 'epoch_0_sopr_24h'), + _1: createSeriesPattern1(this, 'epoch_1_sopr_24h'), + _2: createSeriesPattern1(this, 'epoch_2_sopr_24h'), + _3: createSeriesPattern1(this, 'epoch_3_sopr_24h'), + _4: createSeriesPattern1(this, 'epoch_4_sopr_24h'), + }, + class: { + _2009: createSeriesPattern1(this, 'class_2009_sopr_24h'), + _2010: createSeriesPattern1(this, 'class_2010_sopr_24h'), + _2011: createSeriesPattern1(this, 'class_2011_sopr_24h'), + _2012: createSeriesPattern1(this, 'class_2012_sopr_24h'), + _2013: createSeriesPattern1(this, 'class_2013_sopr_24h'), + _2014: createSeriesPattern1(this, 'class_2014_sopr_24h'), + _2015: createSeriesPattern1(this, 'class_2015_sopr_24h'), + _2016: createSeriesPattern1(this, 'class_2016_sopr_24h'), + _2017: createSeriesPattern1(this, 'class_2017_sopr_24h'), + _2018: createSeriesPattern1(this, 'class_2018_sopr_24h'), + _2019: createSeriesPattern1(this, 'class_2019_sopr_24h'), + _2020: createSeriesPattern1(this, 'class_2020_sopr_24h'), + _2021: createSeriesPattern1(this, 'class_2021_sopr_24h'), + _2022: createSeriesPattern1(this, 'class_2022_sopr_24h'), + _2023: createSeriesPattern1(this, 'class_2023_sopr_24h'), + _2024: createSeriesPattern1(this, 'class_2024_sopr_24h'), + _2025: createSeriesPattern1(this, 'class_2025_sopr_24h'), + _2026: createSeriesPattern1(this, 'class_2026_sopr_24h'), + }, + entry: createDiscountPremiumPattern7(this, 'sopr_24h'), + term: createLongShortPattern7(this, 'sopr_24h'), + aggregateMatrix: { + all: createSeriesPattern1(this, 'sopr_24h_by_aggregate_column_0'), + sth: createSeriesPattern1(this, 'sopr_24h_by_aggregate_column_1'), + lth: createSeriesPattern1(this, 'sopr_24h_by_aggregate_column_2'), + height: createSeriesPattern18(this, 'sopr_24h_by_aggregate'), + }, + ageRangeMatrix: { + under1h: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_0'), + _1hTo1d: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_1'), + _1dTo1w: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_2'), + _1wTo1m: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_3'), + _1mTo2m: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_4'), + _2mTo3m: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_5'), + _3mTo4m: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_6'), + _4mTo5m: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_7'), + _5mTo6m: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_8'), + _6mTo9m: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_9'), + _9mTo1y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_10'), + _1yTo18m: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_11'), + _18mTo2y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_12'), + _2yTo3y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_13'), + _3yTo4y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_14'), + _4yTo5y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_15'), + _5yTo6y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_16'), + _6yTo7y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_17'), + _7yTo8y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_18'), + _8yTo10y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_19'), + _10yTo12y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_20'), + _12yTo15y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_21'), + over15y: createSeriesPattern1(this, 'utxos_sopr_24h_by_age_range_column_22'), + height: createSeriesPattern18(this, 'utxos_sopr_24h_by_age_range'), + }, + underAgeMatrix: { + _1w: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_0'), + _1m: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_1'), + _2m: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_2'), + _3m: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_3'), + _4m: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_4'), + _5m: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_5'), + _6m: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_6'), + _9m: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_7'), + _1y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_8'), + _18m: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_9'), + _2y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_10'), + _3y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_11'), + _4y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_12'), + _5y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_13'), + _6y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_14'), + _7y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_15'), + _8y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_16'), + _10y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_17'), + _12y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_18'), + _15y: createSeriesPattern1(this, 'utxos_sopr_24h_by_under_age_column_19'), + height: createSeriesPattern18(this, 'utxos_sopr_24h_by_under_age'), + }, + overAgeMatrix: { + _1d: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_0'), + _1w: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_1'), + _1m: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_2'), + _2m: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_3'), + _3m: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_4'), + _4m: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_5'), + _5m: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_6'), + _6m: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_7'), + _9m: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_8'), + _1y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_9'), + _18m: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_10'), + _2y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_11'), + _3y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_12'), + _4y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_13'), + _5y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_14'), + _6y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_15'), + _7y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_16'), + _8y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_17'), + _10y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_18'), + _12y: createSeriesPattern1(this, 'utxos_sopr_24h_by_over_age_column_19'), + height: createSeriesPattern18(this, 'utxos_sopr_24h_by_over_age'), + }, + epochMatrix: { + _0: createSeriesPattern1(this, 'sopr_24h_by_epoch_column_0'), + _1: createSeriesPattern1(this, 'sopr_24h_by_epoch_column_1'), + _2: createSeriesPattern1(this, 'sopr_24h_by_epoch_column_2'), + _3: createSeriesPattern1(this, 'sopr_24h_by_epoch_column_3'), + _4: createSeriesPattern1(this, 'sopr_24h_by_epoch_column_4'), + height: createSeriesPattern18(this, 'sopr_24h_by_epoch'), + }, + classMatrix: { + _2009: createSeriesPattern1(this, 'sopr_24h_by_class_column_0'), + _2010: createSeriesPattern1(this, 'sopr_24h_by_class_column_1'), + _2011: createSeriesPattern1(this, 'sopr_24h_by_class_column_2'), + _2012: createSeriesPattern1(this, 'sopr_24h_by_class_column_3'), + _2013: createSeriesPattern1(this, 'sopr_24h_by_class_column_4'), + _2014: createSeriesPattern1(this, 'sopr_24h_by_class_column_5'), + _2015: createSeriesPattern1(this, 'sopr_24h_by_class_column_6'), + _2016: createSeriesPattern1(this, 'sopr_24h_by_class_column_7'), + _2017: createSeriesPattern1(this, 'sopr_24h_by_class_column_8'), + _2018: createSeriesPattern1(this, 'sopr_24h_by_class_column_9'), + _2019: createSeriesPattern1(this, 'sopr_24h_by_class_column_10'), + _2020: createSeriesPattern1(this, 'sopr_24h_by_class_column_11'), + _2021: createSeriesPattern1(this, 'sopr_24h_by_class_column_12'), + _2022: createSeriesPattern1(this, 'sopr_24h_by_class_column_13'), + _2023: createSeriesPattern1(this, 'sopr_24h_by_class_column_14'), + _2024: createSeriesPattern1(this, 'sopr_24h_by_class_column_15'), + _2025: createSeriesPattern1(this, 'sopr_24h_by_class_column_16'), + _2026: createSeriesPattern1(this, 'sopr_24h_by_class_column_17'), + height: createSeriesPattern18(this, 'sopr_24h_by_class'), + }, + entryMatrix: { + discount: createSeriesPattern1(this, 'sopr_24h_by_entry_column_0'), + premium: createSeriesPattern1(this, 'sopr_24h_by_entry_column_1'), + height: createSeriesPattern18(this, 'sopr_24h_by_entry'), + }, + }, + adjustedSopr: { + ratio: { + all: create_1m1w1y24hHeightPattern2(this, 'asopr'), + sth: create_1m1w1y24hHeightPattern2(this, 'sth_asopr'), + }, + transferVolume: { + all: createAverageBlockCumulativeSumPattern(this, 'adj_value_created'), + sth: createAverageBlockCumulativeSumPattern(this, 'sth_adj_value_created'), + cumulative: createSeriesPattern18(this, 'adjusted_sopr_transfer_volume_cumulative_by_cohort'), + }, + valueDestroyed: { + all: createAverageBlockCumulativeSumPattern(this, 'adj_value_destroyed'), + sth: createAverageBlockCumulativeSumPattern(this, 'sth_adj_value_destroyed'), + cumulative: createSeriesPattern18(this, 'adjusted_sopr_value_destroyed_cumulative_by_cohort'), + }, + }, + grossPnl: { + all: createBlockCumulativeSumPattern(this, 'all_realized_gross_pnl'), + sth: createBlockCumulativeSumPattern(this, 'sth_realized_gross_pnl'), + lth: createBlockCumulativeSumPattern(this, 'lth_realized_gross_pnl'), + cumulative: createSeriesPattern18(this, 'realized_gross_pnl_cumulative_cents_by_term'), + }, + capitalizedPrice: { + all: createCentsPpmRatioSatsUsdPattern(this, 'all_capitalized_price'), + sth: createCentsPpmRatioSatsUsdPattern(this, 'sth_capitalized_price'), + lth: createCentsPpmRatioSatsUsdPattern(this, 'lth_capitalized_price'), + height: createSeriesPattern18(this, 'capitalized_price_cents_by_aggregate'), + }, + capRaw: createMatrixPattern(this, 'cap_raw_by_term'), + capitalizedCapRaw: createMatrixPattern(this, 'capitalized_cap_raw_by_term'), + peakRegret: { + all: createBlockCumulativeSumPattern(this, 'all_realized_peak_regret'), + sth: createBlockCumulativeSumPattern(this, 'sth_realized_peak_regret'), + lth: createBlockCumulativeSumPattern(this, 'lth_realized_peak_regret'), + cumulative: createSeriesPattern18(this, 'realized_peak_regret_cumulative_cents_by_term'), + }, + netPnlChange1mToRcap: { + all: createPercentPpmRatioPattern(this, 'all_net_pnl_change_1m_to_rcap'), + sth: createPercentPpmRatioPattern(this, 'sth_net_pnl_change_1m_to_rcap'), + lth: createPercentPpmRatioPattern(this, 'lth_net_pnl_change_1m_to_rcap'), + height: createSeriesPattern18(this, 'net_pnl_change_1m_to_rcap_ppm_by_aggregate'), + }, + sellSideRiskRatio: { + all: create_1m1w1y24hHeightPattern3(this, 'all_sell_side_risk_ratio'), + sth: create_1m1w1y24hHeightPattern3(this, 'sth_sell_side_risk_ratio'), + lth: create_1m1w1y24hHeightPattern3(this, 'lth_sell_side_risk_ratio'), + }, + soprRatioExtended: { + all: create_1m1w1yHeightPattern(this, 'all_sopr'), + sth: create_1m1w1yHeightPattern(this, 'sth_sopr'), + lth: create_1m1w1yHeightPattern(this, 'lth_sopr'), + }, + profitToLossRatio: { + all: create_1m1w1y24hHeightPattern2(this, 'all_realized_profit_to_loss_ratio'), + sth: create_1m1w1y24hHeightPattern2(this, 'sth_realized_profit_to_loss_ratio'), + lth: create_1m1w1y24hHeightPattern2(this, 'lth_realized_profit_to_loss_ratio'), + }, + mvrv: { + all: createSeriesPattern1(this, 'mvrv'), + age: { + range: { + under1h: createSeriesPattern1(this, 'utxos_under_1h_old_mvrv'), + _1hTo1d: createSeriesPattern1(this, 'utxos_1h_to_1d_old_mvrv'), + _1dTo1w: createSeriesPattern1(this, 'utxos_1d_to_1w_old_mvrv'), + _1wTo1m: createSeriesPattern1(this, 'utxos_1w_to_1m_old_mvrv'), + _1mTo2m: createSeriesPattern1(this, 'utxos_1m_to_2m_old_mvrv'), + _2mTo3m: createSeriesPattern1(this, 'utxos_2m_to_3m_old_mvrv'), + _3mTo4m: createSeriesPattern1(this, 'utxos_3m_to_4m_old_mvrv'), + _4mTo5m: createSeriesPattern1(this, 'utxos_4m_to_5m_old_mvrv'), + _5mTo6m: createSeriesPattern1(this, 'utxos_5m_to_6m_old_mvrv'), + _6mTo9m: createSeriesPattern1(this, 'utxos_6m_to_9m_old_mvrv'), + _9mTo1y: createSeriesPattern1(this, 'utxos_9m_to_1y_old_mvrv'), + _1yTo18m: createSeriesPattern1(this, 'utxos_1y_to_18m_old_mvrv'), + _18mTo2y: createSeriesPattern1(this, 'utxos_18m_to_2y_old_mvrv'), + _2yTo3y: createSeriesPattern1(this, 'utxos_2y_to_3y_old_mvrv'), + _3yTo4y: createSeriesPattern1(this, 'utxos_3y_to_4y_old_mvrv'), + _4yTo5y: createSeriesPattern1(this, 'utxos_4y_to_5y_old_mvrv'), + _5yTo6y: createSeriesPattern1(this, 'utxos_5y_to_6y_old_mvrv'), + _6yTo7y: createSeriesPattern1(this, 'utxos_6y_to_7y_old_mvrv'), + _7yTo8y: createSeriesPattern1(this, 'utxos_7y_to_8y_old_mvrv'), + _8yTo10y: createSeriesPattern1(this, 'utxos_8y_to_10y_old_mvrv'), + _10yTo12y: createSeriesPattern1(this, 'utxos_10y_to_12y_old_mvrv'), + _12yTo15y: createSeriesPattern1(this, 'utxos_12y_to_15y_old_mvrv'), + over15y: createSeriesPattern1(this, 'utxos_over_15y_old_mvrv'), + }, + under: { + _1w: createSeriesPattern1(this, 'utxos_under_1w_old_mvrv'), + _1m: createSeriesPattern1(this, 'utxos_under_1m_old_mvrv'), + _2m: createSeriesPattern1(this, 'utxos_under_2m_old_mvrv'), + _3m: createSeriesPattern1(this, 'utxos_under_3m_old_mvrv'), + _4m: createSeriesPattern1(this, 'utxos_under_4m_old_mvrv'), + _5m: createSeriesPattern1(this, 'utxos_under_5m_old_mvrv'), + _6m: createSeriesPattern1(this, 'utxos_under_6m_old_mvrv'), + _9m: createSeriesPattern1(this, 'utxos_under_9m_old_mvrv'), + _1y: createSeriesPattern1(this, 'utxos_under_1y_old_mvrv'), + _18m: createSeriesPattern1(this, 'utxos_under_18m_old_mvrv'), + _2y: createSeriesPattern1(this, 'utxos_under_2y_old_mvrv'), + _3y: createSeriesPattern1(this, 'utxos_under_3y_old_mvrv'), + _4y: createSeriesPattern1(this, 'utxos_under_4y_old_mvrv'), + _5y: createSeriesPattern1(this, 'utxos_under_5y_old_mvrv'), + _6y: createSeriesPattern1(this, 'utxos_under_6y_old_mvrv'), + _7y: createSeriesPattern1(this, 'utxos_under_7y_old_mvrv'), + _8y: createSeriesPattern1(this, 'utxos_under_8y_old_mvrv'), + _10y: createSeriesPattern1(this, 'utxos_under_10y_old_mvrv'), + _12y: createSeriesPattern1(this, 'utxos_under_12y_old_mvrv'), + _15y: createSeriesPattern1(this, 'utxos_under_15y_old_mvrv'), + }, + over: { + _1d: createSeriesPattern1(this, 'utxos_over_1d_old_mvrv'), + _1w: createSeriesPattern1(this, 'utxos_over_1w_old_mvrv'), + _1m: createSeriesPattern1(this, 'utxos_over_1m_old_mvrv'), + _2m: createSeriesPattern1(this, 'utxos_over_2m_old_mvrv'), + _3m: createSeriesPattern1(this, 'utxos_over_3m_old_mvrv'), + _4m: createSeriesPattern1(this, 'utxos_over_4m_old_mvrv'), + _5m: createSeriesPattern1(this, 'utxos_over_5m_old_mvrv'), + _6m: createSeriesPattern1(this, 'utxos_over_6m_old_mvrv'), + _9m: createSeriesPattern1(this, 'utxos_over_9m_old_mvrv'), + _1y: createSeriesPattern1(this, 'utxos_over_1y_old_mvrv'), + _18m: createSeriesPattern1(this, 'utxos_over_18m_old_mvrv'), + _2y: createSeriesPattern1(this, 'utxos_over_2y_old_mvrv'), + _3y: createSeriesPattern1(this, 'utxos_over_3y_old_mvrv'), + _4y: createSeriesPattern1(this, 'utxos_over_4y_old_mvrv'), + _5y: createSeriesPattern1(this, 'utxos_over_5y_old_mvrv'), + _6y: createSeriesPattern1(this, 'utxos_over_6y_old_mvrv'), + _7y: createSeriesPattern1(this, 'utxos_over_7y_old_mvrv'), + _8y: createSeriesPattern1(this, 'utxos_over_8y_old_mvrv'), + _10y: createSeriesPattern1(this, 'utxos_over_10y_old_mvrv'), + _12y: createSeriesPattern1(this, 'utxos_over_12y_old_mvrv'), + }, + }, + epoch: { + _0: createSeriesPattern1(this, 'epoch_0_mvrv'), + _1: createSeriesPattern1(this, 'epoch_1_mvrv'), + _2: createSeriesPattern1(this, 'epoch_2_mvrv'), + _3: createSeriesPattern1(this, 'epoch_3_mvrv'), + _4: createSeriesPattern1(this, 'epoch_4_mvrv'), + }, + class: { + _2009: createSeriesPattern1(this, 'class_2009_mvrv'), + _2010: createSeriesPattern1(this, 'class_2010_mvrv'), + _2011: createSeriesPattern1(this, 'class_2011_mvrv'), + _2012: createSeriesPattern1(this, 'class_2012_mvrv'), + _2013: createSeriesPattern1(this, 'class_2013_mvrv'), + _2014: createSeriesPattern1(this, 'class_2014_mvrv'), + _2015: createSeriesPattern1(this, 'class_2015_mvrv'), + _2016: createSeriesPattern1(this, 'class_2016_mvrv'), + _2017: createSeriesPattern1(this, 'class_2017_mvrv'), + _2018: createSeriesPattern1(this, 'class_2018_mvrv'), + _2019: createSeriesPattern1(this, 'class_2019_mvrv'), + _2020: createSeriesPattern1(this, 'class_2020_mvrv'), + _2021: createSeriesPattern1(this, 'class_2021_mvrv'), + _2022: createSeriesPattern1(this, 'class_2022_mvrv'), + _2023: createSeriesPattern1(this, 'class_2023_mvrv'), + _2024: createSeriesPattern1(this, 'class_2024_mvrv'), + _2025: createSeriesPattern1(this, 'class_2025_mvrv'), + _2026: createSeriesPattern1(this, 'class_2026_mvrv'), + }, + entry: createDiscountPremiumPattern7(this, 'mvrv'), + utxoAmount: { + range: { + _0sats: createSeriesPattern1(this, 'utxos_0sats_mvrv'), + _1satTo10sats: createSeriesPattern1(this, 'utxos_1sat_to_10sats_mvrv'), + _10satsTo100sats: createSeriesPattern1(this, 'utxos_10sats_to_100sats_mvrv'), + _100satsTo1kSats: createSeriesPattern1(this, 'utxos_100sats_to_1k_sats_mvrv'), + _1kSatsTo10kSats: createSeriesPattern1(this, 'utxos_1k_sats_to_10k_sats_mvrv'), + _10kSatsTo100kSats: createSeriesPattern1(this, 'utxos_10k_sats_to_100k_sats_mvrv'), + _100kSatsTo1mSats: createSeriesPattern1(this, 'utxos_100k_sats_to_1m_sats_mvrv'), + _1mSatsTo10mSats: createSeriesPattern1(this, 'utxos_1m_sats_to_10m_sats_mvrv'), + _10mSatsTo1btc: createSeriesPattern1(this, 'utxos_10m_sats_to_1btc_mvrv'), + _1btcTo10btc: createSeriesPattern1(this, 'utxos_1btc_to_10btc_mvrv'), + _10btcTo100btc: createSeriesPattern1(this, 'utxos_10btc_to_100btc_mvrv'), + _100btcTo1kBtc: createSeriesPattern1(this, 'utxos_100btc_to_1k_btc_mvrv'), + _1kBtcTo10kBtc: createSeriesPattern1(this, 'utxos_1k_btc_to_10k_btc_mvrv'), + _10kBtcTo100kBtc: createSeriesPattern1(this, 'utxos_10k_btc_to_100k_btc_mvrv'), + over100kBtc: createSeriesPattern1(this, 'utxos_over_100k_btc_mvrv'), + }, + under: { + _10sats: createSeriesPattern1(this, 'utxos_under_10sats_mvrv'), + _100sats: createSeriesPattern1(this, 'utxos_under_100sats_mvrv'), + _1kSats: createSeriesPattern1(this, 'utxos_under_1k_sats_mvrv'), + _10kSats: createSeriesPattern1(this, 'utxos_under_10k_sats_mvrv'), + _100kSats: createSeriesPattern1(this, 'utxos_under_100k_sats_mvrv'), + _1mSats: createSeriesPattern1(this, 'utxos_under_1m_sats_mvrv'), + _10mSats: createSeriesPattern1(this, 'utxos_under_10m_sats_mvrv'), + _1btc: createSeriesPattern1(this, 'utxos_under_1btc_mvrv'), + _10btc: createSeriesPattern1(this, 'utxos_under_10btc_mvrv'), + _100btc: createSeriesPattern1(this, 'utxos_under_100btc_mvrv'), + _1kBtc: createSeriesPattern1(this, 'utxos_under_1k_btc_mvrv'), + _10kBtc: createSeriesPattern1(this, 'utxos_under_10k_btc_mvrv'), + _100kBtc: createSeriesPattern1(this, 'utxos_under_100k_btc_mvrv'), + }, + over: { + _1sat: createSeriesPattern1(this, 'utxos_over_1sat_mvrv'), + _10sats: createSeriesPattern1(this, 'utxos_over_10sats_mvrv'), + _100sats: createSeriesPattern1(this, 'utxos_over_100sats_mvrv'), + _1kSats: createSeriesPattern1(this, 'utxos_over_1k_sats_mvrv'), + _10kSats: createSeriesPattern1(this, 'utxos_over_10k_sats_mvrv'), + _100kSats: createSeriesPattern1(this, 'utxos_over_100k_sats_mvrv'), + _1mSats: createSeriesPattern1(this, 'utxos_over_1m_sats_mvrv'), + _10mSats: createSeriesPattern1(this, 'utxos_over_10m_sats_mvrv'), + _1btc: createSeriesPattern1(this, 'utxos_over_1btc_mvrv'), + _10btc: createSeriesPattern1(this, 'utxos_over_10btc_mvrv'), + _100btc: createSeriesPattern1(this, 'utxos_over_100btc_mvrv'), + _1kBtc: createSeriesPattern1(this, 'utxos_over_1k_btc_mvrv'), + _10kBtc: createSeriesPattern1(this, 'utxos_over_10k_btc_mvrv'), + }, + }, + term: createLongShortPattern7(this, 'mvrv'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6(this, 'mvrv'), }, - allSupplySats: createSeriesPattern18(this, 'profitability_all_supply_sats'), - sthSupplySats: createSeriesPattern18(this, 'profitability_sth_supply_sats'), - allRealizedCap: createSeriesPattern18(this, 'profitability_all_realized_cap'), - sthRealizedCap: createSeriesPattern18(this, 'profitability_sth_realized_cap'), - allUnrealizedPnl: createSeriesPattern18(this, 'profitability_all_unrealized_pnl'), - sthUnrealizedPnl: createSeriesPattern18(this, 'profitability_sth_unrealized_pnl'), - nupl: createSeriesPattern18(this, 'profitability_nupl_ppm'), }, - matured: { - under1h: createAverageBlockCumulativeSumPattern2(this, 'utxos_under_1h_old_matured_supply'), - _1hTo1d: createAverageBlockCumulativeSumPattern2(this, 'utxos_1h_to_1d_old_matured_supply'), - _1dTo1w: createAverageBlockCumulativeSumPattern2(this, 'utxos_1d_to_1w_old_matured_supply'), - _1wTo1m: createAverageBlockCumulativeSumPattern2(this, 'utxos_1w_to_1m_old_matured_supply'), - _1mTo2m: createAverageBlockCumulativeSumPattern2(this, 'utxos_1m_to_2m_old_matured_supply'), - _2mTo3m: createAverageBlockCumulativeSumPattern2(this, 'utxos_2m_to_3m_old_matured_supply'), - _3mTo4m: createAverageBlockCumulativeSumPattern2(this, 'utxos_3m_to_4m_old_matured_supply'), - _4mTo5m: createAverageBlockCumulativeSumPattern2(this, 'utxos_4m_to_5m_old_matured_supply'), - _5mTo6m: createAverageBlockCumulativeSumPattern2(this, 'utxos_5m_to_6m_old_matured_supply'), - _6mTo9m: createAverageBlockCumulativeSumPattern2(this, 'utxos_6m_to_9m_old_matured_supply'), - _9mTo1y: createAverageBlockCumulativeSumPattern2(this, 'utxos_9m_to_1y_old_matured_supply'), - _1yTo18m: createAverageBlockCumulativeSumPattern2(this, 'utxos_1y_to_18m_old_matured_supply'), - _18mTo2y: createAverageBlockCumulativeSumPattern2(this, 'utxos_18m_to_2y_old_matured_supply'), - _2yTo3y: createAverageBlockCumulativeSumPattern2(this, 'utxos_2y_to_3y_old_matured_supply'), - _3yTo4y: createAverageBlockCumulativeSumPattern2(this, 'utxos_3y_to_4y_old_matured_supply'), - _4yTo5y: createAverageBlockCumulativeSumPattern2(this, 'utxos_4y_to_5y_old_matured_supply'), - _5yTo6y: createAverageBlockCumulativeSumPattern2(this, 'utxos_5y_to_6y_old_matured_supply'), - _6yTo7y: createAverageBlockCumulativeSumPattern2(this, 'utxos_6y_to_7y_old_matured_supply'), - _7yTo8y: createAverageBlockCumulativeSumPattern2(this, 'utxos_7y_to_8y_old_matured_supply'), - _8yTo10y: createAverageBlockCumulativeSumPattern2(this, 'utxos_8y_to_10y_old_matured_supply'), - _10yTo12y: createAverageBlockCumulativeSumPattern2(this, 'utxos_10y_to_12y_old_matured_supply'), - _12yTo15y: createAverageBlockCumulativeSumPattern2(this, 'utxos_12y_to_15y_old_matured_supply'), - over15y: createAverageBlockCumulativeSumPattern2(this, 'utxos_over_15y_old_matured_supply'), + unrealized: { + profit: { + all: createCentsUsdPattern3(this, 'unrealized_profit'), + age: { + range: { + under1h: createCentsUsdPattern3(this, 'utxos_under_1h_old_unrealized_profit'), + _1hTo1d: createCentsUsdPattern3(this, 'utxos_1h_to_1d_old_unrealized_profit'), + _1dTo1w: createCentsUsdPattern3(this, 'utxos_1d_to_1w_old_unrealized_profit'), + _1wTo1m: createCentsUsdPattern3(this, 'utxos_1w_to_1m_old_unrealized_profit'), + _1mTo2m: createCentsUsdPattern3(this, 'utxos_1m_to_2m_old_unrealized_profit'), + _2mTo3m: createCentsUsdPattern3(this, 'utxos_2m_to_3m_old_unrealized_profit'), + _3mTo4m: createCentsUsdPattern3(this, 'utxos_3m_to_4m_old_unrealized_profit'), + _4mTo5m: createCentsUsdPattern3(this, 'utxos_4m_to_5m_old_unrealized_profit'), + _5mTo6m: createCentsUsdPattern3(this, 'utxos_5m_to_6m_old_unrealized_profit'), + _6mTo9m: createCentsUsdPattern3(this, 'utxos_6m_to_9m_old_unrealized_profit'), + _9mTo1y: createCentsUsdPattern3(this, 'utxos_9m_to_1y_old_unrealized_profit'), + _1yTo18m: createCentsUsdPattern3(this, 'utxos_1y_to_18m_old_unrealized_profit'), + _18mTo2y: createCentsUsdPattern3(this, 'utxos_18m_to_2y_old_unrealized_profit'), + _2yTo3y: createCentsUsdPattern3(this, 'utxos_2y_to_3y_old_unrealized_profit'), + _3yTo4y: createCentsUsdPattern3(this, 'utxos_3y_to_4y_old_unrealized_profit'), + _4yTo5y: createCentsUsdPattern3(this, 'utxos_4y_to_5y_old_unrealized_profit'), + _5yTo6y: createCentsUsdPattern3(this, 'utxos_5y_to_6y_old_unrealized_profit'), + _6yTo7y: createCentsUsdPattern3(this, 'utxos_6y_to_7y_old_unrealized_profit'), + _7yTo8y: createCentsUsdPattern3(this, 'utxos_7y_to_8y_old_unrealized_profit'), + _8yTo10y: createCentsUsdPattern3(this, 'utxos_8y_to_10y_old_unrealized_profit'), + _10yTo12y: createCentsUsdPattern3(this, 'utxos_10y_to_12y_old_unrealized_profit'), + _12yTo15y: createCentsUsdPattern3(this, 'utxos_12y_to_15y_old_unrealized_profit'), + over15y: createCentsUsdPattern3(this, 'utxos_over_15y_old_unrealized_profit'), + }, + under: { + _1w: createCentsUsdPattern3(this, 'utxos_under_1w_old_unrealized_profit'), + _1m: createCentsUsdPattern3(this, 'utxos_under_1m_old_unrealized_profit'), + _2m: createCentsUsdPattern3(this, 'utxos_under_2m_old_unrealized_profit'), + _3m: createCentsUsdPattern3(this, 'utxos_under_3m_old_unrealized_profit'), + _4m: createCentsUsdPattern3(this, 'utxos_under_4m_old_unrealized_profit'), + _5m: createCentsUsdPattern3(this, 'utxos_under_5m_old_unrealized_profit'), + _6m: createCentsUsdPattern3(this, 'utxos_under_6m_old_unrealized_profit'), + _9m: createCentsUsdPattern3(this, 'utxos_under_9m_old_unrealized_profit'), + _1y: createCentsUsdPattern3(this, 'utxos_under_1y_old_unrealized_profit'), + _18m: createCentsUsdPattern3(this, 'utxos_under_18m_old_unrealized_profit'), + _2y: createCentsUsdPattern3(this, 'utxos_under_2y_old_unrealized_profit'), + _3y: createCentsUsdPattern3(this, 'utxos_under_3y_old_unrealized_profit'), + _4y: createCentsUsdPattern3(this, 'utxos_under_4y_old_unrealized_profit'), + _5y: createCentsUsdPattern3(this, 'utxos_under_5y_old_unrealized_profit'), + _6y: createCentsUsdPattern3(this, 'utxos_under_6y_old_unrealized_profit'), + _7y: createCentsUsdPattern3(this, 'utxos_under_7y_old_unrealized_profit'), + _8y: createCentsUsdPattern3(this, 'utxos_under_8y_old_unrealized_profit'), + _10y: createCentsUsdPattern3(this, 'utxos_under_10y_old_unrealized_profit'), + _12y: createCentsUsdPattern3(this, 'utxos_under_12y_old_unrealized_profit'), + _15y: createCentsUsdPattern3(this, 'utxos_under_15y_old_unrealized_profit'), + }, + over: { + _1d: createCentsUsdPattern3(this, 'utxos_over_1d_old_unrealized_profit'), + _1w: createCentsUsdPattern3(this, 'utxos_over_1w_old_unrealized_profit'), + _1m: createCentsUsdPattern3(this, 'utxos_over_1m_old_unrealized_profit'), + _2m: createCentsUsdPattern3(this, 'utxos_over_2m_old_unrealized_profit'), + _3m: createCentsUsdPattern3(this, 'utxos_over_3m_old_unrealized_profit'), + _4m: createCentsUsdPattern3(this, 'utxos_over_4m_old_unrealized_profit'), + _5m: createCentsUsdPattern3(this, 'utxos_over_5m_old_unrealized_profit'), + _6m: createCentsUsdPattern3(this, 'utxos_over_6m_old_unrealized_profit'), + _9m: createCentsUsdPattern3(this, 'utxos_over_9m_old_unrealized_profit'), + _1y: createCentsUsdPattern3(this, 'utxos_over_1y_old_unrealized_profit'), + _18m: createCentsUsdPattern3(this, 'utxos_over_18m_old_unrealized_profit'), + _2y: createCentsUsdPattern3(this, 'utxos_over_2y_old_unrealized_profit'), + _3y: createCentsUsdPattern3(this, 'utxos_over_3y_old_unrealized_profit'), + _4y: createCentsUsdPattern3(this, 'utxos_over_4y_old_unrealized_profit'), + _5y: createCentsUsdPattern3(this, 'utxos_over_5y_old_unrealized_profit'), + _6y: createCentsUsdPattern3(this, 'utxos_over_6y_old_unrealized_profit'), + _7y: createCentsUsdPattern3(this, 'utxos_over_7y_old_unrealized_profit'), + _8y: createCentsUsdPattern3(this, 'utxos_over_8y_old_unrealized_profit'), + _10y: createCentsUsdPattern3(this, 'utxos_over_10y_old_unrealized_profit'), + _12y: createCentsUsdPattern3(this, 'utxos_over_12y_old_unrealized_profit'), + }, + }, + epoch: { + _0: createCentsUsdPattern3(this, 'epoch_0_unrealized_profit'), + _1: createCentsUsdPattern3(this, 'epoch_1_unrealized_profit'), + _2: createCentsUsdPattern3(this, 'epoch_2_unrealized_profit'), + _3: createCentsUsdPattern3(this, 'epoch_3_unrealized_profit'), + _4: createCentsUsdPattern3(this, 'epoch_4_unrealized_profit'), + }, + class: { + _2009: createCentsUsdPattern3(this, 'class_2009_unrealized_profit'), + _2010: createCentsUsdPattern3(this, 'class_2010_unrealized_profit'), + _2011: createCentsUsdPattern3(this, 'class_2011_unrealized_profit'), + _2012: createCentsUsdPattern3(this, 'class_2012_unrealized_profit'), + _2013: createCentsUsdPattern3(this, 'class_2013_unrealized_profit'), + _2014: createCentsUsdPattern3(this, 'class_2014_unrealized_profit'), + _2015: createCentsUsdPattern3(this, 'class_2015_unrealized_profit'), + _2016: createCentsUsdPattern3(this, 'class_2016_unrealized_profit'), + _2017: createCentsUsdPattern3(this, 'class_2017_unrealized_profit'), + _2018: createCentsUsdPattern3(this, 'class_2018_unrealized_profit'), + _2019: createCentsUsdPattern3(this, 'class_2019_unrealized_profit'), + _2020: createCentsUsdPattern3(this, 'class_2020_unrealized_profit'), + _2021: createCentsUsdPattern3(this, 'class_2021_unrealized_profit'), + _2022: createCentsUsdPattern3(this, 'class_2022_unrealized_profit'), + _2023: createCentsUsdPattern3(this, 'class_2023_unrealized_profit'), + _2024: createCentsUsdPattern3(this, 'class_2024_unrealized_profit'), + _2025: createCentsUsdPattern3(this, 'class_2025_unrealized_profit'), + _2026: createCentsUsdPattern3(this, 'class_2026_unrealized_profit'), + }, + entry: createDiscountPremiumPattern13(this, 'unrealized_profit'), + term: createLongShortPattern14(this, 'unrealized_profit'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11(this, 'unrealized_profit'), + ageRangeMatrix: createSeriesPattern18(this, 'utxos_unrealized_profit_cents_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'unrealized_profit_cents_by_epoch'), + classMatrix: createSeriesPattern18(this, 'unrealized_profit_cents_by_class'), + entryMatrix: createSeriesPattern18(this, 'unrealized_profit_cents_by_entry'), + typeMatrix: createSeriesPattern18(this, 'unrealized_profit_cents_by_type'), + }, + loss: { + all: createCentsUsdPattern3(this, 'unrealized_loss'), + age: { + range: { + under1h: createCentsUsdPattern3(this, 'utxos_under_1h_old_unrealized_loss'), + _1hTo1d: createCentsUsdPattern3(this, 'utxos_1h_to_1d_old_unrealized_loss'), + _1dTo1w: createCentsUsdPattern3(this, 'utxos_1d_to_1w_old_unrealized_loss'), + _1wTo1m: createCentsUsdPattern3(this, 'utxos_1w_to_1m_old_unrealized_loss'), + _1mTo2m: createCentsUsdPattern3(this, 'utxos_1m_to_2m_old_unrealized_loss'), + _2mTo3m: createCentsUsdPattern3(this, 'utxos_2m_to_3m_old_unrealized_loss'), + _3mTo4m: createCentsUsdPattern3(this, 'utxos_3m_to_4m_old_unrealized_loss'), + _4mTo5m: createCentsUsdPattern3(this, 'utxos_4m_to_5m_old_unrealized_loss'), + _5mTo6m: createCentsUsdPattern3(this, 'utxos_5m_to_6m_old_unrealized_loss'), + _6mTo9m: createCentsUsdPattern3(this, 'utxos_6m_to_9m_old_unrealized_loss'), + _9mTo1y: createCentsUsdPattern3(this, 'utxos_9m_to_1y_old_unrealized_loss'), + _1yTo18m: createCentsUsdPattern3(this, 'utxos_1y_to_18m_old_unrealized_loss'), + _18mTo2y: createCentsUsdPattern3(this, 'utxos_18m_to_2y_old_unrealized_loss'), + _2yTo3y: createCentsUsdPattern3(this, 'utxos_2y_to_3y_old_unrealized_loss'), + _3yTo4y: createCentsUsdPattern3(this, 'utxos_3y_to_4y_old_unrealized_loss'), + _4yTo5y: createCentsUsdPattern3(this, 'utxos_4y_to_5y_old_unrealized_loss'), + _5yTo6y: createCentsUsdPattern3(this, 'utxos_5y_to_6y_old_unrealized_loss'), + _6yTo7y: createCentsUsdPattern3(this, 'utxos_6y_to_7y_old_unrealized_loss'), + _7yTo8y: createCentsUsdPattern3(this, 'utxos_7y_to_8y_old_unrealized_loss'), + _8yTo10y: createCentsUsdPattern3(this, 'utxos_8y_to_10y_old_unrealized_loss'), + _10yTo12y: createCentsUsdPattern3(this, 'utxos_10y_to_12y_old_unrealized_loss'), + _12yTo15y: createCentsUsdPattern3(this, 'utxos_12y_to_15y_old_unrealized_loss'), + over15y: createCentsUsdPattern3(this, 'utxos_over_15y_old_unrealized_loss'), + }, + under: { + _1w: createCentsUsdPattern3(this, 'utxos_under_1w_old_unrealized_loss'), + _1m: createCentsUsdPattern3(this, 'utxos_under_1m_old_unrealized_loss'), + _2m: createCentsUsdPattern3(this, 'utxos_under_2m_old_unrealized_loss'), + _3m: createCentsUsdPattern3(this, 'utxos_under_3m_old_unrealized_loss'), + _4m: createCentsUsdPattern3(this, 'utxos_under_4m_old_unrealized_loss'), + _5m: createCentsUsdPattern3(this, 'utxos_under_5m_old_unrealized_loss'), + _6m: createCentsUsdPattern3(this, 'utxos_under_6m_old_unrealized_loss'), + _9m: createCentsUsdPattern3(this, 'utxos_under_9m_old_unrealized_loss'), + _1y: createCentsUsdPattern3(this, 'utxos_under_1y_old_unrealized_loss'), + _18m: createCentsUsdPattern3(this, 'utxos_under_18m_old_unrealized_loss'), + _2y: createCentsUsdPattern3(this, 'utxos_under_2y_old_unrealized_loss'), + _3y: createCentsUsdPattern3(this, 'utxos_under_3y_old_unrealized_loss'), + _4y: createCentsUsdPattern3(this, 'utxos_under_4y_old_unrealized_loss'), + _5y: createCentsUsdPattern3(this, 'utxos_under_5y_old_unrealized_loss'), + _6y: createCentsUsdPattern3(this, 'utxos_under_6y_old_unrealized_loss'), + _7y: createCentsUsdPattern3(this, 'utxos_under_7y_old_unrealized_loss'), + _8y: createCentsUsdPattern3(this, 'utxos_under_8y_old_unrealized_loss'), + _10y: createCentsUsdPattern3(this, 'utxos_under_10y_old_unrealized_loss'), + _12y: createCentsUsdPattern3(this, 'utxos_under_12y_old_unrealized_loss'), + _15y: createCentsUsdPattern3(this, 'utxos_under_15y_old_unrealized_loss'), + }, + over: { + _1d: createCentsUsdPattern3(this, 'utxos_over_1d_old_unrealized_loss'), + _1w: createCentsUsdPattern3(this, 'utxos_over_1w_old_unrealized_loss'), + _1m: createCentsUsdPattern3(this, 'utxos_over_1m_old_unrealized_loss'), + _2m: createCentsUsdPattern3(this, 'utxos_over_2m_old_unrealized_loss'), + _3m: createCentsUsdPattern3(this, 'utxos_over_3m_old_unrealized_loss'), + _4m: createCentsUsdPattern3(this, 'utxos_over_4m_old_unrealized_loss'), + _5m: createCentsUsdPattern3(this, 'utxos_over_5m_old_unrealized_loss'), + _6m: createCentsUsdPattern3(this, 'utxos_over_6m_old_unrealized_loss'), + _9m: createCentsUsdPattern3(this, 'utxos_over_9m_old_unrealized_loss'), + _1y: createCentsUsdPattern3(this, 'utxos_over_1y_old_unrealized_loss'), + _18m: createCentsUsdPattern3(this, 'utxos_over_18m_old_unrealized_loss'), + _2y: createCentsUsdPattern3(this, 'utxos_over_2y_old_unrealized_loss'), + _3y: createCentsUsdPattern3(this, 'utxos_over_3y_old_unrealized_loss'), + _4y: createCentsUsdPattern3(this, 'utxos_over_4y_old_unrealized_loss'), + _5y: createCentsUsdPattern3(this, 'utxos_over_5y_old_unrealized_loss'), + _6y: createCentsUsdPattern3(this, 'utxos_over_6y_old_unrealized_loss'), + _7y: createCentsUsdPattern3(this, 'utxos_over_7y_old_unrealized_loss'), + _8y: createCentsUsdPattern3(this, 'utxos_over_8y_old_unrealized_loss'), + _10y: createCentsUsdPattern3(this, 'utxos_over_10y_old_unrealized_loss'), + _12y: createCentsUsdPattern3(this, 'utxos_over_12y_old_unrealized_loss'), + }, + }, + epoch: { + _0: createCentsUsdPattern3(this, 'epoch_0_unrealized_loss'), + _1: createCentsUsdPattern3(this, 'epoch_1_unrealized_loss'), + _2: createCentsUsdPattern3(this, 'epoch_2_unrealized_loss'), + _3: createCentsUsdPattern3(this, 'epoch_3_unrealized_loss'), + _4: createCentsUsdPattern3(this, 'epoch_4_unrealized_loss'), + }, + class: { + _2009: createCentsUsdPattern3(this, 'class_2009_unrealized_loss'), + _2010: createCentsUsdPattern3(this, 'class_2010_unrealized_loss'), + _2011: createCentsUsdPattern3(this, 'class_2011_unrealized_loss'), + _2012: createCentsUsdPattern3(this, 'class_2012_unrealized_loss'), + _2013: createCentsUsdPattern3(this, 'class_2013_unrealized_loss'), + _2014: createCentsUsdPattern3(this, 'class_2014_unrealized_loss'), + _2015: createCentsUsdPattern3(this, 'class_2015_unrealized_loss'), + _2016: createCentsUsdPattern3(this, 'class_2016_unrealized_loss'), + _2017: createCentsUsdPattern3(this, 'class_2017_unrealized_loss'), + _2018: createCentsUsdPattern3(this, 'class_2018_unrealized_loss'), + _2019: createCentsUsdPattern3(this, 'class_2019_unrealized_loss'), + _2020: createCentsUsdPattern3(this, 'class_2020_unrealized_loss'), + _2021: createCentsUsdPattern3(this, 'class_2021_unrealized_loss'), + _2022: createCentsUsdPattern3(this, 'class_2022_unrealized_loss'), + _2023: createCentsUsdPattern3(this, 'class_2023_unrealized_loss'), + _2024: createCentsUsdPattern3(this, 'class_2024_unrealized_loss'), + _2025: createCentsUsdPattern3(this, 'class_2025_unrealized_loss'), + _2026: createCentsUsdPattern3(this, 'class_2026_unrealized_loss'), + }, + entry: createDiscountPremiumPattern13(this, 'unrealized_loss'), + term: createLongShortPattern14(this, 'unrealized_loss'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11(this, 'unrealized_loss'), + ageRangeMatrix: createSeriesPattern18(this, 'utxos_unrealized_loss_cents_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'unrealized_loss_cents_by_epoch'), + classMatrix: createSeriesPattern18(this, 'unrealized_loss_cents_by_class'), + entryMatrix: createSeriesPattern18(this, 'unrealized_loss_cents_by_entry'), + typeMatrix: createSeriesPattern18(this, 'unrealized_loss_cents_by_type'), + negative: { + all: createSeriesPattern1(this, 'unrealized_loss_neg'), + age: { + range: { + under1h: createSeriesPattern1(this, 'utxos_under_1h_old_unrealized_loss_neg'), + _1hTo1d: createSeriesPattern1(this, 'utxos_1h_to_1d_old_unrealized_loss_neg'), + _1dTo1w: createSeriesPattern1(this, 'utxos_1d_to_1w_old_unrealized_loss_neg'), + _1wTo1m: createSeriesPattern1(this, 'utxos_1w_to_1m_old_unrealized_loss_neg'), + _1mTo2m: createSeriesPattern1(this, 'utxos_1m_to_2m_old_unrealized_loss_neg'), + _2mTo3m: createSeriesPattern1(this, 'utxos_2m_to_3m_old_unrealized_loss_neg'), + _3mTo4m: createSeriesPattern1(this, 'utxos_3m_to_4m_old_unrealized_loss_neg'), + _4mTo5m: createSeriesPattern1(this, 'utxos_4m_to_5m_old_unrealized_loss_neg'), + _5mTo6m: createSeriesPattern1(this, 'utxos_5m_to_6m_old_unrealized_loss_neg'), + _6mTo9m: createSeriesPattern1(this, 'utxos_6m_to_9m_old_unrealized_loss_neg'), + _9mTo1y: createSeriesPattern1(this, 'utxos_9m_to_1y_old_unrealized_loss_neg'), + _1yTo18m: createSeriesPattern1(this, 'utxos_1y_to_18m_old_unrealized_loss_neg'), + _18mTo2y: createSeriesPattern1(this, 'utxos_18m_to_2y_old_unrealized_loss_neg'), + _2yTo3y: createSeriesPattern1(this, 'utxos_2y_to_3y_old_unrealized_loss_neg'), + _3yTo4y: createSeriesPattern1(this, 'utxos_3y_to_4y_old_unrealized_loss_neg'), + _4yTo5y: createSeriesPattern1(this, 'utxos_4y_to_5y_old_unrealized_loss_neg'), + _5yTo6y: createSeriesPattern1(this, 'utxos_5y_to_6y_old_unrealized_loss_neg'), + _6yTo7y: createSeriesPattern1(this, 'utxos_6y_to_7y_old_unrealized_loss_neg'), + _7yTo8y: createSeriesPattern1(this, 'utxos_7y_to_8y_old_unrealized_loss_neg'), + _8yTo10y: createSeriesPattern1(this, 'utxos_8y_to_10y_old_unrealized_loss_neg'), + _10yTo12y: createSeriesPattern1(this, 'utxos_10y_to_12y_old_unrealized_loss_neg'), + _12yTo15y: createSeriesPattern1(this, 'utxos_12y_to_15y_old_unrealized_loss_neg'), + over15y: createSeriesPattern1(this, 'utxos_over_15y_old_unrealized_loss_neg'), + }, + under: { + _1w: createSeriesPattern1(this, 'utxos_under_1w_old_unrealized_loss_neg'), + _1m: createSeriesPattern1(this, 'utxos_under_1m_old_unrealized_loss_neg'), + _2m: createSeriesPattern1(this, 'utxos_under_2m_old_unrealized_loss_neg'), + _3m: createSeriesPattern1(this, 'utxos_under_3m_old_unrealized_loss_neg'), + _4m: createSeriesPattern1(this, 'utxos_under_4m_old_unrealized_loss_neg'), + _5m: createSeriesPattern1(this, 'utxos_under_5m_old_unrealized_loss_neg'), + _6m: createSeriesPattern1(this, 'utxos_under_6m_old_unrealized_loss_neg'), + _9m: createSeriesPattern1(this, 'utxos_under_9m_old_unrealized_loss_neg'), + _1y: createSeriesPattern1(this, 'utxos_under_1y_old_unrealized_loss_neg'), + _18m: createSeriesPattern1(this, 'utxos_under_18m_old_unrealized_loss_neg'), + _2y: createSeriesPattern1(this, 'utxos_under_2y_old_unrealized_loss_neg'), + _3y: createSeriesPattern1(this, 'utxos_under_3y_old_unrealized_loss_neg'), + _4y: createSeriesPattern1(this, 'utxos_under_4y_old_unrealized_loss_neg'), + _5y: createSeriesPattern1(this, 'utxos_under_5y_old_unrealized_loss_neg'), + _6y: createSeriesPattern1(this, 'utxos_under_6y_old_unrealized_loss_neg'), + _7y: createSeriesPattern1(this, 'utxos_under_7y_old_unrealized_loss_neg'), + _8y: createSeriesPattern1(this, 'utxos_under_8y_old_unrealized_loss_neg'), + _10y: createSeriesPattern1(this, 'utxos_under_10y_old_unrealized_loss_neg'), + _12y: createSeriesPattern1(this, 'utxos_under_12y_old_unrealized_loss_neg'), + _15y: createSeriesPattern1(this, 'utxos_under_15y_old_unrealized_loss_neg'), + }, + over: { + _1d: createSeriesPattern1(this, 'utxos_over_1d_old_unrealized_loss_neg'), + _1w: createSeriesPattern1(this, 'utxos_over_1w_old_unrealized_loss_neg'), + _1m: createSeriesPattern1(this, 'utxos_over_1m_old_unrealized_loss_neg'), + _2m: createSeriesPattern1(this, 'utxos_over_2m_old_unrealized_loss_neg'), + _3m: createSeriesPattern1(this, 'utxos_over_3m_old_unrealized_loss_neg'), + _4m: createSeriesPattern1(this, 'utxos_over_4m_old_unrealized_loss_neg'), + _5m: createSeriesPattern1(this, 'utxos_over_5m_old_unrealized_loss_neg'), + _6m: createSeriesPattern1(this, 'utxos_over_6m_old_unrealized_loss_neg'), + _9m: createSeriesPattern1(this, 'utxos_over_9m_old_unrealized_loss_neg'), + _1y: createSeriesPattern1(this, 'utxos_over_1y_old_unrealized_loss_neg'), + _18m: createSeriesPattern1(this, 'utxos_over_18m_old_unrealized_loss_neg'), + _2y: createSeriesPattern1(this, 'utxos_over_2y_old_unrealized_loss_neg'), + _3y: createSeriesPattern1(this, 'utxos_over_3y_old_unrealized_loss_neg'), + _4y: createSeriesPattern1(this, 'utxos_over_4y_old_unrealized_loss_neg'), + _5y: createSeriesPattern1(this, 'utxos_over_5y_old_unrealized_loss_neg'), + _6y: createSeriesPattern1(this, 'utxos_over_6y_old_unrealized_loss_neg'), + _7y: createSeriesPattern1(this, 'utxos_over_7y_old_unrealized_loss_neg'), + _8y: createSeriesPattern1(this, 'utxos_over_8y_old_unrealized_loss_neg'), + _10y: createSeriesPattern1(this, 'utxos_over_10y_old_unrealized_loss_neg'), + _12y: createSeriesPattern1(this, 'utxos_over_12y_old_unrealized_loss_neg'), + }, + }, + epoch: { + _0: createSeriesPattern1(this, 'epoch_0_unrealized_loss_neg'), + _1: createSeriesPattern1(this, 'epoch_1_unrealized_loss_neg'), + _2: createSeriesPattern1(this, 'epoch_2_unrealized_loss_neg'), + _3: createSeriesPattern1(this, 'epoch_3_unrealized_loss_neg'), + _4: createSeriesPattern1(this, 'epoch_4_unrealized_loss_neg'), + }, + class: { + _2009: createSeriesPattern1(this, 'class_2009_unrealized_loss_neg'), + _2010: createSeriesPattern1(this, 'class_2010_unrealized_loss_neg'), + _2011: createSeriesPattern1(this, 'class_2011_unrealized_loss_neg'), + _2012: createSeriesPattern1(this, 'class_2012_unrealized_loss_neg'), + _2013: createSeriesPattern1(this, 'class_2013_unrealized_loss_neg'), + _2014: createSeriesPattern1(this, 'class_2014_unrealized_loss_neg'), + _2015: createSeriesPattern1(this, 'class_2015_unrealized_loss_neg'), + _2016: createSeriesPattern1(this, 'class_2016_unrealized_loss_neg'), + _2017: createSeriesPattern1(this, 'class_2017_unrealized_loss_neg'), + _2018: createSeriesPattern1(this, 'class_2018_unrealized_loss_neg'), + _2019: createSeriesPattern1(this, 'class_2019_unrealized_loss_neg'), + _2020: createSeriesPattern1(this, 'class_2020_unrealized_loss_neg'), + _2021: createSeriesPattern1(this, 'class_2021_unrealized_loss_neg'), + _2022: createSeriesPattern1(this, 'class_2022_unrealized_loss_neg'), + _2023: createSeriesPattern1(this, 'class_2023_unrealized_loss_neg'), + _2024: createSeriesPattern1(this, 'class_2024_unrealized_loss_neg'), + _2025: createSeriesPattern1(this, 'class_2025_unrealized_loss_neg'), + _2026: createSeriesPattern1(this, 'class_2026_unrealized_loss_neg'), + }, + entry: createDiscountPremiumPattern7(this, 'unrealized_loss_neg'), + term: createLongShortPattern7(this, 'unrealized_loss_neg'), + type: createEmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6(this, 'unrealized_loss_neg'), + }, + }, + netPnl: { + all: createCentsUsdPattern(this, 'net_unrealized_pnl'), + age: { + range: { + under1h: createCentsUsdPattern(this, 'utxos_under_1h_old_net_unrealized_pnl'), + _1hTo1d: createCentsUsdPattern(this, 'utxos_1h_to_1d_old_net_unrealized_pnl'), + _1dTo1w: createCentsUsdPattern(this, 'utxos_1d_to_1w_old_net_unrealized_pnl'), + _1wTo1m: createCentsUsdPattern(this, 'utxos_1w_to_1m_old_net_unrealized_pnl'), + _1mTo2m: createCentsUsdPattern(this, 'utxos_1m_to_2m_old_net_unrealized_pnl'), + _2mTo3m: createCentsUsdPattern(this, 'utxos_2m_to_3m_old_net_unrealized_pnl'), + _3mTo4m: createCentsUsdPattern(this, 'utxos_3m_to_4m_old_net_unrealized_pnl'), + _4mTo5m: createCentsUsdPattern(this, 'utxos_4m_to_5m_old_net_unrealized_pnl'), + _5mTo6m: createCentsUsdPattern(this, 'utxos_5m_to_6m_old_net_unrealized_pnl'), + _6mTo9m: createCentsUsdPattern(this, 'utxos_6m_to_9m_old_net_unrealized_pnl'), + _9mTo1y: createCentsUsdPattern(this, 'utxos_9m_to_1y_old_net_unrealized_pnl'), + _1yTo18m: createCentsUsdPattern(this, 'utxos_1y_to_18m_old_net_unrealized_pnl'), + _18mTo2y: createCentsUsdPattern(this, 'utxos_18m_to_2y_old_net_unrealized_pnl'), + _2yTo3y: createCentsUsdPattern(this, 'utxos_2y_to_3y_old_net_unrealized_pnl'), + _3yTo4y: createCentsUsdPattern(this, 'utxos_3y_to_4y_old_net_unrealized_pnl'), + _4yTo5y: createCentsUsdPattern(this, 'utxos_4y_to_5y_old_net_unrealized_pnl'), + _5yTo6y: createCentsUsdPattern(this, 'utxos_5y_to_6y_old_net_unrealized_pnl'), + _6yTo7y: createCentsUsdPattern(this, 'utxos_6y_to_7y_old_net_unrealized_pnl'), + _7yTo8y: createCentsUsdPattern(this, 'utxos_7y_to_8y_old_net_unrealized_pnl'), + _8yTo10y: createCentsUsdPattern(this, 'utxos_8y_to_10y_old_net_unrealized_pnl'), + _10yTo12y: createCentsUsdPattern(this, 'utxos_10y_to_12y_old_net_unrealized_pnl'), + _12yTo15y: createCentsUsdPattern(this, 'utxos_12y_to_15y_old_net_unrealized_pnl'), + over15y: createCentsUsdPattern(this, 'utxos_over_15y_old_net_unrealized_pnl'), + }, + under: { + _1w: createCentsUsdPattern(this, 'utxos_under_1w_old_net_unrealized_pnl'), + _1m: createCentsUsdPattern(this, 'utxos_under_1m_old_net_unrealized_pnl'), + _2m: createCentsUsdPattern(this, 'utxos_under_2m_old_net_unrealized_pnl'), + _3m: createCentsUsdPattern(this, 'utxos_under_3m_old_net_unrealized_pnl'), + _4m: createCentsUsdPattern(this, 'utxos_under_4m_old_net_unrealized_pnl'), + _5m: createCentsUsdPattern(this, 'utxos_under_5m_old_net_unrealized_pnl'), + _6m: createCentsUsdPattern(this, 'utxos_under_6m_old_net_unrealized_pnl'), + _9m: createCentsUsdPattern(this, 'utxos_under_9m_old_net_unrealized_pnl'), + _1y: createCentsUsdPattern(this, 'utxos_under_1y_old_net_unrealized_pnl'), + _18m: createCentsUsdPattern(this, 'utxos_under_18m_old_net_unrealized_pnl'), + _2y: createCentsUsdPattern(this, 'utxos_under_2y_old_net_unrealized_pnl'), + _3y: createCentsUsdPattern(this, 'utxos_under_3y_old_net_unrealized_pnl'), + _4y: createCentsUsdPattern(this, 'utxos_under_4y_old_net_unrealized_pnl'), + _5y: createCentsUsdPattern(this, 'utxos_under_5y_old_net_unrealized_pnl'), + _6y: createCentsUsdPattern(this, 'utxos_under_6y_old_net_unrealized_pnl'), + _7y: createCentsUsdPattern(this, 'utxos_under_7y_old_net_unrealized_pnl'), + _8y: createCentsUsdPattern(this, 'utxos_under_8y_old_net_unrealized_pnl'), + _10y: createCentsUsdPattern(this, 'utxos_under_10y_old_net_unrealized_pnl'), + _12y: createCentsUsdPattern(this, 'utxos_under_12y_old_net_unrealized_pnl'), + _15y: createCentsUsdPattern(this, 'utxos_under_15y_old_net_unrealized_pnl'), + }, + over: { + _1d: createCentsUsdPattern(this, 'utxos_over_1d_old_net_unrealized_pnl'), + _1w: createCentsUsdPattern(this, 'utxos_over_1w_old_net_unrealized_pnl'), + _1m: createCentsUsdPattern(this, 'utxos_over_1m_old_net_unrealized_pnl'), + _2m: createCentsUsdPattern(this, 'utxos_over_2m_old_net_unrealized_pnl'), + _3m: createCentsUsdPattern(this, 'utxos_over_3m_old_net_unrealized_pnl'), + _4m: createCentsUsdPattern(this, 'utxos_over_4m_old_net_unrealized_pnl'), + _5m: createCentsUsdPattern(this, 'utxos_over_5m_old_net_unrealized_pnl'), + _6m: createCentsUsdPattern(this, 'utxos_over_6m_old_net_unrealized_pnl'), + _9m: createCentsUsdPattern(this, 'utxos_over_9m_old_net_unrealized_pnl'), + _1y: createCentsUsdPattern(this, 'utxos_over_1y_old_net_unrealized_pnl'), + _18m: createCentsUsdPattern(this, 'utxos_over_18m_old_net_unrealized_pnl'), + _2y: createCentsUsdPattern(this, 'utxos_over_2y_old_net_unrealized_pnl'), + _3y: createCentsUsdPattern(this, 'utxos_over_3y_old_net_unrealized_pnl'), + _4y: createCentsUsdPattern(this, 'utxos_over_4y_old_net_unrealized_pnl'), + _5y: createCentsUsdPattern(this, 'utxos_over_5y_old_net_unrealized_pnl'), + _6y: createCentsUsdPattern(this, 'utxos_over_6y_old_net_unrealized_pnl'), + _7y: createCentsUsdPattern(this, 'utxos_over_7y_old_net_unrealized_pnl'), + _8y: createCentsUsdPattern(this, 'utxos_over_8y_old_net_unrealized_pnl'), + _10y: createCentsUsdPattern(this, 'utxos_over_10y_old_net_unrealized_pnl'), + _12y: createCentsUsdPattern(this, 'utxos_over_12y_old_net_unrealized_pnl'), + }, + }, + epoch: { + _0: createCentsUsdPattern(this, 'epoch_0_net_unrealized_pnl'), + _1: createCentsUsdPattern(this, 'epoch_1_net_unrealized_pnl'), + _2: createCentsUsdPattern(this, 'epoch_2_net_unrealized_pnl'), + _3: createCentsUsdPattern(this, 'epoch_3_net_unrealized_pnl'), + _4: createCentsUsdPattern(this, 'epoch_4_net_unrealized_pnl'), + }, + class: { + _2009: createCentsUsdPattern(this, 'class_2009_net_unrealized_pnl'), + _2010: createCentsUsdPattern(this, 'class_2010_net_unrealized_pnl'), + _2011: createCentsUsdPattern(this, 'class_2011_net_unrealized_pnl'), + _2012: createCentsUsdPattern(this, 'class_2012_net_unrealized_pnl'), + _2013: createCentsUsdPattern(this, 'class_2013_net_unrealized_pnl'), + _2014: createCentsUsdPattern(this, 'class_2014_net_unrealized_pnl'), + _2015: createCentsUsdPattern(this, 'class_2015_net_unrealized_pnl'), + _2016: createCentsUsdPattern(this, 'class_2016_net_unrealized_pnl'), + _2017: createCentsUsdPattern(this, 'class_2017_net_unrealized_pnl'), + _2018: createCentsUsdPattern(this, 'class_2018_net_unrealized_pnl'), + _2019: createCentsUsdPattern(this, 'class_2019_net_unrealized_pnl'), + _2020: createCentsUsdPattern(this, 'class_2020_net_unrealized_pnl'), + _2021: createCentsUsdPattern(this, 'class_2021_net_unrealized_pnl'), + _2022: createCentsUsdPattern(this, 'class_2022_net_unrealized_pnl'), + _2023: createCentsUsdPattern(this, 'class_2023_net_unrealized_pnl'), + _2024: createCentsUsdPattern(this, 'class_2024_net_unrealized_pnl'), + _2025: createCentsUsdPattern(this, 'class_2025_net_unrealized_pnl'), + _2026: createCentsUsdPattern(this, 'class_2026_net_unrealized_pnl'), + }, + entry: { + discount: createCentsUsdPattern(this, 'veteran_net_unrealized_pnl'), + premium: createCentsUsdPattern(this, 'rookie_net_unrealized_pnl'), + }, + term: { + short: createCentsUsdPattern(this, 'sth_net_unrealized_pnl'), + long: createCentsUsdPattern(this, 'lth_net_unrealized_pnl'), + }, + ageRangeMatrix: createSeriesPattern18(this, 'utxos_net_unrealized_pnl_cents_by_age_range'), + epochMatrix: createSeriesPattern18(this, 'net_unrealized_pnl_cents_by_epoch'), + classMatrix: createSeriesPattern18(this, 'net_unrealized_pnl_cents_by_class'), + entryMatrix: createSeriesPattern18(this, 'net_unrealized_pnl_cents_by_entry'), + }, + grossPnl: { + all: createCentsUsdPattern3(this, 'all_unrealized_gross_pnl'), + sth: createCentsUsdPattern3(this, 'sth_unrealized_gross_pnl'), + lth: createCentsUsdPattern3(this, 'lth_unrealized_gross_pnl'), + height: createSeriesPattern18(this, 'unrealized_gross_pnl_cents_by_term'), + }, + investedCapitalInProfit: { + all: createCentsUsdPattern3(this, 'all_invested_capital_in_profit'), + sth: createCentsUsdPattern3(this, 'sth_invested_capital_in_profit'), + lth: createCentsUsdPattern3(this, 'lth_invested_capital_in_profit'), + height: createSeriesPattern18(this, 'invested_capital_in_profit_cents_by_term'), + }, + investedCapitalInLoss: { + all: createCentsUsdPattern3(this, 'all_invested_capital_in_loss'), + sth: createCentsUsdPattern3(this, 'sth_invested_capital_in_loss'), + lth: createCentsUsdPattern3(this, 'lth_invested_capital_in_loss'), + height: createSeriesPattern18(this, 'invested_capital_in_loss_cents_by_term'), + }, + capitalizedCapInProfitRaw: createMatrixPattern(this, 'capitalized_cap_in_profit_raw_by_term'), + capitalizedCapInLossRaw: createMatrixPattern(this, 'capitalized_cap_in_loss_raw_by_term'), + painIndex: { + all: createCentsUsdPattern3(this, 'all_pain_index'), + sth: createCentsUsdPattern3(this, 'sth_pain_index'), + lth: createCentsUsdPattern3(this, 'lth_pain_index'), + height: createSeriesPattern18(this, 'pain_index_cents_by_aggregate'), + }, + greedIndex: { + all: createCentsUsdPattern3(this, 'all_greed_index'), + sth: createCentsUsdPattern3(this, 'sth_greed_index'), + lth: createCentsUsdPattern3(this, 'lth_greed_index'), + height: createSeriesPattern18(this, 'greed_index_cents_by_aggregate'), + }, + netSentiment: { + all: createCentsUsdPattern(this, 'all_net_sentiment'), + sth: createCentsUsdPattern(this, 'sth_net_sentiment'), + lth: createCentsUsdPattern(this, 'lth_net_sentiment'), + height: createSeriesPattern18(this, 'net_sentiment_cents_by_aggregate'), + }, + nupl: { + all: createPpmRatioPattern(this, 'nupl'), + age: { + range: { + under1h: createPpmRatioPattern(this, 'utxos_under_1h_old_nupl'), + _1hTo1d: createPpmRatioPattern(this, 'utxos_1h_to_1d_old_nupl'), + _1dTo1w: createPpmRatioPattern(this, 'utxos_1d_to_1w_old_nupl'), + _1wTo1m: createPpmRatioPattern(this, 'utxos_1w_to_1m_old_nupl'), + _1mTo2m: createPpmRatioPattern(this, 'utxos_1m_to_2m_old_nupl'), + _2mTo3m: createPpmRatioPattern(this, 'utxos_2m_to_3m_old_nupl'), + _3mTo4m: createPpmRatioPattern(this, 'utxos_3m_to_4m_old_nupl'), + _4mTo5m: createPpmRatioPattern(this, 'utxos_4m_to_5m_old_nupl'), + _5mTo6m: createPpmRatioPattern(this, 'utxos_5m_to_6m_old_nupl'), + _6mTo9m: createPpmRatioPattern(this, 'utxos_6m_to_9m_old_nupl'), + _9mTo1y: createPpmRatioPattern(this, 'utxos_9m_to_1y_old_nupl'), + _1yTo18m: createPpmRatioPattern(this, 'utxos_1y_to_18m_old_nupl'), + _18mTo2y: createPpmRatioPattern(this, 'utxos_18m_to_2y_old_nupl'), + _2yTo3y: createPpmRatioPattern(this, 'utxos_2y_to_3y_old_nupl'), + _3yTo4y: createPpmRatioPattern(this, 'utxos_3y_to_4y_old_nupl'), + _4yTo5y: createPpmRatioPattern(this, 'utxos_4y_to_5y_old_nupl'), + _5yTo6y: createPpmRatioPattern(this, 'utxos_5y_to_6y_old_nupl'), + _6yTo7y: createPpmRatioPattern(this, 'utxos_6y_to_7y_old_nupl'), + _7yTo8y: createPpmRatioPattern(this, 'utxos_7y_to_8y_old_nupl'), + _8yTo10y: createPpmRatioPattern(this, 'utxos_8y_to_10y_old_nupl'), + _10yTo12y: createPpmRatioPattern(this, 'utxos_10y_to_12y_old_nupl'), + _12yTo15y: createPpmRatioPattern(this, 'utxos_12y_to_15y_old_nupl'), + over15y: createPpmRatioPattern(this, 'utxos_over_15y_old_nupl'), + }, + under: { + _1w: createPpmRatioPattern(this, 'utxos_under_1w_old_nupl'), + _1m: createPpmRatioPattern(this, 'utxos_under_1m_old_nupl'), + _2m: createPpmRatioPattern(this, 'utxos_under_2m_old_nupl'), + _3m: createPpmRatioPattern(this, 'utxos_under_3m_old_nupl'), + _4m: createPpmRatioPattern(this, 'utxos_under_4m_old_nupl'), + _5m: createPpmRatioPattern(this, 'utxos_under_5m_old_nupl'), + _6m: createPpmRatioPattern(this, 'utxos_under_6m_old_nupl'), + _9m: createPpmRatioPattern(this, 'utxos_under_9m_old_nupl'), + _1y: createPpmRatioPattern(this, 'utxos_under_1y_old_nupl'), + _18m: createPpmRatioPattern(this, 'utxos_under_18m_old_nupl'), + _2y: createPpmRatioPattern(this, 'utxos_under_2y_old_nupl'), + _3y: createPpmRatioPattern(this, 'utxos_under_3y_old_nupl'), + _4y: createPpmRatioPattern(this, 'utxos_under_4y_old_nupl'), + _5y: createPpmRatioPattern(this, 'utxos_under_5y_old_nupl'), + _6y: createPpmRatioPattern(this, 'utxos_under_6y_old_nupl'), + _7y: createPpmRatioPattern(this, 'utxos_under_7y_old_nupl'), + _8y: createPpmRatioPattern(this, 'utxos_under_8y_old_nupl'), + _10y: createPpmRatioPattern(this, 'utxos_under_10y_old_nupl'), + _12y: createPpmRatioPattern(this, 'utxos_under_12y_old_nupl'), + _15y: createPpmRatioPattern(this, 'utxos_under_15y_old_nupl'), + }, + over: { + _1d: createPpmRatioPattern(this, 'utxos_over_1d_old_nupl'), + _1w: createPpmRatioPattern(this, 'utxos_over_1w_old_nupl'), + _1m: createPpmRatioPattern(this, 'utxos_over_1m_old_nupl'), + _2m: createPpmRatioPattern(this, 'utxos_over_2m_old_nupl'), + _3m: createPpmRatioPattern(this, 'utxos_over_3m_old_nupl'), + _4m: createPpmRatioPattern(this, 'utxos_over_4m_old_nupl'), + _5m: createPpmRatioPattern(this, 'utxos_over_5m_old_nupl'), + _6m: createPpmRatioPattern(this, 'utxos_over_6m_old_nupl'), + _9m: createPpmRatioPattern(this, 'utxos_over_9m_old_nupl'), + _1y: createPpmRatioPattern(this, 'utxos_over_1y_old_nupl'), + _18m: createPpmRatioPattern(this, 'utxos_over_18m_old_nupl'), + _2y: createPpmRatioPattern(this, 'utxos_over_2y_old_nupl'), + _3y: createPpmRatioPattern(this, 'utxos_over_3y_old_nupl'), + _4y: createPpmRatioPattern(this, 'utxos_over_4y_old_nupl'), + _5y: createPpmRatioPattern(this, 'utxos_over_5y_old_nupl'), + _6y: createPpmRatioPattern(this, 'utxos_over_6y_old_nupl'), + _7y: createPpmRatioPattern(this, 'utxos_over_7y_old_nupl'), + _8y: createPpmRatioPattern(this, 'utxos_over_8y_old_nupl'), + _10y: createPpmRatioPattern(this, 'utxos_over_10y_old_nupl'), + _12y: createPpmRatioPattern(this, 'utxos_over_12y_old_nupl'), + }, + }, + epoch: { + _0: createPpmRatioPattern(this, 'epoch_0_nupl'), + _1: createPpmRatioPattern(this, 'epoch_1_nupl'), + _2: createPpmRatioPattern(this, 'epoch_2_nupl'), + _3: createPpmRatioPattern(this, 'epoch_3_nupl'), + _4: createPpmRatioPattern(this, 'epoch_4_nupl'), + }, + class: { + _2009: createPpmRatioPattern(this, 'class_2009_nupl'), + _2010: createPpmRatioPattern(this, 'class_2010_nupl'), + _2011: createPpmRatioPattern(this, 'class_2011_nupl'), + _2012: createPpmRatioPattern(this, 'class_2012_nupl'), + _2013: createPpmRatioPattern(this, 'class_2013_nupl'), + _2014: createPpmRatioPattern(this, 'class_2014_nupl'), + _2015: createPpmRatioPattern(this, 'class_2015_nupl'), + _2016: createPpmRatioPattern(this, 'class_2016_nupl'), + _2017: createPpmRatioPattern(this, 'class_2017_nupl'), + _2018: createPpmRatioPattern(this, 'class_2018_nupl'), + _2019: createPpmRatioPattern(this, 'class_2019_nupl'), + _2020: createPpmRatioPattern(this, 'class_2020_nupl'), + _2021: createPpmRatioPattern(this, 'class_2021_nupl'), + _2022: createPpmRatioPattern(this, 'class_2022_nupl'), + _2023: createPpmRatioPattern(this, 'class_2023_nupl'), + _2024: createPpmRatioPattern(this, 'class_2024_nupl'), + _2025: createPpmRatioPattern(this, 'class_2025_nupl'), + _2026: createPpmRatioPattern(this, 'class_2026_nupl'), + }, + entry: { + discount: createPpmRatioPattern(this, 'veteran_nupl'), + premium: createPpmRatioPattern(this, 'rookie_nupl'), + }, + utxoAmount: { + range: { + _0sats: createPpmRatioPattern(this, 'utxos_0sats_nupl'), + _1satTo10sats: createPpmRatioPattern(this, 'utxos_1sat_to_10sats_nupl'), + _10satsTo100sats: createPpmRatioPattern(this, 'utxos_10sats_to_100sats_nupl'), + _100satsTo1kSats: createPpmRatioPattern(this, 'utxos_100sats_to_1k_sats_nupl'), + _1kSatsTo10kSats: createPpmRatioPattern(this, 'utxos_1k_sats_to_10k_sats_nupl'), + _10kSatsTo100kSats: createPpmRatioPattern(this, 'utxos_10k_sats_to_100k_sats_nupl'), + _100kSatsTo1mSats: createPpmRatioPattern(this, 'utxos_100k_sats_to_1m_sats_nupl'), + _1mSatsTo10mSats: createPpmRatioPattern(this, 'utxos_1m_sats_to_10m_sats_nupl'), + _10mSatsTo1btc: createPpmRatioPattern(this, 'utxos_10m_sats_to_1btc_nupl'), + _1btcTo10btc: createPpmRatioPattern(this, 'utxos_1btc_to_10btc_nupl'), + _10btcTo100btc: createPpmRatioPattern(this, 'utxos_10btc_to_100btc_nupl'), + _100btcTo1kBtc: createPpmRatioPattern(this, 'utxos_100btc_to_1k_btc_nupl'), + _1kBtcTo10kBtc: createPpmRatioPattern(this, 'utxos_1k_btc_to_10k_btc_nupl'), + _10kBtcTo100kBtc: createPpmRatioPattern(this, 'utxos_10k_btc_to_100k_btc_nupl'), + over100kBtc: createPpmRatioPattern(this, 'utxos_over_100k_btc_nupl'), + }, + under: { + _10sats: createPpmRatioPattern(this, 'utxos_under_10sats_nupl'), + _100sats: createPpmRatioPattern(this, 'utxos_under_100sats_nupl'), + _1kSats: createPpmRatioPattern(this, 'utxos_under_1k_sats_nupl'), + _10kSats: createPpmRatioPattern(this, 'utxos_under_10k_sats_nupl'), + _100kSats: createPpmRatioPattern(this, 'utxos_under_100k_sats_nupl'), + _1mSats: createPpmRatioPattern(this, 'utxos_under_1m_sats_nupl'), + _10mSats: createPpmRatioPattern(this, 'utxos_under_10m_sats_nupl'), + _1btc: createPpmRatioPattern(this, 'utxos_under_1btc_nupl'), + _10btc: createPpmRatioPattern(this, 'utxos_under_10btc_nupl'), + _100btc: createPpmRatioPattern(this, 'utxos_under_100btc_nupl'), + _1kBtc: createPpmRatioPattern(this, 'utxos_under_1k_btc_nupl'), + _10kBtc: createPpmRatioPattern(this, 'utxos_under_10k_btc_nupl'), + _100kBtc: createPpmRatioPattern(this, 'utxos_under_100k_btc_nupl'), + }, + over: { + _1sat: createPpmRatioPattern(this, 'utxos_over_1sat_nupl'), + _10sats: createPpmRatioPattern(this, 'utxos_over_10sats_nupl'), + _100sats: createPpmRatioPattern(this, 'utxos_over_100sats_nupl'), + _1kSats: createPpmRatioPattern(this, 'utxos_over_1k_sats_nupl'), + _10kSats: createPpmRatioPattern(this, 'utxos_over_10k_sats_nupl'), + _100kSats: createPpmRatioPattern(this, 'utxos_over_100k_sats_nupl'), + _1mSats: createPpmRatioPattern(this, 'utxos_over_1m_sats_nupl'), + _10mSats: createPpmRatioPattern(this, 'utxos_over_10m_sats_nupl'), + _1btc: createPpmRatioPattern(this, 'utxos_over_1btc_nupl'), + _10btc: createPpmRatioPattern(this, 'utxos_over_10btc_nupl'), + _100btc: createPpmRatioPattern(this, 'utxos_over_100btc_nupl'), + _1kBtc: createPpmRatioPattern(this, 'utxos_over_1k_btc_nupl'), + _10kBtc: createPpmRatioPattern(this, 'utxos_over_10k_btc_nupl'), + }, + }, + term: { + short: createPpmRatioPattern(this, 'sth_nupl'), + long: createPpmRatioPattern(this, 'lth_nupl'), + }, + type: { + p2pk65: createPpmRatioPattern(this, 'p2pk65_nupl'), + p2pk33: createPpmRatioPattern(this, 'p2pk33_nupl'), + p2pkh: createPpmRatioPattern(this, 'p2pkh_nupl'), + p2ms: createPpmRatioPattern(this, 'p2ms_nupl'), + p2sh: createPpmRatioPattern(this, 'p2sh_nupl'), + p2wpkh: createPpmRatioPattern(this, 'p2wpkh_nupl'), + p2wsh: createPpmRatioPattern(this, 'p2wsh_nupl'), + p2tr: createPpmRatioPattern(this, 'p2tr_nupl'), + p2a: createPpmRatioPattern(this, 'p2a_nupl'), + unknown: createPpmRatioPattern(this, 'unknown_outputs_nupl'), + empty: createPpmRatioPattern(this, 'empty_outputs_nupl'), + }, + }, }, - cumulativeMaturedSats: createSeriesPattern18(this, 'utxos_age_range_matured_supply_cumulative_sats'), - cumulativeMaturedCents: createSeriesPattern18(this, 'utxos_age_range_matured_supply_cumulative_cents'), - }, - addr: { - overAmount: { - _1sat: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_1sat'), - _10sats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_10sats'), - _100sats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_100sats'), - _1kSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_1k_sats'), - _10kSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_10k_sats'), - _100kSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_100k_sats'), - _1mSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_1m_sats'), - _10mSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_10m_sats'), - _1btc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_1btc'), - _10btc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_10btc'), - _100btc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_100btc'), - _1kBtc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_1k_btc'), - _10kBtc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_10k_btc'), + costBasis: { + all: createInMaxMinPerSupplyPattern(this, 'all'), + sth: createInMaxMinPerSupplyPattern(this, 'sth'), + lth: createInMaxMinPerSupplyPattern(this, 'lth'), }, - amountRange: { - _0sats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_0sats'), - _1satTo10sats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_1sat_to_10sats'), - _10satsTo100sats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_10sats_to_100sats'), - _100satsTo1kSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_100sats_to_1k_sats'), - _1kSatsTo10kSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_1k_sats_to_10k_sats'), - _10kSatsTo100kSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_10k_sats_to_100k_sats'), - _100kSatsTo1mSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_100k_sats_to_1m_sats'), - _1mSatsTo10mSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_1m_sats_to_10m_sats'), - _10mSatsTo1btc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_10m_sats_to_1btc'), - _1btcTo10btc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_1btc_to_10btc'), - _10btcTo100btc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_10btc_to_100btc'), - _100btcTo1kBtc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_100btc_to_1k_btc'), - _1kBtcTo10kBtc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_1k_btc_to_10k_btc'), - _10kBtcTo100kBtc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_10k_btc_to_100k_btc'), - over100kBtc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_over_100k_btc'), + relative: { + supply: { + inProfit: createSharePattern2(this, 'supply_in_profit_share'), + inLoss: createSharePattern2(this, 'supply_in_loss_share'), + }, + unrealized: { + profit: { + toMcap: createAllLthSthPattern5(this, 'unrealized_profit_to_mcap'), + toOwnMcap: { + short: createPercentPpmRatioPattern2(this, 'sth_unrealized_profit_to_own_mcap'), + long: createPercentPpmRatioPattern2(this, 'lth_unrealized_profit_to_own_mcap'), + height: createSeriesPattern18(this, 'unrealized_profit_to_own_mcap_ppm_by_term'), + }, + toOwnGrossPnl: createAllLthSthPattern5(this, 'unrealized_profit_to_own_gross_pnl'), + }, + loss: { + toMcap: createAllLthSthPattern5(this, 'unrealized_loss_to_mcap'), + toOwnMcap: { + short: createPercentPpmRatioPattern2(this, 'sth_unrealized_loss_to_own_mcap'), + long: createPercentPpmRatioPattern2(this, 'lth_unrealized_loss_to_own_mcap'), + height: createSeriesPattern18(this, 'unrealized_loss_to_own_mcap_ppm_by_term'), + }, + toOwnGrossPnl: createAllLthSthPattern5(this, 'unrealized_loss_to_own_gross_pnl'), + }, + netPnl: { + toOwnMcap: { + short: createPercentPpmRatioPattern3(this, 'sth_net_unrealized_pnl_to_own_mcap'), + long: createPercentPpmRatioPattern3(this, 'lth_net_unrealized_pnl_to_own_mcap'), + }, + toOwnGrossPnl: { + all: createPercentPpmRatioPattern3(this, 'all_net_unrealized_pnl_to_own_gross_pnl'), + sth: createPercentPpmRatioPattern3(this, 'sth_net_unrealized_pnl_to_own_gross_pnl'), + lth: createPercentPpmRatioPattern3(this, 'lth_net_unrealized_pnl_to_own_gross_pnl'), + }, + }, + }, + investedCapital: { + inProfit: { + share: { + all: createPercentPpmRatioPattern2(this, 'all_invested_capital_in_profit_share'), + sth: createPercentPpmRatioPattern2(this, 'sth_invested_capital_in_profit_share'), + lth: createPercentPpmRatioPattern2(this, 'lth_invested_capital_in_profit_share'), + height: createSeriesPattern18(this, 'invested_capital_in_profit_share_ppm_by_aggregate'), + }, + }, + inLoss: { + share: { + all: createPercentPpmRatioPattern2(this, 'all_invested_capital_in_loss_share'), + sth: createPercentPpmRatioPattern2(this, 'sth_invested_capital_in_loss_share'), + lth: createPercentPpmRatioPattern2(this, 'lth_invested_capital_in_loss_share'), + height: createSeriesPattern18(this, 'invested_capital_in_loss_share_ppm_by_aggregate'), + }, + }, + }, }, - underAmount: { - _10sats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_10sats'), - _100sats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_100sats'), - _1kSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_1k_sats'), - _10kSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_10k_sats'), - _100kSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_100k_sats'), - _1mSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_1m_sats'), - _10mSats: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_10m_sats'), - _1btc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_1btc'), - _10btc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_10btc'), - _100btc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_100btc'), - _1kBtc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_1k_btc'), - _10kBtc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_10k_btc'), - _100kBtc: createActivityAddrOutputsRealizedSupplyPattern(this, 'addrs_under_100k_btc'), + profitability: { + supply: { + range: { + over1000pctInProfit: createAllLthSthPattern4(this, 'utxos_over_1000pct_in_profit'), + _500pctTo1000pctInProfit: createAllLthSthPattern4(this, 'utxos_500pct_to_1000pct_in_profit'), + _300pctTo500pctInProfit: createAllLthSthPattern4(this, 'utxos_300pct_to_500pct_in_profit'), + _200pctTo300pctInProfit: createAllLthSthPattern4(this, 'utxos_200pct_to_300pct_in_profit'), + _100pctTo200pctInProfit: createAllLthSthPattern4(this, 'utxos_100pct_to_200pct_in_profit'), + _90pctTo100pctInProfit: createAllLthSthPattern4(this, 'utxos_90pct_to_100pct_in_profit'), + _80pctTo90pctInProfit: createAllLthSthPattern4(this, 'utxos_80pct_to_90pct_in_profit'), + _70pctTo80pctInProfit: createAllLthSthPattern4(this, 'utxos_70pct_to_80pct_in_profit'), + _60pctTo70pctInProfit: createAllLthSthPattern4(this, 'utxos_60pct_to_70pct_in_profit'), + _50pctTo60pctInProfit: createAllLthSthPattern4(this, 'utxos_50pct_to_60pct_in_profit'), + _40pctTo50pctInProfit: createAllLthSthPattern4(this, 'utxos_40pct_to_50pct_in_profit'), + _30pctTo40pctInProfit: createAllLthSthPattern4(this, 'utxos_30pct_to_40pct_in_profit'), + _20pctTo30pctInProfit: createAllLthSthPattern4(this, 'utxos_20pct_to_30pct_in_profit'), + _10pctTo20pctInProfit: createAllLthSthPattern4(this, 'utxos_10pct_to_20pct_in_profit'), + _0pctTo10pctInProfit: createAllLthSthPattern4(this, 'utxos_0pct_to_10pct_in_profit'), + _0pctTo10pctInLoss: createAllLthSthPattern4(this, 'utxos_0pct_to_10pct_in_loss'), + _10pctTo20pctInLoss: createAllLthSthPattern4(this, 'utxos_10pct_to_20pct_in_loss'), + _20pctTo30pctInLoss: createAllLthSthPattern4(this, 'utxos_20pct_to_30pct_in_loss'), + _30pctTo40pctInLoss: createAllLthSthPattern4(this, 'utxos_30pct_to_40pct_in_loss'), + _40pctTo50pctInLoss: createAllLthSthPattern4(this, 'utxos_40pct_to_50pct_in_loss'), + _50pctTo60pctInLoss: createAllLthSthPattern4(this, 'utxos_50pct_to_60pct_in_loss'), + _60pctTo70pctInLoss: createAllLthSthPattern4(this, 'utxos_60pct_to_70pct_in_loss'), + _70pctTo80pctInLoss: createAllLthSthPattern4(this, 'utxos_70pct_to_80pct_in_loss'), + _80pctTo90pctInLoss: createAllLthSthPattern4(this, 'utxos_80pct_to_90pct_in_loss'), + _90pctTo100pctInLoss: createAllLthSthPattern4(this, 'utxos_90pct_to_100pct_in_loss'), + }, + profit: { + all: createAllLthSthPattern4(this, 'utxos_in_profit'), + _10pct: createAllLthSthPattern4(this, 'utxos_over_10pct_in_profit'), + _20pct: createAllLthSthPattern4(this, 'utxos_over_20pct_in_profit'), + _30pct: createAllLthSthPattern4(this, 'utxos_over_30pct_in_profit'), + _40pct: createAllLthSthPattern4(this, 'utxos_over_40pct_in_profit'), + _50pct: createAllLthSthPattern4(this, 'utxos_over_50pct_in_profit'), + _60pct: createAllLthSthPattern4(this, 'utxos_over_60pct_in_profit'), + _70pct: createAllLthSthPattern4(this, 'utxos_over_70pct_in_profit'), + _80pct: createAllLthSthPattern4(this, 'utxos_over_80pct_in_profit'), + _90pct: createAllLthSthPattern4(this, 'utxos_over_90pct_in_profit'), + _100pct: createAllLthSthPattern4(this, 'utxos_over_100pct_in_profit'), + _200pct: createAllLthSthPattern4(this, 'utxos_over_200pct_in_profit'), + _300pct: createAllLthSthPattern4(this, 'utxos_over_300pct_in_profit'), + _500pct: createAllLthSthPattern4(this, 'utxos_over_500pct_in_profit'), + }, + loss: { + all: createAllLthSthPattern4(this, 'utxos_in_loss'), + _10pct: createAllLthSthPattern4(this, 'utxos_over_10pct_in_loss'), + _20pct: createAllLthSthPattern4(this, 'utxos_over_20pct_in_loss'), + _30pct: createAllLthSthPattern4(this, 'utxos_over_30pct_in_loss'), + _40pct: createAllLthSthPattern4(this, 'utxos_over_40pct_in_loss'), + _50pct: createAllLthSthPattern4(this, 'utxos_over_50pct_in_loss'), + _60pct: createAllLthSthPattern4(this, 'utxos_over_60pct_in_loss'), + _70pct: createAllLthSthPattern4(this, 'utxos_over_70pct_in_loss'), + _80pct: createAllLthSthPattern4(this, 'utxos_over_80pct_in_loss'), + }, + height: createSeriesPattern18(this, 'profitability_supply_sats_by_term_and_range'), + }, + realizedCap: { + range: { + over1000pctInProfit: { + all: createSeriesPattern1(this, 'utxos_over_1000pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_1000pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_1000pct_in_profit_lth_realized_cap'), + }, + _500pctTo1000pctInProfit: { + all: createSeriesPattern1(this, 'utxos_500pct_to_1000pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_500pct_to_1000pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_500pct_to_1000pct_in_profit_lth_realized_cap'), + }, + _300pctTo500pctInProfit: { + all: createSeriesPattern1(this, 'utxos_300pct_to_500pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_300pct_to_500pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_300pct_to_500pct_in_profit_lth_realized_cap'), + }, + _200pctTo300pctInProfit: { + all: createSeriesPattern1(this, 'utxos_200pct_to_300pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_200pct_to_300pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_200pct_to_300pct_in_profit_lth_realized_cap'), + }, + _100pctTo200pctInProfit: { + all: createSeriesPattern1(this, 'utxos_100pct_to_200pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_100pct_to_200pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_100pct_to_200pct_in_profit_lth_realized_cap'), + }, + _90pctTo100pctInProfit: { + all: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_profit_lth_realized_cap'), + }, + _80pctTo90pctInProfit: { + all: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_profit_lth_realized_cap'), + }, + _70pctTo80pctInProfit: { + all: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_profit_lth_realized_cap'), + }, + _60pctTo70pctInProfit: { + all: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_profit_lth_realized_cap'), + }, + _50pctTo60pctInProfit: { + all: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_profit_lth_realized_cap'), + }, + _40pctTo50pctInProfit: { + all: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_profit_lth_realized_cap'), + }, + _30pctTo40pctInProfit: { + all: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_profit_lth_realized_cap'), + }, + _20pctTo30pctInProfit: { + all: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_profit_lth_realized_cap'), + }, + _10pctTo20pctInProfit: { + all: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_profit_lth_realized_cap'), + }, + _0pctTo10pctInProfit: { + all: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_profit_lth_realized_cap'), + }, + _0pctTo10pctInLoss: { + all: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_loss_lth_realized_cap'), + }, + _10pctTo20pctInLoss: { + all: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_loss_lth_realized_cap'), + }, + _20pctTo30pctInLoss: { + all: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_loss_lth_realized_cap'), + }, + _30pctTo40pctInLoss: { + all: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_loss_lth_realized_cap'), + }, + _40pctTo50pctInLoss: { + all: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_loss_lth_realized_cap'), + }, + _50pctTo60pctInLoss: { + all: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_loss_lth_realized_cap'), + }, + _60pctTo70pctInLoss: { + all: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_loss_lth_realized_cap'), + }, + _70pctTo80pctInLoss: { + all: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_loss_lth_realized_cap'), + }, + _80pctTo90pctInLoss: { + all: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_loss_lth_realized_cap'), + }, + _90pctTo100pctInLoss: { + all: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_loss_lth_realized_cap'), + }, + }, + profit: { + all: { + all: createSeriesPattern1(this, 'utxos_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_in_profit_lth_realized_cap'), + }, + _10pct: { + all: createSeriesPattern1(this, 'utxos_over_10pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_10pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_10pct_in_profit_lth_realized_cap'), + }, + _20pct: { + all: createSeriesPattern1(this, 'utxos_over_20pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_20pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_20pct_in_profit_lth_realized_cap'), + }, + _30pct: { + all: createSeriesPattern1(this, 'utxos_over_30pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_30pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_30pct_in_profit_lth_realized_cap'), + }, + _40pct: { + all: createSeriesPattern1(this, 'utxos_over_40pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_40pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_40pct_in_profit_lth_realized_cap'), + }, + _50pct: { + all: createSeriesPattern1(this, 'utxos_over_50pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_50pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_50pct_in_profit_lth_realized_cap'), + }, + _60pct: { + all: createSeriesPattern1(this, 'utxos_over_60pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_60pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_60pct_in_profit_lth_realized_cap'), + }, + _70pct: { + all: createSeriesPattern1(this, 'utxos_over_70pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_70pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_70pct_in_profit_lth_realized_cap'), + }, + _80pct: { + all: createSeriesPattern1(this, 'utxos_over_80pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_80pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_80pct_in_profit_lth_realized_cap'), + }, + _90pct: { + all: createSeriesPattern1(this, 'utxos_over_90pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_90pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_90pct_in_profit_lth_realized_cap'), + }, + _100pct: { + all: createSeriesPattern1(this, 'utxos_over_100pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_100pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_100pct_in_profit_lth_realized_cap'), + }, + _200pct: { + all: createSeriesPattern1(this, 'utxos_over_200pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_200pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_200pct_in_profit_lth_realized_cap'), + }, + _300pct: { + all: createSeriesPattern1(this, 'utxos_over_300pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_300pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_300pct_in_profit_lth_realized_cap'), + }, + _500pct: { + all: createSeriesPattern1(this, 'utxos_over_500pct_in_profit_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_500pct_in_profit_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_500pct_in_profit_lth_realized_cap'), + }, + }, + loss: { + all: { + all: createSeriesPattern1(this, 'utxos_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_in_loss_lth_realized_cap'), + }, + _10pct: { + all: createSeriesPattern1(this, 'utxos_over_10pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_10pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_10pct_in_loss_lth_realized_cap'), + }, + _20pct: { + all: createSeriesPattern1(this, 'utxos_over_20pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_20pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_20pct_in_loss_lth_realized_cap'), + }, + _30pct: { + all: createSeriesPattern1(this, 'utxos_over_30pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_30pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_30pct_in_loss_lth_realized_cap'), + }, + _40pct: { + all: createSeriesPattern1(this, 'utxos_over_40pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_40pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_40pct_in_loss_lth_realized_cap'), + }, + _50pct: { + all: createSeriesPattern1(this, 'utxos_over_50pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_50pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_50pct_in_loss_lth_realized_cap'), + }, + _60pct: { + all: createSeriesPattern1(this, 'utxos_over_60pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_60pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_60pct_in_loss_lth_realized_cap'), + }, + _70pct: { + all: createSeriesPattern1(this, 'utxos_over_70pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_70pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_70pct_in_loss_lth_realized_cap'), + }, + _80pct: { + all: createSeriesPattern1(this, 'utxos_over_80pct_in_loss_realized_cap'), + sth: createSeriesPattern1(this, 'utxos_over_80pct_in_loss_sth_realized_cap'), + lth: createSeriesPattern1(this, 'utxos_over_80pct_in_loss_lth_realized_cap'), + }, + }, + height: createSeriesPattern18(this, 'profitability_realized_cap_by_term_and_range'), + }, + unrealizedPnl: { + range: { + over1000pctInProfit: { + all: createSeriesPattern1(this, 'utxos_over_1000pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_1000pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_1000pct_in_profit_lth_unrealized_pnl'), + }, + _500pctTo1000pctInProfit: { + all: createSeriesPattern1(this, 'utxos_500pct_to_1000pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_500pct_to_1000pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_500pct_to_1000pct_in_profit_lth_unrealized_pnl'), + }, + _300pctTo500pctInProfit: { + all: createSeriesPattern1(this, 'utxos_300pct_to_500pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_300pct_to_500pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_300pct_to_500pct_in_profit_lth_unrealized_pnl'), + }, + _200pctTo300pctInProfit: { + all: createSeriesPattern1(this, 'utxos_200pct_to_300pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_200pct_to_300pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_200pct_to_300pct_in_profit_lth_unrealized_pnl'), + }, + _100pctTo200pctInProfit: { + all: createSeriesPattern1(this, 'utxos_100pct_to_200pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_100pct_to_200pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_100pct_to_200pct_in_profit_lth_unrealized_pnl'), + }, + _90pctTo100pctInProfit: { + all: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_profit_lth_unrealized_pnl'), + }, + _80pctTo90pctInProfit: { + all: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_profit_lth_unrealized_pnl'), + }, + _70pctTo80pctInProfit: { + all: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_profit_lth_unrealized_pnl'), + }, + _60pctTo70pctInProfit: { + all: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_profit_lth_unrealized_pnl'), + }, + _50pctTo60pctInProfit: { + all: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_profit_lth_unrealized_pnl'), + }, + _40pctTo50pctInProfit: { + all: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_profit_lth_unrealized_pnl'), + }, + _30pctTo40pctInProfit: { + all: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_profit_lth_unrealized_pnl'), + }, + _20pctTo30pctInProfit: { + all: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_profit_lth_unrealized_pnl'), + }, + _10pctTo20pctInProfit: { + all: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_profit_lth_unrealized_pnl'), + }, + _0pctTo10pctInProfit: { + all: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_profit_lth_unrealized_pnl'), + }, + _0pctTo10pctInLoss: { + all: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_0pct_to_10pct_in_loss_lth_unrealized_pnl'), + }, + _10pctTo20pctInLoss: { + all: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_10pct_to_20pct_in_loss_lth_unrealized_pnl'), + }, + _20pctTo30pctInLoss: { + all: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_20pct_to_30pct_in_loss_lth_unrealized_pnl'), + }, + _30pctTo40pctInLoss: { + all: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_30pct_to_40pct_in_loss_lth_unrealized_pnl'), + }, + _40pctTo50pctInLoss: { + all: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_40pct_to_50pct_in_loss_lth_unrealized_pnl'), + }, + _50pctTo60pctInLoss: { + all: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_50pct_to_60pct_in_loss_lth_unrealized_pnl'), + }, + _60pctTo70pctInLoss: { + all: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_60pct_to_70pct_in_loss_lth_unrealized_pnl'), + }, + _70pctTo80pctInLoss: { + all: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_70pct_to_80pct_in_loss_lth_unrealized_pnl'), + }, + _80pctTo90pctInLoss: { + all: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_80pct_to_90pct_in_loss_lth_unrealized_pnl'), + }, + _90pctTo100pctInLoss: { + all: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_90pct_to_100pct_in_loss_lth_unrealized_pnl'), + }, + }, + profit: { + all: { + all: createSeriesPattern1(this, 'utxos_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_in_profit_lth_unrealized_pnl'), + }, + _10pct: { + all: createSeriesPattern1(this, 'utxos_over_10pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_10pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_10pct_in_profit_lth_unrealized_pnl'), + }, + _20pct: { + all: createSeriesPattern1(this, 'utxos_over_20pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_20pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_20pct_in_profit_lth_unrealized_pnl'), + }, + _30pct: { + all: createSeriesPattern1(this, 'utxos_over_30pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_30pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_30pct_in_profit_lth_unrealized_pnl'), + }, + _40pct: { + all: createSeriesPattern1(this, 'utxos_over_40pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_40pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_40pct_in_profit_lth_unrealized_pnl'), + }, + _50pct: { + all: createSeriesPattern1(this, 'utxos_over_50pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_50pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_50pct_in_profit_lth_unrealized_pnl'), + }, + _60pct: { + all: createSeriesPattern1(this, 'utxos_over_60pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_60pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_60pct_in_profit_lth_unrealized_pnl'), + }, + _70pct: { + all: createSeriesPattern1(this, 'utxos_over_70pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_70pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_70pct_in_profit_lth_unrealized_pnl'), + }, + _80pct: { + all: createSeriesPattern1(this, 'utxos_over_80pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_80pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_80pct_in_profit_lth_unrealized_pnl'), + }, + _90pct: { + all: createSeriesPattern1(this, 'utxos_over_90pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_90pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_90pct_in_profit_lth_unrealized_pnl'), + }, + _100pct: { + all: createSeriesPattern1(this, 'utxos_over_100pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_100pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_100pct_in_profit_lth_unrealized_pnl'), + }, + _200pct: { + all: createSeriesPattern1(this, 'utxos_over_200pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_200pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_200pct_in_profit_lth_unrealized_pnl'), + }, + _300pct: { + all: createSeriesPattern1(this, 'utxos_over_300pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_300pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_300pct_in_profit_lth_unrealized_pnl'), + }, + _500pct: { + all: createSeriesPattern1(this, 'utxos_over_500pct_in_profit_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_500pct_in_profit_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_500pct_in_profit_lth_unrealized_pnl'), + }, + }, + loss: { + all: { + all: createSeriesPattern1(this, 'utxos_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_in_loss_lth_unrealized_pnl'), + }, + _10pct: { + all: createSeriesPattern1(this, 'utxos_over_10pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_10pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_10pct_in_loss_lth_unrealized_pnl'), + }, + _20pct: { + all: createSeriesPattern1(this, 'utxos_over_20pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_20pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_20pct_in_loss_lth_unrealized_pnl'), + }, + _30pct: { + all: createSeriesPattern1(this, 'utxos_over_30pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_30pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_30pct_in_loss_lth_unrealized_pnl'), + }, + _40pct: { + all: createSeriesPattern1(this, 'utxos_over_40pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_40pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_40pct_in_loss_lth_unrealized_pnl'), + }, + _50pct: { + all: createSeriesPattern1(this, 'utxos_over_50pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_50pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_50pct_in_loss_lth_unrealized_pnl'), + }, + _60pct: { + all: createSeriesPattern1(this, 'utxos_over_60pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_60pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_60pct_in_loss_lth_unrealized_pnl'), + }, + _70pct: { + all: createSeriesPattern1(this, 'utxos_over_70pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_70pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_70pct_in_loss_lth_unrealized_pnl'), + }, + _80pct: { + all: createSeriesPattern1(this, 'utxos_over_80pct_in_loss_unrealized_pnl'), + sth: createSeriesPattern1(this, 'utxos_over_80pct_in_loss_sth_unrealized_pnl'), + lth: createSeriesPattern1(this, 'utxos_over_80pct_in_loss_lth_unrealized_pnl'), + }, + }, + height: createSeriesPattern18(this, 'profitability_unrealized_pnl_by_term_and_range'), + }, + nupl: { + range: { + over1000pctInProfit: createPpmRatioPattern(this, 'utxos_over_1000pct_in_profit_nupl'), + _500pctTo1000pctInProfit: createPpmRatioPattern(this, 'utxos_500pct_to_1000pct_in_profit_nupl'), + _300pctTo500pctInProfit: createPpmRatioPattern(this, 'utxos_300pct_to_500pct_in_profit_nupl'), + _200pctTo300pctInProfit: createPpmRatioPattern(this, 'utxos_200pct_to_300pct_in_profit_nupl'), + _100pctTo200pctInProfit: createPpmRatioPattern(this, 'utxos_100pct_to_200pct_in_profit_nupl'), + _90pctTo100pctInProfit: createPpmRatioPattern(this, 'utxos_90pct_to_100pct_in_profit_nupl'), + _80pctTo90pctInProfit: createPpmRatioPattern(this, 'utxos_80pct_to_90pct_in_profit_nupl'), + _70pctTo80pctInProfit: createPpmRatioPattern(this, 'utxos_70pct_to_80pct_in_profit_nupl'), + _60pctTo70pctInProfit: createPpmRatioPattern(this, 'utxos_60pct_to_70pct_in_profit_nupl'), + _50pctTo60pctInProfit: createPpmRatioPattern(this, 'utxos_50pct_to_60pct_in_profit_nupl'), + _40pctTo50pctInProfit: createPpmRatioPattern(this, 'utxos_40pct_to_50pct_in_profit_nupl'), + _30pctTo40pctInProfit: createPpmRatioPattern(this, 'utxos_30pct_to_40pct_in_profit_nupl'), + _20pctTo30pctInProfit: createPpmRatioPattern(this, 'utxos_20pct_to_30pct_in_profit_nupl'), + _10pctTo20pctInProfit: createPpmRatioPattern(this, 'utxos_10pct_to_20pct_in_profit_nupl'), + _0pctTo10pctInProfit: createPpmRatioPattern(this, 'utxos_0pct_to_10pct_in_profit_nupl'), + _0pctTo10pctInLoss: createPpmRatioPattern(this, 'utxos_0pct_to_10pct_in_loss_nupl'), + _10pctTo20pctInLoss: createPpmRatioPattern(this, 'utxos_10pct_to_20pct_in_loss_nupl'), + _20pctTo30pctInLoss: createPpmRatioPattern(this, 'utxos_20pct_to_30pct_in_loss_nupl'), + _30pctTo40pctInLoss: createPpmRatioPattern(this, 'utxos_30pct_to_40pct_in_loss_nupl'), + _40pctTo50pctInLoss: createPpmRatioPattern(this, 'utxos_40pct_to_50pct_in_loss_nupl'), + _50pctTo60pctInLoss: createPpmRatioPattern(this, 'utxos_50pct_to_60pct_in_loss_nupl'), + _60pctTo70pctInLoss: createPpmRatioPattern(this, 'utxos_60pct_to_70pct_in_loss_nupl'), + _70pctTo80pctInLoss: createPpmRatioPattern(this, 'utxos_70pct_to_80pct_in_loss_nupl'), + _80pctTo90pctInLoss: createPpmRatioPattern(this, 'utxos_80pct_to_90pct_in_loss_nupl'), + _90pctTo100pctInLoss: createPpmRatioPattern(this, 'utxos_90pct_to_100pct_in_loss_nupl'), + }, + profit: { + all: createPpmRatioPattern(this, 'utxos_in_profit_nupl'), + _10pct: createPpmRatioPattern(this, 'utxos_over_10pct_in_profit_nupl'), + _20pct: createPpmRatioPattern(this, 'utxos_over_20pct_in_profit_nupl'), + _30pct: createPpmRatioPattern(this, 'utxos_over_30pct_in_profit_nupl'), + _40pct: createPpmRatioPattern(this, 'utxos_over_40pct_in_profit_nupl'), + _50pct: createPpmRatioPattern(this, 'utxos_over_50pct_in_profit_nupl'), + _60pct: createPpmRatioPattern(this, 'utxos_over_60pct_in_profit_nupl'), + _70pct: createPpmRatioPattern(this, 'utxos_over_70pct_in_profit_nupl'), + _80pct: createPpmRatioPattern(this, 'utxos_over_80pct_in_profit_nupl'), + _90pct: createPpmRatioPattern(this, 'utxos_over_90pct_in_profit_nupl'), + _100pct: createPpmRatioPattern(this, 'utxos_over_100pct_in_profit_nupl'), + _200pct: createPpmRatioPattern(this, 'utxos_over_200pct_in_profit_nupl'), + _300pct: createPpmRatioPattern(this, 'utxos_over_300pct_in_profit_nupl'), + _500pct: createPpmRatioPattern(this, 'utxos_over_500pct_in_profit_nupl'), + }, + loss: { + all: createPpmRatioPattern(this, 'utxos_in_loss_nupl'), + _10pct: createPpmRatioPattern(this, 'utxos_over_10pct_in_loss_nupl'), + _20pct: createPpmRatioPattern(this, 'utxos_over_20pct_in_loss_nupl'), + _30pct: createPpmRatioPattern(this, 'utxos_over_30pct_in_loss_nupl'), + _40pct: createPpmRatioPattern(this, 'utxos_over_40pct_in_loss_nupl'), + _50pct: createPpmRatioPattern(this, 'utxos_over_50pct_in_loss_nupl'), + _60pct: createPpmRatioPattern(this, 'utxos_over_60pct_in_loss_nupl'), + _70pct: createPpmRatioPattern(this, 'utxos_over_70pct_in_loss_nupl'), + _80pct: createPpmRatioPattern(this, 'utxos_over_80pct_in_loss_nupl'), + }, + height: createSeriesPattern18(this, 'profitability_nupl_ppm'), + }, }, }, }, diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index b242d2bfd..4ec573306 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -171,6 +171,11 @@ Hour4 = int Index = Literal["minute10", "minute30", "hour1", "hour4", "hour12", "day1", "day3", "week1", "month1", "month3", "month6", "year1", "year10", "halving", "epoch", "height", "tx_index", "txin_index", "txout_index", "empty_output_index", "op_return_index", "p2a_addr_index", "p2ms_output_index", "p2pk33_addr_index", "p2pk65_addr_index", "p2pkh_addr_index", "p2sh_addr_index", "p2tr_addr_index", "p2wpkh_addr_index", "p2wsh_addr_index", "unknown_output_index", "funded_addr_index", "empty_addr_index"] # Series name SeriesName = str +# Signed parts per million stored as i32. +# One unit is 0.000001. Range: -2,147.483647 to +2,147.483647. +# Use for precise bounded signed ratios and percentages. +# `i32::MIN` is reserved as a NaN sentinel. +PartsPerMillionSigned32 = int # Lowest price value for a time period Low = Dollars Minute10 = int @@ -215,11 +220,6 @@ PartsPerMillion32 = int # Use for precise wide-range ratios. # `u64::MAX` is reserved as a NaN sentinel. PartsPerMillion64 = int -# Signed parts per million stored as i32. -# One unit is 0.000001. Range: -2,147.483647 to +2,147.483647. -# Use for precise bounded signed ratios and percentages. -# `i32::MIN` is reserved as a NaN sentinel. -PartsPerMillionSigned32 = int # Signed parts per million stored as i64. # One unit is 0.000001. Range: -9,223,372,036,854.775807 to +9,223,372,036,854.775807. # Use for precise wide-range signed ratios and percentages. @@ -280,7 +280,6 @@ Year10 = int [Bytes; 4] = List[Bytes] [Cents; 16] = List[Cents] [Cents; 19] = List[Cents] -[Cents; 23] = List[Cents] [Dollars; 3] = List[Dollars] [PartsPerMillion32; 19] = List[PartsPerMillion32] [PartsPerMillion32; 4] = List[PartsPerMillion32] @@ -289,12 +288,9 @@ Year10 = int [Sats; 8] = List[Sats] [StoredF32; 3] = List[StoredF32] [StoredF32; 4] = List[StoredF32] -[StoredF64; 23] = List[StoredF64] [StoredF64; 3] = List[StoredF64] [StoredF64; 4] = List[StoredF64] -[StoredU16; 11] = List[StoredU16] [StoredU16; 12] = List[StoredU16] -[StoredU64; 11] = List[StoredU64] [StoredU64; 12] = List[StoredU64] [StoredU64; 23] = List[StoredU64] [StoredU64; 4] = List[StoredU64] @@ -1254,6 +1250,22 @@ class LegacySeriesWithIndex(TypedDict): metric: SeriesName index: Index +class Loss(TypedDict): + """ + 9 "at least X% loss" aggregate thresholds. + + Each is a suffix sum over the profitability ranges, from most loss-making up. + """ + all: PartsPerMillionSigned32 + _10pct: PartsPerMillionSigned32 + _20pct: PartsPerMillionSigned32 + _30pct: PartsPerMillionSigned32 + _40pct: PartsPerMillionSigned32 + _50pct: PartsPerMillionSigned32 + _60pct: PartsPerMillionSigned32 + _70pct: PartsPerMillionSigned32 + _80pct: PartsPerMillionSigned32 + class MempoolInfo(TypedDict): """ Mempool statistics with incrementally maintained fee histogram. @@ -1526,6 +1538,68 @@ class Prices(TypedDict): time: Timestamp USD: Dollars +class Profit(TypedDict): + """ + 14 "at least X% profit" aggregate thresholds. + + Each is a prefix sum over the profitability ranges, from most profitable down. + """ + all: PartsPerMillionSigned32 + _10pct: PartsPerMillionSigned32 + _20pct: PartsPerMillionSigned32 + _30pct: PartsPerMillionSigned32 + _40pct: PartsPerMillionSigned32 + _50pct: PartsPerMillionSigned32 + _60pct: PartsPerMillionSigned32 + _70pct: PartsPerMillionSigned32 + _80pct: PartsPerMillionSigned32 + _90pct: PartsPerMillionSigned32 + _100pct: PartsPerMillionSigned32 + _200pct: PartsPerMillionSigned32 + _300pct: PartsPerMillionSigned32 + _500pct: PartsPerMillionSigned32 + +class ProfitabilityRange(TypedDict): + """ + 25 profitability range buckets ordered from most profitable to most in loss. + + During the k-way merge (ascending price order), the cursor starts at bucket 0 + (over_1000pct_in_profit, lowest cost basis) and advances as price crosses each boundary. + """ + over_1000pct_in_profit: Sats + _500pct_to_1000pct_in_profit: Sats + _300pct_to_500pct_in_profit: Sats + _200pct_to_300pct_in_profit: Sats + _100pct_to_200pct_in_profit: Sats + _90pct_to_100pct_in_profit: Sats + _80pct_to_90pct_in_profit: Sats + _70pct_to_80pct_in_profit: Sats + _60pct_to_70pct_in_profit: Sats + _50pct_to_60pct_in_profit: Sats + _40pct_to_50pct_in_profit: Sats + _30pct_to_40pct_in_profit: Sats + _20pct_to_30pct_in_profit: Sats + _10pct_to_20pct_in_profit: Sats + _0pct_to_10pct_in_profit: Sats + _0pct_to_10pct_in_loss: Sats + _10pct_to_20pct_in_loss: Sats + _20pct_to_30pct_in_loss: Sats + _30pct_to_40pct_in_loss: Sats + _40pct_to_50pct_in_loss: Sats + _50pct_to_60pct_in_loss: Sats + _60pct_to_70pct_in_loss: Sats + _70pct_to_80pct_in_loss: Sats + _80pct_to_90pct_in_loss: Sats + _90pct_to_100pct_in_loss: Sats + +class ProfitabilityRange(TypedDict): + short: ProfitabilityRange + long: ProfitabilityRange + +class ProfitabilityRange(TypedDict): + short: ProfitabilityRange + long: ProfitabilityRange + class RbfTx(TypedDict): """ Transaction summary carried inside an RBF replacement node. Shape @@ -3060,6 +3134,10 @@ class SeriesPattern35(Generic[T]): # Reusable structural pattern classes +class _0pct100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctOverPattern2: + """Pattern struct for repeated tree structure.""" + pass + class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mCumulativeOverUnderPattern: """Pattern struct for repeated tree structure.""" pass @@ -3068,11 +3146,60 @@ class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mHeightOverUnderPattern2: """Pattern struct for repeated tree structure.""" pass +class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mHeightOverUnderPattern: + """Pattern struct for repeated tree structure.""" + pass + class AscribeBareBitproofBlockstackCoinColuCumulativeDocproofEmptyEpobcEternityFactomKomodoMemoOmniOpenPoetRunesStacksStamperyTextUnknownVeriPattern3(Generic[T]): """Pattern struct for repeated tree structure.""" pass -class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern3: +class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str, disc: str): + """Create pattern node with accumulated series name.""" + self._10y_to_12y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'10y_to_12y_old_transfer_volume{disc}')) + self._12y_to_15y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'12y_to_15y_old_transfer_volume{disc}')) + self._18m_to_2y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'18m_to_2y_old_transfer_volume{disc}')) + self._1d_to_1w: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1d_to_1w_old_transfer_volume{disc}')) + self._1h_to_1d: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1h_to_1d_old_transfer_volume{disc}')) + self._1m_to_2m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1m_to_2m_old_transfer_volume{disc}')) + self._1w_to_1m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1w_to_1m_old_transfer_volume{disc}')) + self._1y_to_18m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1y_to_18m_old_transfer_volume{disc}')) + self._2m_to_3m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2m_to_3m_old_transfer_volume{disc}')) + self._2y_to_3y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2y_to_3y_old_transfer_volume{disc}')) + self._3m_to_4m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'3m_to_4m_old_transfer_volume{disc}')) + self._3y_to_4y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'3y_to_4y_old_transfer_volume{disc}')) + self._4m_to_5m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'4m_to_5m_old_transfer_volume{disc}')) + self._4y_to_5y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'4y_to_5y_old_transfer_volume{disc}')) + self._5m_to_6m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'5m_to_6m_old_transfer_volume{disc}')) + self._5y_to_6y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'5y_to_6y_old_transfer_volume{disc}')) + self._6m_to_9m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'6m_to_9m_old_transfer_volume{disc}')) + self._6y_to_7y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'6y_to_7y_old_transfer_volume{disc}')) + self._7y_to_8y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'7y_to_8y_old_transfer_volume{disc}')) + self._8y_to_10y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'8y_to_10y_old_transfer_volume{disc}')) + self._9m_to_1y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'9m_to_1y_old_transfer_volume{disc}')) + self.over_15y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'over_15y_old_transfer_volume{disc}')) + self.under_1h: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'under_1h_old_transfer_volume{disc}')) + +class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern5: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern12: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern13: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern7(Generic[T]): """Pattern struct for repeated tree structure.""" pass @@ -3104,31 +3231,89 @@ class HeightIndexPct0Pct1Pct10Pct2Pct20Pct30Pct40Pct5Pct50Pct60Pct70Pct80Pct90Pc self.pct99_9: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct99_9')) self.score: SeriesPattern1[StoredI8] = SeriesPattern1(client, _m(acc, 'score')) -class HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern: +class _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2: """Pattern struct for repeated tree structure.""" - def __init__(self, client: BrkClient, acc: str): + def __init__(self, client: BrkClient, acc: str, disc: str): """Create pattern node with accumulated series name.""" - self.height: SeriesPattern18[[Cents; 19]] = SeriesPattern18(client, _m(acc, 'cents')) - self.pct05: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct05')) - self.pct10: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct10')) - self.pct15: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct15')) - self.pct20: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct20')) - self.pct25: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct25')) - self.pct30: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct30')) - self.pct35: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct35')) - self.pct40: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct40')) - self.pct45: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct45')) - self.pct50: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct50')) - self.pct55: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct55')) - self.pct60: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct60')) - self.pct65: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct65')) - self.pct70: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct70')) - self.pct75: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct75')) - self.pct80: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct80')) - self.pct85: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct85')) - self.pct90: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct90')) - self.pct95: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct95')) + self._10y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'10y_old_transfer_volume{disc}')) + self._12y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'12y_old_transfer_volume{disc}')) + self._15y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'15y_old_transfer_volume{disc}')) + self._18m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'18m_old_transfer_volume{disc}')) + self._1m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1m_old_transfer_volume{disc}')) + self._1w: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1w_old_transfer_volume{disc}')) + self._1y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1y_old_transfer_volume{disc}')) + self._2m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2m_old_transfer_volume{disc}')) + self._2y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2y_old_transfer_volume{disc}')) + self._3m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'3m_old_transfer_volume{disc}')) + self._3y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'3y_old_transfer_volume{disc}')) + self._4m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'4m_old_transfer_volume{disc}')) + self._4y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'4y_old_transfer_volume{disc}')) + self._5m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'5m_old_transfer_volume{disc}')) + self._5y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'5y_old_transfer_volume{disc}')) + self._6m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'6m_old_transfer_volume{disc}')) + self._6y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'6y_old_transfer_volume{disc}')) + self._7y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'7y_old_transfer_volume{disc}')) + self._8y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'8y_old_transfer_volume{disc}')) + self._9m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'9m_old_transfer_volume{disc}')) + +class _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str, disc: str): + """Create pattern node with accumulated series name.""" + self._10y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'10y_old_transfer_volume{disc}')) + self._12y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'12y_old_transfer_volume{disc}')) + self._18m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'18m_old_transfer_volume{disc}')) + self._1d: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1d_old_transfer_volume{disc}')) + self._1m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1m_old_transfer_volume{disc}')) + self._1w: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1w_old_transfer_volume{disc}')) + self._1y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1y_old_transfer_volume{disc}')) + self._2m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2m_old_transfer_volume{disc}')) + self._2y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2y_old_transfer_volume{disc}')) + self._3m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'3m_old_transfer_volume{disc}')) + self._3y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'3y_old_transfer_volume{disc}')) + self._4m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'4m_old_transfer_volume{disc}')) + self._4y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'4y_old_transfer_volume{disc}')) + self._5m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'5m_old_transfer_volume{disc}')) + self._5y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'5y_old_transfer_volume{disc}')) + self._6m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'6m_old_transfer_volume{disc}')) + self._6y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'6y_old_transfer_volume{disc}')) + self._7y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'7y_old_transfer_volume{disc}')) + self._8y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'8y_old_transfer_volume{disc}')) + self._9m: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'9m_old_transfer_volume{disc}')) + +class _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern5: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern12: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13: + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern13: + """Pattern struct for repeated tree structure.""" + pass class Pct0Pct1Pct10Pct2Pct20Pct30Pct40Pct5Pct50Pct60Pct70Pct80Pct90Pct95Pct98Pct99RatiosPattern: """Pattern struct for repeated tree structure.""" @@ -3156,6 +3341,406 @@ class Pct0Pct1Pct10Pct2Pct20Pct30Pct40Pct5Pct50Pct60Pct70Pct80Pct90Pct95Pct98Pct self.pct99_9: PpmPriceRatioPattern = PpmPriceRatioPattern(client, acc, 'pct99_9') self.ratios: SeriesPattern18[[PartsPerMillion32; 19]] = SeriesPattern18(client, _m(acc, 'ratios_ppm')) +class _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7(Generic[T]): + """Pattern struct for repeated tree structure.""" + pass + +class _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern7(Generic[T]): + """Pattern struct for repeated tree structure.""" + pass + +class Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.pct05: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct05')) + self.pct10: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct10')) + self.pct15: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct15')) + self.pct20: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct20')) + self.pct25: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct25')) + self.pct30: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct30')) + self.pct35: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct35')) + self.pct40: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct40')) + self.pct45: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct45')) + self.pct50: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct50')) + self.pct55: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct55')) + self.pct60: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct60')) + self.pct65: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct65')) + self.pct70: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct70')) + self.pct75: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct75')) + self.pct80: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct80')) + self.pct85: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct85')) + self.pct90: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct90')) + self.pct95: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct95')) + +class _200920102011201220132014201520162017201820192020202120222023202420252026Pattern: + """Pattern struct for repeated tree structure.""" + pass + +class _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str, disc: str): + """Create pattern node with accumulated series name.""" + self._2009: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2009_transfer_volume{disc}')) + self._2010: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2010_transfer_volume{disc}')) + self._2011: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2011_transfer_volume{disc}')) + self._2012: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2012_transfer_volume{disc}')) + self._2013: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2013_transfer_volume{disc}')) + self._2014: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2014_transfer_volume{disc}')) + self._2015: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2015_transfer_volume{disc}')) + self._2016: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2016_transfer_volume{disc}')) + self._2017: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2017_transfer_volume{disc}')) + self._2018: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2018_transfer_volume{disc}')) + self._2019: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2019_transfer_volume{disc}')) + self._2020: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2020_transfer_volume{disc}')) + self._2021: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2021_transfer_volume{disc}')) + self._2022: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2022_transfer_volume{disc}')) + self._2023: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2023_transfer_volume{disc}')) + self._2024: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2024_transfer_volume{disc}')) + self._2025: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2025_transfer_volume{disc}')) + self._2026: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2026_transfer_volume{disc}')) + +class _200920102011201220132014201520162017201820192020202120222023202420252026Pattern5: + """Pattern struct for repeated tree structure.""" + pass + +class _200920102011201220132014201520162017201820192020202120222023202420252026Pattern12: + """Pattern struct for repeated tree structure.""" + pass + +class _200920102011201220132014201520162017201820192020202120222023202420252026Pattern13: + """Pattern struct for repeated tree structure.""" + pass + +class _200920102011201220132014201520162017201820192020202120222023202420252026Pattern7(Generic[T]): + """Pattern struct for repeated tree structure.""" + pass + +class _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._0sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '0sats_supply_delta')) + self._100btc_to_1k_btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100btc_to_1k_btc_supply_delta')) + self._100k_sats_to_1m_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100k_sats_to_1m_sats_supply_delta')) + self._100sats_to_1k_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100sats_to_1k_sats_supply_delta')) + self._10btc_to_100btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10btc_to_100btc_supply_delta')) + self._10k_btc_to_100k_btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10k_btc_to_100k_btc_supply_delta')) + self._10k_sats_to_100k_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10k_sats_to_100k_sats_supply_delta')) + self._10m_sats_to_1btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10m_sats_to_1btc_supply_delta')) + self._10sats_to_100sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10sats_to_100sats_supply_delta')) + self._1btc_to_10btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1btc_to_10btc_supply_delta')) + self._1k_btc_to_10k_btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1k_btc_to_10k_btc_supply_delta')) + self._1k_sats_to_10k_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1k_sats_to_10k_sats_supply_delta')) + self._1m_sats_to_10m_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1m_sats_to_10m_sats_supply_delta')) + self._1sat_to_10sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1sat_to_10sats_supply_delta')) + self.over_100k_btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, 'over_100k_btc_supply_delta')) + +class _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._0sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '0sats_transfer_volume')) + self._100btc_to_1k_btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100btc_to_1k_btc_transfer_volume')) + self._100k_sats_to_1m_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100k_sats_to_1m_sats_transfer_volume')) + self._100sats_to_1k_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100sats_to_1k_sats_transfer_volume')) + self._10btc_to_100btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10btc_to_100btc_transfer_volume')) + self._10k_btc_to_100k_btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10k_btc_to_100k_btc_transfer_volume')) + self._10k_sats_to_100k_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10k_sats_to_100k_sats_transfer_volume')) + self._10m_sats_to_1btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10m_sats_to_1btc_transfer_volume')) + self._10sats_to_100sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10sats_to_100sats_transfer_volume')) + self._1btc_to_10btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1btc_to_10btc_transfer_volume')) + self._1k_btc_to_10k_btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1k_btc_to_10k_btc_transfer_volume')) + self._1k_sats_to_10k_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1k_sats_to_10k_sats_transfer_volume')) + self._1m_sats_to_10m_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1m_sats_to_10m_sats_transfer_volume')) + self._1sat_to_10sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1sat_to_10sats_transfer_volume')) + self.over_100k_btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, 'over_100k_btc_transfer_volume')) + +class _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern: + """Pattern struct for repeated tree structure.""" + pass + +class _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern5: + """Pattern struct for repeated tree structure.""" + pass + +class _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._0sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '0sats_supply')) + self._100btc_to_1k_btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100btc_to_1k_btc_supply')) + self._100k_sats_to_1m_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100k_sats_to_1m_sats_supply')) + self._100sats_to_1k_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100sats_to_1k_sats_supply')) + self._10btc_to_100btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10btc_to_100btc_supply')) + self._10k_btc_to_100k_btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10k_btc_to_100k_btc_supply')) + self._10k_sats_to_100k_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10k_sats_to_100k_sats_supply')) + self._10m_sats_to_1btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10m_sats_to_1btc_supply')) + self._10sats_to_100sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10sats_to_100sats_supply')) + self._1btc_to_10btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1btc_to_10btc_supply')) + self._1k_btc_to_10k_btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1k_btc_to_10k_btc_supply')) + self._1k_sats_to_10k_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1k_sats_to_10k_sats_supply')) + self._1m_sats_to_10m_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1m_sats_to_10m_sats_supply')) + self._1sat_to_10sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1sat_to_10sats_supply')) + self.over_100k_btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'over_100k_btc_supply')) + +class _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._0sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '0sats_realized_cap')) + self._100btc_to_1k_btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100btc_to_1k_btc_realized_cap')) + self._100k_sats_to_1m_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100k_sats_to_1m_sats_realized_cap')) + self._100sats_to_1k_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100sats_to_1k_sats_realized_cap')) + self._10btc_to_100btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10btc_to_100btc_realized_cap')) + self._10k_btc_to_100k_btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10k_btc_to_100k_btc_realized_cap')) + self._10k_sats_to_100k_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10k_sats_to_100k_sats_realized_cap')) + self._10m_sats_to_1btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10m_sats_to_1btc_realized_cap')) + self._10sats_to_100sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10sats_to_100sats_realized_cap')) + self._1btc_to_10btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1btc_to_10btc_realized_cap')) + self._1k_btc_to_10k_btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1k_btc_to_10k_btc_realized_cap')) + self._1k_sats_to_10k_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1k_sats_to_10k_sats_realized_cap')) + self._1m_sats_to_10m_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1m_sats_to_10m_sats_realized_cap')) + self._1sat_to_10sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1sat_to_10sats_realized_cap')) + self.over_100k_btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, 'over_100k_btc_realized_cap')) + +class _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._0sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '0sats_supply_dominance')) + self._100btc_to_1k_btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100btc_to_1k_btc_supply_dominance')) + self._100k_sats_to_1m_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100k_sats_to_1m_sats_supply_dominance')) + self._100sats_to_1k_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100sats_to_1k_sats_supply_dominance')) + self._10btc_to_100btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10btc_to_100btc_supply_dominance')) + self._10k_btc_to_100k_btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10k_btc_to_100k_btc_supply_dominance')) + self._10k_sats_to_100k_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10k_sats_to_100k_sats_supply_dominance')) + self._10m_sats_to_1btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10m_sats_to_1btc_supply_dominance')) + self._10sats_to_100sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10sats_to_100sats_supply_dominance')) + self._1btc_to_10btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1btc_to_10btc_supply_dominance')) + self._1k_btc_to_10k_btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1k_btc_to_10k_btc_supply_dominance')) + self._1k_sats_to_10k_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1k_sats_to_10k_sats_supply_dominance')) + self._1m_sats_to_10m_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1m_sats_to_10m_sats_supply_dominance')) + self._1sat_to_10sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1sat_to_10sats_supply_dominance')) + self.over_100k_btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'over_100k_btc_supply_dominance')) + +class _100pct10pct200pct20pct300pct30pct40pct500pct50pct60pct70pct80pct90pctAllPattern2: + """Pattern struct for repeated tree structure.""" + pass + +class _100btc100k100sats10btc10k10m10sats1btc1k1mPattern8: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100btc_supply_delta')) + self._100k_btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100k_btc_supply_delta')) + self._100k_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100k_sats_supply_delta')) + self._100sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100sats_supply_delta')) + self._10btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10btc_supply_delta')) + self._10k_btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10k_btc_supply_delta')) + self._10k_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10k_sats_supply_delta')) + self._10m_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10m_sats_supply_delta')) + self._10sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10sats_supply_delta')) + self._1btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1btc_supply_delta')) + self._1k_btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1k_btc_supply_delta')) + self._1k_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1k_sats_supply_delta')) + self._1m_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1m_sats_supply_delta')) + +class _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100btc_supply_delta')) + self._100k_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100k_sats_supply_delta')) + self._100sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '100sats_supply_delta')) + self._10btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10btc_supply_delta')) + self._10k_btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10k_btc_supply_delta')) + self._10k_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10k_sats_supply_delta')) + self._10m_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10m_sats_supply_delta')) + self._10sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '10sats_supply_delta')) + self._1btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1btc_supply_delta')) + self._1k_btc: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1k_btc_supply_delta')) + self._1k_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1k_sats_supply_delta')) + self._1m_sats: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1m_sats_supply_delta')) + self._1sat: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, '1sat_supply_delta')) + +class _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100btc_transfer_volume')) + self._100k_btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100k_btc_transfer_volume')) + self._100k_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100k_sats_transfer_volume')) + self._100sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100sats_transfer_volume')) + self._10btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10btc_transfer_volume')) + self._10k_btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10k_btc_transfer_volume')) + self._10k_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10k_sats_transfer_volume')) + self._10m_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10m_sats_transfer_volume')) + self._10sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10sats_transfer_volume')) + self._1btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1btc_transfer_volume')) + self._1k_btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1k_btc_transfer_volume')) + self._1k_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1k_sats_transfer_volume')) + self._1m_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1m_sats_transfer_volume')) + +class _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100btc_transfer_volume')) + self._100k_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100k_sats_transfer_volume')) + self._100sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '100sats_transfer_volume')) + self._10btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10btc_transfer_volume')) + self._10k_btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10k_btc_transfer_volume')) + self._10k_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10k_sats_transfer_volume')) + self._10m_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10m_sats_transfer_volume')) + self._10sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '10sats_transfer_volume')) + self._1btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1btc_transfer_volume')) + self._1k_btc: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1k_btc_transfer_volume')) + self._1k_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1k_sats_transfer_volume')) + self._1m_sats: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1m_sats_transfer_volume')) + self._1sat: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, '1sat_transfer_volume')) + +class _100btc100k100sats10btc10k10m10sats1btc1k1mPattern: + """Pattern struct for repeated tree structure.""" + pass + +class _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern: + """Pattern struct for repeated tree structure.""" + pass + +class _100btc100k100sats10btc10k10m10sats1btc1k1mPattern5: + """Pattern struct for repeated tree structure.""" + pass + +class _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern5: + """Pattern struct for repeated tree structure.""" + pass + +class _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100btc_supply')) + self._100k_btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100k_btc_supply')) + self._100k_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100k_sats_supply')) + self._100sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100sats_supply')) + self._10btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10btc_supply')) + self._10k_btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10k_btc_supply')) + self._10k_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10k_sats_supply')) + self._10m_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10m_sats_supply')) + self._10sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10sats_supply')) + self._1btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1btc_supply')) + self._1k_btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1k_btc_supply')) + self._1k_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1k_sats_supply')) + self._1m_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1m_sats_supply')) + +class _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100btc_supply')) + self._100k_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100k_sats_supply')) + self._100sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '100sats_supply')) + self._10btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10btc_supply')) + self._10k_btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10k_btc_supply')) + self._10k_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10k_sats_supply')) + self._10m_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10m_sats_supply')) + self._10sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10sats_supply')) + self._1btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1btc_supply')) + self._1k_btc: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1k_btc_supply')) + self._1k_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1k_sats_supply')) + self._1m_sats: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1m_sats_supply')) + self._1sat: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1sat_supply')) + +class _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100btc_realized_cap')) + self._100k_btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100k_btc_realized_cap')) + self._100k_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100k_sats_realized_cap')) + self._100sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100sats_realized_cap')) + self._10btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10btc_realized_cap')) + self._10k_btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10k_btc_realized_cap')) + self._10k_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10k_sats_realized_cap')) + self._10m_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10m_sats_realized_cap')) + self._10sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10sats_realized_cap')) + self._1btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1btc_realized_cap')) + self._1k_btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1k_btc_realized_cap')) + self._1k_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1k_sats_realized_cap')) + self._1m_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1m_sats_realized_cap')) + +class _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100btc_realized_cap')) + self._100k_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100k_sats_realized_cap')) + self._100sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '100sats_realized_cap')) + self._10btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10btc_realized_cap')) + self._10k_btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10k_btc_realized_cap')) + self._10k_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10k_sats_realized_cap')) + self._10m_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10m_sats_realized_cap')) + self._10sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '10sats_realized_cap')) + self._1btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1btc_realized_cap')) + self._1k_btc: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1k_btc_realized_cap')) + self._1k_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1k_sats_realized_cap')) + self._1m_sats: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1m_sats_realized_cap')) + self._1sat: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, '1sat_realized_cap')) + +class _100btc100k100sats10btc10k10m10sats1btc1k1mPattern9: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100btc_supply_dominance')) + self._100k_btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100k_btc_supply_dominance')) + self._100k_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100k_sats_supply_dominance')) + self._100sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100sats_supply_dominance')) + self._10btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10btc_supply_dominance')) + self._10k_btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10k_btc_supply_dominance')) + self._10k_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10k_sats_supply_dominance')) + self._10m_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10m_sats_supply_dominance')) + self._10sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10sats_supply_dominance')) + self._1btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1btc_supply_dominance')) + self._1k_btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1k_btc_supply_dominance')) + self._1k_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1k_sats_supply_dominance')) + self._1m_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1m_sats_supply_dominance')) + +class _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._100btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100btc_supply_dominance')) + self._100k_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100k_sats_supply_dominance')) + self._100sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '100sats_supply_dominance')) + self._10btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10btc_supply_dominance')) + self._10k_btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10k_btc_supply_dominance')) + self._10k_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10k_sats_supply_dominance')) + self._10m_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10m_sats_supply_dominance')) + self._10sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '10sats_supply_dominance')) + self._1btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1btc_supply_dominance')) + self._1k_btc: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1k_btc_supply_dominance')) + self._1k_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1k_sats_supply_dominance')) + self._1m_sats: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1m_sats_supply_dominance')) + self._1sat: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, '1sat_supply_dominance')) + class _10y1m1w1y2y3m3y4y5y6m6y8yPattern3: """Pattern struct for repeated tree structure.""" @@ -3192,23 +3777,9 @@ class _10y1m1w1y2y3m3y4y5y6m6y8yPattern2: self._6y: PercentPpmRatioPattern = PercentPpmRatioPattern(client, _m(acc, '6y')) self._8y: PercentPpmRatioPattern = PercentPpmRatioPattern(client, _m(acc, '8y')) -class CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern: +class AgeAllClassEntryEpochTermTypePattern2: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.cap: CentsDeltaToUsdPattern = CentsDeltaToUsdPattern(client, _m(acc, 'realized_cap')) - self.capitalized: PricePattern = PricePattern(client, _m(acc, 'capitalized_price')) - self.gross_pnl: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _m(acc, 'realized_gross_pnl')) - self.loss: BlockCumulativeNegativeSumPattern = BlockCumulativeNegativeSumPattern(client, _m(acc, 'realized_loss')) - self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'mvrv')) - self.net_pnl: BlockChangeCumulativeDeltaSumPattern = BlockChangeCumulativeDeltaSumPattern(client, _m(acc, 'net')) - self.peak_regret: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _m(acc, 'realized_peak_regret')) - self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, _m(acc, 'realized_price')) - self.profit: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _m(acc, 'realized_profit')) - self.profit_to_loss_ratio: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, _m(acc, 'realized_profit_to_loss_ratio')) - self.sell_side_risk_ratio: _1m1w1y24hHeightPattern3 = _1m1w1y24hHeightPattern3(client, _m(acc, 'sell_side_risk_ratio')) - self.sopr: AdjustedRatioValuePattern = AdjustedRatioValuePattern(client, acc) + pass class EmptyOpP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2: """Pattern struct for repeated tree structure.""" @@ -3249,7 +3820,58 @@ class AverageBlockCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern: self.pct90: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'pct90')) self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'sum')) -class EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2: +class EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.empty: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('empty_outputs', acc)) + self.p2a: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('p2a', acc)) + self.p2ms: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('p2ms', acc)) + self.p2pk33: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('p2pk33', acc)) + self.p2pk65: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('p2pk65', acc)) + self.p2pkh: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('p2pkh', acc)) + self.p2sh: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('p2sh', acc)) + self.p2tr: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('p2tr', acc)) + self.p2wpkh: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('p2wpkh', acc)) + self.p2wsh: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('p2wsh', acc)) + self.unknown: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('unknown_outputs', acc)) + +class EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.empty: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('empty_outputs', acc)) + self.p2a: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2a', acc)) + self.p2ms: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2ms', acc)) + self.p2pk33: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2pk33', acc)) + self.p2pk65: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2pk65', acc)) + self.p2pkh: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2pkh', acc)) + self.p2sh: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2sh', acc)) + self.p2tr: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2tr', acc)) + self.p2wpkh: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2wpkh', acc)) + self.p2wsh: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2wsh', acc)) + self.unknown: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('unknown_outputs', acc)) + +class EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.empty: CentsUsdPattern3 = CentsUsdPattern3(client, _p('empty_outputs', acc)) + self.p2a: CentsUsdPattern3 = CentsUsdPattern3(client, _p('p2a', acc)) + self.p2ms: CentsUsdPattern3 = CentsUsdPattern3(client, _p('p2ms', acc)) + self.p2pk33: CentsUsdPattern3 = CentsUsdPattern3(client, _p('p2pk33', acc)) + self.p2pk65: CentsUsdPattern3 = CentsUsdPattern3(client, _p('p2pk65', acc)) + self.p2pkh: CentsUsdPattern3 = CentsUsdPattern3(client, _p('p2pkh', acc)) + self.p2sh: CentsUsdPattern3 = CentsUsdPattern3(client, _p('p2sh', acc)) + self.p2tr: CentsUsdPattern3 = CentsUsdPattern3(client, _p('p2tr', acc)) + self.p2wpkh: CentsUsdPattern3 = CentsUsdPattern3(client, _p('p2wpkh', acc)) + self.p2wsh: CentsUsdPattern3 = CentsUsdPattern3(client, _p('p2wsh', acc)) + self.unknown: CentsUsdPattern3 = CentsUsdPattern3(client, _p('unknown_outputs', acc)) + +class EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): @@ -3283,6 +3905,23 @@ class AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(Generic[T] self.pct90: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'pct90')) self.sum: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'sum')) +class EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.empty: SeriesPattern1[T] = SeriesPattern1(client, _p('empty_outputs', acc)) + self.p2a: SeriesPattern1[T] = SeriesPattern1(client, _p('p2a', acc)) + self.p2ms: SeriesPattern1[T] = SeriesPattern1(client, _p('p2ms', acc)) + self.p2pk33: SeriesPattern1[T] = SeriesPattern1(client, _p('p2pk33', acc)) + self.p2pk65: SeriesPattern1[T] = SeriesPattern1(client, _p('p2pk65', acc)) + self.p2pkh: SeriesPattern1[T] = SeriesPattern1(client, _p('p2pkh', acc)) + self.p2sh: SeriesPattern1[T] = SeriesPattern1(client, _p('p2sh', acc)) + self.p2tr: SeriesPattern1[T] = SeriesPattern1(client, _p('p2tr', acc)) + self.p2wpkh: SeriesPattern1[T] = SeriesPattern1(client, _p('p2wpkh', acc)) + self.p2wsh: SeriesPattern1[T] = SeriesPattern1(client, _p('p2wsh', acc)) + self.unknown: SeriesPattern1[T] = SeriesPattern1(client, _p('unknown_outputs', acc)) + class AllCumulativeP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern: """Pattern struct for repeated tree structure.""" pass @@ -3291,6 +3930,25 @@ class AllHeightP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern: """Pattern struct for repeated tree structure.""" pass +class _10pct20pct30pct40pct50pct60pct70pct80pctAllPattern2: + """Pattern struct for repeated tree structure.""" + pass + +class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.all: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) + self.p2a: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2a', acc)) + self.p2pk33: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2pk33', acc)) + self.p2pk65: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2pk65', acc)) + self.p2pkh: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2pkh', acc)) + self.p2sh: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2sh', acc)) + self.p2tr: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2tr', acc)) + self.p2wpkh: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2wpkh', acc)) + self.p2wsh: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('p2wsh', acc)) + class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4: """Pattern struct for repeated tree structure.""" @@ -3306,6 +3964,21 @@ class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern4: self.p2wpkh: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _p('p2wpkh', acc)) self.p2wsh: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _p('p2wsh', acc)) +class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.all: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, acc) + self.p2a: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _p('p2a', acc)) + self.p2pk33: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _p('p2pk33', acc)) + self.p2pk65: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _p('p2pk65', acc)) + self.p2pkh: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _p('p2pkh', acc)) + self.p2sh: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _p('p2sh', acc)) + self.p2tr: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _p('p2tr', acc)) + self.p2wpkh: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _p('p2wpkh', acc)) + self.p2wsh: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _p('p2wsh', acc)) + class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern6: """Pattern struct for repeated tree structure.""" @@ -3336,21 +4009,6 @@ class AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern: self.pct90: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'pct90')) self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'sum')) -class CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.capitalized_cap_in_loss_raw: SeriesPattern18[CentsSquaredSats] = SeriesPattern18(client, _m(acc, 'capitalized_cap_in_loss_raw')) - self.capitalized_cap_in_profit_raw: SeriesPattern18[CentsSquaredSats] = SeriesPattern18(client, _m(acc, 'capitalized_cap_in_profit_raw')) - self.gross_pnl: CentsUsdPattern3 = CentsUsdPattern3(client, _m(acc, 'unrealized_gross_pnl')) - self.invested_capital: InPattern2 = InPattern2(client, _m(acc, 'invested_capital_in')) - self.loss: CentsNegativeToUsdPattern2 = CentsNegativeToUsdPattern2(client, _m(acc, 'unrealized_loss')) - self.net_pnl: CentsToUsdPattern3 = CentsToUsdPattern3(client, _m(acc, 'net_unrealized_pnl')) - self.nupl: PpmRatioPattern = PpmRatioPattern(client, _m(acc, 'nupl')) - self.profit: CentsToUsdPattern4 = CentsToUsdPattern4(client, _m(acc, 'unrealized_profit')) - self.sentiment: GreedNetPainPattern = GreedNetPainPattern(client, acc) - class Pct10Pct20Pct30Pct40Pct50Pct60Pct70Pct80Pct90Pattern: """Pattern struct for repeated tree structure.""" @@ -3392,7 +4050,7 @@ class _1m1w1y24hPercentPpmRatioPattern: self.ppm: SeriesPattern1[PartsPerMillion32] = SeriesPattern1(client, _m(acc, 'ppm')) self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ratio')) -class _1m1y2y3m4y6m8yPattern: +class _1m1y2y3m4y6m8yPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): @@ -3409,18 +4067,9 @@ class ActiveInputOutputSpendablePattern: """Pattern struct for repeated tree structure.""" pass -class CapLossMvrvNetPriceProfitSoprPattern: +class AgeAllClassCumulativeEntryEpochTermPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.cap: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, 'realized_cap')) - self.loss: BlockCumulativeNegativeSumPattern = BlockCumulativeNegativeSumPattern(client, _m(acc, 'realized_loss')) - self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'mvrv')) - self.net_pnl: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, _m(acc, 'net_realized_pnl')) - self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, _m(acc, 'realized_price')) - self.profit: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _m(acc, 'realized_profit')) - self.sopr: RatioValuePattern = RatioValuePattern(client, acc) + pass class InMaxMinPerSupplyPattern: """Pattern struct for repeated tree structure.""" @@ -3431,8 +4080,8 @@ class InMaxMinPerSupplyPattern: self.in_profit: PerPattern = PerPattern(client, _m(acc, 'cost_basis_in_profit_per')) self.max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'cost_basis_max')) self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'cost_basis_min')) - self.per_coin: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis_per_coin')) - self.per_dollar: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis_per_dollar')) + self.per_coin: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis_per_coin')) + self.per_dollar: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis_per_dollar')) self.supply_density: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'supply_density')) class MaxMedianMinPct10Pct25Pct75Pct90Pattern2: @@ -3473,54 +4122,6 @@ class AverageBlockChainCumulativeDataSumPattern: self.data_share: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'data_share')) self.sum: _1m1w1y24hPattern[Bytes] = _1m1w1y24hPattern(client, _m(acc, 'data_bytes_sum')) -class AverageBlockCumulativeInSumPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.average: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, _m(acc, 'average')) - self.block: BtcCentsSatsUsdPattern3 = BtcCentsSatsUsdPattern3(client, acc) - self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')) - self.in_loss: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, 'in_loss')) - self.in_profit: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, 'in_profit')) - self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, _m(acc, 'sum')) - -class CentsNegativeToUsdPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) - self.negative: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'neg')) - self.to_mcap: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'to_mcap')) - self.to_own_gross_pnl: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'to_own_gross_pnl')) - self.to_own_mcap: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'to_own_mcap')) - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) - -class DeltaDominanceHalfInTotalPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.delta: AbsoluteRatePattern3 = AbsoluteRatePattern3(client, _m(acc, 'delta')) - self.dominance: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'dominance')) - self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) - self.in_loss: BtcCentsSatsShareUsdPattern = BtcCentsSatsShareUsdPattern(client, _m(acc, 'in_loss')) - self.in_profit: BtcCentsSatsShareUsdPattern = BtcCentsSatsShareUsdPattern(client, _m(acc, 'in_profit')) - self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) - -class DeltaDominanceHalfInTotalPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.delta: AbsoluteRatePattern3 = AbsoluteRatePattern3(client, _m(acc, 'delta')) - self.dominance: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'dominance')) - self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) - self.in_loss: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'in_loss')) - self.in_profit: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'in_profit')) - self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) - class HeightRankTailThresholdPattern: """Pattern struct for repeated tree structure.""" @@ -3533,6 +4134,33 @@ class HeightRankTailThresholdPattern: self.threshold_pct0_05: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'threshold_pct0_05')) self.threshold_pct0_1: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'threshold_pct0_1')) +class _01234Pattern: + """Pattern struct for repeated tree structure.""" + pass + +class _01234Pattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str, disc: str): + """Create pattern node with accumulated series name.""" + self._0: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'0_transfer_volume{disc}')) + self._1: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'1_transfer_volume{disc}')) + self._2: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'2_transfer_volume{disc}')) + self._3: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'3_transfer_volume{disc}')) + self._4: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, f'4_transfer_volume{disc}')) + +class _01234Pattern5: + """Pattern struct for repeated tree structure.""" + pass + +class _01234Pattern12: + """Pattern struct for repeated tree structure.""" + pass + +class _01234Pattern13: + """Pattern struct for repeated tree structure.""" + pass + class _1m1w1y24hHeightPattern3: """Pattern struct for repeated tree structure.""" @@ -3577,17 +4205,6 @@ class _1m1w1y24hHeightPattern: self._24h: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, '24h')) self.height: SeriesPattern18[[StoredF32; 4]] = SeriesPattern18(client, acc) -class _1m1w1y24hHeightPattern4: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self._1m: SeriesPattern1[StoredF64] = SeriesPattern1(client, _m(acc, '1m')) - self._1w: SeriesPattern1[StoredF64] = SeriesPattern1(client, _m(acc, '1w')) - self._1y: SeriesPattern1[StoredF64] = SeriesPattern1(client, _m(acc, '1y')) - self._24h: SeriesPattern1[StoredF64] = SeriesPattern1(client, _m(acc, '24h')) - self.height: SeriesPattern18[[StoredF64; 3]] = SeriesPattern18(client, acc) - class _1m1w1y24hHeightPattern2: """Pattern struct for repeated tree structure.""" @@ -3599,61 +4216,6 @@ class _1m1w1y24hHeightPattern2: self._24h: SeriesPattern1[StoredF64] = SeriesPattern1(client, _m(acc, '24h')) self.height: SeriesPattern18[[StoredF64; 4]] = SeriesPattern18(client, acc) -class ActiveBidirectionalReactivatedReceivingSendingPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.active: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _m(acc, 'active_addrs')) - self.bidirectional: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _m(acc, 'bidirectional_addrs')) - self.reactivated: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _m(acc, 'reactivated_addrs')) - self.receiving: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _m(acc, 'receiving_addrs')) - self.sending: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, _m(acc, 'sending_addrs')) - -class ActivityOutputsRealizedSupplyUnrealizedPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.activity: CoindaysTransferPattern = CoindaysTransferPattern(client, acc) - self.outputs: SpentUnspentPattern = SpentUnspentPattern(client, acc) - self.realized: CapLossMvrvNetPriceProfitSoprPattern = CapLossMvrvNetPriceProfitSoprPattern(client, acc) - self.supply: DeltaDominanceHalfInTotalPattern = DeltaDominanceHalfInTotalPattern(client, _m(acc, 'supply')) - self.unrealized: LossNetNuplProfitPattern = LossNetNuplProfitPattern(client, acc) - -class ActivityAddrOutputsRealizedSupplyPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.activity: TransferPattern = TransferPattern(client, _m(acc, 'transfer_volume')) - self.addr_count: BaseDeltaPattern = BaseDeltaPattern(client, _m(acc, 'addr_count')) - self.outputs: UnspentPattern = UnspentPattern(client, _m(acc, 'utxo_count')) - self.realized: CapLossProfitPattern = CapLossProfitPattern(client, _m(acc, 'realized')) - self.supply: DeltaDominanceTotalPattern = DeltaDominanceTotalPattern(client, _m(acc, 'supply')) - -class ActivityOutputsRealizedSupplyUnrealizedPattern3: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.activity: TransferPattern = TransferPattern(client, _m(acc, 'transfer_volume')) - self.outputs: SpentUnspentPattern = SpentUnspentPattern(client, acc) - self.realized: CapLossMvrvPriceProfitPattern = CapLossMvrvPriceProfitPattern(client, acc) - self.supply: DeltaDominanceHalfInTotalPattern = DeltaDominanceHalfInTotalPattern(client, _m(acc, 'supply')) - self.unrealized: LossNuplProfitPattern = LossNuplProfitPattern(client, acc) - -class ActivityOutputsRealizedSupplyUnrealizedPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.activity: TransferPattern = TransferPattern(client, _m(acc, 'transfer_volume')) - self.outputs: SpentUnspentPattern = SpentUnspentPattern(client, acc) - self.realized: CapLossMvrvPriceProfitPattern = CapLossMvrvPriceProfitPattern(client, acc) - self.supply: DeltaDominanceTotalPattern = DeltaDominanceTotalPattern(client, _m(acc, 'supply')) - self.unrealized: NuplPattern = NuplPattern(client, _m(acc, 'nupl')) - class AverageBlockCumulativeFeeSumPattern: """Pattern struct for repeated tree structure.""" @@ -3665,17 +4227,6 @@ class AverageBlockCumulativeFeeSumPattern: self.fee_share: _1m1w1y24hPercentPpmRatioPattern = _1m1w1y24hPercentPpmRatioPattern(client, _m(acc, 'fee_share')) self.sum: _1m1w1y24hPattern[Sats] = _1m1w1y24hPattern(client, _m(acc, 'fees_sum')) -class BlockChangeCumulativeDeltaSumPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.block: CentsUsdPattern4 = CentsUsdPattern4(client, _m(acc, 'realized_pnl')) - self.change_1m: ToPattern = ToPattern(client, _m(acc, 'pnl_change_1m_to')) - self.cumulative: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_pnl_cumulative')) - self.delta: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, 'realized_pnl_delta')) - self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'realized_pnl_sum')) - class BtcCentsDeltaSatsUsdPattern: """Pattern struct for repeated tree structure.""" @@ -3683,7 +4234,7 @@ class BtcCentsDeltaSatsUsdPattern: """Create pattern node with accumulated series name.""" self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, acc) self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) - self.delta: AbsoluteRatePattern3 = AbsoluteRatePattern3(client, _m(acc, 'delta')) + self.delta: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, 'delta')) self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, _m(acc, 'sats')) self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'usd')) @@ -3691,28 +4242,6 @@ class BtcCentsInSatsUsdPattern: """Pattern struct for repeated tree structure.""" pass -class BtcCentsSatsShareUsdPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, acc) - self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) - self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, _m(acc, 'sats')) - self.share: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'share')) - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'usd')) - -class CapLossMvrvPriceProfitPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.cap: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, 'realized_cap')) - self.loss: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _m(acc, 'realized_loss')) - self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'mvrv')) - self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, _m(acc, 'realized_price')) - self.profit: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _m(acc, 'realized_profit')) - class CentsPpmRatioSatsUsdPattern: """Pattern struct for repeated tree structure.""" @@ -3724,17 +4253,6 @@ class CentsPpmRatioSatsUsdPattern: self.sats: SeriesPattern1[SatsFract] = SeriesPattern1(client, _m(acc, 'sats')) self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) -class CentsToUsdPattern4: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) - self.to_mcap: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'to_mcap')) - self.to_own_gross_pnl: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'to_own_gross_pnl')) - self.to_own_mcap: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'to_own_mcap')) - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) - class EmaHistogramLineSignalPattern: """Pattern struct for repeated tree structure.""" pass @@ -3772,6 +4290,10 @@ class PhsReboundThsPattern: self.ths: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ths')) self.ths_min: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ths_min')) +class _01234Pattern7(Generic[T]): + """Pattern struct for repeated tree structure.""" + pass + class CumulativeMultipleOversizedPrePattern3(Generic[T]): """Pattern struct for repeated tree structure.""" pass @@ -3796,7 +4318,7 @@ class _1m1w1y24hPattern3: self._1y: BtcCentsSatsUsdPattern2 = BtcCentsSatsUsdPattern2(client, _m(acc, '1y')) self._24h: BtcCentsSatsUsdPattern2 = BtcCentsSatsUsdPattern2(client, _m(acc, '24h')) -class _1m1w1y24hPattern7: +class _1m1w1y24hPattern5: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): @@ -3816,7 +4338,7 @@ class _1m1w1y2wPattern: self._1y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, '1y')) self._2w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, '2w')) -class _1m1w1y24hPattern5: +class _1m1w1y24hPattern6: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): @@ -3826,7 +4348,7 @@ class _1m1w1y24hPattern5: self._1y: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1y')) self._24h: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '24h')) -class _1m1w1y24hPattern6: +class _1m1w1y24hPattern7: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): @@ -3846,6 +4368,28 @@ class _1m1w1y24hPattern2: self._1y: PercentPpmRatioPattern = PercentPpmRatioPattern(client, _m(acc, '1y_rate')) self._24h: PercentPpmRatioPattern = PercentPpmRatioPattern(client, _m(acc, '24h_rate')) +class _1m1w1yHeightPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self._1m: SeriesPattern1[StoredF64] = SeriesPattern1(client, _m(acc, '1m')) + self._1w: SeriesPattern1[StoredF64] = SeriesPattern1(client, _m(acc, '1w')) + self._1y: SeriesPattern1[StoredF64] = SeriesPattern1(client, _m(acc, '1y')) + self.height: SeriesPattern18[[StoredF64; 3]] = SeriesPattern18(client, acc) + +class AgeClassEntryEpochPattern: + """Pattern struct for repeated tree structure.""" + pass + +class AllCumulativeLthSthPattern: + """Pattern struct for repeated tree structure.""" + pass + +class AllHeightLthSthPattern4: + """Pattern struct for repeated tree structure.""" + pass + class AverageBlockCumulativeSumPattern2: """Pattern struct for repeated tree structure.""" @@ -3856,16 +4400,6 @@ class AverageBlockCumulativeSumPattern2: self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')) self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, _m(acc, 'sum')) -class BlockCumulativeNegativeSumPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.block: CentsUsdPattern2 = CentsUsdPattern2(client, acc) - self.cumulative: CentsUsdPattern3 = CentsUsdPattern3(client, _m(acc, 'cumulative')) - self.negative: BaseSumPattern = BaseSumPattern(client, _m(acc, 'neg')) - self.sum: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, _m(acc, 'sum')) - class BlockCumulativeDeltaSumPattern: """Pattern struct for repeated tree structure.""" @@ -3873,8 +4407,8 @@ class BlockCumulativeDeltaSumPattern: """Create pattern node with accumulated series name.""" self.block: CentsUsdPattern4 = CentsUsdPattern4(client, acc) self.cumulative: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'cumulative')) - self.delta: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, 'delta')) - self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'sum')) + self.delta: AbsoluteRatePattern3 = AbsoluteRatePattern3(client, _m(acc, 'delta')) + self.sum: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, _m(acc, 'sum')) class BtcCentsSatsUsdPattern: """Pattern struct for repeated tree structure.""" @@ -3906,59 +4440,21 @@ class BtcCentsSatsUsdPattern3: self.sats: SeriesPattern18[Sats] = SeriesPattern18(client, _m(acc, 'sats')) self.usd: SeriesPattern18[Dollars] = SeriesPattern18(client, _m(acc, 'usd')) -class CapHorizonPriceSupplyPattern: +class CapHorizonPriceSupplyPattern2: """Pattern struct for repeated tree structure.""" pass -class CentsDeltaToUsdPattern: +class HeightLossProfitRangePattern2: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) - self.delta: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, 'delta')) - self.to_own_mcap: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'to_own_mcap')) - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) + pass -class CentsToUsdPattern3: +class MatrixOverRangeUnderPattern3: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.cents: SeriesPattern1[CentsSigned] = SeriesPattern1(client, _m(acc, 'cents')) - self.to_own_gross_pnl: PercentPpmRatioPattern3 = PercentPpmRatioPattern3(client, _m(acc, 'to_own_gross_pnl')) - self.to_own_mcap: PercentPpmRatioPattern3 = PercentPpmRatioPattern3(client, _m(acc, 'to_own_mcap')) - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) + pass -class CoindaysCoinyearsDormancyTransferPattern: +class MatrixOverRangeUnderPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.coindays_destroyed: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, _m(acc, 'coindays_destroyed')) - self.coinyears_destroyed: SeriesPattern1[StoredF64] = SeriesPattern1(client, _m(acc, 'coinyears_destroyed')) - self.dormancy: _1m1w1y24hHeightPattern = _1m1w1y24hHeightPattern(client, _m(acc, 'dormancy')) - self.transfer_volume: AverageBlockCumulativeInSumPattern = AverageBlockCumulativeInSumPattern(client, _m(acc, 'transfer_volume')) - -class LossNetNuplProfitPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.loss: CentsNegativeUsdPattern = CentsNegativeUsdPattern(client, _m(acc, 'unrealized_loss')) - self.net_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'net_unrealized_pnl')) - self.nupl: PpmRatioPattern = PpmRatioPattern(client, _m(acc, 'nupl')) - self.profit: CentsUsdPattern3 = CentsUsdPattern3(client, _m(acc, 'unrealized_profit')) - -class NuplRealizedSupplyUnrealizedPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.nupl: PpmRatioPattern = PpmRatioPattern(client, _m(acc, 'nupl')) - self.realized_cap: AllSthPattern = AllSthPattern(client, acc, 'realized_cap') - self.supply: AllSthPattern2 = AllSthPattern2(client, acc) - self.unrealized_pnl: AllSthPattern = AllSthPattern(client, acc, 'unrealized_pnl') + pass class _1m1w1y24hPattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -3970,6 +4466,10 @@ class _1m1w1y24hPattern(Generic[T]): self._1y: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, '1y')) self._24h: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, '24h')) +class AllHeightLthSthPattern5(Generic[T]): + """Pattern struct for repeated tree structure.""" + pass + class AverageBlockCumulativeSumPattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -3980,14 +4480,27 @@ class AverageBlockCumulativeSumPattern(Generic[T]): self.cumulative: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, 'cumulative')) self.sum: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'sum')) -class AdjustedRatioValuePattern: +class AllCumulativeSthPattern: + """Pattern struct for repeated tree structure.""" + pass + +class AllLthSthPattern4: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.adjusted: RatioTransferValuePattern = RatioTransferValuePattern(client, acc) - self.ratio: _1m1w1y24hHeightPattern4 = _1m1w1y24hHeightPattern4(client, _m(acc, 'sopr')) - self.value_destroyed: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, _m(acc, 'value_destroyed')) + self.all: BtcCentsDeltaSatsUsdPattern = BtcCentsDeltaSatsUsdPattern(client, _m(acc, 'supply')) + self.lth: BtcCentsDeltaSatsUsdPattern = BtcCentsDeltaSatsUsdPattern(client, _m(acc, 'lth_supply')) + self.sth: BtcCentsDeltaSatsUsdPattern = BtcCentsDeltaSatsUsdPattern(client, _m(acc, 'sth_supply')) + +class AllLthSthPattern5: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.all: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _p('all', acc)) + self.lth: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _p('lth', acc)) + self.sth: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _p('sth', acc)) class BlockCumulativeSumPattern: """Pattern struct for repeated tree structure.""" @@ -3996,7 +4509,7 @@ class BlockCumulativeSumPattern: """Create pattern node with accumulated series name.""" self.block: CentsUsdPattern2 = CentsUsdPattern2(client, acc) self.cumulative: CentsUsdPattern3 = CentsUsdPattern3(client, _m(acc, 'cumulative')) - self.sum: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, _m(acc, 'sum')) + self.sum: _1m1w1y24hPattern7 = _1m1w1y24hPattern7(client, _m(acc, 'sum')) class BlockCumulativeSumPattern2: """Pattern struct for repeated tree structure.""" @@ -4016,15 +4529,6 @@ class BlocksDominanceRewardsPattern: self.dominance: _1m1w1y24hPercentPpmRatioPattern = _1m1w1y24hPercentPpmRatioPattern(client, _m(acc, 'dominance')) self.rewards: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _m(acc, 'rewards')) -class CapLossProfitPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.cap: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, 'cap')) - self.loss: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _m(acc, 'loss')) - self.profit: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _m(acc, 'profit')) - class CapPriceSupplyPattern: """Pattern struct for repeated tree structure.""" pass @@ -4044,16 +4548,7 @@ class CentsDeltaUsdPattern: def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) - self.delta: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, 'delta')) - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) - -class CentsNegativeUsdPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) - self.negative: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'neg')) + self.delta: AbsoluteRatePattern3 = AbsoluteRatePattern3(client, _m(acc, 'delta')) self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) class CentsSatsUsdPattern: @@ -4078,15 +4573,6 @@ class CumulativeRollingSumPattern: self.rolling: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern = AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) self.sum: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'sum')) -class DeltaDominanceTotalPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.delta: AbsoluteRatePattern3 = AbsoluteRatePattern3(client, _m(acc, 'delta')) - self.dominance: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, 'dominance')) - self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) - class FloorLevelLossPattern: """Pattern struct for repeated tree structure.""" @@ -4096,23 +4582,60 @@ class FloorLevelLossPattern: self.level: Pct10Pct20Pct30Pct40Pct50Pct60Pct70Pct80Pct90Pattern = Pct10Pct20Pct30Pct40Pct50Pct60Pct70Pct80Pct90Pattern(client, _m(acc, 'level')) self.loss_threshold: Pct95Pct98Pct99Pattern2 = Pct95Pct98Pct99Pattern2(client, _m(acc, 'loss_threshold')) -class GreedNetPainPattern: +class HeightLongShortPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.greed_index: CentsUsdPattern3 = CentsUsdPattern3(client, _m(acc, 'greed_index')) - self.net: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'net_sentiment')) - self.pain_index: CentsUsdPattern3 = CentsUsdPattern3(client, _m(acc, 'pain_index')) + pass -class LossNuplProfitPattern: +class OverRangeUnderPattern11: + """Pattern struct for repeated tree structure.""" + pass + +class OverRangeUnderPattern17: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.loss: CentsNegativeUsdPattern = CentsNegativeUsdPattern(client, _m(acc, 'unrealized_loss')) - self.nupl: PpmRatioPattern = PpmRatioPattern(client, _m(acc, 'nupl')) - self.profit: CentsUsdPattern3 = CentsUsdPattern3(client, _m(acc, 'unrealized_profit')) + self.over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8 = _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern8(client, _m(acc, 'over')) + self.range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8 = _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern8(client, acc) + self.under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern8 = _100btc100k100sats10btc10k10m10sats1btc1k1mPattern8(client, _m(acc, 'under')) + +class OverRangeUnderPattern19: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9 = _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern9(client, _m(acc, 'over')) + self.range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9 = _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern9(client, acc) + self.under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern9 = _100btc100k100sats10btc10k10m10sats1btc1k1mPattern9(client, _m(acc, 'under')) + +class OverRangeUnderPattern: + """Pattern struct for repeated tree structure.""" + pass + +class OverRangeUnderPattern21: + """Pattern struct for repeated tree structure.""" + pass + +class OverRangeUnderPattern23: + """Pattern struct for repeated tree structure.""" + pass + +class OverRangeUnderPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.over: _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 = _10y12y18m1d1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2(client, acc, 'over') + self.range: _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2 = _10y12y18m1d1h1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mOverUnderPattern2(client, acc, '') + self.under: _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2 = _10y12y15y18m1m1w1y2m2y3m3y4m4y5m5y6m6y7y8y9mPattern2(client, acc, 'under') + +class OverRangeUnderPattern9: + """Pattern struct for repeated tree structure.""" + pass + +class OverRangeUnderPattern12: + """Pattern struct for repeated tree structure.""" + pass class PercentPpmRatioPattern2: """Pattern struct for repeated tree structure.""" @@ -4159,15 +4682,6 @@ class PpmPriceRatioPattern: self.price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, disc)) self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, f'ratio_{disc}')) -class RatioTransferValuePattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.ratio: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, _m(acc, 'asopr')) - self.transfer_volume: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, _m(acc, 'adj_value_created')) - self.value_destroyed: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, _m(acc, 'adj_value_destroyed')) - class RsiStochPattern: """Pattern struct for repeated tree structure.""" @@ -4177,6 +4691,10 @@ class RsiStochPattern: self.stoch_rsi_d: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, f'stoch_d_{disc}')) self.stoch_rsi_k: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, _m(acc, f'stoch_k_{disc}')) +class ToPattern2: + """Pattern struct for repeated tree structure.""" + pass + class _6bBlockTxPattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -4186,6 +4704,10 @@ class _6bBlockTxPattern(Generic[T]): self.block: MaxMedianMinPct10Pct25Pct75Pct90Pattern[T] = MaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) self.tx_index: SeriesPattern19[T] = SeriesPattern19(client, acc) +class AllLthSthPattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + pass + class AbsoluteRatePattern: """Pattern struct for repeated tree structure.""" @@ -4207,33 +4729,9 @@ class AbsoluteRatePattern3: def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.absolute: _1m1w1y24hPattern7 = _1m1w1y24hPattern7(client, acc) + self.absolute: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, acc) self.rate: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, acc) -class AddrUtxoPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.addr: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'addr_amount')) - self.utxo: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'utxo_amount')) - -class AllSthPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.all: BtcCentsDeltaSatsUsdPattern = BtcCentsDeltaSatsUsdPattern(client, _m(acc, 'supply')) - self.sth: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sth_supply')) - -class AllSthPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str, disc: str): - """Create pattern node with accumulated series name.""" - self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, disc)) - self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, f'sth_{disc}')) - class AwakeDormantPattern2: """Pattern struct for repeated tree structure.""" pass @@ -4310,37 +4808,101 @@ class CentsUsdPattern4: self.cents: SeriesPattern18[CentsSigned] = SeriesPattern18(client, _m(acc, 'cents')) self.usd: SeriesPattern18[Dollars] = SeriesPattern18(client, acc) -class CoindaysTransferPattern: +class CentsSatsPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.coindays_destroyed: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, _m(acc, 'coindays_destroyed')) - self.transfer_volume: AverageBlockCumulativeInSumPattern = AverageBlockCumulativeInSumPattern(client, _m(acc, 'transfer_volume')) + self.cents: CumulativePattern[StoredU64] = CumulativePattern(client, _m(acc, 'cents')) + self.sats: CumulativePattern[StoredU64] = CumulativePattern(client, _m(acc, 'sats')) + +class DiscountPremiumPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.discount: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, _p('veteran', acc)) + self.premium: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, _p('rookie', acc)) + +class DiscountPremiumPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.discount: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _p('veteran', acc)) + self.premium: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _p('rookie', acc)) + +class DiscountPremiumPattern5: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.discount: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('veteran', acc)) + self.premium: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('rookie', acc)) + +class DiscountPremiumPattern12: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.discount: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('veteran', acc)) + self.premium: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('rookie', acc)) + +class DiscountPremiumPattern13: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.discount: CentsUsdPattern3 = CentsUsdPattern3(client, _p('veteran', acc)) + self.premium: CentsUsdPattern3 = CentsUsdPattern3(client, _p('rookie', acc)) class FundedTotalPattern: """Pattern struct for repeated tree structure.""" pass -class ImmobileMobilePattern2: +class ImmobileMobilePattern3: """Pattern struct for repeated tree structure.""" pass -class InPattern2: +class LongShortPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.in_loss: CentsUsdPattern3 = CentsUsdPattern3(client, _m(acc, 'loss')) - self.in_profit: CentsUsdPattern3 = CentsUsdPattern3(client, _m(acc, 'profit')) + self.long: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, _p('lth', acc)) + self.short: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, _p('sth', acc)) -class InPattern: +class LongShortPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.in_loss: SharePattern = SharePattern(client, _m(acc, 'loss_share')) - self.in_profit: SharePattern = SharePattern(client, _m(acc, 'profit_share')) + self.long: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _p('lth', acc)) + self.short: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, _p('sth', acc)) + +class LongShortPattern6: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.long: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('lth', acc)) + self.short: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, _p('sth', acc)) + +class LongShortPattern13: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.long: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('lth', acc)) + self.short: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('sth', acc)) + +class LongShortPattern14: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClient, acc: str): + """Create pattern node with accumulated series name.""" + self.long: CentsUsdPattern3 = CentsUsdPattern3(client, _p('lth', acc)) + self.short: CentsUsdPattern3 = CentsUsdPattern3(client, _p('sth', acc)) class PerPattern: """Pattern struct for repeated tree structure.""" @@ -4374,70 +4936,45 @@ class PpmRatioPattern: self.ppm: SeriesPattern1[PartsPerMillionSigned32] = SeriesPattern1(client, _m(acc, 'ppm')) self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, acc) -class RatioValuePattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.ratio: _24hPattern = _24hPattern(client, _m(acc, 'sopr_24h')) - self.value_destroyed: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, _m(acc, 'value_destroyed')) - class SdSmaPattern: """Pattern struct for repeated tree structure.""" pass -class SpentUnspentPattern: +class DiscountPremiumPattern7(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.spent_count: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, _m(acc, 'spent_utxo_count')) - self.unspent_count: BaseDeltaPattern = BaseDeltaPattern(client, _m(acc, 'utxo_count')) + self.discount: SeriesPattern1[T] = SeriesPattern1(client, _p('veteran', acc)) + self.premium: SeriesPattern1[T] = SeriesPattern1(client, _p('rookie', acc)) -class ToPattern: +class LongShortPattern7(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.to_mcap: PercentPpmRatioPattern = PercentPpmRatioPattern(client, _m(acc, 'mcap')) - self.to_rcap: PercentPpmRatioPattern = PercentPpmRatioPattern(client, _m(acc, 'rcap')) - -class _24hPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self._24h: SeriesPattern1[StoredF64] = SeriesPattern1(client, acc) + self.long: SeriesPattern1[T] = SeriesPattern1(client, _p('lth', acc)) + self.short: SeriesPattern1[T] = SeriesPattern1(client, _p('sth', acc)) class InPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.in_loss: SharePattern2 = SharePattern2(client, acc) - -class NuplPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.nupl: PpmRatioPattern = PpmRatioPattern(client, acc) - -class PricePattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClient, acc: str): - """Create pattern node with accumulated series name.""" - self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, acc) + self.in_loss: SharePattern3 = SharePattern3(client, acc) class SharePattern: """Pattern struct for repeated tree structure.""" + pass + +class SharePattern2: + """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.share: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, acc) + self.share: AllLthSthPattern5 = AllLthSthPattern5(client, acc) -class SharePattern2: +class SharePattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): @@ -4458,19 +4995,19 @@ class SupplyPattern: """Create pattern node with accumulated series name.""" self.supply: InPattern3 = InPattern3(client, acc) -class TransferPattern: +class CumulativePattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.transfer_volume: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, acc) + self.cumulative: SeriesPattern18[T] = SeriesPattern18(client, acc) -class UnspentPattern: +class MatrixPattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClient, acc: str): """Create pattern node with accumulated series name.""" - self.unspent_count: BaseDeltaPattern = BaseDeltaPattern(client, acc) + self.matrix: SeriesPattern18[T] = SeriesPattern18(client, acc) # Series tree classes @@ -4825,7 +5362,7 @@ class SeriesTree_Inputs_ByType_InputCount: self.p2a: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2a_prevout_count') self.unknown: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'unknown_outputs_prevout_count') self.empty: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'empty_outputs_prevout_count') - self.height: SeriesPattern18[[StoredU16; 11]] = SeriesPattern18(client, 'prevout_count_by_type') + self.height: SeriesPattern18[StoredU16] = SeriesPattern18(client, 'prevout_count_by_type') class SeriesTree_Inputs_ByType_InputShare: """Series tree node.""" @@ -4859,7 +5396,7 @@ class SeriesTree_Inputs_ByType_TxCount: self.p2a: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'tx_count_with_p2a_prevout') self.unknown: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'tx_count_with_unknown_outputs_prevout') self.empty: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'tx_count_with_empty_outputs_prevout') - self.cumulative: SeriesPattern18[[StoredU64; 11]] = SeriesPattern18(client, 'tx_count_with_prevout_by_type_cumulative') + self.cumulative: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'tx_count_with_prevout_by_type_cumulative') class SeriesTree_Inputs_ByType: """Series tree node.""" @@ -4868,7 +5405,7 @@ class SeriesTree_Inputs_ByType: self.input_count: SeriesTree_Inputs_ByType_InputCount = SeriesTree_Inputs_ByType_InputCount(client) self.input_share: SeriesTree_Inputs_ByType_InputShare = SeriesTree_Inputs_ByType_InputShare(client) self.tx_count: SeriesTree_Inputs_ByType_TxCount = SeriesTree_Inputs_ByType_TxCount(client) - self.tx_share: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern2(client, 'tx_share_with') + self.tx_share: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern13(client, 'tx_share_with') class SeriesTree_Inputs: """Series tree node.""" @@ -5081,6 +5618,71 @@ class SeriesTree_Addrs_Data: self.funded: SeriesPattern34[FundedAddrData] = SeriesPattern34(client, 'funded_addr_data') self.empty: SeriesPattern35[EmptyAddrData] = SeriesPattern35(client, 'empty_addr_data') +class SeriesTree_Addrs_Funded_Balance_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_0sats_addr_count') + self._1sat_to_10sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1sat_to_10sats_addr_count') + self._10sats_to_100sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10sats_to_100sats_addr_count') + self._100sats_to_1k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_100sats_to_1k_sats_addr_count') + self._1k_sats_to_10k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1k_sats_to_10k_sats_addr_count') + self._10k_sats_to_100k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10k_sats_to_100k_sats_addr_count') + self._100k_sats_to_1m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_100k_sats_to_1m_sats_addr_count') + self._1m_sats_to_10m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1m_sats_to_10m_sats_addr_count') + self._10m_sats_to_1btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10m_sats_to_1btc_addr_count') + self._1btc_to_10btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1btc_to_10btc_addr_count') + self._10btc_to_100btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10btc_to_100btc_addr_count') + self._100btc_to_1k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_100btc_to_1k_btc_addr_count') + self._1k_btc_to_10k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1k_btc_to_10k_btc_addr_count') + self._10k_btc_to_100k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10k_btc_to_100k_btc_addr_count') + self.over_100k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_100k_btc_addr_count') + +class SeriesTree_Addrs_Funded_Balance_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10sats_addr_count') + self._100sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_100sats_addr_count') + self._1k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_1k_sats_addr_count') + self._10k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10k_sats_addr_count') + self._100k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_100k_sats_addr_count') + self._1m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_1m_sats_addr_count') + self._10m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10m_sats_addr_count') + self._1btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_1btc_addr_count') + self._10btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10btc_addr_count') + self._100btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_100btc_addr_count') + self._1k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_1k_btc_addr_count') + self._10k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10k_btc_addr_count') + self._100k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_100k_btc_addr_count') + +class SeriesTree_Addrs_Funded_Balance_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1sat_addr_count') + self._10sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10sats_addr_count') + self._100sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_100sats_addr_count') + self._1k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1k_sats_addr_count') + self._10k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10k_sats_addr_count') + self._100k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_100k_sats_addr_count') + self._1m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1m_sats_addr_count') + self._10m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10m_sats_addr_count') + self._1btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1btc_addr_count') + self._10btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10btc_addr_count') + self._100btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_100btc_addr_count') + self._1k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1k_btc_addr_count') + self._10k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10k_btc_addr_count') + +class SeriesTree_Addrs_Funded_Balance: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Addrs_Funded_Balance_Range = SeriesTree_Addrs_Funded_Balance_Range(client) + self.under: SeriesTree_Addrs_Funded_Balance_Under = SeriesTree_Addrs_Funded_Balance_Under(client) + self.over: SeriesTree_Addrs_Funded_Balance_Over = SeriesTree_Addrs_Funded_Balance_Over(client) + self.matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'addrs_addr_count_by_balance_range') + class SeriesTree_Addrs_Funded: """Series tree node.""" @@ -5095,6 +5697,7 @@ class SeriesTree_Addrs_Funded: self.p2tr: SeriesPattern1[StoredU64] = SeriesPattern1(client, 'p2tr_addr_count') self.p2a: SeriesPattern1[StoredU64] = SeriesPattern1(client, 'p2a_addr_count') self.height: SeriesPattern18[[StoredU64; 8]] = SeriesPattern18(client, 'addr_count_by_type') + self.balance: SeriesTree_Addrs_Funded_Balance = SeriesTree_Addrs_Funded_Balance(client) class SeriesTree_Addrs_Empty: """Series tree node.""" @@ -5111,29 +5714,15 @@ class SeriesTree_Addrs_Empty: self.p2a: SeriesPattern1[StoredU64] = SeriesPattern1(client, 'p2a_empty_addr_count') self.height: SeriesPattern18[[StoredU64; 8]] = SeriesPattern18(client, 'empty_addr_count_by_type') -class SeriesTree_Addrs_Activity_All: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.reactivated: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, 'reactivated_addrs') - self.sending: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, 'sending_addrs') - self.receiving: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, 'receiving_addrs') - self.bidirectional: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, 'bidirectional_addrs') - self.active: _1m1w1y24hBlockPattern = _1m1w1y24hBlockPattern(client, 'active_addrs') - class SeriesTree_Addrs_Activity: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.all: SeriesTree_Addrs_Activity_All = SeriesTree_Addrs_Activity_All(client) - self.p2pk65: ActiveBidirectionalReactivatedReceivingSendingPattern = ActiveBidirectionalReactivatedReceivingSendingPattern(client, 'p2pk65') - self.p2pk33: ActiveBidirectionalReactivatedReceivingSendingPattern = ActiveBidirectionalReactivatedReceivingSendingPattern(client, 'p2pk33') - self.p2pkh: ActiveBidirectionalReactivatedReceivingSendingPattern = ActiveBidirectionalReactivatedReceivingSendingPattern(client, 'p2pkh') - self.p2sh: ActiveBidirectionalReactivatedReceivingSendingPattern = ActiveBidirectionalReactivatedReceivingSendingPattern(client, 'p2sh') - self.p2wpkh: ActiveBidirectionalReactivatedReceivingSendingPattern = ActiveBidirectionalReactivatedReceivingSendingPattern(client, 'p2wpkh') - self.p2wsh: ActiveBidirectionalReactivatedReceivingSendingPattern = ActiveBidirectionalReactivatedReceivingSendingPattern(client, 'p2wsh') - self.p2tr: ActiveBidirectionalReactivatedReceivingSendingPattern = ActiveBidirectionalReactivatedReceivingSendingPattern(client, 'p2tr') - self.p2a: ActiveBidirectionalReactivatedReceivingSendingPattern = ActiveBidirectionalReactivatedReceivingSendingPattern(client, 'p2a') + self.reactivated: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(client, 'reactivated_addrs') + self.sending: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(client, 'sending_addrs') + self.receiving: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(client, 'receiving_addrs') + self.bidirectional: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(client, 'bidirectional_addrs') + self.active: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(client, 'active_addrs') class SeriesTree_Addrs_Total: """Series tree node.""" @@ -5448,15 +6037,8 @@ class SeriesTree_Addrs_AvgAmount: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.all: AddrUtxoPattern = AddrUtxoPattern(client, 'avg') - self.p2pk65: AddrUtxoPattern = AddrUtxoPattern(client, 'p2pk65_avg') - self.p2pk33: AddrUtxoPattern = AddrUtxoPattern(client, 'p2pk33_avg') - self.p2pkh: AddrUtxoPattern = AddrUtxoPattern(client, 'p2pkh_avg') - self.p2sh: AddrUtxoPattern = AddrUtxoPattern(client, 'p2sh_avg') - self.p2wpkh: AddrUtxoPattern = AddrUtxoPattern(client, 'p2wpkh_avg') - self.p2wsh: AddrUtxoPattern = AddrUtxoPattern(client, 'p2wsh_avg') - self.p2tr: AddrUtxoPattern = AddrUtxoPattern(client, 'p2tr_avg') - self.p2a: AddrUtxoPattern = AddrUtxoPattern(client, 'p2a_avg') + self.utxo: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2 = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2(client, 'avg_utxo_amount') + self.addr: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2 = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern2(client, 'avg_addr_amount') class SeriesTree_Addrs: """Series tree node.""" @@ -5874,7 +6456,7 @@ class SeriesTree_Frameworks_Cointime_AgeRange_CoindaysCreated: self._10y_to_12y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_10y_to_12y_old_coindays_created') self._12y_to_15y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_12y_to_15y_old_coindays_created') self.over_15y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_15y_old_coindays_created') - self.cumulative: SeriesPattern18[[StoredF64; 23]] = SeriesPattern18(client, 'utxos_age_range_coindays_created_cumulative') + self.cumulative: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_age_range_coindays_created_cumulative') class SeriesTree_Frameworks_Cointime_AgeRange_CoindaysConsumed: """Series tree node.""" @@ -5903,7 +6485,7 @@ class SeriesTree_Frameworks_Cointime_AgeRange_CoindaysConsumed: self._10y_to_12y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_10y_to_12y_old_coindays_consumed') self._12y_to_15y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_12y_to_15y_old_coindays_consumed') self.over_15y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_15y_old_coindays_consumed') - self.cumulative: SeriesPattern18[[StoredF64; 23]] = SeriesPattern18(client, 'utxos_age_range_coindays_consumed_cumulative') + self.cumulative: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_age_range_coindays_consumed_cumulative') class SeriesTree_Frameworks_Cointime_AgeRange_CoindaysStored: """Series tree node.""" @@ -5932,7 +6514,7 @@ class SeriesTree_Frameworks_Cointime_AgeRange_CoindaysStored: self._10y_to_12y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_10y_to_12y_old_coindays_stored') self._12y_to_15y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_12y_to_15y_old_coindays_stored') self.over_15y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_15y_old_coindays_stored') - self.cumulative: SeriesPattern18[[StoredF64; 23]] = SeriesPattern18(client, 'utxos_age_range_coindays_stored_cumulative') + self.cumulative: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_age_range_coindays_stored_cumulative') class SeriesTree_Frameworks_Cointime_AgeRange_Activity_Wakefulness: """Series tree node.""" @@ -6025,7 +6607,7 @@ class SeriesTree_Frameworks_Cointime_AgeRange_Activity: self.wakefulness: SeriesTree_Frameworks_Cointime_AgeRange_Activity_Wakefulness = SeriesTree_Frameworks_Cointime_AgeRange_Activity_Wakefulness(client) self.dormancy: SeriesTree_Frameworks_Cointime_AgeRange_Activity_Dormancy = SeriesTree_Frameworks_Cointime_AgeRange_Activity_Dormancy(client) self.wakefulness_to_dormancy: SeriesTree_Frameworks_Cointime_AgeRange_Activity_WakefulnessToDormancy = SeriesTree_Frameworks_Cointime_AgeRange_Activity_WakefulnessToDormancy(client) - self.height: SeriesPattern18[[StoredF64; 23]] = SeriesPattern18(client, 'utxos_age_range_wakefulness') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_age_range_wakefulness') class SeriesTree_Frameworks_Cointime_AgeRange_Supply_Awake: """Series tree node.""" @@ -6054,7 +6636,7 @@ class SeriesTree_Frameworks_Cointime_AgeRange_Supply_Awake: self._10y_to_12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_10y_to_12y_old_awake_supply') self._12y_to_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_12y_to_15y_old_awake_supply') self.over_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_15y_old_awake_supply') - self.height: SeriesPattern18[[Sats; 23]] = SeriesPattern18(client, 'utxos_age_range_awake_supply_sats') + self.height: SeriesPattern18[Sats] = SeriesPattern18(client, 'utxos_age_range_awake_supply_sats') class SeriesTree_Frameworks_Cointime_AgeRange_Supply_Dormant: """Series tree node.""" @@ -6083,7 +6665,7 @@ class SeriesTree_Frameworks_Cointime_AgeRange_Supply_Dormant: self._10y_to_12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_10y_to_12y_old_dormant_supply') self._12y_to_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_12y_to_15y_old_dormant_supply') self.over_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_15y_old_dormant_supply') - self.height: SeriesPattern18[[Sats; 23]] = SeriesPattern18(client, 'utxos_age_range_dormant_supply_sats') + self.height: SeriesPattern18[Sats] = SeriesPattern18(client, 'utxos_age_range_dormant_supply_sats') class SeriesTree_Frameworks_Cointime_AgeRange_Supply: """Series tree node.""" @@ -6106,19 +6688,19 @@ class SeriesTree_Frameworks_Cointime_Awake_Supply: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, 'awake_supply') - self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'awake_supply_sats') - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'awake_supply_usd') - self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'awake_supply_cents') - self.in_loss: SharePattern2 = SharePattern2(client, 'awake_supply_in_loss_share') + self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, 'all_awake_supply') + self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'all_awake_supply_sats') + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'all_awake_supply_usd') + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'all_awake_supply_cents') + self.in_loss: SharePattern3 = SharePattern3(client, 'all_awake_supply_in_loss_share') class SeriesTree_Frameworks_Cointime_Awake: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): self.supply: SeriesTree_Frameworks_Cointime_Awake_Supply = SeriesTree_Frameworks_Cointime_Awake_Supply(client) - self.cap: CentsUsdPattern3 = CentsUsdPattern3(client, 'awake_cap') - self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'awake_price') + self.cap: CentsUsdPattern3 = CentsUsdPattern3(client, 'all_awake_cap') + self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'all_awake_price') class SeriesTree_Frameworks_Cointime_Sth_Awake_Supply: """Series tree node.""" @@ -6128,7 +6710,7 @@ class SeriesTree_Frameworks_Cointime_Sth_Awake_Supply: self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'sth_awake_supply_sats') self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'sth_awake_supply_usd') self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'sth_awake_supply_cents') - self.in_loss: SharePattern2 = SharePattern2(client, 'sth_awake_supply_in_loss_share') + self.in_loss: SharePattern3 = SharePattern3(client, 'sth_awake_supply_in_loss_share') class SeriesTree_Frameworks_Cointime_Sth_Awake: """Series tree node.""" @@ -6153,7 +6735,7 @@ class SeriesTree_Frameworks_Cointime_Lth_Awake_Supply: self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'lth_awake_supply_sats') self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'lth_awake_supply_usd') self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'lth_awake_supply_cents') - self.in_loss: SharePattern2 = SharePattern2(client, 'lth_awake_supply_in_loss_share') + self.in_loss: SharePattern3 = SharePattern3(client, 'lth_awake_supply_in_loss_share') class SeriesTree_Frameworks_Cointime_Lth_Awake: """Series tree node.""" @@ -6170,6 +6752,16 @@ class SeriesTree_Frameworks_Cointime_Lth: self.awake: SeriesTree_Frameworks_Cointime_Lth_Awake = SeriesTree_Frameworks_Cointime_Lth_Awake(client) self.dormant: SupplyPattern2 = SupplyPattern2(client, 'lth_dormant_supply') +class SeriesTree_Frameworks_Cointime_Sources: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.awake_supply: SeriesPattern18[Sats] = SeriesPattern18(client, 'cointime_awake_supply_sats_by_term') + self.dormant_supply: SeriesPattern18[Sats] = SeriesPattern18(client, 'cointime_dormant_supply_sats_by_term') + self.awake_cap: SeriesPattern18[Cents] = SeriesPattern18(client, 'cointime_awake_cap_cents_by_term') + self.awake_price: SeriesPattern18[Cents] = SeriesPattern18(client, 'cointime_awake_price_cents_by_aggregate') + self.supply_in_loss_share: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'cointime_awake_supply_in_loss_share_by_term') + class SeriesTree_Frameworks_Cointime_Supply_Active: """Series tree node.""" @@ -6178,7 +6770,7 @@ class SeriesTree_Frameworks_Cointime_Supply_Active: self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'active_supply_sats') self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'active_supply_usd') self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'active_supply_cents') - self.in_loss: SharePattern2 = SharePattern2(client, 'cointime_supply_in_loss_share') + self.in_loss: SharePattern3 = SharePattern3(client, 'cointime_supply_in_loss_share') class SeriesTree_Frameworks_Cointime_Supply: """Series tree node.""" @@ -6239,9 +6831,10 @@ class SeriesTree_Frameworks_Cointime: self.activity: SeriesTree_Frameworks_Cointime_Activity = SeriesTree_Frameworks_Cointime_Activity(client) self.age_range: SeriesTree_Frameworks_Cointime_AgeRange = SeriesTree_Frameworks_Cointime_AgeRange(client) self.awake: SeriesTree_Frameworks_Cointime_Awake = SeriesTree_Frameworks_Cointime_Awake(client) - self.dormant: SupplyPattern2 = SupplyPattern2(client, 'dormant_supply') + self.dormant: SupplyPattern2 = SupplyPattern2(client, 'all_dormant_supply') self.sth: SeriesTree_Frameworks_Cointime_Sth = SeriesTree_Frameworks_Cointime_Sth(client) self.lth: SeriesTree_Frameworks_Cointime_Lth = SeriesTree_Frameworks_Cointime_Lth(client) + self.sources: SeriesTree_Frameworks_Cointime_Sources = SeriesTree_Frameworks_Cointime_Sources(client) self.supply: SeriesTree_Frameworks_Cointime_Supply = SeriesTree_Frameworks_Cointime_Supply(client) self.value: SeriesTree_Frameworks_Cointime_Value = SeriesTree_Frameworks_Cointime_Value(client) self.cap: SeriesTree_Frameworks_Cointime_Cap = SeriesTree_Frameworks_Cointime_Cap(client) @@ -6276,7 +6869,7 @@ class SeriesTree_Frameworks_Coinflow_AgeRange_SpendingRate: self._10y_to_12y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_10y_to_12y_old_spending_rate') self._12y_to_15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_12y_to_15y_old_spending_rate') self.over_15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_15y_old_spending_rate') - self.height: SeriesPattern18[[StoredF64; 23]] = SeriesPattern18(client, 'utxos_age_range_spending_rate') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_age_range_spending_rate') class SeriesTree_Frameworks_Coinflow_AgeRange_SpendingExposure_Mobility: """Series tree node.""" @@ -6334,7 +6927,7 @@ class SeriesTree_Frameworks_Coinflow_AgeRange_SpendingExposure: self._12y_to_15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_12y_to_15y_old_spending_exposure') self.over_15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_15y_old_spending_exposure') self.mobility: SeriesTree_Frameworks_Coinflow_AgeRange_SpendingExposure_Mobility = SeriesTree_Frameworks_Coinflow_AgeRange_SpendingExposure_Mobility(client) - self.height: SeriesPattern18[[StoredF64; 23]] = SeriesPattern18(client, 'utxos_age_range_spending_exposure') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_age_range_spending_exposure') class SeriesTree_Frameworks_Coinflow_AgeRange_Supply_Mobile: """Series tree node.""" @@ -6363,7 +6956,7 @@ class SeriesTree_Frameworks_Coinflow_AgeRange_Supply_Mobile: self._10y_to_12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_10y_to_12y_old_mobile_supply') self._12y_to_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_12y_to_15y_old_mobile_supply') self.over_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_15y_old_mobile_supply') - self.height: SeriesPattern18[[Sats; 23]] = SeriesPattern18(client, 'utxos_age_range_mobile_supply_sats') + self.height: SeriesPattern18[Sats] = SeriesPattern18(client, 'utxos_age_range_mobile_supply_sats') class SeriesTree_Frameworks_Coinflow_AgeRange_Supply_Immobile: """Series tree node.""" @@ -6392,7 +6985,7 @@ class SeriesTree_Frameworks_Coinflow_AgeRange_Supply_Immobile: self._10y_to_12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_10y_to_12y_old_immobile_supply') self._12y_to_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_12y_to_15y_old_immobile_supply') self.over_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_15y_old_immobile_supply') - self.height: SeriesPattern18[[Sats; 23]] = SeriesPattern18(client, 'utxos_age_range_immobile_supply_sats') + self.height: SeriesPattern18[Sats] = SeriesPattern18(client, 'utxos_age_range_immobile_supply_sats') class SeriesTree_Frameworks_Coinflow_AgeRange_Supply: """Series tree node.""" @@ -6413,18 +7006,18 @@ class SeriesTree_Frameworks_Coinflow_Supply_Mobile: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, 'mobile_supply') - self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'mobile_supply_sats') - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'mobile_supply_usd') - self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'mobile_supply_cents') - self.in_loss: SharePattern2 = SharePattern2(client, 'coinflow_supply_in_loss_share') + self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, 'all_mobile_supply') + self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'all_mobile_supply_sats') + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'all_mobile_supply_usd') + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'all_mobile_supply_cents') + self.in_loss: SharePattern3 = SharePattern3(client, 'all_coinflow_supply_in_loss_share') class SeriesTree_Frameworks_Coinflow_Supply: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): self.mobile: SeriesTree_Frameworks_Coinflow_Supply_Mobile = SeriesTree_Frameworks_Coinflow_Supply_Mobile(client) - self.immobile: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'immobile_supply') + self.immobile: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'all_immobile_supply') class SeriesTree_Frameworks_Coinflow_Sth_Supply_Mobile: """Series tree node.""" @@ -6434,7 +7027,7 @@ class SeriesTree_Frameworks_Coinflow_Sth_Supply_Mobile: self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'sth_mobile_supply_sats') self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'sth_mobile_supply_usd') self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'sth_mobile_supply_cents') - self.in_loss: SharePattern2 = SharePattern2(client, 'sth_coinflow_supply_in_loss_share') + self.in_loss: SharePattern3 = SharePattern3(client, 'sth_coinflow_supply_in_loss_share') class SeriesTree_Frameworks_Coinflow_Sth_Supply: """Series tree node.""" @@ -6448,7 +7041,7 @@ class SeriesTree_Frameworks_Coinflow_Sth: def __init__(self, client: BrkClient, base_path: str = ''): self.supply: SeriesTree_Frameworks_Coinflow_Sth_Supply = SeriesTree_Frameworks_Coinflow_Sth_Supply(client) - self.horizon: _1m1y2y3m4y6m8yPattern = _1m1y2y3m4y6m8yPattern(client, 'sth_coinflow') + self.horizon: _1m1y2y3m4y6m8yPattern2 = _1m1y2y3m4y6m8yPattern2(client, 'sth_coinflow') self.cap: CentsUsdPattern3 = CentsUsdPattern3(client, 'sth_coinflow_cap') self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'sth_coinflow_price') @@ -6460,7 +7053,7 @@ class SeriesTree_Frameworks_Coinflow_Lth_Supply_Mobile: self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'lth_mobile_supply_sats') self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'lth_mobile_supply_usd') self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'lth_mobile_supply_cents') - self.in_loss: SharePattern2 = SharePattern2(client, 'lth_coinflow_supply_in_loss_share') + self.in_loss: SharePattern3 = SharePattern3(client, 'lth_coinflow_supply_in_loss_share') class SeriesTree_Frameworks_Coinflow_Lth_Supply: """Series tree node.""" @@ -6474,21 +7067,51 @@ class SeriesTree_Frameworks_Coinflow_Lth: def __init__(self, client: BrkClient, base_path: str = ''): self.supply: SeriesTree_Frameworks_Coinflow_Lth_Supply = SeriesTree_Frameworks_Coinflow_Lth_Supply(client) - self.horizon: _1m1y2y3m4y6m8yPattern = _1m1y2y3m4y6m8yPattern(client, 'lth_coinflow') + self.horizon: _1m1y2y3m4y6m8yPattern2 = _1m1y2y3m4y6m8yPattern2(client, 'lth_coinflow') self.cap: CentsUsdPattern3 = CentsUsdPattern3(client, 'lth_coinflow_cap') self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'lth_coinflow_price') +class SeriesTree_Frameworks_Coinflow_AggregateSources_Supply: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.mobile: SeriesPattern18[Sats] = SeriesPattern18(client, 'coinflow_mobile_supply_sats_by_term') + self.immobile: SeriesPattern18[Sats] = SeriesPattern18(client, 'coinflow_immobile_supply_sats_by_term') + +class SeriesTree_Frameworks_Coinflow_AggregateSources_Horizon: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._8y: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coinflow_8y_supply_in_loss_share_by_aggregate') + self._4y: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coinflow_4y_supply_in_loss_share_by_aggregate') + self._2y: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coinflow_2y_supply_in_loss_share_by_aggregate') + self._1y: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coinflow_1y_supply_in_loss_share_by_aggregate') + self._6m: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coinflow_6m_supply_in_loss_share_by_aggregate') + self._3m: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coinflow_3m_supply_in_loss_share_by_aggregate') + self._1m: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coinflow_1m_supply_in_loss_share_by_aggregate') + +class SeriesTree_Frameworks_Coinflow_AggregateSources: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.supply: SeriesTree_Frameworks_Coinflow_AggregateSources_Supply = SeriesTree_Frameworks_Coinflow_AggregateSources_Supply(client) + self.supply_in_loss_share: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coinflow_supply_in_loss_share_by_aggregate') + self.horizon: SeriesTree_Frameworks_Coinflow_AggregateSources_Horizon = SeriesTree_Frameworks_Coinflow_AggregateSources_Horizon(client) + self.cap: SeriesPattern18[Cents] = SeriesPattern18(client, 'coinflow_cap_cents_by_term') + self.price: SeriesPattern18[Cents] = SeriesPattern18(client, 'coinflow_price_cents_by_aggregate') + class SeriesTree_Frameworks_Coinflow: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): self.age_range: SeriesTree_Frameworks_Coinflow_AgeRange = SeriesTree_Frameworks_Coinflow_AgeRange(client) self.supply: SeriesTree_Frameworks_Coinflow_Supply = SeriesTree_Frameworks_Coinflow_Supply(client) - self.horizon: _1m1y2y3m4y6m8yPattern = _1m1y2y3m4y6m8yPattern(client, 'coinflow') - self.cap: CentsUsdPattern3 = CentsUsdPattern3(client, 'coinflow_cap') - self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'coinflow_price') + self.horizon: _1m1y2y3m4y6m8yPattern2 = _1m1y2y3m4y6m8yPattern2(client, 'all_coinflow') + self.cap: CentsUsdPattern3 = CentsUsdPattern3(client, 'all_coinflow_cap') + self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'all_coinflow_price') self.sth: SeriesTree_Frameworks_Coinflow_Sth = SeriesTree_Frameworks_Coinflow_Sth(client) self.lth: SeriesTree_Frameworks_Coinflow_Lth = SeriesTree_Frameworks_Coinflow_Lth(client) + self.aggregate_sources: SeriesTree_Frameworks_Coinflow_AggregateSources = SeriesTree_Frameworks_Coinflow_AggregateSources(client) class SeriesTree_Frameworks: """Series tree node.""" @@ -7478,445 +8101,163 @@ class SeriesTree_Supply: self.market_minus_realized_cap_growth_rate: _1m1w1y24hPattern[PartsPerMillionSigned64] = _1m1w1y24hPattern(client, 'market_minus_realized_cap_growth_rate') self.hodled_or_lost: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'hodled_or_lost_supply') -class SeriesTree_Cohorts_Utxo_All_Outputs: +class SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Range: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.unspent_count: BaseDeltaPattern = BaseDeltaPattern(client, 'utxo_count') - self.spent_count: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'spent_utxo_count') + self.under_1h: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1h_old_supply') + self._1h_to_1d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1h_to_1d_old_supply') + self._1d_to_1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1d_to_1w_old_supply') + self._1w_to_1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1w_to_1m_old_supply') + self._1m_to_2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1m_to_2m_old_supply') + self._2m_to_3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_2m_to_3m_old_supply') + self._3m_to_4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_3m_to_4m_old_supply') + self._4m_to_5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_4m_to_5m_old_supply') + self._5m_to_6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_5m_to_6m_old_supply') + self._6m_to_9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_6m_to_9m_old_supply') + self._9m_to_1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_9m_to_1y_old_supply') + self._1y_to_18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1y_to_18m_old_supply') + self._18m_to_2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_18m_to_2y_old_supply') + self._2y_to_3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_2y_to_3y_old_supply') + self._3y_to_4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_3y_to_4y_old_supply') + self._4y_to_5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_4y_to_5y_old_supply') + self._5y_to_6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_5y_to_6y_old_supply') + self._6y_to_7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_6y_to_7y_old_supply') + self._7y_to_8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_7y_to_8y_old_supply') + self._8y_to_10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_8y_to_10y_old_supply') + self._10y_to_12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_10y_to_12y_old_supply') + self._12y_to_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_12y_to_15y_old_supply') + self.over_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_15y_old_supply') -class SeriesTree_Cohorts_Utxo_All_Activity: +class SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Under: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.transfer_volume: AverageBlockCumulativeInSumPattern = AverageBlockCumulativeInSumPattern(client, 'transfer_volume') - self.coindays_destroyed: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'coindays_destroyed') - self.coinyears_destroyed: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'coinyears_destroyed') - self.dormancy: _1m1w1y24hHeightPattern = _1m1w1y24hHeightPattern(client, 'dormancy') + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1w_old_supply') + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1m_old_supply') + self._2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_2m_old_supply') + self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_3m_old_supply') + self._4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_4m_old_supply') + self._5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_5m_old_supply') + self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_6m_old_supply') + self._9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_9m_old_supply') + self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1y_old_supply') + self._18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_18m_old_supply') + self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_2y_old_supply') + self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_3y_old_supply') + self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_4y_old_supply') + self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_5y_old_supply') + self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_6y_old_supply') + self._7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_7y_old_supply') + self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_8y_old_supply') + self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_10y_old_supply') + self._12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_12y_old_supply') + self._15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_15y_old_supply') -class SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted: +class SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Over: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.ratio: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, 'asopr') - self.transfer_volume: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, 'adj_value_created') - self.value_destroyed: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, 'adj_value_destroyed') + self._1d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1d_old_supply') + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1w_old_supply') + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1m_old_supply') + self._2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_2m_old_supply') + self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_3m_old_supply') + self._4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_4m_old_supply') + self._5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_5m_old_supply') + self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_6m_old_supply') + self._9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_9m_old_supply') + self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1y_old_supply') + self._18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_18m_old_supply') + self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_2y_old_supply') + self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_3y_old_supply') + self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_4y_old_supply') + self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_5y_old_supply') + self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_6y_old_supply') + self._7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_7y_old_supply') + self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_8y_old_supply') + self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_10y_old_supply') + self._12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_12y_old_supply') -class SeriesTree_Cohorts_Utxo_All_Realized_Sopr: +class SeriesTree_Cohorts_Cohorts_Supply_Total_Age: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.value_destroyed: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, 'value_destroyed') - self.ratio: _1m1w1y24hHeightPattern4 = _1m1w1y24hHeightPattern4(client, 'sopr') - self.adjusted: SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted = SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted(client) + self.range: SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Range = SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Under = SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Over = SeriesTree_Cohorts_Cohorts_Supply_Total_Age_Over(client) -class SeriesTree_Cohorts_Utxo_All_Realized: +class SeriesTree_Cohorts_Cohorts_Supply_Total_Epoch: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.cap: CentsDeltaToUsdPattern = CentsDeltaToUsdPattern(client, 'realized_cap') - self.profit: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'realized_profit') - self.loss: BlockCumulativeNegativeSumPattern = BlockCumulativeNegativeSumPattern(client, 'realized_loss') - self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'realized_price') - self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'mvrv') - self.net_pnl: BlockChangeCumulativeDeltaSumPattern = BlockChangeCumulativeDeltaSumPattern(client, 'net') - self.sopr: SeriesTree_Cohorts_Utxo_All_Realized_Sopr = SeriesTree_Cohorts_Utxo_All_Realized_Sopr(client) - self.gross_pnl: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'realized_gross_pnl') - self.sell_side_risk_ratio: _1m1w1y24hHeightPattern3 = _1m1w1y24hHeightPattern3(client, 'sell_side_risk_ratio') - self.peak_regret: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'realized_peak_regret') - self.capitalized: PricePattern = PricePattern(client, 'capitalized_price') - self.profit_to_loss_ratio: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, 'realized_profit_to_loss_ratio') + self._0: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_0_supply') + self._1: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_1_supply') + self._2: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_2_supply') + self._3: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_3_supply') + self._4: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_4_supply') -class SeriesTree_Cohorts_Utxo_All_CostBasis: +class SeriesTree_Cohorts_Cohorts_Supply_Total_Class: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.in_profit: PerPattern = PerPattern(client, 'cost_basis_in_profit_per') - self.in_loss: PerPattern = PerPattern(client, 'cost_basis_in_loss_per') - self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'cost_basis_min') - self.max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'cost_basis_max') - self.per_coin: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, 'cost_basis_per_coin') - self.per_dollar: HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = HeightPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, 'cost_basis_per_dollar') - self.supply_density: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'supply_density') + self._2009: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2009_supply') + self._2010: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2010_supply') + self._2011: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2011_supply') + self._2012: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2012_supply') + self._2013: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2013_supply') + self._2014: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2014_supply') + self._2015: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2015_supply') + self._2016: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2016_supply') + self._2017: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2017_supply') + self._2018: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2018_supply') + self._2019: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2019_supply') + self._2020: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2020_supply') + self._2021: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2021_supply') + self._2022: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2022_supply') + self._2023: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2023_supply') + self._2024: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2024_supply') + self._2025: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2025_supply') + self._2026: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2026_supply') -class SeriesTree_Cohorts_Utxo_All_Unrealized_Profit: +class SeriesTree_Cohorts_Cohorts_Supply_Total_UtxoAmount: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'unrealized_profit') - self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'unrealized_profit_cents') - self.to_mcap: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'unrealized_profit_to_mcap') - self.to_own_gross_pnl: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'unrealized_profit_to_own_gross_pnl') + self.range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10 = _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10(client, 'utxos') + self.under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10 = _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10(client, 'utxos_under') + self.over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10 = _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10(client, 'utxos_over') -class SeriesTree_Cohorts_Utxo_All_Unrealized_Loss: +class SeriesTree_Cohorts_Cohorts_Supply_Total_AddrBalance: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'unrealized_loss') - self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'unrealized_loss_cents') - self.negative: SeriesPattern1[Dollars] = SeriesPattern1(client, 'unrealized_loss_neg') - self.to_mcap: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'unrealized_loss_to_mcap') - self.to_own_gross_pnl: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'unrealized_loss_to_own_gross_pnl') + self.range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10 = _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern10(client, 'addrs') + self.under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10 = _100btc100k100sats10btc10k10m10sats1btc1k1mPattern10(client, 'addrs_under') + self.over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10 = _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern10(client, 'addrs_over') + self.matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'addrs_supply_sats_by_balance_range') -class SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl: +class SeriesTree_Cohorts_Cohorts_Supply_Total: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'net_unrealized_pnl') - self.cents: SeriesPattern1[CentsSigned] = SeriesPattern1(client, 'net_unrealized_pnl_cents') - self.to_own_gross_pnl: PercentPpmRatioPattern3 = PercentPpmRatioPattern3(client, 'net_unrealized_pnl_to_own_gross_pnl') + self.all: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'supply') + self.age: SeriesTree_Cohorts_Cohorts_Supply_Total_Age = SeriesTree_Cohorts_Cohorts_Supply_Total_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Supply_Total_Epoch = SeriesTree_Cohorts_Cohorts_Supply_Total_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Supply_Total_Class = SeriesTree_Cohorts_Cohorts_Supply_Total_Class(client) + self.entry: DiscountPremiumPattern12 = DiscountPremiumPattern12(client, 'supply') + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Supply_Total_UtxoAmount = SeriesTree_Cohorts_Cohorts_Supply_Total_UtxoAmount(client) + self.term: LongShortPattern13 = LongShortPattern13(client, 'supply') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10(client, 'supply') + self.age_range_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'utxos_supply_sats_by_age_range') + self.epoch_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_sats_by_epoch') + self.class_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_sats_by_class') + self.entry_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_sats_by_entry') + self.type_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_sats_by_type') + self.amount_range_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'utxos_supply_sats_by_amount_range') + self.addr_balance: SeriesTree_Cohorts_Cohorts_Supply_Total_AddrBalance = SeriesTree_Cohorts_Cohorts_Supply_Total_AddrBalance(client) -class SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.pain_index: CentsUsdPattern3 = CentsUsdPattern3(client, 'pain_index') - self.greed_index: CentsUsdPattern3 = CentsUsdPattern3(client, 'greed_index') - self.net: CentsUsdPattern = CentsUsdPattern(client, 'net_sentiment') - -class SeriesTree_Cohorts_Utxo_All_Unrealized: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.nupl: PpmRatioPattern = PpmRatioPattern(client, 'nupl') - self.profit: SeriesTree_Cohorts_Utxo_All_Unrealized_Profit = SeriesTree_Cohorts_Utxo_All_Unrealized_Profit(client) - self.loss: SeriesTree_Cohorts_Utxo_All_Unrealized_Loss = SeriesTree_Cohorts_Utxo_All_Unrealized_Loss(client) - self.net_pnl: SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl = SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl(client) - self.gross_pnl: CentsUsdPattern3 = CentsUsdPattern3(client, 'unrealized_gross_pnl') - self.invested_capital: InPattern2 = InPattern2(client, 'invested_capital_in') - self.capitalized_cap_in_profit_raw: SeriesPattern18[CentsSquaredSats] = SeriesPattern18(client, 'capitalized_cap_in_profit_raw') - self.capitalized_cap_in_loss_raw: SeriesPattern18[CentsSquaredSats] = SeriesPattern18(client, 'capitalized_cap_in_loss_raw') - self.sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment = SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment(client) - -class SeriesTree_Cohorts_Utxo_All: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.supply: DeltaDominanceHalfInTotalPattern2 = DeltaDominanceHalfInTotalPattern2(client, 'supply') - self.outputs: SeriesTree_Cohorts_Utxo_All_Outputs = SeriesTree_Cohorts_Utxo_All_Outputs(client) - self.activity: SeriesTree_Cohorts_Utxo_All_Activity = SeriesTree_Cohorts_Utxo_All_Activity(client) - self.realized: SeriesTree_Cohorts_Utxo_All_Realized = SeriesTree_Cohorts_Utxo_All_Realized(client) - self.cost_basis: SeriesTree_Cohorts_Utxo_All_CostBasis = SeriesTree_Cohorts_Utxo_All_CostBasis(client) - self.unrealized: SeriesTree_Cohorts_Utxo_All_Unrealized = SeriesTree_Cohorts_Utxo_All_Unrealized(client) - self.invested_capital: InPattern = InPattern(client, 'invested_capital_in') - -class SeriesTree_Cohorts_Utxo_Sth: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.supply: DeltaDominanceHalfInTotalPattern2 = DeltaDominanceHalfInTotalPattern2(client, 'sth_supply') - self.outputs: SpentUnspentPattern = SpentUnspentPattern(client, 'sth') - self.activity: CoindaysCoinyearsDormancyTransferPattern = CoindaysCoinyearsDormancyTransferPattern(client, 'sth') - self.realized: CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern = CapCapitalizedGrossLossMvrvNetPeakPriceProfitSellSoprPattern(client, 'sth') - self.cost_basis: InMaxMinPerSupplyPattern = InMaxMinPerSupplyPattern(client, 'sth') - self.unrealized: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2 = CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(client, 'sth') - self.invested_capital: InPattern = InPattern(client, 'sth_invested_capital_in') - -class SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.value_destroyed: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, 'lth_value_destroyed') - self.ratio: _1m1w1y24hHeightPattern4 = _1m1w1y24hHeightPattern4(client, 'lth_sopr') - -class SeriesTree_Cohorts_Utxo_Lth_Realized: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.cap: CentsDeltaToUsdPattern = CentsDeltaToUsdPattern(client, 'lth_realized_cap') - self.profit: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'lth_realized_profit') - self.loss: BlockCumulativeNegativeSumPattern = BlockCumulativeNegativeSumPattern(client, 'lth_realized_loss') - self.price: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'lth_realized_price') - self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'lth_mvrv') - self.net_pnl: BlockChangeCumulativeDeltaSumPattern = BlockChangeCumulativeDeltaSumPattern(client, 'lth_net') - self.sopr: SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr = SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr(client) - self.gross_pnl: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'lth_realized_gross_pnl') - self.sell_side_risk_ratio: _1m1w1y24hHeightPattern3 = _1m1w1y24hHeightPattern3(client, 'lth_sell_side_risk_ratio') - self.peak_regret: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'lth_realized_peak_regret') - self.capitalized: PricePattern = PricePattern(client, 'lth_capitalized_price') - self.profit_to_loss_ratio: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, 'lth_realized_profit_to_loss_ratio') - -class SeriesTree_Cohorts_Utxo_Lth: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.supply: DeltaDominanceHalfInTotalPattern2 = DeltaDominanceHalfInTotalPattern2(client, 'lth_supply') - self.outputs: SpentUnspentPattern = SpentUnspentPattern(client, 'lth') - self.activity: CoindaysCoinyearsDormancyTransferPattern = CoindaysCoinyearsDormancyTransferPattern(client, 'lth') - self.realized: SeriesTree_Cohorts_Utxo_Lth_Realized = SeriesTree_Cohorts_Utxo_Lth_Realized(client) - self.cost_basis: InMaxMinPerSupplyPattern = InMaxMinPerSupplyPattern(client, 'lth') - self.unrealized: CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2 = CapitalizedGrossInvestedLossNetNuplProfitSentimentPattern2(client, 'lth') - self.invested_capital: InPattern = InPattern(client, 'lth_invested_capital_in') - -class SeriesTree_Cohorts_Utxo_AgeRange: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.under_1h: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_1h_old') - self._1h_to_1d: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_1h_to_1d_old') - self._1d_to_1w: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_1d_to_1w_old') - self._1w_to_1m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_1w_to_1m_old') - self._1m_to_2m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_1m_to_2m_old') - self._2m_to_3m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_2m_to_3m_old') - self._3m_to_4m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_3m_to_4m_old') - self._4m_to_5m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_4m_to_5m_old') - self._5m_to_6m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_5m_to_6m_old') - self._6m_to_9m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_6m_to_9m_old') - self._9m_to_1y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_9m_to_1y_old') - self._1y_to_18m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_1y_to_18m_old') - self._18m_to_2y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_18m_to_2y_old') - self._2y_to_3y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_2y_to_3y_old') - self._3y_to_4y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_3y_to_4y_old') - self._4y_to_5y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_4y_to_5y_old') - self._5y_to_6y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_5y_to_6y_old') - self._6y_to_7y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_6y_to_7y_old') - self._7y_to_8y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_7y_to_8y_old') - self._8y_to_10y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_8y_to_10y_old') - self._10y_to_12y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_10y_to_12y_old') - self._12y_to_15y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_12y_to_15y_old') - self.over_15y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_15y_old') - -class SeriesTree_Cohorts_Utxo_UnderAge: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self._1w: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_1w_old') - self._1m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_1m_old') - self._2m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_2m_old') - self._3m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_3m_old') - self._4m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_4m_old') - self._5m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_5m_old') - self._6m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_6m_old') - self._9m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_9m_old') - self._1y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_1y_old') - self._18m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_18m_old') - self._2y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_2y_old') - self._3y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_3y_old') - self._4y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_4y_old') - self._5y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_5y_old') - self._6y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_6y_old') - self._7y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_7y_old') - self._8y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_8y_old') - self._10y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_10y_old') - self._12y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_12y_old') - self._15y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_15y_old') - -class SeriesTree_Cohorts_Utxo_OverAge: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self._1d: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_1d_old') - self._1w: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_1w_old') - self._1m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_1m_old') - self._2m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_2m_old') - self._3m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_3m_old') - self._4m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_4m_old') - self._5m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_5m_old') - self._6m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_6m_old') - self._9m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_9m_old') - self._1y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_1y_old') - self._18m: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_18m_old') - self._2y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_2y_old') - self._3y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_3y_old') - self._4y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_4y_old') - self._5y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_5y_old') - self._6y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_6y_old') - self._7y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_7y_old') - self._8y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_8y_old') - self._10y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_10y_old') - self._12y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_12y_old') - -class SeriesTree_Cohorts_Utxo_Epoch: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self._0: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'epoch_0') - self._1: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'epoch_1') - self._2: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'epoch_2') - self._3: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'epoch_3') - self._4: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'epoch_4') - -class SeriesTree_Cohorts_Utxo_Class: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self._2009: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2009') - self._2010: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2010') - self._2011: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2011') - self._2012: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2012') - self._2013: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2013') - self._2014: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2014') - self._2015: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2015') - self._2016: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2016') - self._2017: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2017') - self._2018: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2018') - self._2019: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2019') - self._2020: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2020') - self._2021: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2021') - self._2022: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2022') - self._2023: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2023') - self._2024: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2024') - self._2025: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2025') - self._2026: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2026') - -class SeriesTree_Cohorts_Utxo_Entry: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.discount: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'veteran') - self.premium: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'rookie') - -class SeriesTree_Cohorts_Utxo_OverAmount: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self._1sat: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_1sat') - self._10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_10sats') - self._100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_100sats') - self._1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_1k_sats') - self._10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_10k_sats') - self._100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_100k_sats') - self._1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_1m_sats') - self._10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_10m_sats') - self._1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_1btc') - self._10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_10btc') - self._100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_100btc') - self._1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_1k_btc') - self._10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_10k_btc') - -class SeriesTree_Cohorts_Utxo_AmountRange: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self._0sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_0sats') - self._1sat_to_10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_1sat_to_10sats') - self._10sats_to_100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_10sats_to_100sats') - self._100sats_to_1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_100sats_to_1k_sats') - self._1k_sats_to_10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_1k_sats_to_10k_sats') - self._10k_sats_to_100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_10k_sats_to_100k_sats') - self._100k_sats_to_1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_100k_sats_to_1m_sats') - self._1m_sats_to_10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_1m_sats_to_10m_sats') - self._10m_sats_to_1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_10m_sats_to_1btc') - self._1btc_to_10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_1btc_to_10btc') - self._10btc_to_100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_10btc_to_100btc') - self._100btc_to_1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_100btc_to_1k_btc') - self._1k_btc_to_10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_1k_btc_to_10k_btc') - self._10k_btc_to_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_10k_btc_to_100k_btc') - self.over_100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_over_100k_btc') - -class SeriesTree_Cohorts_Utxo_UnderAmount: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self._10sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_10sats') - self._100sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_100sats') - self._1k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_1k_sats') - self._10k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_10k_sats') - self._100k_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_100k_sats') - self._1m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_1m_sats') - self._10m_sats: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_10m_sats') - self._1btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_1btc') - self._10btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_10btc') - self._100btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_100btc') - self._1k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_1k_btc') - self._10k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_10k_btc') - self._100k_btc: ActivityOutputsRealizedSupplyUnrealizedPattern2 = ActivityOutputsRealizedSupplyUnrealizedPattern2(client, 'utxos_under_100k_btc') - -class SeriesTree_Cohorts_Utxo_Type: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.p2pk65: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'p2pk65') - self.p2pk33: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'p2pk33') - self.p2pkh: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'p2pkh') - self.p2ms: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'p2ms') - self.p2sh: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'p2sh') - self.p2wpkh: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'p2wpkh') - self.p2wsh: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'p2wsh') - self.p2tr: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'p2tr') - self.p2a: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'p2a') - self.unknown: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'unknown_outputs') - self.empty: ActivityOutputsRealizedSupplyUnrealizedPattern3 = ActivityOutputsRealizedSupplyUnrealizedPattern3(client, 'empty_outputs') - -class SeriesTree_Cohorts_Utxo_Profitability_Range: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.over_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_1000pct_in_profit') - self._500pct_to_1000pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_500pct_to_1000pct_in_profit') - self._300pct_to_500pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_300pct_to_500pct_in_profit') - self._200pct_to_300pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_200pct_to_300pct_in_profit') - self._100pct_to_200pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_100pct_to_200pct_in_profit') - self._90pct_to_100pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_90pct_to_100pct_in_profit') - self._80pct_to_90pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_80pct_to_90pct_in_profit') - self._70pct_to_80pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_70pct_to_80pct_in_profit') - self._60pct_to_70pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_60pct_to_70pct_in_profit') - self._50pct_to_60pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_50pct_to_60pct_in_profit') - self._40pct_to_50pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_40pct_to_50pct_in_profit') - self._30pct_to_40pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_30pct_to_40pct_in_profit') - self._20pct_to_30pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_20pct_to_30pct_in_profit') - self._10pct_to_20pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_10pct_to_20pct_in_profit') - self._0pct_to_10pct_in_profit: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_0pct_to_10pct_in_profit') - self._0pct_to_10pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_0pct_to_10pct_in_loss') - self._10pct_to_20pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_10pct_to_20pct_in_loss') - self._20pct_to_30pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_20pct_to_30pct_in_loss') - self._30pct_to_40pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_30pct_to_40pct_in_loss') - self._40pct_to_50pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_40pct_to_50pct_in_loss') - self._50pct_to_60pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_50pct_to_60pct_in_loss') - self._60pct_to_70pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_60pct_to_70pct_in_loss') - self._70pct_to_80pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_70pct_to_80pct_in_loss') - self._80pct_to_90pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_80pct_to_90pct_in_loss') - self._90pct_to_100pct_in_loss: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_90pct_to_100pct_in_loss') - -class SeriesTree_Cohorts_Utxo_Profitability_Profit: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.all: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_in_profit') - self._10pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_10pct_in_profit') - self._20pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_20pct_in_profit') - self._30pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_30pct_in_profit') - self._40pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_40pct_in_profit') - self._50pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_50pct_in_profit') - self._60pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_60pct_in_profit') - self._70pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_70pct_in_profit') - self._80pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_80pct_in_profit') - self._90pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_90pct_in_profit') - self._100pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_100pct_in_profit') - self._200pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_200pct_in_profit') - self._300pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_300pct_in_profit') - self._500pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_500pct_in_profit') - -class SeriesTree_Cohorts_Utxo_Profitability_Loss: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.all: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_in_loss') - self._10pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_10pct_in_loss') - self._20pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_20pct_in_loss') - self._30pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_30pct_in_loss') - self._40pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_40pct_in_loss') - self._50pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_50pct_in_loss') - self._60pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_60pct_in_loss') - self._70pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_70pct_in_loss') - self._80pct: NuplRealizedSupplyUnrealizedPattern = NuplRealizedSupplyUnrealizedPattern(client, 'utxos_over_80pct_in_loss') - -class SeriesTree_Cohorts_Utxo_Profitability: - """Series tree node.""" - - def __init__(self, client: BrkClient, base_path: str = ''): - self.range: SeriesTree_Cohorts_Utxo_Profitability_Range = SeriesTree_Cohorts_Utxo_Profitability_Range(client) - self.profit: SeriesTree_Cohorts_Utxo_Profitability_Profit = SeriesTree_Cohorts_Utxo_Profitability_Profit(client) - self.loss: SeriesTree_Cohorts_Utxo_Profitability_Loss = SeriesTree_Cohorts_Utxo_Profitability_Loss(client) - self.all_supply_sats: SeriesPattern18[Sats] = SeriesPattern18(client, 'profitability_all_supply_sats') - self.sth_supply_sats: SeriesPattern18[Sats] = SeriesPattern18(client, 'profitability_sth_supply_sats') - self.all_realized_cap: SeriesPattern18[Dollars] = SeriesPattern18(client, 'profitability_all_realized_cap') - self.sth_realized_cap: SeriesPattern18[Dollars] = SeriesPattern18(client, 'profitability_sth_realized_cap') - self.all_unrealized_pnl: SeriesPattern18[Dollars] = SeriesPattern18(client, 'profitability_all_unrealized_pnl') - self.sth_unrealized_pnl: SeriesPattern18[Dollars] = SeriesPattern18(client, 'profitability_sth_unrealized_pnl') - self.nupl: SeriesPattern18[PartsPerMillionSigned32] = SeriesPattern18(client, 'profitability_nupl_ppm') - -class SeriesTree_Cohorts_Utxo_Matured: +class SeriesTree_Cohorts_Cohorts_Supply_Matured: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): @@ -7943,99 +8284,5604 @@ class SeriesTree_Cohorts_Utxo_Matured: self._10y_to_12y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'utxos_10y_to_12y_old_matured_supply') self._12y_to_15y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'utxos_12y_to_15y_old_matured_supply') self.over_15y: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'utxos_over_15y_old_matured_supply') + self.sats: CumulativePattern[StoredU64] = CumulativePattern(client, 'utxos_age_range_matured_supply_cumulative_sats') + self.cents: CumulativePattern[StoredU64] = CumulativePattern(client, 'utxos_age_range_matured_supply_cumulative_cents') -class SeriesTree_Cohorts_Utxo: +class SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Range: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.all: SeriesTree_Cohorts_Utxo_All = SeriesTree_Cohorts_Utxo_All(client) - self.sth: SeriesTree_Cohorts_Utxo_Sth = SeriesTree_Cohorts_Utxo_Sth(client) - self.lth: SeriesTree_Cohorts_Utxo_Lth = SeriesTree_Cohorts_Utxo_Lth(client) - self.age_range: SeriesTree_Cohorts_Utxo_AgeRange = SeriesTree_Cohorts_Utxo_AgeRange(client) - self.under_age: SeriesTree_Cohorts_Utxo_UnderAge = SeriesTree_Cohorts_Utxo_UnderAge(client) - self.over_age: SeriesTree_Cohorts_Utxo_OverAge = SeriesTree_Cohorts_Utxo_OverAge(client) - self.epoch: SeriesTree_Cohorts_Utxo_Epoch = SeriesTree_Cohorts_Utxo_Epoch(client) - self.class_: SeriesTree_Cohorts_Utxo_Class = SeriesTree_Cohorts_Utxo_Class(client) - self.entry: SeriesTree_Cohorts_Utxo_Entry = SeriesTree_Cohorts_Utxo_Entry(client) - self.over_amount: SeriesTree_Cohorts_Utxo_OverAmount = SeriesTree_Cohorts_Utxo_OverAmount(client) - self.amount_range: SeriesTree_Cohorts_Utxo_AmountRange = SeriesTree_Cohorts_Utxo_AmountRange(client) - self.under_amount: SeriesTree_Cohorts_Utxo_UnderAmount = SeriesTree_Cohorts_Utxo_UnderAmount(client) - self.type: SeriesTree_Cohorts_Utxo_Type = SeriesTree_Cohorts_Utxo_Type(client) - self.profitability: SeriesTree_Cohorts_Utxo_Profitability = SeriesTree_Cohorts_Utxo_Profitability(client) - self.matured: SeriesTree_Cohorts_Utxo_Matured = SeriesTree_Cohorts_Utxo_Matured(client) - self.cumulative_matured_sats: SeriesPattern18[[Sats; 23]] = SeriesPattern18(client, 'utxos_age_range_matured_supply_cumulative_sats') - self.cumulative_matured_cents: SeriesPattern18[[Cents; 23]] = SeriesPattern18(client, 'utxos_age_range_matured_supply_cumulative_cents') + self.under_1h: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1h_old_supply_half') + self._1h_to_1d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1h_to_1d_old_supply_half') + self._1d_to_1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1d_to_1w_old_supply_half') + self._1w_to_1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1w_to_1m_old_supply_half') + self._1m_to_2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1m_to_2m_old_supply_half') + self._2m_to_3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_2m_to_3m_old_supply_half') + self._3m_to_4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_3m_to_4m_old_supply_half') + self._4m_to_5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_4m_to_5m_old_supply_half') + self._5m_to_6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_5m_to_6m_old_supply_half') + self._6m_to_9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_6m_to_9m_old_supply_half') + self._9m_to_1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_9m_to_1y_old_supply_half') + self._1y_to_18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1y_to_18m_old_supply_half') + self._18m_to_2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_18m_to_2y_old_supply_half') + self._2y_to_3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_2y_to_3y_old_supply_half') + self._3y_to_4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_3y_to_4y_old_supply_half') + self._4y_to_5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_4y_to_5y_old_supply_half') + self._5y_to_6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_5y_to_6y_old_supply_half') + self._6y_to_7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_6y_to_7y_old_supply_half') + self._7y_to_8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_7y_to_8y_old_supply_half') + self._8y_to_10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_8y_to_10y_old_supply_half') + self._10y_to_12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_10y_to_12y_old_supply_half') + self._12y_to_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_12y_to_15y_old_supply_half') + self.over_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_15y_old_supply_half') -class SeriesTree_Cohorts_Addr_OverAmount: +class SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Under: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self._1sat: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_1sat') - self._10sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_10sats') - self._100sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_100sats') - self._1k_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_1k_sats') - self._10k_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_10k_sats') - self._100k_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_100k_sats') - self._1m_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_1m_sats') - self._10m_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_10m_sats') - self._1btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_1btc') - self._10btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_10btc') - self._100btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_100btc') - self._1k_btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_1k_btc') - self._10k_btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_10k_btc') + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1w_old_supply_half') + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1m_old_supply_half') + self._2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_2m_old_supply_half') + self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_3m_old_supply_half') + self._4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_4m_old_supply_half') + self._5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_5m_old_supply_half') + self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_6m_old_supply_half') + self._9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_9m_old_supply_half') + self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1y_old_supply_half') + self._18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_18m_old_supply_half') + self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_2y_old_supply_half') + self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_3y_old_supply_half') + self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_4y_old_supply_half') + self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_5y_old_supply_half') + self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_6y_old_supply_half') + self._7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_7y_old_supply_half') + self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_8y_old_supply_half') + self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_10y_old_supply_half') + self._12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_12y_old_supply_half') + self._15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_15y_old_supply_half') -class SeriesTree_Cohorts_Addr_AmountRange: +class SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Over: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self._0sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_0sats') - self._1sat_to_10sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_1sat_to_10sats') - self._10sats_to_100sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_10sats_to_100sats') - self._100sats_to_1k_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_100sats_to_1k_sats') - self._1k_sats_to_10k_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_1k_sats_to_10k_sats') - self._10k_sats_to_100k_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_10k_sats_to_100k_sats') - self._100k_sats_to_1m_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_100k_sats_to_1m_sats') - self._1m_sats_to_10m_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_1m_sats_to_10m_sats') - self._10m_sats_to_1btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_10m_sats_to_1btc') - self._1btc_to_10btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_1btc_to_10btc') - self._10btc_to_100btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_10btc_to_100btc') - self._100btc_to_1k_btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_100btc_to_1k_btc') - self._1k_btc_to_10k_btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_1k_btc_to_10k_btc') - self._10k_btc_to_100k_btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_10k_btc_to_100k_btc') - self.over_100k_btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_over_100k_btc') + self._1d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1d_old_supply_half') + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1w_old_supply_half') + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1m_old_supply_half') + self._2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_2m_old_supply_half') + self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_3m_old_supply_half') + self._4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_4m_old_supply_half') + self._5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_5m_old_supply_half') + self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_6m_old_supply_half') + self._9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_9m_old_supply_half') + self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1y_old_supply_half') + self._18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_18m_old_supply_half') + self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_2y_old_supply_half') + self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_3y_old_supply_half') + self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_4y_old_supply_half') + self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_5y_old_supply_half') + self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_6y_old_supply_half') + self._7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_7y_old_supply_half') + self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_8y_old_supply_half') + self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_10y_old_supply_half') + self._12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_12y_old_supply_half') -class SeriesTree_Cohorts_Addr_UnderAmount: +class SeriesTree_Cohorts_Cohorts_Supply_Half_Age: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self._10sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_10sats') - self._100sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_100sats') - self._1k_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_1k_sats') - self._10k_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_10k_sats') - self._100k_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_100k_sats') - self._1m_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_1m_sats') - self._10m_sats: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_10m_sats') - self._1btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_1btc') - self._10btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_10btc') - self._100btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_100btc') - self._1k_btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_1k_btc') - self._10k_btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_10k_btc') - self._100k_btc: ActivityAddrOutputsRealizedSupplyPattern = ActivityAddrOutputsRealizedSupplyPattern(client, 'addrs_under_100k_btc') + self.range: SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Range = SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Under = SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Over = SeriesTree_Cohorts_Cohorts_Supply_Half_Age_Over(client) -class SeriesTree_Cohorts_Addr: +class SeriesTree_Cohorts_Cohorts_Supply_Half_Epoch: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.over_amount: SeriesTree_Cohorts_Addr_OverAmount = SeriesTree_Cohorts_Addr_OverAmount(client) - self.amount_range: SeriesTree_Cohorts_Addr_AmountRange = SeriesTree_Cohorts_Addr_AmountRange(client) - self.under_amount: SeriesTree_Cohorts_Addr_UnderAmount = SeriesTree_Cohorts_Addr_UnderAmount(client) + self._0: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_0_supply_half') + self._1: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_1_supply_half') + self._2: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_2_supply_half') + self._3: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_3_supply_half') + self._4: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_4_supply_half') + +class SeriesTree_Cohorts_Cohorts_Supply_Half_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2009_supply_half') + self._2010: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2010_supply_half') + self._2011: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2011_supply_half') + self._2012: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2012_supply_half') + self._2013: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2013_supply_half') + self._2014: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2014_supply_half') + self._2015: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2015_supply_half') + self._2016: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2016_supply_half') + self._2017: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2017_supply_half') + self._2018: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2018_supply_half') + self._2019: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2019_supply_half') + self._2020: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2020_supply_half') + self._2021: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2021_supply_half') + self._2022: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2022_supply_half') + self._2023: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2023_supply_half') + self._2024: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2024_supply_half') + self._2025: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2025_supply_half') + self._2026: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2026_supply_half') + +class SeriesTree_Cohorts_Cohorts_Supply_Half: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'supply_half') + self.age: SeriesTree_Cohorts_Cohorts_Supply_Half_Age = SeriesTree_Cohorts_Cohorts_Supply_Half_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Supply_Half_Epoch = SeriesTree_Cohorts_Cohorts_Supply_Half_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Supply_Half_Class = SeriesTree_Cohorts_Cohorts_Supply_Half_Class(client) + self.entry: DiscountPremiumPattern12 = DiscountPremiumPattern12(client, 'supply_half') + self.term: LongShortPattern13 = LongShortPattern13(client, 'supply_half') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10(client, 'supply_half') + +class SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1h_old_supply_in_profit') + self._1h_to_1d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1h_to_1d_old_supply_in_profit') + self._1d_to_1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1d_to_1w_old_supply_in_profit') + self._1w_to_1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1w_to_1m_old_supply_in_profit') + self._1m_to_2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1m_to_2m_old_supply_in_profit') + self._2m_to_3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_2m_to_3m_old_supply_in_profit') + self._3m_to_4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_3m_to_4m_old_supply_in_profit') + self._4m_to_5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_4m_to_5m_old_supply_in_profit') + self._5m_to_6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_5m_to_6m_old_supply_in_profit') + self._6m_to_9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_6m_to_9m_old_supply_in_profit') + self._9m_to_1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_9m_to_1y_old_supply_in_profit') + self._1y_to_18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1y_to_18m_old_supply_in_profit') + self._18m_to_2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_18m_to_2y_old_supply_in_profit') + self._2y_to_3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_2y_to_3y_old_supply_in_profit') + self._3y_to_4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_3y_to_4y_old_supply_in_profit') + self._4y_to_5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_4y_to_5y_old_supply_in_profit') + self._5y_to_6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_5y_to_6y_old_supply_in_profit') + self._6y_to_7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_6y_to_7y_old_supply_in_profit') + self._7y_to_8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_7y_to_8y_old_supply_in_profit') + self._8y_to_10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_8y_to_10y_old_supply_in_profit') + self._10y_to_12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_10y_to_12y_old_supply_in_profit') + self._12y_to_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_12y_to_15y_old_supply_in_profit') + self.over_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_15y_old_supply_in_profit') + +class SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1w_old_supply_in_profit') + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1m_old_supply_in_profit') + self._2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_2m_old_supply_in_profit') + self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_3m_old_supply_in_profit') + self._4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_4m_old_supply_in_profit') + self._5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_5m_old_supply_in_profit') + self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_6m_old_supply_in_profit') + self._9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_9m_old_supply_in_profit') + self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1y_old_supply_in_profit') + self._18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_18m_old_supply_in_profit') + self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_2y_old_supply_in_profit') + self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_3y_old_supply_in_profit') + self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_4y_old_supply_in_profit') + self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_5y_old_supply_in_profit') + self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_6y_old_supply_in_profit') + self._7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_7y_old_supply_in_profit') + self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_8y_old_supply_in_profit') + self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_10y_old_supply_in_profit') + self._12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_12y_old_supply_in_profit') + self._15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_15y_old_supply_in_profit') + +class SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1d_old_supply_in_profit') + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1w_old_supply_in_profit') + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1m_old_supply_in_profit') + self._2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_2m_old_supply_in_profit') + self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_3m_old_supply_in_profit') + self._4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_4m_old_supply_in_profit') + self._5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_5m_old_supply_in_profit') + self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_6m_old_supply_in_profit') + self._9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_9m_old_supply_in_profit') + self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1y_old_supply_in_profit') + self._18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_18m_old_supply_in_profit') + self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_2y_old_supply_in_profit') + self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_3y_old_supply_in_profit') + self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_4y_old_supply_in_profit') + self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_5y_old_supply_in_profit') + self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_6y_old_supply_in_profit') + self._7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_7y_old_supply_in_profit') + self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_8y_old_supply_in_profit') + self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_10y_old_supply_in_profit') + self._12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_12y_old_supply_in_profit') + +class SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Range = SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Under = SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Over = SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Supply_InProfit_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_0_supply_in_profit') + self._1: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_1_supply_in_profit') + self._2: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_2_supply_in_profit') + self._3: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_3_supply_in_profit') + self._4: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_4_supply_in_profit') + +class SeriesTree_Cohorts_Cohorts_Supply_InProfit_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2009_supply_in_profit') + self._2010: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2010_supply_in_profit') + self._2011: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2011_supply_in_profit') + self._2012: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2012_supply_in_profit') + self._2013: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2013_supply_in_profit') + self._2014: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2014_supply_in_profit') + self._2015: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2015_supply_in_profit') + self._2016: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2016_supply_in_profit') + self._2017: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2017_supply_in_profit') + self._2018: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2018_supply_in_profit') + self._2019: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2019_supply_in_profit') + self._2020: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2020_supply_in_profit') + self._2021: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2021_supply_in_profit') + self._2022: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2022_supply_in_profit') + self._2023: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2023_supply_in_profit') + self._2024: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2024_supply_in_profit') + self._2025: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2025_supply_in_profit') + self._2026: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2026_supply_in_profit') + +class SeriesTree_Cohorts_Cohorts_Supply_InProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'supply_in_profit') + self.age: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age = SeriesTree_Cohorts_Cohorts_Supply_InProfit_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Epoch = SeriesTree_Cohorts_Cohorts_Supply_InProfit_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Supply_InProfit_Class = SeriesTree_Cohorts_Cohorts_Supply_InProfit_Class(client) + self.entry: DiscountPremiumPattern12 = DiscountPremiumPattern12(client, 'supply_in_profit') + self.term: LongShortPattern13 = LongShortPattern13(client, 'supply_in_profit') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10(client, 'supply_in_profit') + self.age_range_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'utxos_supply_in_profit_sats_by_age_range') + self.epoch_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_in_profit_sats_by_epoch') + self.class_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_in_profit_sats_by_class') + self.entry_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_in_profit_sats_by_entry') + self.type_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_in_profit_sats_by_type') + +class SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1h_old_supply_in_loss') + self._1h_to_1d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1h_to_1d_old_supply_in_loss') + self._1d_to_1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1d_to_1w_old_supply_in_loss') + self._1w_to_1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1w_to_1m_old_supply_in_loss') + self._1m_to_2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1m_to_2m_old_supply_in_loss') + self._2m_to_3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_2m_to_3m_old_supply_in_loss') + self._3m_to_4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_3m_to_4m_old_supply_in_loss') + self._4m_to_5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_4m_to_5m_old_supply_in_loss') + self._5m_to_6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_5m_to_6m_old_supply_in_loss') + self._6m_to_9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_6m_to_9m_old_supply_in_loss') + self._9m_to_1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_9m_to_1y_old_supply_in_loss') + self._1y_to_18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_1y_to_18m_old_supply_in_loss') + self._18m_to_2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_18m_to_2y_old_supply_in_loss') + self._2y_to_3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_2y_to_3y_old_supply_in_loss') + self._3y_to_4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_3y_to_4y_old_supply_in_loss') + self._4y_to_5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_4y_to_5y_old_supply_in_loss') + self._5y_to_6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_5y_to_6y_old_supply_in_loss') + self._6y_to_7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_6y_to_7y_old_supply_in_loss') + self._7y_to_8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_7y_to_8y_old_supply_in_loss') + self._8y_to_10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_8y_to_10y_old_supply_in_loss') + self._10y_to_12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_10y_to_12y_old_supply_in_loss') + self._12y_to_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_12y_to_15y_old_supply_in_loss') + self.over_15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_15y_old_supply_in_loss') + +class SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1w_old_supply_in_loss') + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1m_old_supply_in_loss') + self._2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_2m_old_supply_in_loss') + self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_3m_old_supply_in_loss') + self._4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_4m_old_supply_in_loss') + self._5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_5m_old_supply_in_loss') + self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_6m_old_supply_in_loss') + self._9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_9m_old_supply_in_loss') + self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_1y_old_supply_in_loss') + self._18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_18m_old_supply_in_loss') + self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_2y_old_supply_in_loss') + self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_3y_old_supply_in_loss') + self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_4y_old_supply_in_loss') + self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_5y_old_supply_in_loss') + self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_6y_old_supply_in_loss') + self._7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_7y_old_supply_in_loss') + self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_8y_old_supply_in_loss') + self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_10y_old_supply_in_loss') + self._12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_12y_old_supply_in_loss') + self._15y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_under_15y_old_supply_in_loss') + +class SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1d_old_supply_in_loss') + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1w_old_supply_in_loss') + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1m_old_supply_in_loss') + self._2m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_2m_old_supply_in_loss') + self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_3m_old_supply_in_loss') + self._4m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_4m_old_supply_in_loss') + self._5m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_5m_old_supply_in_loss') + self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_6m_old_supply_in_loss') + self._9m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_9m_old_supply_in_loss') + self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_1y_old_supply_in_loss') + self._18m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_18m_old_supply_in_loss') + self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_2y_old_supply_in_loss') + self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_3y_old_supply_in_loss') + self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_4y_old_supply_in_loss') + self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_5y_old_supply_in_loss') + self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_6y_old_supply_in_loss') + self._7y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_7y_old_supply_in_loss') + self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_8y_old_supply_in_loss') + self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_10y_old_supply_in_loss') + self._12y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'utxos_over_12y_old_supply_in_loss') + +class SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Range = SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Under = SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Over = SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Supply_InLoss_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_0_supply_in_loss') + self._1: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_1_supply_in_loss') + self._2: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_2_supply_in_loss') + self._3: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_3_supply_in_loss') + self._4: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'epoch_4_supply_in_loss') + +class SeriesTree_Cohorts_Cohorts_Supply_InLoss_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2009_supply_in_loss') + self._2010: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2010_supply_in_loss') + self._2011: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2011_supply_in_loss') + self._2012: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2012_supply_in_loss') + self._2013: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2013_supply_in_loss') + self._2014: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2014_supply_in_loss') + self._2015: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2015_supply_in_loss') + self._2016: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2016_supply_in_loss') + self._2017: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2017_supply_in_loss') + self._2018: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2018_supply_in_loss') + self._2019: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2019_supply_in_loss') + self._2020: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2020_supply_in_loss') + self._2021: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2021_supply_in_loss') + self._2022: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2022_supply_in_loss') + self._2023: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2023_supply_in_loss') + self._2024: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2024_supply_in_loss') + self._2025: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2025_supply_in_loss') + self._2026: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'class_2026_supply_in_loss') + +class SeriesTree_Cohorts_Cohorts_Supply_InLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'supply_in_loss') + self.age: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age = SeriesTree_Cohorts_Cohorts_Supply_InLoss_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Epoch = SeriesTree_Cohorts_Cohorts_Supply_InLoss_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Supply_InLoss_Class = SeriesTree_Cohorts_Cohorts_Supply_InLoss_Class(client) + self.entry: DiscountPremiumPattern12 = DiscountPremiumPattern12(client, 'supply_in_loss') + self.term: LongShortPattern13 = LongShortPattern13(client, 'supply_in_loss') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern10(client, 'supply_in_loss') + self.age_range_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'utxos_supply_in_loss_sats_by_age_range') + self.epoch_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_in_loss_sats_by_epoch') + self.class_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_in_loss_sats_by_class') + self.entry_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_in_loss_sats_by_entry') + self.type_matrix: SeriesPattern18[Sats] = SeriesPattern18(client, 'supply_in_loss_sats_by_type') + +class SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_1h_old_supply_delta') + self._1h_to_1d: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_1h_to_1d_old_supply_delta') + self._1d_to_1w: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_1d_to_1w_old_supply_delta') + self._1w_to_1m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_1w_to_1m_old_supply_delta') + self._1m_to_2m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_1m_to_2m_old_supply_delta') + self._2m_to_3m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_2m_to_3m_old_supply_delta') + self._3m_to_4m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_3m_to_4m_old_supply_delta') + self._4m_to_5m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_4m_to_5m_old_supply_delta') + self._5m_to_6m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_5m_to_6m_old_supply_delta') + self._6m_to_9m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_6m_to_9m_old_supply_delta') + self._9m_to_1y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_9m_to_1y_old_supply_delta') + self._1y_to_18m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_1y_to_18m_old_supply_delta') + self._18m_to_2y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_18m_to_2y_old_supply_delta') + self._2y_to_3y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_2y_to_3y_old_supply_delta') + self._3y_to_4y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_3y_to_4y_old_supply_delta') + self._4y_to_5y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_4y_to_5y_old_supply_delta') + self._5y_to_6y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_5y_to_6y_old_supply_delta') + self._6y_to_7y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_6y_to_7y_old_supply_delta') + self._7y_to_8y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_7y_to_8y_old_supply_delta') + self._8y_to_10y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_8y_to_10y_old_supply_delta') + self._10y_to_12y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_10y_to_12y_old_supply_delta') + self._12y_to_15y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_12y_to_15y_old_supply_delta') + self.over_15y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_15y_old_supply_delta') + +class SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_1w_old_supply_delta') + self._1m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_1m_old_supply_delta') + self._2m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_2m_old_supply_delta') + self._3m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_3m_old_supply_delta') + self._4m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_4m_old_supply_delta') + self._5m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_5m_old_supply_delta') + self._6m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_6m_old_supply_delta') + self._9m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_9m_old_supply_delta') + self._1y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_1y_old_supply_delta') + self._18m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_18m_old_supply_delta') + self._2y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_2y_old_supply_delta') + self._3y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_3y_old_supply_delta') + self._4y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_4y_old_supply_delta') + self._5y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_5y_old_supply_delta') + self._6y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_6y_old_supply_delta') + self._7y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_7y_old_supply_delta') + self._8y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_8y_old_supply_delta') + self._10y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_10y_old_supply_delta') + self._12y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_12y_old_supply_delta') + self._15y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_under_15y_old_supply_delta') + +class SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_1d_old_supply_delta') + self._1w: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_1w_old_supply_delta') + self._1m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_1m_old_supply_delta') + self._2m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_2m_old_supply_delta') + self._3m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_3m_old_supply_delta') + self._4m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_4m_old_supply_delta') + self._5m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_5m_old_supply_delta') + self._6m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_6m_old_supply_delta') + self._9m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_9m_old_supply_delta') + self._1y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_1y_old_supply_delta') + self._18m: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_18m_old_supply_delta') + self._2y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_2y_old_supply_delta') + self._3y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_3y_old_supply_delta') + self._4y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_4y_old_supply_delta') + self._5y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_5y_old_supply_delta') + self._6y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_6y_old_supply_delta') + self._7y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_7y_old_supply_delta') + self._8y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_8y_old_supply_delta') + self._10y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_10y_old_supply_delta') + self._12y: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'utxos_over_12y_old_supply_delta') + +class SeriesTree_Cohorts_Cohorts_Supply_Delta_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Range = SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Under = SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Over = SeriesTree_Cohorts_Cohorts_Supply_Delta_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Supply_Delta_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'epoch_0_supply_delta') + self._1: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'epoch_1_supply_delta') + self._2: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'epoch_2_supply_delta') + self._3: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'epoch_3_supply_delta') + self._4: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'epoch_4_supply_delta') + +class SeriesTree_Cohorts_Cohorts_Supply_Delta_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2009_supply_delta') + self._2010: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2010_supply_delta') + self._2011: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2011_supply_delta') + self._2012: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2012_supply_delta') + self._2013: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2013_supply_delta') + self._2014: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2014_supply_delta') + self._2015: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2015_supply_delta') + self._2016: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2016_supply_delta') + self._2017: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2017_supply_delta') + self._2018: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2018_supply_delta') + self._2019: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2019_supply_delta') + self._2020: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2020_supply_delta') + self._2021: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2021_supply_delta') + self._2022: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2022_supply_delta') + self._2023: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2023_supply_delta') + self._2024: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2024_supply_delta') + self._2025: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2025_supply_delta') + self._2026: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'class_2026_supply_delta') + +class SeriesTree_Cohorts_Cohorts_Supply_Delta_Entry: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'veteran_supply_delta') + self.premium: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'rookie_supply_delta') + +class SeriesTree_Cohorts_Cohorts_Supply_Delta_Term: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'sth_supply_delta') + self.long: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'lth_supply_delta') + +class SeriesTree_Cohorts_Cohorts_Supply_Delta_Type: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.p2pk65: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'p2pk65_supply_delta') + self.p2pk33: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'p2pk33_supply_delta') + self.p2pkh: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'p2pkh_supply_delta') + self.p2ms: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'p2ms_supply_delta') + self.p2sh: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'p2sh_supply_delta') + self.p2wpkh: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'p2wpkh_supply_delta') + self.p2wsh: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'p2wsh_supply_delta') + self.p2tr: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'p2tr_supply_delta') + self.p2a: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'p2a_supply_delta') + self.unknown: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'unknown_outputs_supply_delta') + self.empty: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'empty_outputs_supply_delta') + +class SeriesTree_Cohorts_Cohorts_Supply_Delta: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, 'supply_delta') + self.age: SeriesTree_Cohorts_Cohorts_Supply_Delta_Age = SeriesTree_Cohorts_Cohorts_Supply_Delta_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Supply_Delta_Epoch = SeriesTree_Cohorts_Cohorts_Supply_Delta_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Supply_Delta_Class = SeriesTree_Cohorts_Cohorts_Supply_Delta_Class(client) + self.entry: SeriesTree_Cohorts_Cohorts_Supply_Delta_Entry = SeriesTree_Cohorts_Cohorts_Supply_Delta_Entry(client) + self.utxo_amount: OverRangeUnderPattern17 = OverRangeUnderPattern17(client, 'utxos') + self.term: SeriesTree_Cohorts_Cohorts_Supply_Delta_Term = SeriesTree_Cohorts_Cohorts_Supply_Delta_Term(client) + self.type: SeriesTree_Cohorts_Cohorts_Supply_Delta_Type = SeriesTree_Cohorts_Cohorts_Supply_Delta_Type(client) + self.addr_balance: OverRangeUnderPattern17 = OverRangeUnderPattern17(client, 'addrs') + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_1h_old_supply_dominance') + self._1h_to_1d: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_1h_to_1d_old_supply_dominance') + self._1d_to_1w: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_1d_to_1w_old_supply_dominance') + self._1w_to_1m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_1w_to_1m_old_supply_dominance') + self._1m_to_2m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_1m_to_2m_old_supply_dominance') + self._2m_to_3m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_2m_to_3m_old_supply_dominance') + self._3m_to_4m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_3m_to_4m_old_supply_dominance') + self._4m_to_5m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_4m_to_5m_old_supply_dominance') + self._5m_to_6m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_5m_to_6m_old_supply_dominance') + self._6m_to_9m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_6m_to_9m_old_supply_dominance') + self._9m_to_1y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_9m_to_1y_old_supply_dominance') + self._1y_to_18m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_1y_to_18m_old_supply_dominance') + self._18m_to_2y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_18m_to_2y_old_supply_dominance') + self._2y_to_3y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_2y_to_3y_old_supply_dominance') + self._3y_to_4y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_3y_to_4y_old_supply_dominance') + self._4y_to_5y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_4y_to_5y_old_supply_dominance') + self._5y_to_6y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_5y_to_6y_old_supply_dominance') + self._6y_to_7y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_6y_to_7y_old_supply_dominance') + self._7y_to_8y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_7y_to_8y_old_supply_dominance') + self._8y_to_10y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_8y_to_10y_old_supply_dominance') + self._10y_to_12y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_10y_to_12y_old_supply_dominance') + self._12y_to_15y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_12y_to_15y_old_supply_dominance') + self.over_15y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_15y_old_supply_dominance') + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_1w_old_supply_dominance') + self._1m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_1m_old_supply_dominance') + self._2m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_2m_old_supply_dominance') + self._3m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_3m_old_supply_dominance') + self._4m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_4m_old_supply_dominance') + self._5m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_5m_old_supply_dominance') + self._6m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_6m_old_supply_dominance') + self._9m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_9m_old_supply_dominance') + self._1y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_1y_old_supply_dominance') + self._18m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_18m_old_supply_dominance') + self._2y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_2y_old_supply_dominance') + self._3y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_3y_old_supply_dominance') + self._4y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_4y_old_supply_dominance') + self._5y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_5y_old_supply_dominance') + self._6y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_6y_old_supply_dominance') + self._7y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_7y_old_supply_dominance') + self._8y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_8y_old_supply_dominance') + self._10y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_10y_old_supply_dominance') + self._12y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_12y_old_supply_dominance') + self._15y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_under_15y_old_supply_dominance') + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_1d_old_supply_dominance') + self._1w: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_1w_old_supply_dominance') + self._1m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_1m_old_supply_dominance') + self._2m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_2m_old_supply_dominance') + self._3m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_3m_old_supply_dominance') + self._4m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_4m_old_supply_dominance') + self._5m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_5m_old_supply_dominance') + self._6m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_6m_old_supply_dominance') + self._9m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_9m_old_supply_dominance') + self._1y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_1y_old_supply_dominance') + self._18m: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_18m_old_supply_dominance') + self._2y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_2y_old_supply_dominance') + self._3y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_3y_old_supply_dominance') + self._4y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_4y_old_supply_dominance') + self._5y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_5y_old_supply_dominance') + self._6y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_6y_old_supply_dominance') + self._7y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_7y_old_supply_dominance') + self._8y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_8y_old_supply_dominance') + self._10y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_10y_old_supply_dominance') + self._12y: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'utxos_over_12y_old_supply_dominance') + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Range = SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Under = SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Over = SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'epoch_0_supply_dominance') + self._1: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'epoch_1_supply_dominance') + self._2: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'epoch_2_supply_dominance') + self._3: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'epoch_3_supply_dominance') + self._4: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'epoch_4_supply_dominance') + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2009_supply_dominance') + self._2010: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2010_supply_dominance') + self._2011: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2011_supply_dominance') + self._2012: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2012_supply_dominance') + self._2013: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2013_supply_dominance') + self._2014: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2014_supply_dominance') + self._2015: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2015_supply_dominance') + self._2016: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2016_supply_dominance') + self._2017: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2017_supply_dominance') + self._2018: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2018_supply_dominance') + self._2019: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2019_supply_dominance') + self._2020: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2020_supply_dominance') + self._2021: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2021_supply_dominance') + self._2022: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2022_supply_dominance') + self._2023: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2023_supply_dominance') + self._2024: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2024_supply_dominance') + self._2025: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2025_supply_dominance') + self._2026: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'class_2026_supply_dominance') + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance_Entry: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'veteran_supply_dominance') + self.premium: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'rookie_supply_dominance') + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance_Term: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'sth_supply_dominance') + self.long: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'lth_supply_dominance') + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance_Type: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.p2pk65: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'p2pk65_supply_dominance') + self.p2pk33: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'p2pk33_supply_dominance') + self.p2pkh: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'p2pkh_supply_dominance') + self.p2ms: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'p2ms_supply_dominance') + self.p2sh: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'p2sh_supply_dominance') + self.p2wpkh: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'p2wpkh_supply_dominance') + self.p2wsh: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'p2wsh_supply_dominance') + self.p2tr: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'p2tr_supply_dominance') + self.p2a: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'p2a_supply_dominance') + self.unknown: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'unknown_outputs_supply_dominance') + self.empty: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'empty_outputs_supply_dominance') + +class SeriesTree_Cohorts_Cohorts_Supply_Dominance: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'supply_dominance') + self.age: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age = SeriesTree_Cohorts_Cohorts_Supply_Dominance_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Epoch = SeriesTree_Cohorts_Cohorts_Supply_Dominance_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Class = SeriesTree_Cohorts_Cohorts_Supply_Dominance_Class(client) + self.entry: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Entry = SeriesTree_Cohorts_Cohorts_Supply_Dominance_Entry(client) + self.utxo_amount: OverRangeUnderPattern19 = OverRangeUnderPattern19(client, 'utxos') + self.term: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Term = SeriesTree_Cohorts_Cohorts_Supply_Dominance_Term(client) + self.type: SeriesTree_Cohorts_Cohorts_Supply_Dominance_Type = SeriesTree_Cohorts_Cohorts_Supply_Dominance_Type(client) + self.addr_balance: OverRangeUnderPattern19 = OverRangeUnderPattern19(client, 'addrs') + +class SeriesTree_Cohorts_Cohorts_Supply: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.total: SeriesTree_Cohorts_Cohorts_Supply_Total = SeriesTree_Cohorts_Cohorts_Supply_Total(client) + self.matured: SeriesTree_Cohorts_Cohorts_Supply_Matured = SeriesTree_Cohorts_Cohorts_Supply_Matured(client) + self.half: SeriesTree_Cohorts_Cohorts_Supply_Half = SeriesTree_Cohorts_Cohorts_Supply_Half(client) + self.in_profit: SeriesTree_Cohorts_Cohorts_Supply_InProfit = SeriesTree_Cohorts_Cohorts_Supply_InProfit(client) + self.in_loss: SeriesTree_Cohorts_Cohorts_Supply_InLoss = SeriesTree_Cohorts_Cohorts_Supply_InLoss(client) + self.delta: SeriesTree_Cohorts_Cohorts_Supply_Delta = SeriesTree_Cohorts_Cohorts_Supply_Delta(client) + self.dominance: SeriesTree_Cohorts_Cohorts_Supply_Dominance = SeriesTree_Cohorts_Cohorts_Supply_Dominance(client) + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_1h_old_utxo_count') + self._1h_to_1d: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1h_to_1d_old_utxo_count') + self._1d_to_1w: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1d_to_1w_old_utxo_count') + self._1w_to_1m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1w_to_1m_old_utxo_count') + self._1m_to_2m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1m_to_2m_old_utxo_count') + self._2m_to_3m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_2m_to_3m_old_utxo_count') + self._3m_to_4m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_3m_to_4m_old_utxo_count') + self._4m_to_5m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_4m_to_5m_old_utxo_count') + self._5m_to_6m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_5m_to_6m_old_utxo_count') + self._6m_to_9m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_6m_to_9m_old_utxo_count') + self._9m_to_1y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_9m_to_1y_old_utxo_count') + self._1y_to_18m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1y_to_18m_old_utxo_count') + self._18m_to_2y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_18m_to_2y_old_utxo_count') + self._2y_to_3y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_2y_to_3y_old_utxo_count') + self._3y_to_4y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_3y_to_4y_old_utxo_count') + self._4y_to_5y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_4y_to_5y_old_utxo_count') + self._5y_to_6y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_5y_to_6y_old_utxo_count') + self._6y_to_7y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_6y_to_7y_old_utxo_count') + self._7y_to_8y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_7y_to_8y_old_utxo_count') + self._8y_to_10y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_8y_to_10y_old_utxo_count') + self._10y_to_12y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_10y_to_12y_old_utxo_count') + self._12y_to_15y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_12y_to_15y_old_utxo_count') + self.over_15y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_15y_old_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_1w_old_utxo_count') + self._1m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_1m_old_utxo_count') + self._2m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_2m_old_utxo_count') + self._3m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_3m_old_utxo_count') + self._4m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_4m_old_utxo_count') + self._5m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_5m_old_utxo_count') + self._6m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_6m_old_utxo_count') + self._9m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_9m_old_utxo_count') + self._1y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_1y_old_utxo_count') + self._18m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_18m_old_utxo_count') + self._2y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_2y_old_utxo_count') + self._3y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_3y_old_utxo_count') + self._4y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_4y_old_utxo_count') + self._5y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_5y_old_utxo_count') + self._6y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_6y_old_utxo_count') + self._7y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_7y_old_utxo_count') + self._8y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_8y_old_utxo_count') + self._10y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_10y_old_utxo_count') + self._12y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_12y_old_utxo_count') + self._15y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_15y_old_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_1d_old_utxo_count') + self._1w: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_1w_old_utxo_count') + self._1m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_1m_old_utxo_count') + self._2m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_2m_old_utxo_count') + self._3m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_3m_old_utxo_count') + self._4m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_4m_old_utxo_count') + self._5m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_5m_old_utxo_count') + self._6m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_6m_old_utxo_count') + self._9m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_9m_old_utxo_count') + self._1y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_1y_old_utxo_count') + self._18m: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_18m_old_utxo_count') + self._2y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_2y_old_utxo_count') + self._3y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_3y_old_utxo_count') + self._4y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_4y_old_utxo_count') + self._5y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_5y_old_utxo_count') + self._6y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_6y_old_utxo_count') + self._7y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_7y_old_utxo_count') + self._8y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_8y_old_utxo_count') + self._10y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_10y_old_utxo_count') + self._12y: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_12y_old_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Range = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Under = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Over = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: BaseDeltaPattern = BaseDeltaPattern(client, 'epoch_0_utxo_count') + self._1: BaseDeltaPattern = BaseDeltaPattern(client, 'epoch_1_utxo_count') + self._2: BaseDeltaPattern = BaseDeltaPattern(client, 'epoch_2_utxo_count') + self._3: BaseDeltaPattern = BaseDeltaPattern(client, 'epoch_3_utxo_count') + self._4: BaseDeltaPattern = BaseDeltaPattern(client, 'epoch_4_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2009_utxo_count') + self._2010: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2010_utxo_count') + self._2011: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2011_utxo_count') + self._2012: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2012_utxo_count') + self._2013: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2013_utxo_count') + self._2014: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2014_utxo_count') + self._2015: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2015_utxo_count') + self._2016: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2016_utxo_count') + self._2017: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2017_utxo_count') + self._2018: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2018_utxo_count') + self._2019: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2019_utxo_count') + self._2020: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2020_utxo_count') + self._2021: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2021_utxo_count') + self._2022: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2022_utxo_count') + self._2023: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2023_utxo_count') + self._2024: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2024_utxo_count') + self._2025: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2025_utxo_count') + self._2026: BaseDeltaPattern = BaseDeltaPattern(client, 'class_2026_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Entry: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: BaseDeltaPattern = BaseDeltaPattern(client, 'veteran_utxo_count') + self.premium: BaseDeltaPattern = BaseDeltaPattern(client, 'rookie_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_0sats_utxo_count') + self._1sat_to_10sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1sat_to_10sats_utxo_count') + self._10sats_to_100sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_10sats_to_100sats_utxo_count') + self._100sats_to_1k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_100sats_to_1k_sats_utxo_count') + self._1k_sats_to_10k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1k_sats_to_10k_sats_utxo_count') + self._10k_sats_to_100k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_10k_sats_to_100k_sats_utxo_count') + self._100k_sats_to_1m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_100k_sats_to_1m_sats_utxo_count') + self._1m_sats_to_10m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1m_sats_to_10m_sats_utxo_count') + self._10m_sats_to_1btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_10m_sats_to_1btc_utxo_count') + self._1btc_to_10btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1btc_to_10btc_utxo_count') + self._10btc_to_100btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_10btc_to_100btc_utxo_count') + self._100btc_to_1k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_100btc_to_1k_btc_utxo_count') + self._1k_btc_to_10k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_1k_btc_to_10k_btc_utxo_count') + self._10k_btc_to_100k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_10k_btc_to_100k_btc_utxo_count') + self.over_100k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_100k_btc_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_10sats_utxo_count') + self._100sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_100sats_utxo_count') + self._1k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_1k_sats_utxo_count') + self._10k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_10k_sats_utxo_count') + self._100k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_100k_sats_utxo_count') + self._1m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_1m_sats_utxo_count') + self._10m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_10m_sats_utxo_count') + self._1btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_1btc_utxo_count') + self._10btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_10btc_utxo_count') + self._100btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_100btc_utxo_count') + self._1k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_1k_btc_utxo_count') + self._10k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_10k_btc_utxo_count') + self._100k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_under_100k_btc_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_1sat_utxo_count') + self._10sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_10sats_utxo_count') + self._100sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_100sats_utxo_count') + self._1k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_1k_sats_utxo_count') + self._10k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_10k_sats_utxo_count') + self._100k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_100k_sats_utxo_count') + self._1m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_1m_sats_utxo_count') + self._10m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_10m_sats_utxo_count') + self._1btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_1btc_utxo_count') + self._10btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_10btc_utxo_count') + self._100btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_100btc_utxo_count') + self._1k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_1k_btc_utxo_count') + self._10k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'utxos_over_10k_btc_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Range = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Under = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Over = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount_Over(client) + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Term: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: BaseDeltaPattern = BaseDeltaPattern(client, 'sth_utxo_count') + self.long: BaseDeltaPattern = BaseDeltaPattern(client, 'lth_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Type: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.p2pk65: BaseDeltaPattern = BaseDeltaPattern(client, 'p2pk65_utxo_count') + self.p2pk33: BaseDeltaPattern = BaseDeltaPattern(client, 'p2pk33_utxo_count') + self.p2pkh: BaseDeltaPattern = BaseDeltaPattern(client, 'p2pkh_utxo_count') + self.p2ms: BaseDeltaPattern = BaseDeltaPattern(client, 'p2ms_utxo_count') + self.p2sh: BaseDeltaPattern = BaseDeltaPattern(client, 'p2sh_utxo_count') + self.p2wpkh: BaseDeltaPattern = BaseDeltaPattern(client, 'p2wpkh_utxo_count') + self.p2wsh: BaseDeltaPattern = BaseDeltaPattern(client, 'p2wsh_utxo_count') + self.p2tr: BaseDeltaPattern = BaseDeltaPattern(client, 'p2tr_utxo_count') + self.p2a: BaseDeltaPattern = BaseDeltaPattern(client, 'p2a_utxo_count') + self.unknown: BaseDeltaPattern = BaseDeltaPattern(client, 'unknown_outputs_utxo_count') + self.empty: BaseDeltaPattern = BaseDeltaPattern(client, 'empty_outputs_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_0sats_utxo_count') + self._1sat_to_10sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1sat_to_10sats_utxo_count') + self._10sats_to_100sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10sats_to_100sats_utxo_count') + self._100sats_to_1k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_100sats_to_1k_sats_utxo_count') + self._1k_sats_to_10k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1k_sats_to_10k_sats_utxo_count') + self._10k_sats_to_100k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10k_sats_to_100k_sats_utxo_count') + self._100k_sats_to_1m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_100k_sats_to_1m_sats_utxo_count') + self._1m_sats_to_10m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1m_sats_to_10m_sats_utxo_count') + self._10m_sats_to_1btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10m_sats_to_1btc_utxo_count') + self._1btc_to_10btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1btc_to_10btc_utxo_count') + self._10btc_to_100btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10btc_to_100btc_utxo_count') + self._100btc_to_1k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_100btc_to_1k_btc_utxo_count') + self._1k_btc_to_10k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_1k_btc_to_10k_btc_utxo_count') + self._10k_btc_to_100k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_10k_btc_to_100k_btc_utxo_count') + self.over_100k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_100k_btc_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10sats_utxo_count') + self._100sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_100sats_utxo_count') + self._1k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_1k_sats_utxo_count') + self._10k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10k_sats_utxo_count') + self._100k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_100k_sats_utxo_count') + self._1m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_1m_sats_utxo_count') + self._10m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10m_sats_utxo_count') + self._1btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_1btc_utxo_count') + self._10btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10btc_utxo_count') + self._100btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_100btc_utxo_count') + self._1k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_1k_btc_utxo_count') + self._10k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_10k_btc_utxo_count') + self._100k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_under_100k_btc_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1sat_utxo_count') + self._10sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10sats_utxo_count') + self._100sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_100sats_utxo_count') + self._1k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1k_sats_utxo_count') + self._10k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10k_sats_utxo_count') + self._100k_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_100k_sats_utxo_count') + self._1m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1m_sats_utxo_count') + self._10m_sats: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10m_sats_utxo_count') + self._1btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1btc_utxo_count') + self._10btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10btc_utxo_count') + self._100btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_100btc_utxo_count') + self._1k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_1k_btc_utxo_count') + self._10k_btc: BaseDeltaPattern = BaseDeltaPattern(client, 'addrs_over_10k_btc_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Range = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Under = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Over = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance_Over(client) + self.matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'addrs_utxo_count_by_balance_range') + +class SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BaseDeltaPattern = BaseDeltaPattern(client, 'utxo_count') + self.age: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Epoch = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Class = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Class(client) + self.entry: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Entry = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Entry(client) + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_UtxoAmount(client) + self.term: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Term = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Term(client) + self.type: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Type = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_Type(client) + self.age_range_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'utxos_utxo_count_by_age_range') + self.epoch_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'utxo_count_by_epoch') + self.class_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'utxo_count_by_class') + self.entry_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'utxo_count_by_entry') + self.type_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'utxo_count_by_type') + self.amount_range_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'utxos_utxo_count_by_amount_range') + self.addr_balance: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount_AddrBalance(client) + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1h_old_spent_utxo_count') + self._1h_to_1d: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1h_to_1d_old_spent_utxo_count') + self._1d_to_1w: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1d_to_1w_old_spent_utxo_count') + self._1w_to_1m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1w_to_1m_old_spent_utxo_count') + self._1m_to_2m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1m_to_2m_old_spent_utxo_count') + self._2m_to_3m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_2m_to_3m_old_spent_utxo_count') + self._3m_to_4m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_3m_to_4m_old_spent_utxo_count') + self._4m_to_5m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_4m_to_5m_old_spent_utxo_count') + self._5m_to_6m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_5m_to_6m_old_spent_utxo_count') + self._6m_to_9m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_6m_to_9m_old_spent_utxo_count') + self._9m_to_1y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_9m_to_1y_old_spent_utxo_count') + self._1y_to_18m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1y_to_18m_old_spent_utxo_count') + self._18m_to_2y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_18m_to_2y_old_spent_utxo_count') + self._2y_to_3y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_2y_to_3y_old_spent_utxo_count') + self._3y_to_4y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_3y_to_4y_old_spent_utxo_count') + self._4y_to_5y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_4y_to_5y_old_spent_utxo_count') + self._5y_to_6y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_5y_to_6y_old_spent_utxo_count') + self._6y_to_7y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_6y_to_7y_old_spent_utxo_count') + self._7y_to_8y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_7y_to_8y_old_spent_utxo_count') + self._8y_to_10y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_8y_to_10y_old_spent_utxo_count') + self._10y_to_12y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_10y_to_12y_old_spent_utxo_count') + self._12y_to_15y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_12y_to_15y_old_spent_utxo_count') + self.over_15y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_15y_old_spent_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1w_old_spent_utxo_count') + self._1m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1m_old_spent_utxo_count') + self._2m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_2m_old_spent_utxo_count') + self._3m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_3m_old_spent_utxo_count') + self._4m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_4m_old_spent_utxo_count') + self._5m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_5m_old_spent_utxo_count') + self._6m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_6m_old_spent_utxo_count') + self._9m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_9m_old_spent_utxo_count') + self._1y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1y_old_spent_utxo_count') + self._18m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_18m_old_spent_utxo_count') + self._2y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_2y_old_spent_utxo_count') + self._3y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_3y_old_spent_utxo_count') + self._4y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_4y_old_spent_utxo_count') + self._5y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_5y_old_spent_utxo_count') + self._6y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_6y_old_spent_utxo_count') + self._7y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_7y_old_spent_utxo_count') + self._8y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_8y_old_spent_utxo_count') + self._10y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_10y_old_spent_utxo_count') + self._12y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_12y_old_spent_utxo_count') + self._15y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_15y_old_spent_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1d_old_spent_utxo_count') + self._1w: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1w_old_spent_utxo_count') + self._1m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1m_old_spent_utxo_count') + self._2m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_2m_old_spent_utxo_count') + self._3m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_3m_old_spent_utxo_count') + self._4m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_4m_old_spent_utxo_count') + self._5m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_5m_old_spent_utxo_count') + self._6m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_6m_old_spent_utxo_count') + self._9m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_9m_old_spent_utxo_count') + self._1y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1y_old_spent_utxo_count') + self._18m: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_18m_old_spent_utxo_count') + self._2y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_2y_old_spent_utxo_count') + self._3y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_3y_old_spent_utxo_count') + self._4y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_4y_old_spent_utxo_count') + self._5y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_5y_old_spent_utxo_count') + self._6y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_6y_old_spent_utxo_count') + self._7y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_7y_old_spent_utxo_count') + self._8y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_8y_old_spent_utxo_count') + self._10y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_10y_old_spent_utxo_count') + self._12y: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_12y_old_spent_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Range = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Under = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Over = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'epoch_0_spent_utxo_count') + self._1: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'epoch_1_spent_utxo_count') + self._2: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'epoch_2_spent_utxo_count') + self._3: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'epoch_3_spent_utxo_count') + self._4: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'epoch_4_spent_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2009_spent_utxo_count') + self._2010: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2010_spent_utxo_count') + self._2011: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2011_spent_utxo_count') + self._2012: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2012_spent_utxo_count') + self._2013: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2013_spent_utxo_count') + self._2014: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2014_spent_utxo_count') + self._2015: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2015_spent_utxo_count') + self._2016: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2016_spent_utxo_count') + self._2017: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2017_spent_utxo_count') + self._2018: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2018_spent_utxo_count') + self._2019: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2019_spent_utxo_count') + self._2020: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2020_spent_utxo_count') + self._2021: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2021_spent_utxo_count') + self._2022: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2022_spent_utxo_count') + self._2023: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2023_spent_utxo_count') + self._2024: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2024_spent_utxo_count') + self._2025: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2025_spent_utxo_count') + self._2026: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'class_2026_spent_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_0sats_spent_utxo_count') + self._1sat_to_10sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1sat_to_10sats_spent_utxo_count') + self._10sats_to_100sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_10sats_to_100sats_spent_utxo_count') + self._100sats_to_1k_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_100sats_to_1k_sats_spent_utxo_count') + self._1k_sats_to_10k_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1k_sats_to_10k_sats_spent_utxo_count') + self._10k_sats_to_100k_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_10k_sats_to_100k_sats_spent_utxo_count') + self._100k_sats_to_1m_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_100k_sats_to_1m_sats_spent_utxo_count') + self._1m_sats_to_10m_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1m_sats_to_10m_sats_spent_utxo_count') + self._10m_sats_to_1btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_10m_sats_to_1btc_spent_utxo_count') + self._1btc_to_10btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1btc_to_10btc_spent_utxo_count') + self._10btc_to_100btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_10btc_to_100btc_spent_utxo_count') + self._100btc_to_1k_btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_100btc_to_1k_btc_spent_utxo_count') + self._1k_btc_to_10k_btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_1k_btc_to_10k_btc_spent_utxo_count') + self._10k_btc_to_100k_btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_10k_btc_to_100k_btc_spent_utxo_count') + self.over_100k_btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_100k_btc_spent_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_10sats_spent_utxo_count') + self._100sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_100sats_spent_utxo_count') + self._1k_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1k_sats_spent_utxo_count') + self._10k_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_10k_sats_spent_utxo_count') + self._100k_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_100k_sats_spent_utxo_count') + self._1m_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1m_sats_spent_utxo_count') + self._10m_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_10m_sats_spent_utxo_count') + self._1btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1btc_spent_utxo_count') + self._10btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_10btc_spent_utxo_count') + self._100btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_100btc_spent_utxo_count') + self._1k_btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1k_btc_spent_utxo_count') + self._10k_btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_10k_btc_spent_utxo_count') + self._100k_btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_100k_btc_spent_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1sat_spent_utxo_count') + self._10sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_10sats_spent_utxo_count') + self._100sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_100sats_spent_utxo_count') + self._1k_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1k_sats_spent_utxo_count') + self._10k_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_10k_sats_spent_utxo_count') + self._100k_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_100k_sats_spent_utxo_count') + self._1m_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1m_sats_spent_utxo_count') + self._10m_sats: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_10m_sats_spent_utxo_count') + self._1btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1btc_spent_utxo_count') + self._10btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_10btc_spent_utxo_count') + self._100btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_100btc_spent_utxo_count') + self._1k_btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1k_btc_spent_utxo_count') + self._10k_btc: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_10k_btc_spent_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Range = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Under = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Over = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount_Over(client) + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Type: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.p2pk65: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2pk65_spent_utxo_count') + self.p2pk33: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2pk33_spent_utxo_count') + self.p2pkh: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2pkh_spent_utxo_count') + self.p2ms: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2ms_spent_utxo_count') + self.p2sh: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2sh_spent_utxo_count') + self.p2wpkh: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2wpkh_spent_utxo_count') + self.p2wsh: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2wsh_spent_utxo_count') + self.p2tr: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2tr_spent_utxo_count') + self.p2a: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'p2a_spent_utxo_count') + self.unknown: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'unknown_outputs_spent_utxo_count') + self.empty: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'empty_outputs_spent_utxo_count') + +class SeriesTree_Cohorts_Cohorts_Outputs_SpentCount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AverageBlockCumulativeSumPattern[StoredU64] = AverageBlockCumulativeSumPattern(client, 'spent_utxo_count') + self.age: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Epoch = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Class = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Class(client) + self.entry: DiscountPremiumPattern = DiscountPremiumPattern(client, 'spent_utxo_count') + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_UtxoAmount(client) + self.term: LongShortPattern = LongShortPattern(client, 'spent_utxo_count') + self.type: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Type = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount_Type(client) + self.age_range_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'utxos_spent_utxo_count_cumulative_by_age_range') + self.epoch_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'spent_utxo_count_cumulative_by_epoch') + self.class_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'spent_utxo_count_cumulative_by_class') + self.entry_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'spent_utxo_count_cumulative_by_entry') + self.type_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'spent_utxo_count_cumulative_by_type') + self.amount_range_matrix: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'utxos_spent_utxo_count_cumulative_by_amount_range') + +class SeriesTree_Cohorts_Cohorts_Outputs: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.unspent_count: SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount = SeriesTree_Cohorts_Cohorts_Outputs_UnspentCount(client) + self.spent_count: SeriesTree_Cohorts_Cohorts_Outputs_SpentCount = SeriesTree_Cohorts_Cohorts_Outputs_SpentCount(client) + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'epoch_0_transfer_volume') + self._1: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'epoch_1_transfer_volume') + self._2: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'epoch_2_transfer_volume') + self._3: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'epoch_3_transfer_volume') + self._4: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'epoch_4_transfer_volume') + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2009_transfer_volume') + self._2010: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2010_transfer_volume') + self._2011: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2011_transfer_volume') + self._2012: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2012_transfer_volume') + self._2013: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2013_transfer_volume') + self._2014: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2014_transfer_volume') + self._2015: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2015_transfer_volume') + self._2016: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2016_transfer_volume') + self._2017: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2017_transfer_volume') + self._2018: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2018_transfer_volume') + self._2019: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2019_transfer_volume') + self._2020: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2020_transfer_volume') + self._2021: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2021_transfer_volume') + self._2022: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2022_transfer_volume') + self._2023: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2023_transfer_volume') + self._2024: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2024_transfer_volume') + self._2025: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2025_transfer_volume') + self._2026: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'class_2026_transfer_volume') + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_UtxoAmount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2 = _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2(client, 'utxos') + self.under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2 = _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2(client, 'utxos_under') + self.over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2 = _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2(client, 'utxos_over') + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Type: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.p2pk65: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'p2pk65_transfer_volume') + self.p2pk33: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'p2pk33_transfer_volume') + self.p2pkh: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'p2pkh_transfer_volume') + self.p2ms: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'p2ms_transfer_volume') + self.p2sh: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'p2sh_transfer_volume') + self.p2wpkh: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'p2wpkh_transfer_volume') + self.p2wsh: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'p2wsh_transfer_volume') + self.p2tr: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'p2tr_transfer_volume') + self.p2a: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'p2a_transfer_volume') + self.unknown: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'unknown_outputs_transfer_volume') + self.empty: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'empty_outputs_transfer_volume') + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Cumulative: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.age_range: CentsSatsPattern = CentsSatsPattern(client, 'utxos_transfer_volume_cumulative_by_age_range') + self.epoch: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_cumulative_by_epoch') + self.class_: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_cumulative_by_class') + self.entry: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_cumulative_by_entry') + self.amount_range: CentsSatsPattern = CentsSatsPattern(client, 'utxos_transfer_volume_cumulative_by_amount_range') + self.type_: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_cumulative_by_type') + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_AddrBalance: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2 = _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern2(client, 'addrs') + self.under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2 = _100btc100k100sats10btc10k10m10sats1btc1k1mPattern2(client, 'addrs_under') + self.over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2 = _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern2(client, 'addrs_over') + self.values: CentsSatsPattern = CentsSatsPattern(client, 'addrs_transfer_volume_cumulative_by_balance_range') + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit_Cumulative: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.age_range: CentsSatsPattern = CentsSatsPattern(client, 'utxos_transfer_volume_in_profit_cumulative_by_age_range') + self.epoch: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_in_profit_cumulative_by_epoch') + self.class_: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_in_profit_cumulative_by_class') + self.entry: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_in_profit_cumulative_by_entry') + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'transfer_volume_in_profit') + self.age: OverRangeUnderPattern2 = OverRangeUnderPattern2(client, 'utxos') + self.epoch: _01234Pattern2 = _01234Pattern2(client, 'epoch', 'in_profit') + self.class_: _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2 = _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2(client, 'class', 'in_profit') + self.entry: DiscountPremiumPattern2 = DiscountPremiumPattern2(client, 'transfer_volume_in_profit') + self.term: LongShortPattern2 = LongShortPattern2(client, 'transfer_volume_in_profit') + self.cumulative: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit_Cumulative = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit_Cumulative(client) + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss_Cumulative: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.age_range: CentsSatsPattern = CentsSatsPattern(client, 'utxos_transfer_volume_in_loss_cumulative_by_age_range') + self.epoch: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_in_loss_cumulative_by_epoch') + self.class_: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_in_loss_cumulative_by_class') + self.entry: CentsSatsPattern = CentsSatsPattern(client, 'transfer_volume_in_loss_cumulative_by_entry') + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'transfer_volume_in_loss') + self.age: OverRangeUnderPattern2 = OverRangeUnderPattern2(client, 'utxos') + self.epoch: _01234Pattern2 = _01234Pattern2(client, 'epoch', 'in_loss') + self.class_: _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2 = _200920102011201220132014201520162017201820192020202120222023202420252026Pattern2(client, 'class', 'in_loss') + self.entry: DiscountPremiumPattern2 = DiscountPremiumPattern2(client, 'transfer_volume_in_loss') + self.term: LongShortPattern2 = LongShortPattern2(client, 'transfer_volume_in_loss') + self.cumulative: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss_Cumulative = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss_Cumulative(client) + +class SeriesTree_Cohorts_Cohorts_Activity_TransferVolume: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AverageBlockCumulativeSumPattern2 = AverageBlockCumulativeSumPattern2(client, 'transfer_volume') + self.age: OverRangeUnderPattern2 = OverRangeUnderPattern2(client, 'utxos') + self.epoch: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Epoch = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Class = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Class(client) + self.entry: DiscountPremiumPattern2 = DiscountPremiumPattern2(client, 'transfer_volume') + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_UtxoAmount = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_UtxoAmount(client) + self.term: LongShortPattern2 = LongShortPattern2(client, 'transfer_volume') + self.type: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Type = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Type(client) + self.cumulative: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Cumulative = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_Cumulative(client) + self.addr_balance: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_AddrBalance = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_AddrBalance(client) + self.in_profit: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InProfit(client) + self.in_loss: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume_InLoss(client) + +class SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1h_old_coindays_destroyed') + self._1h_to_1d: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_1h_to_1d_old_coindays_destroyed') + self._1d_to_1w: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_1d_to_1w_old_coindays_destroyed') + self._1w_to_1m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_1w_to_1m_old_coindays_destroyed') + self._1m_to_2m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_1m_to_2m_old_coindays_destroyed') + self._2m_to_3m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_2m_to_3m_old_coindays_destroyed') + self._3m_to_4m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_3m_to_4m_old_coindays_destroyed') + self._4m_to_5m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_4m_to_5m_old_coindays_destroyed') + self._5m_to_6m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_5m_to_6m_old_coindays_destroyed') + self._6m_to_9m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_6m_to_9m_old_coindays_destroyed') + self._9m_to_1y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_9m_to_1y_old_coindays_destroyed') + self._1y_to_18m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_1y_to_18m_old_coindays_destroyed') + self._18m_to_2y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_18m_to_2y_old_coindays_destroyed') + self._2y_to_3y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_2y_to_3y_old_coindays_destroyed') + self._3y_to_4y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_3y_to_4y_old_coindays_destroyed') + self._4y_to_5y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_4y_to_5y_old_coindays_destroyed') + self._5y_to_6y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_5y_to_6y_old_coindays_destroyed') + self._6y_to_7y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_6y_to_7y_old_coindays_destroyed') + self._7y_to_8y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_7y_to_8y_old_coindays_destroyed') + self._8y_to_10y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_8y_to_10y_old_coindays_destroyed') + self._10y_to_12y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_10y_to_12y_old_coindays_destroyed') + self._12y_to_15y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_12y_to_15y_old_coindays_destroyed') + self.over_15y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_15y_old_coindays_destroyed') + +class SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1w_old_coindays_destroyed') + self._1m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1m_old_coindays_destroyed') + self._2m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_2m_old_coindays_destroyed') + self._3m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_3m_old_coindays_destroyed') + self._4m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_4m_old_coindays_destroyed') + self._5m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_5m_old_coindays_destroyed') + self._6m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_6m_old_coindays_destroyed') + self._9m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_9m_old_coindays_destroyed') + self._1y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_1y_old_coindays_destroyed') + self._18m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_18m_old_coindays_destroyed') + self._2y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_2y_old_coindays_destroyed') + self._3y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_3y_old_coindays_destroyed') + self._4y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_4y_old_coindays_destroyed') + self._5y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_5y_old_coindays_destroyed') + self._6y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_6y_old_coindays_destroyed') + self._7y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_7y_old_coindays_destroyed') + self._8y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_8y_old_coindays_destroyed') + self._10y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_10y_old_coindays_destroyed') + self._12y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_12y_old_coindays_destroyed') + self._15y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_under_15y_old_coindays_destroyed') + +class SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1d_old_coindays_destroyed') + self._1w: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1w_old_coindays_destroyed') + self._1m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1m_old_coindays_destroyed') + self._2m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_2m_old_coindays_destroyed') + self._3m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_3m_old_coindays_destroyed') + self._4m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_4m_old_coindays_destroyed') + self._5m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_5m_old_coindays_destroyed') + self._6m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_6m_old_coindays_destroyed') + self._9m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_9m_old_coindays_destroyed') + self._1y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_1y_old_coindays_destroyed') + self._18m: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_18m_old_coindays_destroyed') + self._2y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_2y_old_coindays_destroyed') + self._3y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_3y_old_coindays_destroyed') + self._4y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_4y_old_coindays_destroyed') + self._5y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_5y_old_coindays_destroyed') + self._6y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_6y_old_coindays_destroyed') + self._7y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_7y_old_coindays_destroyed') + self._8y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_8y_old_coindays_destroyed') + self._10y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_10y_old_coindays_destroyed') + self._12y: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'utxos_over_12y_old_coindays_destroyed') + +class SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Range = SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Under = SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Over = SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'epoch_0_coindays_destroyed') + self._1: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'epoch_1_coindays_destroyed') + self._2: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'epoch_2_coindays_destroyed') + self._3: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'epoch_3_coindays_destroyed') + self._4: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'epoch_4_coindays_destroyed') + +class SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2009_coindays_destroyed') + self._2010: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2010_coindays_destroyed') + self._2011: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2011_coindays_destroyed') + self._2012: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2012_coindays_destroyed') + self._2013: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2013_coindays_destroyed') + self._2014: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2014_coindays_destroyed') + self._2015: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2015_coindays_destroyed') + self._2016: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2016_coindays_destroyed') + self._2017: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2017_coindays_destroyed') + self._2018: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2018_coindays_destroyed') + self._2019: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2019_coindays_destroyed') + self._2020: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2020_coindays_destroyed') + self._2021: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2021_coindays_destroyed') + self._2022: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2022_coindays_destroyed') + self._2023: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2023_coindays_destroyed') + self._2024: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2024_coindays_destroyed') + self._2025: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2025_coindays_destroyed') + self._2026: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'class_2026_coindays_destroyed') + +class SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AverageBlockCumulativeSumPattern[StoredF64] = AverageBlockCumulativeSumPattern(client, 'coindays_destroyed') + self.age: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age = SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Epoch = SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Class = SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed_Class(client) + self.entry: DiscountPremiumPattern = DiscountPremiumPattern(client, 'coindays_destroyed') + self.term: LongShortPattern = LongShortPattern(client, 'coindays_destroyed') + self.age_range_matrix: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_coindays_destroyed_cumulative_by_age_range') + self.epoch_matrix: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coindays_destroyed_cumulative_by_epoch') + self.class_matrix: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coindays_destroyed_cumulative_by_class') + self.entry_matrix: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'coindays_destroyed_cumulative_by_entry') + +class SeriesTree_Cohorts_Cohorts_Activity_CoinyearsDestroyed: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'all_coinyears_destroyed') + self.sth: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sth_coinyears_destroyed') + self.lth: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'lth_coinyears_destroyed') + +class SeriesTree_Cohorts_Cohorts_Activity_Dormancy: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: _1m1w1y24hHeightPattern = _1m1w1y24hHeightPattern(client, 'all_dormancy') + self.sth: _1m1w1y24hHeightPattern = _1m1w1y24hHeightPattern(client, 'sth_dormancy') + self.lth: _1m1w1y24hHeightPattern = _1m1w1y24hHeightPattern(client, 'lth_dormancy') + +class SeriesTree_Cohorts_Cohorts_Activity: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.transfer_volume: SeriesTree_Cohorts_Cohorts_Activity_TransferVolume = SeriesTree_Cohorts_Cohorts_Activity_TransferVolume(client) + self.coindays_destroyed: SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed = SeriesTree_Cohorts_Cohorts_Activity_CoindaysDestroyed(client) + self.coinyears_destroyed: SeriesTree_Cohorts_Cohorts_Activity_CoinyearsDestroyed = SeriesTree_Cohorts_Cohorts_Activity_CoinyearsDestroyed(client) + self.dormancy: SeriesTree_Cohorts_Cohorts_Activity_Dormancy = SeriesTree_Cohorts_Cohorts_Activity_Dormancy(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_1h_old_realized_cap') + self._1h_to_1d: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_1h_to_1d_old_realized_cap') + self._1d_to_1w: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_1d_to_1w_old_realized_cap') + self._1w_to_1m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_1w_to_1m_old_realized_cap') + self._1m_to_2m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_1m_to_2m_old_realized_cap') + self._2m_to_3m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_2m_to_3m_old_realized_cap') + self._3m_to_4m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_3m_to_4m_old_realized_cap') + self._4m_to_5m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_4m_to_5m_old_realized_cap') + self._5m_to_6m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_5m_to_6m_old_realized_cap') + self._6m_to_9m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_6m_to_9m_old_realized_cap') + self._9m_to_1y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_9m_to_1y_old_realized_cap') + self._1y_to_18m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_1y_to_18m_old_realized_cap') + self._18m_to_2y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_18m_to_2y_old_realized_cap') + self._2y_to_3y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_2y_to_3y_old_realized_cap') + self._3y_to_4y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_3y_to_4y_old_realized_cap') + self._4y_to_5y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_4y_to_5y_old_realized_cap') + self._5y_to_6y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_5y_to_6y_old_realized_cap') + self._6y_to_7y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_6y_to_7y_old_realized_cap') + self._7y_to_8y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_7y_to_8y_old_realized_cap') + self._8y_to_10y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_8y_to_10y_old_realized_cap') + self._10y_to_12y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_10y_to_12y_old_realized_cap') + self._12y_to_15y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_12y_to_15y_old_realized_cap') + self.over_15y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_15y_old_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_1w_old_realized_cap') + self._1m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_1m_old_realized_cap') + self._2m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_2m_old_realized_cap') + self._3m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_3m_old_realized_cap') + self._4m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_4m_old_realized_cap') + self._5m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_5m_old_realized_cap') + self._6m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_6m_old_realized_cap') + self._9m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_9m_old_realized_cap') + self._1y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_1y_old_realized_cap') + self._18m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_18m_old_realized_cap') + self._2y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_2y_old_realized_cap') + self._3y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_3y_old_realized_cap') + self._4y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_4y_old_realized_cap') + self._5y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_5y_old_realized_cap') + self._6y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_6y_old_realized_cap') + self._7y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_7y_old_realized_cap') + self._8y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_8y_old_realized_cap') + self._10y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_10y_old_realized_cap') + self._12y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_12y_old_realized_cap') + self._15y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_under_15y_old_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_1d_old_realized_cap') + self._1w: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_1w_old_realized_cap') + self._1m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_1m_old_realized_cap') + self._2m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_2m_old_realized_cap') + self._3m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_3m_old_realized_cap') + self._4m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_4m_old_realized_cap') + self._5m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_5m_old_realized_cap') + self._6m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_6m_old_realized_cap') + self._9m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_9m_old_realized_cap') + self._1y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_1y_old_realized_cap') + self._18m: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_18m_old_realized_cap') + self._2y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_2y_old_realized_cap') + self._3y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_3y_old_realized_cap') + self._4y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_4y_old_realized_cap') + self._5y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_5y_old_realized_cap') + self._6y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_6y_old_realized_cap') + self._7y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_7y_old_realized_cap') + self._8y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_8y_old_realized_cap') + self._10y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_10y_old_realized_cap') + self._12y: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'utxos_over_12y_old_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Range = SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Under = SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Over = SeriesTree_Cohorts_Cohorts_Realized_Cap_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'epoch_0_realized_cap') + self._1: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'epoch_1_realized_cap') + self._2: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'epoch_2_realized_cap') + self._3: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'epoch_3_realized_cap') + self._4: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'epoch_4_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2009_realized_cap') + self._2010: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2010_realized_cap') + self._2011: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2011_realized_cap') + self._2012: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2012_realized_cap') + self._2013: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2013_realized_cap') + self._2014: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2014_realized_cap') + self._2015: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2015_realized_cap') + self._2016: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2016_realized_cap') + self._2017: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2017_realized_cap') + self._2018: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2018_realized_cap') + self._2019: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2019_realized_cap') + self._2020: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2020_realized_cap') + self._2021: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2021_realized_cap') + self._2022: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2022_realized_cap') + self._2023: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2023_realized_cap') + self._2024: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2024_realized_cap') + self._2025: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2025_realized_cap') + self._2026: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'class_2026_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_Entry: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'veteran_realized_cap') + self.premium: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'rookie_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_UtxoAmount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4 = _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4(client, 'utxos') + self.under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4 = _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4(client, 'utxos_under') + self.over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4 = _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4(client, 'utxos_over') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_Term: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'sth_realized_cap') + self.long: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_Type: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.p2pk65: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'p2pk65_realized_cap') + self.p2pk33: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'p2pk33_realized_cap') + self.p2pkh: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'p2pkh_realized_cap') + self.p2ms: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'p2ms_realized_cap') + self.p2sh: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'p2sh_realized_cap') + self.p2wpkh: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'p2wpkh_realized_cap') + self.p2wsh: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'p2wsh_realized_cap') + self.p2tr: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'p2tr_realized_cap') + self.p2a: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'p2a_realized_cap') + self.unknown: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'unknown_outputs_realized_cap') + self.empty: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'empty_outputs_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap_AddrBalance: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4 = _0sats100btc100k100sats10btc10k10m10sats1btc1k1m1satOverPattern4(client, 'addrs') + self.under: _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4 = _100btc100k100sats10btc10k10m10sats1btc1k1mPattern4(client, 'addrs_under') + self.over: _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4 = _100btc100k100sats10btc10k10m10sats1btc1k1m1satPattern4(client, 'addrs_over') + self.matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'addrs_realized_cap_cents_by_balance_range') + +class SeriesTree_Cohorts_Cohorts_Realized_Cap: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'realized_cap') + self.age: SeriesTree_Cohorts_Cohorts_Realized_Cap_Age = SeriesTree_Cohorts_Cohorts_Realized_Cap_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Realized_Cap_Epoch = SeriesTree_Cohorts_Cohorts_Realized_Cap_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Realized_Cap_Class = SeriesTree_Cohorts_Cohorts_Realized_Cap_Class(client) + self.entry: SeriesTree_Cohorts_Cohorts_Realized_Cap_Entry = SeriesTree_Cohorts_Cohorts_Realized_Cap_Entry(client) + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Cap_UtxoAmount = SeriesTree_Cohorts_Cohorts_Realized_Cap_UtxoAmount(client) + self.term: SeriesTree_Cohorts_Cohorts_Realized_Cap_Term = SeriesTree_Cohorts_Cohorts_Realized_Cap_Term(client) + self.type: SeriesTree_Cohorts_Cohorts_Realized_Cap_Type = SeriesTree_Cohorts_Cohorts_Realized_Cap_Type(client) + self.age_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_cap_cents_by_age_range') + self.epoch_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_cap_cents_by_epoch') + self.class_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_cap_cents_by_class') + self.entry_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_cap_cents_by_entry') + self.type_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_cap_cents_by_type') + self.amount_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_cap_cents_by_amount_range') + self.addr_balance: SeriesTree_Cohorts_Cohorts_Realized_Cap_AddrBalance = SeriesTree_Cohorts_Cohorts_Realized_Cap_AddrBalance(client) + self.to_own_mcap: AllLthSthPattern5 = AllLthSthPattern5(client, 'realized_cap_to_own_mcap') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_1h_old_realized_price') + self._1h_to_1d: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1h_to_1d_old_realized_price') + self._1d_to_1w: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1d_to_1w_old_realized_price') + self._1w_to_1m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1w_to_1m_old_realized_price') + self._1m_to_2m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1m_to_2m_old_realized_price') + self._2m_to_3m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_2m_to_3m_old_realized_price') + self._3m_to_4m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_3m_to_4m_old_realized_price') + self._4m_to_5m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_4m_to_5m_old_realized_price') + self._5m_to_6m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_5m_to_6m_old_realized_price') + self._6m_to_9m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_6m_to_9m_old_realized_price') + self._9m_to_1y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_9m_to_1y_old_realized_price') + self._1y_to_18m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1y_to_18m_old_realized_price') + self._18m_to_2y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_18m_to_2y_old_realized_price') + self._2y_to_3y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_2y_to_3y_old_realized_price') + self._3y_to_4y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_3y_to_4y_old_realized_price') + self._4y_to_5y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_4y_to_5y_old_realized_price') + self._5y_to_6y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_5y_to_6y_old_realized_price') + self._6y_to_7y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_6y_to_7y_old_realized_price') + self._7y_to_8y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_7y_to_8y_old_realized_price') + self._8y_to_10y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_8y_to_10y_old_realized_price') + self._10y_to_12y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_10y_to_12y_old_realized_price') + self._12y_to_15y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_12y_to_15y_old_realized_price') + self.over_15y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_15y_old_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_1w_old_realized_price') + self._1m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_1m_old_realized_price') + self._2m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_2m_old_realized_price') + self._3m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_3m_old_realized_price') + self._4m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_4m_old_realized_price') + self._5m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_5m_old_realized_price') + self._6m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_6m_old_realized_price') + self._9m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_9m_old_realized_price') + self._1y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_1y_old_realized_price') + self._18m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_18m_old_realized_price') + self._2y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_2y_old_realized_price') + self._3y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_3y_old_realized_price') + self._4y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_4y_old_realized_price') + self._5y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_5y_old_realized_price') + self._6y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_6y_old_realized_price') + self._7y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_7y_old_realized_price') + self._8y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_8y_old_realized_price') + self._10y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_10y_old_realized_price') + self._12y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_12y_old_realized_price') + self._15y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_15y_old_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_1d_old_realized_price') + self._1w: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_1w_old_realized_price') + self._1m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_1m_old_realized_price') + self._2m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_2m_old_realized_price') + self._3m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_3m_old_realized_price') + self._4m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_4m_old_realized_price') + self._5m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_5m_old_realized_price') + self._6m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_6m_old_realized_price') + self._9m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_9m_old_realized_price') + self._1y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_1y_old_realized_price') + self._18m: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_18m_old_realized_price') + self._2y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_2y_old_realized_price') + self._3y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_3y_old_realized_price') + self._4y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_4y_old_realized_price') + self._5y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_5y_old_realized_price') + self._6y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_6y_old_realized_price') + self._7y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_7y_old_realized_price') + self._8y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_8y_old_realized_price') + self._10y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_10y_old_realized_price') + self._12y: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_12y_old_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Range = SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Under = SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Over = SeriesTree_Cohorts_Cohorts_Realized_Price_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Price_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'epoch_0_realized_price') + self._1: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'epoch_1_realized_price') + self._2: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'epoch_2_realized_price') + self._3: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'epoch_3_realized_price') + self._4: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'epoch_4_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2009_realized_price') + self._2010: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2010_realized_price') + self._2011: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2011_realized_price') + self._2012: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2012_realized_price') + self._2013: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2013_realized_price') + self._2014: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2014_realized_price') + self._2015: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2015_realized_price') + self._2016: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2016_realized_price') + self._2017: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2017_realized_price') + self._2018: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2018_realized_price') + self._2019: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2019_realized_price') + self._2020: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2020_realized_price') + self._2021: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2021_realized_price') + self._2022: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2022_realized_price') + self._2023: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2023_realized_price') + self._2024: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2024_realized_price') + self._2025: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2025_realized_price') + self._2026: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'class_2026_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_Entry: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'veteran_realized_price') + self.premium: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'rookie_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_0sats_realized_price') + self._1sat_to_10sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1sat_to_10sats_realized_price') + self._10sats_to_100sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_10sats_to_100sats_realized_price') + self._100sats_to_1k_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_100sats_to_1k_sats_realized_price') + self._1k_sats_to_10k_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1k_sats_to_10k_sats_realized_price') + self._10k_sats_to_100k_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_10k_sats_to_100k_sats_realized_price') + self._100k_sats_to_1m_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_100k_sats_to_1m_sats_realized_price') + self._1m_sats_to_10m_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1m_sats_to_10m_sats_realized_price') + self._10m_sats_to_1btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_10m_sats_to_1btc_realized_price') + self._1btc_to_10btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1btc_to_10btc_realized_price') + self._10btc_to_100btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_10btc_to_100btc_realized_price') + self._100btc_to_1k_btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_100btc_to_1k_btc_realized_price') + self._1k_btc_to_10k_btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_1k_btc_to_10k_btc_realized_price') + self._10k_btc_to_100k_btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_10k_btc_to_100k_btc_realized_price') + self.over_100k_btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_100k_btc_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_10sats_realized_price') + self._100sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_100sats_realized_price') + self._1k_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_1k_sats_realized_price') + self._10k_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_10k_sats_realized_price') + self._100k_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_100k_sats_realized_price') + self._1m_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_1m_sats_realized_price') + self._10m_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_10m_sats_realized_price') + self._1btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_1btc_realized_price') + self._10btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_10btc_realized_price') + self._100btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_100btc_realized_price') + self._1k_btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_1k_btc_realized_price') + self._10k_btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_10k_btc_realized_price') + self._100k_btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_under_100k_btc_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_1sat_realized_price') + self._10sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_10sats_realized_price') + self._100sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_100sats_realized_price') + self._1k_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_1k_sats_realized_price') + self._10k_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_10k_sats_realized_price') + self._100k_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_100k_sats_realized_price') + self._1m_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_1m_sats_realized_price') + self._10m_sats: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_10m_sats_realized_price') + self._1btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_1btc_realized_price') + self._10btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_10btc_realized_price') + self._100btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_100btc_realized_price') + self._1k_btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_1k_btc_realized_price') + self._10k_btc: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'utxos_over_10k_btc_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Range = SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Under = SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Over = SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Price_Term: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'sth_realized_price') + self.long: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'lth_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price_Type: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.p2pk65: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'p2pk65_realized_price') + self.p2pk33: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'p2pk33_realized_price') + self.p2pkh: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'p2pkh_realized_price') + self.p2ms: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'p2ms_realized_price') + self.p2sh: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'p2sh_realized_price') + self.p2wpkh: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'p2wpkh_realized_price') + self.p2wsh: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'p2wsh_realized_price') + self.p2tr: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'p2tr_realized_price') + self.p2a: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'p2a_realized_price') + self.unknown: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'unknown_outputs_realized_price') + self.empty: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'empty_outputs_realized_price') + +class SeriesTree_Cohorts_Cohorts_Realized_Price: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'realized_price') + self.age: SeriesTree_Cohorts_Cohorts_Realized_Price_Age = SeriesTree_Cohorts_Cohorts_Realized_Price_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Realized_Price_Epoch = SeriesTree_Cohorts_Cohorts_Realized_Price_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Realized_Price_Class = SeriesTree_Cohorts_Cohorts_Realized_Price_Class(client) + self.entry: SeriesTree_Cohorts_Cohorts_Realized_Price_Entry = SeriesTree_Cohorts_Cohorts_Realized_Price_Entry(client) + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount = SeriesTree_Cohorts_Cohorts_Realized_Price_UtxoAmount(client) + self.term: SeriesTree_Cohorts_Cohorts_Realized_Price_Term = SeriesTree_Cohorts_Cohorts_Realized_Price_Term(client) + self.type: SeriesTree_Cohorts_Cohorts_Realized_Price_Type = SeriesTree_Cohorts_Cohorts_Realized_Price_Type(client) + self.age_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_price_cents_by_age_range') + self.epoch_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_price_cents_by_epoch') + self.class_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_price_cents_by_class') + self.entry_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_price_cents_by_entry') + self.type_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_price_cents_by_type') + self.amount_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_price_cents_by_amount_range') + self.aggregate_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_price_cents_by_aggregate') + self.under_age_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_price_cents_by_under_age') + self.over_age_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_price_cents_by_over_age') + self.under_amount_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_price_cents_by_under_amount') + self.over_amount_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_price_cents_by_over_amount') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1h_old_realized_profit') + self._1h_to_1d: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1h_to_1d_old_realized_profit') + self._1d_to_1w: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1d_to_1w_old_realized_profit') + self._1w_to_1m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1w_to_1m_old_realized_profit') + self._1m_to_2m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1m_to_2m_old_realized_profit') + self._2m_to_3m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_2m_to_3m_old_realized_profit') + self._3m_to_4m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_3m_to_4m_old_realized_profit') + self._4m_to_5m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_4m_to_5m_old_realized_profit') + self._5m_to_6m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_5m_to_6m_old_realized_profit') + self._6m_to_9m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_6m_to_9m_old_realized_profit') + self._9m_to_1y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_9m_to_1y_old_realized_profit') + self._1y_to_18m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1y_to_18m_old_realized_profit') + self._18m_to_2y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_18m_to_2y_old_realized_profit') + self._2y_to_3y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_2y_to_3y_old_realized_profit') + self._3y_to_4y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_3y_to_4y_old_realized_profit') + self._4y_to_5y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_4y_to_5y_old_realized_profit') + self._5y_to_6y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_5y_to_6y_old_realized_profit') + self._6y_to_7y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_6y_to_7y_old_realized_profit') + self._7y_to_8y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_7y_to_8y_old_realized_profit') + self._8y_to_10y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_8y_to_10y_old_realized_profit') + self._10y_to_12y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10y_to_12y_old_realized_profit') + self._12y_to_15y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_12y_to_15y_old_realized_profit') + self.over_15y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_15y_old_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1w_old_realized_profit') + self._1m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1m_old_realized_profit') + self._2m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_2m_old_realized_profit') + self._3m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_3m_old_realized_profit') + self._4m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_4m_old_realized_profit') + self._5m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_5m_old_realized_profit') + self._6m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_6m_old_realized_profit') + self._9m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_9m_old_realized_profit') + self._1y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1y_old_realized_profit') + self._18m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_18m_old_realized_profit') + self._2y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_2y_old_realized_profit') + self._3y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_3y_old_realized_profit') + self._4y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_4y_old_realized_profit') + self._5y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_5y_old_realized_profit') + self._6y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_6y_old_realized_profit') + self._7y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_7y_old_realized_profit') + self._8y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_8y_old_realized_profit') + self._10y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10y_old_realized_profit') + self._12y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_12y_old_realized_profit') + self._15y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_15y_old_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1d_old_realized_profit') + self._1w: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1w_old_realized_profit') + self._1m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1m_old_realized_profit') + self._2m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_2m_old_realized_profit') + self._3m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_3m_old_realized_profit') + self._4m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_4m_old_realized_profit') + self._5m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_5m_old_realized_profit') + self._6m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_6m_old_realized_profit') + self._9m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_9m_old_realized_profit') + self._1y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1y_old_realized_profit') + self._18m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_18m_old_realized_profit') + self._2y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_2y_old_realized_profit') + self._3y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_3y_old_realized_profit') + self._4y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_4y_old_realized_profit') + self._5y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_5y_old_realized_profit') + self._6y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_6y_old_realized_profit') + self._7y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_7y_old_realized_profit') + self._8y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_8y_old_realized_profit') + self._10y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10y_old_realized_profit') + self._12y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_12y_old_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Range = SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Under = SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Over = SeriesTree_Cohorts_Cohorts_Realized_Profit_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_0_realized_profit') + self._1: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_1_realized_profit') + self._2: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_2_realized_profit') + self._3: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_3_realized_profit') + self._4: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_4_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2009_realized_profit') + self._2010: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2010_realized_profit') + self._2011: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2011_realized_profit') + self._2012: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2012_realized_profit') + self._2013: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2013_realized_profit') + self._2014: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2014_realized_profit') + self._2015: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2015_realized_profit') + self._2016: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2016_realized_profit') + self._2017: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2017_realized_profit') + self._2018: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2018_realized_profit') + self._2019: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2019_realized_profit') + self._2020: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2020_realized_profit') + self._2021: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2021_realized_profit') + self._2022: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2022_realized_profit') + self._2023: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2023_realized_profit') + self._2024: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2024_realized_profit') + self._2025: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2025_realized_profit') + self._2026: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2026_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_0sats_realized_profit') + self._1sat_to_10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1sat_to_10sats_realized_profit') + self._10sats_to_100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10sats_to_100sats_realized_profit') + self._100sats_to_1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_100sats_to_1k_sats_realized_profit') + self._1k_sats_to_10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1k_sats_to_10k_sats_realized_profit') + self._10k_sats_to_100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10k_sats_to_100k_sats_realized_profit') + self._100k_sats_to_1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_100k_sats_to_1m_sats_realized_profit') + self._1m_sats_to_10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1m_sats_to_10m_sats_realized_profit') + self._10m_sats_to_1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10m_sats_to_1btc_realized_profit') + self._1btc_to_10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1btc_to_10btc_realized_profit') + self._10btc_to_100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10btc_to_100btc_realized_profit') + self._100btc_to_1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_100btc_to_1k_btc_realized_profit') + self._1k_btc_to_10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1k_btc_to_10k_btc_realized_profit') + self._10k_btc_to_100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10k_btc_to_100k_btc_realized_profit') + self.over_100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_100k_btc_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10sats_realized_profit') + self._100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_100sats_realized_profit') + self._1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1k_sats_realized_profit') + self._10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10k_sats_realized_profit') + self._100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_100k_sats_realized_profit') + self._1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1m_sats_realized_profit') + self._10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10m_sats_realized_profit') + self._1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1btc_realized_profit') + self._10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10btc_realized_profit') + self._100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_100btc_realized_profit') + self._1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1k_btc_realized_profit') + self._10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10k_btc_realized_profit') + self._100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_100k_btc_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1sat_realized_profit') + self._10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10sats_realized_profit') + self._100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_100sats_realized_profit') + self._1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1k_sats_realized_profit') + self._10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10k_sats_realized_profit') + self._100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_100k_sats_realized_profit') + self._1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1m_sats_realized_profit') + self._10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10m_sats_realized_profit') + self._1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1btc_realized_profit') + self._10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10btc_realized_profit') + self._100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_100btc_realized_profit') + self._1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1k_btc_realized_profit') + self._10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10k_btc_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Range = SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Under = SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Over = SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_0sats_realized_profit') + self._1sat_to_10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1sat_to_10sats_realized_profit') + self._10sats_to_100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10sats_to_100sats_realized_profit') + self._100sats_to_1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_100sats_to_1k_sats_realized_profit') + self._1k_sats_to_10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1k_sats_to_10k_sats_realized_profit') + self._10k_sats_to_100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10k_sats_to_100k_sats_realized_profit') + self._100k_sats_to_1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_100k_sats_to_1m_sats_realized_profit') + self._1m_sats_to_10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1m_sats_to_10m_sats_realized_profit') + self._10m_sats_to_1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10m_sats_to_1btc_realized_profit') + self._1btc_to_10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1btc_to_10btc_realized_profit') + self._10btc_to_100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10btc_to_100btc_realized_profit') + self._100btc_to_1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_100btc_to_1k_btc_realized_profit') + self._1k_btc_to_10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1k_btc_to_10k_btc_realized_profit') + self._10k_btc_to_100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10k_btc_to_100k_btc_realized_profit') + self.over_100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_100k_btc_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10sats_realized_profit') + self._100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_100sats_realized_profit') + self._1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_1k_sats_realized_profit') + self._10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10k_sats_realized_profit') + self._100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_100k_sats_realized_profit') + self._1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_1m_sats_realized_profit') + self._10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10m_sats_realized_profit') + self._1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_1btc_realized_profit') + self._10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10btc_realized_profit') + self._100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_100btc_realized_profit') + self._1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_1k_btc_realized_profit') + self._10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10k_btc_realized_profit') + self._100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_100k_btc_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1sat_realized_profit') + self._10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10sats_realized_profit') + self._100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_100sats_realized_profit') + self._1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1k_sats_realized_profit') + self._10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10k_sats_realized_profit') + self._100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_100k_sats_realized_profit') + self._1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1m_sats_realized_profit') + self._10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10m_sats_realized_profit') + self._1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1btc_realized_profit') + self._10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10btc_realized_profit') + self._100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_100btc_realized_profit') + self._1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1k_btc_realized_profit') + self._10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10k_btc_realized_profit') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Range = SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Under = SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Over = SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance_Over(client) + self.matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'addrs_realized_profit_cumulative_cents_by_balance_range') + +class SeriesTree_Cohorts_Cohorts_Realized_Profit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'realized_profit') + self.age: SeriesTree_Cohorts_Cohorts_Realized_Profit_Age = SeriesTree_Cohorts_Cohorts_Realized_Profit_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Realized_Profit_Epoch = SeriesTree_Cohorts_Cohorts_Realized_Profit_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Realized_Profit_Class = SeriesTree_Cohorts_Cohorts_Realized_Profit_Class(client) + self.entry: DiscountPremiumPattern5 = DiscountPremiumPattern5(client, 'realized_profit') + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount = SeriesTree_Cohorts_Cohorts_Realized_Profit_UtxoAmount(client) + self.term: LongShortPattern6 = LongShortPattern6(client, 'realized_profit') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5(client, 'realized_profit') + self.age_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_profit_cumulative_cents_by_age_range') + self.epoch_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_profit_cumulative_cents_by_epoch') + self.class_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_profit_cumulative_cents_by_class') + self.entry_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_profit_cumulative_cents_by_entry') + self.type_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_profit_cumulative_cents_by_type') + self.amount_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_profit_cumulative_cents_by_amount_range') + self.addr_balance: SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance = SeriesTree_Cohorts_Cohorts_Realized_Profit_AddrBalance(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1h_old_realized_loss') + self._1h_to_1d: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1h_to_1d_old_realized_loss') + self._1d_to_1w: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1d_to_1w_old_realized_loss') + self._1w_to_1m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1w_to_1m_old_realized_loss') + self._1m_to_2m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1m_to_2m_old_realized_loss') + self._2m_to_3m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_2m_to_3m_old_realized_loss') + self._3m_to_4m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_3m_to_4m_old_realized_loss') + self._4m_to_5m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_4m_to_5m_old_realized_loss') + self._5m_to_6m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_5m_to_6m_old_realized_loss') + self._6m_to_9m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_6m_to_9m_old_realized_loss') + self._9m_to_1y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_9m_to_1y_old_realized_loss') + self._1y_to_18m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1y_to_18m_old_realized_loss') + self._18m_to_2y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_18m_to_2y_old_realized_loss') + self._2y_to_3y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_2y_to_3y_old_realized_loss') + self._3y_to_4y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_3y_to_4y_old_realized_loss') + self._4y_to_5y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_4y_to_5y_old_realized_loss') + self._5y_to_6y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_5y_to_6y_old_realized_loss') + self._6y_to_7y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_6y_to_7y_old_realized_loss') + self._7y_to_8y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_7y_to_8y_old_realized_loss') + self._8y_to_10y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_8y_to_10y_old_realized_loss') + self._10y_to_12y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10y_to_12y_old_realized_loss') + self._12y_to_15y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_12y_to_15y_old_realized_loss') + self.over_15y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_15y_old_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1w_old_realized_loss') + self._1m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1m_old_realized_loss') + self._2m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_2m_old_realized_loss') + self._3m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_3m_old_realized_loss') + self._4m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_4m_old_realized_loss') + self._5m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_5m_old_realized_loss') + self._6m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_6m_old_realized_loss') + self._9m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_9m_old_realized_loss') + self._1y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1y_old_realized_loss') + self._18m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_18m_old_realized_loss') + self._2y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_2y_old_realized_loss') + self._3y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_3y_old_realized_loss') + self._4y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_4y_old_realized_loss') + self._5y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_5y_old_realized_loss') + self._6y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_6y_old_realized_loss') + self._7y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_7y_old_realized_loss') + self._8y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_8y_old_realized_loss') + self._10y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10y_old_realized_loss') + self._12y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_12y_old_realized_loss') + self._15y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_15y_old_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1d_old_realized_loss') + self._1w: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1w_old_realized_loss') + self._1m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1m_old_realized_loss') + self._2m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_2m_old_realized_loss') + self._3m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_3m_old_realized_loss') + self._4m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_4m_old_realized_loss') + self._5m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_5m_old_realized_loss') + self._6m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_6m_old_realized_loss') + self._9m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_9m_old_realized_loss') + self._1y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1y_old_realized_loss') + self._18m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_18m_old_realized_loss') + self._2y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_2y_old_realized_loss') + self._3y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_3y_old_realized_loss') + self._4y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_4y_old_realized_loss') + self._5y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_5y_old_realized_loss') + self._6y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_6y_old_realized_loss') + self._7y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_7y_old_realized_loss') + self._8y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_8y_old_realized_loss') + self._10y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10y_old_realized_loss') + self._12y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_12y_old_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Range = SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Under = SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Over = SeriesTree_Cohorts_Cohorts_Realized_Loss_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_0_realized_loss') + self._1: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_1_realized_loss') + self._2: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_2_realized_loss') + self._3: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_3_realized_loss') + self._4: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_4_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2009_realized_loss') + self._2010: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2010_realized_loss') + self._2011: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2011_realized_loss') + self._2012: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2012_realized_loss') + self._2013: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2013_realized_loss') + self._2014: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2014_realized_loss') + self._2015: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2015_realized_loss') + self._2016: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2016_realized_loss') + self._2017: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2017_realized_loss') + self._2018: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2018_realized_loss') + self._2019: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2019_realized_loss') + self._2020: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2020_realized_loss') + self._2021: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2021_realized_loss') + self._2022: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2022_realized_loss') + self._2023: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2023_realized_loss') + self._2024: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2024_realized_loss') + self._2025: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2025_realized_loss') + self._2026: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2026_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_0sats_realized_loss') + self._1sat_to_10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1sat_to_10sats_realized_loss') + self._10sats_to_100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10sats_to_100sats_realized_loss') + self._100sats_to_1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_100sats_to_1k_sats_realized_loss') + self._1k_sats_to_10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1k_sats_to_10k_sats_realized_loss') + self._10k_sats_to_100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10k_sats_to_100k_sats_realized_loss') + self._100k_sats_to_1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_100k_sats_to_1m_sats_realized_loss') + self._1m_sats_to_10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1m_sats_to_10m_sats_realized_loss') + self._10m_sats_to_1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10m_sats_to_1btc_realized_loss') + self._1btc_to_10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1btc_to_10btc_realized_loss') + self._10btc_to_100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10btc_to_100btc_realized_loss') + self._100btc_to_1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_100btc_to_1k_btc_realized_loss') + self._1k_btc_to_10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1k_btc_to_10k_btc_realized_loss') + self._10k_btc_to_100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10k_btc_to_100k_btc_realized_loss') + self.over_100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_100k_btc_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10sats_realized_loss') + self._100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_100sats_realized_loss') + self._1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1k_sats_realized_loss') + self._10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10k_sats_realized_loss') + self._100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_100k_sats_realized_loss') + self._1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1m_sats_realized_loss') + self._10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10m_sats_realized_loss') + self._1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1btc_realized_loss') + self._10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10btc_realized_loss') + self._100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_100btc_realized_loss') + self._1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1k_btc_realized_loss') + self._10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10k_btc_realized_loss') + self._100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_100k_btc_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1sat_realized_loss') + self._10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10sats_realized_loss') + self._100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_100sats_realized_loss') + self._1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1k_sats_realized_loss') + self._10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10k_sats_realized_loss') + self._100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_100k_sats_realized_loss') + self._1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1m_sats_realized_loss') + self._10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10m_sats_realized_loss') + self._1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1btc_realized_loss') + self._10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10btc_realized_loss') + self._100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_100btc_realized_loss') + self._1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1k_btc_realized_loss') + self._10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10k_btc_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Range = SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Under = SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Over = SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_0sats_realized_loss') + self._1sat_to_10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1sat_to_10sats_realized_loss') + self._10sats_to_100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10sats_to_100sats_realized_loss') + self._100sats_to_1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_100sats_to_1k_sats_realized_loss') + self._1k_sats_to_10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1k_sats_to_10k_sats_realized_loss') + self._10k_sats_to_100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10k_sats_to_100k_sats_realized_loss') + self._100k_sats_to_1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_100k_sats_to_1m_sats_realized_loss') + self._1m_sats_to_10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1m_sats_to_10m_sats_realized_loss') + self._10m_sats_to_1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10m_sats_to_1btc_realized_loss') + self._1btc_to_10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1btc_to_10btc_realized_loss') + self._10btc_to_100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10btc_to_100btc_realized_loss') + self._100btc_to_1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_100btc_to_1k_btc_realized_loss') + self._1k_btc_to_10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_1k_btc_to_10k_btc_realized_loss') + self._10k_btc_to_100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_10k_btc_to_100k_btc_realized_loss') + self.over_100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_100k_btc_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10sats_realized_loss') + self._100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_100sats_realized_loss') + self._1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_1k_sats_realized_loss') + self._10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10k_sats_realized_loss') + self._100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_100k_sats_realized_loss') + self._1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_1m_sats_realized_loss') + self._10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10m_sats_realized_loss') + self._1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_1btc_realized_loss') + self._10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10btc_realized_loss') + self._100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_100btc_realized_loss') + self._1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_1k_btc_realized_loss') + self._10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_10k_btc_realized_loss') + self._100k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_under_100k_btc_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1sat_realized_loss') + self._10sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10sats_realized_loss') + self._100sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_100sats_realized_loss') + self._1k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1k_sats_realized_loss') + self._10k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10k_sats_realized_loss') + self._100k_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_100k_sats_realized_loss') + self._1m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1m_sats_realized_loss') + self._10m_sats: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10m_sats_realized_loss') + self._1btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1btc_realized_loss') + self._10btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10btc_realized_loss') + self._100btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_100btc_realized_loss') + self._1k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_1k_btc_realized_loss') + self._10k_btc: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'addrs_over_10k_btc_realized_loss') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Range = SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Under = SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Over = SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance_Over(client) + self.matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'addrs_realized_loss_cumulative_cents_by_balance_range') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: BaseSumPattern = BaseSumPattern(client, 'utxos_under_1h_old_realized_loss_neg') + self._1h_to_1d: BaseSumPattern = BaseSumPattern(client, 'utxos_1h_to_1d_old_realized_loss_neg') + self._1d_to_1w: BaseSumPattern = BaseSumPattern(client, 'utxos_1d_to_1w_old_realized_loss_neg') + self._1w_to_1m: BaseSumPattern = BaseSumPattern(client, 'utxos_1w_to_1m_old_realized_loss_neg') + self._1m_to_2m: BaseSumPattern = BaseSumPattern(client, 'utxos_1m_to_2m_old_realized_loss_neg') + self._2m_to_3m: BaseSumPattern = BaseSumPattern(client, 'utxos_2m_to_3m_old_realized_loss_neg') + self._3m_to_4m: BaseSumPattern = BaseSumPattern(client, 'utxos_3m_to_4m_old_realized_loss_neg') + self._4m_to_5m: BaseSumPattern = BaseSumPattern(client, 'utxos_4m_to_5m_old_realized_loss_neg') + self._5m_to_6m: BaseSumPattern = BaseSumPattern(client, 'utxos_5m_to_6m_old_realized_loss_neg') + self._6m_to_9m: BaseSumPattern = BaseSumPattern(client, 'utxos_6m_to_9m_old_realized_loss_neg') + self._9m_to_1y: BaseSumPattern = BaseSumPattern(client, 'utxos_9m_to_1y_old_realized_loss_neg') + self._1y_to_18m: BaseSumPattern = BaseSumPattern(client, 'utxos_1y_to_18m_old_realized_loss_neg') + self._18m_to_2y: BaseSumPattern = BaseSumPattern(client, 'utxos_18m_to_2y_old_realized_loss_neg') + self._2y_to_3y: BaseSumPattern = BaseSumPattern(client, 'utxos_2y_to_3y_old_realized_loss_neg') + self._3y_to_4y: BaseSumPattern = BaseSumPattern(client, 'utxos_3y_to_4y_old_realized_loss_neg') + self._4y_to_5y: BaseSumPattern = BaseSumPattern(client, 'utxos_4y_to_5y_old_realized_loss_neg') + self._5y_to_6y: BaseSumPattern = BaseSumPattern(client, 'utxos_5y_to_6y_old_realized_loss_neg') + self._6y_to_7y: BaseSumPattern = BaseSumPattern(client, 'utxos_6y_to_7y_old_realized_loss_neg') + self._7y_to_8y: BaseSumPattern = BaseSumPattern(client, 'utxos_7y_to_8y_old_realized_loss_neg') + self._8y_to_10y: BaseSumPattern = BaseSumPattern(client, 'utxos_8y_to_10y_old_realized_loss_neg') + self._10y_to_12y: BaseSumPattern = BaseSumPattern(client, 'utxos_10y_to_12y_old_realized_loss_neg') + self._12y_to_15y: BaseSumPattern = BaseSumPattern(client, 'utxos_12y_to_15y_old_realized_loss_neg') + self.over_15y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_15y_old_realized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: BaseSumPattern = BaseSumPattern(client, 'utxos_under_1w_old_realized_loss_neg') + self._1m: BaseSumPattern = BaseSumPattern(client, 'utxos_under_1m_old_realized_loss_neg') + self._2m: BaseSumPattern = BaseSumPattern(client, 'utxos_under_2m_old_realized_loss_neg') + self._3m: BaseSumPattern = BaseSumPattern(client, 'utxos_under_3m_old_realized_loss_neg') + self._4m: BaseSumPattern = BaseSumPattern(client, 'utxos_under_4m_old_realized_loss_neg') + self._5m: BaseSumPattern = BaseSumPattern(client, 'utxos_under_5m_old_realized_loss_neg') + self._6m: BaseSumPattern = BaseSumPattern(client, 'utxos_under_6m_old_realized_loss_neg') + self._9m: BaseSumPattern = BaseSumPattern(client, 'utxos_under_9m_old_realized_loss_neg') + self._1y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_1y_old_realized_loss_neg') + self._18m: BaseSumPattern = BaseSumPattern(client, 'utxos_under_18m_old_realized_loss_neg') + self._2y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_2y_old_realized_loss_neg') + self._3y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_3y_old_realized_loss_neg') + self._4y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_4y_old_realized_loss_neg') + self._5y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_5y_old_realized_loss_neg') + self._6y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_6y_old_realized_loss_neg') + self._7y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_7y_old_realized_loss_neg') + self._8y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_8y_old_realized_loss_neg') + self._10y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_10y_old_realized_loss_neg') + self._12y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_12y_old_realized_loss_neg') + self._15y: BaseSumPattern = BaseSumPattern(client, 'utxos_under_15y_old_realized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: BaseSumPattern = BaseSumPattern(client, 'utxos_over_1d_old_realized_loss_neg') + self._1w: BaseSumPattern = BaseSumPattern(client, 'utxos_over_1w_old_realized_loss_neg') + self._1m: BaseSumPattern = BaseSumPattern(client, 'utxos_over_1m_old_realized_loss_neg') + self._2m: BaseSumPattern = BaseSumPattern(client, 'utxos_over_2m_old_realized_loss_neg') + self._3m: BaseSumPattern = BaseSumPattern(client, 'utxos_over_3m_old_realized_loss_neg') + self._4m: BaseSumPattern = BaseSumPattern(client, 'utxos_over_4m_old_realized_loss_neg') + self._5m: BaseSumPattern = BaseSumPattern(client, 'utxos_over_5m_old_realized_loss_neg') + self._6m: BaseSumPattern = BaseSumPattern(client, 'utxos_over_6m_old_realized_loss_neg') + self._9m: BaseSumPattern = BaseSumPattern(client, 'utxos_over_9m_old_realized_loss_neg') + self._1y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_1y_old_realized_loss_neg') + self._18m: BaseSumPattern = BaseSumPattern(client, 'utxos_over_18m_old_realized_loss_neg') + self._2y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_2y_old_realized_loss_neg') + self._3y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_3y_old_realized_loss_neg') + self._4y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_4y_old_realized_loss_neg') + self._5y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_5y_old_realized_loss_neg') + self._6y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_6y_old_realized_loss_neg') + self._7y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_7y_old_realized_loss_neg') + self._8y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_8y_old_realized_loss_neg') + self._10y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_10y_old_realized_loss_neg') + self._12y: BaseSumPattern = BaseSumPattern(client, 'utxos_over_12y_old_realized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Range = SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Under = SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Over = SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: BaseSumPattern = BaseSumPattern(client, 'epoch_0_realized_loss_neg') + self._1: BaseSumPattern = BaseSumPattern(client, 'epoch_1_realized_loss_neg') + self._2: BaseSumPattern = BaseSumPattern(client, 'epoch_2_realized_loss_neg') + self._3: BaseSumPattern = BaseSumPattern(client, 'epoch_3_realized_loss_neg') + self._4: BaseSumPattern = BaseSumPattern(client, 'epoch_4_realized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: BaseSumPattern = BaseSumPattern(client, 'class_2009_realized_loss_neg') + self._2010: BaseSumPattern = BaseSumPattern(client, 'class_2010_realized_loss_neg') + self._2011: BaseSumPattern = BaseSumPattern(client, 'class_2011_realized_loss_neg') + self._2012: BaseSumPattern = BaseSumPattern(client, 'class_2012_realized_loss_neg') + self._2013: BaseSumPattern = BaseSumPattern(client, 'class_2013_realized_loss_neg') + self._2014: BaseSumPattern = BaseSumPattern(client, 'class_2014_realized_loss_neg') + self._2015: BaseSumPattern = BaseSumPattern(client, 'class_2015_realized_loss_neg') + self._2016: BaseSumPattern = BaseSumPattern(client, 'class_2016_realized_loss_neg') + self._2017: BaseSumPattern = BaseSumPattern(client, 'class_2017_realized_loss_neg') + self._2018: BaseSumPattern = BaseSumPattern(client, 'class_2018_realized_loss_neg') + self._2019: BaseSumPattern = BaseSumPattern(client, 'class_2019_realized_loss_neg') + self._2020: BaseSumPattern = BaseSumPattern(client, 'class_2020_realized_loss_neg') + self._2021: BaseSumPattern = BaseSumPattern(client, 'class_2021_realized_loss_neg') + self._2022: BaseSumPattern = BaseSumPattern(client, 'class_2022_realized_loss_neg') + self._2023: BaseSumPattern = BaseSumPattern(client, 'class_2023_realized_loss_neg') + self._2024: BaseSumPattern = BaseSumPattern(client, 'class_2024_realized_loss_neg') + self._2025: BaseSumPattern = BaseSumPattern(client, 'class_2025_realized_loss_neg') + self._2026: BaseSumPattern = BaseSumPattern(client, 'class_2026_realized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Entry: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: BaseSumPattern = BaseSumPattern(client, 'veteran_realized_loss_neg') + self.premium: BaseSumPattern = BaseSumPattern(client, 'rookie_realized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Term: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: BaseSumPattern = BaseSumPattern(client, 'sth_realized_loss_neg') + self.long: BaseSumPattern = BaseSumPattern(client, 'lth_realized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BaseSumPattern = BaseSumPattern(client, 'realized_loss_neg') + self.age: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age = SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Epoch = SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Class = SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Class(client) + self.entry: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Entry = SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Entry(client) + self.term: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Term = SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative_Term(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Loss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'realized_loss') + self.age: SeriesTree_Cohorts_Cohorts_Realized_Loss_Age = SeriesTree_Cohorts_Cohorts_Realized_Loss_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Realized_Loss_Epoch = SeriesTree_Cohorts_Cohorts_Realized_Loss_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Realized_Loss_Class = SeriesTree_Cohorts_Cohorts_Realized_Loss_Class(client) + self.entry: DiscountPremiumPattern5 = DiscountPremiumPattern5(client, 'realized_loss') + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount = SeriesTree_Cohorts_Cohorts_Realized_Loss_UtxoAmount(client) + self.term: LongShortPattern6 = LongShortPattern6(client, 'realized_loss') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern5(client, 'realized_loss') + self.age_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_loss_cumulative_cents_by_age_range') + self.epoch_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_loss_cumulative_cents_by_epoch') + self.class_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_loss_cumulative_cents_by_class') + self.entry_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_loss_cumulative_cents_by_entry') + self.type_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_loss_cumulative_cents_by_type') + self.amount_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_realized_loss_cumulative_cents_by_amount_range') + self.addr_balance: SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance = SeriesTree_Cohorts_Cohorts_Realized_Loss_AddrBalance(client) + self.negative: SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative = SeriesTree_Cohorts_Cohorts_Realized_Loss_Negative(client) + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_1h_old_net_realized_pnl') + self._1h_to_1d: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_1h_to_1d_old_net_realized_pnl') + self._1d_to_1w: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_1d_to_1w_old_net_realized_pnl') + self._1w_to_1m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_1w_to_1m_old_net_realized_pnl') + self._1m_to_2m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_1m_to_2m_old_net_realized_pnl') + self._2m_to_3m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_2m_to_3m_old_net_realized_pnl') + self._3m_to_4m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_3m_to_4m_old_net_realized_pnl') + self._4m_to_5m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_4m_to_5m_old_net_realized_pnl') + self._5m_to_6m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_5m_to_6m_old_net_realized_pnl') + self._6m_to_9m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_6m_to_9m_old_net_realized_pnl') + self._9m_to_1y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_9m_to_1y_old_net_realized_pnl') + self._1y_to_18m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_1y_to_18m_old_net_realized_pnl') + self._18m_to_2y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_18m_to_2y_old_net_realized_pnl') + self._2y_to_3y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_2y_to_3y_old_net_realized_pnl') + self._3y_to_4y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_3y_to_4y_old_net_realized_pnl') + self._4y_to_5y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_4y_to_5y_old_net_realized_pnl') + self._5y_to_6y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_5y_to_6y_old_net_realized_pnl') + self._6y_to_7y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_6y_to_7y_old_net_realized_pnl') + self._7y_to_8y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_7y_to_8y_old_net_realized_pnl') + self._8y_to_10y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_8y_to_10y_old_net_realized_pnl') + self._10y_to_12y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_10y_to_12y_old_net_realized_pnl') + self._12y_to_15y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_12y_to_15y_old_net_realized_pnl') + self.over_15y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_15y_old_net_realized_pnl') + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_1w_old_net_realized_pnl') + self._1m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_1m_old_net_realized_pnl') + self._2m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_2m_old_net_realized_pnl') + self._3m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_3m_old_net_realized_pnl') + self._4m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_4m_old_net_realized_pnl') + self._5m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_5m_old_net_realized_pnl') + self._6m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_6m_old_net_realized_pnl') + self._9m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_9m_old_net_realized_pnl') + self._1y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_1y_old_net_realized_pnl') + self._18m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_18m_old_net_realized_pnl') + self._2y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_2y_old_net_realized_pnl') + self._3y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_3y_old_net_realized_pnl') + self._4y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_4y_old_net_realized_pnl') + self._5y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_5y_old_net_realized_pnl') + self._6y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_6y_old_net_realized_pnl') + self._7y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_7y_old_net_realized_pnl') + self._8y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_8y_old_net_realized_pnl') + self._10y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_10y_old_net_realized_pnl') + self._12y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_12y_old_net_realized_pnl') + self._15y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_under_15y_old_net_realized_pnl') + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_1d_old_net_realized_pnl') + self._1w: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_1w_old_net_realized_pnl') + self._1m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_1m_old_net_realized_pnl') + self._2m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_2m_old_net_realized_pnl') + self._3m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_3m_old_net_realized_pnl') + self._4m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_4m_old_net_realized_pnl') + self._5m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_5m_old_net_realized_pnl') + self._6m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_6m_old_net_realized_pnl') + self._9m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_9m_old_net_realized_pnl') + self._1y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_1y_old_net_realized_pnl') + self._18m: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_18m_old_net_realized_pnl') + self._2y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_2y_old_net_realized_pnl') + self._3y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_3y_old_net_realized_pnl') + self._4y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_4y_old_net_realized_pnl') + self._5y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_5y_old_net_realized_pnl') + self._6y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_6y_old_net_realized_pnl') + self._7y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_7y_old_net_realized_pnl') + self._8y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_8y_old_net_realized_pnl') + self._10y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_10y_old_net_realized_pnl') + self._12y: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'utxos_over_12y_old_net_realized_pnl') + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Range = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Under = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Over = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'epoch_0_net_realized_pnl') + self._1: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'epoch_1_net_realized_pnl') + self._2: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'epoch_2_net_realized_pnl') + self._3: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'epoch_3_net_realized_pnl') + self._4: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'epoch_4_net_realized_pnl') + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2009_net_realized_pnl') + self._2010: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2010_net_realized_pnl') + self._2011: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2011_net_realized_pnl') + self._2012: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2012_net_realized_pnl') + self._2013: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2013_net_realized_pnl') + self._2014: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2014_net_realized_pnl') + self._2015: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2015_net_realized_pnl') + self._2016: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2016_net_realized_pnl') + self._2017: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2017_net_realized_pnl') + self._2018: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2018_net_realized_pnl') + self._2019: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2019_net_realized_pnl') + self._2020: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2020_net_realized_pnl') + self._2021: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2021_net_realized_pnl') + self._2022: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2022_net_realized_pnl') + self._2023: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2023_net_realized_pnl') + self._2024: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2024_net_realized_pnl') + self._2025: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2025_net_realized_pnl') + self._2026: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'class_2026_net_realized_pnl') + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Entry: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'veteran_net_realized_pnl') + self.premium: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'rookie_net_realized_pnl') + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Term: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'sth_net_realized_pnl') + self.long: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'lth_net_realized_pnl') + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m_ToMcap: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: PercentPpmRatioPattern = PercentPpmRatioPattern(client, 'all_net_pnl_change_1m_to_mcap') + self.sth: PercentPpmRatioPattern = PercentPpmRatioPattern(client, 'sth_net_pnl_change_1m_to_mcap') + self.lth: PercentPpmRatioPattern = PercentPpmRatioPattern(client, 'lth_net_pnl_change_1m_to_mcap') + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.to_mcap: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m_ToMcap = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m_ToMcap(client) + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnl: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BlockCumulativeDeltaSumPattern = BlockCumulativeDeltaSumPattern(client, 'net_realized_pnl') + self.age: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Epoch = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Class = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Class(client) + self.entry: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Entry = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Entry(client) + self.term: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Term = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Term(client) + self.age_range_matrix: SeriesPattern18[CentsSigned] = SeriesPattern18(client, 'utxos_net_realized_pnl_cumulative_cents_by_age_range') + self.epoch_matrix: SeriesPattern18[CentsSigned] = SeriesPattern18(client, 'net_realized_pnl_cumulative_cents_by_epoch') + self.class_matrix: SeriesPattern18[CentsSigned] = SeriesPattern18(client, 'net_realized_pnl_cumulative_cents_by_class') + self.entry_matrix: SeriesPattern18[CentsSigned] = SeriesPattern18(client, 'net_realized_pnl_cumulative_cents_by_entry') + self.change_1m: SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m = SeriesTree_Cohorts_Cohorts_Realized_NetPnl_Change1m(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1h_old_value_destroyed') + self._1h_to_1d: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1h_to_1d_old_value_destroyed') + self._1d_to_1w: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1d_to_1w_old_value_destroyed') + self._1w_to_1m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1w_to_1m_old_value_destroyed') + self._1m_to_2m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1m_to_2m_old_value_destroyed') + self._2m_to_3m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_2m_to_3m_old_value_destroyed') + self._3m_to_4m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_3m_to_4m_old_value_destroyed') + self._4m_to_5m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_4m_to_5m_old_value_destroyed') + self._5m_to_6m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_5m_to_6m_old_value_destroyed') + self._6m_to_9m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_6m_to_9m_old_value_destroyed') + self._9m_to_1y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_9m_to_1y_old_value_destroyed') + self._1y_to_18m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_1y_to_18m_old_value_destroyed') + self._18m_to_2y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_18m_to_2y_old_value_destroyed') + self._2y_to_3y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_2y_to_3y_old_value_destroyed') + self._3y_to_4y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_3y_to_4y_old_value_destroyed') + self._4y_to_5y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_4y_to_5y_old_value_destroyed') + self._5y_to_6y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_5y_to_6y_old_value_destroyed') + self._6y_to_7y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_6y_to_7y_old_value_destroyed') + self._7y_to_8y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_7y_to_8y_old_value_destroyed') + self._8y_to_10y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_8y_to_10y_old_value_destroyed') + self._10y_to_12y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_10y_to_12y_old_value_destroyed') + self._12y_to_15y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_12y_to_15y_old_value_destroyed') + self.over_15y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_15y_old_value_destroyed') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1w_old_value_destroyed') + self._1m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1m_old_value_destroyed') + self._2m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_2m_old_value_destroyed') + self._3m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_3m_old_value_destroyed') + self._4m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_4m_old_value_destroyed') + self._5m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_5m_old_value_destroyed') + self._6m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_6m_old_value_destroyed') + self._9m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_9m_old_value_destroyed') + self._1y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_1y_old_value_destroyed') + self._18m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_18m_old_value_destroyed') + self._2y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_2y_old_value_destroyed') + self._3y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_3y_old_value_destroyed') + self._4y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_4y_old_value_destroyed') + self._5y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_5y_old_value_destroyed') + self._6y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_6y_old_value_destroyed') + self._7y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_7y_old_value_destroyed') + self._8y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_8y_old_value_destroyed') + self._10y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_10y_old_value_destroyed') + self._12y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_12y_old_value_destroyed') + self._15y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_under_15y_old_value_destroyed') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1d_old_value_destroyed') + self._1w: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1w_old_value_destroyed') + self._1m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1m_old_value_destroyed') + self._2m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_2m_old_value_destroyed') + self._3m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_3m_old_value_destroyed') + self._4m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_4m_old_value_destroyed') + self._5m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_5m_old_value_destroyed') + self._6m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_6m_old_value_destroyed') + self._9m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_9m_old_value_destroyed') + self._1y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_1y_old_value_destroyed') + self._18m: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_18m_old_value_destroyed') + self._2y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_2y_old_value_destroyed') + self._3y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_3y_old_value_destroyed') + self._4y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_4y_old_value_destroyed') + self._5y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_5y_old_value_destroyed') + self._6y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_6y_old_value_destroyed') + self._7y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_7y_old_value_destroyed') + self._8y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_8y_old_value_destroyed') + self._10y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_10y_old_value_destroyed') + self._12y: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'utxos_over_12y_old_value_destroyed') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Range = SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Under = SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Over = SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_0_value_destroyed') + self._1: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_1_value_destroyed') + self._2: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_2_value_destroyed') + self._3: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_3_value_destroyed') + self._4: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'epoch_4_value_destroyed') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2009_value_destroyed') + self._2010: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2010_value_destroyed') + self._2011: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2011_value_destroyed') + self._2012: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2012_value_destroyed') + self._2013: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2013_value_destroyed') + self._2014: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2014_value_destroyed') + self._2015: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2015_value_destroyed') + self._2016: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2016_value_destroyed') + self._2017: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2017_value_destroyed') + self._2018: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2018_value_destroyed') + self._2019: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2019_value_destroyed') + self._2020: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2020_value_destroyed') + self._2021: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2021_value_destroyed') + self._2022: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2022_value_destroyed') + self._2023: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2023_value_destroyed') + self._2024: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2024_value_destroyed') + self._2025: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2025_value_destroyed') + self._2026: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'class_2026_value_destroyed') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'value_destroyed') + self.age: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age = SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Epoch = SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Class = SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed_Class(client) + self.entry: DiscountPremiumPattern5 = DiscountPremiumPattern5(client, 'value_destroyed') + self.term: LongShortPattern6 = LongShortPattern6(client, 'value_destroyed') + self.age_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_value_destroyed_cumulative_cents_by_age_range') + self.epoch_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'value_destroyed_cumulative_cents_by_epoch') + self.class_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'value_destroyed_cumulative_cents_by_class') + self.entry_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'value_destroyed_cumulative_cents_by_entry') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_1h_old_sopr_24h') + self._1h_to_1d: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_1h_to_1d_old_sopr_24h') + self._1d_to_1w: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_1d_to_1w_old_sopr_24h') + self._1w_to_1m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_1w_to_1m_old_sopr_24h') + self._1m_to_2m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_1m_to_2m_old_sopr_24h') + self._2m_to_3m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_2m_to_3m_old_sopr_24h') + self._3m_to_4m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_3m_to_4m_old_sopr_24h') + self._4m_to_5m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_4m_to_5m_old_sopr_24h') + self._5m_to_6m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_5m_to_6m_old_sopr_24h') + self._6m_to_9m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_6m_to_9m_old_sopr_24h') + self._9m_to_1y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_9m_to_1y_old_sopr_24h') + self._1y_to_18m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_1y_to_18m_old_sopr_24h') + self._18m_to_2y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_18m_to_2y_old_sopr_24h') + self._2y_to_3y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_2y_to_3y_old_sopr_24h') + self._3y_to_4y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_3y_to_4y_old_sopr_24h') + self._4y_to_5y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_4y_to_5y_old_sopr_24h') + self._5y_to_6y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_5y_to_6y_old_sopr_24h') + self._6y_to_7y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_6y_to_7y_old_sopr_24h') + self._7y_to_8y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_7y_to_8y_old_sopr_24h') + self._8y_to_10y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_8y_to_10y_old_sopr_24h') + self._10y_to_12y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_10y_to_12y_old_sopr_24h') + self._12y_to_15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_12y_to_15y_old_sopr_24h') + self.over_15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_15y_old_sopr_24h') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_1w_old_sopr_24h') + self._1m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_1m_old_sopr_24h') + self._2m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_2m_old_sopr_24h') + self._3m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_3m_old_sopr_24h') + self._4m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_4m_old_sopr_24h') + self._5m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_5m_old_sopr_24h') + self._6m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_6m_old_sopr_24h') + self._9m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_9m_old_sopr_24h') + self._1y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_1y_old_sopr_24h') + self._18m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_18m_old_sopr_24h') + self._2y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_2y_old_sopr_24h') + self._3y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_3y_old_sopr_24h') + self._4y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_4y_old_sopr_24h') + self._5y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_5y_old_sopr_24h') + self._6y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_6y_old_sopr_24h') + self._7y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_7y_old_sopr_24h') + self._8y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_8y_old_sopr_24h') + self._10y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_10y_old_sopr_24h') + self._12y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_12y_old_sopr_24h') + self._15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_under_15y_old_sopr_24h') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_1d_old_sopr_24h') + self._1w: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_1w_old_sopr_24h') + self._1m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_1m_old_sopr_24h') + self._2m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_2m_old_sopr_24h') + self._3m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_3m_old_sopr_24h') + self._4m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_4m_old_sopr_24h') + self._5m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_5m_old_sopr_24h') + self._6m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_6m_old_sopr_24h') + self._9m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_9m_old_sopr_24h') + self._1y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_1y_old_sopr_24h') + self._18m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_18m_old_sopr_24h') + self._2y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_2y_old_sopr_24h') + self._3y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_3y_old_sopr_24h') + self._4y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_4y_old_sopr_24h') + self._5y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_5y_old_sopr_24h') + self._6y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_6y_old_sopr_24h') + self._7y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_7y_old_sopr_24h') + self._8y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_8y_old_sopr_24h') + self._10y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_10y_old_sopr_24h') + self._12y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_over_12y_old_sopr_24h') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Range = SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Under = SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Over = SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'epoch_0_sopr_24h') + self._1: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'epoch_1_sopr_24h') + self._2: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'epoch_2_sopr_24h') + self._3: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'epoch_3_sopr_24h') + self._4: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'epoch_4_sopr_24h') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2009_sopr_24h') + self._2010: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2010_sopr_24h') + self._2011: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2011_sopr_24h') + self._2012: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2012_sopr_24h') + self._2013: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2013_sopr_24h') + self._2014: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2014_sopr_24h') + self._2015: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2015_sopr_24h') + self._2016: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2016_sopr_24h') + self._2017: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2017_sopr_24h') + self._2018: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2018_sopr_24h') + self._2019: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2019_sopr_24h') + self._2020: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2020_sopr_24h') + self._2021: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2021_sopr_24h') + self._2022: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2022_sopr_24h') + self._2023: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2023_sopr_24h') + self._2024: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2024_sopr_24h') + self._2025: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2025_sopr_24h') + self._2026: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'class_2026_sopr_24h') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_AggregateMatrix: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_aggregate_column_0') + self.sth: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_aggregate_column_1') + self.lth: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_aggregate_column_2') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'sopr_24h_by_aggregate') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_AgeRangeMatrix: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_0') + self._1h_to_1d: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_1') + self._1d_to_1w: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_2') + self._1w_to_1m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_3') + self._1m_to_2m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_4') + self._2m_to_3m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_5') + self._3m_to_4m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_6') + self._4m_to_5m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_7') + self._5m_to_6m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_8') + self._6m_to_9m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_9') + self._9m_to_1y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_10') + self._1y_to_18m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_11') + self._18m_to_2y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_12') + self._2y_to_3y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_13') + self._3y_to_4y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_14') + self._4y_to_5y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_15') + self._5y_to_6y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_16') + self._6y_to_7y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_17') + self._7y_to_8y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_18') + self._8y_to_10y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_19') + self._10y_to_12y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_20') + self._12y_to_15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_21') + self.over_15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_age_range_column_22') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_sopr_24h_by_age_range') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_UnderAgeMatrix: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_0') + self._1m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_1') + self._2m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_2') + self._3m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_3') + self._4m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_4') + self._5m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_5') + self._6m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_6') + self._9m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_7') + self._1y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_8') + self._18m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_9') + self._2y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_10') + self._3y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_11') + self._4y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_12') + self._5y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_13') + self._6y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_14') + self._7y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_15') + self._8y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_16') + self._10y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_17') + self._12y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_18') + self._15y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_under_age_column_19') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_sopr_24h_by_under_age') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_OverAgeMatrix: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_0') + self._1w: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_1') + self._1m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_2') + self._2m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_3') + self._3m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_4') + self._4m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_5') + self._5m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_6') + self._6m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_7') + self._9m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_8') + self._1y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_9') + self._18m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_10') + self._2y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_11') + self._3y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_12') + self._4y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_13') + self._5y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_14') + self._6y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_15') + self._7y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_16') + self._8y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_17') + self._10y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_18') + self._12y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'utxos_sopr_24h_by_over_age_column_19') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'utxos_sopr_24h_by_over_age') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_EpochMatrix: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_epoch_column_0') + self._1: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_epoch_column_1') + self._2: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_epoch_column_2') + self._3: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_epoch_column_3') + self._4: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_epoch_column_4') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'sopr_24h_by_epoch') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_ClassMatrix: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_0') + self._2010: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_1') + self._2011: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_2') + self._2012: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_3') + self._2013: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_4') + self._2014: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_5') + self._2015: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_6') + self._2016: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_7') + self._2017: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_8') + self._2018: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_9') + self._2019: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_10') + self._2020: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_11') + self._2021: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_12') + self._2022: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_13') + self._2023: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_14') + self._2024: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_15') + self._2025: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_16') + self._2026: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_class_column_17') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'sopr_24h_by_class') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr_EntryMatrix: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_entry_column_0') + self.premium: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h_by_entry_column_1') + self.height: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'sopr_24h_by_entry') + +class SeriesTree_Cohorts_Cohorts_Realized_Sopr: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.value_destroyed: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed = SeriesTree_Cohorts_Cohorts_Realized_Sopr_ValueDestroyed(client) + self.all: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sopr_24h') + self.age: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age = SeriesTree_Cohorts_Cohorts_Realized_Sopr_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Epoch = SeriesTree_Cohorts_Cohorts_Realized_Sopr_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Realized_Sopr_Class = SeriesTree_Cohorts_Cohorts_Realized_Sopr_Class(client) + self.entry: DiscountPremiumPattern7[StoredF64] = DiscountPremiumPattern7(client, 'sopr_24h') + self.term: LongShortPattern7[StoredF64] = LongShortPattern7(client, 'sopr_24h') + self.aggregate_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_AggregateMatrix = SeriesTree_Cohorts_Cohorts_Realized_Sopr_AggregateMatrix(client) + self.age_range_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_AgeRangeMatrix = SeriesTree_Cohorts_Cohorts_Realized_Sopr_AgeRangeMatrix(client) + self.under_age_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_UnderAgeMatrix = SeriesTree_Cohorts_Cohorts_Realized_Sopr_UnderAgeMatrix(client) + self.over_age_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_OverAgeMatrix = SeriesTree_Cohorts_Cohorts_Realized_Sopr_OverAgeMatrix(client) + self.epoch_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_EpochMatrix = SeriesTree_Cohorts_Cohorts_Realized_Sopr_EpochMatrix(client) + self.class_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_ClassMatrix = SeriesTree_Cohorts_Cohorts_Realized_Sopr_ClassMatrix(client) + self.entry_matrix: SeriesTree_Cohorts_Cohorts_Realized_Sopr_EntryMatrix = SeriesTree_Cohorts_Cohorts_Realized_Sopr_EntryMatrix(client) + +class SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_Ratio: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, 'asopr') + self.sth: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, 'sth_asopr') + +class SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_TransferVolume: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, 'adj_value_created') + self.sth: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, 'sth_adj_value_created') + self.cumulative: SeriesPattern18[Cents] = SeriesPattern18(client, 'adjusted_sopr_transfer_volume_cumulative_by_cohort') + +class SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_ValueDestroyed: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, 'adj_value_destroyed') + self.sth: AverageBlockCumulativeSumPattern[Cents] = AverageBlockCumulativeSumPattern(client, 'sth_adj_value_destroyed') + self.cumulative: SeriesPattern18[Cents] = SeriesPattern18(client, 'adjusted_sopr_value_destroyed_cumulative_by_cohort') + +class SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.ratio: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_Ratio = SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_Ratio(client) + self.transfer_volume: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_TransferVolume = SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_TransferVolume(client) + self.value_destroyed: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_ValueDestroyed = SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr_ValueDestroyed(client) + +class SeriesTree_Cohorts_Cohorts_Realized_GrossPnl: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'all_realized_gross_pnl') + self.sth: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'sth_realized_gross_pnl') + self.lth: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'lth_realized_gross_pnl') + self.cumulative: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_gross_pnl_cumulative_cents_by_term') + +class SeriesTree_Cohorts_Cohorts_Realized_CapitalizedPrice: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'all_capitalized_price') + self.sth: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'sth_capitalized_price') + self.lth: CentsPpmRatioSatsUsdPattern = CentsPpmRatioSatsUsdPattern(client, 'lth_capitalized_price') + self.height: SeriesPattern18[Cents] = SeriesPattern18(client, 'capitalized_price_cents_by_aggregate') + +class SeriesTree_Cohorts_Cohorts_Realized_PeakRegret: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'all_realized_peak_regret') + self.sth: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'sth_realized_peak_regret') + self.lth: BlockCumulativeSumPattern = BlockCumulativeSumPattern(client, 'lth_realized_peak_regret') + self.cumulative: SeriesPattern18[Cents] = SeriesPattern18(client, 'realized_peak_regret_cumulative_cents_by_term') + +class SeriesTree_Cohorts_Cohorts_Realized_NetPnlChange1mToRcap: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: PercentPpmRatioPattern = PercentPpmRatioPattern(client, 'all_net_pnl_change_1m_to_rcap') + self.sth: PercentPpmRatioPattern = PercentPpmRatioPattern(client, 'sth_net_pnl_change_1m_to_rcap') + self.lth: PercentPpmRatioPattern = PercentPpmRatioPattern(client, 'lth_net_pnl_change_1m_to_rcap') + self.height: SeriesPattern18[PartsPerMillionSigned64] = SeriesPattern18(client, 'net_pnl_change_1m_to_rcap_ppm_by_aggregate') + +class SeriesTree_Cohorts_Cohorts_Realized_SellSideRiskRatio: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: _1m1w1y24hHeightPattern3 = _1m1w1y24hHeightPattern3(client, 'all_sell_side_risk_ratio') + self.sth: _1m1w1y24hHeightPattern3 = _1m1w1y24hHeightPattern3(client, 'sth_sell_side_risk_ratio') + self.lth: _1m1w1y24hHeightPattern3 = _1m1w1y24hHeightPattern3(client, 'lth_sell_side_risk_ratio') + +class SeriesTree_Cohorts_Cohorts_Realized_SoprRatioExtended: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: _1m1w1yHeightPattern = _1m1w1yHeightPattern(client, 'all_sopr') + self.sth: _1m1w1yHeightPattern = _1m1w1yHeightPattern(client, 'sth_sopr') + self.lth: _1m1w1yHeightPattern = _1m1w1yHeightPattern(client, 'lth_sopr') + +class SeriesTree_Cohorts_Cohorts_Realized_ProfitToLossRatio: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, 'all_realized_profit_to_loss_ratio') + self.sth: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, 'sth_realized_profit_to_loss_ratio') + self.lth: _1m1w1y24hHeightPattern2 = _1m1w1y24hHeightPattern2(client, 'lth_realized_profit_to_loss_ratio') + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_1h_old_mvrv') + self._1h_to_1d: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1h_to_1d_old_mvrv') + self._1d_to_1w: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1d_to_1w_old_mvrv') + self._1w_to_1m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1w_to_1m_old_mvrv') + self._1m_to_2m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1m_to_2m_old_mvrv') + self._2m_to_3m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_2m_to_3m_old_mvrv') + self._3m_to_4m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_3m_to_4m_old_mvrv') + self._4m_to_5m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_4m_to_5m_old_mvrv') + self._5m_to_6m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_5m_to_6m_old_mvrv') + self._6m_to_9m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_6m_to_9m_old_mvrv') + self._9m_to_1y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_9m_to_1y_old_mvrv') + self._1y_to_18m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1y_to_18m_old_mvrv') + self._18m_to_2y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_18m_to_2y_old_mvrv') + self._2y_to_3y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_2y_to_3y_old_mvrv') + self._3y_to_4y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_3y_to_4y_old_mvrv') + self._4y_to_5y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_4y_to_5y_old_mvrv') + self._5y_to_6y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_5y_to_6y_old_mvrv') + self._6y_to_7y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_6y_to_7y_old_mvrv') + self._7y_to_8y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_7y_to_8y_old_mvrv') + self._8y_to_10y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_8y_to_10y_old_mvrv') + self._10y_to_12y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_10y_to_12y_old_mvrv') + self._12y_to_15y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_12y_to_15y_old_mvrv') + self.over_15y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_15y_old_mvrv') + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_1w_old_mvrv') + self._1m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_1m_old_mvrv') + self._2m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_2m_old_mvrv') + self._3m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_3m_old_mvrv') + self._4m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_4m_old_mvrv') + self._5m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_5m_old_mvrv') + self._6m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_6m_old_mvrv') + self._9m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_9m_old_mvrv') + self._1y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_1y_old_mvrv') + self._18m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_18m_old_mvrv') + self._2y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_2y_old_mvrv') + self._3y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_3y_old_mvrv') + self._4y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_4y_old_mvrv') + self._5y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_5y_old_mvrv') + self._6y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_6y_old_mvrv') + self._7y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_7y_old_mvrv') + self._8y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_8y_old_mvrv') + self._10y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_10y_old_mvrv') + self._12y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_12y_old_mvrv') + self._15y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_15y_old_mvrv') + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_1d_old_mvrv') + self._1w: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_1w_old_mvrv') + self._1m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_1m_old_mvrv') + self._2m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_2m_old_mvrv') + self._3m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_3m_old_mvrv') + self._4m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_4m_old_mvrv') + self._5m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_5m_old_mvrv') + self._6m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_6m_old_mvrv') + self._9m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_9m_old_mvrv') + self._1y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_1y_old_mvrv') + self._18m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_18m_old_mvrv') + self._2y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_2y_old_mvrv') + self._3y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_3y_old_mvrv') + self._4y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_4y_old_mvrv') + self._5y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_5y_old_mvrv') + self._6y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_6y_old_mvrv') + self._7y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_7y_old_mvrv') + self._8y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_8y_old_mvrv') + self._10y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_10y_old_mvrv') + self._12y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_12y_old_mvrv') + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Range = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Under = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Over = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'epoch_0_mvrv') + self._1: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'epoch_1_mvrv') + self._2: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'epoch_2_mvrv') + self._3: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'epoch_3_mvrv') + self._4: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'epoch_4_mvrv') + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2009_mvrv') + self._2010: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2010_mvrv') + self._2011: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2011_mvrv') + self._2012: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2012_mvrv') + self._2013: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2013_mvrv') + self._2014: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2014_mvrv') + self._2015: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2015_mvrv') + self._2016: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2016_mvrv') + self._2017: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2017_mvrv') + self._2018: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2018_mvrv') + self._2019: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2019_mvrv') + self._2020: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2020_mvrv') + self._2021: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2021_mvrv') + self._2022: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2022_mvrv') + self._2023: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2023_mvrv') + self._2024: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2024_mvrv') + self._2025: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2025_mvrv') + self._2026: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'class_2026_mvrv') + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_0sats_mvrv') + self._1sat_to_10sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1sat_to_10sats_mvrv') + self._10sats_to_100sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_10sats_to_100sats_mvrv') + self._100sats_to_1k_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_100sats_to_1k_sats_mvrv') + self._1k_sats_to_10k_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1k_sats_to_10k_sats_mvrv') + self._10k_sats_to_100k_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_10k_sats_to_100k_sats_mvrv') + self._100k_sats_to_1m_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_100k_sats_to_1m_sats_mvrv') + self._1m_sats_to_10m_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1m_sats_to_10m_sats_mvrv') + self._10m_sats_to_1btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_10m_sats_to_1btc_mvrv') + self._1btc_to_10btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1btc_to_10btc_mvrv') + self._10btc_to_100btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_10btc_to_100btc_mvrv') + self._100btc_to_1k_btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_100btc_to_1k_btc_mvrv') + self._1k_btc_to_10k_btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_1k_btc_to_10k_btc_mvrv') + self._10k_btc_to_100k_btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_10k_btc_to_100k_btc_mvrv') + self.over_100k_btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_100k_btc_mvrv') + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_10sats_mvrv') + self._100sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_100sats_mvrv') + self._1k_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_1k_sats_mvrv') + self._10k_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_10k_sats_mvrv') + self._100k_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_100k_sats_mvrv') + self._1m_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_1m_sats_mvrv') + self._10m_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_10m_sats_mvrv') + self._1btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_1btc_mvrv') + self._10btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_10btc_mvrv') + self._100btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_100btc_mvrv') + self._1k_btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_1k_btc_mvrv') + self._10k_btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_10k_btc_mvrv') + self._100k_btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_under_100k_btc_mvrv') + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_1sat_mvrv') + self._10sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_10sats_mvrv') + self._100sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_100sats_mvrv') + self._1k_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_1k_sats_mvrv') + self._10k_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_10k_sats_mvrv') + self._100k_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_100k_sats_mvrv') + self._1m_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_1m_sats_mvrv') + self._10m_sats: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_10m_sats_mvrv') + self._1btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_1btc_mvrv') + self._10btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_10btc_mvrv') + self._100btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_100btc_mvrv') + self._1k_btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_1k_btc_mvrv') + self._10k_btc: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'utxos_over_10k_btc_mvrv') + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Range = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Under = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Over = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount_Over(client) + +class SeriesTree_Cohorts_Cohorts_Realized_Mvrv: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'mvrv') + self.age: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Epoch = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Class = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_Class(client) + self.entry: DiscountPremiumPattern7[StoredF32] = DiscountPremiumPattern7(client, 'mvrv') + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount = SeriesTree_Cohorts_Cohorts_Realized_Mvrv_UtxoAmount(client) + self.term: LongShortPattern7[StoredF32] = LongShortPattern7(client, 'mvrv') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6[StoredF32] = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6(client, 'mvrv') + +class SeriesTree_Cohorts_Cohorts_Realized: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.cap: SeriesTree_Cohorts_Cohorts_Realized_Cap = SeriesTree_Cohorts_Cohorts_Realized_Cap(client) + self.price: SeriesTree_Cohorts_Cohorts_Realized_Price = SeriesTree_Cohorts_Cohorts_Realized_Price(client) + self.profit: SeriesTree_Cohorts_Cohorts_Realized_Profit = SeriesTree_Cohorts_Cohorts_Realized_Profit(client) + self.loss: SeriesTree_Cohorts_Cohorts_Realized_Loss = SeriesTree_Cohorts_Cohorts_Realized_Loss(client) + self.net_pnl: SeriesTree_Cohorts_Cohorts_Realized_NetPnl = SeriesTree_Cohorts_Cohorts_Realized_NetPnl(client) + self.sopr: SeriesTree_Cohorts_Cohorts_Realized_Sopr = SeriesTree_Cohorts_Cohorts_Realized_Sopr(client) + self.adjusted_sopr: SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr = SeriesTree_Cohorts_Cohorts_Realized_AdjustedSopr(client) + self.gross_pnl: SeriesTree_Cohorts_Cohorts_Realized_GrossPnl = SeriesTree_Cohorts_Cohorts_Realized_GrossPnl(client) + self.capitalized_price: SeriesTree_Cohorts_Cohorts_Realized_CapitalizedPrice = SeriesTree_Cohorts_Cohorts_Realized_CapitalizedPrice(client) + self.cap_raw: MatrixPattern[CentsSats] = MatrixPattern(client, 'cap_raw_by_term') + self.capitalized_cap_raw: MatrixPattern[CentsSquaredSats] = MatrixPattern(client, 'capitalized_cap_raw_by_term') + self.peak_regret: SeriesTree_Cohorts_Cohorts_Realized_PeakRegret = SeriesTree_Cohorts_Cohorts_Realized_PeakRegret(client) + self.net_pnl_change_1m_to_rcap: SeriesTree_Cohorts_Cohorts_Realized_NetPnlChange1mToRcap = SeriesTree_Cohorts_Cohorts_Realized_NetPnlChange1mToRcap(client) + self.sell_side_risk_ratio: SeriesTree_Cohorts_Cohorts_Realized_SellSideRiskRatio = SeriesTree_Cohorts_Cohorts_Realized_SellSideRiskRatio(client) + self.sopr_ratio_extended: SeriesTree_Cohorts_Cohorts_Realized_SoprRatioExtended = SeriesTree_Cohorts_Cohorts_Realized_SoprRatioExtended(client) + self.profit_to_loss_ratio: SeriesTree_Cohorts_Cohorts_Realized_ProfitToLossRatio = SeriesTree_Cohorts_Cohorts_Realized_ProfitToLossRatio(client) + self.mvrv: SeriesTree_Cohorts_Cohorts_Realized_Mvrv = SeriesTree_Cohorts_Cohorts_Realized_Mvrv(client) + +class SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_1h_old_unrealized_profit') + self._1h_to_1d: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1h_to_1d_old_unrealized_profit') + self._1d_to_1w: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1d_to_1w_old_unrealized_profit') + self._1w_to_1m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1w_to_1m_old_unrealized_profit') + self._1m_to_2m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1m_to_2m_old_unrealized_profit') + self._2m_to_3m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_2m_to_3m_old_unrealized_profit') + self._3m_to_4m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_3m_to_4m_old_unrealized_profit') + self._4m_to_5m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_4m_to_5m_old_unrealized_profit') + self._5m_to_6m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_5m_to_6m_old_unrealized_profit') + self._6m_to_9m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_6m_to_9m_old_unrealized_profit') + self._9m_to_1y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_9m_to_1y_old_unrealized_profit') + self._1y_to_18m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1y_to_18m_old_unrealized_profit') + self._18m_to_2y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_18m_to_2y_old_unrealized_profit') + self._2y_to_3y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_2y_to_3y_old_unrealized_profit') + self._3y_to_4y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_3y_to_4y_old_unrealized_profit') + self._4y_to_5y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_4y_to_5y_old_unrealized_profit') + self._5y_to_6y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_5y_to_6y_old_unrealized_profit') + self._6y_to_7y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_6y_to_7y_old_unrealized_profit') + self._7y_to_8y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_7y_to_8y_old_unrealized_profit') + self._8y_to_10y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_8y_to_10y_old_unrealized_profit') + self._10y_to_12y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_10y_to_12y_old_unrealized_profit') + self._12y_to_15y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_12y_to_15y_old_unrealized_profit') + self.over_15y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_15y_old_unrealized_profit') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_1w_old_unrealized_profit') + self._1m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_1m_old_unrealized_profit') + self._2m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_2m_old_unrealized_profit') + self._3m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_3m_old_unrealized_profit') + self._4m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_4m_old_unrealized_profit') + self._5m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_5m_old_unrealized_profit') + self._6m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_6m_old_unrealized_profit') + self._9m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_9m_old_unrealized_profit') + self._1y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_1y_old_unrealized_profit') + self._18m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_18m_old_unrealized_profit') + self._2y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_2y_old_unrealized_profit') + self._3y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_3y_old_unrealized_profit') + self._4y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_4y_old_unrealized_profit') + self._5y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_5y_old_unrealized_profit') + self._6y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_6y_old_unrealized_profit') + self._7y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_7y_old_unrealized_profit') + self._8y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_8y_old_unrealized_profit') + self._10y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_10y_old_unrealized_profit') + self._12y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_12y_old_unrealized_profit') + self._15y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_15y_old_unrealized_profit') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_1d_old_unrealized_profit') + self._1w: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_1w_old_unrealized_profit') + self._1m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_1m_old_unrealized_profit') + self._2m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_2m_old_unrealized_profit') + self._3m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_3m_old_unrealized_profit') + self._4m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_4m_old_unrealized_profit') + self._5m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_5m_old_unrealized_profit') + self._6m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_6m_old_unrealized_profit') + self._9m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_9m_old_unrealized_profit') + self._1y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_1y_old_unrealized_profit') + self._18m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_18m_old_unrealized_profit') + self._2y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_2y_old_unrealized_profit') + self._3y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_3y_old_unrealized_profit') + self._4y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_4y_old_unrealized_profit') + self._5y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_5y_old_unrealized_profit') + self._6y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_6y_old_unrealized_profit') + self._7y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_7y_old_unrealized_profit') + self._8y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_8y_old_unrealized_profit') + self._10y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_10y_old_unrealized_profit') + self._12y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_12y_old_unrealized_profit') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Range = SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Under = SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Over = SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_0_unrealized_profit') + self._1: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_1_unrealized_profit') + self._2: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_2_unrealized_profit') + self._3: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_3_unrealized_profit') + self._4: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_4_unrealized_profit') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2009_unrealized_profit') + self._2010: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2010_unrealized_profit') + self._2011: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2011_unrealized_profit') + self._2012: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2012_unrealized_profit') + self._2013: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2013_unrealized_profit') + self._2014: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2014_unrealized_profit') + self._2015: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2015_unrealized_profit') + self._2016: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2016_unrealized_profit') + self._2017: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2017_unrealized_profit') + self._2018: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2018_unrealized_profit') + self._2019: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2019_unrealized_profit') + self._2020: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2020_unrealized_profit') + self._2021: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2021_unrealized_profit') + self._2022: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2022_unrealized_profit') + self._2023: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2023_unrealized_profit') + self._2024: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2024_unrealized_profit') + self._2025: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2025_unrealized_profit') + self._2026: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2026_unrealized_profit') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Profit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsUsdPattern3 = CentsUsdPattern3(client, 'unrealized_profit') + self.age: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age = SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Epoch = SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Class = SeriesTree_Cohorts_Cohorts_Unrealized_Profit_Class(client) + self.entry: DiscountPremiumPattern13 = DiscountPremiumPattern13(client, 'unrealized_profit') + self.term: LongShortPattern14 = LongShortPattern14(client, 'unrealized_profit') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11(client, 'unrealized_profit') + self.age_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_unrealized_profit_cents_by_age_range') + self.epoch_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'unrealized_profit_cents_by_epoch') + self.class_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'unrealized_profit_cents_by_class') + self.entry_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'unrealized_profit_cents_by_entry') + self.type_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'unrealized_profit_cents_by_type') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_1h_old_unrealized_loss') + self._1h_to_1d: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1h_to_1d_old_unrealized_loss') + self._1d_to_1w: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1d_to_1w_old_unrealized_loss') + self._1w_to_1m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1w_to_1m_old_unrealized_loss') + self._1m_to_2m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1m_to_2m_old_unrealized_loss') + self._2m_to_3m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_2m_to_3m_old_unrealized_loss') + self._3m_to_4m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_3m_to_4m_old_unrealized_loss') + self._4m_to_5m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_4m_to_5m_old_unrealized_loss') + self._5m_to_6m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_5m_to_6m_old_unrealized_loss') + self._6m_to_9m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_6m_to_9m_old_unrealized_loss') + self._9m_to_1y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_9m_to_1y_old_unrealized_loss') + self._1y_to_18m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_1y_to_18m_old_unrealized_loss') + self._18m_to_2y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_18m_to_2y_old_unrealized_loss') + self._2y_to_3y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_2y_to_3y_old_unrealized_loss') + self._3y_to_4y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_3y_to_4y_old_unrealized_loss') + self._4y_to_5y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_4y_to_5y_old_unrealized_loss') + self._5y_to_6y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_5y_to_6y_old_unrealized_loss') + self._6y_to_7y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_6y_to_7y_old_unrealized_loss') + self._7y_to_8y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_7y_to_8y_old_unrealized_loss') + self._8y_to_10y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_8y_to_10y_old_unrealized_loss') + self._10y_to_12y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_10y_to_12y_old_unrealized_loss') + self._12y_to_15y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_12y_to_15y_old_unrealized_loss') + self.over_15y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_15y_old_unrealized_loss') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_1w_old_unrealized_loss') + self._1m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_1m_old_unrealized_loss') + self._2m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_2m_old_unrealized_loss') + self._3m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_3m_old_unrealized_loss') + self._4m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_4m_old_unrealized_loss') + self._5m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_5m_old_unrealized_loss') + self._6m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_6m_old_unrealized_loss') + self._9m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_9m_old_unrealized_loss') + self._1y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_1y_old_unrealized_loss') + self._18m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_18m_old_unrealized_loss') + self._2y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_2y_old_unrealized_loss') + self._3y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_3y_old_unrealized_loss') + self._4y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_4y_old_unrealized_loss') + self._5y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_5y_old_unrealized_loss') + self._6y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_6y_old_unrealized_loss') + self._7y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_7y_old_unrealized_loss') + self._8y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_8y_old_unrealized_loss') + self._10y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_10y_old_unrealized_loss') + self._12y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_12y_old_unrealized_loss') + self._15y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_under_15y_old_unrealized_loss') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_1d_old_unrealized_loss') + self._1w: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_1w_old_unrealized_loss') + self._1m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_1m_old_unrealized_loss') + self._2m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_2m_old_unrealized_loss') + self._3m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_3m_old_unrealized_loss') + self._4m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_4m_old_unrealized_loss') + self._5m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_5m_old_unrealized_loss') + self._6m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_6m_old_unrealized_loss') + self._9m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_9m_old_unrealized_loss') + self._1y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_1y_old_unrealized_loss') + self._18m: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_18m_old_unrealized_loss') + self._2y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_2y_old_unrealized_loss') + self._3y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_3y_old_unrealized_loss') + self._4y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_4y_old_unrealized_loss') + self._5y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_5y_old_unrealized_loss') + self._6y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_6y_old_unrealized_loss') + self._7y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_7y_old_unrealized_loss') + self._8y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_8y_old_unrealized_loss') + self._10y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_10y_old_unrealized_loss') + self._12y: CentsUsdPattern3 = CentsUsdPattern3(client, 'utxos_over_12y_old_unrealized_loss') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Range = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Under = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Over = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_0_unrealized_loss') + self._1: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_1_unrealized_loss') + self._2: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_2_unrealized_loss') + self._3: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_3_unrealized_loss') + self._4: CentsUsdPattern3 = CentsUsdPattern3(client, 'epoch_4_unrealized_loss') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2009_unrealized_loss') + self._2010: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2010_unrealized_loss') + self._2011: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2011_unrealized_loss') + self._2012: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2012_unrealized_loss') + self._2013: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2013_unrealized_loss') + self._2014: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2014_unrealized_loss') + self._2015: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2015_unrealized_loss') + self._2016: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2016_unrealized_loss') + self._2017: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2017_unrealized_loss') + self._2018: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2018_unrealized_loss') + self._2019: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2019_unrealized_loss') + self._2020: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2020_unrealized_loss') + self._2021: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2021_unrealized_loss') + self._2022: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2022_unrealized_loss') + self._2023: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2023_unrealized_loss') + self._2024: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2024_unrealized_loss') + self._2025: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2025_unrealized_loss') + self._2026: CentsUsdPattern3 = CentsUsdPattern3(client, 'class_2026_unrealized_loss') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_1h_old_unrealized_loss_neg') + self._1h_to_1d: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_1h_to_1d_old_unrealized_loss_neg') + self._1d_to_1w: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_1d_to_1w_old_unrealized_loss_neg') + self._1w_to_1m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_1w_to_1m_old_unrealized_loss_neg') + self._1m_to_2m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_1m_to_2m_old_unrealized_loss_neg') + self._2m_to_3m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_2m_to_3m_old_unrealized_loss_neg') + self._3m_to_4m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_3m_to_4m_old_unrealized_loss_neg') + self._4m_to_5m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_4m_to_5m_old_unrealized_loss_neg') + self._5m_to_6m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_5m_to_6m_old_unrealized_loss_neg') + self._6m_to_9m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_6m_to_9m_old_unrealized_loss_neg') + self._9m_to_1y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_9m_to_1y_old_unrealized_loss_neg') + self._1y_to_18m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_1y_to_18m_old_unrealized_loss_neg') + self._18m_to_2y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_18m_to_2y_old_unrealized_loss_neg') + self._2y_to_3y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_2y_to_3y_old_unrealized_loss_neg') + self._3y_to_4y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_3y_to_4y_old_unrealized_loss_neg') + self._4y_to_5y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_4y_to_5y_old_unrealized_loss_neg') + self._5y_to_6y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_5y_to_6y_old_unrealized_loss_neg') + self._6y_to_7y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_6y_to_7y_old_unrealized_loss_neg') + self._7y_to_8y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_7y_to_8y_old_unrealized_loss_neg') + self._8y_to_10y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_8y_to_10y_old_unrealized_loss_neg') + self._10y_to_12y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10y_to_12y_old_unrealized_loss_neg') + self._12y_to_15y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_12y_to_15y_old_unrealized_loss_neg') + self.over_15y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_15y_old_unrealized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_1w_old_unrealized_loss_neg') + self._1m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_1m_old_unrealized_loss_neg') + self._2m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_2m_old_unrealized_loss_neg') + self._3m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_3m_old_unrealized_loss_neg') + self._4m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_4m_old_unrealized_loss_neg') + self._5m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_5m_old_unrealized_loss_neg') + self._6m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_6m_old_unrealized_loss_neg') + self._9m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_9m_old_unrealized_loss_neg') + self._1y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_1y_old_unrealized_loss_neg') + self._18m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_18m_old_unrealized_loss_neg') + self._2y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_2y_old_unrealized_loss_neg') + self._3y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_3y_old_unrealized_loss_neg') + self._4y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_4y_old_unrealized_loss_neg') + self._5y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_5y_old_unrealized_loss_neg') + self._6y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_6y_old_unrealized_loss_neg') + self._7y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_7y_old_unrealized_loss_neg') + self._8y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_8y_old_unrealized_loss_neg') + self._10y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_10y_old_unrealized_loss_neg') + self._12y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_12y_old_unrealized_loss_neg') + self._15y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_under_15y_old_unrealized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1d_old_unrealized_loss_neg') + self._1w: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1w_old_unrealized_loss_neg') + self._1m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1m_old_unrealized_loss_neg') + self._2m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_2m_old_unrealized_loss_neg') + self._3m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_3m_old_unrealized_loss_neg') + self._4m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_4m_old_unrealized_loss_neg') + self._5m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_5m_old_unrealized_loss_neg') + self._6m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_6m_old_unrealized_loss_neg') + self._9m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_9m_old_unrealized_loss_neg') + self._1y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1y_old_unrealized_loss_neg') + self._18m: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_18m_old_unrealized_loss_neg') + self._2y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_2y_old_unrealized_loss_neg') + self._3y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_3y_old_unrealized_loss_neg') + self._4y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_4y_old_unrealized_loss_neg') + self._5y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_5y_old_unrealized_loss_neg') + self._6y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_6y_old_unrealized_loss_neg') + self._7y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_7y_old_unrealized_loss_neg') + self._8y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_8y_old_unrealized_loss_neg') + self._10y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10y_old_unrealized_loss_neg') + self._12y: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_12y_old_unrealized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Range = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Under = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Over = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: SeriesPattern1[Dollars] = SeriesPattern1(client, 'epoch_0_unrealized_loss_neg') + self._1: SeriesPattern1[Dollars] = SeriesPattern1(client, 'epoch_1_unrealized_loss_neg') + self._2: SeriesPattern1[Dollars] = SeriesPattern1(client, 'epoch_2_unrealized_loss_neg') + self._3: SeriesPattern1[Dollars] = SeriesPattern1(client, 'epoch_3_unrealized_loss_neg') + self._4: SeriesPattern1[Dollars] = SeriesPattern1(client, 'epoch_4_unrealized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2009_unrealized_loss_neg') + self._2010: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2010_unrealized_loss_neg') + self._2011: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2011_unrealized_loss_neg') + self._2012: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2012_unrealized_loss_neg') + self._2013: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2013_unrealized_loss_neg') + self._2014: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2014_unrealized_loss_neg') + self._2015: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2015_unrealized_loss_neg') + self._2016: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2016_unrealized_loss_neg') + self._2017: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2017_unrealized_loss_neg') + self._2018: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2018_unrealized_loss_neg') + self._2019: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2019_unrealized_loss_neg') + self._2020: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2020_unrealized_loss_neg') + self._2021: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2021_unrealized_loss_neg') + self._2022: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2022_unrealized_loss_neg') + self._2023: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2023_unrealized_loss_neg') + self._2024: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2024_unrealized_loss_neg') + self._2025: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2025_unrealized_loss_neg') + self._2026: SeriesPattern1[Dollars] = SeriesPattern1(client, 'class_2026_unrealized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'unrealized_loss_neg') + self.age: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Epoch = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Class = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative_Class(client) + self.entry: DiscountPremiumPattern7[Dollars] = DiscountPremiumPattern7(client, 'unrealized_loss_neg') + self.term: LongShortPattern7[Dollars] = LongShortPattern7(client, 'unrealized_loss_neg') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6[Dollars] = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern6(client, 'unrealized_loss_neg') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Loss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsUsdPattern3 = CentsUsdPattern3(client, 'unrealized_loss') + self.age: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Epoch = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Class = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Class(client) + self.entry: DiscountPremiumPattern13 = DiscountPremiumPattern13(client, 'unrealized_loss') + self.term: LongShortPattern14 = LongShortPattern14(client, 'unrealized_loss') + self.type: EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11 = EmptyP2aP2msP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshUnknownPattern11(client, 'unrealized_loss') + self.age_range_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'utxos_unrealized_loss_cents_by_age_range') + self.epoch_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'unrealized_loss_cents_by_epoch') + self.class_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'unrealized_loss_cents_by_class') + self.entry_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'unrealized_loss_cents_by_entry') + self.type_matrix: SeriesPattern18[Cents] = SeriesPattern18(client, 'unrealized_loss_cents_by_type') + self.negative: SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative = SeriesTree_Cohorts_Cohorts_Unrealized_Loss_Negative(client) + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_1h_old_net_unrealized_pnl') + self._1h_to_1d: CentsUsdPattern = CentsUsdPattern(client, 'utxos_1h_to_1d_old_net_unrealized_pnl') + self._1d_to_1w: CentsUsdPattern = CentsUsdPattern(client, 'utxos_1d_to_1w_old_net_unrealized_pnl') + self._1w_to_1m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_1w_to_1m_old_net_unrealized_pnl') + self._1m_to_2m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_1m_to_2m_old_net_unrealized_pnl') + self._2m_to_3m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_2m_to_3m_old_net_unrealized_pnl') + self._3m_to_4m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_3m_to_4m_old_net_unrealized_pnl') + self._4m_to_5m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_4m_to_5m_old_net_unrealized_pnl') + self._5m_to_6m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_5m_to_6m_old_net_unrealized_pnl') + self._6m_to_9m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_6m_to_9m_old_net_unrealized_pnl') + self._9m_to_1y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_9m_to_1y_old_net_unrealized_pnl') + self._1y_to_18m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_1y_to_18m_old_net_unrealized_pnl') + self._18m_to_2y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_18m_to_2y_old_net_unrealized_pnl') + self._2y_to_3y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_2y_to_3y_old_net_unrealized_pnl') + self._3y_to_4y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_3y_to_4y_old_net_unrealized_pnl') + self._4y_to_5y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_4y_to_5y_old_net_unrealized_pnl') + self._5y_to_6y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_5y_to_6y_old_net_unrealized_pnl') + self._6y_to_7y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_6y_to_7y_old_net_unrealized_pnl') + self._7y_to_8y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_7y_to_8y_old_net_unrealized_pnl') + self._8y_to_10y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_8y_to_10y_old_net_unrealized_pnl') + self._10y_to_12y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_10y_to_12y_old_net_unrealized_pnl') + self._12y_to_15y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_12y_to_15y_old_net_unrealized_pnl') + self.over_15y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_15y_old_net_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_1w_old_net_unrealized_pnl') + self._1m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_1m_old_net_unrealized_pnl') + self._2m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_2m_old_net_unrealized_pnl') + self._3m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_3m_old_net_unrealized_pnl') + self._4m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_4m_old_net_unrealized_pnl') + self._5m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_5m_old_net_unrealized_pnl') + self._6m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_6m_old_net_unrealized_pnl') + self._9m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_9m_old_net_unrealized_pnl') + self._1y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_1y_old_net_unrealized_pnl') + self._18m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_18m_old_net_unrealized_pnl') + self._2y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_2y_old_net_unrealized_pnl') + self._3y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_3y_old_net_unrealized_pnl') + self._4y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_4y_old_net_unrealized_pnl') + self._5y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_5y_old_net_unrealized_pnl') + self._6y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_6y_old_net_unrealized_pnl') + self._7y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_7y_old_net_unrealized_pnl') + self._8y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_8y_old_net_unrealized_pnl') + self._10y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_10y_old_net_unrealized_pnl') + self._12y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_12y_old_net_unrealized_pnl') + self._15y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_under_15y_old_net_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_1d_old_net_unrealized_pnl') + self._1w: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_1w_old_net_unrealized_pnl') + self._1m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_1m_old_net_unrealized_pnl') + self._2m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_2m_old_net_unrealized_pnl') + self._3m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_3m_old_net_unrealized_pnl') + self._4m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_4m_old_net_unrealized_pnl') + self._5m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_5m_old_net_unrealized_pnl') + self._6m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_6m_old_net_unrealized_pnl') + self._9m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_9m_old_net_unrealized_pnl') + self._1y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_1y_old_net_unrealized_pnl') + self._18m: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_18m_old_net_unrealized_pnl') + self._2y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_2y_old_net_unrealized_pnl') + self._3y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_3y_old_net_unrealized_pnl') + self._4y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_4y_old_net_unrealized_pnl') + self._5y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_5y_old_net_unrealized_pnl') + self._6y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_6y_old_net_unrealized_pnl') + self._7y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_7y_old_net_unrealized_pnl') + self._8y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_8y_old_net_unrealized_pnl') + self._10y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_10y_old_net_unrealized_pnl') + self._12y: CentsUsdPattern = CentsUsdPattern(client, 'utxos_over_12y_old_net_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Range = SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Under = SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Over = SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: CentsUsdPattern = CentsUsdPattern(client, 'epoch_0_net_unrealized_pnl') + self._1: CentsUsdPattern = CentsUsdPattern(client, 'epoch_1_net_unrealized_pnl') + self._2: CentsUsdPattern = CentsUsdPattern(client, 'epoch_2_net_unrealized_pnl') + self._3: CentsUsdPattern = CentsUsdPattern(client, 'epoch_3_net_unrealized_pnl') + self._4: CentsUsdPattern = CentsUsdPattern(client, 'epoch_4_net_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: CentsUsdPattern = CentsUsdPattern(client, 'class_2009_net_unrealized_pnl') + self._2010: CentsUsdPattern = CentsUsdPattern(client, 'class_2010_net_unrealized_pnl') + self._2011: CentsUsdPattern = CentsUsdPattern(client, 'class_2011_net_unrealized_pnl') + self._2012: CentsUsdPattern = CentsUsdPattern(client, 'class_2012_net_unrealized_pnl') + self._2013: CentsUsdPattern = CentsUsdPattern(client, 'class_2013_net_unrealized_pnl') + self._2014: CentsUsdPattern = CentsUsdPattern(client, 'class_2014_net_unrealized_pnl') + self._2015: CentsUsdPattern = CentsUsdPattern(client, 'class_2015_net_unrealized_pnl') + self._2016: CentsUsdPattern = CentsUsdPattern(client, 'class_2016_net_unrealized_pnl') + self._2017: CentsUsdPattern = CentsUsdPattern(client, 'class_2017_net_unrealized_pnl') + self._2018: CentsUsdPattern = CentsUsdPattern(client, 'class_2018_net_unrealized_pnl') + self._2019: CentsUsdPattern = CentsUsdPattern(client, 'class_2019_net_unrealized_pnl') + self._2020: CentsUsdPattern = CentsUsdPattern(client, 'class_2020_net_unrealized_pnl') + self._2021: CentsUsdPattern = CentsUsdPattern(client, 'class_2021_net_unrealized_pnl') + self._2022: CentsUsdPattern = CentsUsdPattern(client, 'class_2022_net_unrealized_pnl') + self._2023: CentsUsdPattern = CentsUsdPattern(client, 'class_2023_net_unrealized_pnl') + self._2024: CentsUsdPattern = CentsUsdPattern(client, 'class_2024_net_unrealized_pnl') + self._2025: CentsUsdPattern = CentsUsdPattern(client, 'class_2025_net_unrealized_pnl') + self._2026: CentsUsdPattern = CentsUsdPattern(client, 'class_2026_net_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Entry: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: CentsUsdPattern = CentsUsdPattern(client, 'veteran_net_unrealized_pnl') + self.premium: CentsUsdPattern = CentsUsdPattern(client, 'rookie_net_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Term: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: CentsUsdPattern = CentsUsdPattern(client, 'sth_net_unrealized_pnl') + self.long: CentsUsdPattern = CentsUsdPattern(client, 'lth_net_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsUsdPattern = CentsUsdPattern(client, 'net_unrealized_pnl') + self.age: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age = SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Epoch = SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Class = SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Class(client) + self.entry: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Entry = SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Entry(client) + self.term: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Term = SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl_Term(client) + self.age_range_matrix: SeriesPattern18[CentsSigned] = SeriesPattern18(client, 'utxos_net_unrealized_pnl_cents_by_age_range') + self.epoch_matrix: SeriesPattern18[CentsSigned] = SeriesPattern18(client, 'net_unrealized_pnl_cents_by_epoch') + self.class_matrix: SeriesPattern18[CentsSigned] = SeriesPattern18(client, 'net_unrealized_pnl_cents_by_class') + self.entry_matrix: SeriesPattern18[CentsSigned] = SeriesPattern18(client, 'net_unrealized_pnl_cents_by_entry') + +class SeriesTree_Cohorts_Cohorts_Unrealized_GrossPnl: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsUsdPattern3 = CentsUsdPattern3(client, 'all_unrealized_gross_pnl') + self.sth: CentsUsdPattern3 = CentsUsdPattern3(client, 'sth_unrealized_gross_pnl') + self.lth: CentsUsdPattern3 = CentsUsdPattern3(client, 'lth_unrealized_gross_pnl') + self.height: SeriesPattern18[Cents] = SeriesPattern18(client, 'unrealized_gross_pnl_cents_by_term') + +class SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsUsdPattern3 = CentsUsdPattern3(client, 'all_invested_capital_in_profit') + self.sth: CentsUsdPattern3 = CentsUsdPattern3(client, 'sth_invested_capital_in_profit') + self.lth: CentsUsdPattern3 = CentsUsdPattern3(client, 'lth_invested_capital_in_profit') + self.height: SeriesPattern18[Cents] = SeriesPattern18(client, 'invested_capital_in_profit_cents_by_term') + +class SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsUsdPattern3 = CentsUsdPattern3(client, 'all_invested_capital_in_loss') + self.sth: CentsUsdPattern3 = CentsUsdPattern3(client, 'sth_invested_capital_in_loss') + self.lth: CentsUsdPattern3 = CentsUsdPattern3(client, 'lth_invested_capital_in_loss') + self.height: SeriesPattern18[Cents] = SeriesPattern18(client, 'invested_capital_in_loss_cents_by_term') + +class SeriesTree_Cohorts_Cohorts_Unrealized_PainIndex: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsUsdPattern3 = CentsUsdPattern3(client, 'all_pain_index') + self.sth: CentsUsdPattern3 = CentsUsdPattern3(client, 'sth_pain_index') + self.lth: CentsUsdPattern3 = CentsUsdPattern3(client, 'lth_pain_index') + self.height: SeriesPattern18[Cents] = SeriesPattern18(client, 'pain_index_cents_by_aggregate') + +class SeriesTree_Cohorts_Cohorts_Unrealized_GreedIndex: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsUsdPattern3 = CentsUsdPattern3(client, 'all_greed_index') + self.sth: CentsUsdPattern3 = CentsUsdPattern3(client, 'sth_greed_index') + self.lth: CentsUsdPattern3 = CentsUsdPattern3(client, 'lth_greed_index') + self.height: SeriesPattern18[Cents] = SeriesPattern18(client, 'greed_index_cents_by_aggregate') + +class SeriesTree_Cohorts_Cohorts_Unrealized_NetSentiment: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: CentsUsdPattern = CentsUsdPattern(client, 'all_net_sentiment') + self.sth: CentsUsdPattern = CentsUsdPattern(client, 'sth_net_sentiment') + self.lth: CentsUsdPattern = CentsUsdPattern(client, 'lth_net_sentiment') + self.height: SeriesPattern18[CentsSigned] = SeriesPattern18(client, 'net_sentiment_cents_by_aggregate') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.under_1h: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_1h_old_nupl') + self._1h_to_1d: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1h_to_1d_old_nupl') + self._1d_to_1w: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1d_to_1w_old_nupl') + self._1w_to_1m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1w_to_1m_old_nupl') + self._1m_to_2m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1m_to_2m_old_nupl') + self._2m_to_3m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_2m_to_3m_old_nupl') + self._3m_to_4m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_3m_to_4m_old_nupl') + self._4m_to_5m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_4m_to_5m_old_nupl') + self._5m_to_6m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_5m_to_6m_old_nupl') + self._6m_to_9m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_6m_to_9m_old_nupl') + self._9m_to_1y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_9m_to_1y_old_nupl') + self._1y_to_18m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1y_to_18m_old_nupl') + self._18m_to_2y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_18m_to_2y_old_nupl') + self._2y_to_3y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_2y_to_3y_old_nupl') + self._3y_to_4y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_3y_to_4y_old_nupl') + self._4y_to_5y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_4y_to_5y_old_nupl') + self._5y_to_6y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_5y_to_6y_old_nupl') + self._6y_to_7y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_6y_to_7y_old_nupl') + self._7y_to_8y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_7y_to_8y_old_nupl') + self._8y_to_10y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_8y_to_10y_old_nupl') + self._10y_to_12y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_10y_to_12y_old_nupl') + self._12y_to_15y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_12y_to_15y_old_nupl') + self.over_15y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_15y_old_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1w: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_1w_old_nupl') + self._1m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_1m_old_nupl') + self._2m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_2m_old_nupl') + self._3m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_3m_old_nupl') + self._4m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_4m_old_nupl') + self._5m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_5m_old_nupl') + self._6m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_6m_old_nupl') + self._9m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_9m_old_nupl') + self._1y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_1y_old_nupl') + self._18m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_18m_old_nupl') + self._2y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_2y_old_nupl') + self._3y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_3y_old_nupl') + self._4y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_4y_old_nupl') + self._5y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_5y_old_nupl') + self._6y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_6y_old_nupl') + self._7y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_7y_old_nupl') + self._8y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_8y_old_nupl') + self._10y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_10y_old_nupl') + self._12y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_12y_old_nupl') + self._15y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_15y_old_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1d: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1d_old_nupl') + self._1w: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1w_old_nupl') + self._1m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1m_old_nupl') + self._2m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_2m_old_nupl') + self._3m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_3m_old_nupl') + self._4m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_4m_old_nupl') + self._5m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_5m_old_nupl') + self._6m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_6m_old_nupl') + self._9m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_9m_old_nupl') + self._1y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1y_old_nupl') + self._18m: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_18m_old_nupl') + self._2y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_2y_old_nupl') + self._3y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_3y_old_nupl') + self._4y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_4y_old_nupl') + self._5y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_5y_old_nupl') + self._6y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_6y_old_nupl') + self._7y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_7y_old_nupl') + self._8y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_8y_old_nupl') + self._10y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_10y_old_nupl') + self._12y: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_12y_old_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Range = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Under = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Over = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age_Over(client) + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Epoch: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0: PpmRatioPattern = PpmRatioPattern(client, 'epoch_0_nupl') + self._1: PpmRatioPattern = PpmRatioPattern(client, 'epoch_1_nupl') + self._2: PpmRatioPattern = PpmRatioPattern(client, 'epoch_2_nupl') + self._3: PpmRatioPattern = PpmRatioPattern(client, 'epoch_3_nupl') + self._4: PpmRatioPattern = PpmRatioPattern(client, 'epoch_4_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Class: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._2009: PpmRatioPattern = PpmRatioPattern(client, 'class_2009_nupl') + self._2010: PpmRatioPattern = PpmRatioPattern(client, 'class_2010_nupl') + self._2011: PpmRatioPattern = PpmRatioPattern(client, 'class_2011_nupl') + self._2012: PpmRatioPattern = PpmRatioPattern(client, 'class_2012_nupl') + self._2013: PpmRatioPattern = PpmRatioPattern(client, 'class_2013_nupl') + self._2014: PpmRatioPattern = PpmRatioPattern(client, 'class_2014_nupl') + self._2015: PpmRatioPattern = PpmRatioPattern(client, 'class_2015_nupl') + self._2016: PpmRatioPattern = PpmRatioPattern(client, 'class_2016_nupl') + self._2017: PpmRatioPattern = PpmRatioPattern(client, 'class_2017_nupl') + self._2018: PpmRatioPattern = PpmRatioPattern(client, 'class_2018_nupl') + self._2019: PpmRatioPattern = PpmRatioPattern(client, 'class_2019_nupl') + self._2020: PpmRatioPattern = PpmRatioPattern(client, 'class_2020_nupl') + self._2021: PpmRatioPattern = PpmRatioPattern(client, 'class_2021_nupl') + self._2022: PpmRatioPattern = PpmRatioPattern(client, 'class_2022_nupl') + self._2023: PpmRatioPattern = PpmRatioPattern(client, 'class_2023_nupl') + self._2024: PpmRatioPattern = PpmRatioPattern(client, 'class_2024_nupl') + self._2025: PpmRatioPattern = PpmRatioPattern(client, 'class_2025_nupl') + self._2026: PpmRatioPattern = PpmRatioPattern(client, 'class_2026_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Entry: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.discount: PpmRatioPattern = PpmRatioPattern(client, 'veteran_nupl') + self.premium: PpmRatioPattern = PpmRatioPattern(client, 'rookie_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._0sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_0sats_nupl') + self._1sat_to_10sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1sat_to_10sats_nupl') + self._10sats_to_100sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_10sats_to_100sats_nupl') + self._100sats_to_1k_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_100sats_to_1k_sats_nupl') + self._1k_sats_to_10k_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1k_sats_to_10k_sats_nupl') + self._10k_sats_to_100k_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_10k_sats_to_100k_sats_nupl') + self._100k_sats_to_1m_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_100k_sats_to_1m_sats_nupl') + self._1m_sats_to_10m_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1m_sats_to_10m_sats_nupl') + self._10m_sats_to_1btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_10m_sats_to_1btc_nupl') + self._1btc_to_10btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1btc_to_10btc_nupl') + self._10btc_to_100btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_10btc_to_100btc_nupl') + self._100btc_to_1k_btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_100btc_to_1k_btc_nupl') + self._1k_btc_to_10k_btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_1k_btc_to_10k_btc_nupl') + self._10k_btc_to_100k_btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_10k_btc_to_100k_btc_nupl') + self.over_100k_btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_100k_btc_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Under: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._10sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_10sats_nupl') + self._100sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_100sats_nupl') + self._1k_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_1k_sats_nupl') + self._10k_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_10k_sats_nupl') + self._100k_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_100k_sats_nupl') + self._1m_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_1m_sats_nupl') + self._10m_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_10m_sats_nupl') + self._1btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_1btc_nupl') + self._10btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_10btc_nupl') + self._100btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_100btc_nupl') + self._1k_btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_1k_btc_nupl') + self._10k_btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_10k_btc_nupl') + self._100k_btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_under_100k_btc_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Over: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self._1sat: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1sat_nupl') + self._10sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_10sats_nupl') + self._100sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_100sats_nupl') + self._1k_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1k_sats_nupl') + self._10k_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_10k_sats_nupl') + self._100k_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_100k_sats_nupl') + self._1m_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1m_sats_nupl') + self._10m_sats: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_10m_sats_nupl') + self._1btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1btc_nupl') + self._10btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_10btc_nupl') + self._100btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_100btc_nupl') + self._1k_btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1k_btc_nupl') + self._10k_btc: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_10k_btc_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Range = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Range(client) + self.under: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Under = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Under(client) + self.over: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Over = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount_Over(client) + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Term: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: PpmRatioPattern = PpmRatioPattern(client, 'sth_nupl') + self.long: PpmRatioPattern = PpmRatioPattern(client, 'lth_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Type: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.p2pk65: PpmRatioPattern = PpmRatioPattern(client, 'p2pk65_nupl') + self.p2pk33: PpmRatioPattern = PpmRatioPattern(client, 'p2pk33_nupl') + self.p2pkh: PpmRatioPattern = PpmRatioPattern(client, 'p2pkh_nupl') + self.p2ms: PpmRatioPattern = PpmRatioPattern(client, 'p2ms_nupl') + self.p2sh: PpmRatioPattern = PpmRatioPattern(client, 'p2sh_nupl') + self.p2wpkh: PpmRatioPattern = PpmRatioPattern(client, 'p2wpkh_nupl') + self.p2wsh: PpmRatioPattern = PpmRatioPattern(client, 'p2wsh_nupl') + self.p2tr: PpmRatioPattern = PpmRatioPattern(client, 'p2tr_nupl') + self.p2a: PpmRatioPattern = PpmRatioPattern(client, 'p2a_nupl') + self.unknown: PpmRatioPattern = PpmRatioPattern(client, 'unknown_outputs_nupl') + self.empty: PpmRatioPattern = PpmRatioPattern(client, 'empty_outputs_nupl') + +class SeriesTree_Cohorts_Cohorts_Unrealized_Nupl: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: PpmRatioPattern = PpmRatioPattern(client, 'nupl') + self.age: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Age(client) + self.epoch: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Epoch = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Epoch(client) + self.class_: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Class = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Class(client) + self.entry: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Entry = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Entry(client) + self.utxo_amount: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_UtxoAmount(client) + self.term: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Term = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Term(client) + self.type: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Type = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl_Type(client) + +class SeriesTree_Cohorts_Cohorts_Unrealized: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.profit: SeriesTree_Cohorts_Cohorts_Unrealized_Profit = SeriesTree_Cohorts_Cohorts_Unrealized_Profit(client) + self.loss: SeriesTree_Cohorts_Cohorts_Unrealized_Loss = SeriesTree_Cohorts_Cohorts_Unrealized_Loss(client) + self.net_pnl: SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl = SeriesTree_Cohorts_Cohorts_Unrealized_NetPnl(client) + self.gross_pnl: SeriesTree_Cohorts_Cohorts_Unrealized_GrossPnl = SeriesTree_Cohorts_Cohorts_Unrealized_GrossPnl(client) + self.invested_capital_in_profit: SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInProfit = SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInProfit(client) + self.invested_capital_in_loss: SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInLoss = SeriesTree_Cohorts_Cohorts_Unrealized_InvestedCapitalInLoss(client) + self.capitalized_cap_in_profit_raw: MatrixPattern[CentsSquaredSats] = MatrixPattern(client, 'capitalized_cap_in_profit_raw_by_term') + self.capitalized_cap_in_loss_raw: MatrixPattern[CentsSquaredSats] = MatrixPattern(client, 'capitalized_cap_in_loss_raw_by_term') + self.pain_index: SeriesTree_Cohorts_Cohorts_Unrealized_PainIndex = SeriesTree_Cohorts_Cohorts_Unrealized_PainIndex(client) + self.greed_index: SeriesTree_Cohorts_Cohorts_Unrealized_GreedIndex = SeriesTree_Cohorts_Cohorts_Unrealized_GreedIndex(client) + self.net_sentiment: SeriesTree_Cohorts_Cohorts_Unrealized_NetSentiment = SeriesTree_Cohorts_Cohorts_Unrealized_NetSentiment(client) + self.nupl: SeriesTree_Cohorts_Cohorts_Unrealized_Nupl = SeriesTree_Cohorts_Cohorts_Unrealized_Nupl(client) + +class SeriesTree_Cohorts_Cohorts_CostBasis: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: InMaxMinPerSupplyPattern = InMaxMinPerSupplyPattern(client, 'all') + self.sth: InMaxMinPerSupplyPattern = InMaxMinPerSupplyPattern(client, 'sth') + self.lth: InMaxMinPerSupplyPattern = InMaxMinPerSupplyPattern(client, 'lth') + +class SeriesTree_Cohorts_Cohorts_Relative_Supply: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.in_profit: SharePattern2 = SharePattern2(client, 'supply_in_profit_share') + self.in_loss: SharePattern2 = SharePattern2(client, 'supply_in_loss_share') + +class SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit_ToOwnMcap: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'sth_unrealized_profit_to_own_mcap') + self.long: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'lth_unrealized_profit_to_own_mcap') + self.height: SeriesPattern18[PartsPerMillion32] = SeriesPattern18(client, 'unrealized_profit_to_own_mcap_ppm_by_term') + +class SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.to_mcap: AllLthSthPattern5 = AllLthSthPattern5(client, 'unrealized_profit_to_mcap') + self.to_own_mcap: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit_ToOwnMcap = SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit_ToOwnMcap(client) + self.to_own_gross_pnl: AllLthSthPattern5 = AllLthSthPattern5(client, 'unrealized_profit_to_own_gross_pnl') + +class SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss_ToOwnMcap: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'sth_unrealized_loss_to_own_mcap') + self.long: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'lth_unrealized_loss_to_own_mcap') + self.height: SeriesPattern18[PartsPerMillion32] = SeriesPattern18(client, 'unrealized_loss_to_own_mcap_ppm_by_term') + +class SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.to_mcap: AllLthSthPattern5 = AllLthSthPattern5(client, 'unrealized_loss_to_mcap') + self.to_own_mcap: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss_ToOwnMcap = SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss_ToOwnMcap(client) + self.to_own_gross_pnl: AllLthSthPattern5 = AllLthSthPattern5(client, 'unrealized_loss_to_own_gross_pnl') + +class SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnMcap: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.short: PercentPpmRatioPattern3 = PercentPpmRatioPattern3(client, 'sth_net_unrealized_pnl_to_own_mcap') + self.long: PercentPpmRatioPattern3 = PercentPpmRatioPattern3(client, 'lth_net_unrealized_pnl_to_own_mcap') + +class SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnGrossPnl: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: PercentPpmRatioPattern3 = PercentPpmRatioPattern3(client, 'all_net_unrealized_pnl_to_own_gross_pnl') + self.sth: PercentPpmRatioPattern3 = PercentPpmRatioPattern3(client, 'sth_net_unrealized_pnl_to_own_gross_pnl') + self.lth: PercentPpmRatioPattern3 = PercentPpmRatioPattern3(client, 'lth_net_unrealized_pnl_to_own_gross_pnl') + +class SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.to_own_mcap: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnMcap = SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnMcap(client) + self.to_own_gross_pnl: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnGrossPnl = SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl_ToOwnGrossPnl(client) + +class SeriesTree_Cohorts_Cohorts_Relative_Unrealized: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.profit: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit = SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Profit(client) + self.loss: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss = SeriesTree_Cohorts_Cohorts_Relative_Unrealized_Loss(client) + self.net_pnl: SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl = SeriesTree_Cohorts_Cohorts_Relative_Unrealized_NetPnl(client) + +class SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit_Share: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'all_invested_capital_in_profit_share') + self.sth: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'sth_invested_capital_in_profit_share') + self.lth: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'lth_invested_capital_in_profit_share') + self.height: SeriesPattern18[PartsPerMillion32] = SeriesPattern18(client, 'invested_capital_in_profit_share_ppm_by_aggregate') + +class SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.share: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit_Share = SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit_Share(client) + +class SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss_Share: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'all_invested_capital_in_loss_share') + self.sth: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'sth_invested_capital_in_loss_share') + self.lth: PercentPpmRatioPattern2 = PercentPpmRatioPattern2(client, 'lth_invested_capital_in_loss_share') + self.height: SeriesPattern18[PartsPerMillion32] = SeriesPattern18(client, 'invested_capital_in_loss_share_ppm_by_aggregate') + +class SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.share: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss_Share = SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss_Share(client) + +class SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.in_profit: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit = SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InProfit(client) + self.in_loss: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss = SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital_InLoss(client) + +class SeriesTree_Cohorts_Cohorts_Relative: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.supply: SeriesTree_Cohorts_Cohorts_Relative_Supply = SeriesTree_Cohorts_Cohorts_Relative_Supply(client) + self.unrealized: SeriesTree_Cohorts_Cohorts_Relative_Unrealized = SeriesTree_Cohorts_Cohorts_Relative_Unrealized(client) + self.invested_capital: SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital = SeriesTree_Cohorts_Cohorts_Relative_InvestedCapital(client) + +class SeriesTree_Cohorts_Cohorts_Profitability_Supply_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.over_1000pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_1000pct_in_profit') + self._500pct_to_1000pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_500pct_to_1000pct_in_profit') + self._300pct_to_500pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_300pct_to_500pct_in_profit') + self._200pct_to_300pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_200pct_to_300pct_in_profit') + self._100pct_to_200pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_100pct_to_200pct_in_profit') + self._90pct_to_100pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_90pct_to_100pct_in_profit') + self._80pct_to_90pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_80pct_to_90pct_in_profit') + self._70pct_to_80pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_70pct_to_80pct_in_profit') + self._60pct_to_70pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_60pct_to_70pct_in_profit') + self._50pct_to_60pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_50pct_to_60pct_in_profit') + self._40pct_to_50pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_40pct_to_50pct_in_profit') + self._30pct_to_40pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_30pct_to_40pct_in_profit') + self._20pct_to_30pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_20pct_to_30pct_in_profit') + self._10pct_to_20pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_10pct_to_20pct_in_profit') + self._0pct_to_10pct_in_profit: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_0pct_to_10pct_in_profit') + self._0pct_to_10pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_0pct_to_10pct_in_loss') + self._10pct_to_20pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_10pct_to_20pct_in_loss') + self._20pct_to_30pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_20pct_to_30pct_in_loss') + self._30pct_to_40pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_30pct_to_40pct_in_loss') + self._40pct_to_50pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_40pct_to_50pct_in_loss') + self._50pct_to_60pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_50pct_to_60pct_in_loss') + self._60pct_to_70pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_60pct_to_70pct_in_loss') + self._70pct_to_80pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_70pct_to_80pct_in_loss') + self._80pct_to_90pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_80pct_to_90pct_in_loss') + self._90pct_to_100pct_in_loss: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_90pct_to_100pct_in_loss') + +class SeriesTree_Cohorts_Cohorts_Profitability_Supply_Profit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_in_profit') + self._10pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_10pct_in_profit') + self._20pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_20pct_in_profit') + self._30pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_30pct_in_profit') + self._40pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_40pct_in_profit') + self._50pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_50pct_in_profit') + self._60pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_60pct_in_profit') + self._70pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_70pct_in_profit') + self._80pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_80pct_in_profit') + self._90pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_90pct_in_profit') + self._100pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_100pct_in_profit') + self._200pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_200pct_in_profit') + self._300pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_300pct_in_profit') + self._500pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_500pct_in_profit') + +class SeriesTree_Cohorts_Cohorts_Profitability_Supply_Loss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_in_loss') + self._10pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_10pct_in_loss') + self._20pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_20pct_in_loss') + self._30pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_30pct_in_loss') + self._40pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_40pct_in_loss') + self._50pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_50pct_in_loss') + self._60pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_60pct_in_loss') + self._70pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_70pct_in_loss') + self._80pct: AllLthSthPattern4 = AllLthSthPattern4(client, 'utxos_over_80pct_in_loss') + +class SeriesTree_Cohorts_Cohorts_Profitability_Supply: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Profitability_Supply_Range = SeriesTree_Cohorts_Cohorts_Profitability_Supply_Range(client) + self.profit: SeriesTree_Cohorts_Cohorts_Profitability_Supply_Profit = SeriesTree_Cohorts_Cohorts_Profitability_Supply_Profit(client) + self.loss: SeriesTree_Cohorts_Cohorts_Profitability_Supply_Loss = SeriesTree_Cohorts_Cohorts_Profitability_Supply_Loss(client) + self.height: SeriesPattern18[Sats] = SeriesPattern18(client, 'profitability_supply_sats_by_term_and_range') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_Over1000pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1000pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1000pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1000pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_500pctTo1000pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_500pct_to_1000pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_500pct_to_1000pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_500pct_to_1000pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_300pctTo500pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_300pct_to_500pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_300pct_to_500pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_300pct_to_500pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_200pctTo300pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_200pct_to_300pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_200pct_to_300pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_200pct_to_300pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_100pctTo200pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_100pct_to_200pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_100pct_to_200pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_100pct_to_200pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.over_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_Over1000pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_Over1000pctInProfit(client) + self._500pct_to_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_500pctTo1000pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_500pctTo1000pctInProfit(client) + self._300pct_to_500pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_300pctTo500pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_300pctTo500pctInProfit(client) + self._200pct_to_300pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_200pctTo300pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_200pctTo300pctInProfit(client) + self._100pct_to_200pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_100pctTo200pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_100pctTo200pctInProfit(client) + self._90pct_to_100pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInProfit(client) + self._80pct_to_90pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInProfit(client) + self._70pct_to_80pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInProfit(client) + self._60pct_to_70pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInProfit(client) + self._50pct_to_60pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInProfit(client) + self._40pct_to_50pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInProfit(client) + self._30pct_to_40pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInProfit(client) + self._20pct_to_30pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInProfit(client) + self._10pct_to_20pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInProfit(client) + self._0pct_to_10pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInProfit(client) + self._0pct_to_10pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_0pctTo10pctInLoss(client) + self._10pct_to_20pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_10pctTo20pctInLoss(client) + self._20pct_to_30pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_20pctTo30pctInLoss(client) + self._30pct_to_40pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_30pctTo40pctInLoss(client) + self._40pct_to_50pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_40pctTo50pctInLoss(client) + self._50pct_to_60pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_50pctTo60pctInLoss(client) + self._60pct_to_70pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_60pctTo70pctInLoss(client) + self._70pct_to_80pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_70pctTo80pctInLoss(client) + self._80pct_to_90pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_80pctTo90pctInLoss(client) + self._90pct_to_100pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range_90pctTo100pctInLoss(client) + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_All: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_10pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_20pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_30pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_40pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_50pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_60pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_70pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_80pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_90pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_90pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_90pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_90pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_100pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_100pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_100pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_100pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_200pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_200pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_200pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_200pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_300pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_300pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_300pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_300pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_500pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_500pct_in_profit_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_500pct_in_profit_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_500pct_in_profit_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_All = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_All(client) + self._10pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_10pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_10pct(client) + self._20pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_20pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_20pct(client) + self._30pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_30pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_30pct(client) + self._40pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_40pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_40pct(client) + self._50pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_50pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_50pct(client) + self._60pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_60pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_60pct(client) + self._70pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_70pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_70pct(client) + self._80pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_80pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_80pct(client) + self._90pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_90pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_90pct(client) + self._100pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_100pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_100pct(client) + self._200pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_200pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_200pct(client) + self._300pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_300pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_300pct(client) + self._500pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_500pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit_500pct(client) + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_All: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_10pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_20pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_30pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_40pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_50pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_60pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_70pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_80pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_loss_realized_cap') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_loss_sth_realized_cap') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_loss_lth_realized_cap') + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_All = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_All(client) + self._10pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_10pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_10pct(client) + self._20pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_20pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_20pct(client) + self._30pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_30pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_30pct(client) + self._40pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_40pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_40pct(client) + self._50pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_50pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_50pct(client) + self._60pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_60pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_60pct(client) + self._70pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_70pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_70pct(client) + self._80pct: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_80pct = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss_80pct(client) + +class SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Range(client) + self.profit: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Profit(client) + self.loss: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap_Loss(client) + self.height: SeriesPattern18[Dollars] = SeriesPattern18(client, 'profitability_realized_cap_by_term_and_range') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_Over1000pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1000pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1000pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_1000pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_500pctTo1000pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_500pct_to_1000pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_500pct_to_1000pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_500pct_to_1000pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_300pctTo500pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_300pct_to_500pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_300pct_to_500pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_300pct_to_500pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_200pctTo300pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_200pct_to_300pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_200pct_to_300pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_200pct_to_300pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_100pctTo200pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_100pct_to_200pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_100pct_to_200pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_100pct_to_200pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInProfit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_0pct_to_10pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_10pct_to_20pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_20pct_to_30pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_30pct_to_40pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_40pct_to_50pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_50pct_to_60pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_60pct_to_70pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_70pct_to_80pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_80pct_to_90pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInLoss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_90pct_to_100pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.over_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_Over1000pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_Over1000pctInProfit(client) + self._500pct_to_1000pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_500pctTo1000pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_500pctTo1000pctInProfit(client) + self._300pct_to_500pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_300pctTo500pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_300pctTo500pctInProfit(client) + self._200pct_to_300pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_200pctTo300pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_200pctTo300pctInProfit(client) + self._100pct_to_200pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_100pctTo200pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_100pctTo200pctInProfit(client) + self._90pct_to_100pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInProfit(client) + self._80pct_to_90pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInProfit(client) + self._70pct_to_80pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInProfit(client) + self._60pct_to_70pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInProfit(client) + self._50pct_to_60pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInProfit(client) + self._40pct_to_50pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInProfit(client) + self._30pct_to_40pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInProfit(client) + self._20pct_to_30pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInProfit(client) + self._10pct_to_20pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInProfit(client) + self._0pct_to_10pct_in_profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInProfit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInProfit(client) + self._0pct_to_10pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_0pctTo10pctInLoss(client) + self._10pct_to_20pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_10pctTo20pctInLoss(client) + self._20pct_to_30pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_20pctTo30pctInLoss(client) + self._30pct_to_40pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_30pctTo40pctInLoss(client) + self._40pct_to_50pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_40pctTo50pctInLoss(client) + self._50pct_to_60pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_50pctTo60pctInLoss(client) + self._60pct_to_70pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_60pctTo70pctInLoss(client) + self._70pct_to_80pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_70pctTo80pctInLoss(client) + self._80pct_to_90pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_80pctTo90pctInLoss(client) + self._90pct_to_100pct_in_loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInLoss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range_90pctTo100pctInLoss(client) + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_All: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_10pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_20pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_30pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_40pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_50pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_60pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_70pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_80pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_90pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_90pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_90pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_90pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_100pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_100pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_100pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_100pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_200pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_200pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_200pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_200pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_300pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_300pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_300pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_300pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_500pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_500pct_in_profit_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_500pct_in_profit_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_500pct_in_profit_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_All = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_All(client) + self._10pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_10pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_10pct(client) + self._20pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_20pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_20pct(client) + self._30pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_30pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_30pct(client) + self._40pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_40pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_40pct(client) + self._50pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_50pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_50pct(client) + self._60pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_60pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_60pct(client) + self._70pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_70pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_70pct(client) + self._80pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_80pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_80pct(client) + self._90pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_90pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_90pct(client) + self._100pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_100pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_100pct(client) + self._200pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_200pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_200pct(client) + self._300pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_300pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_300pct(client) + self._500pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_500pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit_500pct(client) + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_All: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_10pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_10pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_20pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_20pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_30pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_30pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_40pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_40pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_50pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_50pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_60pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_60pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_70pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_70pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_80pct: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_loss_unrealized_pnl') + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_loss_sth_unrealized_pnl') + self.lth: SeriesPattern1[Dollars] = SeriesPattern1(client, 'utxos_over_80pct_in_loss_lth_unrealized_pnl') + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_All = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_All(client) + self._10pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_10pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_10pct(client) + self._20pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_20pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_20pct(client) + self._30pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_30pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_30pct(client) + self._40pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_40pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_40pct(client) + self._50pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_50pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_50pct(client) + self._60pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_60pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_60pct(client) + self._70pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_70pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_70pct(client) + self._80pct: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_80pct = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss_80pct(client) + +class SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Range(client) + self.profit: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Profit(client) + self.loss: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl_Loss(client) + self.height: SeriesPattern18[Dollars] = SeriesPattern18(client, 'profitability_unrealized_pnl_by_term_and_range') + +class SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Range: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.over_1000pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_1000pct_in_profit_nupl') + self._500pct_to_1000pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_500pct_to_1000pct_in_profit_nupl') + self._300pct_to_500pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_300pct_to_500pct_in_profit_nupl') + self._200pct_to_300pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_200pct_to_300pct_in_profit_nupl') + self._100pct_to_200pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_100pct_to_200pct_in_profit_nupl') + self._90pct_to_100pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_90pct_to_100pct_in_profit_nupl') + self._80pct_to_90pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_80pct_to_90pct_in_profit_nupl') + self._70pct_to_80pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_70pct_to_80pct_in_profit_nupl') + self._60pct_to_70pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_60pct_to_70pct_in_profit_nupl') + self._50pct_to_60pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_50pct_to_60pct_in_profit_nupl') + self._40pct_to_50pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_40pct_to_50pct_in_profit_nupl') + self._30pct_to_40pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_30pct_to_40pct_in_profit_nupl') + self._20pct_to_30pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_20pct_to_30pct_in_profit_nupl') + self._10pct_to_20pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_10pct_to_20pct_in_profit_nupl') + self._0pct_to_10pct_in_profit: PpmRatioPattern = PpmRatioPattern(client, 'utxos_0pct_to_10pct_in_profit_nupl') + self._0pct_to_10pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_0pct_to_10pct_in_loss_nupl') + self._10pct_to_20pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_10pct_to_20pct_in_loss_nupl') + self._20pct_to_30pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_20pct_to_30pct_in_loss_nupl') + self._30pct_to_40pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_30pct_to_40pct_in_loss_nupl') + self._40pct_to_50pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_40pct_to_50pct_in_loss_nupl') + self._50pct_to_60pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_50pct_to_60pct_in_loss_nupl') + self._60pct_to_70pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_60pct_to_70pct_in_loss_nupl') + self._70pct_to_80pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_70pct_to_80pct_in_loss_nupl') + self._80pct_to_90pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_80pct_to_90pct_in_loss_nupl') + self._90pct_to_100pct_in_loss: PpmRatioPattern = PpmRatioPattern(client, 'utxos_90pct_to_100pct_in_loss_nupl') + +class SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Profit: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: PpmRatioPattern = PpmRatioPattern(client, 'utxos_in_profit_nupl') + self._10pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_10pct_in_profit_nupl') + self._20pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_20pct_in_profit_nupl') + self._30pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_30pct_in_profit_nupl') + self._40pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_40pct_in_profit_nupl') + self._50pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_50pct_in_profit_nupl') + self._60pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_60pct_in_profit_nupl') + self._70pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_70pct_in_profit_nupl') + self._80pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_80pct_in_profit_nupl') + self._90pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_90pct_in_profit_nupl') + self._100pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_100pct_in_profit_nupl') + self._200pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_200pct_in_profit_nupl') + self._300pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_300pct_in_profit_nupl') + self._500pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_500pct_in_profit_nupl') + +class SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Loss: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.all: PpmRatioPattern = PpmRatioPattern(client, 'utxos_in_loss_nupl') + self._10pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_10pct_in_loss_nupl') + self._20pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_20pct_in_loss_nupl') + self._30pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_30pct_in_loss_nupl') + self._40pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_40pct_in_loss_nupl') + self._50pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_50pct_in_loss_nupl') + self._60pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_60pct_in_loss_nupl') + self._70pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_70pct_in_loss_nupl') + self._80pct: PpmRatioPattern = PpmRatioPattern(client, 'utxos_over_80pct_in_loss_nupl') + +class SeriesTree_Cohorts_Cohorts_Profitability_Nupl: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.range: SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Range = SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Range(client) + self.profit: SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Profit = SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Profit(client) + self.loss: SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Loss = SeriesTree_Cohorts_Cohorts_Profitability_Nupl_Loss(client) + self.height: SeriesPattern18[PartsPerMillionSigned32] = SeriesPattern18(client, 'profitability_nupl_ppm') + +class SeriesTree_Cohorts_Cohorts_Profitability: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.supply: SeriesTree_Cohorts_Cohorts_Profitability_Supply = SeriesTree_Cohorts_Cohorts_Profitability_Supply(client) + self.realized_cap: SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap = SeriesTree_Cohorts_Cohorts_Profitability_RealizedCap(client) + self.unrealized_pnl: SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl = SeriesTree_Cohorts_Cohorts_Profitability_UnrealizedPnl(client) + self.nupl: SeriesTree_Cohorts_Cohorts_Profitability_Nupl = SeriesTree_Cohorts_Cohorts_Profitability_Nupl(client) + +class SeriesTree_Cohorts_Cohorts: + """Series tree node.""" + + def __init__(self, client: BrkClient, base_path: str = ''): + self.supply: SeriesTree_Cohorts_Cohorts_Supply = SeriesTree_Cohorts_Cohorts_Supply(client) + self.outputs: SeriesTree_Cohorts_Cohorts_Outputs = SeriesTree_Cohorts_Cohorts_Outputs(client) + self.activity: SeriesTree_Cohorts_Cohorts_Activity = SeriesTree_Cohorts_Cohorts_Activity(client) + self.realized: SeriesTree_Cohorts_Cohorts_Realized = SeriesTree_Cohorts_Cohorts_Realized(client) + self.unrealized: SeriesTree_Cohorts_Cohorts_Unrealized = SeriesTree_Cohorts_Cohorts_Unrealized(client) + self.cost_basis: SeriesTree_Cohorts_Cohorts_CostBasis = SeriesTree_Cohorts_Cohorts_CostBasis(client) + self.relative: SeriesTree_Cohorts_Cohorts_Relative = SeriesTree_Cohorts_Cohorts_Relative(client) + self.profitability: SeriesTree_Cohorts_Cohorts_Profitability = SeriesTree_Cohorts_Cohorts_Profitability(client) class SeriesTree_Cohorts: """Series tree node.""" def __init__(self, client: BrkClient, base_path: str = ''): - self.utxo: SeriesTree_Cohorts_Utxo = SeriesTree_Cohorts_Utxo(client) - self.addr: SeriesTree_Cohorts_Addr = SeriesTree_Cohorts_Addr(client) + self.cohorts: SeriesTree_Cohorts_Cohorts = SeriesTree_Cohorts_Cohorts(client) class SeriesTree_Cointime_Activity: """Series tree node.""" diff --git a/website/llms-full.txt b/website/llms-full.txt index 3842c779f..f656c9705 100644 --- a/website/llms-full.txt +++ b/website/llms-full.txt @@ -5,7 +5,7 @@ - Version: `v0.11.2` - Base URL: https://bitview.space - MCP endpoint: https://mcp.bitview.space/ -- Metrics: 58115 +- Metrics: 60744 - Operations: 97 For machine-readable tool construction, use [https://bitview.space/openapi.json](https://bitview.space/openapi.json). For the complete source-derived series tree, use [https://bitview.space/api/series](https://bitview.space/api/series). diff --git a/website/llms.txt b/website/llms.txt index eb7d89dc4..73120c2d8 100644 --- a/website/llms.txt +++ b/website/llms.txt @@ -1,6 +1,6 @@ # Bitcoin Research Kit (BRK) -> Free, open-source Bitcoin analytics API and block explorer. 58115 on-chain time-series and 97 API operations. No authentication required. +> Free, open-source Bitcoin analytics API and block explorer. 60744 on-chain time-series and 97 API operations. No authentication required. ## API diff --git a/website/scripts/options/distribution/data.js b/website/scripts/options/distribution/data.js index 585f0fd43..6f8b42366 100644 --- a/website/scripts/options/distribution/data.js +++ b/website/scripts/options/distribution/data.js @@ -90,7 +90,7 @@ export function buildCohortData() { const ageRange = ageRanges.map(({ key, ...range }) => ({ ...range, tree: utxoCohorts.ageRange[key], - matured: utxoCohorts.matured[key], + matured: utxoCohorts.supply.matured[key], })); const epoch = entries(EPOCH_NAMES).map(([key, names], i, arr) => ({ @@ -117,7 +117,7 @@ export function buildCohortData() { title: `Addresses ${names.long}`, color: colors.at(i, arr.length), tree: cohort, - addressCount: cohort.addrCount, + addressCount: addrs.funded.balance.over[key], }; }, ); @@ -139,7 +139,7 @@ export function buildCohortData() { title: `Addresses ${names.long}`, color: colors.at(i, arr.length), tree: cohort, - addressCount: cohort.addrCount, + addressCount: addrs.funded.balance.under[key], }; }, ); @@ -161,7 +161,7 @@ export function buildCohortData() { title: `Addresses ${names.long}`, color: colors.at(i, arr.length), tree: cohort, - addressCount: cohort.addrCount, + addressCount: addrs.funded.balance.range[key], }; }, ); @@ -216,13 +216,19 @@ export function buildCohortData() { tree: utxoCohorts.entry[key], })); - const { range, profit, loss } = utxoCohorts.profitability; + const profitability = utxoCohorts.profitability; + const profitabilityPattern = (group, key) => ({ + supply: profitability.supply[group][key], + realizedCap: profitability.realizedCap[group][key], + unrealizedPnl: profitability.unrealizedPnl[group][key], + nupl: profitability.nupl[group][key], + }); const profitabilityRange = entries(PROFITABILITY_RANGE_NAMES).map( ([key, names], i, arr) => ({ name: names.short, color: colors.at(i, arr.length), - pattern: range[key], + pattern: profitabilityPattern("range", key), }), ); @@ -230,14 +236,14 @@ export function buildCohortData() { ([key, names], i, arr) => ({ name: names.short, color: colors.at(i, arr.length), - pattern: profit[key], + pattern: profitabilityPattern("profit", key), }), ); const profitabilityLoss = entries(LOSS_NAMES).map(([key, names], i, arr) => ({ name: names.short, color: colors.at(i, arr.length), - pattern: loss[key], + pattern: profitabilityPattern("loss", key), })); return { diff --git a/website_next/learn/data/address-count.js b/website_next/learn/data/address-count.js index 51520b49c..410cbcf21 100644 --- a/website_next/learn/data/address-count.js +++ b/website_next/learn/data/address-count.js @@ -66,7 +66,7 @@ export const stateSeries = createCohortSeries([ export const balanceSeries = createCohortSeriesFromKeys( amountRanges, - (key) => (client) => client.series.cohorts.addr.amountRange[key].addrCount.base, + (key) => (client) => client.series.addrs.funded.balance.range[key].base, ); export const typeSeries = createCohortSeriesFromKeys( diff --git a/website_next/learn/data/capitalization.js b/website_next/learn/data/capitalization.js index 53bb32367..ac7994342 100644 --- a/website_next/learn/data/capitalization.js +++ b/website_next/learn/data/capitalization.js @@ -35,13 +35,13 @@ export const marketCapProfitabilitySeries = createCohortSeries([ label: "In profit", color: colors.green, metric: (client) => - client.series.cohorts.utxo.profitability.profit.all.supply.all.usd, + client.series.cohorts.utxo.profitability.supply.profit.all.all.usd, }, { label: "In loss", color: colors.red, metric: (client) => - client.series.cohorts.utxo.profitability.loss.all.supply.all.usd, + client.series.cohorts.utxo.profitability.supply.loss.all.all.usd, }, ]); @@ -50,13 +50,13 @@ export const realizedCapProfitabilitySeries = createCohortSeries([ label: "In profit", color: colors.green, metric: (client) => - client.series.cohorts.utxo.profitability.profit.all.realizedCap.all, + client.series.cohorts.utxo.profitability.realizedCap.profit.all.all, }, { label: "In loss", color: colors.red, metric: (client) => - client.series.cohorts.utxo.profitability.loss.all.realizedCap.all, + client.series.cohorts.utxo.profitability.realizedCap.loss.all.all, }, ]); diff --git a/website_next/learn/data/supply.js b/website_next/learn/data/supply.js index cf3cc7432..03c1a9e54 100644 --- a/website_next/learn/data/supply.js +++ b/website_next/learn/data/supply.js @@ -14,12 +14,12 @@ export const supplyProfitabilitySeries = createCohortSeries([ label: "In profit", color: colors.green, metric: (client) => - client.series.cohorts.utxo.profitability.profit.all.supply.all.btc, + client.series.cohorts.utxo.profitability.supply.profit.all.all.btc, }, { label: "In loss", color: colors.red, metric: (client) => - client.series.cohorts.utxo.profitability.loss.all.supply.all.btc, + client.series.cohorts.utxo.profitability.supply.loss.all.all.btc, }, ]); diff --git a/website_next/llms-full.txt b/website_next/llms-full.txt index 3842c779f..f656c9705 100644 --- a/website_next/llms-full.txt +++ b/website_next/llms-full.txt @@ -5,7 +5,7 @@ - Version: `v0.11.2` - Base URL: https://bitview.space - MCP endpoint: https://mcp.bitview.space/ -- Metrics: 58115 +- Metrics: 60744 - Operations: 97 For machine-readable tool construction, use [https://bitview.space/openapi.json](https://bitview.space/openapi.json). For the complete source-derived series tree, use [https://bitview.space/api/series](https://bitview.space/api/series). diff --git a/website_next/llms.txt b/website_next/llms.txt index eb7d89dc4..73120c2d8 100644 --- a/website_next/llms.txt +++ b/website_next/llms.txt @@ -1,6 +1,6 @@ # Bitcoin Research Kit (BRK) -> Free, open-source Bitcoin analytics API and block explorer. 58115 on-chain time-series and 97 API operations. No authentication required. +> Free, open-source Bitcoin analytics API and block explorer. 60744 on-chain time-series and 97 API operations. No authentication required. ## API