diff --git a/Cargo.lock b/Cargo.lock index fc65e264a..dc554bb1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -561,23 +561,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "brk_playground" -version = "0.1.0-beta.0" -dependencies = [ - "brk_computer", - "brk_error", - "brk_fetcher", - "brk_indexer", - "brk_logger", - "brk_types", - "jiff", - "memmap2", - "plotters", - "tracing", - "vecdb", -] - [[package]] name = "brk_query" version = "0.1.0-beta.0" diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 764e369a7..322f01206 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -1532,42 +1532,6 @@ impl PeriodLumpSumStackPattern { } } -/// Pattern struct for repeated tree structure. -pub struct ClassAveragePricePattern { - pub _2015: MetricPattern4, - pub _2016: MetricPattern4, - pub _2017: MetricPattern4, - pub _2018: MetricPattern4, - pub _2019: MetricPattern4, - pub _2020: MetricPattern4, - pub _2021: MetricPattern4, - pub _2022: MetricPattern4, - pub _2023: MetricPattern4, - pub _2024: MetricPattern4, - pub _2025: MetricPattern4, - pub _2026: MetricPattern4, -} - -impl ClassAveragePricePattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - _2015: MetricPattern4::new(client.clone(), _m(&acc, "2015_returns")), - _2016: MetricPattern4::new(client.clone(), _m(&acc, "2016_returns")), - _2017: MetricPattern4::new(client.clone(), _m(&acc, "2017_returns")), - _2018: MetricPattern4::new(client.clone(), _m(&acc, "2018_returns")), - _2019: MetricPattern4::new(client.clone(), _m(&acc, "2019_returns")), - _2020: MetricPattern4::new(client.clone(), _m(&acc, "2020_returns")), - _2021: MetricPattern4::new(client.clone(), _m(&acc, "2021_returns")), - _2022: MetricPattern4::new(client.clone(), _m(&acc, "2022_returns")), - _2023: MetricPattern4::new(client.clone(), _m(&acc, "2023_returns")), - _2024: MetricPattern4::new(client.clone(), _m(&acc, "2024_returns")), - _2025: MetricPattern4::new(client.clone(), _m(&acc, "2025_returns")), - _2026: MetricPattern4::new(client.clone(), _m(&acc, "2026_returns")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct PeriodAveragePricePattern { pub _10y: MetricPattern4, @@ -1604,6 +1568,42 @@ impl PeriodAveragePricePattern { } } +/// Pattern struct for repeated tree structure. +pub struct ClassAveragePricePattern { + pub _2015: MetricPattern4, + pub _2016: MetricPattern4, + pub _2017: MetricPattern4, + pub _2018: MetricPattern4, + pub _2019: MetricPattern4, + pub _2020: MetricPattern4, + pub _2021: MetricPattern4, + pub _2022: MetricPattern4, + pub _2023: MetricPattern4, + pub _2024: MetricPattern4, + pub _2025: MetricPattern4, + pub _2026: MetricPattern4, +} + +impl ClassAveragePricePattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _2015: MetricPattern4::new(client.clone(), _m(&acc, "2015_average_price")), + _2016: MetricPattern4::new(client.clone(), _m(&acc, "2016_average_price")), + _2017: MetricPattern4::new(client.clone(), _m(&acc, "2017_average_price")), + _2018: MetricPattern4::new(client.clone(), _m(&acc, "2018_average_price")), + _2019: MetricPattern4::new(client.clone(), _m(&acc, "2019_average_price")), + _2020: MetricPattern4::new(client.clone(), _m(&acc, "2020_average_price")), + _2021: MetricPattern4::new(client.clone(), _m(&acc, "2021_average_price")), + _2022: MetricPattern4::new(client.clone(), _m(&acc, "2022_average_price")), + _2023: MetricPattern4::new(client.clone(), _m(&acc, "2023_average_price")), + _2024: MetricPattern4::new(client.clone(), _m(&acc, "2024_average_price")), + _2025: MetricPattern4::new(client.clone(), _m(&acc, "2025_average_price")), + _2026: MetricPattern4::new(client.clone(), _m(&acc, "2026_average_price")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct BitcoinPattern { pub average: MetricPattern2, @@ -1914,6 +1914,58 @@ impl PhaseDailyCentsPattern { } } +/// Pattern struct for repeated tree structure. +pub struct _100btcPattern { + pub activity: ActivityPattern2, + pub cost_basis: CostBasisPattern, + pub outputs: OutputsPattern, + pub realized: RealizedPattern, + pub relative: RelativePattern, + pub supply: SupplyPattern2, + pub unrealized: UnrealizedPattern, +} + +impl _100btcPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + activity: ActivityPattern2::new(client.clone(), acc.clone()), + cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), + outputs: OutputsPattern::new(client.clone(), _m(&acc, "utxo_count")), + realized: RealizedPattern::new(client.clone(), acc.clone()), + relative: RelativePattern::new(client.clone(), acc.clone()), + supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), + unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct PeriodCagrPattern { + pub _10y: MetricPattern4, + pub _2y: MetricPattern4, + pub _3y: MetricPattern4, + pub _4y: MetricPattern4, + pub _5y: MetricPattern4, + pub _6y: MetricPattern4, + pub _8y: MetricPattern4, +} + +impl PeriodCagrPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _10y: MetricPattern4::new(client.clone(), _p("10y", &acc)), + _2y: MetricPattern4::new(client.clone(), _p("2y", &acc)), + _3y: MetricPattern4::new(client.clone(), _p("3y", &acc)), + _4y: MetricPattern4::new(client.clone(), _p("4y", &acc)), + _5y: MetricPattern4::new(client.clone(), _p("5y", &acc)), + _6y: MetricPattern4::new(client.clone(), _p("6y", &acc)), + _8y: MetricPattern4::new(client.clone(), _p("8y", &acc)), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _0satsPattern2 { pub activity: ActivityPattern2, @@ -1966,32 +2018,6 @@ impl _10yTo12yPattern { } } -/// Pattern struct for repeated tree structure. -pub struct PeriodCagrPattern { - pub _10y: MetricPattern4, - pub _2y: MetricPattern4, - pub _3y: MetricPattern4, - pub _4y: MetricPattern4, - pub _5y: MetricPattern4, - pub _6y: MetricPattern4, - pub _8y: MetricPattern4, -} - -impl PeriodCagrPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - _10y: MetricPattern4::new(client.clone(), _p("10y", &acc)), - _2y: MetricPattern4::new(client.clone(), _p("2y", &acc)), - _3y: MetricPattern4::new(client.clone(), _p("3y", &acc)), - _4y: MetricPattern4::new(client.clone(), _p("4y", &acc)), - _5y: MetricPattern4::new(client.clone(), _p("5y", &acc)), - _6y: MetricPattern4::new(client.clone(), _p("6y", &acc)), - _8y: MetricPattern4::new(client.clone(), _p("8y", &acc)), - } - } -} - /// Pattern struct for repeated tree structure. pub struct UnrealizedPattern { pub neg_unrealized_loss: MetricPattern1, @@ -2044,32 +2070,6 @@ impl _10yPattern { } } -/// Pattern struct for repeated tree structure. -pub struct _100btcPattern { - pub activity: ActivityPattern2, - pub cost_basis: CostBasisPattern, - pub outputs: OutputsPattern, - pub realized: RealizedPattern, - pub relative: RelativePattern, - pub supply: SupplyPattern2, - pub unrealized: UnrealizedPattern, -} - -impl _100btcPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: ActivityPattern2::new(client.clone(), acc.clone()), - cost_basis: CostBasisPattern::new(client.clone(), acc.clone()), - outputs: OutputsPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: RealizedPattern::new(client.clone(), acc.clone()), - relative: RelativePattern::new(client.clone(), acc.clone()), - supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")), - unrealized: UnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct ActivityPattern2 { pub coinblocks_destroyed: BlockCountPattern, @@ -2112,24 +2112,6 @@ impl SplitPattern2 { } } -/// Pattern struct for repeated tree structure. -pub struct _2015Pattern { - pub bitcoin: MetricPattern4, - pub dollars: MetricPattern4, - pub sats: MetricPattern4, -} - -impl _2015Pattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - bitcoin: MetricPattern4::new(client.clone(), _m(&acc, "btc")), - dollars: MetricPattern4::new(client.clone(), _m(&acc, "usd")), - sats: MetricPattern4::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct CostBasisPattern2 { pub max: MetricPattern1, @@ -2184,24 +2166,6 @@ impl CoinbasePattern2 { } } -/// Pattern struct for repeated tree structure. -pub struct SegwitAdoptionPattern { - pub base: MetricPattern11, - pub cumulative: MetricPattern2, - pub sum: MetricPattern2, -} - -impl SegwitAdoptionPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - base: MetricPattern11::new(client.clone(), acc.clone()), - cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), - sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct ActiveSupplyPattern { pub bitcoin: MetricPattern1, @@ -2220,6 +2184,24 @@ impl ActiveSupplyPattern { } } +/// Pattern struct for repeated tree structure. +pub struct SegwitAdoptionPattern { + pub base: MetricPattern11, + pub cumulative: MetricPattern2, + pub sum: MetricPattern2, +} + +impl SegwitAdoptionPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + base: MetricPattern11::new(client.clone(), acc.clone()), + cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), + sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct UnclaimedRewardsPattern { pub bitcoin: BitcoinPattern2, @@ -2238,6 +2220,24 @@ impl UnclaimedRewardsPattern { } } +/// Pattern struct for repeated tree structure. +pub struct _2015Pattern { + pub bitcoin: MetricPattern4, + pub dollars: MetricPattern4, + pub sats: MetricPattern4, +} + +impl _2015Pattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + bitcoin: MetricPattern4::new(client.clone(), _m(&acc, "btc")), + dollars: MetricPattern4::new(client.clone(), _m(&acc, "usd")), + sats: MetricPattern4::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct SupplyPattern2 { pub halved: ActiveSupplyPattern, @@ -2303,17 +2303,17 @@ impl _1dReturns1mSdPattern { } /// Pattern struct for repeated tree structure. -pub struct SatsPattern { - pub ohlc: MetricPattern1, - pub split: SplitPattern2, +pub struct BitcoinPattern2 { + pub cumulative: MetricPattern2, + pub sum: MetricPattern1, } -impl SatsPattern { +impl BitcoinPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - ohlc: MetricPattern1::new(client.clone(), _m(&acc, "ohlc")), - split: SplitPattern2::new(client.clone(), acc.clone()), + cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), + sum: MetricPattern1::new(client.clone(), acc.clone()), } } } @@ -2335,17 +2335,17 @@ impl BlockCountPattern { } /// Pattern struct for repeated tree structure. -pub struct BitcoinPattern2 { - pub cumulative: MetricPattern2, - pub sum: MetricPattern1, +pub struct SatsPattern { + pub ohlc: MetricPattern1, + pub split: SplitPattern2, } -impl BitcoinPattern2 { +impl SatsPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), - sum: MetricPattern1::new(client.clone(), acc.clone()), + ohlc: MetricPattern1::new(client.clone(), _m(&acc, "ohlc")), + split: SplitPattern2::new(client.clone(), acc.clone()), } } } @@ -3019,19 +3019,19 @@ pub struct MetricsTree_Distribution_AddressCohorts_GeAmount { impl MetricsTree_Distribution_AddressCohorts_GeAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _100btc: _0satsPattern::new(client.clone(), "addrs_above_100btc".to_string()), - _100k_sats: _0satsPattern::new(client.clone(), "addrs_above_100k_sats".to_string()), - _100sats: _0satsPattern::new(client.clone(), "addrs_above_100sats".to_string()), - _10btc: _0satsPattern::new(client.clone(), "addrs_above_10btc".to_string()), - _10k_btc: _0satsPattern::new(client.clone(), "addrs_above_10k_btc".to_string()), - _10k_sats: _0satsPattern::new(client.clone(), "addrs_above_10k_sats".to_string()), - _10m_sats: _0satsPattern::new(client.clone(), "addrs_above_10m_sats".to_string()), - _10sats: _0satsPattern::new(client.clone(), "addrs_above_10sats".to_string()), - _1btc: _0satsPattern::new(client.clone(), "addrs_above_1btc".to_string()), - _1k_btc: _0satsPattern::new(client.clone(), "addrs_above_1k_btc".to_string()), - _1k_sats: _0satsPattern::new(client.clone(), "addrs_above_1k_sats".to_string()), - _1m_sats: _0satsPattern::new(client.clone(), "addrs_above_1m_sats".to_string()), - _1sat: _0satsPattern::new(client.clone(), "addrs_above_1sat".to_string()), + _100btc: _0satsPattern::new(client.clone(), "addrs_over_100btc".to_string()), + _100k_sats: _0satsPattern::new(client.clone(), "addrs_over_100k_sats".to_string()), + _100sats: _0satsPattern::new(client.clone(), "addrs_over_100sats".to_string()), + _10btc: _0satsPattern::new(client.clone(), "addrs_over_10btc".to_string()), + _10k_btc: _0satsPattern::new(client.clone(), "addrs_over_10k_btc".to_string()), + _10k_sats: _0satsPattern::new(client.clone(), "addrs_over_10k_sats".to_string()), + _10m_sats: _0satsPattern::new(client.clone(), "addrs_over_10m_sats".to_string()), + _10sats: _0satsPattern::new(client.clone(), "addrs_over_10sats".to_string()), + _1btc: _0satsPattern::new(client.clone(), "addrs_over_1btc".to_string()), + _1k_btc: _0satsPattern::new(client.clone(), "addrs_over_1k_btc".to_string()), + _1k_sats: _0satsPattern::new(client.clone(), "addrs_over_1k_sats".to_string()), + _1m_sats: _0satsPattern::new(client.clone(), "addrs_over_1m_sats".to_string()), + _1sat: _0satsPattern::new(client.clone(), "addrs_over_1sat".to_string()), } } } @@ -3176,27 +3176,27 @@ pub struct MetricsTree_Distribution_UtxoCohorts_AgeRange { impl MetricsTree_Distribution_UtxoCohorts_AgeRange { pub fn new(client: Arc, base_path: String) -> Self { Self { - _10y_to_12y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_10y_up_to_12y_old".to_string()), - _12y_to_15y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_12y_up_to_15y_old".to_string()), - _1d_to_1w: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1d_up_to_1w_old".to_string()), - _1h_to_1d: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1h_up_to_1d_old".to_string()), - _1m_to_2m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1m_up_to_2m_old".to_string()), - _1w_to_1m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1w_up_to_1m_old".to_string()), - _1y_to_2y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_1y_up_to_2y_old".to_string()), - _2m_to_3m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_2m_up_to_3m_old".to_string()), - _2y_to_3y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_2y_up_to_3y_old".to_string()), - _3m_to_4m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_3m_up_to_4m_old".to_string()), - _3y_to_4y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_3y_up_to_4y_old".to_string()), - _4m_to_5m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_4m_up_to_5m_old".to_string()), - _4y_to_5y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_4y_up_to_5y_old".to_string()), - _5m_to_6m: _10yTo12yPattern::new(client.clone(), "utxos_at_least_5m_up_to_6m_old".to_string()), - _5y_to_6y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_5y_up_to_6y_old".to_string()), - _6m_to_1y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_6m_up_to_1y_old".to_string()), - _6y_to_7y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_6y_up_to_7y_old".to_string()), - _7y_to_8y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_7y_up_to_8y_old".to_string()), - _8y_to_10y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_8y_up_to_10y_old".to_string()), - from_15y: _10yTo12yPattern::new(client.clone(), "utxos_at_least_15y_old".to_string()), - up_to_1h: _10yTo12yPattern::new(client.clone(), "utxos_up_to_1h_old".to_string()), + _10y_to_12y: _10yTo12yPattern::new(client.clone(), "utxos_10y_to_12y_old".to_string()), + _12y_to_15y: _10yTo12yPattern::new(client.clone(), "utxos_12y_to_15y_old".to_string()), + _1d_to_1w: _10yTo12yPattern::new(client.clone(), "utxos_1d_to_1w_old".to_string()), + _1h_to_1d: _10yTo12yPattern::new(client.clone(), "utxos_1h_to_1d_old".to_string()), + _1m_to_2m: _10yTo12yPattern::new(client.clone(), "utxos_1m_to_2m_old".to_string()), + _1w_to_1m: _10yTo12yPattern::new(client.clone(), "utxos_1w_to_1m_old".to_string()), + _1y_to_2y: _10yTo12yPattern::new(client.clone(), "utxos_1y_to_2y_old".to_string()), + _2m_to_3m: _10yTo12yPattern::new(client.clone(), "utxos_2m_to_3m_old".to_string()), + _2y_to_3y: _10yTo12yPattern::new(client.clone(), "utxos_2y_to_3y_old".to_string()), + _3m_to_4m: _10yTo12yPattern::new(client.clone(), "utxos_3m_to_4m_old".to_string()), + _3y_to_4y: _10yTo12yPattern::new(client.clone(), "utxos_3y_to_4y_old".to_string()), + _4m_to_5m: _10yTo12yPattern::new(client.clone(), "utxos_4m_to_5m_old".to_string()), + _4y_to_5y: _10yTo12yPattern::new(client.clone(), "utxos_4y_to_5y_old".to_string()), + _5m_to_6m: _10yTo12yPattern::new(client.clone(), "utxos_5m_to_6m_old".to_string()), + _5y_to_6y: _10yTo12yPattern::new(client.clone(), "utxos_5y_to_6y_old".to_string()), + _6m_to_1y: _10yTo12yPattern::new(client.clone(), "utxos_6m_to_1y_old".to_string()), + _6y_to_7y: _10yTo12yPattern::new(client.clone(), "utxos_6y_to_7y_old".to_string()), + _7y_to_8y: _10yTo12yPattern::new(client.clone(), "utxos_7y_to_8y_old".to_string()), + _8y_to_10y: _10yTo12yPattern::new(client.clone(), "utxos_8y_to_10y_old".to_string()), + from_15y: _10yTo12yPattern::new(client.clone(), "utxos_over_15y_old".to_string()), + up_to_1h: _10yTo12yPattern::new(client.clone(), "utxos_under_1h_old".to_string()), } } } @@ -3348,19 +3348,19 @@ pub struct MetricsTree_Distribution_UtxoCohorts_GeAmount { impl MetricsTree_Distribution_UtxoCohorts_GeAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _100btc: _100btcPattern::new(client.clone(), "utxos_above_100btc".to_string()), - _100k_sats: _100btcPattern::new(client.clone(), "utxos_above_100k_sats".to_string()), - _100sats: _100btcPattern::new(client.clone(), "utxos_above_100sats".to_string()), - _10btc: _100btcPattern::new(client.clone(), "utxos_above_10btc".to_string()), - _10k_btc: _100btcPattern::new(client.clone(), "utxos_above_10k_btc".to_string()), - _10k_sats: _100btcPattern::new(client.clone(), "utxos_above_10k_sats".to_string()), - _10m_sats: _100btcPattern::new(client.clone(), "utxos_above_10m_sats".to_string()), - _10sats: _100btcPattern::new(client.clone(), "utxos_above_10sats".to_string()), - _1btc: _100btcPattern::new(client.clone(), "utxos_above_1btc".to_string()), - _1k_btc: _100btcPattern::new(client.clone(), "utxos_above_1k_btc".to_string()), - _1k_sats: _100btcPattern::new(client.clone(), "utxos_above_1k_sats".to_string()), - _1m_sats: _100btcPattern::new(client.clone(), "utxos_above_1m_sats".to_string()), - _1sat: _100btcPattern::new(client.clone(), "utxos_above_1sat".to_string()), + _100btc: _100btcPattern::new(client.clone(), "utxos_over_100btc".to_string()), + _100k_sats: _100btcPattern::new(client.clone(), "utxos_over_100k_sats".to_string()), + _100sats: _100btcPattern::new(client.clone(), "utxos_over_100sats".to_string()), + _10btc: _100btcPattern::new(client.clone(), "utxos_over_10btc".to_string()), + _10k_btc: _100btcPattern::new(client.clone(), "utxos_over_10k_btc".to_string()), + _10k_sats: _100btcPattern::new(client.clone(), "utxos_over_10k_sats".to_string()), + _10m_sats: _100btcPattern::new(client.clone(), "utxos_over_10m_sats".to_string()), + _10sats: _100btcPattern::new(client.clone(), "utxos_over_10sats".to_string()), + _1btc: _100btcPattern::new(client.clone(), "utxos_over_1btc".to_string()), + _1k_btc: _100btcPattern::new(client.clone(), "utxos_over_1k_btc".to_string()), + _1k_sats: _100btcPattern::new(client.clone(), "utxos_over_1k_sats".to_string()), + _1m_sats: _100btcPattern::new(client.clone(), "utxos_over_1m_sats".to_string()), + _1sat: _100btcPattern::new(client.clone(), "utxos_over_1sat".to_string()), } } } @@ -3427,24 +3427,24 @@ pub struct MetricsTree_Distribution_UtxoCohorts_MaxAge { impl MetricsTree_Distribution_UtxoCohorts_MaxAge { pub fn new(client: Arc, base_path: String) -> Self { Self { - _10y: _10yPattern::new(client.clone(), "utxos_up_to_10y_old".to_string()), - _12y: _10yPattern::new(client.clone(), "utxos_up_to_12y_old".to_string()), - _15y: _10yPattern::new(client.clone(), "utxos_up_to_15y_old".to_string()), - _1m: _10yPattern::new(client.clone(), "utxos_up_to_1m_old".to_string()), - _1w: _10yPattern::new(client.clone(), "utxos_up_to_1w_old".to_string()), - _1y: _10yPattern::new(client.clone(), "utxos_up_to_1y_old".to_string()), - _2m: _10yPattern::new(client.clone(), "utxos_up_to_2m_old".to_string()), - _2y: _10yPattern::new(client.clone(), "utxos_up_to_2y_old".to_string()), - _3m: _10yPattern::new(client.clone(), "utxos_up_to_3m_old".to_string()), - _3y: _10yPattern::new(client.clone(), "utxos_up_to_3y_old".to_string()), - _4m: _10yPattern::new(client.clone(), "utxos_up_to_4m_old".to_string()), - _4y: _10yPattern::new(client.clone(), "utxos_up_to_4y_old".to_string()), - _5m: _10yPattern::new(client.clone(), "utxos_up_to_5m_old".to_string()), - _5y: _10yPattern::new(client.clone(), "utxos_up_to_5y_old".to_string()), - _6m: _10yPattern::new(client.clone(), "utxos_up_to_6m_old".to_string()), - _6y: _10yPattern::new(client.clone(), "utxos_up_to_6y_old".to_string()), - _7y: _10yPattern::new(client.clone(), "utxos_up_to_7y_old".to_string()), - _8y: _10yPattern::new(client.clone(), "utxos_up_to_8y_old".to_string()), + _10y: _10yPattern::new(client.clone(), "utxos_under_10y_old".to_string()), + _12y: _10yPattern::new(client.clone(), "utxos_under_12y_old".to_string()), + _15y: _10yPattern::new(client.clone(), "utxos_under_15y_old".to_string()), + _1m: _10yPattern::new(client.clone(), "utxos_under_1m_old".to_string()), + _1w: _10yPattern::new(client.clone(), "utxos_under_1w_old".to_string()), + _1y: _10yPattern::new(client.clone(), "utxos_under_1y_old".to_string()), + _2m: _10yPattern::new(client.clone(), "utxos_under_2m_old".to_string()), + _2y: _10yPattern::new(client.clone(), "utxos_under_2y_old".to_string()), + _3m: _10yPattern::new(client.clone(), "utxos_under_3m_old".to_string()), + _3y: _10yPattern::new(client.clone(), "utxos_under_3y_old".to_string()), + _4m: _10yPattern::new(client.clone(), "utxos_under_4m_old".to_string()), + _4y: _10yPattern::new(client.clone(), "utxos_under_4y_old".to_string()), + _5m: _10yPattern::new(client.clone(), "utxos_under_5m_old".to_string()), + _5y: _10yPattern::new(client.clone(), "utxos_under_5y_old".to_string()), + _6m: _10yPattern::new(client.clone(), "utxos_under_6m_old".to_string()), + _6y: _10yPattern::new(client.clone(), "utxos_under_6y_old".to_string()), + _7y: _10yPattern::new(client.clone(), "utxos_under_7y_old".to_string()), + _8y: _10yPattern::new(client.clone(), "utxos_under_8y_old".to_string()), } } } @@ -3474,24 +3474,24 @@ pub struct MetricsTree_Distribution_UtxoCohorts_MinAge { impl MetricsTree_Distribution_UtxoCohorts_MinAge { pub fn new(client: Arc, base_path: String) -> Self { Self { - _10y: _100btcPattern::new(client.clone(), "utxos_at_least_10y_old".to_string()), - _12y: _100btcPattern::new(client.clone(), "utxos_at_least_12y_old".to_string()), - _1d: _100btcPattern::new(client.clone(), "utxos_at_least_1d_old".to_string()), - _1m: _100btcPattern::new(client.clone(), "utxos_at_least_1m_old".to_string()), - _1w: _100btcPattern::new(client.clone(), "utxos_at_least_1w_old".to_string()), - _1y: _100btcPattern::new(client.clone(), "utxos_at_least_1y_old".to_string()), - _2m: _100btcPattern::new(client.clone(), "utxos_at_least_2m_old".to_string()), - _2y: _100btcPattern::new(client.clone(), "utxos_at_least_2y_old".to_string()), - _3m: _100btcPattern::new(client.clone(), "utxos_at_least_3m_old".to_string()), - _3y: _100btcPattern::new(client.clone(), "utxos_at_least_3y_old".to_string()), - _4m: _100btcPattern::new(client.clone(), "utxos_at_least_4m_old".to_string()), - _4y: _100btcPattern::new(client.clone(), "utxos_at_least_4y_old".to_string()), - _5m: _100btcPattern::new(client.clone(), "utxos_at_least_5m_old".to_string()), - _5y: _100btcPattern::new(client.clone(), "utxos_at_least_5y_old".to_string()), - _6m: _100btcPattern::new(client.clone(), "utxos_at_least_6m_old".to_string()), - _6y: _100btcPattern::new(client.clone(), "utxos_at_least_6y_old".to_string()), - _7y: _100btcPattern::new(client.clone(), "utxos_at_least_7y_old".to_string()), - _8y: _100btcPattern::new(client.clone(), "utxos_at_least_8y_old".to_string()), + _10y: _100btcPattern::new(client.clone(), "utxos_over_10y_old".to_string()), + _12y: _100btcPattern::new(client.clone(), "utxos_over_12y_old".to_string()), + _1d: _100btcPattern::new(client.clone(), "utxos_over_1d_old".to_string()), + _1m: _100btcPattern::new(client.clone(), "utxos_over_1m_old".to_string()), + _1w: _100btcPattern::new(client.clone(), "utxos_over_1w_old".to_string()), + _1y: _100btcPattern::new(client.clone(), "utxos_over_1y_old".to_string()), + _2m: _100btcPattern::new(client.clone(), "utxos_over_2m_old".to_string()), + _2y: _100btcPattern::new(client.clone(), "utxos_over_2y_old".to_string()), + _3m: _100btcPattern::new(client.clone(), "utxos_over_3m_old".to_string()), + _3y: _100btcPattern::new(client.clone(), "utxos_over_3y_old".to_string()), + _4m: _100btcPattern::new(client.clone(), "utxos_over_4m_old".to_string()), + _4y: _100btcPattern::new(client.clone(), "utxos_over_4y_old".to_string()), + _5m: _100btcPattern::new(client.clone(), "utxos_over_5m_old".to_string()), + _5y: _100btcPattern::new(client.clone(), "utxos_over_5y_old".to_string()), + _6m: _100btcPattern::new(client.clone(), "utxos_over_6m_old".to_string()), + _6y: _100btcPattern::new(client.clone(), "utxos_over_6y_old".to_string()), + _7y: _100btcPattern::new(client.clone(), "utxos_over_7y_old".to_string()), + _8y: _100btcPattern::new(client.clone(), "utxos_over_8y_old".to_string()), } } } @@ -4204,8 +4204,8 @@ impl MetricsTree_Market_Ath { /// Metrics tree node. pub struct MetricsTree_Market_Dca { - pub class_average_price: MetricsTree_Market_Dca_ClassAveragePrice, - pub class_returns: ClassAveragePricePattern, + pub class_average_price: ClassAveragePricePattern, + pub class_returns: MetricsTree_Market_Dca_ClassReturns, pub class_stack: MetricsTree_Market_Dca_ClassStack, pub period_average_price: PeriodAveragePricePattern, pub period_cagr: PeriodCagrPattern, @@ -4217,8 +4217,8 @@ pub struct MetricsTree_Market_Dca { impl MetricsTree_Market_Dca { pub fn new(client: Arc, base_path: String) -> Self { Self { - class_average_price: MetricsTree_Market_Dca_ClassAveragePrice::new(client.clone(), format!("{base_path}_class_average_price")), - class_returns: ClassAveragePricePattern::new(client.clone(), "dca_class".to_string()), + class_average_price: ClassAveragePricePattern::new(client.clone(), "dca_class".to_string()), + class_returns: MetricsTree_Market_Dca_ClassReturns::new(client.clone(), format!("{base_path}_class_returns")), class_stack: MetricsTree_Market_Dca_ClassStack::new(client.clone(), format!("{base_path}_class_stack")), period_average_price: PeriodAveragePricePattern::new(client.clone(), "dca_average_price".to_string()), period_cagr: PeriodCagrPattern::new(client.clone(), "dca_cagr".to_string()), @@ -4230,36 +4230,36 @@ impl MetricsTree_Market_Dca { } /// Metrics tree node. -pub struct MetricsTree_Market_Dca_ClassAveragePrice { - pub _2015: MetricPattern4, - pub _2016: MetricPattern4, - pub _2017: MetricPattern4, - pub _2018: MetricPattern4, - pub _2019: MetricPattern4, - pub _2020: MetricPattern4, - pub _2021: MetricPattern4, - pub _2022: MetricPattern4, - pub _2023: MetricPattern4, - pub _2024: MetricPattern4, - pub _2025: MetricPattern4, - pub _2026: MetricPattern4, +pub struct MetricsTree_Market_Dca_ClassReturns { + pub _2015: MetricPattern4, + pub _2016: MetricPattern4, + pub _2017: MetricPattern4, + pub _2018: MetricPattern4, + pub _2019: MetricPattern4, + pub _2020: MetricPattern4, + pub _2021: MetricPattern4, + pub _2022: MetricPattern4, + pub _2023: MetricPattern4, + pub _2024: MetricPattern4, + pub _2025: MetricPattern4, + pub _2026: MetricPattern4, } -impl MetricsTree_Market_Dca_ClassAveragePrice { +impl MetricsTree_Market_Dca_ClassReturns { pub fn new(client: Arc, base_path: String) -> Self { Self { - _2015: MetricPattern4::new(client.clone(), "dca_class_2015_average_price".to_string()), - _2016: MetricPattern4::new(client.clone(), "dca_class_2016_average_price".to_string()), - _2017: MetricPattern4::new(client.clone(), "dca_class_2017_average_price".to_string()), - _2018: MetricPattern4::new(client.clone(), "dca_class_2018_average_price".to_string()), - _2019: MetricPattern4::new(client.clone(), "dca_class_2019_average_price".to_string()), - _2020: MetricPattern4::new(client.clone(), "dca_class_2020_average_price".to_string()), - _2021: MetricPattern4::new(client.clone(), "dca_class_2021_average_price".to_string()), - _2022: MetricPattern4::new(client.clone(), "dca_class_2022_average_price".to_string()), - _2023: MetricPattern4::new(client.clone(), "dca_class_2023_average_price".to_string()), - _2024: MetricPattern4::new(client.clone(), "dca_class_2024_average_price".to_string()), - _2025: MetricPattern4::new(client.clone(), "dca_class_2025_average_price".to_string()), - _2026: MetricPattern4::new(client.clone(), "dca_class_2026_average_price".to_string()), + _2015: MetricPattern4::new(client.clone(), "dca_class_2015_returns".to_string()), + _2016: MetricPattern4::new(client.clone(), "dca_class_2016_returns".to_string()), + _2017: MetricPattern4::new(client.clone(), "dca_class_2017_returns".to_string()), + _2018: MetricPattern4::new(client.clone(), "dca_class_2018_returns".to_string()), + _2019: MetricPattern4::new(client.clone(), "dca_class_2019_returns".to_string()), + _2020: MetricPattern4::new(client.clone(), "dca_class_2020_returns".to_string()), + _2021: MetricPattern4::new(client.clone(), "dca_class_2021_returns".to_string()), + _2022: MetricPattern4::new(client.clone(), "dca_class_2022_returns".to_string()), + _2023: MetricPattern4::new(client.clone(), "dca_class_2023_returns".to_string()), + _2024: MetricPattern4::new(client.clone(), "dca_class_2024_returns".to_string()), + _2025: MetricPattern4::new(client.clone(), "dca_class_2025_returns".to_string()), + _2026: MetricPattern4::new(client.clone(), "dca_class_2026_returns".to_string()), } } } @@ -5337,7 +5337,7 @@ impl MetricsTree_Transactions_Fees { /// Metrics tree node. pub struct MetricsTree_Transactions_Fees_Fee { pub bitcoin: CountPattern2, - pub dollars: MetricsTree_Transactions_Fees_Fee_Dollars, + pub dollars: CountPattern2, pub sats: CountPattern2, pub txindex: MetricPattern27, } @@ -5346,46 +5346,13 @@ impl MetricsTree_Transactions_Fees_Fee { pub fn new(client: Arc, base_path: String) -> Self { Self { bitcoin: CountPattern2::new(client.clone(), "fee_btc".to_string()), - dollars: MetricsTree_Transactions_Fees_Fee_Dollars::new(client.clone(), format!("{base_path}_dollars")), + dollars: CountPattern2::new(client.clone(), "fee_usd".to_string()), sats: CountPattern2::new(client.clone(), "fee".to_string()), txindex: MetricPattern27::new(client.clone(), "fee".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Transactions_Fees_Fee_Dollars { - pub average: MetricPattern1, - pub cumulative: MetricPattern2, - pub height_cumulative: MetricPattern11, - pub max: MetricPattern1, - pub median: MetricPattern11, - pub min: MetricPattern1, - pub pct10: MetricPattern11, - pub pct25: MetricPattern11, - pub pct75: MetricPattern11, - pub pct90: MetricPattern11, - pub sum: MetricPattern1, -} - -impl MetricsTree_Transactions_Fees_Fee_Dollars { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - average: MetricPattern1::new(client.clone(), "fee_usd_average".to_string()), - cumulative: MetricPattern2::new(client.clone(), "fee_usd_cumulative".to_string()), - height_cumulative: MetricPattern11::new(client.clone(), "fee_usd_cumulative".to_string()), - max: MetricPattern1::new(client.clone(), "fee_usd_max".to_string()), - median: MetricPattern11::new(client.clone(), "fee_usd_median".to_string()), - min: MetricPattern1::new(client.clone(), "fee_usd_min".to_string()), - pct10: MetricPattern11::new(client.clone(), "fee_usd_pct10".to_string()), - pct25: MetricPattern11::new(client.clone(), "fee_usd_pct25".to_string()), - pct75: MetricPattern11::new(client.clone(), "fee_usd_pct75".to_string()), - pct90: MetricPattern11::new(client.clone(), "fee_usd_pct90".to_string()), - sum: MetricPattern1::new(client.clone(), "fee_usd_sum".to_string()), - } - } -} - /// Metrics tree node. pub struct MetricsTree_Transactions_Size { pub vsize: FeeRatePattern, diff --git a/crates/brk_computer/src/internal/multi/from_tx/value_dollars.rs b/crates/brk_computer/src/internal/multi/from_tx/value_dollars.rs index 2fbb11bd7..466e6b0ec 100644 --- a/crates/brk_computer/src/internal/multi/from_tx/value_dollars.rs +++ b/crates/brk_computer/src/internal/multi/from_tx/value_dollars.rs @@ -43,6 +43,7 @@ pub struct ValueDollarsFromTxFull { pub txindex: LazyDollarsTxIndex, #[traversable(flatten)] pub height: LazyDollarsHeightFull, + #[traversable(rename = "cumulative")] pub height_cumulative: CumulativeVec, pub difficultyepoch: LazyFull, pub dateindex: Stats, diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 958e7150d..a51392745 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -1931,47 +1931,6 @@ function createPeriodLumpSumStackPattern(client, acc) { }; } -/** - * @template T - * @typedef {Object} ClassAveragePricePattern - * @property {MetricPattern4} _2015 - * @property {MetricPattern4} _2016 - * @property {MetricPattern4} _2017 - * @property {MetricPattern4} _2018 - * @property {MetricPattern4} _2019 - * @property {MetricPattern4} _2020 - * @property {MetricPattern4} _2021 - * @property {MetricPattern4} _2022 - * @property {MetricPattern4} _2023 - * @property {MetricPattern4} _2024 - * @property {MetricPattern4} _2025 - * @property {MetricPattern4} _2026 - */ - -/** - * Create a ClassAveragePricePattern pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {ClassAveragePricePattern} - */ -function createClassAveragePricePattern(client, acc) { - return { - _2015: createMetricPattern4(client, _m(acc, '2015_returns')), - _2016: createMetricPattern4(client, _m(acc, '2016_returns')), - _2017: createMetricPattern4(client, _m(acc, '2017_returns')), - _2018: createMetricPattern4(client, _m(acc, '2018_returns')), - _2019: createMetricPattern4(client, _m(acc, '2019_returns')), - _2020: createMetricPattern4(client, _m(acc, '2020_returns')), - _2021: createMetricPattern4(client, _m(acc, '2021_returns')), - _2022: createMetricPattern4(client, _m(acc, '2022_returns')), - _2023: createMetricPattern4(client, _m(acc, '2023_returns')), - _2024: createMetricPattern4(client, _m(acc, '2024_returns')), - _2025: createMetricPattern4(client, _m(acc, '2025_returns')), - _2026: createMetricPattern4(client, _m(acc, '2026_returns')), - }; -} - /** * @template T * @typedef {Object} PeriodAveragePricePattern @@ -2013,6 +1972,47 @@ function createPeriodAveragePricePattern(client, acc) { }; } +/** + * @template T + * @typedef {Object} ClassAveragePricePattern + * @property {MetricPattern4} _2015 + * @property {MetricPattern4} _2016 + * @property {MetricPattern4} _2017 + * @property {MetricPattern4} _2018 + * @property {MetricPattern4} _2019 + * @property {MetricPattern4} _2020 + * @property {MetricPattern4} _2021 + * @property {MetricPattern4} _2022 + * @property {MetricPattern4} _2023 + * @property {MetricPattern4} _2024 + * @property {MetricPattern4} _2025 + * @property {MetricPattern4} _2026 + */ + +/** + * Create a ClassAveragePricePattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {ClassAveragePricePattern} + */ +function createClassAveragePricePattern(client, acc) { + return { + _2015: createMetricPattern4(client, _m(acc, '2015_average_price')), + _2016: createMetricPattern4(client, _m(acc, '2016_average_price')), + _2017: createMetricPattern4(client, _m(acc, '2017_average_price')), + _2018: createMetricPattern4(client, _m(acc, '2018_average_price')), + _2019: createMetricPattern4(client, _m(acc, '2019_average_price')), + _2020: createMetricPattern4(client, _m(acc, '2020_average_price')), + _2021: createMetricPattern4(client, _m(acc, '2021_average_price')), + _2022: createMetricPattern4(client, _m(acc, '2022_average_price')), + _2023: createMetricPattern4(client, _m(acc, '2023_average_price')), + _2024: createMetricPattern4(client, _m(acc, '2024_average_price')), + _2025: createMetricPattern4(client, _m(acc, '2025_average_price')), + _2026: createMetricPattern4(client, _m(acc, '2026_average_price')), + }; +} + /** * @typedef {Object} BitcoinPattern * @property {MetricPattern2} average @@ -2363,6 +2363,64 @@ function createPhaseDailyCentsPattern(client, acc) { }; } +/** + * @typedef {Object} _100btcPattern + * @property {ActivityPattern2} activity + * @property {CostBasisPattern} costBasis + * @property {OutputsPattern} outputs + * @property {RealizedPattern} realized + * @property {RelativePattern} relative + * @property {SupplyPattern2} supply + * @property {UnrealizedPattern} unrealized + */ + +/** + * Create a _100btcPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_100btcPattern} + */ +function create_100btcPattern(client, acc) { + return { + activity: createActivityPattern2(client, acc), + costBasis: createCostBasisPattern(client, acc), + outputs: createOutputsPattern(client, _m(acc, 'utxo_count')), + realized: createRealizedPattern(client, acc), + relative: createRelativePattern(client, acc), + supply: createSupplyPattern2(client, _m(acc, 'supply')), + unrealized: createUnrealizedPattern(client, acc), + }; +} + +/** + * @typedef {Object} PeriodCagrPattern + * @property {MetricPattern4} _10y + * @property {MetricPattern4} _2y + * @property {MetricPattern4} _3y + * @property {MetricPattern4} _4y + * @property {MetricPattern4} _5y + * @property {MetricPattern4} _6y + * @property {MetricPattern4} _8y + */ + +/** + * Create a PeriodCagrPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {PeriodCagrPattern} + */ +function createPeriodCagrPattern(client, acc) { + return { + _10y: createMetricPattern4(client, _p('10y', acc)), + _2y: createMetricPattern4(client, _p('2y', acc)), + _3y: createMetricPattern4(client, _p('3y', acc)), + _4y: createMetricPattern4(client, _p('4y', acc)), + _5y: createMetricPattern4(client, _p('5y', acc)), + _6y: createMetricPattern4(client, _p('6y', acc)), + _8y: createMetricPattern4(client, _p('8y', acc)), + }; +} + /** * @typedef {Object} _0satsPattern2 * @property {ActivityPattern2} activity @@ -2421,35 +2479,6 @@ function create_10yTo12yPattern(client, acc) { }; } -/** - * @typedef {Object} PeriodCagrPattern - * @property {MetricPattern4} _10y - * @property {MetricPattern4} _2y - * @property {MetricPattern4} _3y - * @property {MetricPattern4} _4y - * @property {MetricPattern4} _5y - * @property {MetricPattern4} _6y - * @property {MetricPattern4} _8y - */ - -/** - * Create a PeriodCagrPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {PeriodCagrPattern} - */ -function createPeriodCagrPattern(client, acc) { - return { - _10y: createMetricPattern4(client, _p('10y', acc)), - _2y: createMetricPattern4(client, _p('2y', acc)), - _3y: createMetricPattern4(client, _p('3y', acc)), - _4y: createMetricPattern4(client, _p('4y', acc)), - _5y: createMetricPattern4(client, _p('5y', acc)), - _6y: createMetricPattern4(client, _p('6y', acc)), - _8y: createMetricPattern4(client, _p('8y', acc)), - }; -} - /** * @typedef {Object} UnrealizedPattern * @property {MetricPattern1} negUnrealizedLoss @@ -2508,35 +2537,6 @@ function create_10yPattern(client, acc) { }; } -/** - * @typedef {Object} _100btcPattern - * @property {ActivityPattern2} activity - * @property {CostBasisPattern} costBasis - * @property {OutputsPattern} outputs - * @property {RealizedPattern} realized - * @property {RelativePattern} relative - * @property {SupplyPattern2} supply - * @property {UnrealizedPattern} unrealized - */ - -/** - * Create a _100btcPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_100btcPattern} - */ -function create_100btcPattern(client, acc) { - return { - activity: createActivityPattern2(client, acc), - costBasis: createCostBasisPattern(client, acc), - outputs: createOutputsPattern(client, _m(acc, 'utxo_count')), - realized: createRealizedPattern(client, acc), - relative: createRelativePattern(client, acc), - supply: createSupplyPattern2(client, _m(acc, 'supply')), - unrealized: createUnrealizedPattern(client, acc), - }; -} - /** * @typedef {Object} ActivityPattern2 * @property {BlockCountPattern} coinblocksDestroyed @@ -2587,27 +2587,6 @@ function createSplitPattern2(client, acc) { }; } -/** - * @typedef {Object} _2015Pattern - * @property {MetricPattern4} bitcoin - * @property {MetricPattern4} dollars - * @property {MetricPattern4} sats - */ - -/** - * Create a _2015Pattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_2015Pattern} - */ -function create_2015Pattern(client, acc) { - return { - bitcoin: createMetricPattern4(client, _m(acc, 'btc')), - dollars: createMetricPattern4(client, _m(acc, 'usd')), - sats: createMetricPattern4(client, acc), - }; -} - /** * @typedef {Object} CostBasisPattern2 * @property {MetricPattern1} max @@ -2671,27 +2650,6 @@ function createCoinbasePattern2(client, acc) { }; } -/** - * @typedef {Object} SegwitAdoptionPattern - * @property {MetricPattern11} base - * @property {MetricPattern2} cumulative - * @property {MetricPattern2} sum - */ - -/** - * Create a SegwitAdoptionPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {SegwitAdoptionPattern} - */ -function createSegwitAdoptionPattern(client, acc) { - return { - base: createMetricPattern11(client, acc), - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - sum: createMetricPattern2(client, _m(acc, 'sum')), - }; -} - /** * @typedef {Object} ActiveSupplyPattern * @property {MetricPattern1} bitcoin @@ -2713,6 +2671,27 @@ function createActiveSupplyPattern(client, acc) { }; } +/** + * @typedef {Object} SegwitAdoptionPattern + * @property {MetricPattern11} base + * @property {MetricPattern2} cumulative + * @property {MetricPattern2} sum + */ + +/** + * Create a SegwitAdoptionPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {SegwitAdoptionPattern} + */ +function createSegwitAdoptionPattern(client, acc) { + return { + base: createMetricPattern11(client, acc), + cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), + sum: createMetricPattern2(client, _m(acc, 'sum')), + }; +} + /** * @typedef {Object} UnclaimedRewardsPattern * @property {BitcoinPattern2} bitcoin @@ -2734,6 +2713,27 @@ function createUnclaimedRewardsPattern(client, acc) { }; } +/** + * @typedef {Object} _2015Pattern + * @property {MetricPattern4} bitcoin + * @property {MetricPattern4} dollars + * @property {MetricPattern4} sats + */ + +/** + * Create a _2015Pattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_2015Pattern} + */ +function create_2015Pattern(client, acc) { + return { + bitcoin: createMetricPattern4(client, _m(acc, 'btc')), + dollars: createMetricPattern4(client, _m(acc, 'usd')), + sats: createMetricPattern4(client, acc), + }; +} + /** * @typedef {Object} SupplyPattern2 * @property {ActiveSupplyPattern} halved @@ -2812,22 +2812,22 @@ function create_1dReturns1mSdPattern(client, acc) { /** * @template T - * @typedef {Object} SatsPattern - * @property {MetricPattern1} ohlc - * @property {SplitPattern2} split + * @typedef {Object} BitcoinPattern2 + * @property {MetricPattern2} cumulative + * @property {MetricPattern1} sum */ /** - * Create a SatsPattern pattern node + * Create a BitcoinPattern2 pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {SatsPattern} + * @returns {BitcoinPattern2} */ -function createSatsPattern(client, acc) { +function createBitcoinPattern2(client, acc) { return { - ohlc: createMetricPattern1(client, _m(acc, 'ohlc')), - split: createSplitPattern2(client, acc), + cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), + sum: createMetricPattern1(client, acc), }; } @@ -2854,22 +2854,22 @@ function createBlockCountPattern(client, acc) { /** * @template T - * @typedef {Object} BitcoinPattern2 - * @property {MetricPattern2} cumulative - * @property {MetricPattern1} sum + * @typedef {Object} SatsPattern + * @property {MetricPattern1} ohlc + * @property {SplitPattern2} split */ /** - * Create a BitcoinPattern2 pattern node + * Create a SatsPattern pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {BitcoinPattern2} + * @returns {SatsPattern} */ -function createBitcoinPattern2(client, acc) { +function createSatsPattern(client, acc) { return { - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - sum: createMetricPattern1(client, acc), + ohlc: createMetricPattern1(client, _m(acc, 'ohlc')), + split: createSplitPattern2(client, acc), }; } @@ -3711,8 +3711,8 @@ function createOutputsPattern(client, acc) { /** * @typedef {Object} MetricsTree_Market_Dca - * @property {MetricsTree_Market_Dca_ClassAveragePrice} classAveragePrice - * @property {ClassAveragePricePattern} classReturns + * @property {ClassAveragePricePattern} classAveragePrice + * @property {MetricsTree_Market_Dca_ClassReturns} classReturns * @property {MetricsTree_Market_Dca_ClassStack} classStack * @property {PeriodAveragePricePattern} periodAveragePrice * @property {PeriodCagrPattern} periodCagr @@ -3722,19 +3722,19 @@ function createOutputsPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Dca_ClassAveragePrice - * @property {MetricPattern4} _2015 - * @property {MetricPattern4} _2016 - * @property {MetricPattern4} _2017 - * @property {MetricPattern4} _2018 - * @property {MetricPattern4} _2019 - * @property {MetricPattern4} _2020 - * @property {MetricPattern4} _2021 - * @property {MetricPattern4} _2022 - * @property {MetricPattern4} _2023 - * @property {MetricPattern4} _2024 - * @property {MetricPattern4} _2025 - * @property {MetricPattern4} _2026 + * @typedef {Object} MetricsTree_Market_Dca_ClassReturns + * @property {MetricPattern4} _2015 + * @property {MetricPattern4} _2016 + * @property {MetricPattern4} _2017 + * @property {MetricPattern4} _2018 + * @property {MetricPattern4} _2019 + * @property {MetricPattern4} _2020 + * @property {MetricPattern4} _2021 + * @property {MetricPattern4} _2022 + * @property {MetricPattern4} _2023 + * @property {MetricPattern4} _2024 + * @property {MetricPattern4} _2025 + * @property {MetricPattern4} _2026 */ /** @@ -4233,26 +4233,11 @@ function createOutputsPattern(client, acc) { /** * @typedef {Object} MetricsTree_Transactions_Fees_Fee * @property {CountPattern2} bitcoin - * @property {MetricsTree_Transactions_Fees_Fee_Dollars} dollars + * @property {CountPattern2} dollars * @property {CountPattern2} sats * @property {MetricPattern27} txindex */ -/** - * @typedef {Object} MetricsTree_Transactions_Fees_Fee_Dollars - * @property {MetricPattern1} average - * @property {MetricPattern2} cumulative - * @property {MetricPattern11} heightCumulative - * @property {MetricPattern1} max - * @property {MetricPattern11} median - * @property {MetricPattern1} min - * @property {MetricPattern11} pct10 - * @property {MetricPattern11} pct25 - * @property {MetricPattern11} pct75 - * @property {MetricPattern11} pct90 - * @property {MetricPattern1} sum - */ - /** * @typedef {Object} MetricsTree_Transactions_Size * @property {FeeRatePattern} vsize @@ -4669,107 +4654,107 @@ class BrkClient extends BrkClientBase { AGE_RANGE_NAMES = /** @type {const} */ ({ "upTo1h": { - "id": "up_to_1h_old", + "id": "under_1h_old", "short": "<1h", - "long": "Up to 1 Hour Old" + "long": "Under 1 Hour Old" }, "_1hTo1d": { - "id": "at_least_1h_up_to_1d_old", + "id": "1h_to_1d_old", "short": "1h-1d", "long": "1 Hour to 1 Day Old" }, "_1dTo1w": { - "id": "at_least_1d_up_to_1w_old", + "id": "1d_to_1w_old", "short": "1d-1w", "long": "1 Day to 1 Week Old" }, "_1wTo1m": { - "id": "at_least_1w_up_to_1m_old", + "id": "1w_to_1m_old", "short": "1w-1m", "long": "1 Week to 1 Month Old" }, "_1mTo2m": { - "id": "at_least_1m_up_to_2m_old", + "id": "1m_to_2m_old", "short": "1m-2m", "long": "1 to 2 Months Old" }, "_2mTo3m": { - "id": "at_least_2m_up_to_3m_old", + "id": "2m_to_3m_old", "short": "2m-3m", "long": "2 to 3 Months Old" }, "_3mTo4m": { - "id": "at_least_3m_up_to_4m_old", + "id": "3m_to_4m_old", "short": "3m-4m", "long": "3 to 4 Months Old" }, "_4mTo5m": { - "id": "at_least_4m_up_to_5m_old", + "id": "4m_to_5m_old", "short": "4m-5m", "long": "4 to 5 Months Old" }, "_5mTo6m": { - "id": "at_least_5m_up_to_6m_old", + "id": "5m_to_6m_old", "short": "5m-6m", "long": "5 to 6 Months Old" }, "_6mTo1y": { - "id": "at_least_6m_up_to_1y_old", + "id": "6m_to_1y_old", "short": "6m-1y", "long": "6 Months to 1 Year Old" }, "_1yTo2y": { - "id": "at_least_1y_up_to_2y_old", + "id": "1y_to_2y_old", "short": "1y-2y", "long": "1 to 2 Years Old" }, "_2yTo3y": { - "id": "at_least_2y_up_to_3y_old", + "id": "2y_to_3y_old", "short": "2y-3y", "long": "2 to 3 Years Old" }, "_3yTo4y": { - "id": "at_least_3y_up_to_4y_old", + "id": "3y_to_4y_old", "short": "3y-4y", "long": "3 to 4 Years Old" }, "_4yTo5y": { - "id": "at_least_4y_up_to_5y_old", + "id": "4y_to_5y_old", "short": "4y-5y", "long": "4 to 5 Years Old" }, "_5yTo6y": { - "id": "at_least_5y_up_to_6y_old", + "id": "5y_to_6y_old", "short": "5y-6y", "long": "5 to 6 Years Old" }, "_6yTo7y": { - "id": "at_least_6y_up_to_7y_old", + "id": "6y_to_7y_old", "short": "6y-7y", "long": "6 to 7 Years Old" }, "_7yTo8y": { - "id": "at_least_7y_up_to_8y_old", + "id": "7y_to_8y_old", "short": "7y-8y", "long": "7 to 8 Years Old" }, "_8yTo10y": { - "id": "at_least_8y_up_to_10y_old", + "id": "8y_to_10y_old", "short": "8y-10y", "long": "8 to 10 Years Old" }, "_10yTo12y": { - "id": "at_least_10y_up_to_12y_old", + "id": "10y_to_12y_old", "short": "10y-12y", "long": "10 to 12 Years Old" }, "_12yTo15y": { - "id": "at_least_12y_up_to_15y_old", + "id": "12y_to_15y_old", "short": "12y-15y", "long": "12 to 15 Years Old" }, "from15y": { - "id": "at_least_15y_old", + "id": "over_15y_old", "short": "15y+", "long": "15+ Years Old" } @@ -4777,187 +4762,187 @@ class BrkClient extends BrkClientBase { MAX_AGE_NAMES = /** @type {const} */ ({ "_1w": { - "id": "up_to_1w_old", + "id": "under_1w_old", "short": "<1w", - "long": "Up to 1 Week Old" + "long": "Under 1 Week Old" }, "_1m": { - "id": "up_to_1m_old", + "id": "under_1m_old", "short": "<1m", - "long": "Up to 1 Month Old" + "long": "Under 1 Month Old" }, "_2m": { - "id": "up_to_2m_old", + "id": "under_2m_old", "short": "<2m", - "long": "Up to 2 Months Old" + "long": "Under 2 Months Old" }, "_3m": { - "id": "up_to_3m_old", + "id": "under_3m_old", "short": "<3m", - "long": "Up to 3 Months Old" + "long": "Under 3 Months Old" }, "_4m": { - "id": "up_to_4m_old", + "id": "under_4m_old", "short": "<4m", - "long": "Up to 4 Months Old" + "long": "Under 4 Months Old" }, "_5m": { - "id": "up_to_5m_old", + "id": "under_5m_old", "short": "<5m", - "long": "Up to 5 Months Old" + "long": "Under 5 Months Old" }, "_6m": { - "id": "up_to_6m_old", + "id": "under_6m_old", "short": "<6m", - "long": "Up to 6 Months Old" + "long": "Under 6 Months Old" }, "_1y": { - "id": "up_to_1y_old", + "id": "under_1y_old", "short": "<1y", - "long": "Up to 1 Year Old" + "long": "Under 1 Year Old" }, "_2y": { - "id": "up_to_2y_old", + "id": "under_2y_old", "short": "<2y", - "long": "Up to 2 Years Old" + "long": "Under 2 Years Old" }, "_3y": { - "id": "up_to_3y_old", + "id": "under_3y_old", "short": "<3y", - "long": "Up to 3 Years Old" + "long": "Under 3 Years Old" }, "_4y": { - "id": "up_to_4y_old", + "id": "under_4y_old", "short": "<4y", - "long": "Up to 4 Years Old" + "long": "Under 4 Years Old" }, "_5y": { - "id": "up_to_5y_old", + "id": "under_5y_old", "short": "<5y", - "long": "Up to 5 Years Old" + "long": "Under 5 Years Old" }, "_6y": { - "id": "up_to_6y_old", + "id": "under_6y_old", "short": "<6y", - "long": "Up to 6 Years Old" + "long": "Under 6 Years Old" }, "_7y": { - "id": "up_to_7y_old", + "id": "under_7y_old", "short": "<7y", - "long": "Up to 7 Years Old" + "long": "Under 7 Years Old" }, "_8y": { - "id": "up_to_8y_old", + "id": "under_8y_old", "short": "<8y", - "long": "Up to 8 Years Old" + "long": "Under 8 Years Old" }, "_10y": { - "id": "up_to_10y_old", + "id": "under_10y_old", "short": "<10y", - "long": "Up to 10 Years Old" + "long": "Under 10 Years Old" }, "_12y": { - "id": "up_to_12y_old", + "id": "under_12y_old", "short": "<12y", - "long": "Up to 12 Years Old" + "long": "Under 12 Years Old" }, "_15y": { - "id": "up_to_15y_old", + "id": "under_15y_old", "short": "<15y", - "long": "Up to 15 Years Old" + "long": "Under 15 Years Old" } }); MIN_AGE_NAMES = /** @type {const} */ ({ "_1d": { - "id": "at_least_1d_old", + "id": "over_1d_old", "short": "1d+", - "long": "At Least 1 Day Old" + "long": "Over 1 Day Old" }, "_1w": { - "id": "at_least_1w_old", + "id": "over_1w_old", "short": "1w+", - "long": "At Least 1 Week Old" + "long": "Over 1 Week Old" }, "_1m": { - "id": "at_least_1m_old", + "id": "over_1m_old", "short": "1m+", - "long": "At Least 1 Month Old" + "long": "Over 1 Month Old" }, "_2m": { - "id": "at_least_2m_old", + "id": "over_2m_old", "short": "2m+", - "long": "At Least 2 Months Old" + "long": "Over 2 Months Old" }, "_3m": { - "id": "at_least_3m_old", + "id": "over_3m_old", "short": "3m+", - "long": "At Least 3 Months Old" + "long": "Over 3 Months Old" }, "_4m": { - "id": "at_least_4m_old", + "id": "over_4m_old", "short": "4m+", - "long": "At Least 4 Months Old" + "long": "Over 4 Months Old" }, "_5m": { - "id": "at_least_5m_old", + "id": "over_5m_old", "short": "5m+", - "long": "At Least 5 Months Old" + "long": "Over 5 Months Old" }, "_6m": { - "id": "at_least_6m_old", + "id": "over_6m_old", "short": "6m+", - "long": "At Least 6 Months Old" + "long": "Over 6 Months Old" }, "_1y": { - "id": "at_least_1y_old", + "id": "over_1y_old", "short": "1y+", - "long": "At Least 1 Year Old" + "long": "Over 1 Year Old" }, "_2y": { - "id": "at_least_2y_old", + "id": "over_2y_old", "short": "2y+", - "long": "At Least 2 Years Old" + "long": "Over 2 Years Old" }, "_3y": { - "id": "at_least_3y_old", + "id": "over_3y_old", "short": "3y+", - "long": "At Least 3 Years Old" + "long": "Over 3 Years Old" }, "_4y": { - "id": "at_least_4y_old", + "id": "over_4y_old", "short": "4y+", - "long": "At Least 4 Years Old" + "long": "Over 4 Years Old" }, "_5y": { - "id": "at_least_5y_old", + "id": "over_5y_old", "short": "5y+", - "long": "At Least 5 Years Old" + "long": "Over 5 Years Old" }, "_6y": { - "id": "at_least_6y_old", + "id": "over_6y_old", "short": "6y+", - "long": "At Least 6 Years Old" + "long": "Over 6 Years Old" }, "_7y": { - "id": "at_least_7y_old", + "id": "over_7y_old", "short": "7y+", - "long": "At Least 7 Years Old" + "long": "Over 7 Years Old" }, "_8y": { - "id": "at_least_8y_old", + "id": "over_8y_old", "short": "8y+", - "long": "At Least 8 Years Old" + "long": "Over 8 Years Old" }, "_10y": { - "id": "at_least_10y_old", + "id": "over_10y_old", "short": "10y+", - "long": "At Least 10 Years Old" + "long": "Over 10 Years Old" }, "_12y": { - "id": "at_least_12y_old", + "id": "over_12y_old", "short": "12y+", - "long": "At Least 12 Years Old" + "long": "Over 12 Years Old" } }); @@ -5041,69 +5026,69 @@ class BrkClient extends BrkClientBase { GE_AMOUNT_NAMES = /** @type {const} */ ({ "_1sat": { - "id": "above_1sat", + "id": "over_1sat", "short": "1+ sats", - "long": "Above 1 Sat" + "long": "Over 1 Sat" }, "_10sats": { - "id": "above_10sats", + "id": "over_10sats", "short": "10+ sats", - "long": "Above 10 Sats" + "long": "Over 10 Sats" }, "_100sats": { - "id": "above_100sats", + "id": "over_100sats", "short": "100+ sats", - "long": "Above 100 Sats" + "long": "Over 100 Sats" }, "_1kSats": { - "id": "above_1k_sats", + "id": "over_1k_sats", "short": "1k+ sats", - "long": "Above 1K Sats" + "long": "Over 1K Sats" }, "_10kSats": { - "id": "above_10k_sats", + "id": "over_10k_sats", "short": "10k+ sats", - "long": "Above 10K Sats" + "long": "Over 10K Sats" }, "_100kSats": { - "id": "above_100k_sats", + "id": "over_100k_sats", "short": "100k+ sats", - "long": "Above 100K Sats" + "long": "Over 100K Sats" }, "_1mSats": { - "id": "above_1m_sats", + "id": "over_1m_sats", "short": "1M+ sats", - "long": "Above 1M Sats" + "long": "Over 1M Sats" }, "_10mSats": { - "id": "above_10m_sats", + "id": "over_10m_sats", "short": "0.1+ BTC", - "long": "Above 0.1 BTC" + "long": "Over 0.1 BTC" }, "_1btc": { - "id": "above_1btc", + "id": "over_1btc", "short": "1+ BTC", - "long": "Above 1 BTC" + "long": "Over 1 BTC" }, "_10btc": { - "id": "above_10btc", + "id": "over_10btc", "short": "10+ BTC", - "long": "Above 10 BTC" + "long": "Over 10 BTC" }, "_100btc": { - "id": "above_100btc", + "id": "over_100btc", "short": "100+ BTC", - "long": "Above 100 BTC" + "long": "Over 100 BTC" }, "_1kBtc": { - "id": "above_1k_btc", + "id": "over_1k_btc", "short": "1k+ BTC", - "long": "Above 1K BTC" + "long": "Over 1K BTC" }, "_10kBtc": { - "id": "above_10k_btc", + "id": "over_10k_btc", "short": "10k+ BTC", - "long": "Above 10K BTC" + "long": "Over 10K BTC" } }); @@ -5376,19 +5361,19 @@ class BrkClient extends BrkClientBase { _1satTo10sats: create_0satsPattern(this, 'addrs_above_1sat_under_10sats'), }, geAmount: { - _100btc: create_0satsPattern(this, 'addrs_above_100btc'), - _100kSats: create_0satsPattern(this, 'addrs_above_100k_sats'), - _100sats: create_0satsPattern(this, 'addrs_above_100sats'), - _10btc: create_0satsPattern(this, 'addrs_above_10btc'), - _10kBtc: create_0satsPattern(this, 'addrs_above_10k_btc'), - _10kSats: create_0satsPattern(this, 'addrs_above_10k_sats'), - _10mSats: create_0satsPattern(this, 'addrs_above_10m_sats'), - _10sats: create_0satsPattern(this, 'addrs_above_10sats'), - _1btc: create_0satsPattern(this, 'addrs_above_1btc'), - _1kBtc: create_0satsPattern(this, 'addrs_above_1k_btc'), - _1kSats: create_0satsPattern(this, 'addrs_above_1k_sats'), - _1mSats: create_0satsPattern(this, 'addrs_above_1m_sats'), - _1sat: create_0satsPattern(this, 'addrs_above_1sat'), + _100btc: create_0satsPattern(this, 'addrs_over_100btc'), + _100kSats: create_0satsPattern(this, 'addrs_over_100k_sats'), + _100sats: create_0satsPattern(this, 'addrs_over_100sats'), + _10btc: create_0satsPattern(this, 'addrs_over_10btc'), + _10kBtc: create_0satsPattern(this, 'addrs_over_10k_btc'), + _10kSats: create_0satsPattern(this, 'addrs_over_10k_sats'), + _10mSats: create_0satsPattern(this, 'addrs_over_10m_sats'), + _10sats: create_0satsPattern(this, 'addrs_over_10sats'), + _1btc: create_0satsPattern(this, 'addrs_over_1btc'), + _1kBtc: create_0satsPattern(this, 'addrs_over_1k_btc'), + _1kSats: create_0satsPattern(this, 'addrs_over_1k_sats'), + _1mSats: create_0satsPattern(this, 'addrs_over_1m_sats'), + _1sat: create_0satsPattern(this, 'addrs_over_1sat'), }, ltAmount: { _100btc: create_0satsPattern(this, 'addrs_under_100btc'), @@ -5426,27 +5411,27 @@ class BrkClient extends BrkClientBase { loadedaddressindex: createMetricPattern31(this, 'loadedaddressindex'), utxoCohorts: { ageRange: { - _10yTo12y: create_10yTo12yPattern(this, 'utxos_at_least_10y_up_to_12y_old'), - _12yTo15y: create_10yTo12yPattern(this, 'utxos_at_least_12y_up_to_15y_old'), - _1dTo1w: create_10yTo12yPattern(this, 'utxos_at_least_1d_up_to_1w_old'), - _1hTo1d: create_10yTo12yPattern(this, 'utxos_at_least_1h_up_to_1d_old'), - _1mTo2m: create_10yTo12yPattern(this, 'utxos_at_least_1m_up_to_2m_old'), - _1wTo1m: create_10yTo12yPattern(this, 'utxos_at_least_1w_up_to_1m_old'), - _1yTo2y: create_10yTo12yPattern(this, 'utxos_at_least_1y_up_to_2y_old'), - _2mTo3m: create_10yTo12yPattern(this, 'utxos_at_least_2m_up_to_3m_old'), - _2yTo3y: create_10yTo12yPattern(this, 'utxos_at_least_2y_up_to_3y_old'), - _3mTo4m: create_10yTo12yPattern(this, 'utxos_at_least_3m_up_to_4m_old'), - _3yTo4y: create_10yTo12yPattern(this, 'utxos_at_least_3y_up_to_4y_old'), - _4mTo5m: create_10yTo12yPattern(this, 'utxos_at_least_4m_up_to_5m_old'), - _4yTo5y: create_10yTo12yPattern(this, 'utxos_at_least_4y_up_to_5y_old'), - _5mTo6m: create_10yTo12yPattern(this, 'utxos_at_least_5m_up_to_6m_old'), - _5yTo6y: create_10yTo12yPattern(this, 'utxos_at_least_5y_up_to_6y_old'), - _6mTo1y: create_10yTo12yPattern(this, 'utxos_at_least_6m_up_to_1y_old'), - _6yTo7y: create_10yTo12yPattern(this, 'utxos_at_least_6y_up_to_7y_old'), - _7yTo8y: create_10yTo12yPattern(this, 'utxos_at_least_7y_up_to_8y_old'), - _8yTo10y: create_10yTo12yPattern(this, 'utxos_at_least_8y_up_to_10y_old'), - from15y: create_10yTo12yPattern(this, 'utxos_at_least_15y_old'), - upTo1h: create_10yTo12yPattern(this, 'utxos_up_to_1h_old'), + _10yTo12y: create_10yTo12yPattern(this, 'utxos_10y_to_12y_old'), + _12yTo15y: create_10yTo12yPattern(this, 'utxos_12y_to_15y_old'), + _1dTo1w: create_10yTo12yPattern(this, 'utxos_1d_to_1w_old'), + _1hTo1d: create_10yTo12yPattern(this, 'utxos_1h_to_1d_old'), + _1mTo2m: create_10yTo12yPattern(this, 'utxos_1m_to_2m_old'), + _1wTo1m: create_10yTo12yPattern(this, 'utxos_1w_to_1m_old'), + _1yTo2y: create_10yTo12yPattern(this, 'utxos_1y_to_2y_old'), + _2mTo3m: create_10yTo12yPattern(this, 'utxos_2m_to_3m_old'), + _2yTo3y: create_10yTo12yPattern(this, 'utxos_2y_to_3y_old'), + _3mTo4m: create_10yTo12yPattern(this, 'utxos_3m_to_4m_old'), + _3yTo4y: create_10yTo12yPattern(this, 'utxos_3y_to_4y_old'), + _4mTo5m: create_10yTo12yPattern(this, 'utxos_4m_to_5m_old'), + _4yTo5y: create_10yTo12yPattern(this, 'utxos_4y_to_5y_old'), + _5mTo6m: create_10yTo12yPattern(this, 'utxos_5m_to_6m_old'), + _5yTo6y: create_10yTo12yPattern(this, 'utxos_5y_to_6y_old'), + _6mTo1y: create_10yTo12yPattern(this, 'utxos_6m_to_1y_old'), + _6yTo7y: create_10yTo12yPattern(this, 'utxos_6y_to_7y_old'), + _7yTo8y: create_10yTo12yPattern(this, 'utxos_7y_to_8y_old'), + _8yTo10y: create_10yTo12yPattern(this, 'utxos_8y_to_10y_old'), + from15y: create_10yTo12yPattern(this, 'utxos_over_15y_old'), + upTo1h: create_10yTo12yPattern(this, 'utxos_under_1h_old'), }, all: { activity: createActivityPattern2(this, ''), @@ -5493,19 +5478,19 @@ class BrkClient extends BrkClientBase { _4: create_0satsPattern2(this, 'epoch_4'), }, geAmount: { - _100btc: create_100btcPattern(this, 'utxos_above_100btc'), - _100kSats: create_100btcPattern(this, 'utxos_above_100k_sats'), - _100sats: create_100btcPattern(this, 'utxos_above_100sats'), - _10btc: create_100btcPattern(this, 'utxos_above_10btc'), - _10kBtc: create_100btcPattern(this, 'utxos_above_10k_btc'), - _10kSats: create_100btcPattern(this, 'utxos_above_10k_sats'), - _10mSats: create_100btcPattern(this, 'utxos_above_10m_sats'), - _10sats: create_100btcPattern(this, 'utxos_above_10sats'), - _1btc: create_100btcPattern(this, 'utxos_above_1btc'), - _1kBtc: create_100btcPattern(this, 'utxos_above_1k_btc'), - _1kSats: create_100btcPattern(this, 'utxos_above_1k_sats'), - _1mSats: create_100btcPattern(this, 'utxos_above_1m_sats'), - _1sat: create_100btcPattern(this, 'utxos_above_1sat'), + _100btc: create_100btcPattern(this, 'utxos_over_100btc'), + _100kSats: create_100btcPattern(this, 'utxos_over_100k_sats'), + _100sats: create_100btcPattern(this, 'utxos_over_100sats'), + _10btc: create_100btcPattern(this, 'utxos_over_10btc'), + _10kBtc: create_100btcPattern(this, 'utxos_over_10k_btc'), + _10kSats: create_100btcPattern(this, 'utxos_over_10k_sats'), + _10mSats: create_100btcPattern(this, 'utxos_over_10m_sats'), + _10sats: create_100btcPattern(this, 'utxos_over_10sats'), + _1btc: create_100btcPattern(this, 'utxos_over_1btc'), + _1kBtc: create_100btcPattern(this, 'utxos_over_1k_btc'), + _1kSats: create_100btcPattern(this, 'utxos_over_1k_sats'), + _1mSats: create_100btcPattern(this, 'utxos_over_1m_sats'), + _1sat: create_100btcPattern(this, 'utxos_over_1sat'), }, ltAmount: { _100btc: create_100btcPattern(this, 'utxos_under_100btc'), @@ -5523,44 +5508,44 @@ class BrkClient extends BrkClientBase { _1mSats: create_100btcPattern(this, 'utxos_under_1m_sats'), }, maxAge: { - _10y: create_10yPattern(this, 'utxos_up_to_10y_old'), - _12y: create_10yPattern(this, 'utxos_up_to_12y_old'), - _15y: create_10yPattern(this, 'utxos_up_to_15y_old'), - _1m: create_10yPattern(this, 'utxos_up_to_1m_old'), - _1w: create_10yPattern(this, 'utxos_up_to_1w_old'), - _1y: create_10yPattern(this, 'utxos_up_to_1y_old'), - _2m: create_10yPattern(this, 'utxos_up_to_2m_old'), - _2y: create_10yPattern(this, 'utxos_up_to_2y_old'), - _3m: create_10yPattern(this, 'utxos_up_to_3m_old'), - _3y: create_10yPattern(this, 'utxos_up_to_3y_old'), - _4m: create_10yPattern(this, 'utxos_up_to_4m_old'), - _4y: create_10yPattern(this, 'utxos_up_to_4y_old'), - _5m: create_10yPattern(this, 'utxos_up_to_5m_old'), - _5y: create_10yPattern(this, 'utxos_up_to_5y_old'), - _6m: create_10yPattern(this, 'utxos_up_to_6m_old'), - _6y: create_10yPattern(this, 'utxos_up_to_6y_old'), - _7y: create_10yPattern(this, 'utxos_up_to_7y_old'), - _8y: create_10yPattern(this, 'utxos_up_to_8y_old'), + _10y: create_10yPattern(this, 'utxos_under_10y_old'), + _12y: create_10yPattern(this, 'utxos_under_12y_old'), + _15y: create_10yPattern(this, 'utxos_under_15y_old'), + _1m: create_10yPattern(this, 'utxos_under_1m_old'), + _1w: create_10yPattern(this, 'utxos_under_1w_old'), + _1y: create_10yPattern(this, 'utxos_under_1y_old'), + _2m: create_10yPattern(this, 'utxos_under_2m_old'), + _2y: create_10yPattern(this, 'utxos_under_2y_old'), + _3m: create_10yPattern(this, 'utxos_under_3m_old'), + _3y: create_10yPattern(this, 'utxos_under_3y_old'), + _4m: create_10yPattern(this, 'utxos_under_4m_old'), + _4y: create_10yPattern(this, 'utxos_under_4y_old'), + _5m: create_10yPattern(this, 'utxos_under_5m_old'), + _5y: create_10yPattern(this, 'utxos_under_5y_old'), + _6m: create_10yPattern(this, 'utxos_under_6m_old'), + _6y: create_10yPattern(this, 'utxos_under_6y_old'), + _7y: create_10yPattern(this, 'utxos_under_7y_old'), + _8y: create_10yPattern(this, 'utxos_under_8y_old'), }, minAge: { - _10y: create_100btcPattern(this, 'utxos_at_least_10y_old'), - _12y: create_100btcPattern(this, 'utxos_at_least_12y_old'), - _1d: create_100btcPattern(this, 'utxos_at_least_1d_old'), - _1m: create_100btcPattern(this, 'utxos_at_least_1m_old'), - _1w: create_100btcPattern(this, 'utxos_at_least_1w_old'), - _1y: create_100btcPattern(this, 'utxos_at_least_1y_old'), - _2m: create_100btcPattern(this, 'utxos_at_least_2m_old'), - _2y: create_100btcPattern(this, 'utxos_at_least_2y_old'), - _3m: create_100btcPattern(this, 'utxos_at_least_3m_old'), - _3y: create_100btcPattern(this, 'utxos_at_least_3y_old'), - _4m: create_100btcPattern(this, 'utxos_at_least_4m_old'), - _4y: create_100btcPattern(this, 'utxos_at_least_4y_old'), - _5m: create_100btcPattern(this, 'utxos_at_least_5m_old'), - _5y: create_100btcPattern(this, 'utxos_at_least_5y_old'), - _6m: create_100btcPattern(this, 'utxos_at_least_6m_old'), - _6y: create_100btcPattern(this, 'utxos_at_least_6y_old'), - _7y: create_100btcPattern(this, 'utxos_at_least_7y_old'), - _8y: create_100btcPattern(this, 'utxos_at_least_8y_old'), + _10y: create_100btcPattern(this, 'utxos_over_10y_old'), + _12y: create_100btcPattern(this, 'utxos_over_12y_old'), + _1d: create_100btcPattern(this, 'utxos_over_1d_old'), + _1m: create_100btcPattern(this, 'utxos_over_1m_old'), + _1w: create_100btcPattern(this, 'utxos_over_1w_old'), + _1y: create_100btcPattern(this, 'utxos_over_1y_old'), + _2m: create_100btcPattern(this, 'utxos_over_2m_old'), + _2y: create_100btcPattern(this, 'utxos_over_2y_old'), + _3m: create_100btcPattern(this, 'utxos_over_3m_old'), + _3y: create_100btcPattern(this, 'utxos_over_3y_old'), + _4m: create_100btcPattern(this, 'utxos_over_4m_old'), + _4y: create_100btcPattern(this, 'utxos_over_4y_old'), + _5m: create_100btcPattern(this, 'utxos_over_5m_old'), + _5y: create_100btcPattern(this, 'utxos_over_5y_old'), + _6m: create_100btcPattern(this, 'utxos_over_6m_old'), + _6y: create_100btcPattern(this, 'utxos_over_6y_old'), + _7y: create_100btcPattern(this, 'utxos_over_7y_old'), + _8y: create_100btcPattern(this, 'utxos_over_8y_old'), }, term: { long: { @@ -5754,21 +5739,21 @@ class BrkClient extends BrkClientBase { yearsSincePriceAth: createMetricPattern4(this, 'years_since_price_ath'), }, dca: { - classAveragePrice: { - _2015: createMetricPattern4(this, 'dca_class_2015_average_price'), - _2016: createMetricPattern4(this, 'dca_class_2016_average_price'), - _2017: createMetricPattern4(this, 'dca_class_2017_average_price'), - _2018: createMetricPattern4(this, 'dca_class_2018_average_price'), - _2019: createMetricPattern4(this, 'dca_class_2019_average_price'), - _2020: createMetricPattern4(this, 'dca_class_2020_average_price'), - _2021: createMetricPattern4(this, 'dca_class_2021_average_price'), - _2022: createMetricPattern4(this, 'dca_class_2022_average_price'), - _2023: createMetricPattern4(this, 'dca_class_2023_average_price'), - _2024: createMetricPattern4(this, 'dca_class_2024_average_price'), - _2025: createMetricPattern4(this, 'dca_class_2025_average_price'), - _2026: createMetricPattern4(this, 'dca_class_2026_average_price'), + classAveragePrice: createClassAveragePricePattern(this, 'dca_class'), + classReturns: { + _2015: createMetricPattern4(this, 'dca_class_2015_returns'), + _2016: createMetricPattern4(this, 'dca_class_2016_returns'), + _2017: createMetricPattern4(this, 'dca_class_2017_returns'), + _2018: createMetricPattern4(this, 'dca_class_2018_returns'), + _2019: createMetricPattern4(this, 'dca_class_2019_returns'), + _2020: createMetricPattern4(this, 'dca_class_2020_returns'), + _2021: createMetricPattern4(this, 'dca_class_2021_returns'), + _2022: createMetricPattern4(this, 'dca_class_2022_returns'), + _2023: createMetricPattern4(this, 'dca_class_2023_returns'), + _2024: createMetricPattern4(this, 'dca_class_2024_returns'), + _2025: createMetricPattern4(this, 'dca_class_2025_returns'), + _2026: createMetricPattern4(this, 'dca_class_2026_returns'), }, - classReturns: createClassAveragePricePattern(this, 'dca_class'), classStack: { _2015: create_2015Pattern(this, 'dca_class_2015_stack'), _2016: create_2015Pattern(this, 'dca_class_2016_stack'), @@ -6183,19 +6168,7 @@ class BrkClient extends BrkClientBase { fees: { fee: { bitcoin: createCountPattern2(this, 'fee_btc'), - dollars: { - average: createMetricPattern1(this, 'fee_usd_average'), - cumulative: createMetricPattern2(this, 'fee_usd_cumulative'), - heightCumulative: createMetricPattern11(this, 'fee_usd_cumulative'), - max: createMetricPattern1(this, 'fee_usd_max'), - median: createMetricPattern11(this, 'fee_usd_median'), - min: createMetricPattern1(this, 'fee_usd_min'), - pct10: createMetricPattern11(this, 'fee_usd_pct10'), - pct25: createMetricPattern11(this, 'fee_usd_pct25'), - pct75: createMetricPattern11(this, 'fee_usd_pct75'), - pct90: createMetricPattern11(this, 'fee_usd_pct90'), - sum: createMetricPattern1(this, 'fee_usd_sum'), - }, + dollars: createCountPattern2(this, 'fee_usd'), sats: createCountPattern2(this, 'fee'), txindex: createMetricPattern27(this, 'fee'), }, diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index 68cb3db5c..434aac43d 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -2054,24 +2054,6 @@ class PeriodLumpSumStackPattern: self._6y: _2015Pattern = _2015Pattern(client, _p('6y', acc)) self._8y: _2015Pattern = _2015Pattern(client, _p('8y', acc)) -class ClassAveragePricePattern(Generic[T]): - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._2015: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2015_returns')) - self._2016: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2016_returns')) - self._2017: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2017_returns')) - self._2018: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2018_returns')) - self._2019: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2019_returns')) - self._2020: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2020_returns')) - self._2021: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2021_returns')) - self._2022: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2022_returns')) - self._2023: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2023_returns')) - self._2024: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2024_returns')) - self._2025: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2025_returns')) - self._2026: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2026_returns')) - class PeriodAveragePricePattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2090,6 +2072,24 @@ class PeriodAveragePricePattern(Generic[T]): self._6y: MetricPattern4[T] = MetricPattern4(client, _p('6y', acc)) self._8y: MetricPattern4[T] = MetricPattern4(client, _p('8y', acc)) +class ClassAveragePricePattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._2015: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2015_average_price')) + self._2016: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2016_average_price')) + self._2017: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2017_average_price')) + self._2018: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2018_average_price')) + self._2019: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2019_average_price')) + self._2020: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2020_average_price')) + self._2021: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2021_average_price')) + self._2022: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2022_average_price')) + self._2023: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2023_average_price')) + self._2024: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2024_average_price')) + self._2025: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2025_average_price')) + self._2026: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2026_average_price')) + class BitcoinPattern: """Pattern struct for repeated tree structure.""" @@ -2245,6 +2245,32 @@ class PhaseDailyCentsPattern(Generic[T]): self.pct75: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct75')) self.pct90: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'pct90')) +class _100btcPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: ActivityPattern2 = ActivityPattern2(client, acc) + self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) + self.outputs: OutputsPattern = OutputsPattern(client, _m(acc, 'utxo_count')) + self.realized: RealizedPattern = RealizedPattern(client, acc) + self.relative: RelativePattern = RelativePattern(client, acc) + self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) + self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) + +class PeriodCagrPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._10y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('10y', acc)) + self._2y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('2y', acc)) + self._3y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('3y', acc)) + self._4y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('4y', acc)) + self._5y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('5y', acc)) + self._6y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('6y', acc)) + self._8y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('8y', acc)) + class _0satsPattern2: """Pattern struct for repeated tree structure.""" @@ -2271,19 +2297,6 @@ class _10yTo12yPattern: self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) -class PeriodCagrPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._10y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('10y', acc)) - self._2y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('2y', acc)) - self._3y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('3y', acc)) - self._4y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('4y', acc)) - self._5y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('5y', acc)) - self._6y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('6y', acc)) - self._8y: MetricPattern4[StoredF32] = MetricPattern4(client, _p('8y', acc)) - class UnrealizedPattern: """Pattern struct for repeated tree structure.""" @@ -2310,19 +2323,6 @@ class _10yPattern: self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) -class _100btcPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: ActivityPattern2 = ActivityPattern2(client, acc) - self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc) - self.outputs: OutputsPattern = OutputsPattern(client, _m(acc, 'utxo_count')) - self.realized: RealizedPattern = RealizedPattern(client, acc) - self.relative: RelativePattern = RelativePattern(client, acc) - self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply')) - self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc) - class ActivityPattern2: """Pattern struct for repeated tree structure.""" @@ -2344,15 +2344,6 @@ class SplitPattern2(Generic[T]): self.low: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'low')) self.open: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'open')) -class _2015Pattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bitcoin: MetricPattern4[Bitcoin] = MetricPattern4(client, _m(acc, 'btc')) - self.dollars: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'usd')) - self.sats: MetricPattern4[Sats] = MetricPattern4(client, acc) - class CostBasisPattern2: """Pattern struct for repeated tree structure.""" @@ -2380,15 +2371,6 @@ class CoinbasePattern2: self.dollars: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'usd')) self.sats: BlockCountPattern[Sats] = BlockCountPattern(client, acc) -class SegwitAdoptionPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.base: MetricPattern11[StoredF32] = MetricPattern11(client, acc) - self.cumulative: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'cumulative')) - self.sum: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'sum')) - class ActiveSupplyPattern: """Pattern struct for repeated tree structure.""" @@ -2398,6 +2380,15 @@ class ActiveSupplyPattern: self.dollars: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) self.sats: MetricPattern1[Sats] = MetricPattern1(client, acc) +class SegwitAdoptionPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.base: MetricPattern11[StoredF32] = MetricPattern11(client, acc) + self.cumulative: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'cumulative')) + self.sum: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'sum')) + class UnclaimedRewardsPattern: """Pattern struct for repeated tree structure.""" @@ -2407,6 +2398,15 @@ class UnclaimedRewardsPattern: self.dollars: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'usd')) self.sats: BlockCountPattern[Sats] = BlockCountPattern(client, acc) +class _2015Pattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bitcoin: MetricPattern4[Bitcoin] = MetricPattern4(client, _m(acc, 'btc')) + self.dollars: MetricPattern4[Dollars] = MetricPattern4(client, _m(acc, 'usd')) + self.sats: MetricPattern4[Sats] = MetricPattern4(client, acc) + class SupplyPattern2: """Pattern struct for repeated tree structure.""" @@ -2439,13 +2439,13 @@ class _1dReturns1mSdPattern: self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sd')) self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sma')) -class SatsPattern(Generic[T]): +class BitcoinPattern2(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.ohlc: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'ohlc')) - self.split: SplitPattern2[T] = SplitPattern2(client, acc) + self.cumulative: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'cumulative')) + self.sum: MetricPattern1[T] = MetricPattern1(client, acc) class BlockCountPattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2455,13 +2455,13 @@ class BlockCountPattern(Generic[T]): self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) self.sum: MetricPattern1[T] = MetricPattern1(client, acc) -class BitcoinPattern2(Generic[T]): +class SatsPattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'cumulative')) - self.sum: MetricPattern1[T] = MetricPattern1(client, acc) + self.ohlc: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'ohlc')) + self.split: SplitPattern2[T] = SplitPattern2(client, acc) class RealizedPriceExtraPattern: """Pattern struct for repeated tree structure.""" @@ -2739,19 +2739,19 @@ class MetricsTree_Distribution_AddressCohorts_GeAmount: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._100btc: _0satsPattern = _0satsPattern(client, 'addrs_above_100btc') - self._100k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100k_sats') - self._100sats: _0satsPattern = _0satsPattern(client, 'addrs_above_100sats') - self._10btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10btc') - self._10k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_btc') - self._10k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10k_sats') - self._10m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10m_sats') - self._10sats: _0satsPattern = _0satsPattern(client, 'addrs_above_10sats') - self._1btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1btc') - self._1k_btc: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_btc') - self._1k_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1k_sats') - self._1m_sats: _0satsPattern = _0satsPattern(client, 'addrs_above_1m_sats') - self._1sat: _0satsPattern = _0satsPattern(client, 'addrs_above_1sat') + self._100btc: _0satsPattern = _0satsPattern(client, 'addrs_over_100btc') + self._100k_sats: _0satsPattern = _0satsPattern(client, 'addrs_over_100k_sats') + self._100sats: _0satsPattern = _0satsPattern(client, 'addrs_over_100sats') + self._10btc: _0satsPattern = _0satsPattern(client, 'addrs_over_10btc') + self._10k_btc: _0satsPattern = _0satsPattern(client, 'addrs_over_10k_btc') + self._10k_sats: _0satsPattern = _0satsPattern(client, 'addrs_over_10k_sats') + self._10m_sats: _0satsPattern = _0satsPattern(client, 'addrs_over_10m_sats') + self._10sats: _0satsPattern = _0satsPattern(client, 'addrs_over_10sats') + self._1btc: _0satsPattern = _0satsPattern(client, 'addrs_over_1btc') + self._1k_btc: _0satsPattern = _0satsPattern(client, 'addrs_over_1k_btc') + self._1k_sats: _0satsPattern = _0satsPattern(client, 'addrs_over_1k_sats') + self._1m_sats: _0satsPattern = _0satsPattern(client, 'addrs_over_1m_sats') + self._1sat: _0satsPattern = _0satsPattern(client, 'addrs_over_1sat') class MetricsTree_Distribution_AddressCohorts_LtAmount: """Metrics tree node.""" @@ -2803,27 +2803,27 @@ class MetricsTree_Distribution_UtxoCohorts_AgeRange: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._10y_to_12y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_10y_up_to_12y_old') - self._12y_to_15y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_12y_up_to_15y_old') - self._1d_to_1w: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1d_up_to_1w_old') - self._1h_to_1d: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1h_up_to_1d_old') - self._1m_to_2m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1m_up_to_2m_old') - self._1w_to_1m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1w_up_to_1m_old') - self._1y_to_2y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_1y_up_to_2y_old') - self._2m_to_3m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_2m_up_to_3m_old') - self._2y_to_3y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_2y_up_to_3y_old') - self._3m_to_4m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_3m_up_to_4m_old') - self._3y_to_4y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_3y_up_to_4y_old') - self._4m_to_5m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_4m_up_to_5m_old') - self._4y_to_5y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_4y_up_to_5y_old') - self._5m_to_6m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_5m_up_to_6m_old') - self._5y_to_6y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_5y_up_to_6y_old') - self._6m_to_1y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_6m_up_to_1y_old') - self._6y_to_7y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_6y_up_to_7y_old') - self._7y_to_8y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_7y_up_to_8y_old') - self._8y_to_10y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_8y_up_to_10y_old') - self.from_15y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_at_least_15y_old') - self.up_to_1h: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_up_to_1h_old') + self._10y_to_12y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_10y_to_12y_old') + self._12y_to_15y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_12y_to_15y_old') + self._1d_to_1w: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_1d_to_1w_old') + self._1h_to_1d: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_1h_to_1d_old') + self._1m_to_2m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_1m_to_2m_old') + self._1w_to_1m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_1w_to_1m_old') + self._1y_to_2y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_1y_to_2y_old') + self._2m_to_3m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_2m_to_3m_old') + self._2y_to_3y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_2y_to_3y_old') + self._3m_to_4m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_3m_to_4m_old') + self._3y_to_4y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_3y_to_4y_old') + self._4m_to_5m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_4m_to_5m_old') + self._4y_to_5y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_4y_to_5y_old') + self._5m_to_6m: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_5m_to_6m_old') + self._5y_to_6y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_5y_to_6y_old') + self._6m_to_1y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_6m_to_1y_old') + self._6y_to_7y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_6y_to_7y_old') + self._7y_to_8y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_7y_to_8y_old') + self._8y_to_10y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_8y_to_10y_old') + self.from_15y: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_over_15y_old') + self.up_to_1h: _10yTo12yPattern = _10yTo12yPattern(client, 'utxos_under_1h_old') class MetricsTree_Distribution_UtxoCohorts_All_CostBasis: """Metrics tree node.""" @@ -2890,19 +2890,19 @@ class MetricsTree_Distribution_UtxoCohorts_GeAmount: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._100btc: _100btcPattern = _100btcPattern(client, 'utxos_above_100btc') - self._100k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_100k_sats') - self._100sats: _100btcPattern = _100btcPattern(client, 'utxos_above_100sats') - self._10btc: _100btcPattern = _100btcPattern(client, 'utxos_above_10btc') - self._10k_btc: _100btcPattern = _100btcPattern(client, 'utxos_above_10k_btc') - self._10k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_10k_sats') - self._10m_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_10m_sats') - self._10sats: _100btcPattern = _100btcPattern(client, 'utxos_above_10sats') - self._1btc: _100btcPattern = _100btcPattern(client, 'utxos_above_1btc') - self._1k_btc: _100btcPattern = _100btcPattern(client, 'utxos_above_1k_btc') - self._1k_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_1k_sats') - self._1m_sats: _100btcPattern = _100btcPattern(client, 'utxos_above_1m_sats') - self._1sat: _100btcPattern = _100btcPattern(client, 'utxos_above_1sat') + self._100btc: _100btcPattern = _100btcPattern(client, 'utxos_over_100btc') + self._100k_sats: _100btcPattern = _100btcPattern(client, 'utxos_over_100k_sats') + self._100sats: _100btcPattern = _100btcPattern(client, 'utxos_over_100sats') + self._10btc: _100btcPattern = _100btcPattern(client, 'utxos_over_10btc') + self._10k_btc: _100btcPattern = _100btcPattern(client, 'utxos_over_10k_btc') + self._10k_sats: _100btcPattern = _100btcPattern(client, 'utxos_over_10k_sats') + self._10m_sats: _100btcPattern = _100btcPattern(client, 'utxos_over_10m_sats') + self._10sats: _100btcPattern = _100btcPattern(client, 'utxos_over_10sats') + self._1btc: _100btcPattern = _100btcPattern(client, 'utxos_over_1btc') + self._1k_btc: _100btcPattern = _100btcPattern(client, 'utxos_over_1k_btc') + self._1k_sats: _100btcPattern = _100btcPattern(client, 'utxos_over_1k_sats') + self._1m_sats: _100btcPattern = _100btcPattern(client, 'utxos_over_1m_sats') + self._1sat: _100btcPattern = _100btcPattern(client, 'utxos_over_1sat') class MetricsTree_Distribution_UtxoCohorts_LtAmount: """Metrics tree node.""" @@ -2926,47 +2926,47 @@ class MetricsTree_Distribution_UtxoCohorts_MaxAge: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._10y: _10yPattern = _10yPattern(client, 'utxos_up_to_10y_old') - self._12y: _10yPattern = _10yPattern(client, 'utxos_up_to_12y_old') - self._15y: _10yPattern = _10yPattern(client, 'utxos_up_to_15y_old') - self._1m: _10yPattern = _10yPattern(client, 'utxos_up_to_1m_old') - self._1w: _10yPattern = _10yPattern(client, 'utxos_up_to_1w_old') - self._1y: _10yPattern = _10yPattern(client, 'utxos_up_to_1y_old') - self._2m: _10yPattern = _10yPattern(client, 'utxos_up_to_2m_old') - self._2y: _10yPattern = _10yPattern(client, 'utxos_up_to_2y_old') - self._3m: _10yPattern = _10yPattern(client, 'utxos_up_to_3m_old') - self._3y: _10yPattern = _10yPattern(client, 'utxos_up_to_3y_old') - self._4m: _10yPattern = _10yPattern(client, 'utxos_up_to_4m_old') - self._4y: _10yPattern = _10yPattern(client, 'utxos_up_to_4y_old') - self._5m: _10yPattern = _10yPattern(client, 'utxos_up_to_5m_old') - self._5y: _10yPattern = _10yPattern(client, 'utxos_up_to_5y_old') - self._6m: _10yPattern = _10yPattern(client, 'utxos_up_to_6m_old') - self._6y: _10yPattern = _10yPattern(client, 'utxos_up_to_6y_old') - self._7y: _10yPattern = _10yPattern(client, 'utxos_up_to_7y_old') - self._8y: _10yPattern = _10yPattern(client, 'utxos_up_to_8y_old') + self._10y: _10yPattern = _10yPattern(client, 'utxos_under_10y_old') + self._12y: _10yPattern = _10yPattern(client, 'utxos_under_12y_old') + self._15y: _10yPattern = _10yPattern(client, 'utxos_under_15y_old') + self._1m: _10yPattern = _10yPattern(client, 'utxos_under_1m_old') + self._1w: _10yPattern = _10yPattern(client, 'utxos_under_1w_old') + self._1y: _10yPattern = _10yPattern(client, 'utxos_under_1y_old') + self._2m: _10yPattern = _10yPattern(client, 'utxos_under_2m_old') + self._2y: _10yPattern = _10yPattern(client, 'utxos_under_2y_old') + self._3m: _10yPattern = _10yPattern(client, 'utxos_under_3m_old') + self._3y: _10yPattern = _10yPattern(client, 'utxos_under_3y_old') + self._4m: _10yPattern = _10yPattern(client, 'utxos_under_4m_old') + self._4y: _10yPattern = _10yPattern(client, 'utxos_under_4y_old') + self._5m: _10yPattern = _10yPattern(client, 'utxos_under_5m_old') + self._5y: _10yPattern = _10yPattern(client, 'utxos_under_5y_old') + self._6m: _10yPattern = _10yPattern(client, 'utxos_under_6m_old') + self._6y: _10yPattern = _10yPattern(client, 'utxos_under_6y_old') + self._7y: _10yPattern = _10yPattern(client, 'utxos_under_7y_old') + self._8y: _10yPattern = _10yPattern(client, 'utxos_under_8y_old') class MetricsTree_Distribution_UtxoCohorts_MinAge: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._10y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_10y_old') - self._12y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_12y_old') - self._1d: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1d_old') - self._1m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1m_old') - self._1w: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1w_old') - self._1y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_1y_old') - self._2m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_2m_old') - self._2y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_2y_old') - self._3m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_3m_old') - self._3y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_3y_old') - self._4m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_4m_old') - self._4y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_4y_old') - self._5m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_5m_old') - self._5y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_5y_old') - self._6m: _100btcPattern = _100btcPattern(client, 'utxos_at_least_6m_old') - self._6y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_6y_old') - self._7y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_7y_old') - self._8y: _100btcPattern = _100btcPattern(client, 'utxos_at_least_8y_old') + self._10y: _100btcPattern = _100btcPattern(client, 'utxos_over_10y_old') + self._12y: _100btcPattern = _100btcPattern(client, 'utxos_over_12y_old') + self._1d: _100btcPattern = _100btcPattern(client, 'utxos_over_1d_old') + self._1m: _100btcPattern = _100btcPattern(client, 'utxos_over_1m_old') + self._1w: _100btcPattern = _100btcPattern(client, 'utxos_over_1w_old') + self._1y: _100btcPattern = _100btcPattern(client, 'utxos_over_1y_old') + self._2m: _100btcPattern = _100btcPattern(client, 'utxos_over_2m_old') + self._2y: _100btcPattern = _100btcPattern(client, 'utxos_over_2y_old') + self._3m: _100btcPattern = _100btcPattern(client, 'utxos_over_3m_old') + self._3y: _100btcPattern = _100btcPattern(client, 'utxos_over_3y_old') + self._4m: _100btcPattern = _100btcPattern(client, 'utxos_over_4m_old') + self._4y: _100btcPattern = _100btcPattern(client, 'utxos_over_4y_old') + self._5m: _100btcPattern = _100btcPattern(client, 'utxos_over_5m_old') + self._5y: _100btcPattern = _100btcPattern(client, 'utxos_over_5y_old') + self._6m: _100btcPattern = _100btcPattern(client, 'utxos_over_6m_old') + self._6y: _100btcPattern = _100btcPattern(client, 'utxos_over_6y_old') + self._7y: _100btcPattern = _100btcPattern(client, 'utxos_over_7y_old') + self._8y: _100btcPattern = _100btcPattern(client, 'utxos_over_8y_old') class MetricsTree_Distribution_UtxoCohorts_Term_Long: """Metrics tree node.""" @@ -3320,22 +3320,22 @@ class MetricsTree_Market_Ath: self.price_drawdown: MetricPattern3[StoredF32] = MetricPattern3(client, 'price_drawdown') self.years_since_price_ath: MetricPattern4[StoredF32] = MetricPattern4(client, 'years_since_price_ath') -class MetricsTree_Market_Dca_ClassAveragePrice: +class MetricsTree_Market_Dca_ClassReturns: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._2015: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2015_average_price') - self._2016: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2016_average_price') - self._2017: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2017_average_price') - self._2018: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2018_average_price') - self._2019: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2019_average_price') - self._2020: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2020_average_price') - self._2021: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2021_average_price') - self._2022: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2022_average_price') - self._2023: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2023_average_price') - self._2024: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2024_average_price') - self._2025: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2025_average_price') - self._2026: MetricPattern4[Dollars] = MetricPattern4(client, 'dca_class_2026_average_price') + self._2015: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2015_returns') + self._2016: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2016_returns') + self._2017: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2017_returns') + self._2018: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2018_returns') + self._2019: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2019_returns') + self._2020: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2020_returns') + self._2021: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2021_returns') + self._2022: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2022_returns') + self._2023: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2023_returns') + self._2024: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2024_returns') + self._2025: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2025_returns') + self._2026: MetricPattern4[StoredF32] = MetricPattern4(client, 'dca_class_2026_returns') class MetricsTree_Market_Dca_ClassStack: """Metrics tree node.""" @@ -3358,8 +3358,8 @@ class MetricsTree_Market_Dca: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.class_average_price: MetricsTree_Market_Dca_ClassAveragePrice = MetricsTree_Market_Dca_ClassAveragePrice(client) - self.class_returns: ClassAveragePricePattern[StoredF32] = ClassAveragePricePattern(client, 'dca_class') + self.class_average_price: ClassAveragePricePattern[Dollars] = ClassAveragePricePattern(client, 'dca_class') + self.class_returns: MetricsTree_Market_Dca_ClassReturns = MetricsTree_Market_Dca_ClassReturns(client) self.class_stack: MetricsTree_Market_Dca_ClassStack = MetricsTree_Market_Dca_ClassStack(client) self.period_average_price: PeriodAveragePricePattern[Dollars] = PeriodAveragePricePattern(client, 'dca_average_price') self.period_cagr: PeriodCagrPattern = PeriodCagrPattern(client, 'dca_cagr') @@ -3855,28 +3855,12 @@ class MetricsTree_Transactions_Count: self.is_coinbase: MetricPattern27[StoredBool] = MetricPattern27(client, 'is_coinbase') self.tx_count: DollarsPattern[StoredU64] = DollarsPattern(client, 'tx_count') -class MetricsTree_Transactions_Fees_Fee_Dollars: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.average: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_average') - self.cumulative: MetricPattern2[Dollars] = MetricPattern2(client, 'fee_usd_cumulative') - self.height_cumulative: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_cumulative') - self.max: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_max') - self.median: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_median') - self.min: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_min') - self.pct10: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct10') - self.pct25: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct25') - self.pct75: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct75') - self.pct90: MetricPattern11[Dollars] = MetricPattern11(client, 'fee_usd_pct90') - self.sum: MetricPattern1[Dollars] = MetricPattern1(client, 'fee_usd_sum') - class MetricsTree_Transactions_Fees_Fee: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.bitcoin: CountPattern2[Bitcoin] = CountPattern2(client, 'fee_btc') - self.dollars: MetricsTree_Transactions_Fees_Fee_Dollars = MetricsTree_Transactions_Fees_Fee_Dollars(client) + self.dollars: CountPattern2[Dollars] = CountPattern2(client, 'fee_usd') self.sats: CountPattern2[Sats] = CountPattern2(client, 'fee') self.txindex: MetricPattern27[Sats] = MetricPattern27(client, 'fee') @@ -4346,107 +4330,107 @@ class BrkClient(BrkClientBase): AGE_RANGE_NAMES = { "up_to_1h": { - "id": "up_to_1h_old", + "id": "under_1h_old", "short": "<1h", - "long": "Up to 1 Hour Old" + "long": "Under 1 Hour Old" }, "_1h_to_1d": { - "id": "at_least_1h_up_to_1d_old", + "id": "1h_to_1d_old", "short": "1h-1d", "long": "1 Hour to 1 Day Old" }, "_1d_to_1w": { - "id": "at_least_1d_up_to_1w_old", + "id": "1d_to_1w_old", "short": "1d-1w", "long": "1 Day to 1 Week Old" }, "_1w_to_1m": { - "id": "at_least_1w_up_to_1m_old", + "id": "1w_to_1m_old", "short": "1w-1m", "long": "1 Week to 1 Month Old" }, "_1m_to_2m": { - "id": "at_least_1m_up_to_2m_old", + "id": "1m_to_2m_old", "short": "1m-2m", "long": "1 to 2 Months Old" }, "_2m_to_3m": { - "id": "at_least_2m_up_to_3m_old", + "id": "2m_to_3m_old", "short": "2m-3m", "long": "2 to 3 Months Old" }, "_3m_to_4m": { - "id": "at_least_3m_up_to_4m_old", + "id": "3m_to_4m_old", "short": "3m-4m", "long": "3 to 4 Months Old" }, "_4m_to_5m": { - "id": "at_least_4m_up_to_5m_old", + "id": "4m_to_5m_old", "short": "4m-5m", "long": "4 to 5 Months Old" }, "_5m_to_6m": { - "id": "at_least_5m_up_to_6m_old", + "id": "5m_to_6m_old", "short": "5m-6m", "long": "5 to 6 Months Old" }, "_6m_to_1y": { - "id": "at_least_6m_up_to_1y_old", + "id": "6m_to_1y_old", "short": "6m-1y", "long": "6 Months to 1 Year Old" }, "_1y_to_2y": { - "id": "at_least_1y_up_to_2y_old", + "id": "1y_to_2y_old", "short": "1y-2y", "long": "1 to 2 Years Old" }, "_2y_to_3y": { - "id": "at_least_2y_up_to_3y_old", + "id": "2y_to_3y_old", "short": "2y-3y", "long": "2 to 3 Years Old" }, "_3y_to_4y": { - "id": "at_least_3y_up_to_4y_old", + "id": "3y_to_4y_old", "short": "3y-4y", "long": "3 to 4 Years Old" }, "_4y_to_5y": { - "id": "at_least_4y_up_to_5y_old", + "id": "4y_to_5y_old", "short": "4y-5y", "long": "4 to 5 Years Old" }, "_5y_to_6y": { - "id": "at_least_5y_up_to_6y_old", + "id": "5y_to_6y_old", "short": "5y-6y", "long": "5 to 6 Years Old" }, "_6y_to_7y": { - "id": "at_least_6y_up_to_7y_old", + "id": "6y_to_7y_old", "short": "6y-7y", "long": "6 to 7 Years Old" }, "_7y_to_8y": { - "id": "at_least_7y_up_to_8y_old", + "id": "7y_to_8y_old", "short": "7y-8y", "long": "7 to 8 Years Old" }, "_8y_to_10y": { - "id": "at_least_8y_up_to_10y_old", + "id": "8y_to_10y_old", "short": "8y-10y", "long": "8 to 10 Years Old" }, "_10y_to_12y": { - "id": "at_least_10y_up_to_12y_old", + "id": "10y_to_12y_old", "short": "10y-12y", "long": "10 to 12 Years Old" }, "_12y_to_15y": { - "id": "at_least_12y_up_to_15y_old", + "id": "12y_to_15y_old", "short": "12y-15y", "long": "12 to 15 Years Old" }, "from_15y": { - "id": "at_least_15y_old", + "id": "over_15y_old", "short": "15y+", "long": "15+ Years Old" } @@ -4454,187 +4438,187 @@ class BrkClient(BrkClientBase): MAX_AGE_NAMES = { "_1w": { - "id": "up_to_1w_old", + "id": "under_1w_old", "short": "<1w", - "long": "Up to 1 Week Old" + "long": "Under 1 Week Old" }, "_1m": { - "id": "up_to_1m_old", + "id": "under_1m_old", "short": "<1m", - "long": "Up to 1 Month Old" + "long": "Under 1 Month Old" }, "_2m": { - "id": "up_to_2m_old", + "id": "under_2m_old", "short": "<2m", - "long": "Up to 2 Months Old" + "long": "Under 2 Months Old" }, "_3m": { - "id": "up_to_3m_old", + "id": "under_3m_old", "short": "<3m", - "long": "Up to 3 Months Old" + "long": "Under 3 Months Old" }, "_4m": { - "id": "up_to_4m_old", + "id": "under_4m_old", "short": "<4m", - "long": "Up to 4 Months Old" + "long": "Under 4 Months Old" }, "_5m": { - "id": "up_to_5m_old", + "id": "under_5m_old", "short": "<5m", - "long": "Up to 5 Months Old" + "long": "Under 5 Months Old" }, "_6m": { - "id": "up_to_6m_old", + "id": "under_6m_old", "short": "<6m", - "long": "Up to 6 Months Old" + "long": "Under 6 Months Old" }, "_1y": { - "id": "up_to_1y_old", + "id": "under_1y_old", "short": "<1y", - "long": "Up to 1 Year Old" + "long": "Under 1 Year Old" }, "_2y": { - "id": "up_to_2y_old", + "id": "under_2y_old", "short": "<2y", - "long": "Up to 2 Years Old" + "long": "Under 2 Years Old" }, "_3y": { - "id": "up_to_3y_old", + "id": "under_3y_old", "short": "<3y", - "long": "Up to 3 Years Old" + "long": "Under 3 Years Old" }, "_4y": { - "id": "up_to_4y_old", + "id": "under_4y_old", "short": "<4y", - "long": "Up to 4 Years Old" + "long": "Under 4 Years Old" }, "_5y": { - "id": "up_to_5y_old", + "id": "under_5y_old", "short": "<5y", - "long": "Up to 5 Years Old" + "long": "Under 5 Years Old" }, "_6y": { - "id": "up_to_6y_old", + "id": "under_6y_old", "short": "<6y", - "long": "Up to 6 Years Old" + "long": "Under 6 Years Old" }, "_7y": { - "id": "up_to_7y_old", + "id": "under_7y_old", "short": "<7y", - "long": "Up to 7 Years Old" + "long": "Under 7 Years Old" }, "_8y": { - "id": "up_to_8y_old", + "id": "under_8y_old", "short": "<8y", - "long": "Up to 8 Years Old" + "long": "Under 8 Years Old" }, "_10y": { - "id": "up_to_10y_old", + "id": "under_10y_old", "short": "<10y", - "long": "Up to 10 Years Old" + "long": "Under 10 Years Old" }, "_12y": { - "id": "up_to_12y_old", + "id": "under_12y_old", "short": "<12y", - "long": "Up to 12 Years Old" + "long": "Under 12 Years Old" }, "_15y": { - "id": "up_to_15y_old", + "id": "under_15y_old", "short": "<15y", - "long": "Up to 15 Years Old" + "long": "Under 15 Years Old" } } MIN_AGE_NAMES = { "_1d": { - "id": "at_least_1d_old", + "id": "over_1d_old", "short": "1d+", - "long": "At Least 1 Day Old" + "long": "Over 1 Day Old" }, "_1w": { - "id": "at_least_1w_old", + "id": "over_1w_old", "short": "1w+", - "long": "At Least 1 Week Old" + "long": "Over 1 Week Old" }, "_1m": { - "id": "at_least_1m_old", + "id": "over_1m_old", "short": "1m+", - "long": "At Least 1 Month Old" + "long": "Over 1 Month Old" }, "_2m": { - "id": "at_least_2m_old", + "id": "over_2m_old", "short": "2m+", - "long": "At Least 2 Months Old" + "long": "Over 2 Months Old" }, "_3m": { - "id": "at_least_3m_old", + "id": "over_3m_old", "short": "3m+", - "long": "At Least 3 Months Old" + "long": "Over 3 Months Old" }, "_4m": { - "id": "at_least_4m_old", + "id": "over_4m_old", "short": "4m+", - "long": "At Least 4 Months Old" + "long": "Over 4 Months Old" }, "_5m": { - "id": "at_least_5m_old", + "id": "over_5m_old", "short": "5m+", - "long": "At Least 5 Months Old" + "long": "Over 5 Months Old" }, "_6m": { - "id": "at_least_6m_old", + "id": "over_6m_old", "short": "6m+", - "long": "At Least 6 Months Old" + "long": "Over 6 Months Old" }, "_1y": { - "id": "at_least_1y_old", + "id": "over_1y_old", "short": "1y+", - "long": "At Least 1 Year Old" + "long": "Over 1 Year Old" }, "_2y": { - "id": "at_least_2y_old", + "id": "over_2y_old", "short": "2y+", - "long": "At Least 2 Years Old" + "long": "Over 2 Years Old" }, "_3y": { - "id": "at_least_3y_old", + "id": "over_3y_old", "short": "3y+", - "long": "At Least 3 Years Old" + "long": "Over 3 Years Old" }, "_4y": { - "id": "at_least_4y_old", + "id": "over_4y_old", "short": "4y+", - "long": "At Least 4 Years Old" + "long": "Over 4 Years Old" }, "_5y": { - "id": "at_least_5y_old", + "id": "over_5y_old", "short": "5y+", - "long": "At Least 5 Years Old" + "long": "Over 5 Years Old" }, "_6y": { - "id": "at_least_6y_old", + "id": "over_6y_old", "short": "6y+", - "long": "At Least 6 Years Old" + "long": "Over 6 Years Old" }, "_7y": { - "id": "at_least_7y_old", + "id": "over_7y_old", "short": "7y+", - "long": "At Least 7 Years Old" + "long": "Over 7 Years Old" }, "_8y": { - "id": "at_least_8y_old", + "id": "over_8y_old", "short": "8y+", - "long": "At Least 8 Years Old" + "long": "Over 8 Years Old" }, "_10y": { - "id": "at_least_10y_old", + "id": "over_10y_old", "short": "10y+", - "long": "At Least 10 Years Old" + "long": "Over 10 Years Old" }, "_12y": { - "id": "at_least_12y_old", + "id": "over_12y_old", "short": "12y+", - "long": "At Least 12 Years Old" + "long": "Over 12 Years Old" } } @@ -4718,69 +4702,69 @@ class BrkClient(BrkClientBase): GE_AMOUNT_NAMES = { "_1sat": { - "id": "above_1sat", + "id": "over_1sat", "short": "1+ sats", - "long": "Above 1 Sat" + "long": "Over 1 Sat" }, "_10sats": { - "id": "above_10sats", + "id": "over_10sats", "short": "10+ sats", - "long": "Above 10 Sats" + "long": "Over 10 Sats" }, "_100sats": { - "id": "above_100sats", + "id": "over_100sats", "short": "100+ sats", - "long": "Above 100 Sats" + "long": "Over 100 Sats" }, "_1k_sats": { - "id": "above_1k_sats", + "id": "over_1k_sats", "short": "1k+ sats", - "long": "Above 1K Sats" + "long": "Over 1K Sats" }, "_10k_sats": { - "id": "above_10k_sats", + "id": "over_10k_sats", "short": "10k+ sats", - "long": "Above 10K Sats" + "long": "Over 10K Sats" }, "_100k_sats": { - "id": "above_100k_sats", + "id": "over_100k_sats", "short": "100k+ sats", - "long": "Above 100K Sats" + "long": "Over 100K Sats" }, "_1m_sats": { - "id": "above_1m_sats", + "id": "over_1m_sats", "short": "1M+ sats", - "long": "Above 1M Sats" + "long": "Over 1M Sats" }, "_10m_sats": { - "id": "above_10m_sats", + "id": "over_10m_sats", "short": "0.1+ BTC", - "long": "Above 0.1 BTC" + "long": "Over 0.1 BTC" }, "_1btc": { - "id": "above_1btc", + "id": "over_1btc", "short": "1+ BTC", - "long": "Above 1 BTC" + "long": "Over 1 BTC" }, "_10btc": { - "id": "above_10btc", + "id": "over_10btc", "short": "10+ BTC", - "long": "Above 10 BTC" + "long": "Over 10 BTC" }, "_100btc": { - "id": "above_100btc", + "id": "over_100btc", "short": "100+ BTC", - "long": "Above 100 BTC" + "long": "Over 100 BTC" }, "_1k_btc": { - "id": "above_1k_btc", + "id": "over_1k_btc", "short": "1k+ BTC", - "long": "Above 1K BTC" + "long": "Over 1K BTC" }, "_10k_btc": { - "id": "above_10k_btc", + "id": "over_10k_btc", "short": "10k+ BTC", - "long": "Above 10K BTC" + "long": "Over 10K BTC" } } diff --git a/website/scripts/options/chain.js b/website/scripts/options/chain.js index 91d976388..3ad87ea4d 100644 --- a/website/scripts/options/chain.js +++ b/website/scripts/options/chain.js @@ -103,28 +103,28 @@ export function createChainSection(ctx) { }), line({ metric: pool._24hBlocksMined, - name: "24h Sum", + name: "24h sum", color: colors.pink, unit: Unit.count, defaultActive: false, }), line({ metric: pool._1wBlocksMined, - name: "1w Sum", + name: "1w sum", color: colors.red, unit: Unit.count, defaultActive: false, }), line({ metric: pool._1mBlocksMined, - name: "1m Sum", + name: "1m sum", color: colors.pink, unit: Unit.count, defaultActive: false, }), line({ metric: pool._1yBlocksMined, - name: "1y Sum", + name: "1y sum", color: colors.purple, unit: Unit.count, defaultActive: false, @@ -568,42 +568,9 @@ export function createChainSection(ctx) { name: "Fee", title: "Transaction Fees", bottom: [ - line({ - metric: transactions.fees.fee.bitcoin.sum, - name: "sum", - unit: Unit.btc, - }), - line({ - metric: transactions.fees.fee.bitcoin.cumulative, - name: "cumulative", - color: colors.stat.cumulative, - unit: Unit.btc, - defaultActive: false, - }), - line({ - metric: transactions.fees.fee.sats.sum, - name: "sum", - unit: Unit.sats, - }), - line({ - metric: transactions.fees.fee.sats.cumulative, - name: "cumulative", - color: colors.stat.cumulative, - unit: Unit.sats, - defaultActive: false, - }), - line({ - metric: transactions.fees.fee.dollars.sum, - name: "sum", - unit: Unit.usd, - }), - line({ - metric: transactions.fees.fee.dollars.cumulative, - name: "cumulative", - color: colors.stat.cumulative, - unit: Unit.usd, - defaultActive: false, - }), + ...fromSizePattern(transactions.fees.fee.bitcoin, Unit.btc), + ...fromSizePattern(transactions.fees.fee.sats, Unit.sats), + ...fromSizePattern(transactions.fees.fee.dollars, Unit.usd), line({ metric: blocks.rewards.feeDominance, name: "Dominance", diff --git a/website/scripts/options/context.js b/website/scripts/options/context.js index 236f14d80..87b0bd86d 100644 --- a/website/scripts/options/context.js +++ b/website/scripts/options/context.js @@ -19,6 +19,17 @@ import { colors } from "../chart/colors.js"; /** @typedef {ReturnType} PartialContext */ +/** + * @template {(colors: Colors, ...args: any[]) => any} T + * @param {T} fn + * @returns {OmitFirstArg} + */ +const bind = (fn) => + /** @type {any} */ ( + // @ts-ignore + (...args) => fn(colors, ...args) + ); + /** * Create a context object with all dependencies for building partial options * @param {Object} args @@ -28,43 +39,15 @@ export function createContext({ brk }) { return { colors, brk, - - /** @type {OmitFirstArg} */ - fromSizePattern: (pattern, unit, title) => - fromSizePattern(colors, pattern, unit, title), - /** @type {OmitFirstArg} */ - fromFullnessPattern: (pattern, unit, title) => - fromFullnessPattern(colors, pattern, unit, title), - /** @type {OmitFirstArg} */ - fromDollarsPattern: (pattern, unit, title) => - fromDollarsPattern(colors, pattern, unit, title), - /** @type {OmitFirstArg} */ - fromFeeRatePattern: (pattern, unit, title) => - fromFeeRatePattern(colors, pattern, unit, title), - /** @type {OmitFirstArg} */ - fromCoinbasePattern: (pattern, title) => - fromCoinbasePattern(colors, pattern, title), - /** @type {OmitFirstArg} */ - fromValuePattern: (pattern, title, sumColor, cumulativeColor) => - fromValuePattern(colors, pattern, title, sumColor, cumulativeColor), - /** @type {OmitFirstArg} */ - fromBitcoinPatternWithUnit: (pattern, unit, title, sumColor, cumulativeColor) => - fromBitcoinPatternWithUnit(colors, pattern, unit, title, sumColor, cumulativeColor), - /** @type {OmitFirstArg} */ - fromBlockCountWithUnit: (pattern, unit, title, sumColor, cumulativeColor) => - fromBlockCountWithUnit( - colors, - pattern, - unit, - title, - sumColor, - cumulativeColor, - ), - /** @type {OmitFirstArg} */ - fromIntervalPattern: (pattern, unit, title, color) => - fromIntervalPattern(colors, pattern, unit, title, color), - /** @type {fromSupplyPattern} */ - fromSupplyPattern: (pattern, title, color) => - fromSupplyPattern(pattern, title, color), + fromSizePattern: bind(fromSizePattern), + fromFullnessPattern: bind(fromFullnessPattern), + fromDollarsPattern: bind(fromDollarsPattern), + fromFeeRatePattern: bind(fromFeeRatePattern), + fromCoinbasePattern: bind(fromCoinbasePattern), + fromValuePattern: bind(fromValuePattern), + fromBitcoinPatternWithUnit: bind(fromBitcoinPatternWithUnit), + fromBlockCountWithUnit: bind(fromBlockCountWithUnit), + fromIntervalPattern: bind(fromIntervalPattern), + fromSupplyPattern, }; } diff --git a/website/scripts/options/distribution/address.js b/website/scripts/options/distribution/address.js index 3dd291704..b738a6a8e 100644 --- a/website/scripts/options/distribution/address.js +++ b/website/scripts/options/distribution/address.js @@ -86,7 +86,7 @@ export function createAddressCohortFolder(ctx, args) { { name: "Ratio", title: title("Realized Price Ratio"), - bottom: createRealizedPriceRatioSeries(ctx, list), + bottom: createRealizedPriceRatioSeries(list), }, ] : createRealizedPriceOptions( diff --git a/website/scripts/options/distribution/shared.js b/website/scripts/options/distribution/shared.js index 233b3471c..ffeb9aa1c 100644 --- a/website/scripts/options/distribution/shared.js +++ b/website/scripts/options/distribution/shared.js @@ -295,11 +295,10 @@ export function createRealizedPriceSeries(list) { /** * Create realized price ratio series for grouped cohorts - * @param {PartialContext} ctx * @param {readonly CohortObject[]} list * @returns {AnyFetchedSeriesBlueprint[]} */ -export function createRealizedPriceRatioSeries(ctx, list) { +export function createRealizedPriceRatioSeries(list) { return list.map(({ name, tree }) => baseline({ metric: tree.realized.realizedPriceExtra.ratio, diff --git a/website/scripts/options/distribution/utxo.js b/website/scripts/options/distribution/utxo.js index af3899bd1..17b2b9913 100644 --- a/website/scripts/options/distribution/utxo.js +++ b/website/scripts/options/distribution/utxo.js @@ -199,7 +199,7 @@ export function createCohortFolderAgeRange(ctx, args) { createGroupedRealizedSectionBasic(ctx, list, title, { ratioMetrics: createGroupedRealizedPnlRatioMetrics, }), - createGroupedUnrealizedSectionAgeRange(ctx, list, title), + createGroupedUnrealizedSectionAgeRange(list, title), createGroupedCostBasisSectionWithPercentiles(ctx, list, title), createGroupedActivitySection({ list, title }), ], @@ -271,7 +271,7 @@ export function createCohortFolderBasicWithoutMarketCap(ctx, args) { createGroupedSupplySection(list, title), createGroupedUtxoCountChart(list, title), createGroupedRealizedSectionBasic(ctx, list, title), - createGroupedUnrealizedSectionBase(ctx, list, title), + createGroupedUnrealizedSectionBase(list, title), createGroupedCostBasisSection({ list, title }), createGroupedActivitySection({ list, title }), ], @@ -307,9 +307,9 @@ export function createCohortFolderAddress(ctx, args) { tree: [ createGroupedSupplySection(list, title), createGroupedUtxoCountChart(list, title), - createGroupedAddrCountChart(ctx, list, title), + createGroupedAddrCountChart(list, title), createGroupedRealizedSectionBasic(ctx, list, title), - createGroupedUnrealizedSectionBase(ctx, list, title), + createGroupedUnrealizedSectionBase(list, title), createGroupedCostBasisSection({ list, title }), createGroupedActivitySection({ list, title }), ], @@ -400,12 +400,11 @@ function createSingleAddrCountChart(ctx, cohort, title) { /** * Create address count chart for grouped cohorts with addrCount - * @param {PartialContext} _ctx * @param {readonly CohortAddress[]} list * @param {(metric: string) => string} title * @returns {PartialChartOption} */ -function createGroupedAddrCountChart(_ctx, list, title) { +function createGroupedAddrCountChart(list, title) { return { name: "address count", title: title("Address Count"), @@ -487,7 +486,7 @@ function createGroupedRealizedSectionWithAdjusted(ctx, list, title, { ratioMetri { name: "Ratio", title: title("Realized Price Ratio"), - bottom: createRealizedPriceRatioSeries(ctx, list), + bottom: createRealizedPriceRatioSeries(list), }, { name: "capitalization", @@ -495,7 +494,7 @@ function createGroupedRealizedSectionWithAdjusted(ctx, list, title, { ratioMetri bottom: createGroupedRealizedCapSeries(list), }, ...createGroupedRealizedPnlSections(ctx, list, title, { ratioMetrics }), - createGroupedSoprSectionWithAdjusted(ctx, list, title), + createGroupedSoprSectionWithAdjusted(list, title), ], }; } @@ -572,7 +571,7 @@ function createGroupedRealizedSectionBasic(ctx, list, title, { ratioMetrics } = { name: "Ratio", title: title("Realized Price Ratio"), - bottom: createRealizedPriceRatioSeries(ctx, list), + bottom: createRealizedPriceRatioSeries(list), }, { name: "capitalization", @@ -580,7 +579,7 @@ function createGroupedRealizedSectionBasic(ctx, list, title, { ratioMetrics } = bottom: createGroupedRealizedCapSeries(list), }, ...createGroupedRealizedPnlSections(ctx, list, title, { ratioMetrics }), - createGroupedSoprSectionBasic(ctx, list, title), + createGroupedSoprSectionBasic(list, title), ], }; } @@ -1148,19 +1147,17 @@ function createSingleAdjustedSoprChart(ctx, cohort, title) { defaultActive: false, options: { baseValue: { price: 1 } }, }), - priceLine({ ctx, number: 1, unit: Unit.ratio }), ], }; } /** * Create grouped base SOPR chart (all UTXO cohorts have base SOPR) - * @param {PartialContext} ctx * @param {readonly (CohortAll | CohortFull | CohortWithAdjusted | CohortLongTerm | CohortAgeRange | CohortBasicWithMarketCap | CohortBasicWithoutMarketCap | CohortAddress)[]} list * @param {(metric: string) => string} title * @returns {PartialChartOption} */ -function createGroupedBaseSoprChart(ctx, list, title) { +function createGroupedBaseSoprChart(list, title) { return { name: "Normal", title: title("SOPR"), @@ -1190,19 +1187,17 @@ function createGroupedBaseSoprChart(ctx, list, title) { base: 1, }), ]), - priceLine({ ctx, number: 1, unit: Unit.ratio }), ], }; } /** * Create grouped adjusted SOPR chart (cohorts with RealizedPattern3/4) - * @param {PartialContext} ctx * @param {readonly (CohortFull | CohortWithAdjusted)[]} list * @param {(metric: string) => string} title * @returns {PartialChartOption} */ -function createGroupedAdjustedSoprChart(ctx, list, title) { +function createGroupedAdjustedSoprChart(list, title) { return { name: "Adjusted", title: title("aSOPR"), @@ -1232,7 +1227,6 @@ function createGroupedAdjustedSoprChart(ctx, list, title) { options: { baseValue: { price: 1 } }, }), ]), - priceLine({ ctx, number: 1, unit: Unit.ratio }), ], }; } @@ -1260,17 +1254,16 @@ function createSingleSoprSectionWithAdjusted(ctx, cohort, title) { /** * Create grouped SOPR section with adjusted SOPR - * @param {PartialContext} ctx * @param {readonly (CohortFull | CohortWithAdjusted)[]} list * @param {(metric: string) => string} title * @returns {PartialOptionsGroup} */ -function createGroupedSoprSectionWithAdjusted(ctx, list, title) { +function createGroupedSoprSectionWithAdjusted(list, title) { return { name: "sopr", tree: [ - createGroupedBaseSoprChart(ctx, list, title), - createGroupedAdjustedSoprChart(ctx, list, title), + createGroupedBaseSoprChart(list, title), + createGroupedAdjustedSoprChart(list, title), ], }; } @@ -1291,15 +1284,14 @@ function createSingleSoprSectionBasic(ctx, cohort, title) { /** * Create grouped SOPR section without adjusted SOPR - * @param {PartialContext} ctx * @param {readonly (CohortWithPercentiles | CohortBasic | CohortAddress)[]} list * @param {(metric: string) => string} title * @returns {PartialOptionsGroup} */ -function createGroupedSoprSectionBasic(ctx, list, title) { +function createGroupedSoprSectionBasic(list, title) { return { name: "sopr", - tree: [createGroupedBaseSoprChart(ctx, list, title)], + tree: [createGroupedBaseSoprChart(list, title)], }; } @@ -1586,15 +1578,13 @@ function createUnrealizedSection({ ctx, tree, title, pnl = [], netPnl = [], char * Generic grouped unrealized section builder - callers pass typed metric generators * @template {readonly { color: Color, name: string, tree: { unrealized: UnrealizedPattern } }[]} T * @param {Object} args - * @param {PartialContext} args.ctx * @param {T} args.list * @param {(metric: string) => string} args.title * @param {(cohort: T[number]) => AnyFetchedSeriesBlueprint[]} [args.netPnlMetrics] - Generator for extra net pnl metrics per cohort - * @param {AnyFetchedSeriesBlueprint[]} [args.priceLines] - Extra price lines for net pnl chart * @param {PartialChartOption[]} [args.charts] - Extra charts * @returns {PartialOptionsGroup} */ -function createGroupedUnrealizedSection({ ctx, list, title, netPnlMetrics, priceLines = [], charts = [] }) { +function createGroupedUnrealizedSection({ list, title, netPnlMetrics, charts = [] }) { return { name: "Unrealized", tree: [ @@ -1612,8 +1602,6 @@ function createGroupedUnrealizedSection({ ctx, list, title, netPnlMetrics, price }), ...(netPnlMetrics ? netPnlMetrics(cohort) : []), ]), - priceLine({ ctx, unit: Unit.usd }), - ...priceLines, ], }, ...charts, @@ -1783,7 +1771,6 @@ function createGroupedUnrealizedBaseCharts(list, title) { */ function createGroupedUnrealizedSectionFull(ctx, list, title) { return createGroupedUnrealizedSection({ - ctx, list, title, netPnlMetrics: ({ color, name, tree }) => [ @@ -1791,11 +1778,6 @@ function createGroupedUnrealizedSectionFull(ctx, list, title) { baseline({ metric: tree.relative.netUnrealizedPnlRelToOwnMarketCap, name, color, unit: Unit.pctOwnMcap }), baseline({ metric: tree.relative.netUnrealizedPnlRelToOwnTotalUnrealizedPnl, name, color, unit: Unit.pctOwnPnl }), ], - priceLines: [ - priceLine({ ctx, unit: Unit.pctMcap }), - priceLine({ ctx, unit: Unit.pctOwnMcap }), - priceLine({ ctx, unit: Unit.pctOwnPnl }), - ], charts: [createGroupedNuplChart(ctx, list, title)], }); } @@ -1808,13 +1790,11 @@ function createGroupedUnrealizedSectionFull(ctx, list, title) { */ function createGroupedUnrealizedSectionWithMarketCap(ctx, list, title) { return createGroupedUnrealizedSection({ - ctx, list, title, netPnlMetrics: ({ color, name, tree }) => [ baseline({ metric: tree.relative.netUnrealizedPnlRelToMarketCap, name, color, unit: Unit.pctMcap }), ], - priceLines: [priceLine({ ctx, unit: Unit.pctMcap })], charts: [createGroupedNuplChart(ctx, list, title)], }); } @@ -1828,25 +1808,22 @@ function createGroupedUnrealizedSectionWithMarketCap(ctx, list, title) { */ function createGroupedUnrealizedSectionWithMarketCapOnly(ctx, list, title) { return createGroupedUnrealizedSection({ - ctx, list, title, netPnlMetrics: ({ color, name, tree }) => [ baseline({ metric: tree.relative.netUnrealizedPnlRelToMarketCap, name, color, unit: Unit.pctMcap }), ], - priceLines: [priceLine({ ctx, unit: Unit.pctMcap })], charts: [createGroupedNuplChart(ctx, list, title)], }); } /** * Grouped unrealized section without RelToMarketCap (for CohortBasicWithoutMarketCap) - * @param {PartialContext} ctx * @param {readonly CohortBasicWithoutMarketCap[]} list * @param {(metric: string) => string} title */ -function createGroupedUnrealizedSectionBase(ctx, list, title) { - return createGroupedUnrealizedSection({ ctx, list, title }); +function createGroupedUnrealizedSectionBase(list, title) { + return createGroupedUnrealizedSection({ list, title }); } /** @@ -1863,10 +1840,12 @@ function createSingleUnrealizedSectionWithNupl({ ctx, cohort, title }) { tree, title, pnl: [ + ...createUnrealizedPnlRelToMarketCapMetrics(ctx, tree.relative), ...createUnrealizedPnlRelToOwnMarketCapMetrics(ctx, tree.relative), ...createUnrealizedPnlRelToOwnPnlMetrics(ctx, tree.relative), ], netPnl: [ + ...createNetUnrealizedPnlRelToMarketCapMetrics(tree.relative), ...createNetUnrealizedPnlRelToOwnMarketCapMetrics(ctx, tree.relative), ...createNetUnrealizedPnlRelToOwnPnlMetrics(ctx, tree.relative), ], @@ -1883,14 +1862,13 @@ function createSingleUnrealizedSectionWithNupl({ ctx, cohort, title }) { */ function createGroupedUnrealizedSectionWithNupl({ ctx, list, title }) { return createGroupedUnrealizedSection({ - ctx, list, title, netPnlMetrics: ({ color, name, tree }) => [ + baseline({ metric: tree.relative.netUnrealizedPnlRelToMarketCap, name, color, unit: Unit.pctMcap }), baseline({ metric: tree.relative.netUnrealizedPnlRelToOwnMarketCap, name, color, unit: Unit.pctOwnMcap }), baseline({ metric: tree.relative.netUnrealizedPnlRelToOwnTotalUnrealizedPnl, name, color, unit: Unit.pctOwnPnl }), ], - priceLines: [priceLine({ ctx, unit: Unit.pctOwnMcap }), priceLine({ ctx, unit: Unit.pctOwnPnl })], charts: [createGroupedNuplChart(ctx, list, title)], }); } @@ -1920,20 +1898,17 @@ function createSingleUnrealizedSectionAgeRange(ctx, cohort, title) { /** * Grouped unrealized section for AgeRange cohorts (no nupl via RelativePattern2) - * @param {PartialContext} ctx * @param {readonly CohortAgeRange[]} list * @param {(metric: string) => string} title */ -function createGroupedUnrealizedSectionAgeRange(ctx, list, title) { +function createGroupedUnrealizedSectionAgeRange(list, title) { return createGroupedUnrealizedSection({ - ctx, list, title, netPnlMetrics: ({ color, name, tree }) => [ baseline({ metric: tree.relative.netUnrealizedPnlRelToOwnMarketCap, name, color, unit: Unit.pctOwnMcap }), baseline({ metric: tree.relative.netUnrealizedPnlRelToOwnTotalUnrealizedPnl, name, color, unit: Unit.pctOwnPnl }), ], - priceLines: [priceLine({ ctx, unit: Unit.pctOwnMcap }), priceLine({ ctx, unit: Unit.pctOwnPnl })], }); } diff --git a/website/scripts/options/market/indicators/onchain.js b/website/scripts/options/market/indicators/onchain.js index a31311be5..4c68c5f51 100644 --- a/website/scripts/options/market/indicators/onchain.js +++ b/website/scripts/options/market/indicators/onchain.js @@ -1,7 +1,6 @@ /** On-chain indicators (Pi Cycle, Puell, NVT, Gini) */ import { Unit } from "../../../utils/units.js"; -import { priceLine } from "../../constants.js"; import { baseline, line } from "../../series.js"; /** diff --git a/website/scripts/options/shared.js b/website/scripts/options/shared.js index 2981ac81d..7dab5a89f 100644 --- a/website/scripts/options/shared.js +++ b/website/scripts/options/shared.js @@ -198,7 +198,6 @@ export function createRatioChart(ctx, { title, price, ratio, color, name }) { options: { lineStyle: 1 }, }), ), - priceLine({ ctx, unit: Unit.ratio, number: 1 }), ], }; } @@ -335,7 +334,6 @@ export function createZScoresFolder( defaultActive: false, }), ), - priceLine({ ctx, unit: Unit.ratio, number: 1 }), priceLine({ ctx, unit: Unit.sd,