diff --git a/Cargo.lock b/Cargo.lock index 5b92b1646..58dc6f5a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1238,9 +1238,9 @@ checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "fjall" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce4b4c3a755bae832077657db2727b29b9acc535bb471c6d91ab4fe408fd805" +checksum = "0ebf22b812878dcd767879cb19e03124fd62563dce6410f96538175fba0c132d" dependencies = [ "byteorder-lite", "byteview", @@ -2020,9 +2020,9 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "lsm-tree" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "341e13fa389d2e24023c2c2c110ae556b29fa59a2e734872de295863e11a6741" +checksum = "e9bfd2a6ea0c1d430c13643002f35800a87f200fc8ac4827f18a2db9d9fd0644" dependencies = [ "byteorder-lite", "byteview", @@ -3070,9 +3070,9 @@ dependencies = [ [[package]] name = "toml" -version = "1.0.3+spec-1.1.0" +version = "1.0.4+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7614eaf19ad818347db24addfa201729cf2a9b6fdfd9eb0ab870fcacc606c0c" +checksum = "c94c3321114413476740df133f0d8862c61d87c8d26f04c6841e033c8c80db47" dependencies = [ "indexmap", "serde_core", @@ -3703,9 +3703,9 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "0.7.14" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" [[package]] name = "wio" diff --git a/Cargo.toml b/Cargo.toml index f72c86113..b44009eee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,7 +68,7 @@ brk_website = { version = "0.1.9", path = "crates/brk_website" } byteview = "0.10.1" color-eyre = "0.6.5" derive_more = { version = "2.1.1", features = ["deref", "deref_mut"] } -fjall = "3.0.3" +fjall = "3.0.4" indexmap = { version = "2.13.0", features = ["serde"] } jiff = { version = "0.2.23", features = ["perf-inline", "tz-system"], default-features = false } minreq = { version = "2.14.1", features = ["https", "json-using-serde"] } diff --git a/crates/brk_cli/Cargo.toml b/crates/brk_cli/Cargo.toml index a0b07e1bb..f960eeeae 100644 --- a/crates/brk_cli/Cargo.toml +++ b/crates/brk_cli/Cargo.toml @@ -26,7 +26,7 @@ owo-colors = { workspace = true } tracing = { workspace = true } serde = { workspace = true } tokio = { workspace = true } -toml = "1.0.3" +toml = "1.0.4" vecdb = { workspace = true } [[bin]] diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index feeb0c233..c3f5bf2f1 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -942,7 +942,7 @@ impl MetricPattern for MetricPattern35 { fn get(&self /// Pattern struct for repeated tree structure. pub struct AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern { pub adjusted_sopr: _1m1w1y24hPattern, - pub adjusted_sopr_ema: _1m1wPattern2, + pub adjusted_sopr_ema: _1m1wPattern, pub adjusted_value_created: MetricPattern1, pub adjusted_value_created_sum: _1m1w1y24hPattern, pub adjusted_value_destroyed: MetricPattern1, @@ -990,13 +990,13 @@ pub struct AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitReal pub realized_profit_sum: _1m1w1y24hPattern, pub realized_profit_to_loss_ratio: _1m1w1y24hPattern, pub sell_side_risk_ratio: _1m1w1y24hPattern2, - pub sell_side_risk_ratio_24h_ema: _1m1wPattern, + pub sell_side_risk_ratio_24h_ema: _1m1wPattern2, pub sent_in_loss: BaseCumulativePattern, pub sent_in_loss_ema: _2wPattern, pub sent_in_profit: BaseCumulativePattern, pub sent_in_profit_ema: _2wPattern, pub sopr: _1m1w1y24hPattern, - pub sopr_24h_ema: _1m1wPattern2, + pub sopr_24h_ema: _1m1wPattern, pub upper_price_band: CentsSatsUsdPattern, pub value_created: MetricPattern1, pub value_created_sum: _1m1w1y24hPattern, @@ -1009,7 +1009,7 @@ impl AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSe pub fn new(client: Arc, acc: String) -> Self { Self { adjusted_sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_sopr")), - adjusted_sopr_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "adjusted_sopr_24h_ema")), + adjusted_sopr_ema: _1m1wPattern::new(client.clone(), _m(&acc, "adjusted_sopr_24h_ema")), adjusted_value_created: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created")), adjusted_value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_value_created")), adjusted_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), @@ -1057,253 +1057,13 @@ impl AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSe realized_profit_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), + sell_side_risk_ratio_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), sent_in_loss: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_loss")), sent_in_loss_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_loss_ema_2w")), sent_in_profit: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_profit")), sent_in_profit_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_profit_ema_2w")), sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), - sopr_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sopr_24h_ema")), - upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")), - value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), - value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_created")), - value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), - value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_destroyed")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 { - pub cap_raw: MetricPattern18, - pub capitulation_flow: MetricPattern1, - pub gross_pnl: CentsUsdPattern, - pub gross_pnl_sum: _1m1w1y24hPattern, - pub investor_cap_raw: MetricPattern18, - pub investor_price: CentsSatsUsdPattern, - pub investor_price_ratio: BpsRatioPattern, - pub investor_price_ratio_percentiles: RatioPattern, - pub investor_price_ratio_std_dev: RatioPattern2, - pub loss_value_created: MetricPattern1, - pub loss_value_destroyed: MetricPattern1, - pub lower_price_band: CentsSatsUsdPattern, - pub mvrv: MetricPattern1, - pub neg_realized_loss: MetricPattern1, - pub net_pnl_change_1m: MetricPattern1, - pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern, - pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern, - pub net_realized_pnl: CumulativeHeightPattern, - pub net_realized_pnl_ema_1w: MetricPattern1, - pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, - pub peak_regret: CumulativeHeightPattern, - pub peak_regret_rel_to_realized_cap: BpsPercentRatioPattern, - pub profit_flow: MetricPattern1, - pub profit_value_created: MetricPattern1, - pub profit_value_destroyed: MetricPattern1, - pub realized_cap: MetricPattern1, - pub realized_cap_cents: MetricPattern1, - pub realized_cap_change_1m: MetricPattern1, - pub realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern, - pub realized_loss: CumulativeHeightPattern, - pub realized_loss_ema_1w: MetricPattern1, - pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, - pub realized_loss_sum: _1m1w1y24hPattern, - pub realized_price: CentsSatsUsdPattern, - pub realized_price_ratio: BpsRatioPattern, - pub realized_price_ratio_percentiles: RatioPattern, - pub realized_price_ratio_std_dev: RatioPattern2, - pub realized_profit: CumulativeHeightPattern, - pub realized_profit_ema_1w: MetricPattern1, - pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, - pub realized_profit_sum: _1m1w1y24hPattern, - pub realized_profit_to_loss_ratio: _1m1w1y24hPattern, - pub sell_side_risk_ratio: _1m1w1y24hPattern2, - pub sell_side_risk_ratio_24h_ema: _1m1wPattern, - pub sent_in_loss: BaseCumulativePattern, - pub sent_in_loss_ema: _2wPattern, - pub sent_in_profit: BaseCumulativePattern, - pub sent_in_profit_ema: _2wPattern, - pub sopr: _1m1w1y24hPattern, - pub sopr_24h_ema: _1m1wPattern2, - pub upper_price_band: CentsSatsUsdPattern, - pub value_created: MetricPattern1, - pub value_created_sum: _1m1w1y24hPattern, - pub value_destroyed: MetricPattern1, - pub value_destroyed_sum: _1m1w1y24hPattern, -} - -impl CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "cap_raw")), - capitulation_flow: MetricPattern1::new(client.clone(), _m(&acc, "capitulation_flow")), - gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_gross_pnl")), - gross_pnl_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "gross_pnl_sum")), - investor_cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "investor_cap_raw")), - investor_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "investor_price")), - investor_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), - investor_price_ratio_percentiles: RatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), - investor_price_ratio_std_dev: RatioPattern2::new(client.clone(), _m(&acc, "investor_price_ratio")), - loss_value_created: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_created")), - loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), - lower_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), - mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), - neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), - net_pnl_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "net_pnl_change_1m")), - net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_market_cap")), - net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_realized_cap")), - net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_ema_1w")), - net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), - peak_regret: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), - peak_regret_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_peak_regret_rel_to_realized_cap")), - profit_flow: MetricPattern1::new(client.clone(), _m(&acc, "profit_flow")), - profit_value_created: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_created")), - profit_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_destroyed")), - realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), - realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), - realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_cap_rel_to_own_market_cap")), - realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), - realized_loss_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_ema_1w")), - realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), - realized_loss_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_loss")), - realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_price_ratio_percentiles: RatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_price_ratio_std_dev: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), - realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")), - realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), - realized_profit_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit")), - realized_profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), - sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), - sent_in_loss: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_loss")), - sent_in_loss_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_loss_ema_2w")), - sent_in_profit: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_profit")), - sent_in_profit_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_profit_ema_2w")), - sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), - sopr_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sopr_24h_ema")), - upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")), - value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), - value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_created")), - value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), - value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_destroyed")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 { - pub adjusted_sopr: _1m1w1y24hPattern, - pub adjusted_sopr_ema: _1m1wPattern2, - pub adjusted_value_created: MetricPattern1, - pub adjusted_value_created_sum: _1m1w1y24hPattern, - pub adjusted_value_destroyed: MetricPattern1, - pub adjusted_value_destroyed_sum: _1m1w1y24hPattern, - pub cap_raw: MetricPattern18, - pub capitulation_flow: MetricPattern1, - pub gross_pnl: CentsUsdPattern, - pub gross_pnl_sum: _1m1w1y24hPattern, - pub investor_cap_raw: MetricPattern18, - pub investor_price: CentsSatsUsdPattern, - pub investor_price_ratio: BpsRatioPattern, - pub loss_value_created: MetricPattern1, - pub loss_value_destroyed: MetricPattern1, - pub lower_price_band: CentsSatsUsdPattern, - pub mvrv: MetricPattern1, - pub neg_realized_loss: MetricPattern1, - pub net_pnl_change_1m: MetricPattern1, - pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern, - pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern, - pub net_realized_pnl: CumulativeHeightPattern, - pub net_realized_pnl_ema_1w: MetricPattern1, - pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, - pub peak_regret: CumulativeHeightPattern, - pub peak_regret_rel_to_realized_cap: BpsPercentRatioPattern, - pub profit_flow: MetricPattern1, - pub profit_value_created: MetricPattern1, - pub profit_value_destroyed: MetricPattern1, - pub realized_cap: MetricPattern1, - pub realized_cap_cents: MetricPattern1, - pub realized_cap_change_1m: MetricPattern1, - pub realized_loss: CumulativeHeightPattern, - pub realized_loss_ema_1w: MetricPattern1, - pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, - pub realized_price: CentsSatsUsdPattern, - pub realized_price_ratio: BpsRatioPattern, - pub realized_profit: CumulativeHeightPattern, - pub realized_profit_ema_1w: MetricPattern1, - pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, - pub sell_side_risk_ratio: _1m1w1y24hPattern2, - pub sell_side_risk_ratio_24h_ema: _1m1wPattern, - pub sent_in_loss: BaseCumulativePattern, - pub sent_in_loss_ema: _2wPattern, - pub sent_in_profit: BaseCumulativePattern, - pub sent_in_profit_ema: _2wPattern, - pub sopr: _1m1w1y24hPattern, - pub sopr_24h_ema: _1m1wPattern2, - pub upper_price_band: CentsSatsUsdPattern, - pub value_created: MetricPattern1, - pub value_created_sum: _1m1w1y24hPattern, - pub value_destroyed: MetricPattern1, - pub value_destroyed_sum: _1m1w1y24hPattern, -} - -impl AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - adjusted_sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_sopr")), - adjusted_sopr_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "adjusted_sopr_24h_ema")), - adjusted_value_created: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created")), - adjusted_value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_value_created")), - adjusted_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), - adjusted_value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), - cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "cap_raw")), - capitulation_flow: MetricPattern1::new(client.clone(), _m(&acc, "capitulation_flow")), - gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_gross_pnl")), - gross_pnl_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "gross_pnl_sum")), - investor_cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "investor_cap_raw")), - investor_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "investor_price")), - investor_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), - loss_value_created: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_created")), - loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), - lower_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), - mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), - neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), - net_pnl_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "net_pnl_change_1m")), - net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_market_cap")), - net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_realized_cap")), - net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_ema_1w")), - net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), - peak_regret: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), - peak_regret_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_peak_regret_rel_to_realized_cap")), - profit_flow: MetricPattern1::new(client.clone(), _m(&acc, "profit_flow")), - profit_value_created: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_created")), - profit_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_destroyed")), - realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), - realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), - realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), - realized_loss_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_ema_1w")), - realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), - realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), - realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")), - realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), - sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), - sent_in_loss: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_loss")), - sent_in_loss_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_loss_ema_2w")), - sent_in_profit: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_profit")), - sent_in_profit_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_profit_ema_2w")), - sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), - sopr_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sopr_24h_ema")), + sopr_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sopr_24h_ema")), upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_created")), @@ -1350,13 +1110,13 @@ pub struct CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSell pub realized_profit_ema_1w: MetricPattern1, pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, pub sell_side_risk_ratio: _1m1w1y24hPattern2, - pub sell_side_risk_ratio_24h_ema: _1m1wPattern, + pub sell_side_risk_ratio_24h_ema: _1m1wPattern2, pub sent_in_loss: BaseCumulativePattern, pub sent_in_loss_ema: _2wPattern, pub sent_in_profit: BaseCumulativePattern, pub sent_in_profit_ema: _2wPattern, pub sopr: _1m1w1y24hPattern, - pub sopr_24h_ema: _1m1wPattern2, + pub sopr_24h_ema: _1m1wPattern, pub upper_price_band: CentsSatsUsdPattern, pub value_created: MetricPattern1, pub value_created_sum: _1m1w1y24hPattern, @@ -1403,13 +1163,13 @@ impl CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSo realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")), realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), + sell_side_risk_ratio_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), sent_in_loss: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_loss")), sent_in_loss_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_loss_ema_2w")), sent_in_profit: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_profit")), sent_in_profit_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_profit_ema_2w")), sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), - sopr_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sopr_24h_ema")), + sopr_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sopr_24h_ema")), upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_created")), @@ -1419,6 +1179,92 @@ impl CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSo } } +/// Pattern struct for repeated tree structure. +pub struct CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern { + pub capitulation_flow: MetricPattern1, + pub gross_pnl: CentsUsdPattern, + pub gross_pnl_sum: _1m1w1y24hPattern, + pub loss_value_created: MetricPattern1, + pub loss_value_destroyed: MetricPattern1, + pub mvrv: MetricPattern1, + pub neg_realized_loss: MetricPattern1, + pub net_pnl_change_1m: MetricPattern1, + pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern, + pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern, + pub net_realized_pnl: CumulativeHeightPattern, + pub net_realized_pnl_ema_1w: MetricPattern1, + pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, + pub profit_flow: MetricPattern1, + pub profit_value_created: MetricPattern1, + pub profit_value_destroyed: MetricPattern1, + pub realized_cap: MetricPattern1, + pub realized_cap_cents: MetricPattern1, + pub realized_cap_change_1m: MetricPattern1, + pub realized_loss: CumulativeHeightPattern, + pub realized_loss_ema_1w: MetricPattern1, + pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, + pub realized_price: CentsSatsUsdPattern, + pub realized_price_ratio: BpsRatioPattern, + pub realized_profit: CumulativeHeightPattern, + pub realized_profit_ema_1w: MetricPattern1, + pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub sent_in_loss: BaseCumulativePattern, + pub sent_in_loss_ema: _2wPattern, + pub sent_in_profit: BaseCumulativePattern, + pub sent_in_profit_ema: _2wPattern, + pub sopr: _1m1w1y24hPattern, + pub sopr_24h_ema: _1m1wPattern, + pub value_created: MetricPattern1, + pub value_created_sum: _1m1w1y24hPattern, + pub value_destroyed: MetricPattern1, + pub value_destroyed_sum: _1m1w1y24hPattern, +} + +impl CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + capitulation_flow: MetricPattern1::new(client.clone(), _m(&acc, "capitulation_flow")), + gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_gross_pnl")), + gross_pnl_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "gross_pnl_sum")), + loss_value_created: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_created")), + loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), + mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), + neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), + net_pnl_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "net_pnl_change_1m")), + net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_market_cap")), + net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_realized_cap")), + net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), + net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_ema_1w")), + net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + profit_flow: MetricPattern1::new(client.clone(), _m(&acc, "profit_flow")), + profit_value_created: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_created")), + profit_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_destroyed")), + realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), + realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), + realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), + realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), + realized_loss_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_ema_1w")), + realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), + realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), + realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")), + realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + sent_in_loss: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_loss")), + sent_in_loss_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_loss_ema_2w")), + sent_in_profit: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_profit")), + sent_in_profit_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_profit_ema_2w")), + sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), + sopr_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sopr_24h_ema")), + value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), + value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_created")), + value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), + value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_destroyed")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern { pub _0sd_price: CentsSatsUsdPattern, @@ -1488,7 +1334,7 @@ impl _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern { } /// Pattern struct for repeated tree structure. -pub struct InvestedNegNetNuplSupplyUnrealizedPattern2 { +pub struct InvestedNegNetNuplSupplyUnrealizedPattern3 { pub invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern, pub invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern, pub neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, @@ -1511,7 +1357,7 @@ pub struct InvestedNegNetNuplSupplyUnrealizedPattern2 { pub unrealized_profit_rel_to_own_market_cap: BpsPercentRatioPattern, } -impl InvestedNegNetNuplSupplyUnrealizedPattern2 { +impl InvestedNegNetNuplSupplyUnrealizedPattern3 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -1539,6 +1385,56 @@ impl InvestedNegNetNuplSupplyUnrealizedPattern2 { } } +/// Pattern struct for repeated tree structure. +pub struct GrossMvrvNegNetRealizedSoprPattern { + pub gross_pnl: CentsUsdPattern, + pub mvrv: MetricPattern1, + pub neg_realized_loss: MetricPattern1, + pub net_realized_pnl: CumulativeHeightPattern, + pub net_realized_pnl_ema_1w: MetricPattern1, + pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, + pub realized_cap: MetricPattern1, + pub realized_cap_cents: MetricPattern1, + pub realized_cap_change_1m: MetricPattern1, + pub realized_loss: CumulativeHeightPattern, + pub realized_loss_ema_1w: MetricPattern1, + pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, + pub realized_price: CentsSatsUsdPattern, + pub realized_price_ratio: BpsRatioPattern, + pub realized_profit: CumulativeHeightPattern, + pub realized_profit_ema_1w: MetricPattern1, + pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub sopr: _1m1w1y24hPattern, + pub sopr_24h_ema: _1m1wPattern, +} + +impl GrossMvrvNegNetRealizedSoprPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_gross_pnl")), + mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), + neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), + net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), + net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_ema_1w")), + net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), + realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), + realized_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), + realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), + realized_loss_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_ema_1w")), + realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), + realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), + realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")), + realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), + sopr_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sopr_24h_ema")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern { pub pct05: CentsSatsUsdPattern, @@ -1925,36 +1821,6 @@ impl AverageGainsLossesRsiStochPattern { } } -/// Pattern struct for repeated tree structure. -pub struct ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern { - pub activity: CoinblocksCoindaysSentPattern, - pub addr_count: MetricPattern1, - pub addr_count_change_1m: MetricPattern1, - pub cost_basis: MaxMinPattern, - pub outputs: UtxoPattern, - pub realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern, - pub relative: InvestedNegNetNuplSupplyUnrealizedPattern, - pub supply: ChangeHalvedTotalPattern, - pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, -} - -impl ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: CoinblocksCoindaysSentPattern::new(client.clone(), acc.clone()), - addr_count: MetricPattern1::new(client.clone(), _m(&acc, "addr_count")), - addr_count_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "addr_count_change_1m")), - cost_basis: MaxMinPattern::new(client.clone(), _m(&acc, "cost_basis")), - outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern::new(client.clone(), acc.clone()), - relative: InvestedNegNetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), - supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), - unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern { pub all: ChangeCountPattern, @@ -2045,6 +1911,36 @@ impl AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern { } } +/// Pattern struct for repeated tree structure. +pub struct NetNuplSupplyUnrealizedPattern { + pub net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern, + pub nupl: MetricPattern1, + pub supply_in_loss_rel_to_circulating_supply: BpsPercentRatioPattern, + pub supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern, + pub supply_in_profit_rel_to_circulating_supply: BpsPercentRatioPattern, + pub supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern, + pub supply_rel_to_circulating_supply: BpsPercentRatioPattern, + pub unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, + pub unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern, +} + +impl NetNuplSupplyUnrealizedPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), + nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")), + supply_in_loss_rel_to_circulating_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), + supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), + supply_in_profit_rel_to_circulating_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), + supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), + supply_rel_to_circulating_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")), + unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), + unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern { pub average: _1m1w1y24hPattern, @@ -2103,6 +1999,34 @@ impl _1m1w1y24hBtcCentsSatsUsdPattern { } } +/// Pattern struct for repeated tree structure. +pub struct ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern { + pub activity: SentPattern, + pub addr_count: MetricPattern1, + pub addr_count_change_1m: MetricPattern1, + pub outputs: UtxoPattern, + pub realized: GrossMvrvNegNetRealizedSoprPattern, + pub relative: NetNuplSupplyUnrealizedPattern, + pub supply: ChangeHalvedTotalPattern, + pub unrealized: NegNetSupplyUnrealizedPattern, +} + +impl ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + activity: SentPattern::new(client.clone(), _m(&acc, "sent")), + addr_count: MetricPattern1::new(client.clone(), _m(&acc, "addr_count")), + addr_count_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "addr_count_change_1m")), + outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), + realized: GrossMvrvNegNetRealizedSoprPattern::new(client.clone(), acc.clone()), + relative: NetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), + supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), + unrealized: NegNetSupplyUnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern { pub average: MetricPattern18, @@ -2160,10 +2084,10 @@ impl _10y2y3y4y5y6y8yPattern { /// Pattern struct for repeated tree structure. pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern { pub activity: CoinblocksCoindaysSentPattern, - pub cost_basis: InvestedMaxMinPercentilesPattern, + pub cost_basis: MaxMinPattern, pub outputs: UtxoPattern, - pub realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2, - pub relative: InvestedNegNetNuplSupplyUnrealizedPattern2, + pub realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern, + pub relative: InvestedNegNetNuplSupplyUnrealizedPattern, pub supply: ChangeHalvedTotalPattern, pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, } @@ -2173,10 +2097,10 @@ impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern { pub fn new(client: Arc, acc: String) -> Self { Self { activity: CoinblocksCoindaysSentPattern::new(client.clone(), acc.clone()), - cost_basis: InvestedMaxMinPercentilesPattern::new(client.clone(), acc.clone()), + cost_basis: MaxMinPattern::new(client.clone(), _m(&acc, "cost_basis")), outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2::new(client.clone(), acc.clone()), - relative: InvestedNegNetNuplSupplyUnrealizedPattern2::new(client.clone(), acc.clone()), + realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern::new(client.clone(), acc.clone()), + relative: InvestedNegNetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), acc.clone()), } @@ -2188,10 +2112,10 @@ pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { pub activity: CoinblocksCoindaysSentPattern, pub cost_basis: MaxMinPattern, pub outputs: UtxoPattern, - pub realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2, - pub relative: InvestedNegNetNuplSupplyUnrealizedPattern, + pub realized: CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern, + pub relative: NetNuplSupplyUnrealizedPattern, pub supply: ChangeHalvedTotalPattern, - pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, + pub unrealized: NegNetSupplyUnrealizedPattern, } impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { @@ -2201,36 +2125,10 @@ impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { activity: CoinblocksCoindaysSentPattern::new(client.clone(), acc.clone()), cost_basis: MaxMinPattern::new(client.clone(), _m(&acc, "cost_basis")), outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2::new(client.clone(), acc.clone()), - relative: InvestedNegNetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), + realized: CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern::new(client.clone(), acc.clone()), + relative: NetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), - unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 { - pub activity: CoinblocksCoindaysSentPattern, - pub cost_basis: MaxMinPattern, - pub outputs: UtxoPattern, - pub realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern, - pub relative: InvestedNegNetNuplSupplyUnrealizedPattern, - pub supply: ChangeHalvedTotalPattern, - pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, -} - -impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: CoinblocksCoindaysSentPattern::new(client.clone(), acc.clone()), - cost_basis: MaxMinPattern::new(client.clone(), _m(&acc, "cost_basis")), - outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern::new(client.clone(), acc.clone()), - relative: InvestedNegNetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), - supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), - unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), acc.clone()), + unrealized: NegNetSupplyUnrealizedPattern::new(client.clone(), acc.clone()), } } } @@ -2259,6 +2157,30 @@ impl _1m1w1y24hBaseCumulativePattern { } } +/// Pattern struct for repeated tree structure. +pub struct ActivityOutputsRealizedRelativeSupplyUnrealizedPattern { + pub activity: SentPattern, + pub outputs: UtxoPattern, + pub realized: GrossMvrvNegNetRealizedSoprPattern, + pub relative: NetNuplSupplyUnrealizedPattern, + pub supply: ChangeHalvedTotalPattern, + pub unrealized: NegNetSupplyUnrealizedPattern, +} + +impl ActivityOutputsRealizedRelativeSupplyUnrealizedPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + activity: SentPattern::new(client.clone(), _m(&acc, "sent")), + outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), + realized: GrossMvrvNegNetRealizedSoprPattern::new(client.clone(), acc.clone()), + relative: NetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), + supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), + unrealized: NegNetSupplyUnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct BalanceBothReactivatedReceivingSendingPattern { pub balance_decreased: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, @@ -2283,6 +2205,30 @@ impl BalanceBothReactivatedReceivingSendingPattern { } } +/// Pattern struct for repeated tree structure. +pub struct NegNetSupplyUnrealizedPattern { + pub neg_unrealized_loss: MetricPattern1, + pub net_unrealized_pnl: CentsUsdPattern, + pub supply_in_loss: BtcCentsSatsUsdPattern, + pub supply_in_profit: BtcCentsSatsUsdPattern, + pub unrealized_loss: CentsUsdPattern, + pub unrealized_profit: CentsUsdPattern, +} + +impl NegNetSupplyUnrealizedPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + neg_unrealized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")), + net_unrealized_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "net_unrealized_pnl")), + supply_in_loss: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "supply_in_loss")), + supply_in_profit: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "supply_in_profit")), + unrealized_loss: CentsUsdPattern::new(client.clone(), _m(&acc, "unrealized_loss")), + unrealized_profit: CentsUsdPattern::new(client.clone(), _m(&acc, "unrealized_profit")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct EmaHistogramLineSignalPattern { pub ema_fast: MetricPattern1, @@ -2305,6 +2251,50 @@ impl EmaHistogramLineSignalPattern { } } +/// Pattern struct for repeated tree structure. +pub struct MvrvRealizedPattern { + pub mvrv: MetricPattern1, + pub realized_cap: MetricPattern1, + pub realized_cap_cents: MetricPattern1, + pub realized_price: CentsSatsUsdPattern, + pub realized_price_ratio: BpsRatioPattern, +} + +impl MvrvRealizedPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), + realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), + realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), + realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), + realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct OutputsRealizedRelativeSupplyUnrealizedPattern { + pub outputs: UtxoPattern, + pub realized: MvrvRealizedPattern, + pub relative: SupplyPattern, + pub supply: ChangeHalvedTotalPattern, + pub unrealized: SupplyPattern2, +} + +impl OutputsRealizedRelativeSupplyUnrealizedPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), + realized: MvrvRealizedPattern::new(client.clone(), acc.clone()), + relative: SupplyPattern::new(client.clone(), _m(&acc, "supply_in")), + supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), + unrealized: SupplyPattern2::new(client.clone(), _m(&acc, "supply_in")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _1m1w1y24hPattern2 { pub _1m: BpsPercentRatioPattern, @@ -2628,12 +2618,12 @@ impl CumulativeHeightSumPattern { } /// Pattern struct for repeated tree structure. -pub struct _1m1wPattern { +pub struct _1m1wPattern2 { pub _1m: BpsPercentRatioPattern, pub _1w: BpsPercentRatioPattern, } -impl _1m1wPattern { +impl _1m1wPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2644,12 +2634,12 @@ impl _1m1wPattern { } /// Pattern struct for repeated tree structure. -pub struct _1m1wPattern2 { +pub struct _1m1wPattern { pub _1m: MetricPattern1, pub _1w: MetricPattern1, } -impl _1m1wPattern2 { +impl _1m1wPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2755,6 +2745,54 @@ impl SdSmaPattern { } } +/// Pattern struct for repeated tree structure. +pub struct SentPattern { + pub sent: BaseCumulativePattern, + pub sent_ema: _2wPattern, +} + +impl SentPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + sent: BaseCumulativePattern::new(client.clone(), acc.clone()), + sent_ema: _2wPattern::new(client.clone(), _m(&acc, "ema_2w")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct SupplyPattern2 { + pub supply_in_loss: BtcCentsSatsUsdPattern, + pub supply_in_profit: BtcCentsSatsUsdPattern, +} + +impl SupplyPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + supply_in_loss: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "loss")), + supply_in_profit: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "profit")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct SupplyPattern { + pub supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern, + pub supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern, +} + +impl SupplyPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "loss_rel_to_own_supply")), + supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "profit_rel_to_own_supply")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct UtxoPattern { pub utxo_count: MetricPattern1, @@ -5571,7 +5609,7 @@ impl MetricsTree_Distribution_AddressesData { pub struct MetricsTree_Distribution_UtxoCohorts { pub all: MetricsTree_Distribution_UtxoCohorts_All, pub sth: MetricsTree_Distribution_UtxoCohorts_Sth, - pub lth: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern, + pub lth: MetricsTree_Distribution_UtxoCohorts_Lth, pub age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange, pub max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge, pub min_age: MetricsTree_Distribution_UtxoCohorts_MinAge, @@ -5588,7 +5626,7 @@ impl MetricsTree_Distribution_UtxoCohorts { Self { all: MetricsTree_Distribution_UtxoCohorts_All::new(client.clone(), format!("{base_path}_all")), sth: MetricsTree_Distribution_UtxoCohorts_Sth::new(client.clone(), format!("{base_path}_sth")), - lth: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "lth".to_string()), + lth: MetricsTree_Distribution_UtxoCohorts_Lth::new(client.clone(), format!("{base_path}_lth")), age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange::new(client.clone(), format!("{base_path}_age_range")), max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge::new(client.clone(), format!("{base_path}_max_age")), min_age: MetricsTree_Distribution_UtxoCohorts_MinAge::new(client.clone(), format!("{base_path}_min_age")), @@ -5629,15 +5667,15 @@ impl MetricsTree_Distribution_UtxoCohorts_All { /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_All_Relative { + pub neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, + pub invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern, pub supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern, pub supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern, pub unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern, pub unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, - pub neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, pub net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern, pub nupl: MetricPattern1, - pub invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern, - pub invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern, pub unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern, pub unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern, pub neg_unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern, @@ -5647,15 +5685,15 @@ pub struct MetricsTree_Distribution_UtxoCohorts_All_Relative { impl MetricsTree_Distribution_UtxoCohorts_All_Relative { pub fn new(client: Arc, base_path: String) -> Self { Self { + neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "neg_unrealized_loss_rel_to_market_cap".to_string()), + invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "invested_capital_in_profit_rel_to_realized_cap".to_string()), + invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "invested_capital_in_loss_rel_to_realized_cap".to_string()), supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), "supply_in_profit_rel_to_own_supply".to_string()), supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), "supply_in_loss_rel_to_own_supply".to_string()), unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "unrealized_profit_rel_to_market_cap".to_string()), unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "unrealized_loss_rel_to_market_cap".to_string()), - neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "neg_unrealized_loss_rel_to_market_cap".to_string()), net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "net_unrealized_pnl_rel_to_market_cap".to_string()), nupl: MetricPattern1::new(client.clone(), "nupl".to_string()), - invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "invested_capital_in_profit_rel_to_realized_cap".to_string()), - invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "invested_capital_in_loss_rel_to_realized_cap".to_string()), unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), "unrealized_profit_rel_to_own_gross_pnl".to_string()), unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), "unrealized_loss_rel_to_own_gross_pnl".to_string()), neg_unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), "neg_unrealized_loss_rel_to_own_gross_pnl".to_string()), @@ -5672,7 +5710,7 @@ pub struct MetricsTree_Distribution_UtxoCohorts_Sth { pub realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern, pub cost_basis: InvestedMaxMinPercentilesPattern, pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, - pub relative: InvestedNegNetNuplSupplyUnrealizedPattern2, + pub relative: InvestedNegNetNuplSupplyUnrealizedPattern3, } impl MetricsTree_Distribution_UtxoCohorts_Sth { @@ -5684,7 +5722,153 @@ impl MetricsTree_Distribution_UtxoCohorts_Sth { realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern::new(client.clone(), "sth".to_string()), cost_basis: InvestedMaxMinPercentilesPattern::new(client.clone(), "sth".to_string()), unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), "sth".to_string()), - relative: InvestedNegNetNuplSupplyUnrealizedPattern2::new(client.clone(), "sth".to_string()), + relative: InvestedNegNetNuplSupplyUnrealizedPattern3::new(client.clone(), "sth".to_string()), + } + } +} + +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Lth { + pub supply: ChangeHalvedTotalPattern, + pub outputs: UtxoPattern, + pub activity: CoinblocksCoindaysSentPattern, + pub realized: MetricsTree_Distribution_UtxoCohorts_Lth_Realized, + pub cost_basis: InvestedMaxMinPercentilesPattern, + pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, + pub relative: InvestedNegNetNuplSupplyUnrealizedPattern3, +} + +impl MetricsTree_Distribution_UtxoCohorts_Lth { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + supply: ChangeHalvedTotalPattern::new(client.clone(), "lth_supply".to_string()), + outputs: UtxoPattern::new(client.clone(), "lth_utxo_count".to_string()), + activity: CoinblocksCoindaysSentPattern::new(client.clone(), "lth".to_string()), + realized: MetricsTree_Distribution_UtxoCohorts_Lth_Realized::new(client.clone(), format!("{base_path}_realized")), + cost_basis: InvestedMaxMinPercentilesPattern::new(client.clone(), "lth".to_string()), + unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), "lth".to_string()), + relative: InvestedNegNetNuplSupplyUnrealizedPattern3::new(client.clone(), "lth".to_string()), + } + } +} + +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Lth_Realized { + pub investor_price: CentsSatsUsdPattern, + pub investor_price_ratio: BpsRatioPattern, + pub lower_price_band: CentsSatsUsdPattern, + pub upper_price_band: CentsSatsUsdPattern, + pub cap_raw: MetricPattern18, + pub investor_cap_raw: MetricPattern18, + pub sell_side_risk_ratio: _1m1w1y24hPattern2, + pub sell_side_risk_ratio_24h_ema: _1m1wPattern2, + pub peak_regret: CumulativeHeightPattern, + pub peak_regret_rel_to_realized_cap: BpsPercentRatioPattern, + pub profit_value_created: MetricPattern1, + pub profit_value_destroyed: MetricPattern1, + pub loss_value_created: MetricPattern1, + pub loss_value_destroyed: MetricPattern1, + pub value_created: MetricPattern1, + pub value_destroyed: MetricPattern1, + pub capitulation_flow: MetricPattern1, + pub profit_flow: MetricPattern1, + pub value_created_sum: _1m1w1y24hPattern, + pub value_destroyed_sum: _1m1w1y24hPattern, + pub gross_pnl_sum: _1m1w1y24hPattern, + pub net_pnl_change_1m: MetricPattern1, + pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern, + pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern, + pub sent_in_profit: BaseCumulativePattern, + pub sent_in_profit_ema: _2wPattern, + pub sent_in_loss: BaseCumulativePattern, + pub sent_in_loss_ema: _2wPattern, + pub realized_cap_cents: MetricPattern1, + pub realized_profit: CumulativeHeightPattern, + pub realized_loss: CumulativeHeightPattern, + pub realized_cap: MetricPattern1, + pub realized_price: CentsSatsUsdPattern, + pub realized_price_ratio: BpsRatioPattern, + pub realized_cap_change_1m: MetricPattern1, + pub mvrv: MetricPattern1, + pub neg_realized_loss: MetricPattern1, + pub net_realized_pnl: CumulativeHeightPattern, + pub net_realized_pnl_ema_1w: MetricPattern1, + pub gross_pnl: CentsUsdPattern, + pub realized_profit_ema_1w: MetricPattern1, + pub realized_loss_ema_1w: MetricPattern1, + pub sopr: _1m1w1y24hPattern, + pub sopr_24h_ema: _1m1wPattern, + pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, + pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, + pub realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern, + pub realized_profit_sum: _1m1w1y24hPattern, + pub realized_loss_sum: _1m1w1y24hPattern, + pub realized_profit_to_loss_ratio: _1m1w1y24hPattern, + pub realized_price_ratio_percentiles: RatioPattern, + pub realized_price_ratio_std_dev: RatioPattern2, + pub investor_price_ratio_percentiles: RatioPattern, + pub investor_price_ratio_std_dev: RatioPattern2, +} + +impl MetricsTree_Distribution_UtxoCohorts_Lth_Realized { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + investor_price: CentsSatsUsdPattern::new(client.clone(), "lth_investor_price".to_string()), + investor_price_ratio: BpsRatioPattern::new(client.clone(), "lth_investor_price_ratio".to_string()), + lower_price_band: CentsSatsUsdPattern::new(client.clone(), "lth_lower_price_band".to_string()), + upper_price_band: CentsSatsUsdPattern::new(client.clone(), "lth_upper_price_band".to_string()), + cap_raw: MetricPattern18::new(client.clone(), "lth_cap_raw".to_string()), + investor_cap_raw: MetricPattern18::new(client.clone(), "lth_investor_cap_raw".to_string()), + sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), "lth_sell_side_risk_ratio".to_string()), + sell_side_risk_ratio_24h_ema: _1m1wPattern2::new(client.clone(), "lth_sell_side_risk_ratio_24h_ema".to_string()), + peak_regret: CumulativeHeightPattern::new(client.clone(), "lth_realized_peak_regret".to_string()), + peak_regret_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "lth_realized_peak_regret_rel_to_realized_cap".to_string()), + profit_value_created: MetricPattern1::new(client.clone(), "lth_profit_value_created".to_string()), + profit_value_destroyed: MetricPattern1::new(client.clone(), "lth_profit_value_destroyed".to_string()), + loss_value_created: MetricPattern1::new(client.clone(), "lth_loss_value_created".to_string()), + loss_value_destroyed: MetricPattern1::new(client.clone(), "lth_loss_value_destroyed".to_string()), + value_created: MetricPattern1::new(client.clone(), "lth_value_created".to_string()), + value_destroyed: MetricPattern1::new(client.clone(), "lth_value_destroyed".to_string()), + capitulation_flow: MetricPattern1::new(client.clone(), "lth_capitulation_flow".to_string()), + profit_flow: MetricPattern1::new(client.clone(), "lth_profit_flow".to_string()), + value_created_sum: _1m1w1y24hPattern::new(client.clone(), "lth_value_created".to_string()), + value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), "lth_value_destroyed".to_string()), + gross_pnl_sum: _1m1w1y24hPattern::new(client.clone(), "lth_gross_pnl_sum".to_string()), + net_pnl_change_1m: MetricPattern1::new(client.clone(), "lth_net_pnl_change_1m".to_string()), + net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "lth_net_pnl_change_1m_rel_to_realized_cap".to_string()), + net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "lth_net_pnl_change_1m_rel_to_market_cap".to_string()), + sent_in_profit: BaseCumulativePattern::new(client.clone(), "lth_sent_in_profit".to_string()), + sent_in_profit_ema: _2wPattern::new(client.clone(), "lth_sent_in_profit_ema_2w".to_string()), + sent_in_loss: BaseCumulativePattern::new(client.clone(), "lth_sent_in_loss".to_string()), + sent_in_loss_ema: _2wPattern::new(client.clone(), "lth_sent_in_loss_ema_2w".to_string()), + realized_cap_cents: MetricPattern1::new(client.clone(), "lth_realized_cap_cents".to_string()), + realized_profit: CumulativeHeightPattern::new(client.clone(), "lth_realized_profit".to_string()), + realized_loss: CumulativeHeightPattern::new(client.clone(), "lth_realized_loss".to_string()), + realized_cap: MetricPattern1::new(client.clone(), "lth_realized_cap".to_string()), + realized_price: CentsSatsUsdPattern::new(client.clone(), "lth_realized_price".to_string()), + realized_price_ratio: BpsRatioPattern::new(client.clone(), "lth_realized_price_ratio".to_string()), + realized_cap_change_1m: MetricPattern1::new(client.clone(), "lth_realized_cap_change_1m".to_string()), + mvrv: MetricPattern1::new(client.clone(), "lth_mvrv".to_string()), + neg_realized_loss: MetricPattern1::new(client.clone(), "lth_neg_realized_loss".to_string()), + net_realized_pnl: CumulativeHeightPattern::new(client.clone(), "lth_net_realized_pnl".to_string()), + net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), "lth_net_realized_pnl_ema_1w".to_string()), + gross_pnl: CentsUsdPattern::new(client.clone(), "lth_realized_gross_pnl".to_string()), + realized_profit_ema_1w: MetricPattern1::new(client.clone(), "lth_realized_profit_ema_1w".to_string()), + realized_loss_ema_1w: MetricPattern1::new(client.clone(), "lth_realized_loss_ema_1w".to_string()), + sopr: _1m1w1y24hPattern::new(client.clone(), "lth_sopr".to_string()), + sopr_24h_ema: _1m1wPattern::new(client.clone(), "lth_sopr_24h_ema".to_string()), + realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "lth_realized_profit_rel_to_realized_cap".to_string()), + realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "lth_realized_loss_rel_to_realized_cap".to_string()), + net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "lth_net_realized_pnl_rel_to_realized_cap".to_string()), + realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), "lth_realized_cap_rel_to_own_market_cap".to_string()), + realized_profit_sum: _1m1w1y24hPattern::new(client.clone(), "lth_realized_profit".to_string()), + realized_loss_sum: _1m1w1y24hPattern::new(client.clone(), "lth_realized_loss".to_string()), + realized_profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), "lth_realized_profit_to_loss_ratio".to_string()), + realized_price_ratio_percentiles: RatioPattern::new(client.clone(), "lth_realized_price_ratio".to_string()), + realized_price_ratio_std_dev: RatioPattern2::new(client.clone(), "lth_realized_price_ratio".to_string()), + investor_price_ratio_percentiles: RatioPattern::new(client.clone(), "lth_investor_price_ratio".to_string()), + investor_price_ratio_std_dev: RatioPattern2::new(client.clone(), "lth_investor_price_ratio".to_string()), } } } @@ -5791,263 +5975,263 @@ impl MetricsTree_Distribution_UtxoCohorts_MaxAge { /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_MinAge { - pub _1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, + pub _1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, + pub _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, } impl MetricsTree_Distribution_UtxoCohorts_MinAge { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_1d_old".to_string()), - _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_1w_old".to_string()), - _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_1m_old".to_string()), - _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_2m_old".to_string()), - _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_3m_old".to_string()), - _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_4m_old".to_string()), - _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_5m_old".to_string()), - _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_6m_old".to_string()), - _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_1y_old".to_string()), - _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_2y_old".to_string()), - _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_3y_old".to_string()), - _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_4y_old".to_string()), - _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_5y_old".to_string()), - _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_6y_old".to_string()), - _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_7y_old".to_string()), - _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_8y_old".to_string()), - _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_10y_old".to_string()), - _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_12y_old".to_string()), + _1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_1d_old".to_string()), + _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_1w_old".to_string()), + _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_1m_old".to_string()), + _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_2m_old".to_string()), + _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_3m_old".to_string()), + _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_4m_old".to_string()), + _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_5m_old".to_string()), + _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_6m_old".to_string()), + _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_1y_old".to_string()), + _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_2y_old".to_string()), + _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_3y_old".to_string()), + _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_4y_old".to_string()), + _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_5y_old".to_string()), + _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_6y_old".to_string()), + _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_7y_old".to_string()), + _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_8y_old".to_string()), + _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_10y_old".to_string()), + _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_12y_old".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_GeAmount { - pub _1sat: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, + pub _1sat: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, } impl MetricsTree_Distribution_UtxoCohorts_GeAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1sat: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_1sat".to_string()), - _10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_10sats".to_string()), - _100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_100sats".to_string()), - _1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_1k_sats".to_string()), - _10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_10k_sats".to_string()), - _100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_100k_sats".to_string()), - _1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_1m_sats".to_string()), - _10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_10m_sats".to_string()), - _1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_1btc".to_string()), - _10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_10btc".to_string()), - _100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_100btc".to_string()), - _1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_1k_btc".to_string()), - _10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_over_10k_btc".to_string()), + _1sat: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1sat".to_string()), + _10sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10sats".to_string()), + _100sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_100sats".to_string()), + _1k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1k_sats".to_string()), + _10k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10k_sats".to_string()), + _100k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_100k_sats".to_string()), + _1m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1m_sats".to_string()), + _10m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10m_sats".to_string()), + _1btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1btc".to_string()), + _10btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10btc".to_string()), + _100btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_100btc".to_string()), + _1k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1k_btc".to_string()), + _10k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_over_10k_btc".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_AmountRange { - pub _0sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1sat_to_10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10sats_to_100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100sats_to_1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1k_sats_to_10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10k_sats_to_100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100k_sats_to_1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1m_sats_to_10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10m_sats_to_1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1btc_to_10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10btc_to_100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100btc_to_1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1k_btc_to_10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10k_btc_to_100k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100k_btc_or_more: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, + pub _0sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1sat_to_10sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10sats_to_100sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100sats_to_1k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_sats_to_10k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_sats_to_100k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_sats_to_1m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1m_sats_to_10m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10m_sats_to_1btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1btc_to_10btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10btc_to_100btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100btc_to_1k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_btc_to_10k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_btc_to_100k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_btc_or_more: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, } impl MetricsTree_Distribution_UtxoCohorts_AmountRange { pub fn new(client: Arc, base_path: String) -> Self { Self { - _0sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_with_0sats".to_string()), - _1sat_to_10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_1sat_under_10sats".to_string()), - _10sats_to_100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_10sats_under_100sats".to_string()), - _100sats_to_1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_100sats_under_1k_sats".to_string()), - _1k_sats_to_10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_1k_sats_under_10k_sats".to_string()), - _10k_sats_to_100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_10k_sats_under_100k_sats".to_string()), - _100k_sats_to_1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_100k_sats_under_1m_sats".to_string()), - _1m_sats_to_10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_1m_sats_under_10m_sats".to_string()), - _10m_sats_to_1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_10m_sats_under_1btc".to_string()), - _1btc_to_10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_1btc_under_10btc".to_string()), - _10btc_to_100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_10btc_under_100btc".to_string()), - _100btc_to_1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_100btc_under_1k_btc".to_string()), - _1k_btc_to_10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_1k_btc_under_10k_btc".to_string()), - _10k_btc_to_100k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_10k_btc_under_100k_btc".to_string()), - _100k_btc_or_more: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_above_100k_btc".to_string()), + _0sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_with_0sats".to_string()), + _1sat_to_10sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_1sat_under_10sats".to_string()), + _10sats_to_100sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_10sats_under_100sats".to_string()), + _100sats_to_1k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_100sats_under_1k_sats".to_string()), + _1k_sats_to_10k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_1k_sats_under_10k_sats".to_string()), + _10k_sats_to_100k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_10k_sats_under_100k_sats".to_string()), + _100k_sats_to_1m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_100k_sats_under_1m_sats".to_string()), + _1m_sats_to_10m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_1m_sats_under_10m_sats".to_string()), + _10m_sats_to_1btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_10m_sats_under_1btc".to_string()), + _1btc_to_10btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_1btc_under_10btc".to_string()), + _10btc_to_100btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_10btc_under_100btc".to_string()), + _100btc_to_1k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_100btc_under_1k_btc".to_string()), + _1k_btc_to_10k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_1k_btc_under_10k_btc".to_string()), + _10k_btc_to_100k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_10k_btc_under_100k_btc".to_string()), + _100k_btc_or_more: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_above_100k_btc".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_LtAmount { - pub _10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _100k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, + pub _10sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, } impl MetricsTree_Distribution_UtxoCohorts_LtAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_10sats".to_string()), - _100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_100sats".to_string()), - _1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_1k_sats".to_string()), - _10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_10k_sats".to_string()), - _100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_100k_sats".to_string()), - _1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_1m_sats".to_string()), - _10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_10m_sats".to_string()), - _1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_1btc".to_string()), - _10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_10btc".to_string()), - _100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_100btc".to_string()), - _1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_1k_btc".to_string()), - _10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_10k_btc".to_string()), - _100k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "utxos_under_100k_btc".to_string()), + _10sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_10sats".to_string()), + _100sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_100sats".to_string()), + _1k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1k_sats".to_string()), + _10k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_10k_sats".to_string()), + _100k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_100k_sats".to_string()), + _1m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1m_sats".to_string()), + _10m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_10m_sats".to_string()), + _1btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1btc".to_string()), + _10btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_10btc".to_string()), + _100btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_100btc".to_string()), + _1k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1k_btc".to_string()), + _10k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_10k_btc".to_string()), + _100k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "utxos_under_100k_btc".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_Epoch { - pub _0: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _1: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _3: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _4: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, + pub _0: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _3: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _4: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, } impl MetricsTree_Distribution_UtxoCohorts_Epoch { pub fn new(client: Arc, base_path: String) -> Self { Self { - _0: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "epoch_0".to_string()), - _1: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "epoch_1".to_string()), - _2: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "epoch_2".to_string()), - _3: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "epoch_3".to_string()), - _4: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "epoch_4".to_string()), + _0: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "epoch_0".to_string()), + _1: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "epoch_1".to_string()), + _2: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "epoch_2".to_string()), + _3: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "epoch_3".to_string()), + _4: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "epoch_4".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_Class { - pub _2009: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2010: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2011: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2012: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2013: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2014: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2015: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2016: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2017: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2018: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2019: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2020: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2021: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2022: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2023: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2024: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2025: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub _2026: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, + pub _2009: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2010: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2011: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2012: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2013: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2014: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2015: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2016: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2017: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2018: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2019: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2020: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2021: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2022: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2023: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2024: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2025: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _2026: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern, } impl MetricsTree_Distribution_UtxoCohorts_Class { pub fn new(client: Arc, base_path: String) -> Self { Self { - _2009: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2009".to_string()), - _2010: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2010".to_string()), - _2011: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2011".to_string()), - _2012: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2012".to_string()), - _2013: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2013".to_string()), - _2014: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2014".to_string()), - _2015: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2015".to_string()), - _2016: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2016".to_string()), - _2017: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2017".to_string()), - _2018: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2018".to_string()), - _2019: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2019".to_string()), - _2020: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2020".to_string()), - _2021: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2021".to_string()), - _2022: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2022".to_string()), - _2023: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2023".to_string()), - _2024: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2024".to_string()), - _2025: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2025".to_string()), - _2026: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "class_2026".to_string()), + _2009: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2009".to_string()), + _2010: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2010".to_string()), + _2011: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2011".to_string()), + _2012: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2012".to_string()), + _2013: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2013".to_string()), + _2014: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2014".to_string()), + _2015: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2015".to_string()), + _2016: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2016".to_string()), + _2017: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2017".to_string()), + _2018: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2018".to_string()), + _2019: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2019".to_string()), + _2020: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2020".to_string()), + _2021: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2021".to_string()), + _2022: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2022".to_string()), + _2023: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2023".to_string()), + _2024: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2024".to_string()), + _2025: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2025".to_string()), + _2026: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "class_2026".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_Type { - pub p2pk65: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub p2pk33: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub p2pkh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub p2ms: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub p2sh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub p2wpkh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub p2wsh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub p2tr: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub p2a: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub unknown: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub empty: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, + pub p2pk65: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub p2pk33: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub p2pkh: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub p2ms: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub p2sh: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub p2wpkh: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub p2wsh: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub p2tr: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub p2a: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub unknown: OutputsRealizedRelativeSupplyUnrealizedPattern, + pub empty: OutputsRealizedRelativeSupplyUnrealizedPattern, } impl MetricsTree_Distribution_UtxoCohorts_Type { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2pk65: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "p2pk65".to_string()), - p2pk33: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "p2pk33".to_string()), - p2pkh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "p2pkh".to_string()), - p2ms: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "p2ms".to_string()), - p2sh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "p2sh".to_string()), - p2wpkh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "p2wpkh".to_string()), - p2wsh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "p2wsh".to_string()), - p2tr: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "p2tr".to_string()), - p2a: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "p2a".to_string()), - unknown: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "unknown_outputs".to_string()), - empty: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "empty_outputs".to_string()), + p2pk65: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "p2pk65".to_string()), + p2pk33: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "p2pk33".to_string()), + p2pkh: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "p2pkh".to_string()), + p2ms: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "p2ms".to_string()), + p2sh: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "p2sh".to_string()), + p2wpkh: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "p2wpkh".to_string()), + p2wsh: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "p2wsh".to_string()), + p2tr: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "p2tr".to_string()), + p2a: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "p2a".to_string()), + unknown: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "unknown_outputs".to_string()), + empty: OutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "empty_outputs".to_string()), } } } @@ -6071,115 +6255,115 @@ impl MetricsTree_Distribution_AddressCohorts { /// Metrics tree node. pub struct MetricsTree_Distribution_AddressCohorts_GeAmount { - pub _1sat: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1sat: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, } impl MetricsTree_Distribution_AddressCohorts_GeAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1sat: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1sat".to_string()), - _10sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10sats".to_string()), - _100sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100sats".to_string()), - _1k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1k_sats".to_string()), - _10k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10k_sats".to_string()), - _100k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100k_sats".to_string()), - _1m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1m_sats".to_string()), - _10m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10m_sats".to_string()), - _1btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1btc".to_string()), - _10btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10btc".to_string()), - _100btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100btc".to_string()), - _1k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1k_btc".to_string()), - _10k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10k_btc".to_string()), + _1sat: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1sat".to_string()), + _10sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10sats".to_string()), + _100sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100sats".to_string()), + _1k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1k_sats".to_string()), + _10k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10k_sats".to_string()), + _100k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100k_sats".to_string()), + _1m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1m_sats".to_string()), + _10m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10m_sats".to_string()), + _1btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1btc".to_string()), + _10btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10btc".to_string()), + _100btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_100btc".to_string()), + _1k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1k_btc".to_string()), + _10k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_over_10k_btc".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_AddressCohorts_AmountRange { - pub _0sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1sat_to_10sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10sats_to_100sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100sats_to_1k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1k_sats_to_10k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10k_sats_to_100k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100k_sats_to_1m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1m_sats_to_10m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10m_sats_to_1btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1btc_to_10btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10btc_to_100btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100btc_to_1k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1k_btc_to_10k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10k_btc_to_100k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100k_btc_or_more: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _0sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1sat_to_10sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10sats_to_100sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100sats_to_1k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_sats_to_10k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_sats_to_100k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_sats_to_1m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1m_sats_to_10m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10m_sats_to_1btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1btc_to_10btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10btc_to_100btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100btc_to_1k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_btc_to_10k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_btc_to_100k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_btc_or_more: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, } impl MetricsTree_Distribution_AddressCohorts_AmountRange { pub fn new(client: Arc, base_path: String) -> Self { Self { - _0sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_with_0sats".to_string()), - _1sat_to_10sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1sat_under_10sats".to_string()), - _10sats_to_100sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10sats_under_100sats".to_string()), - _100sats_to_1k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_100sats_under_1k_sats".to_string()), - _1k_sats_to_10k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1k_sats_under_10k_sats".to_string()), - _10k_sats_to_100k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10k_sats_under_100k_sats".to_string()), - _100k_sats_to_1m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_100k_sats_under_1m_sats".to_string()), - _1m_sats_to_10m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1m_sats_under_10m_sats".to_string()), - _10m_sats_to_1btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10m_sats_under_1btc".to_string()), - _1btc_to_10btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1btc_under_10btc".to_string()), - _10btc_to_100btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10btc_under_100btc".to_string()), - _100btc_to_1k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_100btc_under_1k_btc".to_string()), - _1k_btc_to_10k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1k_btc_under_10k_btc".to_string()), - _10k_btc_to_100k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10k_btc_under_100k_btc".to_string()), - _100k_btc_or_more: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_100k_btc".to_string()), + _0sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_with_0sats".to_string()), + _1sat_to_10sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1sat_under_10sats".to_string()), + _10sats_to_100sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10sats_under_100sats".to_string()), + _100sats_to_1k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_100sats_under_1k_sats".to_string()), + _1k_sats_to_10k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1k_sats_under_10k_sats".to_string()), + _10k_sats_to_100k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10k_sats_under_100k_sats".to_string()), + _100k_sats_to_1m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_100k_sats_under_1m_sats".to_string()), + _1m_sats_to_10m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1m_sats_under_10m_sats".to_string()), + _10m_sats_to_1btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10m_sats_under_1btc".to_string()), + _1btc_to_10btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1btc_under_10btc".to_string()), + _10btc_to_100btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10btc_under_100btc".to_string()), + _100btc_to_1k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_100btc_under_1k_btc".to_string()), + _1k_btc_to_10k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_1k_btc_under_10k_btc".to_string()), + _10k_btc_to_100k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_10k_btc_under_100k_btc".to_string()), + _100k_btc_or_more: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_above_100k_btc".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_AddressCohorts_LtAmount { - pub _10sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _1k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _10k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, - pub _100k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _1k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _10k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, + pub _100k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern, } impl MetricsTree_Distribution_AddressCohorts_LtAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { - _10sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10sats".to_string()), - _100sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100sats".to_string()), - _1k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1k_sats".to_string()), - _10k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10k_sats".to_string()), - _100k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100k_sats".to_string()), - _1m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1m_sats".to_string()), - _10m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10m_sats".to_string()), - _1btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1btc".to_string()), - _10btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10btc".to_string()), - _100btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100btc".to_string()), - _1k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1k_btc".to_string()), - _10k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10k_btc".to_string()), - _100k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100k_btc".to_string()), + _10sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10sats".to_string()), + _100sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100sats".to_string()), + _1k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1k_sats".to_string()), + _10k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10k_sats".to_string()), + _100k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100k_sats".to_string()), + _1m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1m_sats".to_string()), + _10m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10m_sats".to_string()), + _1btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1btc".to_string()), + _10btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10btc".to_string()), + _100btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100btc".to_string()), + _1k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_1k_btc".to_string()), + _10k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10k_btc".to_string()), + _100k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern::new(client.clone(), "addrs_under_100k_btc".to_string()), } } } diff --git a/crates/brk_computer/src/distribution/cohorts/address/groups.rs b/crates/brk_computer/src/distribution/cohorts/address/groups.rs index 24b666726..3e6d6ec27 100644 --- a/crates/brk_computer/src/distribution/cohorts/address/groups.rs +++ b/crates/brk_computer/src/distribution/cohorts/address/groups.rs @@ -12,8 +12,6 @@ use vecdb::{AnyStoredVec, Database, Exit, ReadableVec, Rw, StorageMode}; use crate::{blocks, distribution::DynCohortVecs, indexes, prices}; -use crate::distribution::metrics::CohortMetricsBase; - use super::{super::traits::CohortVecs, vecs::AddressCohortVecs}; const VERSION: Version = Version::new(0); @@ -97,7 +95,6 @@ impl AddressCohorts { starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { - // 1. Compute addr_count_change_1m using rolling window self.par_iter_mut().try_for_each(|v| { v.addr_count_change_1m.height.compute_rolling_change( starting_indexes.height, @@ -107,18 +104,9 @@ impl AddressCohorts { ) })?; - // 2. Compute all metrics except net_sentiment self.par_iter_mut() .try_for_each(|v| v.compute_rest_part1(blocks, prices, starting_indexes, exit))?; - // 3. Compute net_sentiment.height for aggregate cohorts (weighted average). - // Separate cohorts already computed net_sentiment in step 2 (inside compute_rest_part1). - self.for_each_aggregate(|vecs, sources| { - let metrics: Vec<_> = sources.iter().map(|v| &v.metrics).collect(); - vecs.metrics - .compute_net_sentiment_from_others(starting_indexes, &metrics, exit) - })?; - Ok(()) } diff --git a/crates/brk_computer/src/distribution/cohorts/address/vecs.rs b/crates/brk_computer/src/distribution/cohorts/address/vecs.rs index dd7f56bec..ae4fafb1b 100644 --- a/crates/brk_computer/src/distribution/cohorts/address/vecs.rs +++ b/crates/brk_computer/src/distribution/cohorts/address/vecs.rs @@ -11,28 +11,24 @@ use crate::{ blocks, distribution::state::AddressCohortState, indexes, internal::ComputedFromHeight, prices, }; -use crate::distribution::metrics::{BasicCohortMetrics, CohortMetricsBase, ImportConfig}; +use crate::distribution::metrics::{CoreCohortMetrics, ImportConfig}; use super::super::traits::{CohortVecs, DynCohortVecs}; #[derive(Traversable)] pub struct AddressCohortVecs { - /// Starting height when state was imported starting_height: Option, - /// Runtime state for block-by-block processing #[traversable(skip)] pub state: Option>, - /// Metric vectors #[traversable(flatten)] - pub metrics: BasicCohortMetrics, + pub metrics: CoreCohortMetrics, pub addr_count: ComputedFromHeight, pub addr_count_change_1m: ComputedFromHeight, } impl AddressCohortVecs { - /// Import address cohort from database. pub(crate) fn forced_import( db: &Database, filter: Filter, @@ -56,7 +52,7 @@ impl AddressCohortVecs { state: states_path.map(|path| Box::new(AddressCohortState::new(path, &full_name))), - metrics: BasicCohortMetrics::forced_import(&cfg)?, + metrics: CoreCohortMetrics::forced_import(&cfg)?, addr_count: ComputedFromHeight::forced_import( db, @@ -73,20 +69,19 @@ impl AddressCohortVecs { }) } - /// Reset starting height to zero. pub(crate) fn reset_starting_height(&mut self) { self.starting_height = Some(Height::ZERO); } - /// Returns a parallel iterator over all vecs for parallel writing. pub(crate) fn par_iter_vecs_mut( &mut self, ) -> impl ParallelIterator { - rayon::iter::once(&mut self.addr_count.height as &mut dyn AnyStoredVec) - .chain(self.metrics.par_iter_mut()) + let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); + vecs.push(&mut self.addr_count.height as &mut dyn AnyStoredVec); + vecs.extend(self.metrics.collect_all_vecs_mut()); + vecs.into_par_iter() } - /// Commit state to disk (separate from vec writes for parallelization). pub(crate) fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { if let Some(state) = self.state.as_mut() { state.inner.write(height, cleanup)?; @@ -117,15 +112,10 @@ impl DynCohortVecs for AddressCohortVecs { } fn import_state(&mut self, starting_height: Height) -> Result { - // Import state from runtime state if present if let Some(state) = self.state.as_mut() { - // State files are saved AT height H, so to resume at H+1 we need to import at H - // Decrement first, then increment result to match expected starting_height if let Some(mut prev_height) = starting_height.decremented() { - // Import cost_basis_data state file (may adjust prev_height to actual file found) prev_height = state.inner.import_at_or_before(prev_height)?; - // Restore supply state from height-indexed vectors state.inner.supply.value = self .metrics .supply @@ -143,14 +133,12 @@ impl DynCohortVecs for AddressCohortVecs { .unwrap(); state.addr_count = *self.addr_count.height.collect_one(prev_height).unwrap(); - // Restore realized cap from persisted exact values state.inner.restore_realized_cap(); let result = prev_height.incremented(); self.starting_height = Some(result); Ok(result) } else { - // starting_height is 0, nothing to import self.starting_height = Some(Height::ZERO); Ok(Height::ZERO) } @@ -174,12 +162,22 @@ impl DynCohortVecs for AddressCohortVecs { return Ok(()); } - // Push addr_count from state if let Some(state) = self.state.as_ref() { self.addr_count .height .truncate_push(height, state.addr_count.into())?; - self.metrics.truncate_push(height, &state.inner)?; + self.metrics + .supply + .truncate_push(height, state.inner.supply.value)?; + self.metrics + .outputs + .truncate_push(height, state.inner.supply.utxo_count)?; + self.metrics + .activity + .truncate_push(height, state.inner.sent)?; + self.metrics + .realized + .truncate_push(height, &state.inner.realized)?; } Ok(()) @@ -189,15 +187,14 @@ impl DynCohortVecs for AddressCohortVecs { &mut self, height: Height, height_price: Cents, - is_day_boundary: bool, + _is_day_boundary: bool, ) -> Result<()> { if let Some(state) = self.state.as_mut() { - self.metrics.compute_then_truncate_push_unrealized_states( - height, - height_price, - &mut state.inner, - is_day_boundary, - )?; + state.inner.apply_pending(); + let unrealized_state = state.inner.compute_unrealized_state(height_price); + self.metrics + .unrealized + .truncate_push(height, &unrealized_state)?; } Ok(()) } @@ -210,14 +207,7 @@ impl DynCohortVecs for AddressCohortVecs { exit: &Exit, ) -> Result<()> { self.metrics - .compute_rest_part1(blocks, prices, starting_indexes, exit)?; - // Separate cohorts (with state) compute net_sentiment = greed - pain directly. - // Aggregate cohorts get it via weighted average in groups.rs. - if self.state.is_some() { - self.metrics - .compute_net_sentiment_height(starting_indexes, exit)?; - } - Ok(()) + .compute_rest_part1(blocks, prices, starting_indexes, exit) } fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { @@ -257,7 +247,7 @@ impl CohortVecs for AddressCohortVecs { .as_slice(), exit, )?; - self.metrics.compute_from_stateful( + self.metrics.compute_from_sources( starting_indexes, &others.iter().map(|v| &v.metrics).collect::>(), exit, diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs b/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs index 49142ea2a..6b3d9ad17 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs +++ b/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs @@ -13,8 +13,9 @@ use vecdb::{AnyStoredVec, Database, Exit, ReadOnlyClone, ReadableVec, Rw, Storag use crate::{blocks, distribution::DynCohortVecs, indexes, prices}; use crate::distribution::metrics::{ - AdjustedCohortMetrics, AllCohortMetrics, BasicCohortMetrics, CohortMetricsBase, - ExtendedAdjustedCohortMetrics, ExtendedCohortMetrics, ImportConfig, SupplyMetrics, + AllCohortMetrics, BasicCohortMetrics, CohortMetricsBase, CompleteCohortMetrics, + CoreCohortMetrics, ExtendedAdjustedCohortMetrics, ExtendedCohortMetrics, ImportConfig, + MinimalCohortMetrics, SupplyMetrics, }; use super::{percentiles::PercentileCache, vecs::UTXOCohortVecs}; @@ -38,15 +39,15 @@ pub struct UTXOCohorts { pub all: UTXOCohortVecs>, pub sth: UTXOCohortVecs>, pub lth: UTXOCohortVecs>, - pub age_range: ByAgeRange>>, - pub max_age: ByMaxAge>>, - pub min_age: ByMinAge>>, - pub ge_amount: ByGreatEqualAmount>>, - pub amount_range: ByAmountRange>>, - pub lt_amount: ByLowerThanAmount>>, - pub epoch: ByEpoch>>, - pub class: ByClass>>, - pub type_: BySpendableType>>, + pub age_range: ByAgeRange>>, + pub max_age: ByMaxAge>>, + pub min_age: ByMinAge>>, + pub ge_amount: ByGreatEqualAmount>>, + pub amount_range: ByAmountRange>>, + pub lt_amount: ByLowerThanAmount>>, + pub epoch: ByEpoch>>, + pub class: ByClass>>, + pub type_: BySpendableType>>, #[traversable(skip)] pub(super) percentile_cache: PercentileCache, /// Cached partition_point positions for tick_tock boundary searches. @@ -83,25 +84,6 @@ impl UTXOCohorts { // Phase 2: Import separate (stateful) cohorts. - // age_range: ExtendedCohortMetrics with full state - let age_range = { - ByAgeRange::try_new(&|f: Filter, name: &'static str| -> Result<_> { - let full_name = CohortContext::Utxo.full_name(&f, name); - let cfg = ImportConfig { - db, - filter: &f, - full_name: &full_name, - version: v, - indexes, - }; - let state = Some(Box::new(UTXOCohortState::new(states_path, &full_name))); - Ok(UTXOCohortVecs::new( - state, - ExtendedCohortMetrics::forced_import(&cfg)?, - )) - })? - }; - // Helper for separate cohorts with BasicCohortMetrics + full state let basic_separate = |f: Filter, name: &'static str| -> Result> { @@ -120,10 +102,46 @@ impl UTXOCohorts { )) }; - let amount_range = ByAmountRange::try_new(&basic_separate)?; - let epoch = ByEpoch::try_new(&basic_separate)?; - let class = ByClass::try_new(&basic_separate)?; - let type_ = BySpendableType::try_new(&basic_separate)?; + let age_range = ByAgeRange::try_new(&basic_separate)?; + + let core_separate = + |f: Filter, name: &'static str| -> Result> { + let full_name = CohortContext::Utxo.full_name(&f, name); + let cfg = ImportConfig { + db, + filter: &f, + full_name: &full_name, + version: v, + indexes, + }; + let state = Some(Box::new(UTXOCohortState::new(states_path, &full_name))); + Ok(UTXOCohortVecs::new( + state, + CoreCohortMetrics::forced_import(&cfg)?, + )) + }; + + let amount_range = ByAmountRange::try_new(&core_separate)?; + let epoch = ByEpoch::try_new(&core_separate)?; + let class = ByClass::try_new(&core_separate)?; + + let type_ = BySpendableType::try_new( + &|f: Filter, name: &'static str| -> Result> { + let full_name = CohortContext::Utxo.full_name(&f, name); + let cfg = ImportConfig { + db, + filter: &f, + full_name: &full_name, + version: v, + indexes, + }; + let state = Some(Box::new(UTXOCohortState::new(states_path, &full_name))); + Ok(UTXOCohortVecs::new( + state, + MinimalCohortMetrics::forced_import(&cfg)?, + )) + }, + )?; // Phase 3: Import "all" cohort with pre-imported supply. let all = UTXOCohortVecs::new( @@ -161,7 +179,7 @@ impl UTXOCohorts { UTXOCohortVecs::new(None, ExtendedCohortMetrics::forced_import(&cfg)?) }; - // max_age: AdjustedCohortMetrics (adjusted + peak_regret) + // max_age: CompleteCohortMetrics (no state, aggregates from age_range) let max_age = { ByMaxAge::try_new(&|f: Filter, name: &'static str| -> Result<_> { let full_name = CohortContext::Utxo.full_name(&f, name); @@ -174,12 +192,12 @@ impl UTXOCohorts { }; Ok(UTXOCohortVecs::new( None, - AdjustedCohortMetrics::forced_import(&cfg)?, + CompleteCohortMetrics::forced_import(&cfg)?, )) })? }; - // min_age: BasicCohortMetrics + // min_age: CompleteCohortMetrics let min_age = { ByMinAge::try_new(&|f: Filter, name: &'static str| -> Result<_> { let full_name = CohortContext::Utxo.full_name(&f, name); @@ -192,14 +210,14 @@ impl UTXOCohorts { }; Ok(UTXOCohortVecs::new( None, - BasicCohortMetrics::forced_import(&cfg)?, + CompleteCohortMetrics::forced_import(&cfg)?, )) })? }; - // ge_amount, lt_amount: BasicCohortMetrics (no state) - let basic_no_state = - |f: Filter, name: &'static str| -> Result> { + // ge_amount, lt_amount: CoreCohortMetrics (no state) + let core_no_state = + |f: Filter, name: &'static str| -> Result> { let full_name = CohortContext::Utxo.full_name(&f, name); let cfg = ImportConfig { db, @@ -210,12 +228,12 @@ impl UTXOCohorts { }; Ok(UTXOCohortVecs::new( None, - BasicCohortMetrics::forced_import(&cfg)?, + CoreCohortMetrics::forced_import(&cfg)?, )) }; - let lt_amount = ByLowerThanAmount::try_new(&basic_no_state)?; - let ge_amount = ByGreatEqualAmount::try_new(&basic_no_state)?; + let lt_amount = ByLowerThanAmount::try_new(&core_no_state)?; + let ge_amount = ByGreatEqualAmount::try_new(&core_no_state)?; Ok(Self { all, @@ -295,20 +313,20 @@ impl UTXOCohorts { }), Box::new(|| { min_age.par_iter_mut().try_for_each(|vecs| { - let sources = filter_sources_from(ar.iter(), Some(vecs.metrics.filter())); - vecs.metrics.compute_base_from_others(si, &sources, exit) + let sources = filter_sources_from(ar.iter(), Some(&vecs.metrics.filter)); + vecs.metrics.compute_from_sources(si, &sources, exit) }) }), Box::new(|| { max_age.par_iter_mut().try_for_each(|vecs| { - let sources = filter_sources_from(ar.iter(), Some(vecs.metrics.filter())); - vecs.metrics.compute_base_from_others(si, &sources, exit) + let sources = filter_sources_from(ar.iter(), Some(&vecs.metrics.filter)); + vecs.metrics.compute_from_sources(si, &sources, exit) }) }), Box::new(|| { ge_amount.par_iter_mut().chain(lt_amount.par_iter_mut()).try_for_each(|vecs| { - let sources = filter_sources_from(amr.iter(), Some(vecs.metrics.filter())); - vecs.metrics.compute_base_from_others(si, &sources, exit) + let sources = filter_core_sources_from(amr.iter(), Some(&vecs.metrics.filter)); + vecs.metrics.compute_from_sources(si, &sources, exit) }) }), ]; @@ -366,15 +384,15 @@ impl UTXOCohorts { // 2. Compute net_sentiment.height for aggregate cohorts (weighted average). // Separate cohorts already computed net_sentiment in step 1 (inside compute_rest_part1). + // Note: min_age, max_age, epoch, class are Complete tier — no net_sentiment. + // Note: ge_amount, lt_amount, amount_range are Core tier — no net_sentiment. { let Self { - all, sth, lth, age_range, max_age, min_age, - ge_amount, amount_range, lt_amount, + all, sth, lth, age_range, .. } = self; let ar = &*age_range; - let amr = &*amount_range; let si = starting_indexes; let tasks: Vec Result<()> + Send + '_>> = vec![ @@ -390,24 +408,6 @@ impl UTXOCohorts { let sources = filter_sources_from(ar.iter(), Some(lth.metrics.filter())); lth.metrics.compute_net_sentiment_from_others_dyn(si, &sources, exit) }), - Box::new(|| { - min_age.par_iter_mut().try_for_each(|vecs| { - let sources = filter_sources_from(ar.iter(), Some(vecs.metrics.filter())); - vecs.metrics.compute_net_sentiment_from_others_dyn(si, &sources, exit) - }) - }), - Box::new(|| { - max_age.par_iter_mut().try_for_each(|vecs| { - let sources = filter_sources_from(ar.iter(), Some(vecs.metrics.filter())); - vecs.metrics.compute_net_sentiment_from_others_dyn(si, &sources, exit) - }) - }), - Box::new(|| { - ge_amount.par_iter_mut().chain(lt_amount.par_iter_mut()).try_for_each(|vecs| { - let sources = filter_sources_from(amr.iter(), Some(vecs.metrics.filter())); - vecs.metrics.compute_net_sentiment_from_others_dyn(si, &sources, exit) - }) - }), ]; tasks @@ -479,14 +479,14 @@ impl UTXOCohorts { Box::new(|| sth.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, vc, vd, ss, exit)), Box::new(|| lth.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit)), Box::new(|| age_range.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit))), - Box::new(|| max_age.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, vc, vd, ss, exit))), + Box::new(|| max_age.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit))), Box::new(|| min_age.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit))), Box::new(|| ge_amount.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit))), Box::new(|| epoch.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit))), Box::new(|| class.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit))), Box::new(|| amount_range.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit))), Box::new(|| lt_amount.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit))), - Box::new(|| type_.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(blocks, prices, starting_indexes, height_to_market_cap, ss, exit))), + Box::new(|| type_.par_iter_mut().try_for_each(|v| v.metrics.compute_rest_part2(prices, starting_indexes, exit))), ]; tasks @@ -613,3 +613,17 @@ fn filter_sources_from<'a, M: CohortMetricsBase + 'a>( .collect(), } } + +/// Filter CoreCohortMetrics source cohorts by an optional filter. +fn filter_core_sources_from<'a>( + sources: impl Iterator>, + filter: Option<&Filter>, +) -> Vec<&'a CoreCohortMetrics> { + match filter { + Some(f) => sources + .filter(|v| f.includes(&v.metrics.filter)) + .map(|v| &v.metrics) + .collect(), + None => sources.map(|v| &v.metrics).collect(), + } +} diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs b/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs index 3e9ab1eaf..202b38900 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs +++ b/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs @@ -6,7 +6,7 @@ use vecdb::{Exit, ReadableVec}; use crate::{blocks, distribution::state::UTXOCohortState, prices}; -use crate::distribution::metrics::CohortMetricsBase; +use crate::distribution::metrics::{CohortMetricsBase, CompleteCohortMetrics, CoreCohortMetrics, MinimalCohortMetrics}; use super::super::traits::DynCohortVecs; @@ -161,3 +161,391 @@ impl DynCohortVecs for UTXOCohortVecs< } } } + +impl Filtered for UTXOCohortVecs { + fn filter(&self) -> &Filter { + &self.metrics.filter + } +} + +impl DynCohortVecs for UTXOCohortVecs { + fn min_stateful_height_len(&self) -> usize { + self.metrics.min_stateful_height_len() + } + + fn reset_state_starting_height(&mut self) { + self.state_starting_height = Some(Height::ZERO); + if let Some(state) = self.state.as_mut() { + state.reset(); + } + } + + fn import_state(&mut self, starting_height: Height) -> Result { + if let Some(state) = self.state.as_mut() { + if let Some(mut prev_height) = starting_height.decremented() { + prev_height = state.import_at_or_before(prev_height)?; + + state.supply.value = self + .metrics + .supply + .total + .sats + .height + .collect_one(prev_height) + .unwrap(); + state.supply.utxo_count = *self + .metrics + .outputs + .utxo_count + .height + .collect_one(prev_height) + .unwrap(); + + state.restore_realized_cap(); + + let result = prev_height.incremented(); + self.state_starting_height = Some(result); + Ok(result) + } else { + self.state_starting_height = Some(Height::ZERO); + Ok(Height::ZERO) + } + } else { + self.state_starting_height = Some(starting_height); + Ok(starting_height) + } + } + + fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { + self.metrics.validate_computed_versions(base_version) + } + + fn truncate_push(&mut self, height: Height) -> Result<()> { + if self.state_starting_height.is_some_and(|h| h > height) { + return Ok(()); + } + + if let Some(state) = self.state.as_ref() { + self.metrics + .supply + .truncate_push(height, state.supply.value)?; + self.metrics + .outputs + .truncate_push(height, state.supply.utxo_count)?; + self.metrics + .realized + .truncate_push(height, state.realized.cap())?; + } + + Ok(()) + } + + fn compute_then_truncate_push_unrealized_states( + &mut self, + height: Height, + height_price: Cents, + _is_day_boundary: bool, + ) -> Result<()> { + if let Some(state) = self.state.as_mut() { + state.apply_pending(); + let unrealized_state = state.compute_unrealized_state(height_price); + self.metrics + .unrealized + .truncate_push(height, &unrealized_state)?; + } + Ok(()) + } + + fn compute_rest_part1( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.metrics + .compute_rest_part1(blocks, prices, starting_indexes, exit) + } + + fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { + if let Some(state) = self.state.as_mut() { + state.write(height, cleanup)?; + } + Ok(()) + } + + fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { + if let Some(state) = self.state.as_mut() { + state.reset_cost_basis_data_if_needed()?; + } + Ok(()) + } + + fn reset_single_iteration_values(&mut self) { + if let Some(state) = self.state.as_mut() { + state.reset_single_iteration_values(); + } + } +} + +impl Filtered for UTXOCohortVecs { + fn filter(&self) -> &Filter { + &self.metrics.filter + } +} + +impl DynCohortVecs for UTXOCohortVecs { + fn min_stateful_height_len(&self) -> usize { + self.metrics.min_stateful_height_len() + } + + fn reset_state_starting_height(&mut self) { + self.state_starting_height = Some(Height::ZERO); + if let Some(state) = self.state.as_mut() { + state.reset(); + } + } + + fn import_state(&mut self, starting_height: Height) -> Result { + if let Some(state) = self.state.as_mut() { + if let Some(mut prev_height) = starting_height.decremented() { + prev_height = state.import_at_or_before(prev_height)?; + + state.supply.value = self + .metrics + .supply + .total + .sats + .height + .collect_one(prev_height) + .unwrap(); + state.supply.utxo_count = *self + .metrics + .outputs + .utxo_count + .height + .collect_one(prev_height) + .unwrap(); + + state.restore_realized_cap(); + + let result = prev_height.incremented(); + self.state_starting_height = Some(result); + Ok(result) + } else { + self.state_starting_height = Some(Height::ZERO); + Ok(Height::ZERO) + } + } else { + self.state_starting_height = Some(starting_height); + Ok(starting_height) + } + } + + fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { + self.metrics.validate_computed_versions(base_version) + } + + fn truncate_push(&mut self, height: Height) -> Result<()> { + if self.state_starting_height.is_some_and(|h| h > height) { + return Ok(()); + } + + if let Some(state) = self.state.as_ref() { + self.metrics + .supply + .truncate_push(height, state.supply.value)?; + self.metrics + .outputs + .truncate_push(height, state.supply.utxo_count)?; + self.metrics.activity.truncate_push(height, state.sent)?; + self.metrics + .realized + .truncate_push(height, &state.realized)?; + } + + Ok(()) + } + + fn compute_then_truncate_push_unrealized_states( + &mut self, + height: Height, + height_price: Cents, + _is_day_boundary: bool, + ) -> Result<()> { + if let Some(state) = self.state.as_mut() { + state.apply_pending(); + let unrealized_state = state.compute_unrealized_state(height_price); + self.metrics + .unrealized + .truncate_push(height, &unrealized_state)?; + } + Ok(()) + } + + fn compute_rest_part1( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.metrics + .compute_rest_part1(blocks, prices, starting_indexes, exit) + } + + fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { + if let Some(state) = self.state.as_mut() { + state.write(height, cleanup)?; + } + Ok(()) + } + + fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { + if let Some(state) = self.state.as_mut() { + state.reset_cost_basis_data_if_needed()?; + } + Ok(()) + } + + fn reset_single_iteration_values(&mut self) { + if let Some(state) = self.state.as_mut() { + state.reset_single_iteration_values(); + } + } +} + +impl Filtered for UTXOCohortVecs { + fn filter(&self) -> &Filter { + &self.metrics.filter + } +} + +impl DynCohortVecs for UTXOCohortVecs { + fn min_stateful_height_len(&self) -> usize { + self.metrics.min_stateful_height_len() + } + + fn reset_state_starting_height(&mut self) { + self.state_starting_height = Some(Height::ZERO); + if let Some(state) = self.state.as_mut() { + state.reset(); + } + } + + fn import_state(&mut self, starting_height: Height) -> Result { + if let Some(state) = self.state.as_mut() { + if let Some(mut prev_height) = starting_height.decremented() { + prev_height = state.import_at_or_before(prev_height)?; + + state.supply.value = self + .metrics + .supply + .total + .sats + .height + .collect_one(prev_height) + .unwrap(); + state.supply.utxo_count = *self + .metrics + .outputs + .utxo_count + .height + .collect_one(prev_height) + .unwrap(); + + state.restore_realized_cap(); + + let result = prev_height.incremented(); + self.state_starting_height = Some(result); + Ok(result) + } else { + self.state_starting_height = Some(Height::ZERO); + Ok(Height::ZERO) + } + } else { + self.state_starting_height = Some(starting_height); + Ok(starting_height) + } + } + + fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { + self.metrics.validate_computed_versions(base_version) + } + + fn truncate_push(&mut self, height: Height) -> Result<()> { + if self.state_starting_height.is_some_and(|h| h > height) { + return Ok(()); + } + + if let Some(state) = self.state.as_ref() { + self.metrics + .supply + .truncate_push(height, state.supply.value)?; + self.metrics + .outputs + .truncate_push(height, state.supply.utxo_count)?; + self.metrics.activity.truncate_push( + height, + state.sent, + state.satblocks_destroyed, + state.satdays_destroyed, + )?; + self.metrics + .realized + .truncate_push(height, &state.realized)?; + } + + Ok(()) + } + + fn compute_then_truncate_push_unrealized_states( + &mut self, + height: Height, + height_price: Cents, + _is_day_boundary: bool, + ) -> Result<()> { + if let Some(state) = self.state.as_mut() { + state.apply_pending(); + self.metrics + .cost_basis + .truncate_push_minmax(height, state)?; + let unrealized_state = state.compute_unrealized_state(height_price); + self.metrics + .unrealized + .truncate_push(height, &unrealized_state)?; + } + Ok(()) + } + + fn compute_rest_part1( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.metrics + .compute_rest_part1(blocks, prices, starting_indexes, exit) + } + + fn write_state(&mut self, height: Height, cleanup: bool) -> Result<()> { + if let Some(state) = self.state.as_mut() { + state.write(height, cleanup)?; + } + Ok(()) + } + + fn reset_cost_basis_data_if_needed(&mut self) -> Result<()> { + if let Some(state) = self.state.as_mut() { + state.reset_cost_basis_data_if_needed()?; + } + Ok(()) + } + + fn reset_single_iteration_values(&mut self) { + if let Some(state) = self.state.as_mut() { + state.reset_single_iteration_values(); + } + } +} diff --git a/crates/brk_computer/src/distribution/metrics/activity.rs b/crates/brk_computer/src/distribution/metrics/activity/base.rs similarity index 64% rename from crates/brk_computer/src/distribution/metrics/activity.rs rename to crates/brk_computer/src/distribution/metrics/activity/base.rs index b8bbd0d4c..980e0ffa3 100644 --- a/crates/brk_computer/src/distribution/metrics/activity.rs +++ b/crates/brk_computer/src/distribution/metrics/activity/base.rs @@ -1,57 +1,44 @@ use brk_error::Result; use brk_traversable::Traversable; use brk_types::{Bitcoin, Height, Indexes, Sats, StoredF64, Version}; +use derive_more::{Deref, DerefMut}; use rayon::prelude::*; use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec}; -use crate::{ - blocks, - internal::{ComputedFromHeightCumulativeSum, RollingEmas2w, ValueFromHeightCumulative}, -}; +use crate::internal::ComputedFromHeightCumulativeSum; -use super::ImportConfig; +use crate::{blocks, distribution::metrics::ImportConfig, prices}; -/// Activity metrics for a cohort. -#[derive(Traversable)] +use super::CoreActivity; + +#[derive(Deref, DerefMut, Traversable)] pub struct ActivityMetrics { - /// Total satoshis sent at each height + derived indexes - pub sent: ValueFromHeightCumulative, + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub core: CoreActivity, - /// 14-day EMA of sent supply (sats, btc, usd) - pub sent_ema: RollingEmas2w, - - /// Coin-blocks destroyed (in BTC) pub coinblocks_destroyed: ComputedFromHeightCumulativeSum, - - /// Coin-days destroyed (in BTC) pub coindays_destroyed: ComputedFromHeightCumulativeSum, } impl ActivityMetrics { - /// Import activity metrics from database. pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { Ok(Self { - sent: cfg.import_value_cumulative("sent", Version::ZERO)?, - sent_ema: cfg.import_emas_2w("sent", Version::ZERO)?, - + core: CoreActivity::forced_import(cfg)?, coinblocks_destroyed: cfg .import_cumulative_sum("coinblocks_destroyed", Version::ONE)?, coindays_destroyed: cfg.import_cumulative_sum("coindays_destroyed", Version::ONE)?, }) } - /// Get minimum length across height-indexed vectors. pub(crate) fn min_len(&self) -> usize { - self.sent - .base - .sats - .height - .len() + self.core + .min_len() .min(self.coinblocks_destroyed.height.len()) .min(self.coindays_destroyed.height.len()) } - /// Push activity state values to height-indexed vectors. pub(crate) fn truncate_push( &mut self, height: Height, @@ -59,7 +46,7 @@ impl ActivityMetrics { satblocks_destroyed: Sats, satdays_destroyed: Sats, ) -> Result<()> { - self.sent.base.sats.height.truncate_push(height, sent)?; + self.core.truncate_push(height, sent)?; self.coinblocks_destroyed.height.truncate_push( height, StoredF64::from(Bitcoin::from(satblocks_destroyed)), @@ -71,29 +58,29 @@ impl ActivityMetrics { Ok(()) } - /// Returns a parallel iterator over all vecs for parallel writing. pub(crate) fn par_iter_mut(&mut self) -> impl ParallelIterator { vec![ - &mut self.sent.base.sats.height as &mut dyn AnyStoredVec, + &mut self.core.sent.base.sats.height as &mut dyn AnyStoredVec, &mut self.coinblocks_destroyed.height as &mut dyn AnyStoredVec, &mut self.coindays_destroyed.height as &mut dyn AnyStoredVec, ] .into_par_iter() } - /// Validate computed versions against base version. pub(crate) fn validate_computed_versions(&mut self, _base_version: Version) -> Result<()> { - // Validation logic for computed vecs Ok(()) } - /// Compute aggregate values from separate cohorts. pub(crate) fn compute_from_stateful( &mut self, starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> { + let core_refs: Vec<&CoreActivity> = others.iter().map(|o| &o.core).collect(); + self.core + .compute_from_stateful(starting_indexes, &core_refs, exit)?; + macro_rules! sum_others { ($($field:tt).+) => { self.$($field).+.compute_sum_of_others( @@ -104,29 +91,22 @@ impl ActivityMetrics { }; } - sum_others!(sent.base.sats.height); sum_others!(coinblocks_destroyed.height); sum_others!(coindays_destroyed.height); Ok(()) } - /// First phase of computed metrics (indexes from height). pub(crate) fn compute_rest_part1( &mut self, blocks: &blocks::Vecs, + prices: &prices::Vecs, starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { - let window_starts = blocks.count.window_starts(); + self.core + .compute_rest_part1(blocks, prices, starting_indexes, exit)?; - // 14-day EMA of sent (sats and dollars) - self.sent_ema.compute( - starting_indexes.height, - &blocks.count.height_2w_ago, - &self.sent.base.sats.height, - &self.sent.base.cents.height, - exit, - )?; + let window_starts = blocks.count.window_starts(); self.coinblocks_destroyed .compute_rest(starting_indexes.height, &window_starts, exit)?; diff --git a/crates/brk_computer/src/distribution/metrics/activity/core.rs b/crates/brk_computer/src/distribution/metrics/activity/core.rs new file mode 100644 index 000000000..58f8b06d4 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/activity/core.rs @@ -0,0 +1,79 @@ +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Height, Indexes, Sats, Version}; +use rayon::prelude::*; +use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec}; + +use crate::internal::{RollingEmas2w, ValueFromHeightCumulative}; + +use crate::{blocks, distribution::metrics::ImportConfig, prices}; + +#[derive(Traversable)] +pub struct CoreActivity { + pub sent: ValueFromHeightCumulative, + pub sent_ema: RollingEmas2w, +} + +impl CoreActivity { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + Ok(Self { + sent: cfg.import_value_cumulative("sent", Version::ZERO)?, + sent_ema: cfg.import_emas_2w("sent", Version::ZERO)?, + }) + } + + pub(crate) fn min_len(&self) -> usize { + self.sent.base.sats.height.len() + } + + pub(crate) fn truncate_push(&mut self, height: Height, sent: Sats) -> Result<()> { + self.sent.base.sats.height.truncate_push(height, sent)?; + Ok(()) + } + + pub(crate) fn par_iter_mut(&mut self) -> impl ParallelIterator { + vec![&mut self.sent.base.sats.height as &mut dyn AnyStoredVec].into_par_iter() + } + + pub(crate) fn validate_computed_versions(&mut self, _base_version: Version) -> Result<()> { + Ok(()) + } + + pub(crate) fn compute_from_stateful( + &mut self, + starting_indexes: &Indexes, + others: &[&Self], + exit: &Exit, + ) -> Result<()> { + self.sent.base.sats.height.compute_sum_of_others( + starting_indexes.height, + &others + .iter() + .map(|v| &v.sent.base.sats.height) + .collect::>(), + exit, + )?; + Ok(()) + } + + pub(crate) fn compute_rest_part1( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.sent + .compute(prices, starting_indexes.height, exit)?; + + self.sent_ema.compute( + starting_indexes.height, + &blocks.count.height_2w_ago, + &self.sent.base.sats.height, + &self.sent.base.cents.height, + exit, + )?; + + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/activity/mod.rs b/crates/brk_computer/src/distribution/metrics/activity/mod.rs new file mode 100644 index 000000000..5074723b6 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/activity/mod.rs @@ -0,0 +1,5 @@ +mod base; +mod core; + +pub use base::*; +pub use core::*; diff --git a/crates/brk_computer/src/distribution/metrics/cohort/complete.rs b/crates/brk_computer/src/distribution/metrics/cohort/complete.rs new file mode 100644 index 000000000..2ba7462c3 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/cohort/complete.rs @@ -0,0 +1,197 @@ +use brk_cohort::Filter; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Dollars, Height, Indexes, Sats, Version}; +use rayon::prelude::*; +use vecdb::{AnyStoredVec, Exit, ReadableVec, Rw, StorageMode}; + +use crate::{blocks, prices}; + +use crate::distribution::metrics::{ + ActivityMetrics, CohortMetricsBase, CostBasisBase, ImportConfig, OutputsMetrics, + RealizedComplete, RelativeCompleteWithRelToAll, SupplyMetrics, UnrealizedComplete, +}; + +/// Complete cohort metrics (Tier C): ~216 stored vecs. +/// +/// Used for epoch, class, min_age, max_age cohorts. +/// Everything in Core, plus cost basis, CDD, value created/destroyed, +/// sent in profit/loss, net PnL change, etc. +/// +/// Does NOT include source-only fields (peak_regret, invested_capital, +/// raw BytesVecs) or extended-only fields (investor_price, sell_side_risk, +/// pain/greed/net_sentiment). +/// +/// Does NOT implement CohortMetricsBase — standalone, not usable as Source. +#[derive(Traversable)] +pub struct CompleteCohortMetrics { + #[traversable(skip)] + pub filter: Filter, + pub supply: Box>, + pub outputs: Box>, + pub activity: Box>, + pub realized: Box>, + pub cost_basis: Box>, + pub unrealized: Box>, + pub relative: Box>, +} + +impl CompleteCohortMetrics { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + Ok(Self { + filter: cfg.filter.clone(), + supply: Box::new(SupplyMetrics::forced_import(cfg)?), + outputs: Box::new(OutputsMetrics::forced_import(cfg)?), + activity: Box::new(ActivityMetrics::forced_import(cfg)?), + realized: Box::new(RealizedComplete::forced_import(cfg)?), + cost_basis: Box::new(CostBasisBase::forced_import(cfg)?), + unrealized: Box::new(UnrealizedComplete::forced_import(cfg)?), + relative: Box::new(RelativeCompleteWithRelToAll::forced_import(cfg)?), + }) + } + + pub(crate) fn min_stateful_height_len(&self) -> usize { + self.supply + .min_len() + .min(self.outputs.min_len()) + .min(self.activity.min_len()) + .min(self.realized.min_stateful_height_len()) + .min(self.unrealized.min_stateful_height_len()) + .min(self.cost_basis.min_stateful_height_len()) + } + + pub(crate) fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { + self.supply.validate_computed_versions(base_version)?; + self.activity.validate_computed_versions(base_version)?; + Ok(()) + } + + pub(crate) fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); + vecs.extend(self.supply.par_iter_mut().collect::>()); + vecs.extend(self.outputs.par_iter_mut().collect::>()); + vecs.extend(self.activity.par_iter_mut().collect::>()); + vecs.extend(self.realized.collect_vecs_mut()); + vecs.extend(self.cost_basis.collect_vecs_mut()); + vecs.extend(self.unrealized.collect_vecs_mut()); + vecs + } + + /// Aggregate Complete-tier metrics from Source cohort refs. + pub(crate) fn compute_from_sources( + &mut self, + starting_indexes: &Indexes, + others: &[&dyn CohortMetricsBase], + exit: &Exit, + ) -> Result<()> { + // Supply, outputs, activity: use their existing compute_from_stateful + self.supply.compute_from_stateful( + starting_indexes, + &others.iter().map(|v| v.supply()).collect::>(), + exit, + )?; + self.outputs.compute_from_stateful( + starting_indexes, + &others.iter().map(|v| v.outputs()).collect::>(), + exit, + )?; + self.activity.compute_from_stateful( + starting_indexes, + &others.iter().map(|v| v.activity()).collect::>(), + exit, + )?; + + // Realized: aggregate only Complete-tier fields from Source's RealizedBase + let realized_complete_refs: Vec<&RealizedComplete> = others + .iter() + .map(|v| &v.realized_base().complete) + .collect(); + self.realized + .compute_from_stateful(starting_indexes, &realized_complete_refs, exit)?; + + // Unrealized: aggregate only Complete-tier fields + let unrealized_complete_refs: Vec<&UnrealizedComplete> = others + .iter() + .map(|v| &v.unrealized_base().complete) + .collect(); + self.unrealized + .compute_from_stateful(starting_indexes, &unrealized_complete_refs, exit)?; + + // Cost basis: use existing aggregation + self.cost_basis.compute_from_stateful( + starting_indexes, + &others + .iter() + .map(|v| v.cost_basis_base()) + .collect::>(), + exit, + )?; + + Ok(()) + } + + /// First phase: compute index transforms. + pub(crate) fn compute_rest_part1( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.supply + .compute(prices, starting_indexes.height, exit)?; + self.supply + .compute_rest_part1(blocks, starting_indexes, exit)?; + self.outputs + .compute_rest(blocks, starting_indexes, exit)?; + self.activity + .sent + .compute(prices, starting_indexes.height, exit)?; + self.activity + .compute_rest_part1(blocks, prices, starting_indexes, exit)?; + + self.realized + .sent_in_profit + .compute(prices, starting_indexes.height, exit)?; + self.realized + .sent_in_loss + .compute(prices, starting_indexes.height, exit)?; + self.realized + .compute_rest_part1(starting_indexes, exit)?; + + self.unrealized.compute_rest(starting_indexes, exit)?; + + Ok(()) + } + + /// Second phase: compute relative metrics and remaining. + pub(crate) fn compute_rest_part2( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + height_to_market_cap: &impl ReadableVec, + all_supply_sats: &impl ReadableVec, + exit: &Exit, + ) -> Result<()> { + self.realized.compute_rest_part2( + blocks, + prices, + starting_indexes, + &self.supply.total.btc.height, + height_to_market_cap, + exit, + )?; + + self.relative.compute( + starting_indexes.height, + &self.unrealized, + &self.supply.total.sats.height, + height_to_market_cap, + all_supply_sats, + exit, + )?; + + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/core.rs b/crates/brk_computer/src/distribution/metrics/cohort/core.rs new file mode 100644 index 000000000..bd5c048c0 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/cohort/core.rs @@ -0,0 +1,153 @@ +use brk_cohort::Filter; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Dollars, Height, Indexes, Sats, Version}; +use rayon::prelude::*; +use vecdb::{AnyStoredVec, Exit, ReadableVec, Rw, StorageMode}; + +use crate::{blocks, prices}; + +use crate::distribution::metrics::{ + CoreActivity, CoreRealized, ImportConfig, OutputsMetrics, + RelativeCompleteWithRelToAll, SupplyMetrics, UnrealizedComplete, +}; + +#[derive(Traversable)] +pub struct CoreCohortMetrics { + #[traversable(skip)] + pub filter: Filter, + pub supply: Box>, + pub outputs: Box>, + pub activity: Box>, + pub realized: Box>, + pub unrealized: Box>, + pub relative: Box>, +} + +impl CoreCohortMetrics { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + Ok(Self { + filter: cfg.filter.clone(), + supply: Box::new(SupplyMetrics::forced_import(cfg)?), + outputs: Box::new(OutputsMetrics::forced_import(cfg)?), + activity: Box::new(CoreActivity::forced_import(cfg)?), + realized: Box::new(CoreRealized::forced_import(cfg)?), + unrealized: Box::new(UnrealizedComplete::forced_import(cfg)?), + relative: Box::new(RelativeCompleteWithRelToAll::forced_import(cfg)?), + }) + } + + pub(crate) fn min_stateful_height_len(&self) -> usize { + self.supply + .min_len() + .min(self.outputs.min_len()) + .min(self.activity.min_len()) + .min(self.realized.min_stateful_height_len()) + .min(self.unrealized.min_stateful_height_len()) + } + + pub(crate) fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { + self.supply.validate_computed_versions(base_version)?; + self.activity.validate_computed_versions(base_version)?; + Ok(()) + } + + pub(crate) fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); + vecs.extend(self.supply.par_iter_mut().collect::>()); + vecs.extend(self.outputs.par_iter_mut().collect::>()); + vecs.extend(self.activity.par_iter_mut().collect::>()); + vecs.extend(self.realized.collect_vecs_mut()); + vecs.extend(self.unrealized.collect_vecs_mut()); + vecs + } + + pub(crate) fn compute_from_sources( + &mut self, + starting_indexes: &Indexes, + others: &[&CoreCohortMetrics], + exit: &Exit, + ) -> Result<()> { + self.supply.compute_from_stateful( + starting_indexes, + &others.iter().map(|v| v.supply.as_ref()).collect::>(), + exit, + )?; + self.outputs.compute_from_stateful( + starting_indexes, + &others.iter().map(|v| v.outputs.as_ref()).collect::>(), + exit, + )?; + self.activity.compute_from_stateful( + starting_indexes, + &others.iter().map(|v| v.activity.as_ref()).collect::>(), + exit, + )?; + self.realized.compute_from_stateful( + starting_indexes, + &others.iter().map(|v| v.realized.as_ref()).collect::>(), + exit, + )?; + self.unrealized.compute_from_stateful( + starting_indexes, + &others.iter().map(|v| v.unrealized.as_ref()).collect::>(), + exit, + )?; + + Ok(()) + } + + pub(crate) fn compute_rest_part1( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.supply + .compute(prices, starting_indexes.height, exit)?; + self.supply + .compute_rest_part1(blocks, starting_indexes, exit)?; + self.outputs + .compute_rest(blocks, starting_indexes, exit)?; + + self.activity + .compute_rest_part1(blocks, prices, starting_indexes, exit)?; + + self.realized + .compute_rest_part1(starting_indexes, exit)?; + + self.unrealized.compute_rest(starting_indexes, exit)?; + + Ok(()) + } + + pub(crate) fn compute_rest_part2( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + height_to_market_cap: &impl ReadableVec, + all_supply_sats: &impl ReadableVec, + exit: &Exit, + ) -> Result<()> { + self.realized.compute_rest_part2( + blocks, + prices, + starting_indexes, + &self.supply.total.btc.height, + exit, + )?; + + self.relative.compute( + starting_indexes.height, + &self.unrealized, + &self.supply.total.sats.height, + height_to_market_cap, + all_supply_sats, + exit, + )?; + + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/minimal.rs b/crates/brk_computer/src/distribution/metrics/cohort/minimal.rs new file mode 100644 index 000000000..97a18e757 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/cohort/minimal.rs @@ -0,0 +1,302 @@ +use brk_cohort::Filter; +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{ + BasisPoints16, BasisPoints32, Bitcoin, Cents, Dollars, Height, Indexes, Sats, StoredF32, + Version, +}; +use rayon::prelude::*; +use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode, WritableVec}; + +use crate::{blocks, prices}; + +use crate::internal::{ + CentsUnsignedToDollars, ComputedFromHeight, ComputedFromHeightRatio, Identity, LazyFromHeight, + PercentFromHeight, Price, RatioSatsBp16, ValueFromHeight, +}; + +use crate::distribution::{ + metrics::{ImportConfig, OutputsMetrics, SupplyMetrics}, + state::UnrealizedState, +}; + +/// Minimal realized metrics: realized cap, realized price, and MVRV ratio. +#[derive(Traversable)] +pub struct MinimalRealized { + pub realized_cap_cents: ComputedFromHeight, + pub realized_cap: LazyFromHeight, + pub realized_price: Price>, + pub realized_price_ratio: ComputedFromHeightRatio, + pub mvrv: LazyFromHeight, +} + +/// Minimal unrealized metrics: supply in profit/loss only. +#[derive(Traversable)] +pub struct MinimalUnrealized { + pub supply_in_profit: ValueFromHeight, + pub supply_in_loss: ValueFromHeight, +} + +/// Minimal relative metrics: supply in profit/loss relative to own supply. +#[derive(Traversable)] +pub struct MinimalRelative { + pub supply_in_profit_rel_to_own_supply: PercentFromHeight, + pub supply_in_loss_rel_to_own_supply: PercentFromHeight, +} + +/// MinimalCohortMetrics (Tier A): ~15 stored vecs. +/// +/// Used for type_ cohorts where most metrics are irrelevant. +/// Does NOT implement CohortMetricsBase — standalone, not aggregatable. +#[derive(Traversable)] +pub struct MinimalCohortMetrics { + #[traversable(skip)] + pub filter: Filter, + pub supply: Box>, + pub outputs: Box>, + pub realized: Box>, + pub unrealized: Box>, + pub relative: Box>, +} + +impl MinimalRealized { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + let realized_cap_cents = cfg.import_computed("realized_cap_cents", Version::ZERO)?; + let realized_cap = LazyFromHeight::from_computed::( + &cfg.name("realized_cap"), + cfg.version, + realized_cap_cents.height.read_only_boxed_clone(), + &realized_cap_cents, + ); + + let realized_price = cfg.import_price("realized_price", Version::ONE)?; + let realized_price_ratio = cfg.import_ratio("realized_price", Version::ONE)?; + let mvrv = LazyFromHeight::from_lazy::, BasisPoints32>( + &cfg.name("mvrv"), + cfg.version, + &realized_price_ratio.ratio, + ); + + Ok(Self { + realized_cap_cents, + realized_cap, + realized_price, + realized_price_ratio, + mvrv, + }) + } + + pub(crate) fn min_stateful_height_len(&self) -> usize { + self.realized_cap_cents.height.len() + } + + pub(crate) fn truncate_push(&mut self, height: Height, cap: Cents) -> Result<()> { + self.realized_cap_cents + .height + .truncate_push(height, cap)?; + Ok(()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + vec![&mut self.realized_cap_cents.height as &mut dyn AnyStoredVec] + } + + pub(crate) fn compute_rest_part2( + &mut self, + prices: &prices::Vecs, + starting_indexes: &Indexes, + height_to_supply: &impl ReadableVec, + exit: &Exit, + ) -> Result<()> { + self.realized_price.cents.height.compute_transform2( + starting_indexes.height, + &self.realized_cap_cents.height, + height_to_supply, + |(i, cap_cents, supply, ..)| { + let cap = cap_cents.as_u128(); + let supply_sats = Sats::from(supply).as_u128(); + if supply_sats == 0 { + (i, Cents::ZERO) + } else { + (i, Cents::from(cap * Sats::ONE_BTC_U128 / supply_sats)) + } + }, + exit, + )?; + + self.realized_price_ratio.compute_ratio( + starting_indexes, + &prices.price.cents.height, + &self.realized_price.cents.height, + exit, + )?; + + Ok(()) + } +} + +impl MinimalUnrealized { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + Ok(Self { + supply_in_profit: cfg.import_value("supply_in_profit", Version::ZERO)?, + supply_in_loss: cfg.import_value("supply_in_loss", Version::ZERO)?, + }) + } + + pub(crate) fn min_stateful_height_len(&self) -> usize { + self.supply_in_profit + .sats + .height + .len() + .min(self.supply_in_loss.sats.height.len()) + } + + pub(crate) fn truncate_push( + &mut self, + height: Height, + state: &UnrealizedState, + ) -> Result<()> { + self.supply_in_profit + .sats + .height + .truncate_push(height, state.supply_in_profit)?; + self.supply_in_loss + .sats + .height + .truncate_push(height, state.supply_in_loss)?; + Ok(()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + vec![ + &mut self.supply_in_profit.base.sats.height as &mut dyn AnyStoredVec, + &mut self.supply_in_profit.base.cents.height as &mut dyn AnyStoredVec, + &mut self.supply_in_loss.base.sats.height as &mut dyn AnyStoredVec, + &mut self.supply_in_loss.base.cents.height as &mut dyn AnyStoredVec, + ] + } + + pub(crate) fn compute_rest( + &mut self, + prices: &prices::Vecs, + max_from: Height, + exit: &Exit, + ) -> Result<()> { + self.supply_in_profit.compute(prices, max_from, exit)?; + self.supply_in_loss.compute(prices, max_from, exit)?; + Ok(()) + } +} + +impl MinimalRelative { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + Ok(Self { + supply_in_profit_rel_to_own_supply: cfg + .import_percent_bp16("supply_in_profit_rel_to_own_supply", Version::ONE)?, + supply_in_loss_rel_to_own_supply: cfg + .import_percent_bp16("supply_in_loss_rel_to_own_supply", Version::ONE)?, + }) + } + + pub(crate) fn compute( + &mut self, + max_from: Height, + supply_in_profit_sats: &impl ReadableVec, + supply_in_loss_sats: &impl ReadableVec, + supply_total_sats: &impl ReadableVec, + exit: &Exit, + ) -> Result<()> { + self.supply_in_profit_rel_to_own_supply + .compute_binary::( + max_from, + supply_in_profit_sats, + supply_total_sats, + exit, + )?; + self.supply_in_loss_rel_to_own_supply + .compute_binary::( + max_from, + supply_in_loss_sats, + supply_total_sats, + exit, + )?; + Ok(()) + } +} + +impl MinimalCohortMetrics { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + Ok(Self { + filter: cfg.filter.clone(), + supply: Box::new(SupplyMetrics::forced_import(cfg)?), + outputs: Box::new(OutputsMetrics::forced_import(cfg)?), + realized: Box::new(MinimalRealized::forced_import(cfg)?), + unrealized: Box::new(MinimalUnrealized::forced_import(cfg)?), + relative: Box::new(MinimalRelative::forced_import(cfg)?), + }) + } + + pub(crate) fn min_stateful_height_len(&self) -> usize { + self.supply + .min_len() + .min(self.outputs.min_len()) + .min(self.realized.min_stateful_height_len()) + .min(self.unrealized.min_stateful_height_len()) + } + + pub(crate) fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { + self.supply.validate_computed_versions(base_version)?; + Ok(()) + } + + pub(crate) fn collect_all_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); + vecs.extend(self.supply.par_iter_mut().collect::>()); + vecs.extend(self.outputs.par_iter_mut().collect::>()); + vecs.extend(self.realized.collect_vecs_mut()); + vecs.extend(self.unrealized.collect_vecs_mut()); + vecs + } + + pub(crate) fn compute_rest_part1( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.supply + .compute(prices, starting_indexes.height, exit)?; + self.supply + .compute_rest_part1(blocks, starting_indexes, exit)?; + self.outputs + .compute_rest(blocks, starting_indexes, exit)?; + self.unrealized + .compute_rest(prices, starting_indexes.height, exit)?; + Ok(()) + } + + pub(crate) fn compute_rest_part2( + &mut self, + prices: &prices::Vecs, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.realized.compute_rest_part2( + prices, + starting_indexes, + &self.supply.total.btc.height, + exit, + )?; + + self.relative.compute( + starting_indexes.height, + &self.unrealized.supply_in_profit.sats.height, + &self.unrealized.supply_in_loss.sats.height, + &self.supply.total.sats.height, + exit, + )?; + + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/cohort/mod.rs b/crates/brk_computer/src/distribution/metrics/cohort/mod.rs index e77ba80a1..0cda51957 100644 --- a/crates/brk_computer/src/distribution/metrics/cohort/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/cohort/mod.rs @@ -1,11 +1,17 @@ mod adjusted; mod all; mod basic; +mod complete; +mod core; mod extended; mod extended_adjusted; +mod minimal; pub use adjusted::*; pub use all::*; pub use basic::*; +pub use complete::*; +pub use core::*; pub use extended::*; pub use extended_adjusted::*; +pub use minimal::*; diff --git a/crates/brk_computer/src/distribution/metrics/mod.rs b/crates/brk_computer/src/distribution/metrics/mod.rs index e237e4c3f..20bdc44e0 100644 --- a/crates/brk_computer/src/distribution/metrics/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/mod.rs @@ -168,7 +168,7 @@ pub trait CohortMetricsBase: Send + Sync { .sent .compute(prices, starting_indexes.height, exit)?; self.activity_mut() - .compute_rest_part1(blocks, starting_indexes, exit)?; + .compute_rest_part1(blocks, prices, starting_indexes, exit)?; self.realized_base_mut() .sent_in_profit diff --git a/crates/brk_computer/src/distribution/metrics/realized/base.rs b/crates/brk_computer/src/distribution/metrics/realized/base.rs index 2e6b13afe..e5b5490f6 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/base.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/base.rs @@ -1,38 +1,38 @@ use brk_error::Result; use brk_traversable::Traversable; use brk_types::{ - BasisPoints32, BasisPointsSigned32, Bitcoin, Cents, CentsSats, CentsSigned, - CentsSquaredSats, Dollars, Height, Indexes, Sats, StoredF32, StoredF64, Version, -}; -use vecdb::{ - AnyStoredVec, AnyVec, BytesVec, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode, - WritableVec, + BasisPoints32, Bitcoin, Cents, CentsSats, CentsSquaredSats, Dollars, Height, Indexes, Version, }; +use derive_more::{Deref, DerefMut}; +use vecdb::{AnyStoredVec, AnyVec, BytesVec, Exit, ReadableVec, Rw, StorageMode, WritableVec}; use crate::{ blocks, distribution::state::RealizedState, internal::{ - CentsPlus, CentsUnsignedToDollars, ComputedFromHeight, ComputedFromHeightCumulative, - ComputedFromHeightRatio, FiatFromHeight, Identity, LazyFromHeight, - NegCentsUnsignedToDollars, PercentFromHeight, PercentRollingEmas1w1m, - PercentRollingWindows, Price, RatioCents64, RatioCentsBp32, - RatioCentsSignedCentsBps32, RatioCentsSignedDollarsBps32, RollingEmas1w1m, RollingEmas2w, - RollingWindows, ValueFromHeightCumulative, + ComputedFromHeight, ComputedFromHeightCumulative, ComputedFromHeightRatio, + PercentFromHeight, PercentRollingEmas1w1m, PercentRollingWindows, Price, RatioCentsBp32, }, prices, }; use crate::distribution::metrics::ImportConfig; -#[derive(Traversable)] -pub struct RealizedBase { - pub realized_cap_cents: ComputedFromHeight, - pub realized_cap: LazyFromHeight, - pub realized_price: Price>, - pub realized_price_ratio: ComputedFromHeightRatio, - pub realized_cap_change_1m: ComputedFromHeight, +use super::RealizedComplete; +/// Full realized metrics (Source/Extended tier). +/// +/// Contains all Complete-tier fields (via Deref to RealizedComplete) plus: +/// - Source-only: peak_regret, peak_regret_rel_to_realized_cap +/// - Extended-only: investor_price, price bands, cap_raw, sell_side_risk_ratio +#[derive(Deref, DerefMut, Traversable)] +pub struct RealizedBase { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub complete: RealizedComplete, + + // --- Extended-only fields --- pub investor_price: Price>, pub investor_price_ratio: ComputedFromHeightRatio, @@ -42,93 +42,20 @@ pub struct RealizedBase { pub cap_raw: M::Stored>, pub investor_cap_raw: M::Stored>, - pub mvrv: LazyFromHeight, - - pub realized_profit: ComputedFromHeightCumulative, - pub realized_profit_ema_1w: ComputedFromHeight, - pub realized_loss: ComputedFromHeightCumulative, - pub realized_loss_ema_1w: ComputedFromHeight, - pub neg_realized_loss: LazyFromHeight, - pub net_realized_pnl: ComputedFromHeightCumulative, - pub net_realized_pnl_ema_1w: ComputedFromHeight, - pub gross_pnl: FiatFromHeight, - - pub realized_profit_rel_to_realized_cap: PercentFromHeight, - pub realized_loss_rel_to_realized_cap: PercentFromHeight, - pub net_realized_pnl_rel_to_realized_cap: PercentFromHeight, - - pub profit_value_created: ComputedFromHeight, - pub profit_value_destroyed: ComputedFromHeight, - pub loss_value_created: ComputedFromHeight, - pub loss_value_destroyed: ComputedFromHeight, - - pub value_created: ComputedFromHeight, - pub value_destroyed: ComputedFromHeight, - - pub capitulation_flow: LazyFromHeight, - pub profit_flow: LazyFromHeight, - - pub value_created_sum: RollingWindows, - pub value_destroyed_sum: RollingWindows, - - pub sopr: RollingWindows, - pub sopr_24h_ema: RollingEmas1w1m, - - pub gross_pnl_sum: RollingWindows, pub sell_side_risk_ratio: PercentRollingWindows, pub sell_side_risk_ratio_24h_ema: PercentRollingEmas1w1m, - pub net_pnl_change_1m: ComputedFromHeight, - pub net_pnl_change_1m_rel_to_realized_cap: PercentFromHeight, - pub net_pnl_change_1m_rel_to_market_cap: PercentFromHeight, - + // --- Source-only fields --- pub peak_regret: ComputedFromHeightCumulative, pub peak_regret_rel_to_realized_cap: PercentFromHeight, - - pub sent_in_profit: ValueFromHeightCumulative, - pub sent_in_profit_ema: RollingEmas2w, - pub sent_in_loss: ValueFromHeightCumulative, - pub sent_in_loss_ema: RollingEmas2w, } impl RealizedBase { pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { let v0 = Version::ZERO; - let v1 = Version::ONE; - let realized_cap_cents = cfg.import_computed("realized_cap_cents", v0)?; - let realized_cap = LazyFromHeight::from_computed::( - &cfg.name("realized_cap"), - cfg.version, - realized_cap_cents.height.read_only_boxed_clone(), - &realized_cap_cents, - ); + let complete = RealizedComplete::forced_import(cfg)?; - let realized_profit = cfg.import_cumulative("realized_profit", v0)?; - let realized_profit_ema_1w = cfg.import_computed("realized_profit_ema_1w", v0)?; - let realized_loss = cfg.import_cumulative("realized_loss", v0)?; - let realized_loss_ema_1w = cfg.import_computed("realized_loss_ema_1w", v0)?; - - let neg_realized_loss = LazyFromHeight::from_height_source::( - &cfg.name("neg_realized_loss"), - cfg.version + Version::ONE, - realized_loss.height.read_only_boxed_clone(), - cfg.indexes, - ); - - let net_realized_pnl = cfg.import_cumulative("net_realized_pnl", v0)?; - let net_realized_pnl_ema_1w = cfg.import_computed("net_realized_pnl_ema_1w", v0)?; - let peak_regret = cfg.import_cumulative("realized_peak_regret", Version::new(2))?; - let gross_pnl = cfg.import_fiat("realized_gross_pnl", v0)?; - - let realized_profit_rel_to_realized_cap = - cfg.import_percent_bp32("realized_profit_rel_to_realized_cap", Version::new(2))?; - let realized_loss_rel_to_realized_cap = - cfg.import_percent_bp32("realized_loss_rel_to_realized_cap", Version::new(2))?; - let net_realized_pnl_rel_to_realized_cap = - cfg.import_percent_bps32("net_realized_pnl_rel_to_realized_cap", Version::new(2))?; - - let realized_price = cfg.import_price("realized_price", v1)?; let investor_price = cfg.import_price("investor_price", v0)?; let investor_price_ratio = cfg.import_ratio("investor_price", v0)?; let lower_price_band = cfg.import_price("lower_price_band", v0)?; @@ -137,132 +64,41 @@ impl RealizedBase { let cap_raw = cfg.import_bytes("cap_raw", v0)?; let investor_cap_raw = cfg.import_bytes("investor_cap_raw", v0)?; - let profit_value_created = cfg.import_computed("profit_value_created", v0)?; - let profit_value_destroyed = cfg.import_computed("profit_value_destroyed", v0)?; - let loss_value_created = cfg.import_computed("loss_value_created", v0)?; - let loss_value_destroyed = cfg.import_computed("loss_value_destroyed", v0)?; - let value_created = cfg.import_computed("value_created", v0)?; - let value_destroyed = cfg.import_computed("value_destroyed", v0)?; - - let capitulation_flow = LazyFromHeight::from_computed::( - &cfg.name("capitulation_flow"), - cfg.version, - loss_value_destroyed.height.read_only_boxed_clone(), - &loss_value_destroyed, - ); - let profit_flow = LazyFromHeight::from_computed::( - &cfg.name("profit_flow"), - cfg.version, - profit_value_destroyed.height.read_only_boxed_clone(), - &profit_value_destroyed, - ); - - let realized_price_ratio = cfg.import_ratio("realized_price", v1)?; - let mvrv = LazyFromHeight::from_lazy::, BasisPoints32>( - &cfg.name("mvrv"), - cfg.version, - &realized_price_ratio.ratio, - ); - - // Rolling windows - let value_created_sum = cfg.import_rolling("value_created", v1)?; - let value_destroyed_sum = cfg.import_rolling("value_destroyed", v1)?; - let gross_pnl_sum = cfg.import_rolling("gross_pnl_sum", v1)?; - let sopr = cfg.import_rolling("sopr", v1)?; - let sell_side_risk_ratio = cfg.import_percent_rolling_bp32("sell_side_risk_ratio", Version::new(2))?; - - // EMAs - let sopr_24h_ema = cfg.import_emas_1w_1m("sopr_24h", v1)?; + let sell_side_risk_ratio = + cfg.import_percent_rolling_bp32("sell_side_risk_ratio", Version::new(2))?; let sell_side_risk_ratio_24h_ema = cfg.import_percent_emas_1w_1m_bp32("sell_side_risk_ratio_24h", Version::new(2))?; + let peak_regret = cfg.import_cumulative("realized_peak_regret", Version::new(2))?; let peak_regret_rel_to_realized_cap = cfg.import_percent_bp32("realized_peak_regret_rel_to_realized_cap", Version::new(2))?; Ok(Self { - realized_cap_cents, - realized_cap, - realized_price, - realized_price_ratio, - realized_cap_change_1m: cfg.import_computed("realized_cap_change_1m", v0)?, + complete, investor_price, investor_price_ratio, lower_price_band, upper_price_band, cap_raw, investor_cap_raw, - mvrv, - realized_profit, - realized_profit_ema_1w, - realized_loss, - realized_loss_ema_1w, - neg_realized_loss, - net_realized_pnl, - net_realized_pnl_ema_1w, - gross_pnl, - realized_profit_rel_to_realized_cap, - realized_loss_rel_to_realized_cap, - net_realized_pnl_rel_to_realized_cap, - profit_value_created, - profit_value_destroyed, - loss_value_created, - loss_value_destroyed, - value_created, - value_destroyed, - capitulation_flow, - profit_flow, - value_created_sum, - value_destroyed_sum, - sopr, - sopr_24h_ema, - gross_pnl_sum, sell_side_risk_ratio, sell_side_risk_ratio_24h_ema, - net_pnl_change_1m: cfg.import_computed("net_pnl_change_1m", Version::new(3))?, - net_pnl_change_1m_rel_to_realized_cap: cfg - .import_percent_bps32("net_pnl_change_1m_rel_to_realized_cap", Version::new(4))?, - net_pnl_change_1m_rel_to_market_cap: cfg - .import_percent_bps32("net_pnl_change_1m_rel_to_market_cap", Version::new(4))?, peak_regret, peak_regret_rel_to_realized_cap, - sent_in_profit: cfg.import_value_cumulative("sent_in_profit", v0)?, - sent_in_profit_ema: cfg.import_emas_2w("sent_in_profit", v0)?, - sent_in_loss: cfg.import_value_cumulative("sent_in_loss", v0)?, - sent_in_loss_ema: cfg.import_emas_2w("sent_in_loss", v0)?, }) } pub(crate) fn min_stateful_height_len(&self) -> usize { - [ - self.realized_cap.height.len(), - self.realized_profit.height.len(), - self.realized_loss.height.len(), - self.investor_price.cents.height.len(), - self.cap_raw.len(), - self.investor_cap_raw.len(), - self.profit_value_created.height.len(), - self.profit_value_destroyed.height.len(), - self.loss_value_created.height.len(), - self.loss_value_destroyed.height.len(), - self.peak_regret.height.len(), - self.sent_in_profit.base.sats.height.len(), - self.sent_in_loss.base.sats.height.len(), - ] - .into_iter() - .min() - .unwrap() + self.complete + .min_stateful_height_len() + .min(self.investor_price.cents.height.len()) + .min(self.cap_raw.len()) + .min(self.investor_cap_raw.len()) + .min(self.peak_regret.height.len()) } pub(crate) fn truncate_push(&mut self, height: Height, state: &RealizedState) -> Result<()> { - self.realized_cap_cents - .height - .truncate_push(height, state.cap())?; - self.realized_profit - .height - .truncate_push(height, state.profit())?; - self.realized_loss - .height - .truncate_push(height, state.loss())?; + self.complete.truncate_push(height, state)?; self.investor_price .cents .height @@ -270,51 +106,20 @@ impl RealizedBase { self.cap_raw.truncate_push(height, state.cap_raw())?; self.investor_cap_raw .truncate_push(height, state.investor_cap_raw())?; - self.profit_value_created - .height - .truncate_push(height, state.profit_value_created())?; - self.profit_value_destroyed - .height - .truncate_push(height, state.profit_value_destroyed())?; - self.loss_value_created - .height - .truncate_push(height, state.loss_value_created())?; - self.loss_value_destroyed - .height - .truncate_push(height, state.loss_value_destroyed())?; self.peak_regret .height .truncate_push(height, state.peak_regret())?; - self.sent_in_profit - .base - .sats - .height - .truncate_push(height, state.sent_in_profit())?; - self.sent_in_loss - .base - .sats - .height - .truncate_push(height, state.sent_in_loss())?; Ok(()) } pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - vec![ - &mut self.realized_cap_cents.height as &mut dyn AnyStoredVec, - &mut self.realized_profit.height, - &mut self.realized_loss.height, - &mut self.investor_price.cents.height, - &mut self.cap_raw as &mut dyn AnyStoredVec, - &mut self.investor_cap_raw as &mut dyn AnyStoredVec, - &mut self.profit_value_created.height, - &mut self.profit_value_destroyed.height, - &mut self.loss_value_created.height, - &mut self.loss_value_destroyed.height, - &mut self.peak_regret.height, - &mut self.sent_in_profit.base.sats.height, - &mut self.sent_in_loss.base.sats.height, - ] + let mut vecs = self.complete.collect_vecs_mut(); + vecs.push(&mut self.investor_price.cents.height as &mut dyn AnyStoredVec); + vecs.push(&mut self.cap_raw as &mut dyn AnyStoredVec); + vecs.push(&mut self.investor_cap_raw as &mut dyn AnyStoredVec); + vecs.push(&mut self.peak_regret.height as &mut dyn AnyStoredVec); + vecs } pub(crate) fn compute_from_stateful( @@ -323,19 +128,11 @@ impl RealizedBase { others: &[&Self], exit: &Exit, ) -> Result<()> { - macro_rules! sum_others { - ($($field:tt).+) => { - self.$($field).+.compute_sum_of_others( - starting_indexes.height, - &others.iter().map(|v| &v.$($field).+).collect::>(), - exit, - )? - }; - } - - sum_others!(realized_cap_cents.height); - sum_others!(realized_profit.height); - sum_others!(realized_loss.height); + // Delegate Complete-tier aggregation + let complete_refs: Vec<&RealizedComplete> = + others.iter().map(|o| &o.complete).collect(); + self.complete + .compute_from_stateful(starting_indexes, &complete_refs, exit)?; // Aggregate raw values for investor_price computation let investor_price_dep_version = others @@ -396,13 +193,15 @@ impl RealizedBase { self.investor_price.cents.height.write()?; } - sum_others!(profit_value_created.height); - sum_others!(profit_value_destroyed.height); - sum_others!(loss_value_created.height); - sum_others!(loss_value_destroyed.height); - sum_others!(peak_regret.height); - sum_others!(sent_in_profit.base.sats.height); - sum_others!(sent_in_loss.base.sats.height); + // Source-only: peak_regret + self.peak_regret.height.compute_sum_of_others( + starting_indexes.height, + &others + .iter() + .map(|v| &v.peak_regret.height) + .collect::>(), + exit, + )?; Ok(()) } @@ -412,34 +211,7 @@ impl RealizedBase { starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { - self.realized_profit - .compute_rest(starting_indexes.height, exit)?; - self.realized_loss - .compute_rest(starting_indexes.height, exit)?; - - self.net_realized_pnl - .compute(starting_indexes.height, exit, |vec| { - vec.compute_transform2( - starting_indexes.height, - &self.realized_profit.height, - &self.realized_loss.height, - |(i, profit, loss, ..)| { - ( - i, - CentsSigned::new(profit.inner() as i64 - loss.inner() as i64), - ) - }, - exit, - )?; - Ok(()) - })?; - - self.gross_pnl.cents.height.compute_add( - starting_indexes.height, - &self.realized_profit.height, - &self.realized_loss.height, - exit, - )?; + self.complete.compute_rest_part1(starting_indexes, exit)?; self.peak_regret .compute_rest(starting_indexes.height, exit)?; @@ -457,29 +229,17 @@ impl RealizedBase { height_to_market_cap: &impl ReadableVec, exit: &Exit, ) -> Result<()> { - self.realized_price.cents.height.compute_transform2( - starting_indexes.height, - &self.realized_cap_cents.height, - height_to_supply, - |(i, cap_cents, supply, ..)| { - let cap = cap_cents.as_u128(); - let supply_sats = Sats::from(supply).as_u128(); - if supply_sats == 0 { - (i, Cents::ZERO) - } else { - (i, Cents::from(cap * Sats::ONE_BTC_U128 / supply_sats)) - } - }, - exit, - )?; - - self.realized_price_ratio.compute_ratio( + // Compute all Complete-tier fields + self.complete.compute_rest_part2( + blocks, + prices, starting_indexes, - &prices.price.cents.height, - &self.realized_price.cents.height, + height_to_supply, + height_to_market_cap, exit, )?; + // Extended-only: investor_price ratio and price bands self.investor_price_ratio.compute_ratio( starting_indexes, &prices.price.cents.height, @@ -489,7 +249,7 @@ impl RealizedBase { self.lower_price_band.cents.height.compute_transform2( starting_indexes.height, - &self.realized_price.cents.height, + &self.complete.realized_price.cents.height, &self.investor_price.cents.height, |(i, rp, ip, ..)| { let rp = rp.as_u128(); @@ -506,7 +266,7 @@ impl RealizedBase { self.upper_price_band.cents.height.compute_transform2( starting_indexes.height, &self.investor_price.cents.height, - &self.realized_price.cents.height, + &self.complete.realized_price.cents.height, |(i, ip, rp, ..)| { let ip = ip.as_u128(); let rp = rp.as_u128(); @@ -519,126 +279,22 @@ impl RealizedBase { exit, )?; - self.realized_cap_change_1m.height.compute_rolling_change( - starting_indexes.height, - &blocks.count.height_1m_ago, - &self.realized_cap_cents.height, - exit, - )?; - - // Compute value_created/destroyed from stored components - self.value_created - .compute_binary::( - starting_indexes.height, - &self.profit_value_created.height, - &self.loss_value_created.height, - exit, - )?; - self.value_destroyed - .compute_binary::( - starting_indexes.height, - &self.profit_value_destroyed.height, - &self.loss_value_destroyed.height, - exit, - )?; - - let window_starts = blocks.count.window_starts(); - self.value_created_sum.compute_rolling_sum( - starting_indexes.height, - &window_starts, - &self.value_created.height, - exit, - )?; - self.value_destroyed_sum.compute_rolling_sum( - starting_indexes.height, - &window_starts, - &self.value_destroyed.height, - exit, - )?; - self.gross_pnl_sum.compute_rolling_sum( - starting_indexes.height, - &window_starts, - &self.gross_pnl.cents.height, - exit, - )?; - - // Compute SOPR from rolling sums - for ((sopr, vc), vd) in self - .sopr - .as_mut_array() - .into_iter() - .zip(self.value_created_sum.as_array()) - .zip(self.value_destroyed_sum.as_array()) - { - sopr.compute_binary::( - starting_indexes.height, - &vc.height, - &vd.height, - exit, - )?; - } - - // Compute sell-side risk ratios + // Extended-only: sell-side risk ratios for (ssrr, rv) in self .sell_side_risk_ratio .as_mut_array() .into_iter() - .zip(self.gross_pnl_sum.as_array()) + .zip(self.complete.gross_pnl_sum.as_array()) { ssrr.compute_binary::( starting_indexes.height, &rv.height, - &self.realized_cap_cents.height, + &self.complete.realized_cap_cents.height, exit, )?; } - // 7d EMAs - self.realized_profit_ema_1w.height.compute_rolling_ema( - starting_indexes.height, - &blocks.count.height_1w_ago, - &self.realized_profit.height, - exit, - )?; - self.realized_loss_ema_1w.height.compute_rolling_ema( - starting_indexes.height, - &blocks.count.height_1w_ago, - &self.realized_loss.height, - exit, - )?; - self.net_realized_pnl_ema_1w.height.compute_rolling_ema( - starting_indexes.height, - &blocks.count.height_1w_ago, - &self.net_realized_pnl.height, - exit, - )?; - - // 14-day EMA of sent in profit/loss - self.sent_in_profit_ema.compute( - starting_indexes.height, - &blocks.count.height_2w_ago, - &self.sent_in_profit.base.sats.height, - &self.sent_in_profit.base.cents.height, - exit, - )?; - self.sent_in_loss_ema.compute( - starting_indexes.height, - &blocks.count.height_2w_ago, - &self.sent_in_loss.base.sats.height, - &self.sent_in_loss.base.cents.height, - exit, - )?; - - // SOPR EMAs (based on 24h window) - self.sopr_24h_ema.compute_from_24h( - starting_indexes.height, - &blocks.count.height_1w_ago, - &blocks.count.height_1m_ago, - &self.sopr._24h.height, - exit, - )?; - - // Sell side risk EMAs (based on 24h window) + // Extended-only: sell side risk EMAs self.sell_side_risk_ratio_24h_ema.compute_from_24h( starting_indexes.height, &blocks.count.height_1w_ago, @@ -647,57 +303,12 @@ impl RealizedBase { exit, )?; - // Realized profit/loss/net relative to realized cap - self.realized_profit_rel_to_realized_cap - .compute_binary::( - starting_indexes.height, - &self.realized_profit.height, - &self.realized_cap_cents.height, - exit, - )?; - self.realized_loss_rel_to_realized_cap - .compute_binary::( - starting_indexes.height, - &self.realized_loss.height, - &self.realized_cap_cents.height, - exit, - )?; - self.net_realized_pnl_rel_to_realized_cap - .compute_binary::( - starting_indexes.height, - &self.net_realized_pnl.height, - &self.realized_cap_cents.height, - exit, - )?; + // Source-only: peak_regret relative to realized cap self.peak_regret_rel_to_realized_cap .compute_binary::( starting_indexes.height, &self.peak_regret.height, - &self.realized_cap_cents.height, - exit, - )?; - - // Net realized PnL cumulative 30d delta - self.net_pnl_change_1m.height.compute_rolling_change( - starting_indexes.height, - &blocks.count.height_1m_ago, - &self.net_realized_pnl.cumulative.height, - exit, - )?; - - self.net_pnl_change_1m_rel_to_realized_cap - .compute_binary::( - starting_indexes.height, - &self.net_pnl_change_1m.height, - &self.realized_cap_cents.height, - exit, - )?; - - self.net_pnl_change_1m_rel_to_market_cap - .compute_binary::( - starting_indexes.height, - &self.net_pnl_change_1m.height, - height_to_market_cap, + &self.complete.realized_cap_cents.height, exit, )?; diff --git a/crates/brk_computer/src/distribution/metrics/realized/complete.rs b/crates/brk_computer/src/distribution/metrics/realized/complete.rs new file mode 100644 index 000000000..dc869c83d --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/complete.rs @@ -0,0 +1,328 @@ +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{ + BasisPointsSigned32, Bitcoin, Cents, CentsSigned, Dollars, Height, Indexes, StoredF64, Version, +}; +use derive_more::{Deref, DerefMut}; +use vecdb::{ + AnyStoredVec, AnyVec, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode, WritableVec, +}; + +use crate::{ + blocks, + distribution::state::RealizedState, + internal::{ + CentsPlus, CentsUnsignedToDollars, ComputedFromHeight, LazyFromHeight, PercentFromHeight, + RatioCents64, RatioCentsSignedCentsBps32, RatioCentsSignedDollarsBps32, RollingEmas1w1m, + RollingEmas2w, RollingWindows, ValueFromHeightCumulative, + }, + prices, +}; + +use crate::distribution::metrics::ImportConfig; + +use super::CoreRealized; + +#[derive(Deref, DerefMut, Traversable)] +pub struct RealizedComplete { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub core: CoreRealized, + + pub profit_value_created: ComputedFromHeight, + pub profit_value_destroyed: ComputedFromHeight, + pub loss_value_created: ComputedFromHeight, + pub loss_value_destroyed: ComputedFromHeight, + + pub value_created: ComputedFromHeight, + pub value_destroyed: ComputedFromHeight, + + pub capitulation_flow: LazyFromHeight, + pub profit_flow: LazyFromHeight, + + pub value_created_sum: RollingWindows, + pub value_destroyed_sum: RollingWindows, + + pub gross_pnl_sum: RollingWindows, + + pub net_pnl_change_1m: ComputedFromHeight, + pub net_pnl_change_1m_rel_to_realized_cap: PercentFromHeight, + pub net_pnl_change_1m_rel_to_market_cap: PercentFromHeight, + + pub sopr: RollingWindows, + pub sopr_24h_ema: RollingEmas1w1m, + + pub sent_in_profit: ValueFromHeightCumulative, + pub sent_in_profit_ema: RollingEmas2w, + pub sent_in_loss: ValueFromHeightCumulative, + pub sent_in_loss_ema: RollingEmas2w, +} + +impl RealizedComplete { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + let v0 = Version::ZERO; + + let core = CoreRealized::forced_import(cfg)?; + + let profit_value_created = cfg.import_computed("profit_value_created", v0)?; + let profit_value_destroyed = cfg.import_computed("profit_value_destroyed", v0)?; + let loss_value_created = cfg.import_computed("loss_value_created", v0)?; + let loss_value_destroyed = cfg.import_computed("loss_value_destroyed", v0)?; + let value_created = cfg.import_computed("value_created", v0)?; + let value_destroyed = cfg.import_computed("value_destroyed", v0)?; + + let capitulation_flow = LazyFromHeight::from_computed::( + &cfg.name("capitulation_flow"), + cfg.version, + loss_value_destroyed.height.read_only_boxed_clone(), + &loss_value_destroyed, + ); + let profit_flow = LazyFromHeight::from_computed::( + &cfg.name("profit_flow"), + cfg.version, + profit_value_destroyed.height.read_only_boxed_clone(), + &profit_value_destroyed, + ); + + let value_created_sum = cfg.import_rolling("value_created", Version::ONE)?; + let value_destroyed_sum = cfg.import_rolling("value_destroyed", Version::ONE)?; + let gross_pnl_sum = cfg.import_rolling("gross_pnl_sum", Version::ONE)?; + + let sopr = cfg.import_rolling("sopr", Version::ONE)?; + let sopr_24h_ema = cfg.import_emas_1w_1m("sopr_24h", Version::ONE)?; + + Ok(Self { + core, + profit_value_created, + profit_value_destroyed, + loss_value_created, + loss_value_destroyed, + value_created, + value_destroyed, + capitulation_flow, + profit_flow, + value_created_sum, + value_destroyed_sum, + gross_pnl_sum, + sopr, + sopr_24h_ema, + net_pnl_change_1m: cfg.import_computed("net_pnl_change_1m", Version::new(3))?, + net_pnl_change_1m_rel_to_realized_cap: cfg + .import_percent_bps32("net_pnl_change_1m_rel_to_realized_cap", Version::new(4))?, + net_pnl_change_1m_rel_to_market_cap: cfg + .import_percent_bps32("net_pnl_change_1m_rel_to_market_cap", Version::new(4))?, + sent_in_profit: cfg.import_value_cumulative("sent_in_profit", v0)?, + sent_in_profit_ema: cfg.import_emas_2w("sent_in_profit", v0)?, + sent_in_loss: cfg.import_value_cumulative("sent_in_loss", v0)?, + sent_in_loss_ema: cfg.import_emas_2w("sent_in_loss", v0)?, + }) + } + + pub(crate) fn min_stateful_height_len(&self) -> usize { + self.core + .min_stateful_height_len() + .min(self.profit_value_created.height.len()) + .min(self.profit_value_destroyed.height.len()) + .min(self.loss_value_created.height.len()) + .min(self.loss_value_destroyed.height.len()) + .min(self.sent_in_profit.base.sats.height.len()) + .min(self.sent_in_loss.base.sats.height.len()) + } + + pub(crate) fn truncate_push(&mut self, height: Height, state: &RealizedState) -> Result<()> { + self.core.truncate_push(height, state)?; + self.profit_value_created + .height + .truncate_push(height, state.profit_value_created())?; + self.profit_value_destroyed + .height + .truncate_push(height, state.profit_value_destroyed())?; + self.loss_value_created + .height + .truncate_push(height, state.loss_value_created())?; + self.loss_value_destroyed + .height + .truncate_push(height, state.loss_value_destroyed())?; + self.sent_in_profit + .base + .sats + .height + .truncate_push(height, state.sent_in_profit())?; + self.sent_in_loss + .base + .sats + .height + .truncate_push(height, state.sent_in_loss())?; + + Ok(()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + let mut vecs = self.core.collect_vecs_mut(); + vecs.push(&mut self.profit_value_created.height as &mut dyn AnyStoredVec); + vecs.push(&mut self.profit_value_destroyed.height); + vecs.push(&mut self.loss_value_created.height); + vecs.push(&mut self.loss_value_destroyed.height); + vecs.push(&mut self.sent_in_profit.base.sats.height); + vecs.push(&mut self.sent_in_loss.base.sats.height); + vecs + } + + pub(crate) fn compute_from_stateful( + &mut self, + starting_indexes: &Indexes, + others: &[&Self], + exit: &Exit, + ) -> Result<()> { + let core_refs: Vec<&CoreRealized> = others.iter().map(|o| &o.core).collect(); + self.core + .compute_from_stateful(starting_indexes, &core_refs, exit)?; + + macro_rules! sum_others { + ($($field:tt).+) => { + self.$($field).+.compute_sum_of_others( + starting_indexes.height, + &others.iter().map(|v| &v.$($field).+).collect::>(), + exit, + )? + }; + } + + sum_others!(profit_value_created.height); + sum_others!(profit_value_destroyed.height); + sum_others!(loss_value_created.height); + sum_others!(loss_value_destroyed.height); + sum_others!(sent_in_profit.base.sats.height); + sum_others!(sent_in_loss.base.sats.height); + + Ok(()) + } + + pub(crate) fn compute_rest_part1( + &mut self, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.core.compute_rest_part1(starting_indexes, exit)?; + + Ok(()) + } + + #[allow(clippy::too_many_arguments)] + pub(crate) fn compute_rest_part2( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + height_to_supply: &impl ReadableVec, + height_to_market_cap: &impl ReadableVec, + exit: &Exit, + ) -> Result<()> { + self.core.compute_rest_part2( + blocks, + prices, + starting_indexes, + height_to_supply, + exit, + )?; + + self.value_created + .compute_binary::( + starting_indexes.height, + &self.profit_value_created.height, + &self.loss_value_created.height, + exit, + )?; + self.value_destroyed + .compute_binary::( + starting_indexes.height, + &self.profit_value_destroyed.height, + &self.loss_value_destroyed.height, + exit, + )?; + + let window_starts = blocks.count.window_starts(); + self.value_created_sum.compute_rolling_sum( + starting_indexes.height, + &window_starts, + &self.value_created.height, + exit, + )?; + self.value_destroyed_sum.compute_rolling_sum( + starting_indexes.height, + &window_starts, + &self.value_destroyed.height, + exit, + )?; + self.gross_pnl_sum.compute_rolling_sum( + starting_indexes.height, + &window_starts, + &self.core.gross_pnl.cents.height, + exit, + )?; + + for ((sopr, vc), vd) in self + .sopr + .as_mut_array() + .into_iter() + .zip(self.value_created_sum.as_array()) + .zip(self.value_destroyed_sum.as_array()) + { + sopr.compute_binary::( + starting_indexes.height, + &vc.height, + &vd.height, + exit, + )?; + } + + self.sopr_24h_ema.compute_from_24h( + starting_indexes.height, + &blocks.count.height_1w_ago, + &blocks.count.height_1m_ago, + &self.sopr._24h.height, + exit, + )?; + + self.sent_in_profit_ema.compute( + starting_indexes.height, + &blocks.count.height_2w_ago, + &self.sent_in_profit.base.sats.height, + &self.sent_in_profit.base.cents.height, + exit, + )?; + self.sent_in_loss_ema.compute( + starting_indexes.height, + &blocks.count.height_2w_ago, + &self.sent_in_loss.base.sats.height, + &self.sent_in_loss.base.cents.height, + exit, + )?; + + self.net_pnl_change_1m.height.compute_rolling_change( + starting_indexes.height, + &blocks.count.height_1m_ago, + &self.core.net_realized_pnl.cumulative.height, + exit, + )?; + + self.net_pnl_change_1m_rel_to_realized_cap + .compute_binary::( + starting_indexes.height, + &self.net_pnl_change_1m.height, + &self.core.realized_cap_cents.height, + exit, + )?; + + self.net_pnl_change_1m_rel_to_market_cap + .compute_binary::( + starting_indexes.height, + &self.net_pnl_change_1m.height, + height_to_market_cap, + exit, + )?; + + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/core.rs b/crates/brk_computer/src/distribution/metrics/realized/core.rs new file mode 100644 index 000000000..ce29199cc --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/realized/core.rs @@ -0,0 +1,287 @@ +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{ + BasisPoints32, BasisPointsSigned32, Bitcoin, Cents, CentsSigned, Dollars, Height, Indexes, + Sats, StoredF32, Version, +}; +use vecdb::{ + AnyStoredVec, AnyVec, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode, WritableVec, +}; + +use crate::{ + blocks, + distribution::state::RealizedState, + internal::{ + CentsUnsignedToDollars, ComputedFromHeight, ComputedFromHeightCumulative, + ComputedFromHeightRatio, FiatFromHeight, Identity, LazyFromHeight, + NegCentsUnsignedToDollars, PercentFromHeight, Price, RatioCentsBp32, + RatioCentsSignedCentsBps32, + }, + prices, +}; + +use crate::distribution::metrics::ImportConfig; + +#[derive(Traversable)] +pub struct CoreRealized { + pub realized_cap_cents: ComputedFromHeight, + pub realized_profit: ComputedFromHeightCumulative, + pub realized_loss: ComputedFromHeightCumulative, + + pub realized_cap: LazyFromHeight, + pub realized_price: Price>, + pub realized_price_ratio: ComputedFromHeightRatio, + pub realized_cap_change_1m: ComputedFromHeight, + + pub mvrv: LazyFromHeight, + + pub neg_realized_loss: LazyFromHeight, + pub net_realized_pnl: ComputedFromHeightCumulative, + pub net_realized_pnl_ema_1w: ComputedFromHeight, + pub gross_pnl: FiatFromHeight, + + pub realized_profit_ema_1w: ComputedFromHeight, + pub realized_loss_ema_1w: ComputedFromHeight, + + pub realized_profit_rel_to_realized_cap: PercentFromHeight, + pub realized_loss_rel_to_realized_cap: PercentFromHeight, + pub net_realized_pnl_rel_to_realized_cap: PercentFromHeight, +} + +impl CoreRealized { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + let v0 = Version::ZERO; + let v1 = Version::ONE; + + let realized_cap_cents = cfg.import_computed("realized_cap_cents", v0)?; + let realized_cap = LazyFromHeight::from_computed::( + &cfg.name("realized_cap"), + cfg.version, + realized_cap_cents.height.read_only_boxed_clone(), + &realized_cap_cents, + ); + + let realized_profit = cfg.import_cumulative("realized_profit", v0)?; + let realized_profit_ema_1w = cfg.import_computed("realized_profit_ema_1w", v0)?; + let realized_loss = cfg.import_cumulative("realized_loss", v0)?; + let realized_loss_ema_1w = cfg.import_computed("realized_loss_ema_1w", v0)?; + + let neg_realized_loss = LazyFromHeight::from_height_source::( + &cfg.name("neg_realized_loss"), + cfg.version + Version::ONE, + realized_loss.height.read_only_boxed_clone(), + cfg.indexes, + ); + + let net_realized_pnl = cfg.import_cumulative("net_realized_pnl", v0)?; + let net_realized_pnl_ema_1w = cfg.import_computed("net_realized_pnl_ema_1w", v0)?; + let gross_pnl = cfg.import_fiat("realized_gross_pnl", v0)?; + + let realized_profit_rel_to_realized_cap = + cfg.import_percent_bp32("realized_profit_rel_to_realized_cap", Version::new(2))?; + let realized_loss_rel_to_realized_cap = + cfg.import_percent_bp32("realized_loss_rel_to_realized_cap", Version::new(2))?; + let net_realized_pnl_rel_to_realized_cap = + cfg.import_percent_bps32("net_realized_pnl_rel_to_realized_cap", Version::new(2))?; + + let realized_price = cfg.import_price("realized_price", v1)?; + + let realized_price_ratio = cfg.import_ratio("realized_price", v1)?; + let mvrv = LazyFromHeight::from_lazy::, BasisPoints32>( + &cfg.name("mvrv"), + cfg.version, + &realized_price_ratio.ratio, + ); + + Ok(Self { + realized_cap_cents, + realized_cap, + realized_price, + realized_price_ratio, + realized_cap_change_1m: cfg.import_computed("realized_cap_change_1m", v0)?, + mvrv, + realized_profit, + realized_profit_ema_1w, + realized_loss, + realized_loss_ema_1w, + neg_realized_loss, + net_realized_pnl, + net_realized_pnl_ema_1w, + gross_pnl, + realized_profit_rel_to_realized_cap, + realized_loss_rel_to_realized_cap, + net_realized_pnl_rel_to_realized_cap, + }) + } + + pub(crate) fn min_stateful_height_len(&self) -> usize { + self.realized_cap_cents + .height + .len() + .min(self.realized_profit.height.len()) + .min(self.realized_loss.height.len()) + } + + pub(crate) fn truncate_push(&mut self, height: Height, state: &RealizedState) -> Result<()> { + self.realized_cap_cents + .height + .truncate_push(height, state.cap())?; + self.realized_profit + .height + .truncate_push(height, state.profit())?; + self.realized_loss + .height + .truncate_push(height, state.loss())?; + Ok(()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + vec![ + &mut self.realized_cap_cents.height as &mut dyn AnyStoredVec, + &mut self.realized_profit.height, + &mut self.realized_loss.height, + ] + } + + pub(crate) fn compute_from_stateful( + &mut self, + starting_indexes: &Indexes, + others: &[&Self], + exit: &Exit, + ) -> Result<()> { + macro_rules! sum_others { + ($($field:tt).+) => { + self.$($field).+.compute_sum_of_others( + starting_indexes.height, + &others.iter().map(|v| &v.$($field).+).collect::>(), + exit, + )? + }; + } + + sum_others!(realized_cap_cents.height); + sum_others!(realized_profit.height); + sum_others!(realized_loss.height); + + Ok(()) + } + + pub(crate) fn compute_rest_part1( + &mut self, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.realized_profit + .compute_rest(starting_indexes.height, exit)?; + self.realized_loss + .compute_rest(starting_indexes.height, exit)?; + + self.net_realized_pnl + .compute(starting_indexes.height, exit, |vec| { + vec.compute_transform2( + starting_indexes.height, + &self.realized_profit.height, + &self.realized_loss.height, + |(i, profit, loss, ..)| { + ( + i, + CentsSigned::new(profit.inner() as i64 - loss.inner() as i64), + ) + }, + exit, + )?; + Ok(()) + })?; + + self.gross_pnl.cents.height.compute_add( + starting_indexes.height, + &self.realized_profit.height, + &self.realized_loss.height, + exit, + )?; + + Ok(()) + } + + pub(crate) fn compute_rest_part2( + &mut self, + blocks: &blocks::Vecs, + prices: &prices::Vecs, + starting_indexes: &Indexes, + height_to_supply: &impl ReadableVec, + exit: &Exit, + ) -> Result<()> { + self.realized_price.cents.height.compute_transform2( + starting_indexes.height, + &self.realized_cap_cents.height, + height_to_supply, + |(i, cap_cents, supply, ..)| { + let cap = cap_cents.as_u128(); + let supply_sats = Sats::from(supply).as_u128(); + if supply_sats == 0 { + (i, Cents::ZERO) + } else { + (i, Cents::from(cap * Sats::ONE_BTC_U128 / supply_sats)) + } + }, + exit, + )?; + + self.realized_price_ratio.compute_ratio( + starting_indexes, + &prices.price.cents.height, + &self.realized_price.cents.height, + exit, + )?; + + self.realized_cap_change_1m.height.compute_rolling_change( + starting_indexes.height, + &blocks.count.height_1m_ago, + &self.realized_cap_cents.height, + exit, + )?; + + self.realized_profit_ema_1w.height.compute_rolling_ema( + starting_indexes.height, + &blocks.count.height_1w_ago, + &self.realized_profit.height, + exit, + )?; + self.realized_loss_ema_1w.height.compute_rolling_ema( + starting_indexes.height, + &blocks.count.height_1w_ago, + &self.realized_loss.height, + exit, + )?; + self.net_realized_pnl_ema_1w.height.compute_rolling_ema( + starting_indexes.height, + &blocks.count.height_1w_ago, + &self.net_realized_pnl.height, + exit, + )?; + + self.realized_profit_rel_to_realized_cap + .compute_binary::( + starting_indexes.height, + &self.realized_profit.height, + &self.realized_cap_cents.height, + exit, + )?; + self.realized_loss_rel_to_realized_cap + .compute_binary::( + starting_indexes.height, + &self.realized_loss.height, + &self.realized_cap_cents.height, + exit, + )?; + self.net_realized_pnl_rel_to_realized_cap + .compute_binary::( + starting_indexes.height, + &self.net_realized_pnl.height, + &self.realized_cap_cents.height, + exit, + )?; + + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/realized/mod.rs b/crates/brk_computer/src/distribution/metrics/realized/mod.rs index 497a804a6..475699475 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/mod.rs @@ -1,5 +1,7 @@ mod adjusted; mod base; +mod complete; +mod core; mod extended; mod with_adjusted; @@ -8,6 +10,8 @@ mod with_extended_adjusted; pub use adjusted::*; pub use base::*; +pub use complete::*; +pub use core::*; pub use extended::*; pub use with_adjusted::*; diff --git a/crates/brk_computer/src/distribution/metrics/relative/base.rs b/crates/brk_computer/src/distribution/metrics/relative/base.rs index 5b3b5dbb3..0e5b09d6a 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/base.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/base.rs @@ -1,25 +1,28 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{BasisPoints16, BasisPointsSigned32, Dollars, Height, Sats, StoredF32, Version}; -use vecdb::{Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode}; +use brk_types::{BasisPoints16, BasisPointsSigned32, Dollars, Height, Sats, Version}; +use derive_more::{Deref, DerefMut}; +use vecdb::{Exit, ReadableVec, Rw, StorageMode}; -use crate::internal::{ - Bps32ToFloat, LazyFromHeight, NegRatioDollarsBps32, PercentFromHeight, RatioDollarsBp16, - RatioDollarsBps32, RatioSatsBp16, -}; +use crate::internal::{NegRatioDollarsBps32, PercentFromHeight, RatioDollarsBp16}; use crate::distribution::metrics::{ImportConfig, RealizedBase, UnrealizedBase}; -#[derive(Traversable)] -pub struct RelativeBase { - pub supply_in_profit_rel_to_own_supply: PercentFromHeight, - pub supply_in_loss_rel_to_own_supply: PercentFromHeight, +use super::RelativeComplete; - pub unrealized_profit_rel_to_market_cap: PercentFromHeight, - pub unrealized_loss_rel_to_market_cap: PercentFromHeight, +/// Full relative metrics (Source/Extended tier). +/// +/// Contains all Complete-tier fields (via Deref to RelativeComplete) plus: +/// - Source-only: neg_unrealized_loss_rel_to_market_cap, invested_capital_in_profit/loss_rel_to_realized_cap +#[derive(Deref, DerefMut, Traversable)] +pub struct RelativeBase { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub complete: RelativeComplete, + + // --- Source-only fields --- pub neg_unrealized_loss_rel_to_market_cap: PercentFromHeight, - pub net_unrealized_pnl_rel_to_market_cap: PercentFromHeight, - pub nupl: LazyFromHeight, pub invested_capital_in_profit_rel_to_realized_cap: PercentFromHeight, pub invested_capital_in_loss_rel_to_realized_cap: PercentFromHeight, @@ -27,35 +30,12 @@ pub struct RelativeBase { impl RelativeBase { pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - let v2 = Version::new(2); - - let net_unrealized_pnl_rel_to_market_cap = - cfg.import_percent_bps32("net_unrealized_pnl_rel_to_market_cap", Version::new(3))?; - - let nupl = LazyFromHeight::from_computed::( - &cfg.name("nupl"), - cfg.version + Version::new(3), - net_unrealized_pnl_rel_to_market_cap - .bps - .height - .read_only_boxed_clone(), - &net_unrealized_pnl_rel_to_market_cap.bps, - ); + let complete = RelativeComplete::forced_import(cfg)?; Ok(Self { - supply_in_profit_rel_to_own_supply: cfg - .import_percent_bp16("supply_in_profit_rel_to_own_supply", v1)?, - supply_in_loss_rel_to_own_supply: cfg - .import_percent_bp16("supply_in_loss_rel_to_own_supply", v1)?, - unrealized_profit_rel_to_market_cap: cfg - .import_percent_bp16("unrealized_profit_rel_to_market_cap", v2)?, - unrealized_loss_rel_to_market_cap: cfg - .import_percent_bp16("unrealized_loss_rel_to_market_cap", v2)?, + complete, neg_unrealized_loss_rel_to_market_cap: cfg .import_percent_bps32("neg_unrealized_loss_rel_to_market_cap", Version::new(3))?, - net_unrealized_pnl_rel_to_market_cap, - nupl, invested_capital_in_profit_rel_to_realized_cap: cfg.import_percent_bp16( "invested_capital_in_profit_rel_to_realized_cap", Version::ZERO, @@ -76,34 +56,16 @@ impl RelativeBase { market_cap: &impl ReadableVec, exit: &Exit, ) -> Result<()> { - self.supply_in_profit_rel_to_own_supply - .compute_binary::( - max_from, - &unrealized.supply_in_profit.sats.height, - supply_total_sats, - exit, - )?; - self.supply_in_loss_rel_to_own_supply - .compute_binary::( - max_from, - &unrealized.supply_in_loss.sats.height, - supply_total_sats, - exit, - )?; - self.unrealized_profit_rel_to_market_cap - .compute_binary::( - max_from, - &unrealized.unrealized_profit.usd.height, - market_cap, - exit, - )?; - self.unrealized_loss_rel_to_market_cap - .compute_binary::( - max_from, - &unrealized.unrealized_loss.usd.height, - market_cap, - exit, - )?; + // Compute Complete-tier fields + self.complete.compute( + max_from, + &unrealized.complete, + supply_total_sats, + market_cap, + exit, + )?; + + // Source-only self.neg_unrealized_loss_rel_to_market_cap .compute_binary::( max_from, @@ -111,13 +73,6 @@ impl RelativeBase { market_cap, exit, )?; - self.net_unrealized_pnl_rel_to_market_cap - .compute_binary::( - max_from, - &unrealized.net_unrealized_pnl.usd.height, - market_cap, - exit, - )?; self.invested_capital_in_profit_rel_to_realized_cap .compute_binary::( max_from, diff --git a/crates/brk_computer/src/distribution/metrics/relative/complete.rs b/crates/brk_computer/src/distribution/metrics/relative/complete.rs new file mode 100644 index 000000000..b6f5083a0 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/relative/complete.rs @@ -0,0 +1,105 @@ +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{BasisPoints16, BasisPointsSigned32, Dollars, Height, Sats, StoredF32, Version}; +use vecdb::{Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode}; + +use crate::internal::{ + Bps32ToFloat, LazyFromHeight, PercentFromHeight, RatioDollarsBp16, RatioDollarsBps32, + RatioSatsBp16, +}; + +use crate::distribution::metrics::{ImportConfig, UnrealizedComplete}; + +/// Relative metrics for the Complete tier (~6 fields). +/// +/// Excludes source-only fields (invested_capital_in_profit/loss_rel_to_realized_cap, +/// neg_unrealized_loss_rel_to_market_cap). +#[derive(Traversable)] +pub struct RelativeComplete { + pub supply_in_profit_rel_to_own_supply: PercentFromHeight, + pub supply_in_loss_rel_to_own_supply: PercentFromHeight, + + pub unrealized_profit_rel_to_market_cap: PercentFromHeight, + pub unrealized_loss_rel_to_market_cap: PercentFromHeight, + pub net_unrealized_pnl_rel_to_market_cap: PercentFromHeight, + pub nupl: LazyFromHeight, +} + +impl RelativeComplete { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + let v1 = Version::ONE; + let v2 = Version::new(2); + + let net_unrealized_pnl_rel_to_market_cap = + cfg.import_percent_bps32("net_unrealized_pnl_rel_to_market_cap", Version::new(3))?; + + let nupl = LazyFromHeight::from_computed::( + &cfg.name("nupl"), + cfg.version + Version::new(3), + net_unrealized_pnl_rel_to_market_cap + .bps + .height + .read_only_boxed_clone(), + &net_unrealized_pnl_rel_to_market_cap.bps, + ); + + Ok(Self { + supply_in_profit_rel_to_own_supply: cfg + .import_percent_bp16("supply_in_profit_rel_to_own_supply", v1)?, + supply_in_loss_rel_to_own_supply: cfg + .import_percent_bp16("supply_in_loss_rel_to_own_supply", v1)?, + unrealized_profit_rel_to_market_cap: cfg + .import_percent_bp16("unrealized_profit_rel_to_market_cap", v2)?, + unrealized_loss_rel_to_market_cap: cfg + .import_percent_bp16("unrealized_loss_rel_to_market_cap", v2)?, + net_unrealized_pnl_rel_to_market_cap, + nupl, + }) + } + + pub(crate) fn compute( + &mut self, + max_from: Height, + unrealized: &UnrealizedComplete, + supply_total_sats: &impl ReadableVec, + market_cap: &impl ReadableVec, + exit: &Exit, + ) -> Result<()> { + self.supply_in_profit_rel_to_own_supply + .compute_binary::( + max_from, + &unrealized.supply_in_profit.sats.height, + supply_total_sats, + exit, + )?; + self.supply_in_loss_rel_to_own_supply + .compute_binary::( + max_from, + &unrealized.supply_in_loss.sats.height, + supply_total_sats, + exit, + )?; + self.unrealized_profit_rel_to_market_cap + .compute_binary::( + max_from, + &unrealized.unrealized_profit.usd.height, + market_cap, + exit, + )?; + self.unrealized_loss_rel_to_market_cap + .compute_binary::( + max_from, + &unrealized.unrealized_loss.usd.height, + market_cap, + exit, + )?; + self.net_unrealized_pnl_rel_to_market_cap + .compute_binary::( + max_from, + &unrealized.net_unrealized_pnl.usd.height, + market_cap, + exit, + )?; + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/relative/mod.rs b/crates/brk_computer/src/distribution/metrics/relative/mod.rs index d12e5181b..302238142 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/mod.rs @@ -1,4 +1,5 @@ mod base; +mod complete; mod extended_own_market_cap; mod extended_own_pnl; mod for_all; @@ -6,8 +7,10 @@ mod for_all; mod to_all; mod with_extended; mod with_rel_to_all; +mod with_rel_to_all_complete; pub use base::*; +pub use complete::*; pub use extended_own_market_cap::*; pub use extended_own_pnl::*; pub use for_all::*; @@ -15,3 +18,4 @@ pub use for_all::*; pub use to_all::*; pub use with_extended::*; pub use with_rel_to_all::*; +pub use with_rel_to_all_complete::*; diff --git a/crates/brk_computer/src/distribution/metrics/relative/to_all.rs b/crates/brk_computer/src/distribution/metrics/relative/to_all.rs index 43ee646bc..0bbce8c45 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/to_all.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/to_all.rs @@ -5,7 +5,7 @@ use vecdb::{Exit, ReadableVec, Rw, StorageMode}; use crate::internal::{PercentFromHeight, RatioSatsBp16}; -use crate::distribution::metrics::{ImportConfig, UnrealizedBase}; +use crate::distribution::metrics::ImportConfig; /// Relative-to-all metrics (not present for the "all" cohort itself). #[derive(Traversable)] @@ -30,7 +30,8 @@ impl RelativeToAll { pub(crate) fn compute( &mut self, max_from: Height, - unrealized: &UnrealizedBase, + supply_in_profit_sats: &impl ReadableVec, + supply_in_loss_sats: &impl ReadableVec, supply_total_sats: &impl ReadableVec, all_supply_sats: &impl ReadableVec, exit: &Exit, @@ -45,14 +46,14 @@ impl RelativeToAll { self.supply_in_profit_rel_to_circulating_supply .compute_binary::( max_from, - &unrealized.supply_in_profit.sats.height, + supply_in_profit_sats, all_supply_sats, exit, )?; self.supply_in_loss_rel_to_circulating_supply .compute_binary::( max_from, - &unrealized.supply_in_loss.sats.height, + supply_in_loss_sats, all_supply_sats, exit, )?; diff --git a/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs b/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs index bd21eaaee..dcdc17942 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs @@ -56,7 +56,8 @@ impl RelativeWithExtended { )?; self.rel_to_all.compute( max_from, - unrealized, + &unrealized.supply_in_profit.sats.height, + &unrealized.supply_in_loss.sats.height, supply_total_sats, all_supply_sats, exit, diff --git a/crates/brk_computer/src/distribution/metrics/relative/with_rel_to_all.rs b/crates/brk_computer/src/distribution/metrics/relative/with_rel_to_all.rs index bec7c65b5..a553908ad 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/with_rel_to_all.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/with_rel_to_all.rs @@ -49,7 +49,8 @@ impl RelativeWithRelToAll { )?; self.rel_to_all.compute( max_from, - unrealized, + &unrealized.supply_in_profit.sats.height, + &unrealized.supply_in_loss.sats.height, supply_total_sats, all_supply_sats, exit, diff --git a/crates/brk_computer/src/distribution/metrics/relative/with_rel_to_all_complete.rs b/crates/brk_computer/src/distribution/metrics/relative/with_rel_to_all_complete.rs new file mode 100644 index 000000000..f0b1e3724 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/relative/with_rel_to_all_complete.rs @@ -0,0 +1,58 @@ +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Dollars, Height, Sats}; +use derive_more::{Deref, DerefMut}; +use vecdb::{Exit, ReadableVec, Rw, StorageMode}; + +use crate::distribution::metrics::{ImportConfig, UnrealizedComplete}; + +use super::{RelativeComplete, RelativeToAll}; + +/// Complete relative metrics with rel_to_all. +/// Used by CompleteCohortMetrics (epoch, class, min_age, max_age). +#[derive(Deref, DerefMut, Traversable)] +pub struct RelativeCompleteWithRelToAll { + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub base: RelativeComplete, + #[traversable(flatten)] + pub rel_to_all: RelativeToAll, +} + +impl RelativeCompleteWithRelToAll { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + Ok(Self { + base: RelativeComplete::forced_import(cfg)?, + rel_to_all: RelativeToAll::forced_import(cfg)?, + }) + } + + #[allow(clippy::too_many_arguments)] + pub(crate) fn compute( + &mut self, + max_from: Height, + unrealized: &UnrealizedComplete, + supply_total_sats: &impl ReadableVec, + market_cap: &impl ReadableVec, + all_supply_sats: &impl ReadableVec, + exit: &Exit, + ) -> Result<()> { + self.base.compute( + max_from, + unrealized, + supply_total_sats, + market_cap, + exit, + )?; + self.rel_to_all.compute( + max_from, + &unrealized.supply_in_profit.sats.height, + &unrealized.supply_in_loss.sats.height, + supply_total_sats, + all_supply_sats, + exit, + )?; + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/base.rs b/crates/brk_computer/src/distribution/metrics/unrealized/base.rs index 326e9d915..1e59df5dd 100644 --- a/crates/brk_computer/src/distribution/metrics/unrealized/base.rs +++ b/crates/brk_computer/src/distribution/metrics/unrealized/base.rs @@ -1,32 +1,32 @@ use brk_error::Result; use brk_traversable::Traversable; use brk_types::{Cents, CentsSats, CentsSigned, CentsSquaredSats, Height, Indexes, Version}; -use vecdb::{ - AnyStoredVec, AnyVec, BytesVec, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode, - WritableVec, -}; +use derive_more::{Deref, DerefMut}; +use vecdb::{AnyStoredVec, AnyVec, BytesVec, Exit, ReadableVec, Rw, StorageMode, WritableVec}; use crate::{ distribution::state::UnrealizedState, - internal::{ - CentsSubtractToCentsSigned, FiatFromHeight, LazyFromHeight, NegCentsUnsignedToDollars, - ValueFromHeight, - }, + internal::{CentsSubtractToCentsSigned, FiatFromHeight}, prices, }; -use brk_types::Dollars; - use crate::distribution::metrics::ImportConfig; -#[derive(Traversable)] +use super::UnrealizedComplete; + +/// Full unrealized metrics (Source/Extended tier). +/// +/// Contains all Complete-tier fields (via Deref to UnrealizedComplete) plus: +/// - Source-only: invested_capital, raw BytesVecs, unrealized_gross_pnl +/// - Extended-only: pain_index, greed_index, net_sentiment +#[derive(Deref, DerefMut, Traversable)] pub struct UnrealizedBase { - pub supply_in_profit: ValueFromHeight, - pub supply_in_loss: ValueFromHeight, - - pub unrealized_profit: FiatFromHeight, - pub unrealized_loss: FiatFromHeight, + #[deref] + #[deref_mut] + #[traversable(flatten)] + pub complete: UnrealizedComplete, + // --- Source-only fields --- pub invested_capital_in_profit: FiatFromHeight, pub invested_capital_in_loss: FiatFromHeight, @@ -35,24 +35,19 @@ pub struct UnrealizedBase { pub investor_cap_in_profit_raw: M::Stored>, pub investor_cap_in_loss_raw: M::Stored>, + pub gross_pnl: FiatFromHeight, + + // --- Extended-only fields --- pub pain_index: FiatFromHeight, pub greed_index: FiatFromHeight, pub net_sentiment: FiatFromHeight, - - pub neg_unrealized_loss: LazyFromHeight, - - pub net_unrealized_pnl: FiatFromHeight, - pub gross_pnl: FiatFromHeight, } impl UnrealizedBase { pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { let v0 = Version::ZERO; - let supply_in_profit = cfg.import_value("supply_in_profit", v0)?; - let supply_in_loss = cfg.import_value("supply_in_loss", v0)?; - let unrealized_profit = cfg.import_fiat("unrealized_profit", v0)?; - let unrealized_loss = cfg.import_fiat("unrealized_loss", v0)?; + let complete = UnrealizedComplete::forced_import(cfg)?; let invested_capital_in_profit = cfg.import_fiat("invested_capital_in_profit", v0)?; let invested_capital_in_loss = cfg.import_fiat("invested_capital_in_loss", v0)?; @@ -67,21 +62,10 @@ impl UnrealizedBase { let greed_index = cfg.import_fiat("greed_index", v0)?; let net_sentiment = cfg.import_fiat("net_sentiment", Version::ONE)?; - let neg_unrealized_loss = LazyFromHeight::from_computed::( - &cfg.name("neg_unrealized_loss"), - cfg.version, - unrealized_loss.cents.height.read_only_boxed_clone(), - &unrealized_loss.cents, - ); - - let net_unrealized_pnl = cfg.import_fiat("net_unrealized_pnl", v0)?; let gross_pnl = cfg.import_fiat("unrealized_gross_pnl", v0)?; Ok(Self { - supply_in_profit, - supply_in_loss, - unrealized_profit, - unrealized_loss, + complete, invested_capital_in_profit, invested_capital_in_loss, invested_capital_in_profit_raw, @@ -91,20 +75,13 @@ impl UnrealizedBase { pain_index, greed_index, net_sentiment, - neg_unrealized_loss, - net_unrealized_pnl, gross_pnl, }) } pub(crate) fn min_stateful_height_len(&self) -> usize { - self.supply_in_profit - .sats - .height - .len() - .min(self.supply_in_loss.sats.height.len()) - .min(self.unrealized_profit.cents.height.len()) - .min(self.unrealized_loss.cents.height.len()) + self.complete + .min_stateful_height_len() .min(self.invested_capital_in_profit.cents.height.len()) .min(self.invested_capital_in_loss.cents.height.len()) .min(self.invested_capital_in_profit_raw.len()) @@ -118,22 +95,8 @@ impl UnrealizedBase { height: Height, height_state: &UnrealizedState, ) -> Result<()> { - self.supply_in_profit - .sats - .height - .truncate_push(height, height_state.supply_in_profit)?; - self.supply_in_loss - .sats - .height - .truncate_push(height, height_state.supply_in_loss)?; - self.unrealized_profit - .cents - .height - .truncate_push(height, height_state.unrealized_profit)?; - self.unrealized_loss - .cents - .height - .truncate_push(height, height_state.unrealized_loss)?; + self.complete.truncate_push(height, height_state)?; + self.invested_capital_in_profit .cents .height @@ -164,20 +127,14 @@ impl UnrealizedBase { } pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { - vec![ - &mut self.supply_in_profit.base.sats.height as &mut dyn AnyStoredVec, - &mut self.supply_in_profit.base.cents.height as &mut dyn AnyStoredVec, - &mut self.supply_in_loss.base.sats.height as &mut dyn AnyStoredVec, - &mut self.supply_in_loss.base.cents.height as &mut dyn AnyStoredVec, - &mut self.unrealized_profit.cents.height, - &mut self.unrealized_loss.cents.height, - &mut self.invested_capital_in_profit.cents.height, - &mut self.invested_capital_in_loss.cents.height, - &mut self.invested_capital_in_profit_raw as &mut dyn AnyStoredVec, - &mut self.invested_capital_in_loss_raw as &mut dyn AnyStoredVec, - &mut self.investor_cap_in_profit_raw as &mut dyn AnyStoredVec, - &mut self.investor_cap_in_loss_raw as &mut dyn AnyStoredVec, - ] + let mut vecs = self.complete.collect_vecs_mut(); + vecs.push(&mut self.invested_capital_in_profit.cents.height as &mut dyn AnyStoredVec); + vecs.push(&mut self.invested_capital_in_loss.cents.height as &mut dyn AnyStoredVec); + vecs.push(&mut self.invested_capital_in_profit_raw as &mut dyn AnyStoredVec); + vecs.push(&mut self.invested_capital_in_loss_raw as &mut dyn AnyStoredVec); + vecs.push(&mut self.investor_cap_in_profit_raw as &mut dyn AnyStoredVec); + vecs.push(&mut self.investor_cap_in_loss_raw as &mut dyn AnyStoredVec); + vecs } pub(crate) fn compute_from_stateful( @@ -186,6 +143,13 @@ impl UnrealizedBase { others: &[&Self], exit: &Exit, ) -> Result<()> { + // Delegate Complete-tier aggregation + let complete_refs: Vec<&UnrealizedComplete> = + others.iter().map(|o| &o.complete).collect(); + self.complete + .compute_from_stateful(starting_indexes, &complete_refs, exit)?; + + // Source-only: invested_capital macro_rules! sum_others { ($($field:tt).+) => { self.$($field).+.compute_sum_of_others( @@ -196,14 +160,10 @@ impl UnrealizedBase { }; } - sum_others!(supply_in_profit.sats.height); - sum_others!(supply_in_loss.sats.height); - sum_others!(unrealized_profit.cents.height); - sum_others!(unrealized_loss.cents.height); sum_others!(invested_capital_in_profit.cents.height); sum_others!(invested_capital_in_loss.cents.height); - // Raw values for aggregation + // Source-only: raw BytesVec aggregation let start = self .invested_capital_in_profit_raw .len() @@ -273,7 +233,10 @@ impl UnrealizedBase { starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { - // Pain index: investor_price_of_losers - spot + // Complete-tier: net_unrealized_pnl + self.complete.compute_rest(starting_indexes, exit)?; + + // Extended-only: Pain index (investor_price_of_losers - spot) self.pain_index.cents.height.compute_transform3( starting_indexes.height, &self.investor_cap_in_loss_raw, @@ -290,7 +253,7 @@ impl UnrealizedBase { exit, )?; - // Greed index: spot - investor_price_of_winners + // Extended-only: Greed index (spot - investor_price_of_winners) self.greed_index.cents.height.compute_transform3( starting_indexes.height, &self.investor_cap_in_profit_raw, @@ -307,19 +270,11 @@ impl UnrealizedBase { exit, )?; - self.net_unrealized_pnl - .cents - .height - .compute_binary::( - starting_indexes.height, - &self.unrealized_profit.cents.height, - &self.unrealized_loss.cents.height, - exit, - )?; + // Source-only: unrealized gross pnl self.gross_pnl.cents.height.compute_add( starting_indexes.height, - &self.unrealized_profit.cents.height, - &self.unrealized_loss.cents.height, + &self.complete.unrealized_profit.cents.height, + &self.complete.unrealized_loss.cents.height, exit, )?; diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/complete.rs b/crates/brk_computer/src/distribution/metrics/unrealized/complete.rs new file mode 100644 index 000000000..c9b27fbf2 --- /dev/null +++ b/crates/brk_computer/src/distribution/metrics/unrealized/complete.rs @@ -0,0 +1,151 @@ +use brk_error::Result; +use brk_traversable::Traversable; +use brk_types::{Cents, CentsSigned, Height, Indexes, Version}; +use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableCloneableVec, Rw, StorageMode, WritableVec}; + +use crate::{ + distribution::state::UnrealizedState, + internal::{ + CentsSubtractToCentsSigned, FiatFromHeight, LazyFromHeight, NegCentsUnsignedToDollars, + ValueFromHeight, + }, +}; + +use brk_types::Dollars; + +use crate::distribution::metrics::ImportConfig; + +/// Unrealized metrics for the Complete tier (~6 fields). +/// +/// Excludes source-only fields (invested_capital, raw BytesVecs, unrealized_gross_pnl) +/// and extended-only fields (pain_index, greed_index, net_sentiment). +#[derive(Traversable)] +pub struct UnrealizedComplete { + pub supply_in_profit: ValueFromHeight, + pub supply_in_loss: ValueFromHeight, + + pub unrealized_profit: FiatFromHeight, + pub unrealized_loss: FiatFromHeight, + + pub neg_unrealized_loss: LazyFromHeight, + + pub net_unrealized_pnl: FiatFromHeight, +} + +impl UnrealizedComplete { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + let v0 = Version::ZERO; + let supply_in_profit = cfg.import_value("supply_in_profit", v0)?; + let supply_in_loss = cfg.import_value("supply_in_loss", v0)?; + + let unrealized_profit = cfg.import_fiat("unrealized_profit", v0)?; + let unrealized_loss = cfg.import_fiat("unrealized_loss", v0)?; + + let neg_unrealized_loss = LazyFromHeight::from_computed::( + &cfg.name("neg_unrealized_loss"), + cfg.version, + unrealized_loss.cents.height.read_only_boxed_clone(), + &unrealized_loss.cents, + ); + + let net_unrealized_pnl = cfg.import_fiat("net_unrealized_pnl", v0)?; + + Ok(Self { + supply_in_profit, + supply_in_loss, + unrealized_profit, + unrealized_loss, + neg_unrealized_loss, + net_unrealized_pnl, + }) + } + + pub(crate) fn min_stateful_height_len(&self) -> usize { + self.supply_in_profit + .sats + .height + .len() + .min(self.supply_in_loss.sats.height.len()) + .min(self.unrealized_profit.cents.height.len()) + .min(self.unrealized_loss.cents.height.len()) + } + + pub(crate) fn truncate_push( + &mut self, + height: Height, + height_state: &UnrealizedState, + ) -> Result<()> { + self.supply_in_profit + .sats + .height + .truncate_push(height, height_state.supply_in_profit)?; + self.supply_in_loss + .sats + .height + .truncate_push(height, height_state.supply_in_loss)?; + self.unrealized_profit + .cents + .height + .truncate_push(height, height_state.unrealized_profit)?; + self.unrealized_loss + .cents + .height + .truncate_push(height, height_state.unrealized_loss)?; + + Ok(()) + } + + pub(crate) fn collect_vecs_mut(&mut self) -> Vec<&mut dyn AnyStoredVec> { + vec![ + &mut self.supply_in_profit.base.sats.height as &mut dyn AnyStoredVec, + &mut self.supply_in_profit.base.cents.height as &mut dyn AnyStoredVec, + &mut self.supply_in_loss.base.sats.height as &mut dyn AnyStoredVec, + &mut self.supply_in_loss.base.cents.height as &mut dyn AnyStoredVec, + &mut self.unrealized_profit.cents.height, + &mut self.unrealized_loss.cents.height, + ] + } + + pub(crate) fn compute_from_stateful( + &mut self, + starting_indexes: &Indexes, + others: &[&Self], + exit: &Exit, + ) -> Result<()> { + macro_rules! sum_others { + ($($field:tt).+) => { + self.$($field).+.compute_sum_of_others( + starting_indexes.height, + &others.iter().map(|v| &v.$($field).+).collect::>(), + exit, + )? + }; + } + + sum_others!(supply_in_profit.sats.height); + sum_others!(supply_in_loss.sats.height); + sum_others!(unrealized_profit.cents.height); + sum_others!(unrealized_loss.cents.height); + + Ok(()) + } + + /// Compute derived metrics from stored values. + pub(crate) fn compute_rest( + &mut self, + starting_indexes: &Indexes, + exit: &Exit, + ) -> Result<()> { + self.net_unrealized_pnl + .cents + .height + .compute_binary::( + starting_indexes.height, + &self.unrealized_profit.cents.height, + &self.unrealized_loss.cents.height, + exit, + )?; + + Ok(()) + } +} diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/mod.rs b/crates/brk_computer/src/distribution/metrics/unrealized/mod.rs index cbcb6ac7e..4fc634b09 100644 --- a/crates/brk_computer/src/distribution/metrics/unrealized/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/unrealized/mod.rs @@ -1,3 +1,5 @@ mod base; +mod complete; pub use base::*; +pub use complete::*; diff --git a/crates/brk_computer/src/scripts/value/compute.rs b/crates/brk_computer/src/scripts/value/compute.rs index bc33485e7..91ad9d6b7 100644 --- a/crates/brk_computer/src/scripts/value/compute.rs +++ b/crates/brk_computer/src/scripts/value/compute.rs @@ -53,6 +53,9 @@ impl Vecs { + 2.min(indexer.vecs.outputs.first_txoutindex.len()), ); + let mut outputtypes_buf: Vec = Vec::new(); + let mut values_buf: Vec = Vec::new(); + // Iterate blocks for h in starting_height.to_usize()..=target_height.to_usize() { let height = Height::from(h); @@ -70,25 +73,24 @@ impl Vecs { let out_start = first_txoutindex.to_usize(); let out_end = next_first_txoutindex.to_usize(); - // Sum opreturn values — fold over both vecs without allocation - let opreturn_value = indexer + // Pre-collect both vecs into reusable buffers + indexer .vecs .outputs .outputtype - .fold_range_at( - out_start, - out_end, - (Sats::ZERO, out_start), - |(sum, vi), ot| { - let new_sum = if ot == OutputType::OpReturn { - sum + indexer.vecs.outputs.value.collect_one_at(vi).unwrap() - } else { - sum - }; - (new_sum, vi + 1) - }, - ) - .0; + .collect_range_into_at(out_start, out_end, &mut outputtypes_buf); + indexer + .vecs + .outputs + .value + .collect_range_into_at(out_start, out_end, &mut values_buf); + + let mut opreturn_value = Sats::ZERO; + for (ot, val) in outputtypes_buf.iter().zip(values_buf.iter()) { + if *ot == OutputType::OpReturn { + opreturn_value += *val; + } + } height_vec.truncate_push(height, opreturn_value)?; } diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index 3924e3c4d..90da302ba 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -1572,7 +1572,7 @@ function createMetricPattern35(client, name) { return /** @type {MetricPattern35 /** * @typedef {Object} AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern * @property {_1m1w1y24hPattern} adjustedSopr - * @property {_1m1wPattern2} adjustedSoprEma + * @property {_1m1wPattern} adjustedSoprEma * @property {MetricPattern1} adjustedValueCreated * @property {_1m1w1y24hPattern} adjustedValueCreatedSum * @property {MetricPattern1} adjustedValueDestroyed @@ -1620,13 +1620,13 @@ function createMetricPattern35(client, name) { return /** @type {MetricPattern35 * @property {_1m1w1y24hPattern} realizedProfitSum * @property {_1m1w1y24hPattern} realizedProfitToLossRatio * @property {_1m1w1y24hPattern2} sellSideRiskRatio - * @property {_1m1wPattern} sellSideRiskRatio24hEma + * @property {_1m1wPattern2} sellSideRiskRatio24hEma * @property {BaseCumulativePattern} sentInLoss * @property {_2wPattern} sentInLossEma * @property {BaseCumulativePattern} sentInProfit * @property {_2wPattern} sentInProfitEma * @property {_1m1w1y24hPattern} sopr - * @property {_1m1wPattern2} sopr24hEma + * @property {_1m1wPattern} sopr24hEma * @property {CentsSatsUsdPattern} upperPriceBand * @property {MetricPattern1} valueCreated * @property {_1m1w1y24hPattern} valueCreatedSum @@ -1643,7 +1643,7 @@ function createMetricPattern35(client, name) { return /** @type {MetricPattern35 function createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc) { return { adjustedSopr: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_sopr')), - adjustedSoprEma: create_1m1wPattern2(client, _m(acc, 'adjusted_sopr_24h_ema')), + adjustedSoprEma: create_1m1wPattern(client, _m(acc, 'adjusted_sopr_24h_ema')), adjustedValueCreated: createMetricPattern1(client, _m(acc, 'adjusted_value_created')), adjustedValueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_value_created')), adjustedValueDestroyed: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed')), @@ -1691,259 +1691,13 @@ function createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfit realizedProfitSum: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit')), realizedProfitToLossRatio: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')), sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio24hEma: create_1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), + sellSideRiskRatio24hEma: create_1m1wPattern2(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), sentInLoss: createBaseCumulativePattern(client, _m(acc, 'sent_in_loss')), sentInLossEma: create_2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')), sentInProfit: createBaseCumulativePattern(client, _m(acc, 'sent_in_profit')), sentInProfitEma: create_2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')), sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), - sopr24hEma: create_1m1wPattern2(client, _m(acc, 'sopr_24h_ema')), - upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')), - valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_created')), - valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), - valueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_destroyed')), - }; -} - -/** - * @typedef {Object} CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 - * @property {MetricPattern18} capRaw - * @property {MetricPattern1} capitulationFlow - * @property {CentsUsdPattern} grossPnl - * @property {_1m1w1y24hPattern} grossPnlSum - * @property {MetricPattern18} investorCapRaw - * @property {CentsSatsUsdPattern} investorPrice - * @property {BpsRatioPattern} investorPriceRatio - * @property {RatioPattern} investorPriceRatioPercentiles - * @property {RatioPattern2} investorPriceRatioStdDev - * @property {MetricPattern1} lossValueCreated - * @property {MetricPattern1} lossValueDestroyed - * @property {CentsSatsUsdPattern} lowerPriceBand - * @property {MetricPattern1} mvrv - * @property {MetricPattern1} negRealizedLoss - * @property {MetricPattern1} netPnlChange1m - * @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap - * @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap - * @property {CumulativeHeightPattern} netRealizedPnl - * @property {MetricPattern1} netRealizedPnlEma1w - * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap - * @property {CumulativeHeightPattern} peakRegret - * @property {BpsPercentRatioPattern} peakRegretRelToRealizedCap - * @property {MetricPattern1} profitFlow - * @property {MetricPattern1} profitValueCreated - * @property {MetricPattern1} profitValueDestroyed - * @property {MetricPattern1} realizedCap - * @property {MetricPattern1} realizedCapCents - * @property {MetricPattern1} realizedCapChange1m - * @property {BpsPercentRatioPattern} realizedCapRelToOwnMarketCap - * @property {CumulativeHeightPattern} realizedLoss - * @property {MetricPattern1} realizedLossEma1w - * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap - * @property {_1m1w1y24hPattern} realizedLossSum - * @property {CentsSatsUsdPattern} realizedPrice - * @property {BpsRatioPattern} realizedPriceRatio - * @property {RatioPattern} realizedPriceRatioPercentiles - * @property {RatioPattern2} realizedPriceRatioStdDev - * @property {CumulativeHeightPattern} realizedProfit - * @property {MetricPattern1} realizedProfitEma1w - * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap - * @property {_1m1w1y24hPattern} realizedProfitSum - * @property {_1m1w1y24hPattern} realizedProfitToLossRatio - * @property {_1m1w1y24hPattern2} sellSideRiskRatio - * @property {_1m1wPattern} sellSideRiskRatio24hEma - * @property {BaseCumulativePattern} sentInLoss - * @property {_2wPattern} sentInLossEma - * @property {BaseCumulativePattern} sentInProfit - * @property {_2wPattern} sentInProfitEma - * @property {_1m1w1y24hPattern} sopr - * @property {_1m1wPattern2} sopr24hEma - * @property {CentsSatsUsdPattern} upperPriceBand - * @property {MetricPattern1} valueCreated - * @property {_1m1w1y24hPattern} valueCreatedSum - * @property {MetricPattern1} valueDestroyed - * @property {_1m1w1y24hPattern} valueDestroyedSum - */ - -/** - * Create a CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2} - */ -function createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc) { - return { - capRaw: createMetricPattern18(client, _m(acc, 'cap_raw')), - capitulationFlow: createMetricPattern1(client, _m(acc, 'capitulation_flow')), - grossPnl: createCentsUsdPattern(client, _m(acc, 'realized_gross_pnl')), - grossPnlSum: create_1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')), - investorCapRaw: createMetricPattern18(client, _m(acc, 'investor_cap_raw')), - investorPrice: createCentsSatsUsdPattern(client, _m(acc, 'investor_price')), - investorPriceRatio: createBpsRatioPattern(client, _m(acc, 'investor_price_ratio')), - investorPriceRatioPercentiles: createRatioPattern(client, _m(acc, 'investor_price_ratio')), - investorPriceRatioStdDev: createRatioPattern2(client, _m(acc, 'investor_price_ratio')), - lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), - lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), - lowerPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'lower_price_band')), - mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), - negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), - netPnlChange1m: createMetricPattern1(client, _m(acc, 'net_pnl_change_1m')), - netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')), - netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')), - netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlEma1w: createMetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')), - netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), - peakRegretRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')), - profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), - profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), - profitValueDestroyed: createMetricPattern1(client, _m(acc, 'profit_value_destroyed')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), - realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), - realizedCapRelToOwnMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), - realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), - realizedLossEma1w: createMetricPattern1(client, _m(acc, 'realized_loss_ema_1w')), - realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedLossSum: create_1m1w1y24hPattern(client, _m(acc, 'realized_loss')), - realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), - realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), - realizedPriceRatioPercentiles: createRatioPattern(client, _m(acc, 'realized_price_ratio')), - realizedPriceRatioStdDev: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), - realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), - realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')), - realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), - realizedProfitSum: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit')), - realizedProfitToLossRatio: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')), - sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio24hEma: create_1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), - sentInLoss: createBaseCumulativePattern(client, _m(acc, 'sent_in_loss')), - sentInLossEma: create_2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')), - sentInProfit: createBaseCumulativePattern(client, _m(acc, 'sent_in_profit')), - sentInProfitEma: create_2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')), - sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), - sopr24hEma: create_1m1wPattern2(client, _m(acc, 'sopr_24h_ema')), - upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')), - valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_created')), - valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), - valueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_destroyed')), - }; -} - -/** - * @typedef {Object} AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 - * @property {_1m1w1y24hPattern} adjustedSopr - * @property {_1m1wPattern2} adjustedSoprEma - * @property {MetricPattern1} adjustedValueCreated - * @property {_1m1w1y24hPattern} adjustedValueCreatedSum - * @property {MetricPattern1} adjustedValueDestroyed - * @property {_1m1w1y24hPattern} adjustedValueDestroyedSum - * @property {MetricPattern18} capRaw - * @property {MetricPattern1} capitulationFlow - * @property {CentsUsdPattern} grossPnl - * @property {_1m1w1y24hPattern} grossPnlSum - * @property {MetricPattern18} investorCapRaw - * @property {CentsSatsUsdPattern} investorPrice - * @property {BpsRatioPattern} investorPriceRatio - * @property {MetricPattern1} lossValueCreated - * @property {MetricPattern1} lossValueDestroyed - * @property {CentsSatsUsdPattern} lowerPriceBand - * @property {MetricPattern1} mvrv - * @property {MetricPattern1} negRealizedLoss - * @property {MetricPattern1} netPnlChange1m - * @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap - * @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap - * @property {CumulativeHeightPattern} netRealizedPnl - * @property {MetricPattern1} netRealizedPnlEma1w - * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap - * @property {CumulativeHeightPattern} peakRegret - * @property {BpsPercentRatioPattern} peakRegretRelToRealizedCap - * @property {MetricPattern1} profitFlow - * @property {MetricPattern1} profitValueCreated - * @property {MetricPattern1} profitValueDestroyed - * @property {MetricPattern1} realizedCap - * @property {MetricPattern1} realizedCapCents - * @property {MetricPattern1} realizedCapChange1m - * @property {CumulativeHeightPattern} realizedLoss - * @property {MetricPattern1} realizedLossEma1w - * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap - * @property {CentsSatsUsdPattern} realizedPrice - * @property {BpsRatioPattern} realizedPriceRatio - * @property {CumulativeHeightPattern} realizedProfit - * @property {MetricPattern1} realizedProfitEma1w - * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap - * @property {_1m1w1y24hPattern2} sellSideRiskRatio - * @property {_1m1wPattern} sellSideRiskRatio24hEma - * @property {BaseCumulativePattern} sentInLoss - * @property {_2wPattern} sentInLossEma - * @property {BaseCumulativePattern} sentInProfit - * @property {_2wPattern} sentInProfitEma - * @property {_1m1w1y24hPattern} sopr - * @property {_1m1wPattern2} sopr24hEma - * @property {CentsSatsUsdPattern} upperPriceBand - * @property {MetricPattern1} valueCreated - * @property {_1m1w1y24hPattern} valueCreatedSum - * @property {MetricPattern1} valueDestroyed - * @property {_1m1w1y24hPattern} valueDestroyedSum - */ - -/** - * Create a AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2} - */ -function createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc) { - return { - adjustedSopr: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_sopr')), - adjustedSoprEma: create_1m1wPattern2(client, _m(acc, 'adjusted_sopr_24h_ema')), - adjustedValueCreated: createMetricPattern1(client, _m(acc, 'adjusted_value_created')), - adjustedValueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_value_created')), - adjustedValueDestroyed: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed')), - adjustedValueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_value_destroyed')), - capRaw: createMetricPattern18(client, _m(acc, 'cap_raw')), - capitulationFlow: createMetricPattern1(client, _m(acc, 'capitulation_flow')), - grossPnl: createCentsUsdPattern(client, _m(acc, 'realized_gross_pnl')), - grossPnlSum: create_1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')), - investorCapRaw: createMetricPattern18(client, _m(acc, 'investor_cap_raw')), - investorPrice: createCentsSatsUsdPattern(client, _m(acc, 'investor_price')), - investorPriceRatio: createBpsRatioPattern(client, _m(acc, 'investor_price_ratio')), - lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), - lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), - lowerPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'lower_price_band')), - mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), - negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), - netPnlChange1m: createMetricPattern1(client, _m(acc, 'net_pnl_change_1m')), - netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')), - netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')), - netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), - netRealizedPnlEma1w: createMetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')), - netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), - peakRegretRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')), - profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), - profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), - profitValueDestroyed: createMetricPattern1(client, _m(acc, 'profit_value_destroyed')), - realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), - realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), - realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), - realizedLossEma1w: createMetricPattern1(client, _m(acc, 'realized_loss_ema_1w')), - realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), - realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), - realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), - realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), - realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')), - realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), - sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio24hEma: create_1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), - sentInLoss: createBaseCumulativePattern(client, _m(acc, 'sent_in_loss')), - sentInLossEma: create_2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')), - sentInProfit: createBaseCumulativePattern(client, _m(acc, 'sent_in_profit')), - sentInProfitEma: create_2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')), - sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), - sopr24hEma: create_1m1wPattern2(client, _m(acc, 'sopr_24h_ema')), + sopr24hEma: create_1m1wPattern(client, _m(acc, 'sopr_24h_ema')), upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), valueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_created')), @@ -1989,13 +1743,13 @@ function createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfit * @property {MetricPattern1} realizedProfitEma1w * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap * @property {_1m1w1y24hPattern2} sellSideRiskRatio - * @property {_1m1wPattern} sellSideRiskRatio24hEma + * @property {_1m1wPattern2} sellSideRiskRatio24hEma * @property {BaseCumulativePattern} sentInLoss * @property {_2wPattern} sentInLossEma * @property {BaseCumulativePattern} sentInProfit * @property {_2wPattern} sentInProfitEma * @property {_1m1w1y24hPattern} sopr - * @property {_1m1wPattern2} sopr24hEma + * @property {_1m1wPattern} sopr24hEma * @property {CentsSatsUsdPattern} upperPriceBand * @property {MetricPattern1} valueCreated * @property {_1m1w1y24hPattern} valueCreatedSum @@ -2046,13 +1800,13 @@ function createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealized realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')), realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio24hEma: create_1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), + sellSideRiskRatio24hEma: create_1m1wPattern2(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), sentInLoss: createBaseCumulativePattern(client, _m(acc, 'sent_in_loss')), sentInLossEma: create_2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')), sentInProfit: createBaseCumulativePattern(client, _m(acc, 'sent_in_profit')), sentInProfitEma: create_2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')), sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), - sopr24hEma: create_1m1wPattern2(client, _m(acc, 'sopr_24h_ema')), + sopr24hEma: create_1m1wPattern(client, _m(acc, 'sopr_24h_ema')), upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), valueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_created')), @@ -2061,6 +1815,95 @@ function createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealized }; } +/** + * @typedef {Object} CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern + * @property {MetricPattern1} capitulationFlow + * @property {CentsUsdPattern} grossPnl + * @property {_1m1w1y24hPattern} grossPnlSum + * @property {MetricPattern1} lossValueCreated + * @property {MetricPattern1} lossValueDestroyed + * @property {MetricPattern1} mvrv + * @property {MetricPattern1} negRealizedLoss + * @property {MetricPattern1} netPnlChange1m + * @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap + * @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap + * @property {CumulativeHeightPattern} netRealizedPnl + * @property {MetricPattern1} netRealizedPnlEma1w + * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap + * @property {MetricPattern1} profitFlow + * @property {MetricPattern1} profitValueCreated + * @property {MetricPattern1} profitValueDestroyed + * @property {MetricPattern1} realizedCap + * @property {MetricPattern1} realizedCapCents + * @property {MetricPattern1} realizedCapChange1m + * @property {CumulativeHeightPattern} realizedLoss + * @property {MetricPattern1} realizedLossEma1w + * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap + * @property {CentsSatsUsdPattern} realizedPrice + * @property {BpsRatioPattern} realizedPriceRatio + * @property {CumulativeHeightPattern} realizedProfit + * @property {MetricPattern1} realizedProfitEma1w + * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap + * @property {BaseCumulativePattern} sentInLoss + * @property {_2wPattern} sentInLossEma + * @property {BaseCumulativePattern} sentInProfit + * @property {_2wPattern} sentInProfitEma + * @property {_1m1w1y24hPattern} sopr + * @property {_1m1wPattern} sopr24hEma + * @property {MetricPattern1} valueCreated + * @property {_1m1w1y24hPattern} valueCreatedSum + * @property {MetricPattern1} valueDestroyed + * @property {_1m1w1y24hPattern} valueDestroyedSum + */ + +/** + * Create a CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern} + */ +function createCapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern(client, acc) { + return { + capitulationFlow: createMetricPattern1(client, _m(acc, 'capitulation_flow')), + grossPnl: createCentsUsdPattern(client, _m(acc, 'realized_gross_pnl')), + grossPnlSum: create_1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')), + lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), + lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), + mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), + negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netPnlChange1m: createMetricPattern1(client, _m(acc, 'net_pnl_change_1m')), + netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')), + netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')), + netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), + netRealizedPnlEma1w: createMetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')), + netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), + profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), + profitValueDestroyed: createMetricPattern1(client, _m(acc, 'profit_value_destroyed')), + realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), + realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), + realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), + realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), + realizedLossEma1w: createMetricPattern1(client, _m(acc, 'realized_loss_ema_1w')), + realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), + realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), + realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), + realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')), + realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + sentInLoss: createBaseCumulativePattern(client, _m(acc, 'sent_in_loss')), + sentInLossEma: create_2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')), + sentInProfit: createBaseCumulativePattern(client, _m(acc, 'sent_in_profit')), + sentInProfitEma: create_2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')), + sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), + sopr24hEma: create_1m1wPattern(client, _m(acc, 'sopr_24h_ema')), + valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), + valueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_created')), + valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), + valueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_destroyed')), + }; +} + /** * @typedef {Object} _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern * @property {CentsSatsUsdPattern} _0sdPrice @@ -2133,7 +1976,7 @@ function create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client } /** - * @typedef {Object} InvestedNegNetNuplSupplyUnrealizedPattern2 + * @typedef {Object} InvestedNegNetNuplSupplyUnrealizedPattern3 * @property {BpsPercentRatioPattern} investedCapitalInLossRelToRealizedCap * @property {BpsPercentRatioPattern} investedCapitalInProfitRelToRealizedCap * @property {BpsPercentRatioPattern} negUnrealizedLossRelToMarketCap @@ -2157,12 +2000,12 @@ function create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client */ /** - * Create a InvestedNegNetNuplSupplyUnrealizedPattern2 pattern node + * Create a InvestedNegNetNuplSupplyUnrealizedPattern3 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {InvestedNegNetNuplSupplyUnrealizedPattern2} + * @returns {InvestedNegNetNuplSupplyUnrealizedPattern3} */ -function createInvestedNegNetNuplSupplyUnrealizedPattern2(client, acc) { +function createInvestedNegNetNuplSupplyUnrealizedPattern3(client, acc) { return { investedCapitalInLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_loss_rel_to_realized_cap')), investedCapitalInProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_profit_rel_to_realized_cap')), @@ -2187,6 +2030,59 @@ function createInvestedNegNetNuplSupplyUnrealizedPattern2(client, acc) { }; } +/** + * @typedef {Object} GrossMvrvNegNetRealizedSoprPattern + * @property {CentsUsdPattern} grossPnl + * @property {MetricPattern1} mvrv + * @property {MetricPattern1} negRealizedLoss + * @property {CumulativeHeightPattern} netRealizedPnl + * @property {MetricPattern1} netRealizedPnlEma1w + * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap + * @property {MetricPattern1} realizedCap + * @property {MetricPattern1} realizedCapCents + * @property {MetricPattern1} realizedCapChange1m + * @property {CumulativeHeightPattern} realizedLoss + * @property {MetricPattern1} realizedLossEma1w + * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap + * @property {CentsSatsUsdPattern} realizedPrice + * @property {BpsRatioPattern} realizedPriceRatio + * @property {CumulativeHeightPattern} realizedProfit + * @property {MetricPattern1} realizedProfitEma1w + * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap + * @property {_1m1w1y24hPattern} sopr + * @property {_1m1wPattern} sopr24hEma + */ + +/** + * Create a GrossMvrvNegNetRealizedSoprPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {GrossMvrvNegNetRealizedSoprPattern} + */ +function createGrossMvrvNegNetRealizedSoprPattern(client, acc) { + return { + grossPnl: createCentsUsdPattern(client, _m(acc, 'realized_gross_pnl')), + mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), + negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), + netRealizedPnlEma1w: createMetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')), + netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), + realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), + realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), + realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), + realizedLossEma1w: createMetricPattern1(client, _m(acc, 'realized_loss_ema_1w')), + realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), + realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), + realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), + realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')), + realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), + sopr24hEma: create_1m1wPattern(client, _m(acc, 'sopr_24h_ema')), + }; +} + /** * @typedef {Object} Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern * @property {CentsSatsUsdPattern} pct05 @@ -2603,39 +2499,6 @@ function createAverageGainsLossesRsiStochPattern(client, acc) { }; } -/** - * @typedef {Object} ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern - * @property {CoinblocksCoindaysSentPattern} activity - * @property {MetricPattern1} addrCount - * @property {MetricPattern1} addrCountChange1m - * @property {MaxMinPattern} costBasis - * @property {UtxoPattern} outputs - * @property {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} realized - * @property {InvestedNegNetNuplSupplyUnrealizedPattern} relative - * @property {ChangeHalvedTotalPattern} supply - * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized - */ - -/** - * Create a ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} - */ -function createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, acc) { - return { - activity: createCoinblocksCoindaysSentPattern(client, acc), - addrCount: createMetricPattern1(client, _m(acc, 'addr_count')), - addrCountChange1m: createMetricPattern1(client, _m(acc, 'addr_count_change_1m')), - costBasis: createMaxMinPattern(client, _m(acc, 'cost_basis')), - outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc), - supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), - unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc), - }; -} - /** * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern * @property {ChangeCountPattern} all @@ -2735,6 +2598,39 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) { }; } +/** + * @typedef {Object} NetNuplSupplyUnrealizedPattern + * @property {BpsPercentRatioPattern} netUnrealizedPnlRelToMarketCap + * @property {MetricPattern1} nupl + * @property {BpsPercentRatioPattern} supplyInLossRelToCirculatingSupply + * @property {BpsPercentRatioPattern} supplyInLossRelToOwnSupply + * @property {BpsPercentRatioPattern} supplyInProfitRelToCirculatingSupply + * @property {BpsPercentRatioPattern} supplyInProfitRelToOwnSupply + * @property {BpsPercentRatioPattern} supplyRelToCirculatingSupply + * @property {BpsPercentRatioPattern} unrealizedLossRelToMarketCap + * @property {BpsPercentRatioPattern} unrealizedProfitRelToMarketCap + */ + +/** + * Create a NetNuplSupplyUnrealizedPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {NetNuplSupplyUnrealizedPattern} + */ +function createNetNuplSupplyUnrealizedPattern(client, acc) { + return { + netUnrealizedPnlRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), + nupl: createMetricPattern1(client, _m(acc, 'nupl')), + supplyInLossRelToCirculatingSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), + supplyInLossRelToOwnSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), + supplyInProfitRelToCirculatingSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), + supplyInProfitRelToOwnSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), + supplyRelToCirculatingSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_rel_to_circulating_supply')), + unrealizedLossRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), + unrealizedProfitRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), + }; +} + /** * @template T * @typedef {Object} AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern @@ -2801,6 +2697,37 @@ function create_1m1w1y24hBtcCentsSatsUsdPattern(client, acc) { }; } +/** + * @typedef {Object} ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern + * @property {SentPattern} activity + * @property {MetricPattern1} addrCount + * @property {MetricPattern1} addrCountChange1m + * @property {UtxoPattern} outputs + * @property {GrossMvrvNegNetRealizedSoprPattern} realized + * @property {NetNuplSupplyUnrealizedPattern} relative + * @property {ChangeHalvedTotalPattern} supply + * @property {NegNetSupplyUnrealizedPattern} unrealized + */ + +/** + * Create a ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} + */ +function createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, acc) { + return { + activity: createSentPattern(client, _m(acc, 'sent')), + addrCount: createMetricPattern1(client, _m(acc, 'addr_count')), + addrCountChange1m: createMetricPattern1(client, _m(acc, 'addr_count_change_1m')), + outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), + realized: createGrossMvrvNegNetRealizedSoprPattern(client, acc), + relative: createNetNuplSupplyUnrealizedPattern(client, acc), + supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), + unrealized: createNegNetSupplyUnrealizedPattern(client, acc), + }; +} + /** * @template T * @typedef {Object} AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern @@ -2866,10 +2793,10 @@ function create_10y2y3y4y5y6y8yPattern(client, acc) { /** * @typedef {Object} ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern * @property {CoinblocksCoindaysSentPattern} activity - * @property {InvestedMaxMinPercentilesPattern} costBasis + * @property {MaxMinPattern} costBasis * @property {UtxoPattern} outputs - * @property {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2} realized - * @property {InvestedNegNetNuplSupplyUnrealizedPattern2} relative + * @property {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} realized + * @property {InvestedNegNetNuplSupplyUnrealizedPattern} relative * @property {ChangeHalvedTotalPattern} supply * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized */ @@ -2883,10 +2810,10 @@ function create_10y2y3y4y5y6y8yPattern(client, acc) { function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, acc) { return { activity: createCoinblocksCoindaysSentPattern(client, acc), - costBasis: createInvestedMaxMinPercentilesPattern(client, acc), + costBasis: createMaxMinPattern(client, _m(acc, 'cost_basis')), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern2(client, acc), + realized: createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc), + relative: createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc), supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc), }; @@ -2897,10 +2824,10 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(client * @property {CoinblocksCoindaysSentPattern} activity * @property {MaxMinPattern} costBasis * @property {UtxoPattern} outputs - * @property {AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2} realized - * @property {InvestedNegNetNuplSupplyUnrealizedPattern} relative + * @property {CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern} realized + * @property {NetNuplSupplyUnrealizedPattern} relative * @property {ChangeHalvedTotalPattern} supply - * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized + * @property {NegNetSupplyUnrealizedPattern} unrealized */ /** @@ -2914,39 +2841,10 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(clien activity: createCoinblocksCoindaysSentPattern(client, acc), costBasis: createMaxMinPattern(client, _m(acc, 'cost_basis')), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc), + realized: createCapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern(client, acc), + relative: createNetNuplSupplyUnrealizedPattern(client, acc), supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), - unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc), - }; -} - -/** - * @typedef {Object} ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 - * @property {CoinblocksCoindaysSentPattern} activity - * @property {MaxMinPattern} costBasis - * @property {UtxoPattern} outputs - * @property {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} realized - * @property {InvestedNegNetNuplSupplyUnrealizedPattern} relative - * @property {ChangeHalvedTotalPattern} supply - * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized - */ - -/** - * Create a ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} - */ -function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, acc) { - return { - activity: createCoinblocksCoindaysSentPattern(client, acc), - costBasis: createMaxMinPattern(client, _m(acc, 'cost_basis')), - outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc), - supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), - unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc), + unrealized: createNegNetSupplyUnrealizedPattern(client, acc), }; } @@ -2977,6 +2875,33 @@ function create_1m1w1y24hBaseCumulativePattern(client, acc) { }; } +/** + * @typedef {Object} ActivityOutputsRealizedRelativeSupplyUnrealizedPattern + * @property {SentPattern} activity + * @property {UtxoPattern} outputs + * @property {GrossMvrvNegNetRealizedSoprPattern} realized + * @property {NetNuplSupplyUnrealizedPattern} relative + * @property {ChangeHalvedTotalPattern} supply + * @property {NegNetSupplyUnrealizedPattern} unrealized + */ + +/** + * Create a ActivityOutputsRealizedRelativeSupplyUnrealizedPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} + */ +function createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, acc) { + return { + activity: createSentPattern(client, _m(acc, 'sent')), + outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), + realized: createGrossMvrvNegNetRealizedSoprPattern(client, acc), + relative: createNetNuplSupplyUnrealizedPattern(client, acc), + supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), + unrealized: createNegNetSupplyUnrealizedPattern(client, acc), + }; +} + /** * @typedef {Object} BalanceBothReactivatedReceivingSendingPattern * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} balanceDecreased @@ -3004,6 +2929,33 @@ function createBalanceBothReactivatedReceivingSendingPattern(client, acc) { }; } +/** + * @typedef {Object} NegNetSupplyUnrealizedPattern + * @property {MetricPattern1} negUnrealizedLoss + * @property {CentsUsdPattern} netUnrealizedPnl + * @property {BtcCentsSatsUsdPattern} supplyInLoss + * @property {BtcCentsSatsUsdPattern} supplyInProfit + * @property {CentsUsdPattern} unrealizedLoss + * @property {CentsUsdPattern} unrealizedProfit + */ + +/** + * Create a NegNetSupplyUnrealizedPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {NegNetSupplyUnrealizedPattern} + */ +function createNegNetSupplyUnrealizedPattern(client, acc) { + return { + negUnrealizedLoss: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss')), + netUnrealizedPnl: createCentsUsdPattern(client, _m(acc, 'net_unrealized_pnl')), + supplyInLoss: createBtcCentsSatsUsdPattern(client, _m(acc, 'supply_in_loss')), + supplyInProfit: createBtcCentsSatsUsdPattern(client, _m(acc, 'supply_in_profit')), + unrealizedLoss: createCentsUsdPattern(client, _m(acc, 'unrealized_loss')), + unrealizedProfit: createCentsUsdPattern(client, _m(acc, 'unrealized_profit')), + }; +} + /** * @typedef {Object} EmaHistogramLineSignalPattern * @property {MetricPattern1} emaFast @@ -3029,6 +2981,56 @@ function createEmaHistogramLineSignalPattern(client, acc) { }; } +/** + * @typedef {Object} MvrvRealizedPattern + * @property {MetricPattern1} mvrv + * @property {MetricPattern1} realizedCap + * @property {MetricPattern1} realizedCapCents + * @property {CentsSatsUsdPattern} realizedPrice + * @property {BpsRatioPattern} realizedPriceRatio + */ + +/** + * Create a MvrvRealizedPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {MvrvRealizedPattern} + */ +function createMvrvRealizedPattern(client, acc) { + return { + mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), + realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), + realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), + realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), + realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), + }; +} + +/** + * @typedef {Object} OutputsRealizedRelativeSupplyUnrealizedPattern + * @property {UtxoPattern} outputs + * @property {MvrvRealizedPattern} realized + * @property {SupplyPattern} relative + * @property {ChangeHalvedTotalPattern} supply + * @property {SupplyPattern2} unrealized + */ + +/** + * Create a OutputsRealizedRelativeSupplyUnrealizedPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {OutputsRealizedRelativeSupplyUnrealizedPattern} + */ +function createOutputsRealizedRelativeSupplyUnrealizedPattern(client, acc) { + return { + outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), + realized: createMvrvRealizedPattern(client, acc), + relative: createSupplyPattern(client, _m(acc, 'supply_in')), + supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), + unrealized: createSupplyPattern2(client, _m(acc, 'supply_in')), + }; +} + /** * @typedef {Object} _1m1w1y24hPattern2 * @property {BpsPercentRatioPattern} _1m @@ -3409,30 +3411,11 @@ function createCumulativeHeightSumPattern(client, acc) { } /** - * @typedef {Object} _1m1wPattern + * @typedef {Object} _1m1wPattern2 * @property {BpsPercentRatioPattern} _1m * @property {BpsPercentRatioPattern} _1w */ -/** - * Create a _1m1wPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_1m1wPattern} - */ -function create_1m1wPattern(client, acc) { - return { - _1m: createBpsPercentRatioPattern(client, _m(acc, '1m')), - _1w: createBpsPercentRatioPattern(client, _m(acc, '1w')), - }; -} - -/** - * @typedef {Object} _1m1wPattern2 - * @property {MetricPattern1} _1m - * @property {MetricPattern1} _1w - */ - /** * Create a _1m1wPattern2 pattern node * @param {BrkClientBase} client @@ -3440,6 +3423,25 @@ function create_1m1wPattern(client, acc) { * @returns {_1m1wPattern2} */ function create_1m1wPattern2(client, acc) { + return { + _1m: createBpsPercentRatioPattern(client, _m(acc, '1m')), + _1w: createBpsPercentRatioPattern(client, _m(acc, '1w')), + }; +} + +/** + * @typedef {Object} _1m1wPattern + * @property {MetricPattern1} _1m + * @property {MetricPattern1} _1w + */ + +/** + * Create a _1m1wPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_1m1wPattern} + */ +function create_1m1wPattern(client, acc) { return { _1m: createMetricPattern1(client, _m(acc, '1m')), _1w: createMetricPattern1(client, _m(acc, '1w')), @@ -3560,6 +3562,63 @@ function createSdSmaPattern(client, acc) { }; } +/** + * @typedef {Object} SentPattern + * @property {BaseCumulativePattern} sent + * @property {_2wPattern} sentEma + */ + +/** + * Create a SentPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {SentPattern} + */ +function createSentPattern(client, acc) { + return { + sent: createBaseCumulativePattern(client, acc), + sentEma: create_2wPattern(client, _m(acc, 'ema_2w')), + }; +} + +/** + * @typedef {Object} SupplyPattern2 + * @property {BtcCentsSatsUsdPattern} supplyInLoss + * @property {BtcCentsSatsUsdPattern} supplyInProfit + */ + +/** + * Create a SupplyPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {SupplyPattern2} + */ +function createSupplyPattern2(client, acc) { + return { + supplyInLoss: createBtcCentsSatsUsdPattern(client, _m(acc, 'loss')), + supplyInProfit: createBtcCentsSatsUsdPattern(client, _m(acc, 'profit')), + }; +} + +/** + * @typedef {Object} SupplyPattern + * @property {BpsPercentRatioPattern} supplyInLossRelToOwnSupply + * @property {BpsPercentRatioPattern} supplyInProfitRelToOwnSupply + */ + +/** + * Create a SupplyPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {SupplyPattern} + */ +function createSupplyPattern(client, acc) { + return { + supplyInLossRelToOwnSupply: createBpsPercentRatioPattern(client, _m(acc, 'loss_rel_to_own_supply')), + supplyInProfitRelToOwnSupply: createBpsPercentRatioPattern(client, _m(acc, 'profit_rel_to_own_supply')), + }; +} + /** * @typedef {Object} UtxoPattern * @property {MetricPattern1} utxoCount @@ -4849,7 +4908,7 @@ function create_2wPattern(client, acc) { * @typedef {Object} MetricsTree_Distribution_UtxoCohorts * @property {MetricsTree_Distribution_UtxoCohorts_All} all * @property {MetricsTree_Distribution_UtxoCohorts_Sth} sth - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern} lth + * @property {MetricsTree_Distribution_UtxoCohorts_Lth} lth * @property {MetricsTree_Distribution_UtxoCohorts_AgeRange} ageRange * @property {MetricsTree_Distribution_UtxoCohorts_MaxAge} maxAge * @property {MetricsTree_Distribution_UtxoCohorts_MinAge} minAge @@ -4874,15 +4933,15 @@ function create_2wPattern(client, acc) { /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_All_Relative + * @property {BpsPercentRatioPattern} negUnrealizedLossRelToMarketCap + * @property {BpsPercentRatioPattern} investedCapitalInProfitRelToRealizedCap + * @property {BpsPercentRatioPattern} investedCapitalInLossRelToRealizedCap * @property {BpsPercentRatioPattern} supplyInProfitRelToOwnSupply * @property {BpsPercentRatioPattern} supplyInLossRelToOwnSupply * @property {BpsPercentRatioPattern} unrealizedProfitRelToMarketCap * @property {BpsPercentRatioPattern} unrealizedLossRelToMarketCap - * @property {BpsPercentRatioPattern} negUnrealizedLossRelToMarketCap * @property {BpsPercentRatioPattern} netUnrealizedPnlRelToMarketCap * @property {MetricPattern1} nupl - * @property {BpsPercentRatioPattern} investedCapitalInProfitRelToRealizedCap - * @property {BpsPercentRatioPattern} investedCapitalInLossRelToRealizedCap * @property {BpsPercentRatioPattern} unrealizedProfitRelToOwnGrossPnl * @property {BpsPercentRatioPattern} unrealizedLossRelToOwnGrossPnl * @property {BpsPercentRatioPattern} negUnrealizedLossRelToOwnGrossPnl @@ -4897,7 +4956,77 @@ function create_2wPattern(client, acc) { * @property {AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} realized * @property {InvestedMaxMinPercentilesPattern} costBasis * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized - * @property {InvestedNegNetNuplSupplyUnrealizedPattern2} relative + * @property {InvestedNegNetNuplSupplyUnrealizedPattern3} relative + */ + +/** + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Lth + * @property {ChangeHalvedTotalPattern} supply + * @property {UtxoPattern} outputs + * @property {CoinblocksCoindaysSentPattern} activity + * @property {MetricsTree_Distribution_UtxoCohorts_Lth_Realized} realized + * @property {InvestedMaxMinPercentilesPattern} costBasis + * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized + * @property {InvestedNegNetNuplSupplyUnrealizedPattern3} relative + */ + +/** + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Lth_Realized + * @property {CentsSatsUsdPattern} investorPrice + * @property {BpsRatioPattern} investorPriceRatio + * @property {CentsSatsUsdPattern} lowerPriceBand + * @property {CentsSatsUsdPattern} upperPriceBand + * @property {MetricPattern18} capRaw + * @property {MetricPattern18} investorCapRaw + * @property {_1m1w1y24hPattern2} sellSideRiskRatio + * @property {_1m1wPattern2} sellSideRiskRatio24hEma + * @property {CumulativeHeightPattern} peakRegret + * @property {BpsPercentRatioPattern} peakRegretRelToRealizedCap + * @property {MetricPattern1} profitValueCreated + * @property {MetricPattern1} profitValueDestroyed + * @property {MetricPattern1} lossValueCreated + * @property {MetricPattern1} lossValueDestroyed + * @property {MetricPattern1} valueCreated + * @property {MetricPattern1} valueDestroyed + * @property {MetricPattern1} capitulationFlow + * @property {MetricPattern1} profitFlow + * @property {_1m1w1y24hPattern} valueCreatedSum + * @property {_1m1w1y24hPattern} valueDestroyedSum + * @property {_1m1w1y24hPattern} grossPnlSum + * @property {MetricPattern1} netPnlChange1m + * @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap + * @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap + * @property {BaseCumulativePattern} sentInProfit + * @property {_2wPattern} sentInProfitEma + * @property {BaseCumulativePattern} sentInLoss + * @property {_2wPattern} sentInLossEma + * @property {MetricPattern1} realizedCapCents + * @property {CumulativeHeightPattern} realizedProfit + * @property {CumulativeHeightPattern} realizedLoss + * @property {MetricPattern1} realizedCap + * @property {CentsSatsUsdPattern} realizedPrice + * @property {BpsRatioPattern} realizedPriceRatio + * @property {MetricPattern1} realizedCapChange1m + * @property {MetricPattern1} mvrv + * @property {MetricPattern1} negRealizedLoss + * @property {CumulativeHeightPattern} netRealizedPnl + * @property {MetricPattern1} netRealizedPnlEma1w + * @property {CentsUsdPattern} grossPnl + * @property {MetricPattern1} realizedProfitEma1w + * @property {MetricPattern1} realizedLossEma1w + * @property {_1m1w1y24hPattern} sopr + * @property {_1m1wPattern} sopr24hEma + * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap + * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap + * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap + * @property {BpsPercentRatioPattern} realizedCapRelToOwnMarketCap + * @property {_1m1w1y24hPattern} realizedProfitSum + * @property {_1m1w1y24hPattern} realizedLossSum + * @property {_1m1w1y24hPattern} realizedProfitToLossRatio + * @property {RatioPattern} realizedPriceRatioPercentiles + * @property {RatioPattern2} realizedPriceRatioStdDev + * @property {RatioPattern} investorPriceRatioPercentiles + * @property {RatioPattern2} investorPriceRatioStdDev */ /** @@ -4949,123 +5078,123 @@ function create_2wPattern(client, acc) { /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_MinAge - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1d - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1w - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _3m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _4m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _5m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _6m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _3y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _4y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _5y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _6y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _7y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _8y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _12y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1d + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1w + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _2m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _3m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _4m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _5m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _6m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _2y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _3y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _4y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _5y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _6y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _7y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _8y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _12y */ /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_GeAmount - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1sat - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1kBtc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10kBtc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1sat + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10sats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100sats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1kSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10kSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100kSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1mSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10mSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1btc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10btc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100btc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1kBtc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10kBtc */ /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_AmountRange - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _0sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1satTo10sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10satsTo100sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100satsTo1kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1kSatsTo10kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10kSatsTo100kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100kSatsTo1mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1mSatsTo10mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10mSatsTo1btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1btcTo10btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10btcTo100btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100btcTo1kBtc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1kBtcTo10kBtc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10kBtcTo100kBtc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100kBtcOrMore + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _0sats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1satTo10sats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10satsTo100sats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100satsTo1kSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1kSatsTo10kSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10kSatsTo100kSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100kSatsTo1mSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1mSatsTo10mSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10mSatsTo1btc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1btcTo10btc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10btcTo100btc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100btcTo1kBtc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1kBtcTo10kBtc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10kBtcTo100kBtc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100kBtcOrMore */ /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_LtAmount - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1kBtc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _10kBtc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _100kBtc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10sats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100sats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1kSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10kSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100kSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1mSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10mSats + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1btc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10btc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100btc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1kBtc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _10kBtc + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _100kBtc */ /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Epoch - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _0 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _1 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _3 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _4 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _0 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _1 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _3 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _4 */ /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Class - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2009 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2010 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2011 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2012 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2013 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2014 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2015 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2016 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2017 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2018 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2019 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2020 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2021 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2022 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2023 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2024 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2025 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2026 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2009 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2010 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2011 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2012 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2013 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2014 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2015 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2016 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2017 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2018 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2019 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2020 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2021 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2022 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2023 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2024 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2025 + * @property {ActivityOutputsRealizedRelativeSupplyUnrealizedPattern} _2026 */ /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Type - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2pk65 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2pk33 - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2pkh - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2ms - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2sh - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2wpkh - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2wsh - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2tr - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2a - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} unknown - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} empty + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} p2pk65 + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} p2pk33 + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} p2pkh + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} p2ms + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} p2sh + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} p2wpkh + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} p2wsh + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} p2tr + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} p2a + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} unknown + * @property {OutputsRealizedRelativeSupplyUnrealizedPattern} empty */ /** @@ -5077,55 +5206,55 @@ function create_2wPattern(client, acc) { /** * @typedef {Object} MetricsTree_Distribution_AddressCohorts_GeAmount - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1sat - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10sats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100sats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1kSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10kSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100kSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1mSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10mSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1btc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10btc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100btc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1kBtc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10kBtc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1sat + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10sats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100sats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1kSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10kSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100kSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1mSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10mSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1btc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10btc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100btc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1kBtc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10kBtc */ /** * @typedef {Object} MetricsTree_Distribution_AddressCohorts_AmountRange - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _0sats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1satTo10sats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10satsTo100sats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100satsTo1kSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1kSatsTo10kSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10kSatsTo100kSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100kSatsTo1mSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1mSatsTo10mSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10mSatsTo1btc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1btcTo10btc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10btcTo100btc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100btcTo1kBtc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1kBtcTo10kBtc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10kBtcTo100kBtc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100kBtcOrMore + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _0sats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1satTo10sats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10satsTo100sats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100satsTo1kSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1kSatsTo10kSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10kSatsTo100kSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100kSatsTo1mSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1mSatsTo10mSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10mSatsTo1btc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1btcTo10btc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10btcTo100btc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100btcTo1kBtc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1kBtcTo10kBtc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10kBtcTo100kBtc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100kBtcOrMore */ /** * @typedef {Object} MetricsTree_Distribution_AddressCohorts_LtAmount - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10sats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100sats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1kSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10kSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100kSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1mSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10mSats - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1btc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10btc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100btc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _1kBtc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _10kBtc - * @property {ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern} _100kBtc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10sats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100sats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1kSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10kSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100kSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1mSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10mSats + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1btc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10btc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100btc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _1kBtc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _10kBtc + * @property {ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern} _100kBtc */ /** @@ -7060,15 +7189,15 @@ class BrkClient extends BrkClientBase { costBasis: createInvestedMaxMinPercentilesPattern(this, ''), unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(this, ''), relative: { + negUnrealizedLossRelToMarketCap: createBpsPercentRatioPattern(this, 'neg_unrealized_loss_rel_to_market_cap'), + investedCapitalInProfitRelToRealizedCap: createBpsPercentRatioPattern(this, 'invested_capital_in_profit_rel_to_realized_cap'), + investedCapitalInLossRelToRealizedCap: createBpsPercentRatioPattern(this, 'invested_capital_in_loss_rel_to_realized_cap'), supplyInProfitRelToOwnSupply: createBpsPercentRatioPattern(this, 'supply_in_profit_rel_to_own_supply'), supplyInLossRelToOwnSupply: createBpsPercentRatioPattern(this, 'supply_in_loss_rel_to_own_supply'), unrealizedProfitRelToMarketCap: createBpsPercentRatioPattern(this, 'unrealized_profit_rel_to_market_cap'), unrealizedLossRelToMarketCap: createBpsPercentRatioPattern(this, 'unrealized_loss_rel_to_market_cap'), - negUnrealizedLossRelToMarketCap: createBpsPercentRatioPattern(this, 'neg_unrealized_loss_rel_to_market_cap'), netUnrealizedPnlRelToMarketCap: createBpsPercentRatioPattern(this, 'net_unrealized_pnl_rel_to_market_cap'), nupl: createMetricPattern1(this, 'nupl'), - investedCapitalInProfitRelToRealizedCap: createBpsPercentRatioPattern(this, 'invested_capital_in_profit_rel_to_realized_cap'), - investedCapitalInLossRelToRealizedCap: createBpsPercentRatioPattern(this, 'invested_capital_in_loss_rel_to_realized_cap'), unrealizedProfitRelToOwnGrossPnl: createBpsPercentRatioPattern(this, 'unrealized_profit_rel_to_own_gross_pnl'), unrealizedLossRelToOwnGrossPnl: createBpsPercentRatioPattern(this, 'unrealized_loss_rel_to_own_gross_pnl'), negUnrealizedLossRelToOwnGrossPnl: createBpsPercentRatioPattern(this, 'neg_unrealized_loss_rel_to_own_gross_pnl'), @@ -7082,9 +7211,73 @@ class BrkClient extends BrkClientBase { realized: createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(this, 'sth'), costBasis: createInvestedMaxMinPercentilesPattern(this, 'sth'), unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(this, 'sth'), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern2(this, 'sth'), + relative: createInvestedNegNetNuplSupplyUnrealizedPattern3(this, 'sth'), + }, + lth: { + supply: createChangeHalvedTotalPattern(this, 'lth_supply'), + outputs: createUtxoPattern(this, 'lth_utxo_count'), + activity: createCoinblocksCoindaysSentPattern(this, 'lth'), + realized: { + investorPrice: createCentsSatsUsdPattern(this, 'lth_investor_price'), + investorPriceRatio: createBpsRatioPattern(this, 'lth_investor_price_ratio'), + lowerPriceBand: createCentsSatsUsdPattern(this, 'lth_lower_price_band'), + upperPriceBand: createCentsSatsUsdPattern(this, 'lth_upper_price_band'), + capRaw: createMetricPattern18(this, 'lth_cap_raw'), + investorCapRaw: createMetricPattern18(this, 'lth_investor_cap_raw'), + sellSideRiskRatio: create_1m1w1y24hPattern2(this, 'lth_sell_side_risk_ratio'), + sellSideRiskRatio24hEma: create_1m1wPattern2(this, 'lth_sell_side_risk_ratio_24h_ema'), + peakRegret: createCumulativeHeightPattern(this, 'lth_realized_peak_regret'), + peakRegretRelToRealizedCap: createBpsPercentRatioPattern(this, 'lth_realized_peak_regret_rel_to_realized_cap'), + profitValueCreated: createMetricPattern1(this, 'lth_profit_value_created'), + profitValueDestroyed: createMetricPattern1(this, 'lth_profit_value_destroyed'), + lossValueCreated: createMetricPattern1(this, 'lth_loss_value_created'), + lossValueDestroyed: createMetricPattern1(this, 'lth_loss_value_destroyed'), + valueCreated: createMetricPattern1(this, 'lth_value_created'), + valueDestroyed: createMetricPattern1(this, 'lth_value_destroyed'), + capitulationFlow: createMetricPattern1(this, 'lth_capitulation_flow'), + profitFlow: createMetricPattern1(this, 'lth_profit_flow'), + valueCreatedSum: create_1m1w1y24hPattern(this, 'lth_value_created'), + valueDestroyedSum: create_1m1w1y24hPattern(this, 'lth_value_destroyed'), + grossPnlSum: create_1m1w1y24hPattern(this, 'lth_gross_pnl_sum'), + netPnlChange1m: createMetricPattern1(this, 'lth_net_pnl_change_1m'), + netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(this, 'lth_net_pnl_change_1m_rel_to_realized_cap'), + netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(this, 'lth_net_pnl_change_1m_rel_to_market_cap'), + sentInProfit: createBaseCumulativePattern(this, 'lth_sent_in_profit'), + sentInProfitEma: create_2wPattern(this, 'lth_sent_in_profit_ema_2w'), + sentInLoss: createBaseCumulativePattern(this, 'lth_sent_in_loss'), + sentInLossEma: create_2wPattern(this, 'lth_sent_in_loss_ema_2w'), + realizedCapCents: createMetricPattern1(this, 'lth_realized_cap_cents'), + realizedProfit: createCumulativeHeightPattern(this, 'lth_realized_profit'), + realizedLoss: createCumulativeHeightPattern(this, 'lth_realized_loss'), + realizedCap: createMetricPattern1(this, 'lth_realized_cap'), + realizedPrice: createCentsSatsUsdPattern(this, 'lth_realized_price'), + realizedPriceRatio: createBpsRatioPattern(this, 'lth_realized_price_ratio'), + realizedCapChange1m: createMetricPattern1(this, 'lth_realized_cap_change_1m'), + mvrv: createMetricPattern1(this, 'lth_mvrv'), + negRealizedLoss: createMetricPattern1(this, 'lth_neg_realized_loss'), + netRealizedPnl: createCumulativeHeightPattern(this, 'lth_net_realized_pnl'), + netRealizedPnlEma1w: createMetricPattern1(this, 'lth_net_realized_pnl_ema_1w'), + grossPnl: createCentsUsdPattern(this, 'lth_realized_gross_pnl'), + realizedProfitEma1w: createMetricPattern1(this, 'lth_realized_profit_ema_1w'), + realizedLossEma1w: createMetricPattern1(this, 'lth_realized_loss_ema_1w'), + sopr: create_1m1w1y24hPattern(this, 'lth_sopr'), + sopr24hEma: create_1m1wPattern(this, 'lth_sopr_24h_ema'), + realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(this, 'lth_realized_profit_rel_to_realized_cap'), + realizedLossRelToRealizedCap: createBpsPercentRatioPattern(this, 'lth_realized_loss_rel_to_realized_cap'), + netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(this, 'lth_net_realized_pnl_rel_to_realized_cap'), + realizedCapRelToOwnMarketCap: createBpsPercentRatioPattern(this, 'lth_realized_cap_rel_to_own_market_cap'), + realizedProfitSum: create_1m1w1y24hPattern(this, 'lth_realized_profit'), + realizedLossSum: create_1m1w1y24hPattern(this, 'lth_realized_loss'), + realizedProfitToLossRatio: create_1m1w1y24hPattern(this, 'lth_realized_profit_to_loss_ratio'), + realizedPriceRatioPercentiles: createRatioPattern(this, 'lth_realized_price_ratio'), + realizedPriceRatioStdDev: createRatioPattern2(this, 'lth_realized_price_ratio'), + investorPriceRatioPercentiles: createRatioPattern(this, 'lth_investor_price_ratio'), + investorPriceRatioStdDev: createRatioPattern2(this, 'lth_investor_price_ratio'), + }, + costBasis: createInvestedMaxMinPercentilesPattern(this, 'lth'), + unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(this, 'lth'), + relative: createInvestedNegNetNuplSupplyUnrealizedPattern3(this, 'lth'), }, - lth: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'lth'), ageRange: { upTo1h: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_1h_old'), _1hTo1d: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_1h_to_1d_old'), @@ -7129,160 +7322,160 @@ class BrkClient extends BrkClientBase { _15y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_15y_old'), }, minAge: { - _1d: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_1d_old'), - _1w: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_1w_old'), - _1m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_1m_old'), - _2m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_2m_old'), - _3m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_3m_old'), - _4m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_4m_old'), - _5m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_5m_old'), - _6m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_6m_old'), - _1y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_1y_old'), - _2y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_2y_old'), - _3y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_3y_old'), - _4y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_4y_old'), - _5y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_5y_old'), - _6y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_6y_old'), - _7y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_7y_old'), - _8y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_8y_old'), - _10y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_10y_old'), - _12y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_12y_old'), + _1d: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_1d_old'), + _1w: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_1w_old'), + _1m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_1m_old'), + _2m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_2m_old'), + _3m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_3m_old'), + _4m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_4m_old'), + _5m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_5m_old'), + _6m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_6m_old'), + _1y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_1y_old'), + _2y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_2y_old'), + _3y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_3y_old'), + _4y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_4y_old'), + _5y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_5y_old'), + _6y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_6y_old'), + _7y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_7y_old'), + _8y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_8y_old'), + _10y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_10y_old'), + _12y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_12y_old'), }, geAmount: { - _1sat: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_1sat'), - _10sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_10sats'), - _100sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_100sats'), - _1kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_1k_sats'), - _10kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_10k_sats'), - _100kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_100k_sats'), - _1mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_1m_sats'), - _10mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_10m_sats'), - _1btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_1btc'), - _10btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_10btc'), - _100btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_100btc'), - _1kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_1k_btc'), - _10kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_over_10k_btc'), + _1sat: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_1sat'), + _10sats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_10sats'), + _100sats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_100sats'), + _1kSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_1k_sats'), + _10kSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_10k_sats'), + _100kSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_100k_sats'), + _1mSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_1m_sats'), + _10mSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_10m_sats'), + _1btc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_1btc'), + _10btc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_10btc'), + _100btc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_100btc'), + _1kBtc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_1k_btc'), + _10kBtc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_10k_btc'), }, amountRange: { - _0sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_with_0sats'), - _1satTo10sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_1sat_under_10sats'), - _10satsTo100sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_10sats_under_100sats'), - _100satsTo1kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_100sats_under_1k_sats'), - _1kSatsTo10kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_1k_sats_under_10k_sats'), - _10kSatsTo100kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_10k_sats_under_100k_sats'), - _100kSatsTo1mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_100k_sats_under_1m_sats'), - _1mSatsTo10mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_1m_sats_under_10m_sats'), - _10mSatsTo1btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_10m_sats_under_1btc'), - _1btcTo10btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_1btc_under_10btc'), - _10btcTo100btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_10btc_under_100btc'), - _100btcTo1kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_100btc_under_1k_btc'), - _1kBtcTo10kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_1k_btc_under_10k_btc'), - _10kBtcTo100kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_10k_btc_under_100k_btc'), - _100kBtcOrMore: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_above_100k_btc'), + _0sats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_with_0sats'), + _1satTo10sats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_1sat_under_10sats'), + _10satsTo100sats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_10sats_under_100sats'), + _100satsTo1kSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_100sats_under_1k_sats'), + _1kSatsTo10kSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_1k_sats_under_10k_sats'), + _10kSatsTo100kSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_10k_sats_under_100k_sats'), + _100kSatsTo1mSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_100k_sats_under_1m_sats'), + _1mSatsTo10mSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_1m_sats_under_10m_sats'), + _10mSatsTo1btc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_10m_sats_under_1btc'), + _1btcTo10btc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_1btc_under_10btc'), + _10btcTo100btc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_10btc_under_100btc'), + _100btcTo1kBtc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_100btc_under_1k_btc'), + _1kBtcTo10kBtc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_1k_btc_under_10k_btc'), + _10kBtcTo100kBtc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_10k_btc_under_100k_btc'), + _100kBtcOrMore: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_above_100k_btc'), }, ltAmount: { - _10sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_10sats'), - _100sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_100sats'), - _1kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_1k_sats'), - _10kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_10k_sats'), - _100kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_100k_sats'), - _1mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_1m_sats'), - _10mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_10m_sats'), - _1btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_1btc'), - _10btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_10btc'), - _100btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_100btc'), - _1kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_1k_btc'), - _10kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_10k_btc'), - _100kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'utxos_under_100k_btc'), + _10sats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_10sats'), + _100sats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_100sats'), + _1kSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_1k_sats'), + _10kSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_10k_sats'), + _100kSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_100k_sats'), + _1mSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_1m_sats'), + _10mSats: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_10m_sats'), + _1btc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_1btc'), + _10btc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_10btc'), + _100btc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_100btc'), + _1kBtc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_1k_btc'), + _10kBtc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_10k_btc'), + _100kBtc: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_100k_btc'), }, epoch: { - _0: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'epoch_0'), - _1: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'epoch_1'), - _2: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'epoch_2'), - _3: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'epoch_3'), - _4: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'epoch_4'), + _0: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'epoch_0'), + _1: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'epoch_1'), + _2: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'epoch_2'), + _3: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'epoch_3'), + _4: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'epoch_4'), }, class: { - _2009: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2009'), - _2010: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2010'), - _2011: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2011'), - _2012: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2012'), - _2013: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2013'), - _2014: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2014'), - _2015: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2015'), - _2016: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2016'), - _2017: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2017'), - _2018: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2018'), - _2019: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2019'), - _2020: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2020'), - _2021: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2021'), - _2022: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2022'), - _2023: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2023'), - _2024: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2024'), - _2025: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2025'), - _2026: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'class_2026'), + _2009: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2009'), + _2010: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2010'), + _2011: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2011'), + _2012: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2012'), + _2013: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2013'), + _2014: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2014'), + _2015: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2015'), + _2016: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2016'), + _2017: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2017'), + _2018: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2018'), + _2019: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2019'), + _2020: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2020'), + _2021: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2021'), + _2022: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2022'), + _2023: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2023'), + _2024: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2024'), + _2025: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2025'), + _2026: createActivityOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'class_2026'), }, type: { - p2pk65: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2pk65'), - p2pk33: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2pk33'), - p2pkh: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2pkh'), - p2ms: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2ms'), - p2sh: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2sh'), - p2wpkh: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2wpkh'), - p2wsh: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2wsh'), - p2tr: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2tr'), - p2a: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2a'), - unknown: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'unknown_outputs'), - empty: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'empty_outputs'), + p2pk65: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'p2pk65'), + p2pk33: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'p2pk33'), + p2pkh: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'p2pkh'), + p2ms: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'p2ms'), + p2sh: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'p2sh'), + p2wpkh: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'p2wpkh'), + p2wsh: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'p2wsh'), + p2tr: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'p2tr'), + p2a: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'p2a'), + unknown: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'unknown_outputs'), + empty: createOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'empty_outputs'), }, }, addressCohorts: { geAmount: { - _1sat: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1sat'), - _10sats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10sats'), - _100sats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_100sats'), - _1kSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1k_sats'), - _10kSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10k_sats'), - _100kSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_100k_sats'), - _1mSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1m_sats'), - _10mSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10m_sats'), - _1btc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1btc'), - _10btc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10btc'), - _100btc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_100btc'), - _1kBtc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1k_btc'), - _10kBtc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10k_btc'), + _1sat: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1sat'), + _10sats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10sats'), + _100sats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_100sats'), + _1kSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1k_sats'), + _10kSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10k_sats'), + _100kSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_100k_sats'), + _1mSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1m_sats'), + _10mSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10m_sats'), + _1btc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1btc'), + _10btc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10btc'), + _100btc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_100btc'), + _1kBtc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_1k_btc'), + _10kBtc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_over_10k_btc'), }, amountRange: { - _0sats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_with_0sats'), - _1satTo10sats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1sat_under_10sats'), - _10satsTo100sats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10sats_under_100sats'), - _100satsTo1kSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_100sats_under_1k_sats'), - _1kSatsTo10kSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1k_sats_under_10k_sats'), - _10kSatsTo100kSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10k_sats_under_100k_sats'), - _100kSatsTo1mSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_100k_sats_under_1m_sats'), - _1mSatsTo10mSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1m_sats_under_10m_sats'), - _10mSatsTo1btc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10m_sats_under_1btc'), - _1btcTo10btc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1btc_under_10btc'), - _10btcTo100btc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10btc_under_100btc'), - _100btcTo1kBtc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_100btc_under_1k_btc'), - _1kBtcTo10kBtc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1k_btc_under_10k_btc'), - _10kBtcTo100kBtc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10k_btc_under_100k_btc'), - _100kBtcOrMore: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_100k_btc'), + _0sats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_with_0sats'), + _1satTo10sats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1sat_under_10sats'), + _10satsTo100sats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10sats_under_100sats'), + _100satsTo1kSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_100sats_under_1k_sats'), + _1kSatsTo10kSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1k_sats_under_10k_sats'), + _10kSatsTo100kSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10k_sats_under_100k_sats'), + _100kSatsTo1mSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_100k_sats_under_1m_sats'), + _1mSatsTo10mSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1m_sats_under_10m_sats'), + _10mSatsTo1btc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10m_sats_under_1btc'), + _1btcTo10btc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1btc_under_10btc'), + _10btcTo100btc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10btc_under_100btc'), + _100btcTo1kBtc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_100btc_under_1k_btc'), + _1kBtcTo10kBtc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_1k_btc_under_10k_btc'), + _10kBtcTo100kBtc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_10k_btc_under_100k_btc'), + _100kBtcOrMore: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_above_100k_btc'), }, ltAmount: { - _10sats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10sats'), - _100sats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_100sats'), - _1kSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_1k_sats'), - _10kSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10k_sats'), - _100kSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_100k_sats'), - _1mSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_1m_sats'), - _10mSats: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10m_sats'), - _1btc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_1btc'), - _10btc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10btc'), - _100btc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_100btc'), - _1kBtc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_1k_btc'), - _10kBtc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10k_btc'), - _100kBtc: createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_100k_btc'), + _10sats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10sats'), + _100sats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_100sats'), + _1kSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_1k_sats'), + _10kSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10k_sats'), + _100kSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_100k_sats'), + _1mSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_1m_sats'), + _10mSats: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10m_sats'), + _1btc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_1btc'), + _10btc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10btc'), + _100btc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_100btc'), + _1kBtc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_1k_btc'), + _10kBtc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_10k_btc'), + _100kBtc: createActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'addrs_under_100k_btc'), }, }, addrCount: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(this, 'addr_count'), diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index 53a3df203..622ab4ab5 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -2070,7 +2070,7 @@ class AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedS def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.adjusted_sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_sopr')) - self.adjusted_sopr_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'adjusted_sopr_24h_ema')) + self.adjusted_sopr_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'adjusted_sopr_24h_ema')) self.adjusted_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created')) self.adjusted_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_value_created')) self.adjusted_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed')) @@ -2118,133 +2118,13 @@ class AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedS self.realized_profit_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit')) self.realized_profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')) self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) + self.sell_side_risk_ratio_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_loss')) self.sent_in_loss_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')) self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_profit')) self.sent_in_profit_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')) self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) - self.sopr_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sopr_24h_ema')) - self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band')) - self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) - self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_created')) - self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed')) - self.value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_destroyed')) - -class CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cap_raw: MetricPattern18[CentsSats] = MetricPattern18(client, _m(acc, 'cap_raw')) - self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'capitulation_flow')) - self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_gross_pnl')) - self.gross_pnl_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')) - self.investor_cap_raw: MetricPattern18[CentsSquaredSats] = MetricPattern18(client, _m(acc, 'investor_cap_raw')) - self.investor_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'investor_price')) - self.investor_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'investor_price_ratio')) - self.investor_price_ratio_percentiles: RatioPattern = RatioPattern(client, _m(acc, 'investor_price_ratio')) - self.investor_price_ratio_std_dev: RatioPattern2 = RatioPattern2(client, _m(acc, 'investor_price_ratio')) - self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_created')) - self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) - self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'lower_price_band')) - self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) - self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) - self.net_pnl_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_pnl_change_1m')) - self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')) - self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')) - self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) - self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')) - self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) - self.peak_regret: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) - self.peak_regret_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')) - self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) - self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_created')) - self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_destroyed')) - self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) - self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) - self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) - self.realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap')) - self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) - self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_ema_1w')) - self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) - self.realized_loss_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'realized_loss')) - self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) - self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) - self.realized_price_ratio_percentiles: RatioPattern = RatioPattern(client, _m(acc, 'realized_price_ratio')) - self.realized_price_ratio_std_dev: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) - self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) - self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w')) - self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) - self.realized_profit_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit')) - self.realized_profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')) - self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) - self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_loss')) - self.sent_in_loss_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')) - self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_profit')) - self.sent_in_profit_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')) - self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) - self.sopr_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sopr_24h_ema')) - self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band')) - self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) - self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_created')) - self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed')) - self.value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_destroyed')) - -class AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.adjusted_sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_sopr')) - self.adjusted_sopr_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'adjusted_sopr_24h_ema')) - self.adjusted_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created')) - self.adjusted_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_value_created')) - self.adjusted_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed')) - self.adjusted_value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_value_destroyed')) - self.cap_raw: MetricPattern18[CentsSats] = MetricPattern18(client, _m(acc, 'cap_raw')) - self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'capitulation_flow')) - self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_gross_pnl')) - self.gross_pnl_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')) - self.investor_cap_raw: MetricPattern18[CentsSquaredSats] = MetricPattern18(client, _m(acc, 'investor_cap_raw')) - self.investor_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'investor_price')) - self.investor_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'investor_price_ratio')) - self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_created')) - self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) - self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'lower_price_band')) - self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) - self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) - self.net_pnl_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_pnl_change_1m')) - self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')) - self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')) - self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) - self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')) - self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) - self.peak_regret: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) - self.peak_regret_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')) - self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) - self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_created')) - self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_destroyed')) - self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) - self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) - self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) - self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) - self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_ema_1w')) - self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) - self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) - self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) - self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) - self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w')) - self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) - self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) - self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_loss')) - self.sent_in_loss_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')) - self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_profit')) - self.sent_in_profit_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')) - self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) - self.sopr_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sopr_24h_ema')) + self.sopr_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sopr_24h_ema')) self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band')) self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_created')) @@ -2291,19 +2171,62 @@ class CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentS self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w')) self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) + self.sell_side_risk_ratio_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_loss')) self.sent_in_loss_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')) self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_profit')) self.sent_in_profit_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')) self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) - self.sopr_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sopr_24h_ema')) + self.sopr_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sopr_24h_ema')) self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band')) self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_created')) self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed')) self.value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_destroyed')) +class CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'capitulation_flow')) + self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_gross_pnl')) + self.gross_pnl_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')) + self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_created')) + self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) + self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) + self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_pnl_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_pnl_change_1m')) + self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')) + self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')) + self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) + self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')) + self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) + self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_created')) + self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_destroyed')) + self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) + self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) + self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) + self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) + self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_ema_1w')) + self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) + self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) + self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) + self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w')) + self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_loss')) + self.sent_in_loss_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')) + self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_profit')) + self.sent_in_profit_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')) + self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) + self.sopr_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sopr_24h_ema')) + self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) + self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_created')) + self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed')) + self.value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_destroyed')) + class _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern: """Pattern struct for repeated tree structure.""" @@ -2338,7 +2261,7 @@ class _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern: self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sma_4y')) self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'zscore_4y')) -class InvestedNegNetNuplSupplyUnrealizedPattern2: +class InvestedNegNetNuplSupplyUnrealizedPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2364,6 +2287,31 @@ class InvestedNegNetNuplSupplyUnrealizedPattern2: self.unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_own_gross_pnl')) self.unrealized_profit_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) +class GrossMvrvNegNetRealizedSoprPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_gross_pnl')) + self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) + self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) + self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')) + self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) + self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) + self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) + self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) + self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_ema_1w')) + self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) + self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) + self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) + self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w')) + self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) + self.sopr_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sopr_24h_ema')) + class Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern: """Pattern struct for repeated tree structure.""" @@ -2557,21 +2505,6 @@ class AverageGainsLossesRsiStochPattern: self.stoch_rsi_d: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'stoch_d_24h')) self.stoch_rsi_k: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'stoch_k_24h')) -class ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: CoinblocksCoindaysSentPattern = CoinblocksCoindaysSentPattern(client, acc) - self.addr_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'addr_count')) - self.addr_count_change_1m: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'addr_count_change_1m')) - self.cost_basis: MaxMinPattern = MaxMinPattern(client, _m(acc, 'cost_basis')) - self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern = CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc) - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern = InvestedNegNetNuplSupplyUnrealizedPattern(client, acc) - self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) - self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc) - class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern: """Pattern struct for repeated tree structure.""" @@ -2617,6 +2550,21 @@ class AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern: self.pct90: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p90')) self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'sum')) +class NetNuplSupplyUnrealizedPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) + self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl')) + self.supply_in_loss_rel_to_circulating_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) + self.supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_circulating_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) + self.supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.supply_rel_to_circulating_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_rel_to_circulating_supply')) + self.unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) + self.unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) + class AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2646,6 +2594,20 @@ class _1m1w1y24hBtcCentsSatsUsdPattern: self.sats: MetricPattern18[Sats] = MetricPattern18(client, acc) self.usd: MetricPattern18[Dollars] = MetricPattern18(client, _m(acc, 'usd')) +class ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: SentPattern = SentPattern(client, _m(acc, 'sent')) + self.addr_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'addr_count')) + self.addr_count_change_1m: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'addr_count_change_1m')) + self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) + self.realized: GrossMvrvNegNetRealizedSoprPattern = GrossMvrvNegNetRealizedSoprPattern(client, acc) + self.relative: NetNuplSupplyUnrealizedPattern = NetNuplSupplyUnrealizedPattern(client, acc) + self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) + self.unrealized: NegNetSupplyUnrealizedPattern = NegNetSupplyUnrealizedPattern(client, acc) + class AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2679,10 +2641,10 @@ class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.activity: CoinblocksCoindaysSentPattern = CoinblocksCoindaysSentPattern(client, acc) - self.cost_basis: InvestedMaxMinPercentilesPattern = InvestedMaxMinPercentilesPattern(client, acc) + self.cost_basis: MaxMinPattern = MaxMinPattern(client, _m(acc, 'cost_basis')) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 = CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc) - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern2 = InvestedNegNetNuplSupplyUnrealizedPattern2(client, acc) + self.realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern = CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc) + self.relative: InvestedNegNetNuplSupplyUnrealizedPattern = InvestedNegNetNuplSupplyUnrealizedPattern(client, acc) self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc) @@ -2694,23 +2656,10 @@ class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4: self.activity: CoinblocksCoindaysSentPattern = CoinblocksCoindaysSentPattern(client, acc) self.cost_basis: MaxMinPattern = MaxMinPattern(client, _m(acc, 'cost_basis')) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 = AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc) - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern = InvestedNegNetNuplSupplyUnrealizedPattern(client, acc) + self.realized: CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern = CapitulationGrossLossMvrvNegNetProfitRealizedSentSoprValuePattern(client, acc) + self.relative: NetNuplSupplyUnrealizedPattern = NetNuplSupplyUnrealizedPattern(client, acc) self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) - self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc) - -class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: CoinblocksCoindaysSentPattern = CoinblocksCoindaysSentPattern(client, acc) - self.cost_basis: MaxMinPattern = MaxMinPattern(client, _m(acc, 'cost_basis')) - self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern = CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc) - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern = InvestedNegNetNuplSupplyUnrealizedPattern(client, acc) - self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) - self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc) + self.unrealized: NegNetSupplyUnrealizedPattern = NegNetSupplyUnrealizedPattern(client, acc) class _1m1w1y24hBaseCumulativePattern: """Pattern struct for repeated tree structure.""" @@ -2724,6 +2673,18 @@ class _1m1w1y24hBaseCumulativePattern: self.base: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')) +class ActivityOutputsRealizedRelativeSupplyUnrealizedPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.activity: SentPattern = SentPattern(client, _m(acc, 'sent')) + self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) + self.realized: GrossMvrvNegNetRealizedSoprPattern = GrossMvrvNegNetRealizedSoprPattern(client, acc) + self.relative: NetNuplSupplyUnrealizedPattern = NetNuplSupplyUnrealizedPattern(client, acc) + self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) + self.unrealized: NegNetSupplyUnrealizedPattern = NegNetSupplyUnrealizedPattern(client, acc) + class BalanceBothReactivatedReceivingSendingPattern: """Pattern struct for repeated tree structure.""" @@ -2736,6 +2697,18 @@ class BalanceBothReactivatedReceivingSendingPattern: self.receiving: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredU32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'receiving')) self.sending: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredU32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'sending')) +class NegNetSupplyUnrealizedPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.neg_unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss')) + self.net_unrealized_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'net_unrealized_pnl')) + self.supply_in_loss: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'supply_in_loss')) + self.supply_in_profit: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'supply_in_profit')) + self.unrealized_loss: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_loss')) + self.unrealized_profit: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_profit')) + class EmaHistogramLineSignalPattern: """Pattern struct for repeated tree structure.""" @@ -2747,6 +2720,28 @@ class EmaHistogramLineSignalPattern: self.line: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'line_24h')) self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'signal_24h')) +class MvrvRealizedPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) + self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) + self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) + self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) + self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) + +class OutputsRealizedRelativeSupplyUnrealizedPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) + self.realized: MvrvRealizedPattern = MvrvRealizedPattern(client, acc) + self.relative: SupplyPattern = SupplyPattern(client, _m(acc, 'supply_in')) + self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) + self.unrealized: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply_in')) + class _1m1w1y24hPattern2: """Pattern struct for repeated tree structure.""" @@ -2908,7 +2903,7 @@ class CumulativeHeightSumPattern(Generic[T]): self.height: MetricPattern18[T] = MetricPattern18(client, acc) self.sum: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, acc) -class _1m1wPattern: +class _1m1wPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2916,7 +2911,7 @@ class _1m1wPattern: self._1m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1m')) self._1w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1w')) -class _1m1wPattern2: +class _1m1wPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2972,6 +2967,30 @@ class SdSmaPattern: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sd_1y')) self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sma_1y')) +class SentPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.sent: BaseCumulativePattern = BaseCumulativePattern(client, acc) + self.sent_ema: _2wPattern = _2wPattern(client, _m(acc, 'ema_2w')) + +class SupplyPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.supply_in_loss: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'loss')) + self.supply_in_profit: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'profit')) + +class SupplyPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'profit_rel_to_own_supply')) + class UtxoPattern: """Pattern struct for repeated tree structure.""" @@ -4292,15 +4311,15 @@ class MetricsTree_Distribution_UtxoCohorts_All_Relative: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): + self.neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'neg_unrealized_loss_rel_to_market_cap') + self.invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'invested_capital_in_profit_rel_to_realized_cap') + self.invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'invested_capital_in_loss_rel_to_realized_cap') self.supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'supply_in_profit_rel_to_own_supply') self.supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'supply_in_loss_rel_to_own_supply') self.unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_profit_rel_to_market_cap') self.unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_loss_rel_to_market_cap') - self.neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'neg_unrealized_loss_rel_to_market_cap') self.net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'net_unrealized_pnl_rel_to_market_cap') self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, 'nupl') - self.invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'invested_capital_in_profit_rel_to_realized_cap') - self.invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'invested_capital_in_loss_rel_to_realized_cap') self.unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_profit_rel_to_own_gross_pnl') self.unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_loss_rel_to_own_gross_pnl') self.neg_unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'neg_unrealized_loss_rel_to_own_gross_pnl') @@ -4328,7 +4347,79 @@ class MetricsTree_Distribution_UtxoCohorts_Sth: self.realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern = AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, 'sth') self.cost_basis: InvestedMaxMinPercentilesPattern = InvestedMaxMinPercentilesPattern(client, 'sth') self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, 'sth') - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern2 = InvestedNegNetNuplSupplyUnrealizedPattern2(client, 'sth') + self.relative: InvestedNegNetNuplSupplyUnrealizedPattern3 = InvestedNegNetNuplSupplyUnrealizedPattern3(client, 'sth') + +class MetricsTree_Distribution_UtxoCohorts_Lth_Realized: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.investor_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_investor_price') + self.investor_price_ratio: BpsRatioPattern = BpsRatioPattern(client, 'lth_investor_price_ratio') + self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_lower_price_band') + self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_upper_price_band') + self.cap_raw: MetricPattern18[CentsSats] = MetricPattern18(client, 'lth_cap_raw') + self.investor_cap_raw: MetricPattern18[CentsSquaredSats] = MetricPattern18(client, 'lth_investor_cap_raw') + self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, 'lth_sell_side_risk_ratio') + self.sell_side_risk_ratio_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, 'lth_sell_side_risk_ratio_24h_ema') + self.peak_regret: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, 'lth_realized_peak_regret') + self.peak_regret_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'lth_realized_peak_regret_rel_to_realized_cap') + self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, 'lth_profit_value_created') + self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, 'lth_profit_value_destroyed') + self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, 'lth_loss_value_created') + self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, 'lth_loss_value_destroyed') + self.value_created: MetricPattern1[Cents] = MetricPattern1(client, 'lth_value_created') + self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, 'lth_value_destroyed') + self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_capitulation_flow') + self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_profit_flow') + self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'lth_value_created') + self.value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'lth_value_destroyed') + self.gross_pnl_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'lth_gross_pnl_sum') + self.net_pnl_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, 'lth_net_pnl_change_1m') + self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'lth_net_pnl_change_1m_rel_to_realized_cap') + self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'lth_net_pnl_change_1m_rel_to_market_cap') + self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, 'lth_sent_in_profit') + self.sent_in_profit_ema: _2wPattern = _2wPattern(client, 'lth_sent_in_profit_ema_2w') + self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, 'lth_sent_in_loss') + self.sent_in_loss_ema: _2wPattern = _2wPattern(client, 'lth_sent_in_loss_ema_2w') + self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, 'lth_realized_cap_cents') + self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, 'lth_realized_profit') + self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, 'lth_realized_loss') + self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_realized_cap') + self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_realized_price') + self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, 'lth_realized_price_ratio') + self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, 'lth_realized_cap_change_1m') + self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_mvrv') + self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_neg_realized_loss') + self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, 'lth_net_realized_pnl') + self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, 'lth_net_realized_pnl_ema_1w') + self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, 'lth_realized_gross_pnl') + self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, 'lth_realized_profit_ema_1w') + self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, 'lth_realized_loss_ema_1w') + self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'lth_sopr') + self.sopr_24h_ema: _1m1wPattern = _1m1wPattern(client, 'lth_sopr_24h_ema') + self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'lth_realized_profit_rel_to_realized_cap') + self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'lth_realized_loss_rel_to_realized_cap') + self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'lth_net_realized_pnl_rel_to_realized_cap') + self.realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'lth_realized_cap_rel_to_own_market_cap') + self.realized_profit_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'lth_realized_profit') + self.realized_loss_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, 'lth_realized_loss') + self.realized_profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'lth_realized_profit_to_loss_ratio') + self.realized_price_ratio_percentiles: RatioPattern = RatioPattern(client, 'lth_realized_price_ratio') + self.realized_price_ratio_std_dev: RatioPattern2 = RatioPattern2(client, 'lth_realized_price_ratio') + self.investor_price_ratio_percentiles: RatioPattern = RatioPattern(client, 'lth_investor_price_ratio') + self.investor_price_ratio_std_dev: RatioPattern2 = RatioPattern2(client, 'lth_investor_price_ratio') + +class MetricsTree_Distribution_UtxoCohorts_Lth: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, 'lth_supply') + self.outputs: UtxoPattern = UtxoPattern(client, 'lth_utxo_count') + self.activity: CoinblocksCoindaysSentPattern = CoinblocksCoindaysSentPattern(client, 'lth') + self.realized: MetricsTree_Distribution_UtxoCohorts_Lth_Realized = MetricsTree_Distribution_UtxoCohorts_Lth_Realized(client) + self.cost_basis: InvestedMaxMinPercentilesPattern = InvestedMaxMinPercentilesPattern(client, 'lth') + self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, 'lth') + self.relative: InvestedNegNetNuplSupplyUnrealizedPattern3 = InvestedNegNetNuplSupplyUnrealizedPattern3(client, 'lth') class MetricsTree_Distribution_UtxoCohorts_AgeRange: """Metrics tree node.""" @@ -4383,129 +4474,129 @@ class MetricsTree_Distribution_UtxoCohorts_MinAge: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_1d_old') - self._1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_1w_old') - self._1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_1m_old') - self._2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_2m_old') - self._3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_3m_old') - self._4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_4m_old') - self._5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_5m_old') - self._6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_6m_old') - self._1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_1y_old') - self._2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_2y_old') - self._3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_3y_old') - self._4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_4y_old') - self._5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_5y_old') - self._6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_6y_old') - self._7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_7y_old') - self._8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_8y_old') - self._10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_10y_old') - self._12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_12y_old') + self._1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_1d_old') + self._1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_1w_old') + self._1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_1m_old') + self._2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_2m_old') + self._3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_3m_old') + self._4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_4m_old') + self._5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_5m_old') + self._6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_6m_old') + self._1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_1y_old') + self._2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_2y_old') + self._3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_3y_old') + self._4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_4y_old') + self._5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_5y_old') + self._6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_6y_old') + self._7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_7y_old') + self._8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_8y_old') + self._10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_10y_old') + self._12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_12y_old') class MetricsTree_Distribution_UtxoCohorts_GeAmount: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1sat: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_1sat') - self._10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_10sats') - self._100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_100sats') - self._1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_1k_sats') - self._10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_10k_sats') - self._100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_100k_sats') - self._1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_1m_sats') - self._10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_10m_sats') - self._1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_1btc') - self._10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_10btc') - self._100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_100btc') - self._1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_1k_btc') - self._10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_over_10k_btc') + self._1sat: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_1sat') + self._10sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_10sats') + self._100sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_100sats') + self._1k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_1k_sats') + self._10k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_10k_sats') + self._100k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_100k_sats') + self._1m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_1m_sats') + self._10m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_10m_sats') + self._1btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_1btc') + self._10btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_10btc') + self._100btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_100btc') + self._1k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_1k_btc') + self._10k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_10k_btc') class MetricsTree_Distribution_UtxoCohorts_AmountRange: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._0sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_with_0sats') - self._1sat_to_10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_1sat_under_10sats') - self._10sats_to_100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_10sats_under_100sats') - self._100sats_to_1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_100sats_under_1k_sats') - self._1k_sats_to_10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_1k_sats_under_10k_sats') - self._10k_sats_to_100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_10k_sats_under_100k_sats') - self._100k_sats_to_1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_100k_sats_under_1m_sats') - self._1m_sats_to_10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_1m_sats_under_10m_sats') - self._10m_sats_to_1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_10m_sats_under_1btc') - self._1btc_to_10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_1btc_under_10btc') - self._10btc_to_100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_10btc_under_100btc') - self._100btc_to_1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_100btc_under_1k_btc') - self._1k_btc_to_10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_1k_btc_under_10k_btc') - self._10k_btc_to_100k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_10k_btc_under_100k_btc') - self._100k_btc_or_more: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_above_100k_btc') + self._0sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_with_0sats') + self._1sat_to_10sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_1sat_under_10sats') + self._10sats_to_100sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_10sats_under_100sats') + self._100sats_to_1k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_100sats_under_1k_sats') + self._1k_sats_to_10k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_1k_sats_under_10k_sats') + self._10k_sats_to_100k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_10k_sats_under_100k_sats') + self._100k_sats_to_1m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_100k_sats_under_1m_sats') + self._1m_sats_to_10m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_1m_sats_under_10m_sats') + self._10m_sats_to_1btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_10m_sats_under_1btc') + self._1btc_to_10btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_1btc_under_10btc') + self._10btc_to_100btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_10btc_under_100btc') + self._100btc_to_1k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_100btc_under_1k_btc') + self._1k_btc_to_10k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_1k_btc_under_10k_btc') + self._10k_btc_to_100k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_10k_btc_under_100k_btc') + self._100k_btc_or_more: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_above_100k_btc') class MetricsTree_Distribution_UtxoCohorts_LtAmount: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_10sats') - self._100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_100sats') - self._1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_1k_sats') - self._10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_10k_sats') - self._100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_100k_sats') - self._1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_1m_sats') - self._10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_10m_sats') - self._1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_1btc') - self._10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_10btc') - self._100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_100btc') - self._1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_1k_btc') - self._10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_10k_btc') - self._100k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'utxos_under_100k_btc') + self._10sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_10sats') + self._100sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_100sats') + self._1k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_1k_sats') + self._10k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_10k_sats') + self._100k_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_100k_sats') + self._1m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_1m_sats') + self._10m_sats: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_10m_sats') + self._1btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_1btc') + self._10btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_10btc') + self._100btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_100btc') + self._1k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_1k_btc') + self._10k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_10k_btc') + self._100k_btc: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_under_100k_btc') class MetricsTree_Distribution_UtxoCohorts_Epoch: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._0: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'epoch_0') - self._1: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'epoch_1') - self._2: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'epoch_2') - self._3: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'epoch_3') - self._4: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'epoch_4') + self._0: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'epoch_0') + self._1: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'epoch_1') + self._2: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'epoch_2') + self._3: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'epoch_3') + self._4: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'epoch_4') class MetricsTree_Distribution_UtxoCohorts_Class: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._2009: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2009') - self._2010: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2010') - self._2011: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2011') - self._2012: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2012') - self._2013: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2013') - self._2014: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2014') - self._2015: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2015') - self._2016: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2016') - self._2017: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2017') - self._2018: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2018') - self._2019: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2019') - self._2020: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2020') - self._2021: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2021') - self._2022: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2022') - self._2023: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2023') - self._2024: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2024') - self._2025: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2025') - self._2026: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'class_2026') + self._2009: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2009') + self._2010: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2010') + self._2011: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2011') + self._2012: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2012') + self._2013: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2013') + self._2014: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2014') + self._2015: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2015') + self._2016: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2016') + self._2017: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2017') + self._2018: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2018') + self._2019: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2019') + self._2020: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2020') + self._2021: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2021') + self._2022: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2022') + self._2023: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2023') + self._2024: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2024') + self._2025: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2025') + self._2026: ActivityOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'class_2026') class MetricsTree_Distribution_UtxoCohorts_Type: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.p2pk65: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2pk65') - self.p2pk33: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2pk33') - self.p2pkh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2pkh') - self.p2ms: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2ms') - self.p2sh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2sh') - self.p2wpkh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2wpkh') - self.p2wsh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2wsh') - self.p2tr: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2tr') - self.p2a: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2a') - self.unknown: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'unknown_outputs') - self.empty: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'empty_outputs') + self.p2pk65: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'p2pk65') + self.p2pk33: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'p2pk33') + self.p2pkh: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'p2pkh') + self.p2ms: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'p2ms') + self.p2sh: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'p2sh') + self.p2wpkh: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'p2wpkh') + self.p2wsh: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'p2wsh') + self.p2tr: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'p2tr') + self.p2a: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'p2a') + self.unknown: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'unknown_outputs') + self.empty: OutputsRealizedRelativeSupplyUnrealizedPattern = OutputsRealizedRelativeSupplyUnrealizedPattern(client, 'empty_outputs') class MetricsTree_Distribution_UtxoCohorts: """Metrics tree node.""" @@ -4513,7 +4604,7 @@ class MetricsTree_Distribution_UtxoCohorts: def __init__(self, client: BrkClientBase, base_path: str = ''): self.all: MetricsTree_Distribution_UtxoCohorts_All = MetricsTree_Distribution_UtxoCohorts_All(client) self.sth: MetricsTree_Distribution_UtxoCohorts_Sth = MetricsTree_Distribution_UtxoCohorts_Sth(client) - self.lth: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'lth') + self.lth: MetricsTree_Distribution_UtxoCohorts_Lth = MetricsTree_Distribution_UtxoCohorts_Lth(client) self.age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange = MetricsTree_Distribution_UtxoCohorts_AgeRange(client) self.max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge = MetricsTree_Distribution_UtxoCohorts_MaxAge(client) self.min_age: MetricsTree_Distribution_UtxoCohorts_MinAge = MetricsTree_Distribution_UtxoCohorts_MinAge(client) @@ -4528,57 +4619,57 @@ class MetricsTree_Distribution_AddressCohorts_GeAmount: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1sat: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1sat') - self._10sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10sats') - self._100sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_100sats') - self._1k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1k_sats') - self._10k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10k_sats') - self._100k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_100k_sats') - self._1m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1m_sats') - self._10m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10m_sats') - self._1btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1btc') - self._10btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10btc') - self._100btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_100btc') - self._1k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1k_btc') - self._10k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10k_btc') + self._1sat: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1sat') + self._10sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10sats') + self._100sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_100sats') + self._1k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1k_sats') + self._10k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10k_sats') + self._100k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_100k_sats') + self._1m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1m_sats') + self._10m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10m_sats') + self._1btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1btc') + self._10btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10btc') + self._100btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_100btc') + self._1k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_1k_btc') + self._10k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_over_10k_btc') class MetricsTree_Distribution_AddressCohorts_AmountRange: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._0sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_with_0sats') - self._1sat_to_10sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1sat_under_10sats') - self._10sats_to_100sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10sats_under_100sats') - self._100sats_to_1k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_100sats_under_1k_sats') - self._1k_sats_to_10k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1k_sats_under_10k_sats') - self._10k_sats_to_100k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10k_sats_under_100k_sats') - self._100k_sats_to_1m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_100k_sats_under_1m_sats') - self._1m_sats_to_10m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1m_sats_under_10m_sats') - self._10m_sats_to_1btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10m_sats_under_1btc') - self._1btc_to_10btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1btc_under_10btc') - self._10btc_to_100btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10btc_under_100btc') - self._100btc_to_1k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_100btc_under_1k_btc') - self._1k_btc_to_10k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1k_btc_under_10k_btc') - self._10k_btc_to_100k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10k_btc_under_100k_btc') - self._100k_btc_or_more: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_100k_btc') + self._0sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_with_0sats') + self._1sat_to_10sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1sat_under_10sats') + self._10sats_to_100sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10sats_under_100sats') + self._100sats_to_1k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_100sats_under_1k_sats') + self._1k_sats_to_10k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1k_sats_under_10k_sats') + self._10k_sats_to_100k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10k_sats_under_100k_sats') + self._100k_sats_to_1m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_100k_sats_under_1m_sats') + self._1m_sats_to_10m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1m_sats_under_10m_sats') + self._10m_sats_to_1btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10m_sats_under_1btc') + self._1btc_to_10btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1btc_under_10btc') + self._10btc_to_100btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10btc_under_100btc') + self._100btc_to_1k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_100btc_under_1k_btc') + self._1k_btc_to_10k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_1k_btc_under_10k_btc') + self._10k_btc_to_100k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_10k_btc_under_100k_btc') + self._100k_btc_or_more: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_above_100k_btc') class MetricsTree_Distribution_AddressCohorts_LtAmount: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._10sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10sats') - self._100sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_100sats') - self._1k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_1k_sats') - self._10k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10k_sats') - self._100k_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_100k_sats') - self._1m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_1m_sats') - self._10m_sats: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10m_sats') - self._1btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_1btc') - self._10btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10btc') - self._100btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_100btc') - self._1k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_1k_btc') - self._10k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10k_btc') - self._100k_btc: ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_100k_btc') + self._10sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10sats') + self._100sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_100sats') + self._1k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_1k_sats') + self._10k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10k_sats') + self._100k_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_100k_sats') + self._1m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_1m_sats') + self._10m_sats: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10m_sats') + self._1btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_1btc') + self._10btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10btc') + self._100btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_100btc') + self._1k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_1k_btc') + self._10k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_10k_btc') + self._100k_btc: ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityAddrOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'addrs_under_100k_btc') class MetricsTree_Distribution_AddressCohorts: """Metrics tree node.""" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 535513300..76a06e6b8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.93.1" +channel = "1.94.0"