diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 029451ba9..c872c2efd 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -999,19 +999,20 @@ pub struct AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedS pub investor_cap_raw: MetricPattern20, pub investor_price: SatsUsdPattern, pub investor_price_cents: MetricPattern1, - pub investor_price_extra: RatioPattern, + pub investor_price_extra: RatioPattern2, + pub investor_price_ratio_ext: RatioPattern3, pub loss_value_created: MetricPattern1, pub loss_value_destroyed: MetricPattern1, pub lower_price_band: SatsUsdPattern, pub mvrv: MetricPattern1, - pub neg_realized_loss: CumulativeSumPattern2, - pub net_realized_pnl: CumulativeSumPattern, + pub neg_realized_loss: MetricPattern1, + pub net_realized_pnl: CumulativeHeightPattern, pub net_realized_pnl_7d_ema: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1, - pub net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern, - pub peak_regret: CumulativeSumPattern, + pub net_realized_pnl_rel_to_realized_cap: MetricPattern1, + pub peak_regret: CumulativeHeightPattern, pub peak_regret_rel_to_realized_cap: MetricPattern1, pub profit_flow: MetricPattern1, pub profit_value_created: MetricPattern1, @@ -1020,22 +1021,23 @@ pub struct AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedS pub realized_cap_30d_delta: MetricPattern1, pub realized_cap_cents: MetricPattern1, pub realized_cap_rel_to_own_market_cap: MetricPattern1, - pub realized_loss: CumulativeSumPattern, + pub realized_loss: CumulativeHeightPattern, pub realized_loss_1y: MetricPattern1, pub realized_loss_24h: MetricPattern1, pub realized_loss_30d: MetricPattern1, pub realized_loss_7d: MetricPattern1, pub realized_loss_7d_ema: MetricPattern1, - pub realized_loss_rel_to_realized_cap: CumulativeSumPattern, + pub realized_loss_rel_to_realized_cap: MetricPattern1, pub realized_price: SatsUsdPattern, - pub realized_price_extra: RatioPattern, - pub realized_profit: CumulativeSumPattern, + pub realized_price_extra: RatioPattern2, + pub realized_price_ratio_ext: RatioPattern3, + pub realized_profit: CumulativeHeightPattern, pub realized_profit_1y: MetricPattern1, pub realized_profit_24h: MetricPattern1, pub realized_profit_30d: MetricPattern1, pub realized_profit_7d: MetricPattern1, pub realized_profit_7d_ema: MetricPattern1, - pub realized_profit_rel_to_realized_cap: CumulativeSumPattern, + pub realized_profit_rel_to_realized_cap: MetricPattern1, pub realized_profit_to_loss_ratio_1y: MetricPattern1, pub realized_profit_to_loss_ratio_24h: MetricPattern1, pub realized_profit_to_loss_ratio_30d: MetricPattern1, @@ -1109,19 +1111,20 @@ impl AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSen investor_cap_raw: MetricPattern20::new(client.clone(), _m(&acc, "investor_cap_raw")), investor_price: SatsUsdPattern::new(client.clone(), _m(&acc, "investor_price")), investor_price_cents: MetricPattern1::new(client.clone(), _m(&acc, "investor_price_cents")), - investor_price_extra: RatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_ratio_ext: RatioPattern3::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: SatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), - neg_realized_loss: CumulativeSumPattern2::new(client.clone(), _m(&acc, "neg_realized_loss")), - net_realized_pnl: CumulativeSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), + 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_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_7d_ema")), net_realized_pnl_cumulative_30d_delta: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta")), net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap")), net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap")), - net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), - peak_regret: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), + net_realized_pnl_rel_to_realized_cap: MetricPattern1::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: MetricPattern1::new(client.clone(), _m(&acc, "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")), @@ -1130,22 +1133,23 @@ impl AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSen realized_cap_30d_delta: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_30d_delta")), realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), realized_cap_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_rel_to_own_market_cap")), - realized_loss: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_loss")), + realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), realized_loss_1y: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_1y")), realized_loss_24h: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_24h")), realized_loss_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_30d")), realized_loss_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_7d")), realized_loss_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_7d_ema")), - realized_loss_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), realized_price: SatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: RatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_profit: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit")), + realized_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_ratio_ext: RatioPattern3::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_1y: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_1y")), realized_profit_24h: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_24h")), realized_profit_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_30d")), realized_profit_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_7d")), realized_profit_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_7d_ema")), - realized_profit_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + realized_profit_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), realized_profit_to_loss_ratio_1y: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio_1y")), realized_profit_to_loss_ratio_24h: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio_24h")), realized_profit_to_loss_ratio_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio_30d")), @@ -1224,14 +1228,14 @@ pub struct AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedS pub loss_value_destroyed: MetricPattern1, pub lower_price_band: SatsUsdPattern, pub mvrv: MetricPattern1, - pub neg_realized_loss: CumulativeSumPattern2, - pub net_realized_pnl: CumulativeSumPattern, + pub neg_realized_loss: MetricPattern1, + pub net_realized_pnl: CumulativeHeightPattern, pub net_realized_pnl_7d_ema: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1, - pub net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern, - pub peak_regret: CumulativeSumPattern, + pub net_realized_pnl_rel_to_realized_cap: MetricPattern1, + pub peak_regret: CumulativeHeightPattern, pub peak_regret_rel_to_realized_cap: MetricPattern1, pub profit_flow: MetricPattern1, pub profit_value_created: MetricPattern1, @@ -1239,14 +1243,14 @@ pub struct AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedS pub realized_cap: MetricPattern1, pub realized_cap_30d_delta: MetricPattern1, pub realized_cap_cents: MetricPattern1, - pub realized_loss: CumulativeSumPattern, + pub realized_loss: CumulativeHeightPattern, pub realized_loss_7d_ema: MetricPattern1, - pub realized_loss_rel_to_realized_cap: CumulativeSumPattern, + pub realized_loss_rel_to_realized_cap: MetricPattern1, pub realized_price: SatsUsdPattern, pub realized_price_extra: RatioPattern2, - pub realized_profit: CumulativeSumPattern, + pub realized_profit: CumulativeHeightPattern, pub realized_profit_7d_ema: MetricPattern1, - pub realized_profit_rel_to_realized_cap: CumulativeSumPattern, + pub realized_profit_rel_to_realized_cap: MetricPattern1, pub realized_value: MetricPattern1, pub realized_value_1y: MetricPattern1, pub realized_value_24h: MetricPattern1, @@ -1321,14 +1325,14 @@ impl AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSen loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), lower_price_band: SatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), - neg_realized_loss: CumulativeSumPattern2::new(client.clone(), _m(&acc, "neg_realized_loss")), - net_realized_pnl: CumulativeSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), + 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_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_7d_ema")), net_realized_pnl_cumulative_30d_delta: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta")), net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap")), net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap")), - net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), - peak_regret: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), + net_realized_pnl_rel_to_realized_cap: MetricPattern1::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: MetricPattern1::new(client.clone(), _m(&acc, "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")), @@ -1336,14 +1340,14 @@ impl AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSen realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), realized_cap_30d_delta: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_30d_delta")), realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), - realized_loss: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_loss")), + realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), realized_loss_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_7d_ema")), - realized_loss_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), realized_price: SatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), realized_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_profit: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit")), + realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_7d_ema")), - realized_profit_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + realized_profit_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), realized_value_1y: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_1y")), realized_value_24h: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_24h")), @@ -1394,19 +1398,20 @@ pub struct CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentS pub investor_cap_raw: MetricPattern20, pub investor_price: SatsUsdPattern, pub investor_price_cents: MetricPattern1, - pub investor_price_extra: RatioPattern, + pub investor_price_extra: RatioPattern2, + pub investor_price_ratio_ext: RatioPattern3, pub loss_value_created: MetricPattern1, pub loss_value_destroyed: MetricPattern1, pub lower_price_band: SatsUsdPattern, pub mvrv: MetricPattern1, - pub neg_realized_loss: CumulativeSumPattern2, - pub net_realized_pnl: CumulativeSumPattern, + pub neg_realized_loss: MetricPattern1, + pub net_realized_pnl: CumulativeHeightPattern, pub net_realized_pnl_7d_ema: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1, - pub net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern, - pub peak_regret: CumulativeSumPattern, + pub net_realized_pnl_rel_to_realized_cap: MetricPattern1, + pub peak_regret: CumulativeHeightPattern, pub peak_regret_rel_to_realized_cap: MetricPattern1, pub profit_flow: MetricPattern1, pub profit_value_created: MetricPattern1, @@ -1415,22 +1420,23 @@ pub struct CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentS pub realized_cap_30d_delta: MetricPattern1, pub realized_cap_cents: MetricPattern1, pub realized_cap_rel_to_own_market_cap: MetricPattern1, - pub realized_loss: CumulativeSumPattern, + pub realized_loss: CumulativeHeightPattern, pub realized_loss_1y: MetricPattern1, pub realized_loss_24h: MetricPattern1, pub realized_loss_30d: MetricPattern1, pub realized_loss_7d: MetricPattern1, pub realized_loss_7d_ema: MetricPattern1, - pub realized_loss_rel_to_realized_cap: CumulativeSumPattern, + pub realized_loss_rel_to_realized_cap: MetricPattern1, pub realized_price: SatsUsdPattern, - pub realized_price_extra: RatioPattern, - pub realized_profit: CumulativeSumPattern, + pub realized_price_extra: RatioPattern2, + pub realized_price_ratio_ext: RatioPattern3, + pub realized_profit: CumulativeHeightPattern, pub realized_profit_1y: MetricPattern1, pub realized_profit_24h: MetricPattern1, pub realized_profit_30d: MetricPattern1, pub realized_profit_7d: MetricPattern1, pub realized_profit_7d_ema: MetricPattern1, - pub realized_profit_rel_to_realized_cap: CumulativeSumPattern, + pub realized_profit_rel_to_realized_cap: MetricPattern1, pub realized_profit_to_loss_ratio_1y: MetricPattern1, pub realized_profit_to_loss_ratio_24h: MetricPattern1, pub realized_profit_to_loss_ratio_30d: MetricPattern1, @@ -1485,19 +1491,20 @@ impl CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTot investor_cap_raw: MetricPattern20::new(client.clone(), _m(&acc, "investor_cap_raw")), investor_price: SatsUsdPattern::new(client.clone(), _m(&acc, "investor_price")), investor_price_cents: MetricPattern1::new(client.clone(), _m(&acc, "investor_price_cents")), - investor_price_extra: RatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_ratio_ext: RatioPattern3::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: SatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), - neg_realized_loss: CumulativeSumPattern2::new(client.clone(), _m(&acc, "neg_realized_loss")), - net_realized_pnl: CumulativeSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), + 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_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_7d_ema")), net_realized_pnl_cumulative_30d_delta: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta")), net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap")), net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap")), - net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), - peak_regret: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), + net_realized_pnl_rel_to_realized_cap: MetricPattern1::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: MetricPattern1::new(client.clone(), _m(&acc, "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")), @@ -1506,22 +1513,23 @@ impl CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTot realized_cap_30d_delta: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_30d_delta")), realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), realized_cap_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_rel_to_own_market_cap")), - realized_loss: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_loss")), + realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), realized_loss_1y: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_1y")), realized_loss_24h: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_24h")), realized_loss_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_30d")), realized_loss_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_7d")), realized_loss_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_7d_ema")), - realized_loss_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), realized_price: SatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: RatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_profit: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit")), + realized_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_ratio_ext: RatioPattern3::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_1y: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_1y")), realized_profit_24h: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_24h")), realized_profit_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_30d")), realized_profit_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_7d")), realized_profit_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_7d_ema")), - realized_profit_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + realized_profit_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), realized_profit_to_loss_ratio_1y: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio_1y")), realized_profit_to_loss_ratio_24h: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio_24h")), realized_profit_to_loss_ratio_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio_30d")), @@ -1581,14 +1589,14 @@ pub struct CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentS pub loss_value_destroyed: MetricPattern1, pub lower_price_band: SatsUsdPattern, pub mvrv: MetricPattern1, - pub neg_realized_loss: CumulativeSumPattern2, - pub net_realized_pnl: CumulativeSumPattern, + pub neg_realized_loss: MetricPattern1, + pub net_realized_pnl: CumulativeHeightPattern, pub net_realized_pnl_7d_ema: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1, pub net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1, - pub net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern, - pub peak_regret: CumulativeSumPattern, + pub net_realized_pnl_rel_to_realized_cap: MetricPattern1, + pub peak_regret: CumulativeHeightPattern, pub peak_regret_rel_to_realized_cap: MetricPattern1, pub profit_flow: MetricPattern1, pub profit_value_created: MetricPattern1, @@ -1596,14 +1604,14 @@ pub struct CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentS pub realized_cap: MetricPattern1, pub realized_cap_30d_delta: MetricPattern1, pub realized_cap_cents: MetricPattern1, - pub realized_loss: CumulativeSumPattern, + pub realized_loss: CumulativeHeightPattern, pub realized_loss_7d_ema: MetricPattern1, - pub realized_loss_rel_to_realized_cap: CumulativeSumPattern, + pub realized_loss_rel_to_realized_cap: MetricPattern1, pub realized_price: SatsUsdPattern, pub realized_price_extra: RatioPattern2, - pub realized_profit: CumulativeSumPattern, + pub realized_profit: CumulativeHeightPattern, pub realized_profit_7d_ema: MetricPattern1, - pub realized_profit_rel_to_realized_cap: CumulativeSumPattern, + pub realized_profit_rel_to_realized_cap: MetricPattern1, pub realized_value: MetricPattern1, pub realized_value_1y: MetricPattern1, pub realized_value_24h: MetricPattern1, @@ -1659,14 +1667,14 @@ impl CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTot loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), lower_price_band: SatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), - neg_realized_loss: CumulativeSumPattern2::new(client.clone(), _m(&acc, "neg_realized_loss")), - net_realized_pnl: CumulativeSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), + 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_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_7d_ema")), net_realized_pnl_cumulative_30d_delta: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta")), net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_market_cap")), net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap")), - net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), - peak_regret: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), + net_realized_pnl_rel_to_realized_cap: MetricPattern1::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: MetricPattern1::new(client.clone(), _m(&acc, "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")), @@ -1674,14 +1682,14 @@ impl CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTot realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), realized_cap_30d_delta: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_30d_delta")), realized_cap_cents: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_cents")), - realized_loss: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_loss")), + realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), realized_loss_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_7d_ema")), - realized_loss_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), realized_price: SatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), realized_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_profit: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit")), + realized_profit: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_profit")), realized_profit_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_7d_ema")), - realized_profit_rel_to_realized_cap: CumulativeSumPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + realized_profit_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), realized_value: MetricPattern1::new(client.clone(), _m(&acc, "realized_value")), realized_value_1y: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_1y")), realized_value_24h: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_24h")), @@ -1794,7 +1802,7 @@ impl _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern { } /// Pattern struct for repeated tree structure. -pub struct InvestedNegNetNuplSupplyUnrealizedPattern4 { +pub struct InvestedNegNetNuplSupplyUnrealizedPattern2 { pub invested_capital_in_loss_pct: MetricPattern1, pub invested_capital_in_profit_pct: MetricPattern1, pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, @@ -1818,7 +1826,7 @@ pub struct InvestedNegNetNuplSupplyUnrealizedPattern4 { pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, } -impl InvestedNegNetNuplSupplyUnrealizedPattern4 { +impl InvestedNegNetNuplSupplyUnrealizedPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -1999,6 +2007,54 @@ impl RatioPattern { } } +/// Pattern struct for repeated tree structure. +pub struct RatioPattern3 { + pub ratio_1m_sma: MetricPattern1, + pub ratio_1w_sma: MetricPattern1, + pub ratio_1y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_2y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_4y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_pct1: MetricPattern1, + pub ratio_pct1_usd: SatsUsdPattern, + pub ratio_pct2: MetricPattern1, + pub ratio_pct2_usd: SatsUsdPattern, + pub ratio_pct5: MetricPattern1, + pub ratio_pct5_usd: SatsUsdPattern, + pub ratio_pct95: MetricPattern1, + pub ratio_pct95_usd: SatsUsdPattern, + pub ratio_pct98: MetricPattern1, + pub ratio_pct98_usd: SatsUsdPattern, + pub ratio_pct99: MetricPattern1, + pub ratio_pct99_usd: SatsUsdPattern, + pub ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, +} + +impl RatioPattern3 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + ratio_1m_sma: MetricPattern1::new(client.clone(), _m(&acc, "1m_sma")), + ratio_1w_sma: MetricPattern1::new(client.clone(), _m(&acc, "1w_sma")), + ratio_1y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "1y")), + ratio_2y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "2y")), + ratio_4y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "4y")), + ratio_pct1: MetricPattern1::new(client.clone(), _m(&acc, "pct1")), + ratio_pct1_usd: SatsUsdPattern::new(client.clone(), _m(&acc, "pct1_usd")), + ratio_pct2: MetricPattern1::new(client.clone(), _m(&acc, "pct2")), + ratio_pct2_usd: SatsUsdPattern::new(client.clone(), _m(&acc, "pct2_usd")), + ratio_pct5: MetricPattern1::new(client.clone(), _m(&acc, "pct5")), + ratio_pct5_usd: SatsUsdPattern::new(client.clone(), _m(&acc, "pct5_usd")), + ratio_pct95: MetricPattern1::new(client.clone(), _m(&acc, "pct95")), + ratio_pct95_usd: SatsUsdPattern::new(client.clone(), _m(&acc, "pct95_usd")), + ratio_pct98: MetricPattern1::new(client.clone(), _m(&acc, "pct98")), + ratio_pct98_usd: SatsUsdPattern::new(client.clone(), _m(&acc, "pct98_usd")), + ratio_pct99: MetricPattern1::new(client.clone(), _m(&acc, "pct99")), + ratio_pct99_usd: SatsUsdPattern::new(client.clone(), _m(&acc, "pct99_usd")), + ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern { pub greed_index: MetricPattern1, @@ -2045,6 +2101,52 @@ impl GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern { } } +/// Pattern struct for repeated tree structure. +pub struct Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern { + pub day1: MetricPattern10, + pub day3: MetricPattern11, + pub difficultyepoch: MetricPattern19, + pub halvingepoch: MetricPattern18, + pub hour1: MetricPattern7, + pub hour12: MetricPattern9, + pub hour4: MetricPattern8, + pub minute1: MetricPattern3, + pub minute10: MetricPattern5, + pub minute30: MetricPattern6, + pub minute5: MetricPattern4, + pub month1: MetricPattern13, + pub month3: MetricPattern14, + pub month6: MetricPattern15, + pub week1: MetricPattern12, + pub year1: MetricPattern16, + pub year10: MetricPattern17, +} + +impl Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + day1: MetricPattern10::new(client.clone(), _m(&acc, "day1")), + day3: MetricPattern11::new(client.clone(), _m(&acc, "day3")), + difficultyepoch: MetricPattern19::new(client.clone(), _m(&acc, "difficultyepoch")), + halvingepoch: MetricPattern18::new(client.clone(), _m(&acc, "halvingepoch")), + hour1: MetricPattern7::new(client.clone(), _m(&acc, "hour1")), + hour12: MetricPattern9::new(client.clone(), _m(&acc, "hour12")), + hour4: MetricPattern8::new(client.clone(), _m(&acc, "hour4")), + minute1: MetricPattern3::new(client.clone(), _m(&acc, "minute1")), + minute10: MetricPattern5::new(client.clone(), _m(&acc, "minute10")), + minute30: MetricPattern6::new(client.clone(), _m(&acc, "minute30")), + minute5: MetricPattern4::new(client.clone(), _m(&acc, "minute5")), + month1: MetricPattern13::new(client.clone(), _m(&acc, "month1")), + month3: MetricPattern14::new(client.clone(), _m(&acc, "month3")), + month6: MetricPattern15::new(client.clone(), _m(&acc, "month6")), + week1: MetricPattern12::new(client.clone(), _m(&acc, "week1")), + year1: MetricPattern16::new(client.clone(), _m(&acc, "year1")), + year10: MetricPattern17::new(client.clone(), _m(&acc, "year10")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern { pub greed_index: MetricPattern1, @@ -2091,7 +2193,7 @@ impl GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern { /// Pattern struct for repeated tree structure. pub struct BlocksCoinbaseDaysDominanceFeeSubsidyPattern { - pub blocks_mined: CumulativeSumPattern, + pub blocks_mined: CumulativeHeightRollingPattern, pub blocks_mined_1m_sum: MetricPattern1, pub blocks_mined_1w_sum: MetricPattern1, pub blocks_mined_1y_sum: MetricPattern1, @@ -2104,15 +2206,15 @@ pub struct BlocksCoinbaseDaysDominanceFeeSubsidyPattern { pub dominance_1w: MetricPattern1, pub dominance_1y: MetricPattern1, pub dominance_24h: MetricPattern1, - pub fee: BtcSatsUsdPattern2, - pub subsidy: BtcSatsUsdPattern2, + pub fee: BtcSatsUsdPattern4, + pub subsidy: BtcSatsUsdPattern4, } impl BlocksCoinbaseDaysDominanceFeeSubsidyPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - blocks_mined: CumulativeSumPattern::new(client.clone(), _m(&acc, "blocks_mined")), + blocks_mined: CumulativeHeightRollingPattern::new(client.clone(), _m(&acc, "blocks_mined")), blocks_mined_1m_sum: MetricPattern1::new(client.clone(), _m(&acc, "blocks_mined_1m_sum")), blocks_mined_1w_sum: MetricPattern1::new(client.clone(), _m(&acc, "blocks_mined_1w_sum")), blocks_mined_1y_sum: MetricPattern1::new(client.clone(), _m(&acc, "blocks_mined_1y_sum")), @@ -2125,14 +2227,14 @@ impl BlocksCoinbaseDaysDominanceFeeSubsidyPattern { dominance_1w: MetricPattern1::new(client.clone(), _m(&acc, "dominance_1w")), dominance_1y: MetricPattern1::new(client.clone(), _m(&acc, "dominance_1y")), dominance_24h: MetricPattern1::new(client.clone(), _m(&acc, "dominance_24h")), - fee: BtcSatsUsdPattern2::new(client.clone(), _m(&acc, "fee")), - subsidy: BtcSatsUsdPattern2::new(client.clone(), _m(&acc, "subsidy")), + fee: BtcSatsUsdPattern4::new(client.clone(), _m(&acc, "fee")), + subsidy: BtcSatsUsdPattern4::new(client.clone(), _m(&acc, "subsidy")), } } } /// Pattern struct for repeated tree structure. -pub struct InvestedNegNetNuplSupplyUnrealizedPattern3 { +pub struct InvestedNegNetNuplSupplyUnrealizedPattern4 { pub invested_capital_in_loss_pct: MetricPattern1, pub invested_capital_in_profit_pct: MetricPattern1, pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, @@ -2148,7 +2250,7 @@ pub struct InvestedNegNetNuplSupplyUnrealizedPattern3 { pub unrealized_profit_rel_to_market_cap: MetricPattern1, } -impl InvestedNegNetNuplSupplyUnrealizedPattern3 { +impl InvestedNegNetNuplSupplyUnrealizedPattern4 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2241,42 +2343,6 @@ impl InvestedNegNetNuplSupplyUnrealizedPattern { } } -/// Pattern struct for repeated tree structure. -pub struct InvestedNegNetSupplyUnrealizedPattern { - pub invested_capital_in_loss_pct: MetricPattern1, - pub invested_capital_in_profit_pct: MetricPattern1, - pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1, - pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1, - pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub supply_in_profit_rel_to_own_supply: MetricPattern1, - pub unrealized_loss_rel_to_own_market_cap: MetricPattern1, - pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub unrealized_profit_rel_to_own_market_cap: MetricPattern1, - pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, -} - -impl InvestedNegNetSupplyUnrealizedPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - invested_capital_in_loss_pct: MetricPattern1::new(client.clone(), _m(&acc, "invested_capital_in_loss_pct")), - invested_capital_in_profit_pct: MetricPattern1::new(client.clone(), _m(&acc, "invested_capital_in_profit_pct")), - neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), - neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_total_unrealized_pnl")), - net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), - net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_total_unrealized_pnl")), - supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), - unrealized_loss_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), - unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_total_unrealized_pnl")), - unrealized_profit_rel_to_own_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), - unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_total_unrealized_pnl")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 { pub _10y: MetricPattern1, @@ -2350,69 +2416,67 @@ impl _201520162017201820192020202120222023202420252026Patte } /// Pattern struct for repeated tree structure. -pub struct AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 { - pub average: MetricPattern2, - pub base: MetricPattern20, - pub cumulative: MetricPattern2, - pub max: MetricPattern2, - pub median: MetricPattern2, - pub min: MetricPattern2, - pub pct10: MetricPattern2, - pub pct25: MetricPattern2, - pub pct75: MetricPattern2, - pub pct90: MetricPattern2, - pub sum: MetricPattern2, +pub struct AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern { + pub average: MetricPattern20, + pub cumulative: MetricPattern20, + pub max: MetricPattern20, + pub median: MetricPattern20, + pub min: MetricPattern20, + pub pct10: MetricPattern20, + pub pct25: MetricPattern20, + pub pct75: MetricPattern20, + pub pct90: MetricPattern20, + pub rolling: AverageMaxMedianMinP10P25P75P90SumPattern, + pub sum: MetricPattern20, } -impl AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 { +impl AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: MetricPattern2::new(client.clone(), _m(&acc, "average")), - base: MetricPattern20::new(client.clone(), acc.clone()), - cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), - max: MetricPattern2::new(client.clone(), _m(&acc, "max")), - median: MetricPattern2::new(client.clone(), _m(&acc, "median")), - min: MetricPattern2::new(client.clone(), _m(&acc, "min")), - pct10: MetricPattern2::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern2::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern2::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern2::new(client.clone(), _m(&acc, "pct90")), - sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), + average: MetricPattern20::new(client.clone(), _m(&acc, "average")), + cumulative: MetricPattern20::new(client.clone(), _m(&acc, "cumulative")), + max: MetricPattern20::new(client.clone(), _m(&acc, "max")), + median: MetricPattern20::new(client.clone(), _m(&acc, "median")), + min: MetricPattern20::new(client.clone(), _m(&acc, "min")), + pct10: MetricPattern20::new(client.clone(), _m(&acc, "pct10")), + pct25: MetricPattern20::new(client.clone(), _m(&acc, "pct25")), + pct75: MetricPattern20::new(client.clone(), _m(&acc, "pct75")), + pct90: MetricPattern20::new(client.clone(), _m(&acc, "pct90")), + rolling: AverageMaxMedianMinP10P25P75P90SumPattern::new(client.clone(), acc.clone()), + sum: MetricPattern20::new(client.clone(), _m(&acc, "sum")), } } } /// Pattern struct for repeated tree structure. -pub struct AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern { - pub average: MetricPattern2, - pub base: MetricPattern20, - pub cumulative: MetricPattern1, - pub max: MetricPattern2, - pub median: MetricPattern2, - pub min: MetricPattern2, - pub pct10: MetricPattern2, - pub pct25: MetricPattern2, - pub pct75: MetricPattern2, - pub pct90: MetricPattern2, - pub sum: MetricPattern2, +pub struct AverageCumulativeMaxMedianMinP10P25P75P90SumPattern { + pub average: _1y24h30d7dPattern, + pub cumulative: MetricPattern1, + pub max: _1y24h30d7dPattern, + pub median: _1y24h30d7dPattern, + pub min: _1y24h30d7dPattern, + pub p10: _1y24h30d7dPattern, + pub p25: _1y24h30d7dPattern, + pub p75: _1y24h30d7dPattern, + pub p90: _1y24h30d7dPattern, + pub sum: _1y24h30d7dPattern, } -impl AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern { +impl AverageCumulativeMaxMedianMinP10P25P75P90SumPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: MetricPattern2::new(client.clone(), _m(&acc, "average")), - base: MetricPattern20::new(client.clone(), acc.clone()), + average: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "average")), cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), - max: MetricPattern2::new(client.clone(), _m(&acc, "max")), - median: MetricPattern2::new(client.clone(), _m(&acc, "median")), - min: MetricPattern2::new(client.clone(), _m(&acc, "min")), - pct10: MetricPattern2::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern2::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern2::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern2::new(client.clone(), _m(&acc, "pct90")), - sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), + max: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "max")), + median: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "median")), + min: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "min")), + p10: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p10")), + p25: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p25")), + p75: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p75")), + p90: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p90")), + sum: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "sum")), } } } @@ -2423,7 +2487,7 @@ pub struct AverageGainsLossesRsiStochPattern { pub average_loss: MetricPattern1, pub gains: MetricPattern1, pub losses: MetricPattern1, - pub rsi: MetricPattern20, + pub rsi: MetricPattern1, pub rsi_max: MetricPattern1, pub rsi_min: MetricPattern1, pub stoch_rsi: MetricPattern1, @@ -2439,7 +2503,7 @@ impl AverageGainsLossesRsiStochPattern { average_loss: MetricPattern1::new(client.clone(), _m(&acc, "avg_loss_1y")), gains: MetricPattern1::new(client.clone(), _m(&acc, "gains_1y")), losses: MetricPattern1::new(client.clone(), _m(&acc, "losses_1y")), - rsi: MetricPattern20::new(client.clone(), _m(&acc, "1y")), + rsi: MetricPattern1::new(client.clone(), _m(&acc, "1y")), rsi_max: MetricPattern1::new(client.clone(), _m(&acc, "rsi_max_1y")), rsi_min: MetricPattern1::new(client.clone(), _m(&acc, "rsi_min_1y")), stoch_rsi: MetricPattern1::new(client.clone(), _m(&acc, "stoch_rsi_1y")), @@ -2449,38 +2513,6 @@ impl AverageGainsLossesRsiStochPattern { } } -/// Pattern struct for repeated tree structure. -pub struct AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 { - pub average: MetricPattern1, - pub cumulative: MetricPattern1, - pub max: MetricPattern1, - pub median: MetricPattern1, - pub min: MetricPattern1, - pub pct10: MetricPattern1, - pub pct25: MetricPattern1, - pub pct75: MetricPattern1, - pub pct90: MetricPattern1, - pub sum: MetricPattern1, -} - -impl AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - average: MetricPattern1::new(client.clone(), _m(&acc, "average")), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), - max: MetricPattern1::new(client.clone(), _m(&acc, "max")), - median: MetricPattern1::new(client.clone(), _m(&acc, "median")), - min: MetricPattern1::new(client.clone(), _m(&acc, "min")), - pct10: MetricPattern1::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern1::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern1::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern1::new(client.clone(), _m(&acc, "pct90")), - sum: MetricPattern1::new(client.clone(), _m(&acc, "sum")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern { pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, @@ -2542,61 +2574,89 @@ impl AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern { } /// Pattern struct for repeated tree structure. -pub struct AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern { - pub average: MetricPattern2, - pub base: MetricPattern20, - pub max: MetricPattern2, - pub median: MetricPattern2, - pub min: MetricPattern2, - pub pct10: MetricPattern2, - pub pct25: MetricPattern2, - pub pct75: MetricPattern2, - pub pct90: MetricPattern2, +pub struct AverageMaxMedianMinP10P25P75P90SumPattern { + pub average: _1y24h30d7dPattern, + pub max: _1y24h30d7dPattern, + pub median: _1y24h30d7dPattern, + pub min: _1y24h30d7dPattern, + pub p10: _1y24h30d7dPattern, + pub p25: _1y24h30d7dPattern, + pub p75: _1y24h30d7dPattern, + pub p90: _1y24h30d7dPattern, + pub sum: _1y24h30d7dPattern, } -impl AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern { +impl AverageMaxMedianMinP10P25P75P90SumPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: MetricPattern2::new(client.clone(), _m(&acc, "average")), - base: MetricPattern20::new(client.clone(), acc.clone()), - max: MetricPattern2::new(client.clone(), _m(&acc, "max")), - median: MetricPattern2::new(client.clone(), _m(&acc, "median")), - min: MetricPattern2::new(client.clone(), _m(&acc, "min")), - pct10: MetricPattern2::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern2::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern2::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern2::new(client.clone(), _m(&acc, "pct90")), + average: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "average")), + max: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "max")), + median: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "median")), + min: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "min")), + p10: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p10")), + p25: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p25")), + p75: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p75")), + p90: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p90")), + sum: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "sum")), } } } /// Pattern struct for repeated tree structure. -pub struct AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern { - pub average: MetricPattern1, - pub max: MetricPattern1, - pub median: MetricPattern1, - pub min: MetricPattern1, - pub pct10: MetricPattern1, - pub pct25: MetricPattern1, - pub pct75: MetricPattern1, - pub pct90: MetricPattern1, - pub txindex: MetricPattern21, +pub struct AverageHeightMaxMedianMinP10P25P75P90Pattern { + pub average: _1y24h30d7dPattern, + pub height: MetricPattern20, + pub max: _1y24h30d7dPattern, + pub median: _1y24h30d7dPattern, + pub min: _1y24h30d7dPattern, + pub p10: _1y24h30d7dPattern, + pub p25: _1y24h30d7dPattern, + pub p75: _1y24h30d7dPattern, + pub p90: _1y24h30d7dPattern, } -impl AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern { +impl AverageHeightMaxMedianMinP10P25P75P90Pattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: MetricPattern1::new(client.clone(), _m(&acc, "average")), - max: MetricPattern1::new(client.clone(), _m(&acc, "max")), - median: MetricPattern1::new(client.clone(), _m(&acc, "median")), - min: MetricPattern1::new(client.clone(), _m(&acc, "min")), - pct10: MetricPattern1::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern1::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern1::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern1::new(client.clone(), _m(&acc, "pct90")), - txindex: MetricPattern21::new(client.clone(), acc.clone()), + average: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "average")), + height: MetricPattern20::new(client.clone(), acc.clone()), + max: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "max")), + median: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "median")), + min: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "min")), + p10: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p10")), + p25: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p25")), + p75: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p75")), + p90: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p90")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern { + pub average: MetricPattern20, + pub max: MetricPattern20, + pub median: MetricPattern20, + pub min: MetricPattern20, + pub pct10: MetricPattern20, + pub pct25: MetricPattern20, + pub pct75: MetricPattern20, + pub pct90: MetricPattern20, +} + +impl AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + average: MetricPattern20::new(client.clone(), _m(&acc, "average")), + max: MetricPattern20::new(client.clone(), _m(&acc, "max")), + median: MetricPattern20::new(client.clone(), _m(&acc, "median")), + min: MetricPattern20::new(client.clone(), _m(&acc, "min")), + pct10: MetricPattern20::new(client.clone(), _m(&acc, "pct10")), + pct25: MetricPattern20::new(client.clone(), _m(&acc, "pct25")), + pct75: MetricPattern20::new(client.clone(), _m(&acc, "pct75")), + pct90: MetricPattern20::new(client.clone(), _m(&acc, "pct90")), } } } @@ -2633,7 +2693,7 @@ pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern { pub cost_basis: InvestedMaxMinPercentilesSpotPattern, pub outputs: UtxoPattern, pub realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2, - pub relative: InvestedNegNetSupplyUnrealizedPattern, + pub relative: InvestedNegNetNuplSupplyUnrealizedPattern2, pub supply: _30dHalvedTotalPattern, pub unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern, } @@ -2646,33 +2706,7 @@ impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern { cost_basis: InvestedMaxMinPercentilesSpotPattern::new(client.clone(), acc.clone()), outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2::new(client.clone(), acc.clone()), - relative: InvestedNegNetSupplyUnrealizedPattern::new(client.clone(), acc.clone()), - supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), - unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 { - pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, - pub cost_basis: MaxMinPattern, - pub outputs: UtxoPattern, - pub realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2, - pub relative: InvestedNegNetNuplSupplyUnrealizedPattern3, - pub supply: _30dHalvedTotalPattern, - pub unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern, -} - -impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), acc.clone()), - cost_basis: MaxMinPattern::new(client.clone(), acc.clone()), - outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2::new(client.clone(), acc.clone()), - relative: InvestedNegNetNuplSupplyUnrealizedPattern3::new(client.clone(), acc.clone()), + relative: InvestedNegNetNuplSupplyUnrealizedPattern2::new(client.clone(), acc.clone()), supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), } @@ -2681,6 +2715,32 @@ impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 { /// Pattern struct for repeated tree structure. pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { + pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, + pub cost_basis: MaxMinPattern, + pub outputs: UtxoPattern, + pub realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2, + pub relative: InvestedNegNetNuplSupplyUnrealizedPattern4, + pub supply: _30dHalvedTotalPattern, + pub unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern, +} + +impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), acc.clone()), + cost_basis: MaxMinPattern::new(client.clone(), acc.clone()), + outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), + realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2::new(client.clone(), acc.clone()), + relative: InvestedNegNetNuplSupplyUnrealizedPattern4::new(client.clone(), acc.clone()), + supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), + unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 { pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, pub cost_basis: MaxMinPattern, pub outputs: UtxoPattern, @@ -2690,7 +2750,7 @@ pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { pub unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern, } -impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { +impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2706,17 +2766,17 @@ impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { } /// Pattern struct for repeated tree structure. -pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 { +pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 { pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, pub cost_basis: MaxMinPattern, pub outputs: UtxoPattern, pub realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, - pub relative: InvestedNegNetNuplSupplyUnrealizedPattern3, + pub relative: InvestedNegNetNuplSupplyUnrealizedPattern4, pub supply: _30dHalvedTotalPattern, pub unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern, } -impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 { +impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2724,91 +2784,41 @@ impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 { cost_basis: MaxMinPattern::new(client.clone(), acc.clone()), outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern::new(client.clone(), acc.clone()), - relative: InvestedNegNetNuplSupplyUnrealizedPattern3::new(client.clone(), acc.clone()), + relative: InvestedNegNetNuplSupplyUnrealizedPattern4::new(client.clone(), acc.clone()), supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), } } } -/// Pattern struct for repeated tree structure. -pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 { - pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, - pub cost_basis: MaxMinPattern, - pub outputs: UtxoPattern, - pub realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, - pub relative: InvestedSupplyPattern, - pub supply: _30dHalvedTotalPattern, - pub unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern, -} - -impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), acc.clone()), - cost_basis: MaxMinPattern::new(client.clone(), acc.clone()), - outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern::new(client.clone(), acc.clone()), - relative: InvestedSupplyPattern::new(client.clone(), acc.clone()), - supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), - unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct ActivityCostOutputsRealizedSupplyUnrealizedPattern { - pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, - pub cost_basis: MaxMinPattern, - pub outputs: UtxoPattern, - pub realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, - pub supply: _30dHalvedTotalPattern, - pub unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern, -} - -impl ActivityCostOutputsRealizedSupplyUnrealizedPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), acc.clone()), - cost_basis: MaxMinPattern::new(client.clone(), acc.clone()), - outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern::new(client.clone(), acc.clone()), - supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), - unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct BalanceBothReactivatedReceivingSendingPattern { - pub balance_decreased: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub balance_increased: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub both: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub reactivated: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub receiving: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub sending: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub balance_decreased: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub balance_increased: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub both: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub reactivated: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub receiving: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub sending: AverageHeightMaxMedianMinP10P25P75P90Pattern, } impl BalanceBothReactivatedReceivingSendingPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - balance_decreased: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), _m(&acc, "balance_decreased")), - balance_increased: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), _m(&acc, "balance_increased")), - both: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), _m(&acc, "both")), - reactivated: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), _m(&acc, "reactivated")), - receiving: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), _m(&acc, "receiving")), - sending: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), _m(&acc, "sending")), + balance_decreased: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), _m(&acc, "balance_decreased")), + balance_increased: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), _m(&acc, "balance_increased")), + both: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), _m(&acc, "both")), + reactivated: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), _m(&acc, "reactivated")), + receiving: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), _m(&acc, "receiving")), + sending: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), _m(&acc, "sending")), } } } /// Pattern struct for repeated tree structure. pub struct CoinblocksCoindaysSatblocksSatdaysSentPattern { - pub coinblocks_destroyed: CumulativeSumPattern, - pub coindays_destroyed: CumulativeSumPattern, + pub coinblocks_destroyed: CumulativeHeightRollingPattern, + pub coindays_destroyed: CumulativeHeightRollingPattern, pub satblocks_destroyed: MetricPattern20, pub satdays_destroyed: MetricPattern20, pub sent: BtcSatsUsdPattern2, @@ -2819,8 +2829,8 @@ impl CoinblocksCoindaysSatblocksSatdaysSentPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - coinblocks_destroyed: CumulativeSumPattern::new(client.clone(), _m(&acc, "coinblocks_destroyed")), - coindays_destroyed: CumulativeSumPattern::new(client.clone(), _m(&acc, "coindays_destroyed")), + coinblocks_destroyed: CumulativeHeightRollingPattern::new(client.clone(), _m(&acc, "coinblocks_destroyed")), + coindays_destroyed: CumulativeHeightRollingPattern::new(client.clone(), _m(&acc, "coindays_destroyed")), satblocks_destroyed: MetricPattern20::new(client.clone(), _m(&acc, "satblocks_destroyed")), satdays_destroyed: MetricPattern20::new(client.clone(), _m(&acc, "satdays_destroyed")), sent: BtcSatsUsdPattern2::new(client.clone(), _m(&acc, "sent")), @@ -2854,41 +2864,103 @@ impl InvestedMaxMinPercentilesSpotPattern { } /// Pattern struct for repeated tree structure. -pub struct InvestedSupplyPattern { - pub invested_capital_in_loss_pct: MetricPattern1, - pub invested_capital_in_profit_pct: MetricPattern1, - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub supply_in_profit_rel_to_own_supply: MetricPattern1, +pub struct CloseHighLowOpenPricePattern { + pub close: MetricPattern2, + pub high: Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern, + pub low: Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern, + pub open: Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern, + pub price: MetricPattern20, } -impl InvestedSupplyPattern { +impl CloseHighLowOpenPricePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - invested_capital_in_loss_pct: MetricPattern1::new(client.clone(), _m(&acc, "invested_capital_in_loss_pct")), - invested_capital_in_profit_pct: MetricPattern1::new(client.clone(), _m(&acc, "invested_capital_in_profit_pct")), - supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), + close: MetricPattern2::new(client.clone(), _m(&acc, "close")), + high: Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern::new(client.clone(), _m(&acc, "high")), + low: Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern::new(client.clone(), _m(&acc, "low")), + open: Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern::new(client.clone(), _m(&acc, "open")), + price: MetricPattern20::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. -pub struct CloseHighLowOpenPattern { - pub close: MetricPattern2, - pub high: MetricPattern2, - pub low: MetricPattern2, - pub open: MetricPattern2, +pub struct _1y24h30d7dPattern2 { + pub _1y: BtcSatsUsdPattern, + pub _24h: BtcSatsUsdPattern, + pub _30d: BtcSatsUsdPattern, + pub _7d: BtcSatsUsdPattern, } -impl CloseHighLowOpenPattern { +impl _1y24h30d7dPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - close: MetricPattern2::new(client.clone(), _m(&acc, "close")), - high: MetricPattern2::new(client.clone(), _m(&acc, "high")), - low: MetricPattern2::new(client.clone(), _m(&acc, "low")), - open: MetricPattern2::new(client.clone(), _m(&acc, "open")), + _1y: BtcSatsUsdPattern::new(client.clone(), _m(&acc, "1y")), + _24h: BtcSatsUsdPattern::new(client.clone(), _m(&acc, "24h")), + _30d: BtcSatsUsdPattern::new(client.clone(), _m(&acc, "30d")), + _7d: BtcSatsUsdPattern::new(client.clone(), _m(&acc, "7d")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct BtcRollingSatsUsdPattern { + pub btc: MetricPattern20, + pub rolling: _1y24h30d7dPattern2, + pub sats: MetricPattern20, + pub usd: MetricPattern20, +} + +impl BtcRollingSatsUsdPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + btc: MetricPattern20::new(client.clone(), _m(&acc, "btc")), + rolling: _1y24h30d7dPattern2::new(client.clone(), acc.clone()), + sats: MetricPattern20::new(client.clone(), acc.clone()), + usd: MetricPattern20::new(client.clone(), _m(&acc, "usd")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _1h24hBlockTxindexPattern { + pub _1h: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub _24h: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub block: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub txindex: MetricPattern21, +} + +impl _1h24hBlockTxindexPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _1h: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), _m(&acc, "1h")), + _24h: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), _m(&acc, "24h")), + block: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), acc.clone()), + txindex: MetricPattern21::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _1y24h30d7dPattern { + pub _1y: MetricPattern1, + pub _24h: MetricPattern1, + pub _30d: MetricPattern1, + pub _7d: MetricPattern1, +} + +impl _1y24h30d7dPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _1y: MetricPattern1::new(client.clone(), _m(&acc, "1y")), + _24h: MetricPattern1::new(client.clone(), _m(&acc, "24h")), + _30d: MetricPattern1::new(client.clone(), _m(&acc, "30d")), + _7d: MetricPattern1::new(client.clone(), _m(&acc, "7d")), } } } @@ -2912,37 +2984,55 @@ impl _30dHalvedTotalPattern { } /// Pattern struct for repeated tree structure. -pub struct BaseCumulativeSumPattern { - pub base: MetricPattern20, - pub cumulative: MetricPattern2, - pub sum: MetricPattern2, +pub struct BtcSatsUsdPattern2 { + pub btc: MetricPattern1, + pub sats: CumulativeHeightPattern, + pub usd: MetricPattern1, } -impl BaseCumulativeSumPattern { +impl BtcSatsUsdPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - base: MetricPattern20::new(client.clone(), acc.clone()), - cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), - sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")), + btc: MetricPattern1::new(client.clone(), _m(&acc, "btc")), + sats: CumulativeHeightPattern::new(client.clone(), acc.clone()), + usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct BtcSatsUsdPattern4 { + pub btc: MetricPattern1, + pub sats: CumulativeHeightRollingPattern, + pub usd: CumulativeHeightRollingPattern, +} + +impl BtcSatsUsdPattern4 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + btc: MetricPattern1::new(client.clone(), _m(&acc, "btc")), + sats: CumulativeHeightRollingPattern::new(client.clone(), acc.clone()), + usd: CumulativeHeightRollingPattern::new(client.clone(), _m(&acc, "usd")), } } } /// Pattern struct for repeated tree structure. pub struct BtcSatsUsdPattern3 { - pub btc: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, - pub sats: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub usd: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, + pub btc: MetricPattern1, + pub sats: CumulativeHeightRollingPattern2, + pub usd: CumulativeHeightRollingPattern2, } impl BtcSatsUsdPattern3 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - btc: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), _m(&acc, "btc")), - sats: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), acc.clone()), - usd: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), _m(&acc, "usd")), + btc: MetricPattern1::new(client.clone(), _m(&acc, "btc")), + sats: CumulativeHeightRollingPattern2::new(client.clone(), acc.clone()), + usd: CumulativeHeightRollingPattern2::new(client.clone(), _m(&acc, "usd")), } } } @@ -2965,45 +3055,9 @@ impl BtcSatsUsdPattern { } } -/// Pattern struct for repeated tree structure. -pub struct BtcSatsUsdPattern4 { - pub btc: CumulativeSumPattern, - pub sats: CumulativeSumPattern, - pub usd: CumulativeSumPattern, -} - -impl BtcSatsUsdPattern4 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - btc: CumulativeSumPattern::new(client.clone(), _m(&acc, "btc")), - sats: CumulativeSumPattern::new(client.clone(), acc.clone()), - usd: CumulativeSumPattern::new(client.clone(), _m(&acc, "usd")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct BtcSatsUsdPattern2 { - pub btc: CumulativeSumPattern2, - pub sats: CumulativeSumPattern, - pub usd: CumulativeSumPattern, -} - -impl BtcSatsUsdPattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - btc: CumulativeSumPattern2::new(client.clone(), _m(&acc, "btc")), - sats: CumulativeSumPattern::new(client.clone(), acc.clone()), - usd: CumulativeSumPattern::new(client.clone(), _m(&acc, "usd")), - } - } -} - /// Pattern struct for repeated tree structure. pub struct HistogramLineSignalPattern { - pub histogram: MetricPattern20, + pub histogram: MetricPattern1, pub line: MetricPattern1, pub signal: MetricPattern1, } @@ -3012,13 +3066,49 @@ impl HistogramLineSignalPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - histogram: MetricPattern20::new(client.clone(), _m(&acc, "histogram_1y")), + histogram: MetricPattern1::new(client.clone(), _m(&acc, "histogram_1y")), line: MetricPattern1::new(client.clone(), _m(&acc, "line_1y")), signal: MetricPattern1::new(client.clone(), _m(&acc, "signal_1y")), } } } +/// Pattern struct for repeated tree structure. +pub struct CumulativeHeightRollingPattern2 { + pub cumulative: MetricPattern1, + pub height: MetricPattern20, + pub rolling: AverageMaxMedianMinP10P25P75P90SumPattern, +} + +impl CumulativeHeightRollingPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + height: MetricPattern20::new(client.clone(), acc.clone()), + rolling: AverageMaxMedianMinP10P25P75P90SumPattern::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct CumulativeHeightRollingPattern { + pub cumulative: MetricPattern1, + pub height: MetricPattern20, + pub rolling: _1y24h30d7dPattern, +} + +impl CumulativeHeightRollingPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + height: MetricPattern20::new(client.clone(), acc.clone()), + rolling: _1y24h30d7dPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _30dCountPattern { pub _30d_change: MetricPattern1, @@ -3035,6 +3125,22 @@ impl _30dCountPattern { } } +/// Pattern struct for repeated tree structure. +pub struct BaseRestPattern { + pub base: MetricPattern20, + pub rest: AverageCumulativeMaxMedianMinP10P25P75P90SumPattern, +} + +impl BaseRestPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + base: MetricPattern20::new(client.clone(), acc.clone()), + rest: AverageCumulativeMaxMedianMinP10P25P75P90SumPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct MaxMinPattern { pub max: SatsUsdPattern, @@ -3100,33 +3206,17 @@ impl UtxoPattern { } /// Pattern struct for repeated tree structure. -pub struct CumulativeSumPattern2 { - pub cumulative: MetricPattern2, - pub sum: MetricPattern1, -} - -impl CumulativeSumPattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")), - sum: MetricPattern1::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct CumulativeSumPattern { +pub struct CumulativeHeightPattern { pub cumulative: MetricPattern1, - pub sum: MetricPattern1, + pub height: MetricPattern20, } -impl CumulativeSumPattern { +impl CumulativeHeightPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), - sum: MetricPattern1::new(client.clone(), acc.clone()), + height: MetricPattern20::new(client.clone(), acc.clone()), } } } @@ -3196,13 +3286,13 @@ pub struct MetricsTree_Blocks { pub difficulty: MetricsTree_Blocks_Difficulty, pub time: MetricsTree_Blocks_Time, pub total_size: MetricPattern20, - pub weight: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, + pub weight: MetricsTree_Blocks_Weight, pub count: MetricsTree_Blocks_Count, - pub interval: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub interval: AverageHeightMaxMedianMinP10P25P75P90Pattern, pub halving: MetricsTree_Blocks_Halving, - pub vbytes: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub size: MetricsTree_Blocks_Size, - pub fullness: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub vbytes: CumulativeHeightRollingPattern2, + pub size: AverageCumulativeMaxMedianMinP10P25P75P90SumPattern, + pub fullness: AverageHeightMaxMedianMinP10P25P75P90Pattern, } impl MetricsTree_Blocks { @@ -3212,13 +3302,13 @@ impl MetricsTree_Blocks { difficulty: MetricsTree_Blocks_Difficulty::new(client.clone(), format!("{base_path}_difficulty")), time: MetricsTree_Blocks_Time::new(client.clone(), format!("{base_path}_time")), total_size: MetricPattern20::new(client.clone(), "total_size".to_string()), - weight: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "block_weight".to_string()), + weight: MetricsTree_Blocks_Weight::new(client.clone(), format!("{base_path}_weight")), count: MetricsTree_Blocks_Count::new(client.clone(), format!("{base_path}_count")), - interval: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "block_interval".to_string()), + interval: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "block_interval".to_string()), halving: MetricsTree_Blocks_Halving::new(client.clone(), format!("{base_path}_halving")), - vbytes: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "block_vbytes".to_string()), - size: MetricsTree_Blocks_Size::new(client.clone(), format!("{base_path}_size")), - fullness: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "block_fullness".to_string()), + vbytes: CumulativeHeightRollingPattern2::new(client.clone(), "block_vbytes".to_string()), + size: AverageCumulativeMaxMedianMinP10P25P75P90SumPattern::new(client.clone(), "block_size".to_string()), + fullness: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "block_fullness".to_string()), } } } @@ -3248,7 +3338,7 @@ impl MetricsTree_Blocks_Difficulty { /// Metrics tree node. pub struct MetricsTree_Blocks_Time { - pub timestamp: MetricPattern1, + pub timestamp: MetricsTree_Blocks_Time_Timestamp, pub date: MetricPattern20, pub timestamp_monotonic: MetricPattern20, } @@ -3256,17 +3346,99 @@ pub struct MetricsTree_Blocks_Time { impl MetricsTree_Blocks_Time { pub fn new(client: Arc, base_path: String) -> Self { Self { - timestamp: MetricPattern1::new(client.clone(), "timestamp".to_string()), + timestamp: MetricsTree_Blocks_Time_Timestamp::new(client.clone(), format!("{base_path}_timestamp")), date: MetricPattern20::new(client.clone(), "date".to_string()), timestamp_monotonic: MetricPattern20::new(client.clone(), "timestamp_monotonic".to_string()), } } } +/// Metrics tree node. +pub struct MetricsTree_Blocks_Time_Timestamp { + pub base: MetricPattern20, + pub minute1: MetricPattern3, + pub minute5: MetricPattern4, + pub minute10: MetricPattern5, + pub minute30: MetricPattern6, + pub hour1: MetricPattern7, + pub hour4: MetricPattern8, + pub hour12: MetricPattern9, + pub day1: MetricPattern10, + pub day3: MetricPattern11, + pub week1: MetricPattern12, + pub month1: MetricPattern13, + pub month3: MetricPattern14, + pub month6: MetricPattern15, + pub year1: MetricPattern16, + pub year10: MetricPattern17, + pub halvingepoch: MetricPattern18, + pub difficultyepoch: MetricPattern19, +} + +impl MetricsTree_Blocks_Time_Timestamp { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + base: MetricPattern20::new(client.clone(), "timestamp".to_string()), + minute1: MetricPattern3::new(client.clone(), "timestamp_minute1".to_string()), + minute5: MetricPattern4::new(client.clone(), "timestamp_minute5".to_string()), + minute10: MetricPattern5::new(client.clone(), "timestamp_minute10".to_string()), + minute30: MetricPattern6::new(client.clone(), "timestamp_minute30".to_string()), + hour1: MetricPattern7::new(client.clone(), "timestamp_hour1".to_string()), + hour4: MetricPattern8::new(client.clone(), "timestamp_hour4".to_string()), + hour12: MetricPattern9::new(client.clone(), "timestamp_hour12".to_string()), + day1: MetricPattern10::new(client.clone(), "timestamp_day1".to_string()), + day3: MetricPattern11::new(client.clone(), "timestamp_day3".to_string()), + week1: MetricPattern12::new(client.clone(), "timestamp_week1".to_string()), + month1: MetricPattern13::new(client.clone(), "timestamp_month1".to_string()), + month3: MetricPattern14::new(client.clone(), "timestamp_month3".to_string()), + month6: MetricPattern15::new(client.clone(), "timestamp_month6".to_string()), + year1: MetricPattern16::new(client.clone(), "timestamp_year1".to_string()), + year10: MetricPattern17::new(client.clone(), "timestamp_year10".to_string()), + halvingepoch: MetricPattern18::new(client.clone(), "timestamp_halvingepoch".to_string()), + difficultyepoch: MetricPattern19::new(client.clone(), "timestamp_difficultyepoch".to_string()), + } + } +} + +/// Metrics tree node. +pub struct MetricsTree_Blocks_Weight { + pub base: MetricPattern20, + pub cumulative: MetricPattern1, + pub sum: _1y24h30d7dPattern, + pub average: _1y24h30d7dPattern, + pub min: _1y24h30d7dPattern, + pub max: _1y24h30d7dPattern, + pub p10: _1y24h30d7dPattern, + pub p25: _1y24h30d7dPattern, + pub median: _1y24h30d7dPattern, + pub p75: _1y24h30d7dPattern, + pub p90: _1y24h30d7dPattern, +} + +impl MetricsTree_Blocks_Weight { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + base: MetricPattern20::new(client.clone(), "block_weight".to_string()), + cumulative: MetricPattern1::new(client.clone(), "block_weight_cumulative".to_string()), + sum: _1y24h30d7dPattern::new(client.clone(), "block_weight_sum".to_string()), + average: _1y24h30d7dPattern::new(client.clone(), "block_weight_average".to_string()), + min: _1y24h30d7dPattern::new(client.clone(), "block_weight_min".to_string()), + max: _1y24h30d7dPattern::new(client.clone(), "block_weight_max".to_string()), + p10: _1y24h30d7dPattern::new(client.clone(), "block_weight_p10".to_string()), + p25: _1y24h30d7dPattern::new(client.clone(), "block_weight_p25".to_string()), + median: _1y24h30d7dPattern::new(client.clone(), "block_weight_median".to_string()), + p75: _1y24h30d7dPattern::new(client.clone(), "block_weight_p75".to_string()), + p90: _1y24h30d7dPattern::new(client.clone(), "block_weight_p90".to_string()), + } + } +} + /// Metrics tree node. pub struct MetricsTree_Blocks_Count { pub block_count_target: MetricPattern1, - pub block_count: CumulativeSumPattern, + pub block_count: CumulativeHeightRollingPattern, + pub block_count_sum: _1y24h30d7dPattern, + pub height_1h_ago: MetricPattern20, pub height_24h_ago: MetricPattern20, pub height_3d_ago: MetricPattern20, pub height_1w_ago: MetricPattern20, @@ -3297,17 +3469,15 @@ pub struct MetricsTree_Blocks_Count { pub height_6y_ago: MetricPattern20, pub height_8y_ago: MetricPattern20, pub height_10y_ago: MetricPattern20, - pub block_count_24h_sum: MetricPattern1, - pub block_count_1w_sum: MetricPattern1, - pub block_count_1m_sum: MetricPattern1, - pub block_count_1y_sum: MetricPattern1, } impl MetricsTree_Blocks_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { block_count_target: MetricPattern1::new(client.clone(), "block_count_target".to_string()), - block_count: CumulativeSumPattern::new(client.clone(), "block_count".to_string()), + block_count: CumulativeHeightRollingPattern::new(client.clone(), "block_count".to_string()), + block_count_sum: _1y24h30d7dPattern::new(client.clone(), "block_count_sum".to_string()), + height_1h_ago: MetricPattern20::new(client.clone(), "height_1h_ago".to_string()), height_24h_ago: MetricPattern20::new(client.clone(), "height_24h_ago".to_string()), height_3d_ago: MetricPattern20::new(client.clone(), "height_3d_ago".to_string()), height_1w_ago: MetricPattern20::new(client.clone(), "height_1w_ago".to_string()), @@ -3338,10 +3508,6 @@ impl MetricsTree_Blocks_Count { height_6y_ago: MetricPattern20::new(client.clone(), "height_6y_ago".to_string()), height_8y_ago: MetricPattern20::new(client.clone(), "height_8y_ago".to_string()), height_10y_ago: MetricPattern20::new(client.clone(), "height_10y_ago".to_string()), - block_count_24h_sum: MetricPattern1::new(client.clone(), "block_count_24h_sum".to_string()), - block_count_1w_sum: MetricPattern1::new(client.clone(), "block_count_1w_sum".to_string()), - block_count_1m_sum: MetricPattern1::new(client.clone(), "block_count_1m_sum".to_string()), - block_count_1y_sum: MetricPattern1::new(client.clone(), "block_count_1y_sum".to_string()), } } } @@ -3363,37 +3529,6 @@ impl MetricsTree_Blocks_Halving { } } -/// Metrics tree node. -pub struct MetricsTree_Blocks_Size { - pub cumulative: MetricPattern1, - pub average: MetricPattern2, - pub min: MetricPattern2, - pub max: MetricPattern2, - pub pct10: MetricPattern2, - pub pct25: MetricPattern2, - pub median: MetricPattern2, - pub pct75: MetricPattern2, - pub pct90: MetricPattern2, - pub sum: MetricPattern2, -} - -impl MetricsTree_Blocks_Size { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - cumulative: MetricPattern1::new(client.clone(), "block_size_cumulative".to_string()), - average: MetricPattern2::new(client.clone(), "block_size_average".to_string()), - min: MetricPattern2::new(client.clone(), "block_size_min".to_string()), - max: MetricPattern2::new(client.clone(), "block_size_max".to_string()), - pct10: MetricPattern2::new(client.clone(), "block_size_pct10".to_string()), - pct25: MetricPattern2::new(client.clone(), "block_size_pct25".to_string()), - median: MetricPattern2::new(client.clone(), "block_size_median".to_string()), - pct75: MetricPattern2::new(client.clone(), "block_size_pct75".to_string()), - pct90: MetricPattern2::new(client.clone(), "block_size_pct90".to_string()), - sum: MetricPattern2::new(client.clone(), "block_size_sum".to_string()), - } - } -} - /// Metrics tree node. pub struct MetricsTree_Transactions { pub first_txindex: MetricPattern20, @@ -3437,14 +3572,14 @@ impl MetricsTree_Transactions { /// Metrics tree node. pub struct MetricsTree_Transactions_Count { - pub tx_count: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, + pub tx_count: CumulativeHeightRollingPattern2, pub is_coinbase: MetricPattern21, } impl MetricsTree_Transactions_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { - tx_count: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "tx_count".to_string()), + tx_count: CumulativeHeightRollingPattern2::new(client.clone(), "tx_count".to_string()), is_coinbase: MetricPattern21::new(client.clone(), "is_coinbase".to_string()), } } @@ -3452,15 +3587,15 @@ impl MetricsTree_Transactions_Count { /// Metrics tree node. pub struct MetricsTree_Transactions_Size { - pub vsize: AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern, - pub weight: AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern, + pub vsize: _1h24hBlockTxindexPattern, + pub weight: _1h24hBlockTxindexPattern, } impl MetricsTree_Transactions_Size { pub fn new(client: Arc, base_path: String) -> Self { Self { - vsize: AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern::new(client.clone(), "tx_vsize".to_string()), - weight: AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern::new(client.clone(), "tx_weight".to_string()), + vsize: _1h24hBlockTxindexPattern::new(client.clone(), "tx_vsize".to_string()), + weight: _1h24hBlockTxindexPattern::new(client.clone(), "tx_weight".to_string()), } } } @@ -3469,8 +3604,8 @@ impl MetricsTree_Transactions_Size { pub struct MetricsTree_Transactions_Fees { pub input_value: MetricPattern21, pub output_value: MetricPattern21, - pub fee: MetricsTree_Transactions_Fees_Fee, - pub fee_rate: AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern, + pub fee: _1h24hBlockTxindexPattern, + pub fee_rate: _1h24hBlockTxindexPattern, } impl MetricsTree_Transactions_Fees { @@ -3478,52 +3613,33 @@ impl MetricsTree_Transactions_Fees { Self { input_value: MetricPattern21::new(client.clone(), "input_value".to_string()), output_value: MetricPattern21::new(client.clone(), "output_value".to_string()), - fee: MetricsTree_Transactions_Fees_Fee::new(client.clone(), format!("{base_path}_fee")), - fee_rate: AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern::new(client.clone(), "fee_rate".to_string()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Transactions_Fees_Fee { - pub txindex: MetricPattern21, - pub sats: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, - pub btc: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, - pub usd: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, -} - -impl MetricsTree_Transactions_Fees_Fee { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - txindex: MetricPattern21::new(client.clone(), "fee".to_string()), - sats: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), "fee".to_string()), - btc: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), "fee_btc".to_string()), - usd: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), "fee_usd".to_string()), + fee: _1h24hBlockTxindexPattern::new(client.clone(), "fee".to_string()), + fee_rate: _1h24hBlockTxindexPattern::new(client.clone(), "fee_rate".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Transactions_Versions { - pub v1: CumulativeSumPattern, - pub v2: CumulativeSumPattern, - pub v3: CumulativeSumPattern, + pub v1: CumulativeHeightRollingPattern, + pub v2: CumulativeHeightRollingPattern, + pub v3: CumulativeHeightRollingPattern, } impl MetricsTree_Transactions_Versions { pub fn new(client: Arc, base_path: String) -> Self { Self { - v1: CumulativeSumPattern::new(client.clone(), "tx_v1".to_string()), - v2: CumulativeSumPattern::new(client.clone(), "tx_v2".to_string()), - v3: CumulativeSumPattern::new(client.clone(), "tx_v3".to_string()), + v1: CumulativeHeightRollingPattern::new(client.clone(), "tx_v1".to_string()), + v2: CumulativeHeightRollingPattern::new(client.clone(), "tx_v2".to_string()), + v3: CumulativeHeightRollingPattern::new(client.clone(), "tx_v3".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Transactions_Volume { - pub sent_sum: BtcSatsUsdPattern, - pub received_sum: BtcSatsUsdPattern, + pub sent_sum: BtcRollingSatsUsdPattern, + pub received_sum: BtcRollingSatsUsdPattern, pub annualized_volume: BtcSatsUsdPattern, pub tx_per_sec: MetricPattern1, pub outputs_per_sec: MetricPattern1, @@ -3533,8 +3649,8 @@ pub struct MetricsTree_Transactions_Volume { impl MetricsTree_Transactions_Volume { pub fn new(client: Arc, base_path: String) -> Self { Self { - sent_sum: BtcSatsUsdPattern::new(client.clone(), "sent_sum".to_string()), - received_sum: BtcSatsUsdPattern::new(client.clone(), "received_sum".to_string()), + sent_sum: BtcRollingSatsUsdPattern::new(client.clone(), "sent_sum".to_string()), + received_sum: BtcRollingSatsUsdPattern::new(client.clone(), "received_sum".to_string()), annualized_volume: BtcSatsUsdPattern::new(client.clone(), "annualized_volume".to_string()), tx_per_sec: MetricPattern1::new(client.clone(), "tx_per_sec".to_string()), outputs_per_sec: MetricPattern1::new(client.clone(), "outputs_per_sec".to_string()), @@ -3551,7 +3667,7 @@ pub struct MetricsTree_Inputs { pub outputtype: MetricPattern22, pub typeindex: MetricPattern22, pub spent: MetricsTree_Inputs_Spent, - pub count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, + pub count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern, } impl MetricsTree_Inputs { @@ -3563,7 +3679,7 @@ impl MetricsTree_Inputs { outputtype: MetricPattern22::new(client.clone(), "outputtype".to_string()), typeindex: MetricPattern22::new(client.clone(), "typeindex".to_string()), spent: MetricsTree_Inputs_Spent::new(client.clone(), format!("{base_path}_spent")), - count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), "input_count".to_string()), + count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern::new(client.clone(), "input_count".to_string()), } } } @@ -3623,14 +3739,14 @@ impl MetricsTree_Outputs_Spent { /// Metrics tree node. pub struct MetricsTree_Outputs_Count { - pub total_count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, + pub total_count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern, pub utxo_count: MetricPattern1, } impl MetricsTree_Outputs_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { - total_count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), "output_count".to_string()), + total_count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern::new(client.clone(), "output_count".to_string()), utxo_count: MetricPattern1::new(client.clone(), "exact_utxo_count".to_string()), } } @@ -3712,41 +3828,41 @@ impl MetricsTree_Scripts { /// Metrics tree node. pub struct MetricsTree_Scripts_Count { - pub p2a: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2ms: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2pk33: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2pk65: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2pkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2sh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2tr: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2wpkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2wsh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub opreturn: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub emptyoutput: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub unknownoutput: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub segwit: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub taproot_adoption: BaseCumulativeSumPattern, - pub segwit_adoption: BaseCumulativeSumPattern, + pub p2a: CumulativeHeightRollingPattern, + pub p2ms: CumulativeHeightRollingPattern, + pub p2pk33: CumulativeHeightRollingPattern, + pub p2pk65: CumulativeHeightRollingPattern, + pub p2pkh: CumulativeHeightRollingPattern, + pub p2sh: CumulativeHeightRollingPattern, + pub p2tr: CumulativeHeightRollingPattern, + pub p2wpkh: CumulativeHeightRollingPattern, + pub p2wsh: CumulativeHeightRollingPattern, + pub opreturn: CumulativeHeightRollingPattern, + pub emptyoutput: CumulativeHeightRollingPattern, + pub unknownoutput: CumulativeHeightRollingPattern, + pub segwit: CumulativeHeightRollingPattern, + pub taproot_adoption: MetricPattern1, + pub segwit_adoption: MetricPattern1, } impl MetricsTree_Scripts_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2a: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2a_count".to_string()), - p2ms: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2ms_count".to_string()), - p2pk33: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2pk33_count".to_string()), - p2pk65: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2pk65_count".to_string()), - p2pkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2pkh_count".to_string()), - p2sh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2sh_count".to_string()), - p2tr: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2tr_count".to_string()), - p2wpkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2wpkh_count".to_string()), - p2wsh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2wsh_count".to_string()), - opreturn: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "opreturn_count".to_string()), - emptyoutput: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "emptyoutput_count".to_string()), - unknownoutput: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "unknownoutput_count".to_string()), - segwit: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "segwit_count".to_string()), - taproot_adoption: BaseCumulativeSumPattern::new(client.clone(), "taproot_adoption".to_string()), - segwit_adoption: BaseCumulativeSumPattern::new(client.clone(), "segwit_adoption".to_string()), + p2a: CumulativeHeightRollingPattern::new(client.clone(), "p2a_count".to_string()), + p2ms: CumulativeHeightRollingPattern::new(client.clone(), "p2ms_count".to_string()), + p2pk33: CumulativeHeightRollingPattern::new(client.clone(), "p2pk33_count".to_string()), + p2pk65: CumulativeHeightRollingPattern::new(client.clone(), "p2pk65_count".to_string()), + p2pkh: CumulativeHeightRollingPattern::new(client.clone(), "p2pkh_count".to_string()), + p2sh: CumulativeHeightRollingPattern::new(client.clone(), "p2sh_count".to_string()), + p2tr: CumulativeHeightRollingPattern::new(client.clone(), "p2tr_count".to_string()), + p2wpkh: CumulativeHeightRollingPattern::new(client.clone(), "p2wpkh_count".to_string()), + p2wsh: CumulativeHeightRollingPattern::new(client.clone(), "p2wsh_count".to_string()), + opreturn: CumulativeHeightRollingPattern::new(client.clone(), "opreturn_count".to_string()), + emptyoutput: CumulativeHeightRollingPattern::new(client.clone(), "emptyoutput_count".to_string()), + unknownoutput: CumulativeHeightRollingPattern::new(client.clone(), "unknownoutput_count".to_string()), + segwit: CumulativeHeightRollingPattern::new(client.clone(), "segwit_count".to_string()), + taproot_adoption: MetricPattern1::new(client.clone(), "taproot_adoption".to_string()), + segwit_adoption: MetricPattern1::new(client.clone(), "segwit_adoption".to_string()), } } } @@ -3781,17 +3897,10 @@ impl MetricsTree_Mining { /// Metrics tree node. pub struct MetricsTree_Mining_Rewards { - pub coinbase_24h_sum: BtcSatsUsdPattern, - pub coinbase_7d_sum: BtcSatsUsdPattern, - pub coinbase_30d_sum: BtcSatsUsdPattern, - pub coinbase_1y_sum: BtcSatsUsdPattern, - pub fee_24h_sum: BtcSatsUsdPattern, - pub fee_7d_sum: BtcSatsUsdPattern, - pub fee_30d_sum: BtcSatsUsdPattern, - pub fee_1y_sum: BtcSatsUsdPattern, pub coinbase: BtcSatsUsdPattern3, pub subsidy: BtcSatsUsdPattern3, - pub unclaimed_rewards: BtcSatsUsdPattern2, + pub fees: BtcSatsUsdPattern3, + pub unclaimed_rewards: BtcSatsUsdPattern4, pub fee_dominance: MetricPattern1, pub fee_dominance_24h: MetricPattern1, pub fee_dominance_7d: MetricPattern1, @@ -3808,17 +3917,10 @@ pub struct MetricsTree_Mining_Rewards { impl MetricsTree_Mining_Rewards { pub fn new(client: Arc, base_path: String) -> Self { Self { - coinbase_24h_sum: BtcSatsUsdPattern::new(client.clone(), "coinbase_24h_sum".to_string()), - coinbase_7d_sum: BtcSatsUsdPattern::new(client.clone(), "coinbase_7d_sum".to_string()), - coinbase_30d_sum: BtcSatsUsdPattern::new(client.clone(), "coinbase_30d_sum".to_string()), - coinbase_1y_sum: BtcSatsUsdPattern::new(client.clone(), "coinbase_1y_sum".to_string()), - fee_24h_sum: BtcSatsUsdPattern::new(client.clone(), "fee_24h_sum".to_string()), - fee_7d_sum: BtcSatsUsdPattern::new(client.clone(), "fee_7d_sum".to_string()), - fee_30d_sum: BtcSatsUsdPattern::new(client.clone(), "fee_30d_sum".to_string()), - fee_1y_sum: BtcSatsUsdPattern::new(client.clone(), "fee_1y_sum".to_string()), coinbase: BtcSatsUsdPattern3::new(client.clone(), "coinbase".to_string()), subsidy: BtcSatsUsdPattern3::new(client.clone(), "subsidy".to_string()), - unclaimed_rewards: BtcSatsUsdPattern2::new(client.clone(), "unclaimed_rewards".to_string()), + fees: BtcSatsUsdPattern3::new(client.clone(), "fees".to_string()), + unclaimed_rewards: BtcSatsUsdPattern4::new(client.clone(), "unclaimed_rewards".to_string()), fee_dominance: MetricPattern1::new(client.clone(), "fee_dominance".to_string()), fee_dominance_24h: MetricPattern1::new(client.clone(), "fee_dominance_24h".to_string()), fee_dominance_7d: MetricPattern1::new(client.clone(), "fee_dominance_7d".to_string()), @@ -3921,8 +4023,8 @@ impl MetricsTree_Cointime { /// Metrics tree node. pub struct MetricsTree_Cointime_Activity { - pub coinblocks_created: CumulativeSumPattern, - pub coinblocks_stored: CumulativeSumPattern, + pub coinblocks_created: CumulativeHeightRollingPattern, + pub coinblocks_stored: CumulativeHeightRollingPattern, pub liveliness: MetricPattern1, pub vaultedness: MetricPattern1, pub activity_to_vaultedness_ratio: MetricPattern1, @@ -3931,8 +4033,8 @@ pub struct MetricsTree_Cointime_Activity { impl MetricsTree_Cointime_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { - coinblocks_created: CumulativeSumPattern::new(client.clone(), "coinblocks_created".to_string()), - coinblocks_stored: CumulativeSumPattern::new(client.clone(), "coinblocks_stored".to_string()), + coinblocks_created: CumulativeHeightRollingPattern::new(client.clone(), "coinblocks_created".to_string()), + coinblocks_stored: CumulativeHeightRollingPattern::new(client.clone(), "coinblocks_stored".to_string()), liveliness: MetricPattern1::new(client.clone(), "liveliness".to_string()), vaultedness: MetricPattern1::new(client.clone(), "vaultedness".to_string()), activity_to_vaultedness_ratio: MetricPattern1::new(client.clone(), "activity_to_vaultedness_ratio".to_string()), @@ -3957,19 +4059,19 @@ impl MetricsTree_Cointime_Supply { /// Metrics tree node. pub struct MetricsTree_Cointime_Value { - pub cointime_value_destroyed: CumulativeSumPattern, - pub cointime_value_created: CumulativeSumPattern, - pub cointime_value_stored: CumulativeSumPattern, - pub vocdd: CumulativeSumPattern, + pub cointime_value_destroyed: CumulativeHeightRollingPattern, + pub cointime_value_created: CumulativeHeightRollingPattern, + pub cointime_value_stored: CumulativeHeightRollingPattern, + pub vocdd: CumulativeHeightRollingPattern, } impl MetricsTree_Cointime_Value { pub fn new(client: Arc, base_path: String) -> Self { Self { - cointime_value_destroyed: CumulativeSumPattern::new(client.clone(), "cointime_value_destroyed".to_string()), - cointime_value_created: CumulativeSumPattern::new(client.clone(), "cointime_value_created".to_string()), - cointime_value_stored: CumulativeSumPattern::new(client.clone(), "cointime_value_stored".to_string()), - vocdd: CumulativeSumPattern::new(client.clone(), "vocdd".to_string()), + cointime_value_destroyed: CumulativeHeightRollingPattern::new(client.clone(), "cointime_value_destroyed".to_string()), + cointime_value_created: CumulativeHeightRollingPattern::new(client.clone(), "cointime_value_created".to_string()), + cointime_value_stored: CumulativeHeightRollingPattern::new(client.clone(), "cointime_value_stored".to_string()), + vocdd: CumulativeHeightRollingPattern::new(client.clone(), "vocdd".to_string()), } } } @@ -4872,12 +4974,12 @@ pub struct MetricsTree_Market_Volatility { pub price_1w_volatility: MetricPattern1, pub price_1m_volatility: MetricPattern1, pub price_1y_volatility: MetricPattern1, - pub sharpe_1w: MetricPattern20, - pub sharpe_1m: MetricPattern20, - pub sharpe_1y: MetricPattern20, - pub sortino_1w: MetricPattern20, - pub sortino_1m: MetricPattern20, - pub sortino_1y: MetricPattern20, + pub sharpe_1w: MetricPattern1, + pub sharpe_1m: MetricPattern1, + pub sharpe_1y: MetricPattern1, + pub sortino_1w: MetricPattern1, + pub sortino_1m: MetricPattern1, + pub sortino_1y: MetricPattern1, } impl MetricsTree_Market_Volatility { @@ -4886,12 +4988,12 @@ impl MetricsTree_Market_Volatility { price_1w_volatility: MetricPattern1::new(client.clone(), "price_1w_volatility".to_string()), price_1m_volatility: MetricPattern1::new(client.clone(), "price_1m_volatility".to_string()), price_1y_volatility: MetricPattern1::new(client.clone(), "price_1y_volatility".to_string()), - sharpe_1w: MetricPattern20::new(client.clone(), "sharpe_1w".to_string()), - sharpe_1m: MetricPattern20::new(client.clone(), "sharpe_1m".to_string()), - sharpe_1y: MetricPattern20::new(client.clone(), "sharpe_1y".to_string()), - sortino_1w: MetricPattern20::new(client.clone(), "sortino_1w".to_string()), - sortino_1m: MetricPattern20::new(client.clone(), "sortino_1m".to_string()), - sortino_1y: MetricPattern20::new(client.clone(), "sortino_1y".to_string()), + sharpe_1w: MetricPattern1::new(client.clone(), "sharpe_1w".to_string()), + sharpe_1m: MetricPattern1::new(client.clone(), "sharpe_1m".to_string()), + sharpe_1y: MetricPattern1::new(client.clone(), "sharpe_1y".to_string()), + sortino_1w: MetricPattern1::new(client.clone(), "sortino_1w".to_string()), + sortino_1m: MetricPattern1::new(client.clone(), "sortino_1m".to_string()), + sortino_1y: MetricPattern1::new(client.clone(), "sortino_1y".to_string()), } } } @@ -5362,7 +5464,7 @@ pub struct MetricsTree_Market_Indicators_Rsi_1d { pub losses: MetricPattern1, pub average_gain: MetricPattern1, pub average_loss: MetricPattern1, - pub rsi: MetricPattern20, + pub rsi: MetricPattern1, pub rsi_min: MetricPattern1, pub rsi_max: MetricPattern1, pub stoch_rsi: MetricPattern1, @@ -5377,7 +5479,7 @@ impl MetricsTree_Market_Indicators_Rsi_1d { losses: MetricPattern1::new(client.clone(), "rsi_losses_1d".to_string()), average_gain: MetricPattern1::new(client.clone(), "rsi_avg_gain_1d".to_string()), average_loss: MetricPattern1::new(client.clone(), "rsi_avg_loss_1d".to_string()), - rsi: MetricPattern20::new(client.clone(), "rsi_1d".to_string()), + rsi: MetricPattern1::new(client.clone(), "rsi_1d".to_string()), rsi_min: MetricPattern1::new(client.clone(), "rsi_rsi_min_1d".to_string()), rsi_max: MetricPattern1::new(client.clone(), "rsi_rsi_max_1d".to_string()), stoch_rsi: MetricPattern1::new(client.clone(), "rsi_stoch_rsi_1d".to_string()), @@ -5393,7 +5495,7 @@ pub struct MetricsTree_Market_Indicators_Rsi_1w { pub losses: MetricPattern1, pub average_gain: MetricPattern1, pub average_loss: MetricPattern1, - pub rsi: MetricPattern20, + pub rsi: MetricPattern1, pub rsi_min: MetricPattern1, pub rsi_max: MetricPattern1, pub stoch_rsi: MetricPattern1, @@ -5408,7 +5510,7 @@ impl MetricsTree_Market_Indicators_Rsi_1w { losses: MetricPattern1::new(client.clone(), "rsi_losses_1w".to_string()), average_gain: MetricPattern1::new(client.clone(), "rsi_avg_gain_1w".to_string()), average_loss: MetricPattern1::new(client.clone(), "rsi_avg_loss_1w".to_string()), - rsi: MetricPattern20::new(client.clone(), "rsi_1w".to_string()), + rsi: MetricPattern1::new(client.clone(), "rsi_1w".to_string()), rsi_min: MetricPattern1::new(client.clone(), "rsi_rsi_min_1w".to_string()), rsi_max: MetricPattern1::new(client.clone(), "rsi_rsi_max_1w".to_string()), stoch_rsi: MetricPattern1::new(client.clone(), "rsi_stoch_rsi_1w".to_string()), @@ -5424,7 +5526,7 @@ pub struct MetricsTree_Market_Indicators_Rsi_1m { pub losses: MetricPattern1, pub average_gain: MetricPattern1, pub average_loss: MetricPattern1, - pub rsi: MetricPattern20, + pub rsi: MetricPattern1, pub rsi_min: MetricPattern1, pub rsi_max: MetricPattern1, pub stoch_rsi: MetricPattern1, @@ -5439,7 +5541,7 @@ impl MetricsTree_Market_Indicators_Rsi_1m { losses: MetricPattern1::new(client.clone(), "rsi_losses_1m".to_string()), average_gain: MetricPattern1::new(client.clone(), "rsi_avg_gain_1m".to_string()), average_loss: MetricPattern1::new(client.clone(), "rsi_avg_loss_1m".to_string()), - rsi: MetricPattern20::new(client.clone(), "rsi_1m".to_string()), + rsi: MetricPattern1::new(client.clone(), "rsi_1m".to_string()), rsi_min: MetricPattern1::new(client.clone(), "rsi_rsi_min_1m".to_string()), rsi_max: MetricPattern1::new(client.clone(), "rsi_rsi_max_1m".to_string()), stoch_rsi: MetricPattern1::new(client.clone(), "rsi_stoch_rsi_1m".to_string()), @@ -5472,7 +5574,7 @@ impl MetricsTree_Market_Indicators_Macd { pub struct MetricsTree_Market_Indicators_Macd_1d { pub line: MetricPattern1, pub signal: MetricPattern1, - pub histogram: MetricPattern20, + pub histogram: MetricPattern1, } impl MetricsTree_Market_Indicators_Macd_1d { @@ -5480,7 +5582,7 @@ impl MetricsTree_Market_Indicators_Macd_1d { Self { line: MetricPattern1::new(client.clone(), "macd_line_1d".to_string()), signal: MetricPattern1::new(client.clone(), "macd_signal_1d".to_string()), - histogram: MetricPattern20::new(client.clone(), "macd_histogram_1d".to_string()), + histogram: MetricPattern1::new(client.clone(), "macd_histogram_1d".to_string()), } } } @@ -5489,7 +5591,7 @@ impl MetricsTree_Market_Indicators_Macd_1d { pub struct MetricsTree_Market_Indicators_Macd_1w { pub line: MetricPattern1, pub signal: MetricPattern1, - pub histogram: MetricPattern20, + pub histogram: MetricPattern1, } impl MetricsTree_Market_Indicators_Macd_1w { @@ -5497,7 +5599,7 @@ impl MetricsTree_Market_Indicators_Macd_1w { Self { line: MetricPattern1::new(client.clone(), "macd_line_1w".to_string()), signal: MetricPattern1::new(client.clone(), "macd_signal_1w".to_string()), - histogram: MetricPattern20::new(client.clone(), "macd_histogram_1w".to_string()), + histogram: MetricPattern1::new(client.clone(), "macd_histogram_1w".to_string()), } } } @@ -5506,7 +5608,7 @@ impl MetricsTree_Market_Indicators_Macd_1w { pub struct MetricsTree_Market_Indicators_Macd_1m { pub line: MetricPattern1, pub signal: MetricPattern1, - pub histogram: MetricPattern20, + pub histogram: MetricPattern1, } impl MetricsTree_Market_Indicators_Macd_1m { @@ -5514,7 +5616,7 @@ impl MetricsTree_Market_Indicators_Macd_1m { Self { line: MetricPattern1::new(client.clone(), "macd_line_1m".to_string()), signal: MetricPattern1::new(client.clone(), "macd_signal_1m".to_string()), - histogram: MetricPattern20::new(client.clone(), "macd_histogram_1m".to_string()), + histogram: MetricPattern1::new(client.clone(), "macd_histogram_1m".to_string()), } } } @@ -5871,68 +5973,17 @@ impl MetricsTree_Pools_Vecs { /// Metrics tree node. pub struct MetricsTree_Prices { - pub cents: MetricsTree_Prices_Cents, - pub usd: MetricsTree_Prices_Usd, - pub sats: MetricsTree_Prices_Sats, + pub cents: CloseHighLowOpenPricePattern, + pub usd: CloseHighLowOpenPricePattern, + pub sats: CloseHighLowOpenPricePattern, } impl MetricsTree_Prices { pub fn new(client: Arc, base_path: String) -> Self { Self { - cents: MetricsTree_Prices_Cents::new(client.clone(), format!("{base_path}_cents")), - usd: MetricsTree_Prices_Usd::new(client.clone(), format!("{base_path}_usd")), - sats: MetricsTree_Prices_Sats::new(client.clone(), format!("{base_path}_sats")), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Prices_Cents { - pub price: MetricPattern20, - pub split: CloseHighLowOpenPattern, - pub ohlc: MetricPattern2, -} - -impl MetricsTree_Prices_Cents { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - price: MetricPattern20::new(client.clone(), "price_cents".to_string()), - split: CloseHighLowOpenPattern::new(client.clone(), "price_cents".to_string()), - ohlc: MetricPattern2::new(client.clone(), "price_cents_ohlc".to_string()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Prices_Usd { - pub price: MetricPattern20, - pub split: CloseHighLowOpenPattern, - pub ohlc: MetricPattern2, -} - -impl MetricsTree_Prices_Usd { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - price: MetricPattern20::new(client.clone(), "price_usd".to_string()), - split: CloseHighLowOpenPattern::new(client.clone(), "price".to_string()), - ohlc: MetricPattern2::new(client.clone(), "price_usd_ohlc".to_string()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Prices_Sats { - pub price: MetricPattern20, - pub split: CloseHighLowOpenPattern, - pub ohlc: MetricPattern2, -} - -impl MetricsTree_Prices_Sats { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - price: MetricPattern20::new(client.clone(), "price_sats".to_string()), - split: CloseHighLowOpenPattern::new(client.clone(), "price_sats".to_string()), - ohlc: MetricPattern2::new(client.clone(), "price_sats_ohlc".to_string()), + cents: CloseHighLowOpenPricePattern::new(client.clone(), "price_cents".to_string()), + usd: CloseHighLowOpenPricePattern::new(client.clone(), "price_usd".to_string()), + sats: CloseHighLowOpenPricePattern::new(client.clone(), "price_sats".to_string()), } } } @@ -6019,32 +6070,34 @@ impl MetricsTree_Distribution_AddressesData { /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts { pub all: MetricsTree_Distribution_UtxoCohorts_All, + pub sth: MetricsTree_Distribution_UtxoCohorts_Sth, + pub lth: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern, pub age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange, - pub epoch: MetricsTree_Distribution_UtxoCohorts_Epoch, - pub year: MetricsTree_Distribution_UtxoCohorts_Year, + pub max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge, pub min_age: MetricsTree_Distribution_UtxoCohorts_MinAge, pub ge_amount: MetricsTree_Distribution_UtxoCohorts_GeAmount, pub amount_range: MetricsTree_Distribution_UtxoCohorts_AmountRange, - pub term: MetricsTree_Distribution_UtxoCohorts_Term, - pub type_: MetricsTree_Distribution_UtxoCohorts_Type, - pub max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge, pub lt_amount: MetricsTree_Distribution_UtxoCohorts_LtAmount, + pub epoch: MetricsTree_Distribution_UtxoCohorts_Epoch, + pub year: MetricsTree_Distribution_UtxoCohorts_Year, + pub type_: MetricsTree_Distribution_UtxoCohorts_Type, } impl MetricsTree_Distribution_UtxoCohorts { pub fn new(client: Arc, base_path: String) -> Self { 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()), age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange::new(client.clone(), format!("{base_path}_age_range")), - epoch: MetricsTree_Distribution_UtxoCohorts_Epoch::new(client.clone(), format!("{base_path}_epoch")), - year: MetricsTree_Distribution_UtxoCohorts_Year::new(client.clone(), format!("{base_path}_year")), + 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")), ge_amount: MetricsTree_Distribution_UtxoCohorts_GeAmount::new(client.clone(), format!("{base_path}_ge_amount")), amount_range: MetricsTree_Distribution_UtxoCohorts_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), - term: MetricsTree_Distribution_UtxoCohorts_Term::new(client.clone(), format!("{base_path}_term")), - type_: MetricsTree_Distribution_UtxoCohorts_Type::new(client.clone(), format!("{base_path}_type_")), - max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge::new(client.clone(), format!("{base_path}_max_age")), lt_amount: MetricsTree_Distribution_UtxoCohorts_LtAmount::new(client.clone(), format!("{base_path}_lt_amount")), + epoch: MetricsTree_Distribution_UtxoCohorts_Epoch::new(client.clone(), format!("{base_path}_epoch")), + year: MetricsTree_Distribution_UtxoCohorts_Year::new(client.clone(), format!("{base_path}_year")), + type_: MetricsTree_Distribution_UtxoCohorts_Type::new(client.clone(), format!("{base_path}_type_")), } } } @@ -6055,8 +6108,8 @@ pub struct MetricsTree_Distribution_UtxoCohorts_All { pub outputs: UtxoPattern, pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, pub realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, - pub unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern, pub cost_basis: InvestedMaxMinPercentilesSpotPattern, + pub unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern, pub relative: MetricsTree_Distribution_UtxoCohorts_All_Relative, } @@ -6067,8 +6120,8 @@ impl MetricsTree_Distribution_UtxoCohorts_All { outputs: UtxoPattern::new(client.clone(), "utxo_count".to_string()), activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), "".to_string()), realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern::new(client.clone(), "".to_string()), - unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern::new(client.clone(), "".to_string()), cost_basis: InvestedMaxMinPercentilesSpotPattern::new(client.clone(), "".to_string()), + unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern::new(client.clone(), "".to_string()), relative: MetricsTree_Distribution_UtxoCohorts_All_Relative::new(client.clone(), format!("{base_path}_relative")), } } @@ -6083,12 +6136,12 @@ pub struct MetricsTree_Distribution_UtxoCohorts_All_Relative { pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, pub net_unrealized_pnl_rel_to_market_cap: MetricPattern1, pub nupl: MetricPattern1, + pub invested_capital_in_profit_pct: MetricPattern1, + pub invested_capital_in_loss_pct: MetricPattern1, pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, pub unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, pub neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1, pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, - pub invested_capital_in_profit_pct: MetricPattern1, - pub invested_capital_in_loss_pct: MetricPattern1, pub unrealized_peak_regret_rel_to_market_cap: MetricPattern1, } @@ -6102,17 +6155,42 @@ impl MetricsTree_Distribution_UtxoCohorts_All_Relative { neg_unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), "neg_unrealized_loss_rel_to_market_cap".to_string()), net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new(client.clone(), "net_unrealized_pnl_rel_to_market_cap".to_string()), nupl: MetricPattern1::new(client.clone(), "nupl".to_string()), + invested_capital_in_profit_pct: MetricPattern1::new(client.clone(), "invested_capital_in_profit_pct".to_string()), + invested_capital_in_loss_pct: MetricPattern1::new(client.clone(), "invested_capital_in_loss_pct".to_string()), unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), "unrealized_profit_rel_to_own_total_unrealized_pnl".to_string()), unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), "unrealized_loss_rel_to_own_total_unrealized_pnl".to_string()), neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), "neg_unrealized_loss_rel_to_own_total_unrealized_pnl".to_string()), net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1::new(client.clone(), "net_unrealized_pnl_rel_to_own_total_unrealized_pnl".to_string()), - invested_capital_in_profit_pct: MetricPattern1::new(client.clone(), "invested_capital_in_profit_pct".to_string()), - invested_capital_in_loss_pct: MetricPattern1::new(client.clone(), "invested_capital_in_loss_pct".to_string()), unrealized_peak_regret_rel_to_market_cap: MetricPattern1::new(client.clone(), "unrealized_peak_regret_rel_to_market_cap".to_string()), } } } +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_Sth { + pub supply: _30dHalvedTotalPattern, + pub outputs: UtxoPattern, + pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, + pub realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, + pub cost_basis: InvestedMaxMinPercentilesSpotPattern, + pub unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern, + pub relative: InvestedNegNetNuplSupplyUnrealizedPattern2, +} + +impl MetricsTree_Distribution_UtxoCohorts_Sth { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + supply: _30dHalvedTotalPattern::new(client.clone(), "sth".to_string()), + outputs: UtxoPattern::new(client.clone(), "sth_utxo_count".to_string()), + activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), "sth".to_string()), + realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern::new(client.clone(), "sth".to_string()), + cost_basis: InvestedMaxMinPercentilesSpotPattern::new(client.clone(), "sth".to_string()), + unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern::new(client.clone(), "sth".to_string()), + relative: InvestedNegNetNuplSupplyUnrealizedPattern2::new(client.clone(), "sth".to_string()), + } + } +} + /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_AgeRange { pub up_to_1h: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern, @@ -6166,6 +6244,215 @@ impl MetricsTree_Distribution_UtxoCohorts_AgeRange { } } +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_MaxAge { + 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, + pub _15y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, +} + +impl MetricsTree_Distribution_UtxoCohorts_MaxAge { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_1w_old".to_string()), + _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_1m_old".to_string()), + _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_2m_old".to_string()), + _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_3m_old".to_string()), + _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_4m_old".to_string()), + _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_5m_old".to_string()), + _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_6m_old".to_string()), + _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_1y_old".to_string()), + _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_2y_old".to_string()), + _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_3y_old".to_string()), + _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_4y_old".to_string()), + _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_5y_old".to_string()), + _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_6y_old".to_string()), + _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_7y_old".to_string()), + _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_8y_old".to_string()), + _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_10y_old".to_string()), + _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_12y_old".to_string()), + _15y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_15y_old".to_string()), + } + } +} + +/// Metrics tree node. +pub struct MetricsTree_Distribution_UtxoCohorts_MinAge { + pub _1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, + pub _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, +} + +impl MetricsTree_Distribution_UtxoCohorts_MinAge { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + _1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_1d_old".to_string()), + _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_1w_old".to_string()), + _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_1m_old".to_string()), + _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_2m_old".to_string()), + _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_3m_old".to_string()), + _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_4m_old".to_string()), + _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_5m_old".to_string()), + _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_6m_old".to_string()), + _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_1y_old".to_string()), + _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_2y_old".to_string()), + _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_3y_old".to_string()), + _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_4y_old".to_string()), + _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_5y_old".to_string()), + _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_6y_old".to_string()), + _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_7y_old".to_string()), + _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_8y_old".to_string()), + _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_over_10y_old".to_string()), + _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::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, +} + +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()), + } + } +} + +/// 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, +} + +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()), + } + } +} + +/// 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, +} + +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()), + } + } +} + /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_Epoch { pub _0: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, @@ -6234,209 +6521,19 @@ impl MetricsTree_Distribution_UtxoCohorts_Year { } } -/// Metrics tree node. -pub struct MetricsTree_Distribution_UtxoCohorts_MinAge { - pub _1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, - pub _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6, -} - -impl MetricsTree_Distribution_UtxoCohorts_MinAge { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_1d_old".to_string()), - _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_1w_old".to_string()), - _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_1m_old".to_string()), - _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_2m_old".to_string()), - _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_3m_old".to_string()), - _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_4m_old".to_string()), - _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_5m_old".to_string()), - _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_6m_old".to_string()), - _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_1y_old".to_string()), - _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_2y_old".to_string()), - _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_3y_old".to_string()), - _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_4y_old".to_string()), - _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_5y_old".to_string()), - _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_6y_old".to_string()), - _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_7y_old".to_string()), - _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_8y_old".to_string()), - _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_10y_old".to_string()), - _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6::new(client.clone(), "utxos_over_12y_old".to_string()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Distribution_UtxoCohorts_GeAmount { - pub _1sat: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, -} - -impl MetricsTree_Distribution_UtxoCohorts_GeAmount { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _1sat: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_1sat".to_string()), - _10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_10sats".to_string()), - _100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_100sats".to_string()), - _1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_1k_sats".to_string()), - _10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_10k_sats".to_string()), - _100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_100k_sats".to_string()), - _1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_1m_sats".to_string()), - _10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_10m_sats".to_string()), - _1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_1btc".to_string()), - _10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_10btc".to_string()), - _100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_100btc".to_string()), - _1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_over_1k_btc".to_string()), - _10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::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, -} - -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()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Distribution_UtxoCohorts_Term { - pub short: MetricsTree_Distribution_UtxoCohorts_Term_Short, - pub long: MetricsTree_Distribution_UtxoCohorts_Term_Long, -} - -impl MetricsTree_Distribution_UtxoCohorts_Term { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - short: MetricsTree_Distribution_UtxoCohorts_Term_Short::new(client.clone(), format!("{base_path}_short")), - long: MetricsTree_Distribution_UtxoCohorts_Term_Long::new(client.clone(), format!("{base_path}_long")), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Distribution_UtxoCohorts_Term_Short { - pub supply: _30dHalvedTotalPattern, - pub outputs: UtxoPattern, - pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, - pub realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, - pub unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern, - pub cost_basis: InvestedMaxMinPercentilesSpotPattern, - pub relative: InvestedNegNetNuplSupplyUnrealizedPattern4, -} - -impl MetricsTree_Distribution_UtxoCohorts_Term_Short { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - supply: _30dHalvedTotalPattern::new(client.clone(), "sth".to_string()), - outputs: UtxoPattern::new(client.clone(), "sth_utxo_count".to_string()), - activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), "sth".to_string()), - realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern::new(client.clone(), "sth".to_string()), - unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern::new(client.clone(), "sth".to_string()), - cost_basis: InvestedMaxMinPercentilesSpotPattern::new(client.clone(), "sth".to_string()), - relative: InvestedNegNetNuplSupplyUnrealizedPattern4::new(client.clone(), "sth".to_string()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Distribution_UtxoCohorts_Term_Long { - pub supply: _30dHalvedTotalPattern, - pub outputs: UtxoPattern, - pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, - pub realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2, - pub unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern, - pub cost_basis: InvestedMaxMinPercentilesSpotPattern, - pub relative: InvestedNegNetNuplSupplyUnrealizedPattern4, -} - -impl MetricsTree_Distribution_UtxoCohorts_Term_Long { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - supply: _30dHalvedTotalPattern::new(client.clone(), "lth".to_string()), - outputs: UtxoPattern::new(client.clone(), "lth_utxo_count".to_string()), - activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), "lth".to_string()), - realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2::new(client.clone(), "lth".to_string()), - unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern::new(client.clone(), "lth".to_string()), - cost_basis: InvestedMaxMinPercentilesSpotPattern::new(client.clone(), "lth".to_string()), - relative: InvestedNegNetNuplSupplyUnrealizedPattern4::new(client.clone(), "lth".to_string()), - } - } -} - /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_Type { pub p2pk65: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, pub p2pk33: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, pub p2pkh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub p2ms: ActivityCostOutputsRealizedSupplyUnrealizedPattern, + pub p2ms: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, pub p2sh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, pub p2wpkh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, pub p2wsh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, pub p2tr: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, pub p2a: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, - pub unknown: ActivityCostOutputsRealizedSupplyUnrealizedPattern, - pub empty: ActivityCostOutputsRealizedSupplyUnrealizedPattern, + pub unknown: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, + pub empty: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3, } impl MetricsTree_Distribution_UtxoCohorts_Type { @@ -6445,98 +6542,14 @@ impl MetricsTree_Distribution_UtxoCohorts_Type { 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: ActivityCostOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "p2ms".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: ActivityCostOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "unknown_outputs".to_string()), - empty: ActivityCostOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "empty_outputs".to_string()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Distribution_UtxoCohorts_MaxAge { - pub _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, - pub _15y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5, -} - -impl MetricsTree_Distribution_UtxoCohorts_MaxAge { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_1w_old".to_string()), - _1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_1m_old".to_string()), - _2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_2m_old".to_string()), - _3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_3m_old".to_string()), - _4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_4m_old".to_string()), - _5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_5m_old".to_string()), - _6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_6m_old".to_string()), - _1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_1y_old".to_string()), - _2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_2y_old".to_string()), - _3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_3y_old".to_string()), - _4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_4y_old".to_string()), - _5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_5y_old".to_string()), - _6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_6y_old".to_string()), - _7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_7y_old".to_string()), - _8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_8y_old".to_string()), - _10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_10y_old".to_string()), - _12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_12y_old".to_string()), - _15y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5::new(client.clone(), "utxos_under_15y_old".to_string()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Distribution_UtxoCohorts_LtAmount { - pub _10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, - pub _100k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4, -} - -impl MetricsTree_Distribution_UtxoCohorts_LtAmount { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - _10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_10sats".to_string()), - _100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_100sats".to_string()), - _1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_1k_sats".to_string()), - _10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_10k_sats".to_string()), - _100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_100k_sats".to_string()), - _1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_1m_sats".to_string()), - _10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_10m_sats".to_string()), - _1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_1btc".to_string()), - _10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_10btc".to_string()), - _100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_100btc".to_string()), - _1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_1k_btc".to_string()), - _10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_10k_btc".to_string()), - _100k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4::new(client.clone(), "utxos_under_100k_btc".to_string()), + unknown: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "unknown_outputs".to_string()), + empty: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3::new(client.clone(), "empty_outputs".to_string()), } } } @@ -6733,58 +6746,58 @@ impl MetricsTree_Distribution_TotalAddrCount { /// Metrics tree node. pub struct MetricsTree_Distribution_NewAddrCount { - pub all: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2pk65: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2pk33: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2pkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2sh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2wpkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2wsh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2tr: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub p2a: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, + pub all: BaseRestPattern, + pub p2pk65: BaseRestPattern, + pub p2pk33: BaseRestPattern, + pub p2pkh: BaseRestPattern, + pub p2sh: BaseRestPattern, + pub p2wpkh: BaseRestPattern, + pub p2wsh: BaseRestPattern, + pub p2tr: BaseRestPattern, + pub p2a: BaseRestPattern, } impl MetricsTree_Distribution_NewAddrCount { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "new_addr_count".to_string()), - p2pk65: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2pk65_new_addr_count".to_string()), - p2pk33: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2pk33_new_addr_count".to_string()), - p2pkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2pkh_new_addr_count".to_string()), - p2sh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2sh_new_addr_count".to_string()), - p2wpkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2wpkh_new_addr_count".to_string()), - p2wsh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2wsh_new_addr_count".to_string()), - p2tr: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2tr_new_addr_count".to_string()), - p2a: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "p2a_new_addr_count".to_string()), + all: BaseRestPattern::new(client.clone(), "new_addr_count".to_string()), + p2pk65: BaseRestPattern::new(client.clone(), "p2pk65_new_addr_count".to_string()), + p2pk33: BaseRestPattern::new(client.clone(), "p2pk33_new_addr_count".to_string()), + p2pkh: BaseRestPattern::new(client.clone(), "p2pkh_new_addr_count".to_string()), + p2sh: BaseRestPattern::new(client.clone(), "p2sh_new_addr_count".to_string()), + p2wpkh: BaseRestPattern::new(client.clone(), "p2wpkh_new_addr_count".to_string()), + p2wsh: BaseRestPattern::new(client.clone(), "p2wsh_new_addr_count".to_string()), + p2tr: BaseRestPattern::new(client.clone(), "p2tr_new_addr_count".to_string()), + p2a: BaseRestPattern::new(client.clone(), "p2a_new_addr_count".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_GrowthRate { - pub all: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2pk65: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2pk33: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2pkh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2sh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2wpkh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2wsh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2tr: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2a: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub all: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub p2pk65: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub p2pk33: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub p2pkh: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub p2sh: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub p2wpkh: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub p2wsh: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub p2tr: AverageHeightMaxMedianMinP10P25P75P90Pattern, + pub p2a: AverageHeightMaxMedianMinP10P25P75P90Pattern, } impl MetricsTree_Distribution_GrowthRate { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "growth_rate".to_string()), - p2pk65: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2pk65_growth_rate".to_string()), - p2pk33: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2pk33_growth_rate".to_string()), - p2pkh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2pkh_growth_rate".to_string()), - p2sh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2sh_growth_rate".to_string()), - p2wpkh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2wpkh_growth_rate".to_string()), - p2wsh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2wsh_growth_rate".to_string()), - p2tr: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2tr_growth_rate".to_string()), - p2a: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2a_growth_rate".to_string()), + all: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "growth_rate".to_string()), + p2pk65: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "p2pk65_growth_rate".to_string()), + p2pk33: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "p2pk33_growth_rate".to_string()), + p2pkh: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "p2pkh_growth_rate".to_string()), + p2sh: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "p2sh_growth_rate".to_string()), + p2wpkh: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "p2wpkh_growth_rate".to_string()), + p2wsh: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "p2wsh_growth_rate".to_string()), + p2tr: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "p2tr_growth_rate".to_string()), + p2a: AverageHeightMaxMedianMinP10P25P75P90Pattern::new(client.clone(), "p2a_growth_rate".to_string()), } } } @@ -6818,15 +6831,15 @@ impl MetricsTree_Supply { /// Metrics tree node. pub struct MetricsTree_Supply_Burned { - pub opreturn: BtcSatsUsdPattern2, - pub unspendable: BtcSatsUsdPattern2, + pub opreturn: BtcSatsUsdPattern4, + pub unspendable: BtcSatsUsdPattern4, } impl MetricsTree_Supply_Burned { pub fn new(client: Arc, base_path: String) -> Self { Self { - opreturn: BtcSatsUsdPattern2::new(client.clone(), "opreturn_supply".to_string()), - unspendable: BtcSatsUsdPattern2::new(client.clone(), "unspendable_supply".to_string()), + opreturn: BtcSatsUsdPattern4::new(client.clone(), "opreturn_supply".to_string()), + unspendable: BtcSatsUsdPattern4::new(client.clone(), "unspendable_supply".to_string()), } } } diff --git a/crates/brk_computer/src/distribution/compute/block_loop.rs b/crates/brk_computer/src/distribution/compute/block_loop.rs index 269b6c9d8..b1aaa3534 100644 --- a/crates/brk_computer/src/distribution/compute/block_loop.rs +++ b/crates/brk_computer/src/distribution/compute/block_loop.rs @@ -67,8 +67,8 @@ pub(crate) fn process_blocks( // From transactions and inputs/outputs (via .height or .height.sum_cumulative.sum patterns): let height_to_tx_count = &transactions.count.tx_count.height; - let height_to_output_count = &outputs.count.total_count.height.sum_cumulative.sum.0; - let height_to_input_count = &inputs.count.height.sum_cumulative.sum.0; + let height_to_output_count = &outputs.count.total_count.full.sum_cumulative.sum.0; + let height_to_input_count = &inputs.count.full.sum_cumulative.sum.0; // From blocks: let height_to_timestamp = &blocks.time.timestamp_monotonic; let height_to_date = &blocks.time.date; diff --git a/crates/brk_computer/src/distribution/metrics/cost_basis/with_extended.rs b/crates/brk_computer/src/distribution/metrics/cost_basis/with_extended.rs index fa65c6b75..8d33bb15c 100644 --- a/crates/brk_computer/src/distribution/metrics/cost_basis/with_extended.rs +++ b/crates/brk_computer/src/distribution/metrics/cost_basis/with_extended.rs @@ -10,7 +10,6 @@ use super::{CostBasisBase, CostBasisExtended}; /// Cost basis metrics with guaranteed extended (no Option). #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct CostBasisWithExtended { #[deref] #[deref_mut] @@ -31,5 +30,4 @@ impl CostBasisWithExtended { pub(crate) fn validate_computed_versions(&mut self, base_version: Version) -> Result<()> { self.extended.validate_computed_versions(base_version) } - } diff --git a/crates/brk_computer/src/distribution/metrics/realized/with_adjusted.rs b/crates/brk_computer/src/distribution/metrics/realized/with_adjusted.rs index 63b10f435..1009f40ea 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/with_adjusted.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/with_adjusted.rs @@ -12,7 +12,6 @@ use super::{RealizedAdjusted, RealizedBase}; /// Realized metrics with guaranteed adjusted (no Option). #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct RealizedWithAdjusted { #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/distribution/metrics/realized/with_extended.rs b/crates/brk_computer/src/distribution/metrics/realized/with_extended.rs index e512b85d4..f4522639e 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/with_extended.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/with_extended.rs @@ -12,7 +12,6 @@ use super::{RealizedBase, RealizedExtended}; /// Realized metrics with guaranteed extended (no Option). #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct RealizedWithExtended { #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/distribution/metrics/realized/with_extended_adjusted.rs b/crates/brk_computer/src/distribution/metrics/realized/with_extended_adjusted.rs index fcd0ff0eb..d09e491ff 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/with_extended_adjusted.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/with_extended_adjusted.rs @@ -12,7 +12,6 @@ use super::{RealizedAdjusted, RealizedBase, RealizedExtended}; /// Realized metrics with guaranteed extended AND adjusted (no Options). #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct RealizedWithExtendedAdjusted { #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/distribution/metrics/relative/for_all.rs b/crates/brk_computer/src/distribution/metrics/relative/for_all.rs index 87e932d3c..677b884a0 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/for_all.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/for_all.rs @@ -10,7 +10,6 @@ use super::{RelativeBase, RelativeExtendedOwnPnl, RelativePeakRegret}; /// Relative metrics for the "all" cohort (base + own_pnl + peak_regret, NO rel_to_all). #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct RelativeForAll { #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs b/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs index 88690267d..33c1ed195 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/with_extended.rs @@ -7,14 +7,13 @@ use vecdb::{Exit, ReadableVec, Rw, StorageMode}; use crate::distribution::metrics::{ImportConfig, RealizedBase, UnrealizedBase}; use super::{ - RelativeBase, RelativeExtendedOwnMarketCap, RelativeExtendedOwnPnl, - RelativePeakRegret, RelativeToAll, + RelativeBase, RelativeExtendedOwnMarketCap, RelativeExtendedOwnPnl, RelativePeakRegret, + RelativeToAll, }; /// Full extended relative metrics (base + rel_to_all + own_market_cap + own_pnl + peak_regret). /// Used by: sth, lth, age_range cohorts. #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct RelativeWithExtended { #[deref] #[deref_mut] @@ -54,11 +53,26 @@ impl RelativeWithExtended { peak_regret_val: &impl ReadableVec, exit: &Exit, ) -> Result<()> { - self.base.compute(max_from, unrealized, realized, supply_total_sats, market_cap, exit)?; - self.rel_to_all.compute(max_from, unrealized, supply_total_sats, all_supply_sats, exit)?; - self.extended_own_market_cap.compute(max_from, unrealized, own_market_cap, exit)?; + self.base.compute( + max_from, + unrealized, + realized, + supply_total_sats, + market_cap, + exit, + )?; + self.rel_to_all.compute( + max_from, + unrealized, + supply_total_sats, + all_supply_sats, + exit, + )?; + self.extended_own_market_cap + .compute(max_from, unrealized, own_market_cap, exit)?; self.extended_own_pnl.compute(max_from, unrealized, exit)?; - self.peak_regret.compute(max_from, peak_regret_val, market_cap, exit)?; + self.peak_regret + .compute(max_from, peak_regret_val, market_cap, exit)?; Ok(()) } } diff --git a/crates/brk_computer/src/distribution/metrics/relative/with_peak_regret.rs b/crates/brk_computer/src/distribution/metrics/relative/with_peak_regret.rs index f5f5647d8..f70bd99bf 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/with_peak_regret.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/with_peak_regret.rs @@ -11,7 +11,6 @@ use super::{RelativeBase, RelativePeakRegret, RelativeToAll}; /// Relative metrics with rel_to_all + peak_regret (no extended). /// Used by: max_age, min_age cohorts. #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct RelativeWithPeakRegret { #[deref] #[deref_mut] 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 07c606fe6..bec7c65b5 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 @@ -11,7 +11,6 @@ use super::{RelativeBase, RelativeToAll}; /// Relative metrics with rel_to_all (no extended, no peak_regret). /// Used by: epoch, year, type, amount, address cohorts. #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct RelativeWithRelToAll { #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/with_peak_regret.rs b/crates/brk_computer/src/distribution/metrics/unrealized/with_peak_regret.rs index a06f10fde..1690bed95 100644 --- a/crates/brk_computer/src/distribution/metrics/unrealized/with_peak_regret.rs +++ b/crates/brk_computer/src/distribution/metrics/unrealized/with_peak_regret.rs @@ -9,7 +9,6 @@ use super::{UnrealizedBase, UnrealizedPeakRegret}; /// Unrealized metrics with guaranteed peak regret (no Option). #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct UnrealizedWithPeakRegret { #[deref] #[deref_mut] @@ -26,5 +25,4 @@ impl UnrealizedWithPeakRegret { peak_regret_ext: UnrealizedPeakRegret::forced_import(cfg)?, }) } - } diff --git a/crates/brk_computer/src/internal/block_windows.rs b/crates/brk_computer/src/internal/block_windows.rs index f12f340dd..38721be97 100644 --- a/crates/brk_computer/src/internal/block_windows.rs +++ b/crates/brk_computer/src/internal/block_windows.rs @@ -5,11 +5,9 @@ use brk_traversable::Traversable; #[derive(Clone, Traversable)] -#[traversable(merge)] pub struct BlockWindows { #[traversable(rename = "1h")] pub _1h: A, #[traversable(rename = "24h")] pub _24h: B, } - diff --git a/crates/brk_computer/src/internal/distribution_stats.rs b/crates/brk_computer/src/internal/distribution_stats.rs index 841a30419..09a2b71f2 100644 --- a/crates/brk_computer/src/internal/distribution_stats.rs +++ b/crates/brk_computer/src/internal/distribution_stats.rs @@ -5,7 +5,6 @@ use brk_traversable::Traversable; #[derive(Clone, Traversable)] -#[traversable(merge)] pub struct DistributionStats { pub average: A, pub min: B, diff --git a/crates/brk_computer/src/internal/multi/from_height/cumulative.rs b/crates/brk_computer/src/internal/multi/from_height/cumulative.rs index 8e68bba28..71b1ca83d 100644 --- a/crates/brk_computer/src/internal/multi/from_height/cumulative.rs +++ b/crates/brk_computer/src/internal/multi/from_height/cumulative.rs @@ -16,13 +16,11 @@ use crate::{ }; #[derive(Traversable)] -#[traversable(merge)] pub struct ComputedFromHeightCumulative where T: NumericValue + JsonSchema, { pub height: M::Stored>>, - #[traversable(flatten)] pub cumulative: ComputedFromHeightLast, } diff --git a/crates/brk_computer/src/internal/multi/from_height/cumulative_rolling_full.rs b/crates/brk_computer/src/internal/multi/from_height/cumulative_rolling_full.rs index c57e9bd23..c6b8d3b5a 100644 --- a/crates/brk_computer/src/internal/multi/from_height/cumulative_rolling_full.rs +++ b/crates/brk_computer/src/internal/multi/from_height/cumulative_rolling_full.rs @@ -17,15 +17,12 @@ use crate::{ }; #[derive(Traversable)] -#[traversable(merge)] pub struct ComputedFromHeightCumulativeFull where T: NumericValue + JsonSchema, { pub height: M::Stored>>, - #[traversable(flatten)] pub cumulative: ComputedFromHeightLast, - #[traversable(flatten)] pub rolling: RollingFull, } diff --git a/crates/brk_computer/src/internal/multi/from_height/cumulative_rolling_sum.rs b/crates/brk_computer/src/internal/multi/from_height/cumulative_rolling_sum.rs index 0ed09bdf7..90eaa0a2a 100644 --- a/crates/brk_computer/src/internal/multi/from_height/cumulative_rolling_sum.rs +++ b/crates/brk_computer/src/internal/multi/from_height/cumulative_rolling_sum.rs @@ -18,15 +18,12 @@ use crate::{ }; #[derive(Traversable)] -#[traversable(merge)] pub struct ComputedFromHeightCumulativeSum where T: NumericValue + JsonSchema, { pub height: M::Stored>>, - #[traversable(flatten)] pub cumulative: ComputedFromHeightLast, - #[traversable(flatten)] pub rolling: RollingWindows, } diff --git a/crates/brk_computer/src/internal/multi/from_height/distribution.rs b/crates/brk_computer/src/internal/multi/from_height/distribution.rs index 0964c2a71..e02e2d8cd 100644 --- a/crates/brk_computer/src/internal/multi/from_height/distribution.rs +++ b/crates/brk_computer/src/internal/multi/from_height/distribution.rs @@ -16,7 +16,6 @@ use crate::indexes; use crate::internal::{ComputedVecValue, NumericValue, RollingDistribution, WindowStarts}; #[derive(Traversable)] -#[traversable(merge)] pub struct ComputedFromHeightDistribution where T: ComputedVecValue + PartialOrd + JsonSchema, diff --git a/crates/brk_computer/src/internal/multi/from_height/full.rs b/crates/brk_computer/src/internal/multi/from_height/full.rs index 197e05252..3de520081 100644 --- a/crates/brk_computer/src/internal/multi/from_height/full.rs +++ b/crates/brk_computer/src/internal/multi/from_height/full.rs @@ -17,14 +17,12 @@ use crate::{ }; #[derive(Traversable)] -#[traversable(merge)] pub struct ComputedFromHeightFull where T: NumericValue + JsonSchema, { #[traversable(flatten)] - pub height: Full, - #[traversable(flatten)] + pub full: Full, pub rolling: RollingFull, } @@ -45,7 +43,10 @@ where let height = Full::forced_import(db, name, v)?; let rolling = RollingFull::forced_import(db, name, v, indexes)?; - Ok(Self { height, rolling }) + Ok(Self { + full: height, + rolling, + }) } /// Compute Full stats via closure, then rolling windows from the per-block sum. @@ -60,11 +61,11 @@ where T: From + Default + SubAssign + Copy + Ord, f64: From, { - compute_full(&mut self.height)?; + compute_full(&mut self.full)?; self.rolling.compute( max_from, windows, - self.height.sum_cumulative.sum.inner(), + self.full.sum_cumulative.sum.inner(), exit, )?; Ok(()) diff --git a/crates/brk_computer/src/internal/multi/from_height/lazy_computed_full.rs b/crates/brk_computer/src/internal/multi/from_height/lazy_computed_full.rs index 3ac777941..eea7e6294 100644 --- a/crates/brk_computer/src/internal/multi/from_height/lazy_computed_full.rs +++ b/crates/brk_computer/src/internal/multi/from_height/lazy_computed_full.rs @@ -18,7 +18,6 @@ const VERSION: Version = Version::ZERO; /// Block full aggregation with lazy height transform + cumulative + rolling windows. #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct LazyComputedFromHeightFull where T: NumericValue + JsonSchema, @@ -47,12 +46,7 @@ where let height = LazyVecFrom1::transformed::(name, v, source.read_only_boxed_clone()); - let rest = ComputedHeightDerivedCumulativeFull::forced_import( - db, - name, - v, - indexes, - )?; + let rest = ComputedHeightDerivedCumulativeFull::forced_import(db, name, v, indexes)?; Ok(Self { height, diff --git a/crates/brk_computer/src/internal/multi/from_height/price.rs b/crates/brk_computer/src/internal/multi/from_height/price.rs index e5704925a..2e46e76d6 100644 --- a/crates/brk_computer/src/internal/multi/from_height/price.rs +++ b/crates/brk_computer/src/internal/multi/from_height/price.rs @@ -17,9 +17,7 @@ use crate::{ /// Generic price metric with both USD and sats representations. #[derive(Clone, Traversable)] -#[traversable(merge)] pub struct Price { - #[traversable(flatten)] pub usd: U, pub sats: LazyFromHeightLast, } @@ -65,4 +63,3 @@ where Self { usd, sats } } } - diff --git a/crates/brk_computer/src/internal/multi/from_height/ratio/extended.rs b/crates/brk_computer/src/internal/multi/from_height/ratio/extended.rs index 2bf34fe8e..15dca546a 100644 --- a/crates/brk_computer/src/internal/multi/from_height/ratio/extended.rs +++ b/crates/brk_computer/src/internal/multi/from_height/ratio/extended.rs @@ -9,7 +9,6 @@ use crate::{ComputeIndexes, blocks, indexes, prices}; use super::{ComputedFromHeightRatio, ComputedFromHeightRatioExtension}; #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct ComputedFromHeightRatioExtended { #[deref] #[deref_mut] @@ -44,12 +43,8 @@ impl ComputedFromHeightRatioExtended { let close_price = &prices.usd.price; self.base .compute_ratio(starting_indexes, close_price, metric_price, exit)?; - self.extended.compute_rest( - blocks, - starting_indexes, - exit, - &self.base.ratio.height, - )?; + self.extended + .compute_rest(blocks, starting_indexes, exit, &self.base.ratio.height)?; self.extended .compute_usd_bands(starting_indexes, metric_price, exit)?; Ok(()) diff --git a/crates/brk_computer/src/internal/multi/from_height/ratio/price_extended.rs b/crates/brk_computer/src/internal/multi/from_height/ratio/price_extended.rs index f2d252aa5..15225738d 100644 --- a/crates/brk_computer/src/internal/multi/from_height/ratio/price_extended.rs +++ b/crates/brk_computer/src/internal/multi/from_height/ratio/price_extended.rs @@ -10,7 +10,6 @@ use crate::{ComputeIndexes, blocks, indexes, prices}; use super::ComputedFromHeightRatioExtended; #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct ComputedFromHeightPriceWithRatioExtended { #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/internal/multi/from_height/stddev/extended.rs b/crates/brk_computer/src/internal/multi/from_height/stddev/extended.rs index 1625d07e4..e4286ccb2 100644 --- a/crates/brk_computer/src/internal/multi/from_height/stddev/extended.rs +++ b/crates/brk_computer/src/internal/multi/from_height/stddev/extended.rs @@ -1,7 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; use brk_types::{Dollars, Height, StoredF32, Version}; -use vecdb::{AnyStoredVec, AnyVec, Database, EagerVec, Exit, PcoVec, ReadableVec, Rw, StorageMode, VecIndex, WritableVec}; +use vecdb::{ + AnyStoredVec, AnyVec, Database, EagerVec, Exit, PcoVec, ReadableVec, Rw, StorageMode, VecIndex, + WritableVec, +}; use crate::{ComputeIndexes, blocks, indexes}; @@ -10,7 +13,6 @@ use crate::internal::{ComputedFromHeightLast, Price}; use super::ComputedFromHeightStdDev; #[derive(Traversable)] -#[traversable(merge)] pub struct ComputedFromHeightStdDevExtended { #[traversable(flatten)] pub base: ComputedFromHeightStdDev, @@ -68,12 +70,7 @@ impl ComputedFromHeightStdDevExtended { macro_rules! import_usd { ($suffix:expr) => { - Price::forced_import( - db, - &format!("{name}_{}", $suffix), - version, - indexes, - )? + Price::forced_import(db, &format!("{name}_{}", $suffix), version, indexes)? }; } @@ -115,7 +112,8 @@ impl ComputedFromHeightStdDevExtended { exit: &Exit, source: &impl ReadableVec, ) -> Result<()> { - self.base.compute_all(blocks, starting_indexes, exit, source)?; + self.base + .compute_all(blocks, starting_indexes, exit, source)?; let sma_opt: Option<&EagerVec>> = None; self.compute_bands(starting_indexes, exit, sma_opt, source) @@ -148,37 +146,54 @@ impl ComputedFromHeightStdDevExtended { let source_len = source.len(); let source_data = source.collect_range_at(start, source_len); - let sma_len = sma_opt.map(|s| s.len()).unwrap_or(self.base.sma.height.len()); + let sma_len = sma_opt + .map(|s| s.len()) + .unwrap_or(self.base.sma.height.len()); let sma_data: Vec = if let Some(sma) = sma_opt { sma.collect_range_at(start, sma_len) } else { self.base.sma.height.collect_range_at(start, sma_len) }; - let sd_data = self.base.sd.height.collect_range_at(start, self.base.sd.height.len()); + let sd_data = self + .base + .sd + .height + .collect_range_at(start, self.base.sd.height.len()); for (offset, _ratio) in source_data.into_iter().enumerate() { let index = start + offset; let average = sma_data[offset]; let sd = sd_data[offset]; - self.p0_5sd.height.truncate_push_at(index, average + StoredF32::from(0.5 * *sd))?; + self.p0_5sd + .height + .truncate_push_at(index, average + StoredF32::from(0.5 * *sd))?; self.p1sd.height.truncate_push_at(index, average + sd)?; - self.p1_5sd.height.truncate_push_at(index, average + StoredF32::from(1.5 * *sd))?; + self.p1_5sd + .height + .truncate_push_at(index, average + StoredF32::from(1.5 * *sd))?; self.p2sd.height.truncate_push_at(index, average + 2 * sd)?; - self.p2_5sd.height.truncate_push_at(index, average + StoredF32::from(2.5 * *sd))?; + self.p2_5sd + .height + .truncate_push_at(index, average + StoredF32::from(2.5 * *sd))?; self.p3sd.height.truncate_push_at(index, average + 3 * sd)?; - self.m0_5sd.height.truncate_push_at(index, average - StoredF32::from(0.5 * *sd))?; + self.m0_5sd + .height + .truncate_push_at(index, average - StoredF32::from(0.5 * *sd))?; self.m1sd.height.truncate_push_at(index, average - sd)?; - self.m1_5sd.height.truncate_push_at(index, average - StoredF32::from(1.5 * *sd))?; + self.m1_5sd + .height + .truncate_push_at(index, average - StoredF32::from(1.5 * *sd))?; self.m2sd.height.truncate_push_at(index, average - 2 * sd)?; - self.m2_5sd.height.truncate_push_at(index, average - StoredF32::from(2.5 * *sd))?; + self.m2_5sd + .height + .truncate_push_at(index, average - StoredF32::from(2.5 * *sd))?; self.m3sd.height.truncate_push_at(index, average - 3 * sd)?; } { let _lock = exit.lock(); - self.mut_band_height_vecs() - .try_for_each(|v| v.flush())?; + self.mut_band_height_vecs().try_for_each(|v| v.flush())?; } if let Some(sma) = sma_opt { @@ -213,7 +228,8 @@ impl ComputedFromHeightStdDevExtended { macro_rules! compute_band { ($usd_field:ident, $band_source:expr) => { - self.$usd_field.usd + self.$usd_field + .usd .compute_binary::( starting_indexes.height, metric_price, diff --git a/crates/brk_computer/src/internal/multi/from_height/value_last_rolling.rs b/crates/brk_computer/src/internal/multi/from_height/value_last_rolling.rs index 271a85893..cee15a989 100644 --- a/crates/brk_computer/src/internal/multi/from_height/value_last_rolling.rs +++ b/crates/brk_computer/src/internal/multi/from_height/value_last_rolling.rs @@ -16,7 +16,6 @@ use crate::{ }; #[derive(Deref, DerefMut, Traversable)] -#[traversable(merge)] pub struct ValueFromHeightLastRolling { #[deref] #[deref_mut] diff --git a/crates/brk_computer/src/internal/multi/from_tx/distribution.rs b/crates/brk_computer/src/internal/multi/from_tx/distribution.rs index 1ec91271a..40f4ddffa 100644 --- a/crates/brk_computer/src/internal/multi/from_tx/distribution.rs +++ b/crates/brk_computer/src/internal/multi/from_tx/distribution.rs @@ -1,11 +1,14 @@ -//! LazyFromTxDistribution - lazy txindex source + computed distribution. +//! ComputedFromTxDistribution - stored per-tx EagerVec + computed distribution. +//! +//! Like LazyFromTxDistribution, but the per-tx source is eagerly computed +//! and stored rather than lazily derived. use brk_error::Result; use brk_indexer::Indexer; use brk_traversable::Traversable; use brk_types::TxIndex; use schemars::JsonSchema; -use vecdb::{Database, Exit, LazyVecFrom2, ReadableVec, Rw, StorageMode, Version}; +use vecdb::{Database, EagerVec, Exit, ImportableVec, PcoVec, Rw, StorageMode, Version}; use crate::{ ComputeIndexes, indexes, @@ -13,30 +16,21 @@ use crate::{ }; #[derive(Traversable)] -#[traversable(merge)] -pub struct LazyFromTxDistribution +pub struct ComputedFromTxDistribution where T: ComputedVecValue + PartialOrd + JsonSchema, - S1: ComputedVecValue, - S2: ComputedVecValue, { - pub txindex: LazyVecFrom2, + pub txindex: M::Stored>>, #[traversable(flatten)] pub distribution: TxDerivedDistribution, } -impl LazyFromTxDistribution +impl ComputedFromTxDistribution where T: NumericValue + JsonSchema, - S1: ComputedVecValue + JsonSchema, - S2: ComputedVecValue + JsonSchema, { - pub(crate) fn forced_import( - db: &Database, - name: &str, - version: Version, - txindex: LazyVecFrom2, - ) -> Result { + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { + let txindex = EagerVec::forced_import(db, name, version)?; let distribution = TxDerivedDistribution::forced_import(db, name, version)?; Ok(Self { txindex, @@ -44,26 +38,28 @@ where }) } - pub(crate) fn derive_from( + #[allow(clippy::too_many_arguments)] + pub(crate) fn derive_from_with_skip( &mut self, indexer: &Indexer, indexes: &indexes::Vecs, starting_indexes: &ComputeIndexes, block_windows: &BlockWindowStarts<'_>, exit: &Exit, + skip_count: usize, ) -> Result<()> where T: Copy + Ord + From + Default, f64: From, - LazyVecFrom2: ReadableVec, { - self.distribution.derive_from( + self.distribution.derive_from_with_skip( indexer, indexes, starting_indexes, block_windows, &self.txindex, exit, + skip_count, ) } } diff --git a/crates/brk_computer/src/internal/multi/from_tx/lazy_distribution.rs b/crates/brk_computer/src/internal/multi/from_tx/lazy_distribution.rs new file mode 100644 index 000000000..4f6c5d0d7 --- /dev/null +++ b/crates/brk_computer/src/internal/multi/from_tx/lazy_distribution.rs @@ -0,0 +1,68 @@ +//! LazyFromTxDistribution - lazy txindex source + computed distribution. + +use brk_error::Result; +use brk_indexer::Indexer; +use brk_traversable::Traversable; +use brk_types::TxIndex; +use schemars::JsonSchema; +use vecdb::{Database, Exit, LazyVecFrom2, ReadableVec, Rw, StorageMode, Version}; + +use crate::{ + ComputeIndexes, indexes, + internal::{BlockWindowStarts, ComputedVecValue, NumericValue, TxDerivedDistribution}, +}; + +#[derive(Traversable)] +pub struct LazyFromTxDistribution +where + T: ComputedVecValue + PartialOrd + JsonSchema, + S1: ComputedVecValue, + S2: ComputedVecValue, +{ + pub txindex: LazyVecFrom2, + #[traversable(flatten)] + pub distribution: TxDerivedDistribution, +} + +impl LazyFromTxDistribution +where + T: NumericValue + JsonSchema, + S1: ComputedVecValue + JsonSchema, + S2: ComputedVecValue + JsonSchema, +{ + pub(crate) fn forced_import( + db: &Database, + name: &str, + version: Version, + txindex: LazyVecFrom2, + ) -> Result { + let distribution = TxDerivedDistribution::forced_import(db, name, version)?; + Ok(Self { + txindex, + distribution, + }) + } + + pub(crate) fn derive_from( + &mut self, + indexer: &Indexer, + indexes: &indexes::Vecs, + starting_indexes: &ComputeIndexes, + block_windows: &BlockWindowStarts<'_>, + exit: &Exit, + ) -> Result<()> + where + T: Copy + Ord + From + Default, + f64: From, + LazyVecFrom2: ReadableVec, + { + self.distribution.derive_from( + indexer, + indexes, + starting_indexes, + block_windows, + &self.txindex, + exit, + ) + } +} diff --git a/crates/brk_computer/src/internal/multi/from_tx/mod.rs b/crates/brk_computer/src/internal/multi/from_tx/mod.rs index 79fe1f2d5..8405ee007 100644 --- a/crates/brk_computer/src/internal/multi/from_tx/mod.rs +++ b/crates/brk_computer/src/internal/multi/from_tx/mod.rs @@ -1,3 +1,5 @@ mod distribution; +mod lazy_distribution; pub use distribution::*; +pub use lazy_distribution::*; diff --git a/crates/brk_computer/src/internal/multi/height_derived/cumulative_full.rs b/crates/brk_computer/src/internal/multi/height_derived/cumulative_full.rs index bf177f33f..42f378e28 100644 --- a/crates/brk_computer/src/internal/multi/height_derived/cumulative_full.rs +++ b/crates/brk_computer/src/internal/multi/height_derived/cumulative_full.rs @@ -17,12 +17,10 @@ use crate::{ }; #[derive(Traversable)] -#[traversable(merge)] pub struct ComputedHeightDerivedCumulativeFull where T: NumericValue + JsonSchema, { - #[traversable(flatten)] pub cumulative: ComputedFromHeightLast, #[traversable(flatten)] pub rolling: RollingFull, diff --git a/crates/brk_computer/src/internal/multi/tx_derived/distribution.rs b/crates/brk_computer/src/internal/multi/tx_derived/distribution.rs index a4508ae41..e370da88d 100644 --- a/crates/brk_computer/src/internal/multi/tx_derived/distribution.rs +++ b/crates/brk_computer/src/internal/multi/tx_derived/distribution.rs @@ -13,11 +13,12 @@ use vecdb::{Database, Exit, ReadableVec, Rw, StorageMode, Version}; use crate::{ ComputeIndexes, indexes, - internal::{BlockRollingDistribution, BlockWindowStarts, ComputedVecValue, Distribution, NumericValue}, + internal::{ + BlockRollingDistribution, BlockWindowStarts, ComputedVecValue, Distribution, NumericValue, + }, }; #[derive(Traversable)] -#[traversable(merge)] pub struct TxDerivedDistribution where T: ComputedVecValue + PartialOrd + JsonSchema, @@ -31,11 +32,7 @@ impl TxDerivedDistribution where T: NumericValue + JsonSchema, { - pub(crate) fn forced_import( - db: &Database, - name: &str, - version: Version, - ) -> Result { + pub(crate) fn forced_import(db: &Database, name: &str, version: Version) -> Result { let block = Distribution::forced_import(db, name, version)?; let rolling = BlockRollingDistribution::forced_import(db, name, version)?; diff --git a/crates/brk_computer/src/internal/single/rolling/full.rs b/crates/brk_computer/src/internal/single/rolling/full.rs index 69e827b16..3d32569f7 100644 --- a/crates/brk_computer/src/internal/single/rolling/full.rs +++ b/crates/brk_computer/src/internal/single/rolling/full.rs @@ -18,12 +18,10 @@ use crate::{ /// Sum (4 windows) + Distribution (8 stats × 4 windows) = 36 stored height vecs. #[derive(Traversable)] -#[traversable(merge)] pub struct RollingFull where T: ComputedVecValue + PartialOrd + JsonSchema, { - #[traversable(flatten)] pub sum: RollingWindows, #[traversable(flatten)] pub distribution: RollingDistribution, diff --git a/crates/brk_computer/src/internal/single/vec/cumulative.rs b/crates/brk_computer/src/internal/single/vec/cumulative.rs index b8e6193af..e35a1be4a 100644 --- a/crates/brk_computer/src/internal/single/vec/cumulative.rs +++ b/crates/brk_computer/src/internal/single/vec/cumulative.rs @@ -24,11 +24,6 @@ impl CumulativeVec { )?)) } - #[inline] - pub(crate) fn inner(&self) -> &EagerVec> { - &self.0 - } - pub fn read_only_clone(&self) -> CumulativeVec { CumulativeVec(StoredVec::read_only_clone(&self.0)) } diff --git a/crates/brk_computer/src/internal/windows.rs b/crates/brk_computer/src/internal/windows.rs index 01cde46c9..0f84f7941 100644 --- a/crates/brk_computer/src/internal/windows.rs +++ b/crates/brk_computer/src/internal/windows.rs @@ -5,7 +5,6 @@ use brk_traversable::Traversable; #[derive(Clone, Traversable)] -#[traversable(merge)] pub struct Windows { #[traversable(rename = "24h")] pub _24h: A, diff --git a/crates/brk_computer/src/lib.rs b/crates/brk_computer/src/lib.rs index a3ef4c7c9..f22f1eef8 100644 --- a/crates/brk_computer/src/lib.rs +++ b/crates/brk_computer/src/lib.rs @@ -359,7 +359,6 @@ impl Computer { &self.blocks, &self.prices, &self.mining, - &self.transactions, &starting_indexes_clone, exit, )?; diff --git a/crates/brk_computer/src/mining/compute.rs b/crates/brk_computer/src/mining/compute.rs index b5c0de1e7..0c9be771f 100644 --- a/crates/brk_computer/src/mining/compute.rs +++ b/crates/brk_computer/src/mining/compute.rs @@ -28,12 +28,11 @@ impl Vecs { exit, )?; - // Hashrate metrics (disjoint field borrow via coinbase_sum) self.hashrate.compute( &blocks.count, &blocks.difficulty, - &self.rewards.coinbase_sum._24h.sats.height, - &self.rewards.coinbase_sum._24h.usd.height, + &self.rewards.coinbase.sats.rolling.sum._24h.height, + &self.rewards.coinbase.usd.rolling.sum._24h.height, starting_indexes, exit, )?; diff --git a/crates/brk_computer/src/mining/rewards/compute.rs b/crates/brk_computer/src/mining/rewards/compute.rs index a5c04dfd2..0f768c07a 100644 --- a/crates/brk_computer/src/mining/rewards/compute.rs +++ b/crates/brk_computer/src/mining/rewards/compute.rs @@ -20,77 +20,93 @@ impl Vecs { ) -> Result<()> { let window_starts = count_vecs.window_starts(); - self.coinbase.compute(starting_indexes.height, &window_starts, prices, exit, |vec| { - // Cursors avoid per-height PcoVec page decompression for the - // tx-indexed lookups. Coinbase txindex values are strictly - // increasing, so the cursors only advance forward. - let mut txout_cursor = indexer.vecs.transactions.first_txoutindex.cursor(); - let mut count_cursor = indexes.txindex.output_count.cursor(); - - vec.compute_transform( - starting_indexes.height, - &indexer.vecs.transactions.first_txindex, - |(height, txindex, ..)| { - let ti = txindex.to_usize(); - - txout_cursor.advance(ti - txout_cursor.position()); - let first_txoutindex = txout_cursor.next().unwrap().to_usize(); - - count_cursor.advance(ti - count_cursor.position()); - let output_count: usize = count_cursor.next().unwrap().into(); - - let sats = indexer.vecs.outputs.value.fold_range_at( - first_txoutindex, - first_txoutindex + output_count, - Sats::ZERO, - |acc, v| acc + v, - ); - (height, sats) - }, - exit, - )?; - Ok(()) - })?; - - self.coinbase_sum.compute_rolling_sum( + self.coinbase.compute( starting_indexes.height, &window_starts, - &self.coinbase.sats.height, - &self.coinbase.usd.height, + prices, exit, + |vec| { + // Cursors avoid per-height PcoVec page decompression for the + // tx-indexed lookups. Coinbase txindex values are strictly + // increasing, so the cursors only advance forward. + let mut txout_cursor = indexer.vecs.transactions.first_txoutindex.cursor(); + let mut count_cursor = indexes.txindex.output_count.cursor(); + + vec.compute_transform( + starting_indexes.height, + &indexer.vecs.transactions.first_txindex, + |(height, txindex, ..)| { + let ti = txindex.to_usize(); + + txout_cursor.advance(ti - txout_cursor.position()); + let first_txoutindex = txout_cursor.next().unwrap().to_usize(); + + count_cursor.advance(ti - count_cursor.position()); + let output_count: usize = count_cursor.next().unwrap().into(); + + let sats = indexer.vecs.outputs.value.fold_range_at( + first_txoutindex, + first_txoutindex + output_count, + Sats::ZERO, + |acc, v| acc + v, + ); + (height, sats) + }, + exit, + )?; + Ok(()) + }, )?; - let fee_sats_source = transactions_fees.fee.height.sum_cumulative.sum.inner(); - let fee_usd_source = &transactions_fees.fee_usd_sum; - self.fee_sum.compute_rolling_sum( + // Coinbase fee is 0, so including it in the sum doesn't affect the result + self.fees.compute( starting_indexes.height, &window_starts, - fee_sats_source, - fee_usd_source, + prices, exit, + |vec| { + vec.compute_sum_from_indexes( + starting_indexes.height, + &indexer.vecs.transactions.first_txindex, + &indexes.height.txindex_count, + &transactions_fees.fee.txindex, + exit, + )?; + Ok(()) + }, )?; - self.subsidy.compute(starting_indexes.height, &window_starts, prices, exit, |vec| { - vec.compute_transform2( - starting_indexes.height, - &self.coinbase.sats.height, - transactions_fees.fee.height.sum_cumulative.sum.inner(), - |(height, coinbase, fees, ..)| { - ( - height, - coinbase.checked_sub(fees).unwrap_or_else(|| { - dbg!(height, coinbase, fees); - panic!() - }), - ) - }, - exit, - )?; - Ok(()) - })?; + self.subsidy.compute( + starting_indexes.height, + &window_starts, + prices, + exit, + |vec| { + vec.compute_transform2( + starting_indexes.height, + &self.coinbase.sats.height, + &self.fees.sats.height, + |(height, coinbase, fees, ..)| { + ( + height, + coinbase.checked_sub(fees).unwrap_or_else(|| { + dbg!(height, coinbase, fees); + panic!() + }), + ) + }, + exit, + )?; + Ok(()) + }, + )?; - self.unclaimed_rewards - .compute(starting_indexes.height, &window_starts, prices, exit, |vec| { + self.unclaimed_rewards.compute( + starting_indexes.height, + &window_starts, + prices, + exit, + |vec| { vec.compute_transform( starting_indexes.height, &self.subsidy.sats.height, @@ -102,12 +118,13 @@ impl Vecs { exit, )?; Ok(()) - })?; + }, + )?; // All-time cumulative fee dominance self.fee_dominance.height.compute_percentage( starting_indexes.height, - transactions_fees.fee.height.sum_cumulative.cumulative.inner(), + &self.fees.sats.cumulative.height, &self.coinbase.sats.cumulative.height, exit, )?; @@ -115,26 +132,26 @@ impl Vecs { // Rolling fee dominance = sum(fees) / sum(coinbase) * 100 self.fee_dominance_24h.height.compute_percentage( starting_indexes.height, - &self.fee_sum._24h.sats.height, - &self.coinbase_sum._24h.sats.height, + &self.fees.sats.rolling.sum._24h.height, + &self.coinbase.sats.rolling.sum._24h.height, exit, )?; self.fee_dominance_7d.height.compute_percentage( starting_indexes.height, - &self.fee_sum._7d.sats.height, - &self.coinbase_sum._7d.sats.height, + &self.fees.sats.rolling.sum._7d.height, + &self.coinbase.sats.rolling.sum._7d.height, exit, )?; self.fee_dominance_30d.height.compute_percentage( starting_indexes.height, - &self.fee_sum._30d.sats.height, - &self.coinbase_sum._30d.sats.height, + &self.fees.sats.rolling.sum._30d.height, + &self.coinbase.sats.rolling.sum._30d.height, exit, )?; self.fee_dominance_1y.height.compute_percentage( starting_indexes.height, - &self.fee_sum._1y.sats.height, - &self.coinbase_sum._1y.sats.height, + &self.fees.sats.rolling.sum._1y.height, + &self.coinbase.sats.rolling.sum._1y.height, exit, )?; diff --git a/crates/brk_computer/src/mining/rewards/import.rs b/crates/brk_computer/src/mining/rewards/import.rs index 9c09b3128..79ae238d0 100644 --- a/crates/brk_computer/src/mining/rewards/import.rs +++ b/crates/brk_computer/src/mining/rewards/import.rs @@ -5,7 +5,10 @@ use vecdb::Database; use super::Vecs; use crate::{ indexes, - internal::{ComputedFromHeightLast, StoredValueRollingWindows, ValueFromHeightFull, ValueFromHeightSumCumulative}, + internal::{ + ComputedFromHeightLast, ValueFromHeightFull, + ValueFromHeightSumCumulative, + }, }; impl Vecs { @@ -15,10 +18,9 @@ impl Vecs { indexes: &indexes::Vecs, ) -> Result { Ok(Self { - coinbase_sum: StoredValueRollingWindows::forced_import(db, "coinbase_sum", version, indexes)?, - fee_sum: StoredValueRollingWindows::forced_import(db, "fee_sum", version, indexes)?, coinbase: ValueFromHeightFull::forced_import(db, "coinbase", version, indexes)?, subsidy: ValueFromHeightFull::forced_import(db, "subsidy", version, indexes)?, + fees: ValueFromHeightFull::forced_import(db, "fees", version, indexes)?, unclaimed_rewards: ValueFromHeightSumCumulative::forced_import( db, "unclaimed_rewards", diff --git a/crates/brk_computer/src/mining/rewards/vecs.rs b/crates/brk_computer/src/mining/rewards/vecs.rs index 2bba9788c..d030c6aa4 100644 --- a/crates/brk_computer/src/mining/rewards/vecs.rs +++ b/crates/brk_computer/src/mining/rewards/vecs.rs @@ -2,15 +2,17 @@ use brk_traversable::Traversable; use brk_types::{Dollars, StoredF32}; use vecdb::{Rw, StorageMode}; -use crate::internal::{ComputedFromHeightLast, StoredValueRollingWindows, ValueFromHeightFull, ValueFromHeightSumCumulative}; +use crate::internal::{ + ComputedFromHeightLast, ValueFromHeightFull, + ValueFromHeightSumCumulative, +}; /// Coinbase/subsidy/rewards metrics #[derive(Traversable)] pub struct Vecs { - pub coinbase_sum: StoredValueRollingWindows, - pub fee_sum: StoredValueRollingWindows, pub coinbase: ValueFromHeightFull, pub subsidy: ValueFromHeightFull, + pub fees: ValueFromHeightFull, pub unclaimed_rewards: ValueFromHeightSumCumulative, pub fee_dominance: ComputedFromHeightLast, pub fee_dominance_24h: ComputedFromHeightLast, diff --git a/crates/brk_computer/src/outputs/count/compute.rs b/crates/brk_computer/src/outputs/count/compute.rs index 7bb88ed63..ee5516a63 100644 --- a/crates/brk_computer/src/outputs/count/compute.rs +++ b/crates/brk_computer/src/outputs/count/compute.rs @@ -19,11 +19,8 @@ impl Vecs { exit: &Exit, ) -> Result<()> { let window_starts = blocks.count.window_starts(); - self.total_count.compute( - starting_indexes.height, - &window_starts, - exit, - |full| { + self.total_count + .compute(starting_indexes.height, &window_starts, exit, |full| { full.compute_with_skip( starting_indexes.height, &indexes.txindex.output_count, @@ -32,13 +29,12 @@ impl Vecs { exit, 0, ) - }, - )?; + })?; self.utxo_count.height.compute_transform3( starting_indexes.height, - &*self.total_count.height.sum_cumulative.cumulative, - &*inputs_count.height.sum_cumulative.cumulative, + &*self.total_count.full.sum_cumulative.cumulative, + &*inputs_count.full.sum_cumulative.cumulative, &scripts_count.opreturn.cumulative.height, |(h, output_count, input_count, opreturn_count, ..)| { let block_count = u64::from(h + 1_usize); diff --git a/crates/brk_computer/src/pools/mod.rs b/crates/brk_computer/src/pools/mod.rs index a31e3f0a2..549e58b6e 100644 --- a/crates/brk_computer/src/pools/mod.rs +++ b/crates/brk_computer/src/pools/mod.rs @@ -16,7 +16,7 @@ mod vecs; use crate::{ blocks, indexes::{self, ComputeIndexes}, - mining, prices, transactions, + mining, prices, }; pub const DB_NAME: &str = "pools"; @@ -73,7 +73,6 @@ impl Vecs { blocks: &blocks::Vecs, prices: &prices::Vecs, mining: &mining::Vecs, - transactions: &transactions::Vecs, starting_indexes: &ComputeIndexes, exit: &Exit, ) -> Result<()> { @@ -83,7 +82,6 @@ impl Vecs { blocks, prices, mining, - transactions, starting_indexes, exit, )?; @@ -100,7 +98,6 @@ impl Vecs { blocks: &blocks::Vecs, prices: &prices::Vecs, mining: &mining::Vecs, - transactions: &transactions::Vecs, starting_indexes: &ComputeIndexes, exit: &Exit, ) -> Result<()> { @@ -113,7 +110,6 @@ impl Vecs { blocks, prices, mining, - transactions, exit, ) })?; diff --git a/crates/brk_computer/src/pools/vecs.rs b/crates/brk_computer/src/pools/vecs.rs index 2856ffd86..4053e2653 100644 --- a/crates/brk_computer/src/pools/vecs.rs +++ b/crates/brk_computer/src/pools/vecs.rs @@ -10,7 +10,7 @@ use crate::{ ComputedFromHeightCumulativeSum, ComputedFromHeightLast, MaskSats, PercentageU32F32, ValueFromHeightSumCumulative, }, - mining, prices, transactions, + mining, prices, }; #[derive(Traversable)] @@ -45,8 +45,12 @@ impl Vecs { let suffix = |s: &str| format!("{}_{s}", slug); let version = parent_version; - let blocks_mined = - ComputedFromHeightCumulativeSum::forced_import(db, &suffix("blocks_mined"), version, indexes)?; + let blocks_mined = ComputedFromHeightCumulativeSum::forced_import( + db, + &suffix("blocks_mined"), + version, + indexes, + )?; let blocks_mined_24h_sum = ComputedFromHeightLast::forced_import( db, @@ -76,7 +80,8 @@ impl Vecs { let subsidy = ValueFromHeightSumCumulative::forced_import(db, &suffix("subsidy"), version, indexes)?; - let fee = ValueFromHeightSumCumulative::forced_import(db, &suffix("fee"), version, indexes)?; + let fee = + ValueFromHeightSumCumulative::forced_import(db, &suffix("fee"), version, indexes)?; let coinbase = ValueFromHeightSumCumulative::forced_import(db, &suffix("coinbase"), version, indexes)?; @@ -130,29 +135,29 @@ impl Vecs { blocks: &blocks::Vecs, prices: &prices::Vecs, mining: &mining::Vecs, - transactions: &transactions::Vecs, exit: &Exit, ) -> Result<()> { let window_starts = blocks.count.window_starts(); - self.blocks_mined.compute(starting_indexes.height, &window_starts, exit, |vec| { - vec.compute_transform( - starting_indexes.height, - height_to_pool, - |(h, id, ..)| { - ( - h, - if id == self.slug { - StoredU32::ONE - } else { - StoredU32::ZERO - }, - ) - }, - exit, - )?; - Ok(()) - })?; + self.blocks_mined + .compute(starting_indexes.height, &window_starts, exit, |vec| { + vec.compute_transform( + starting_indexes.height, + height_to_pool, + |(h, id, ..)| { + ( + h, + if id == self.slug { + StoredU32::ONE + } else { + StoredU32::ZERO + }, + ) + }, + exit, + )?; + Ok(()) + })?; // Compute rolling window blocks mined using the start heights from blocks.count self.blocks_mined_24h_sum.height.compute_rolling_sum( @@ -223,8 +228,12 @@ impl Vecs { exit, )?; - self.subsidy - .compute(starting_indexes.height, &window_starts, prices, exit, |vec| { + self.subsidy.compute( + starting_indexes.height, + &window_starts, + prices, + exit, + |vec| { Ok(vec.compute_transform2( starting_indexes.height, &self.blocks_mined.height, @@ -232,20 +241,31 @@ impl Vecs { |(h, mask, val, ..)| (h, MaskSats::apply(mask, val)), exit, )?) - })?; + }, + )?; - self.fee.compute(starting_indexes.height, &window_starts, prices, exit, |vec| { - Ok(vec.compute_transform2( - starting_indexes.height, - &self.blocks_mined.height, - &*transactions.fees.fee.height.sum_cumulative.sum, - |(h, mask, val, ..)| (h, MaskSats::apply(mask, val)), - exit, - )?) - })?; + self.fee.compute( + starting_indexes.height, + &window_starts, + prices, + exit, + |vec| { + Ok(vec.compute_transform2( + starting_indexes.height, + &self.blocks_mined.height, + &mining.rewards.fees.sats.height, + |(h, mask, val, ..)| (h, MaskSats::apply(mask, val)), + exit, + )?) + }, + )?; - self.coinbase - .compute(starting_indexes.height, &window_starts, prices, exit, |vec| { + self.coinbase.compute( + starting_indexes.height, + &window_starts, + prices, + exit, + |vec| { Ok(vec.compute_transform2( starting_indexes.height, &self.blocks_mined.height, @@ -253,7 +273,8 @@ impl Vecs { |(h, mask, val, ..)| (h, MaskSats::apply(mask, val)), exit, )?) - })?; + }, + )?; { let mut prev = StoredU32::ZERO; diff --git a/crates/brk_computer/src/scripts/count/compute.rs b/crates/brk_computer/src/scripts/count/compute.rs index 1cc9f9fca..4260de0f3 100644 --- a/crates/brk_computer/src/scripts/count/compute.rs +++ b/crates/brk_computer/src/scripts/count/compute.rs @@ -5,7 +5,7 @@ use brk_types::StoredU64; use vecdb::Exit; use super::Vecs; -use crate::{blocks, outputs, ComputeIndexes}; +use crate::{ComputeIndexes, blocks, outputs}; impl Vecs { pub(crate) fn compute( @@ -18,133 +18,144 @@ impl Vecs { ) -> Result<()> { let window_starts = count_vecs.window_starts(); - self.p2a.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.addresses.first_p2aaddressindex, - &indexer.vecs.addresses.p2abytes, - exit, - )?) - })?; + self.p2a + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.addresses.first_p2aaddressindex, + &indexer.vecs.addresses.p2abytes, + exit, + )?) + })?; - self.p2ms.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.scripts.first_p2msoutputindex, - &indexer.vecs.scripts.p2ms_to_txindex, - exit, - )?) - })?; + self.p2ms + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.scripts.first_p2msoutputindex, + &indexer.vecs.scripts.p2ms_to_txindex, + exit, + )?) + })?; - self.p2pk33.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.addresses.first_p2pk33addressindex, - &indexer.vecs.addresses.p2pk33bytes, - exit, - )?) - })?; + self.p2pk33 + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.addresses.first_p2pk33addressindex, + &indexer.vecs.addresses.p2pk33bytes, + exit, + )?) + })?; - self.p2pk65.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.addresses.first_p2pk65addressindex, - &indexer.vecs.addresses.p2pk65bytes, - exit, - )?) - })?; + self.p2pk65 + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.addresses.first_p2pk65addressindex, + &indexer.vecs.addresses.p2pk65bytes, + exit, + )?) + })?; - self.p2pkh.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.addresses.first_p2pkhaddressindex, - &indexer.vecs.addresses.p2pkhbytes, - exit, - )?) - })?; + self.p2pkh + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.addresses.first_p2pkhaddressindex, + &indexer.vecs.addresses.p2pkhbytes, + exit, + )?) + })?; - self.p2sh.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.addresses.first_p2shaddressindex, - &indexer.vecs.addresses.p2shbytes, - exit, - )?) - })?; + self.p2sh + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.addresses.first_p2shaddressindex, + &indexer.vecs.addresses.p2shbytes, + exit, + )?) + })?; - self.p2tr.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.addresses.first_p2traddressindex, - &indexer.vecs.addresses.p2trbytes, - exit, - )?) - })?; + self.p2tr + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.addresses.first_p2traddressindex, + &indexer.vecs.addresses.p2trbytes, + exit, + )?) + })?; - self.p2wpkh.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.addresses.first_p2wpkhaddressindex, - &indexer.vecs.addresses.p2wpkhbytes, - exit, - )?) - })?; + self.p2wpkh + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.addresses.first_p2wpkhaddressindex, + &indexer.vecs.addresses.p2wpkhbytes, + exit, + )?) + })?; - self.p2wsh.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.addresses.first_p2wshaddressindex, - &indexer.vecs.addresses.p2wshbytes, - exit, - )?) - })?; + self.p2wsh + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.addresses.first_p2wshaddressindex, + &indexer.vecs.addresses.p2wshbytes, + exit, + )?) + })?; - self.opreturn.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.scripts.first_opreturnindex, - &indexer.vecs.scripts.opreturn_to_txindex, - exit, - )?) - })?; + self.opreturn + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.scripts.first_opreturnindex, + &indexer.vecs.scripts.opreturn_to_txindex, + exit, + )?) + })?; - self.unknownoutput.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.scripts.first_unknownoutputindex, - &indexer.vecs.scripts.unknown_to_txindex, - exit, - )?) - })?; + self.unknownoutput + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.scripts.first_unknownoutputindex, + &indexer.vecs.scripts.unknown_to_txindex, + exit, + )?) + })?; - self.emptyoutput.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_count_from_indexes( - starting_indexes.height, - &indexer.vecs.scripts.first_emptyoutputindex, - &indexer.vecs.scripts.empty_to_txindex, - exit, - )?) - })?; + self.emptyoutput + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_count_from_indexes( + starting_indexes.height, + &indexer.vecs.scripts.first_emptyoutputindex, + &indexer.vecs.scripts.empty_to_txindex, + exit, + )?) + })?; // Compute segwit = p2wpkh + p2wsh + p2tr - self.segwit.compute(starting_indexes.height, &window_starts, exit, |v| { - Ok(v.compute_transform3( - starting_indexes.height, - &self.p2wpkh.height, - &self.p2wsh.height, - &self.p2tr.height, - |(h, p2wpkh, p2wsh, p2tr, ..)| { - (h, StoredU64::from(*p2wpkh + *p2wsh + *p2tr)) - }, - exit, - )?) - })?; + self.segwit + .compute(starting_indexes.height, &window_starts, exit, |v| { + Ok(v.compute_transform3( + starting_indexes.height, + &self.p2wpkh.height, + &self.p2wsh.height, + &self.p2tr.height, + |(h, p2wpkh, p2wsh, p2tr, ..)| (h, StoredU64::from(*p2wpkh + *p2wsh + *p2tr)), + exit, + )?) + })?; // Adoption ratios: per-block ratio of script type / total outputs self.taproot_adoption.height.compute_transform2( starting_indexes.height, &self.p2tr.height, - &outputs_count.total_count.height.sum_cumulative.sum.0, + &outputs_count.total_count.full.sum_cumulative.sum.0, |(h, p2tr, total, ..)| { let ratio = if *total > 0 { StoredF32::from(*p2tr as f64 / *total as f64) @@ -159,7 +170,7 @@ impl Vecs { self.segwit_adoption.height.compute_transform2( starting_indexes.height, &self.segwit.height, - &outputs_count.total_count.height.sum_cumulative.sum.0, + &outputs_count.total_count.full.sum_cumulative.sum.0, |(h, segwit, total, ..)| { let ratio = if *total > 0 { StoredF32::from(*segwit as f64 / *total as f64) diff --git a/crates/brk_computer/src/transactions/compute.rs b/crates/brk_computer/src/transactions/compute.rs index 4c781382b..4286b2457 100644 --- a/crates/brk_computer/src/transactions/compute.rs +++ b/crates/brk_computer/src/transactions/compute.rs @@ -31,14 +31,13 @@ impl Vecs { self.size .compute(indexer, indexes, &blocks.count, starting_indexes, exit)?; - // Fees depends on size, blocks (window starts), prices (USD conversion) + // Fees depends on size, blocks (window starts) self.fees.compute( indexer, indexes, inputs, &self.size, blocks, - prices, starting_indexes, exit, )?; diff --git a/crates/brk_computer/src/transactions/fees/compute.rs b/crates/brk_computer/src/transactions/fees/compute.rs index 32830f923..37515c9e7 100644 --- a/crates/brk_computer/src/transactions/fees/compute.rs +++ b/crates/brk_computer/src/transactions/fees/compute.rs @@ -1,11 +1,11 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{Bitcoin, FeeRate, Sats}; +use brk_types::{FeeRate, Sats}; use vecdb::{Exit, unlikely}; use super::super::size; use super::Vecs; -use crate::{blocks, indexes, inputs, prices, ComputeIndexes}; +use crate::{ComputeIndexes, blocks, indexes, inputs}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -16,7 +16,6 @@ impl Vecs { txins: &inputs::Vecs, size_vecs: &size::Vecs, blocks: &blocks::Vecs, - prices: &prices::Vecs, starting_indexes: &ComputeIndexes, exit: &Exit, ) -> Result<()> { @@ -36,7 +35,7 @@ impl Vecs { exit, )?; - self.fee_txindex.compute_transform2( + self.fee.txindex.compute_transform2( starting_indexes.txindex, &self.input_value, &self.output_value, @@ -51,57 +50,34 @@ impl Vecs { exit, )?; - self.fee_rate_txindex.compute_transform2( + self.fee_rate.txindex.compute_transform2( starting_indexes.txindex, - &self.fee_txindex, + &self.fee.txindex, &size_vecs.vsize.txindex, |(txindex, fee, vsize, ..)| (txindex, FeeRate::from((fee, vsize))), exit, )?; - // Skip coinbase (first tx per block) since it has no fee - let window_starts = blocks.count.window_starts(); - self.fee.compute( - starting_indexes.height, - &window_starts, - exit, - |full| { - full.compute_with_skip( - starting_indexes.height, - &self.fee_txindex, - &indexer.vecs.transactions.first_txindex, - &indexes.height.txindex_count, - exit, - 1, - ) - }, - )?; + let block_windows = blocks.count.block_window_starts(); - // Skip coinbase (first tx per block) since it has no feerate - self.fee_rate.compute_with_skip( - starting_indexes.height, - &self.fee_rate_txindex, - &indexer.vecs.transactions.first_txindex, - &indexes.height.txindex_count, + // Skip coinbase (first tx per block) since it has fee=0 + self.fee.derive_from_with_skip( + indexer, + indexes, + starting_indexes, + &block_windows, exit, 1, )?; - // Compute fee USD sum per block: price * Bitcoin::from(sats) - self.fee_usd_sum.compute_transform2( - starting_indexes.height, - self.fee.height.sum_cumulative.sum.inner(), - &prices.usd.price, - |(h, sats, price, ..)| (h, price * Bitcoin::from(sats)), - exit, - )?; - - // Rolling fee rate distribution (from per-block average) - self.fee_rate_rolling.compute_distribution( - starting_indexes.height, - &window_starts, - &self.fee_rate.average.0, + // Skip coinbase (first tx per block) since it has no feerate + self.fee_rate.derive_from_with_skip( + indexer, + indexes, + starting_indexes, + &block_windows, exit, + 1, )?; Ok(()) diff --git a/crates/brk_computer/src/transactions/fees/import.rs b/crates/brk_computer/src/transactions/fees/import.rs index 7b2fc6369..6ac5d50fc 100644 --- a/crates/brk_computer/src/transactions/fees/import.rs +++ b/crates/brk_computer/src/transactions/fees/import.rs @@ -3,30 +3,19 @@ use brk_types::Version; use vecdb::{Database, EagerVec, ImportableVec}; use super::Vecs; -use crate::{ - indexes, - internal::{ComputedFromHeightFull, Distribution, RollingDistribution}, -}; +use crate::internal::ComputedFromTxDistribution; /// Bump this when fee/feerate aggregation logic changes (e.g., skip coinbase). const VERSION: Version = Version::new(2); impl Vecs { - pub(crate) fn forced_import( - db: &Database, - version: Version, - indexes: &indexes::Vecs, - ) -> Result { + pub(crate) fn forced_import(db: &Database, version: Version) -> Result { let v = version + VERSION; Ok(Self { input_value: EagerVec::forced_import(db, "input_value", version)?, output_value: EagerVec::forced_import(db, "output_value", version)?, - fee_txindex: EagerVec::forced_import(db, "fee", v)?, - fee: ComputedFromHeightFull::forced_import(db, "fee", v, indexes)?, - fee_usd_sum: EagerVec::forced_import(db, "fee_usd_sum", v)?, - fee_rate_txindex: EagerVec::forced_import(db, "fee_rate", v)?, - fee_rate: Distribution::forced_import(db, "fee_rate", v)?, - fee_rate_rolling: RollingDistribution::forced_import(db, "fee_rate", v, indexes)?, + fee: ComputedFromTxDistribution::forced_import(db, "fee", v)?, + fee_rate: ComputedFromTxDistribution::forced_import(db, "fee_rate", v)?, }) } } diff --git a/crates/brk_computer/src/transactions/fees/vecs.rs b/crates/brk_computer/src/transactions/fees/vecs.rs index 35eb21458..126bb7033 100644 --- a/crates/brk_computer/src/transactions/fees/vecs.rs +++ b/crates/brk_computer/src/transactions/fees/vecs.rs @@ -1,17 +1,13 @@ use brk_traversable::Traversable; -use brk_types::{Dollars, FeeRate, Height, Sats, TxIndex}; +use brk_types::{FeeRate, Sats, TxIndex}; use vecdb::{EagerVec, PcoVec, Rw, StorageMode}; -use crate::internal::{ComputedFromHeightFull, Distribution, RollingDistribution}; +use crate::internal::ComputedFromTxDistribution; #[derive(Traversable)] pub struct Vecs { pub input_value: M::Stored>>, pub output_value: M::Stored>>, - pub fee_txindex: M::Stored>>, - pub fee: ComputedFromHeightFull, - pub fee_usd_sum: M::Stored>>, - pub fee_rate_txindex: M::Stored>>, - pub fee_rate: Distribution, - pub fee_rate_rolling: RollingDistribution, + pub fee: ComputedFromTxDistribution, + pub fee_rate: ComputedFromTxDistribution, } diff --git a/crates/brk_computer/src/transactions/import.rs b/crates/brk_computer/src/transactions/import.rs index d4a65e698..9694f0d8d 100644 --- a/crates/brk_computer/src/transactions/import.rs +++ b/crates/brk_computer/src/transactions/import.rs @@ -24,7 +24,7 @@ impl Vecs { let count = CountVecs::forced_import(&db, version, indexer, indexes)?; let size = SizeVecs::forced_import(&db, version, indexer)?; - let fees = FeesVecs::forced_import(&db, version, indexes)?; + let fees = FeesVecs::forced_import(&db, version)?; let versions = VersionsVecs::forced_import(&db, version, indexes)?; let volume = VolumeVecs::forced_import(&db, version, indexes)?; diff --git a/crates/brk_computer/src/transactions/volume/compute.rs b/crates/brk_computer/src/transactions/volume/compute.rs index db524203e..77d9372fd 100644 --- a/crates/brk_computer/src/transactions/volume/compute.rs +++ b/crates/brk_computer/src/transactions/volume/compute.rs @@ -4,8 +4,8 @@ use brk_types::StoredF32; use vecdb::Exit; use super::Vecs; -use crate::{blocks, ComputeIndexes, indexes, inputs, outputs, prices}; use crate::transactions::{count, fees}; +use crate::{ComputeIndexes, blocks, indexes, inputs, outputs, prices}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -87,7 +87,7 @@ impl Vecs { // inputs_per_sec: per-block input count / block interval self.inputs_per_sec.height.compute_transform2( starting_indexes.height, - &inputs_count.height.sum_cumulative.sum.0, + &inputs_count.full.sum_cumulative.sum.0, &blocks.interval.height, |(h, input_count, interval, ..)| { let interval_f64 = f64::from(*interval); @@ -104,7 +104,7 @@ impl Vecs { // outputs_per_sec: per-block output count / block interval self.outputs_per_sec.height.compute_transform2( starting_indexes.height, - &outputs_count.total_count.height.sum_cumulative.sum.0, + &outputs_count.total_count.full.sum_cumulative.sum.0, &blocks.interval.height, |(h, output_count, interval, ..)| { let interval_f64 = f64::from(*interval); diff --git a/crates/brk_computer/src/transactions/volume/vecs.rs b/crates/brk_computer/src/transactions/volume/vecs.rs index a771c296f..fbda9f1b9 100644 --- a/crates/brk_computer/src/transactions/volume/vecs.rs +++ b/crates/brk_computer/src/transactions/volume/vecs.rs @@ -9,11 +9,8 @@ use crate::internal::{ /// Volume metrics #[derive(Traversable)] pub struct Vecs { - #[traversable(flatten)] pub sent_sum: ValueFromHeightLastRolling, - #[traversable(flatten)] pub received_sum: ValueFromHeightLastRolling, - #[traversable(flatten)] pub annualized_volume: ValueFromHeightLast, pub tx_per_sec: ComputedFromHeightLast, pub outputs_per_sec: ComputedFromHeightLast, diff --git a/crates/brk_query/src/impl/mining/block_fees.rs b/crates/brk_query/src/impl/mining/block_fees.rs index 400135030..5fd32597a 100644 --- a/crates/brk_query/src/impl/mining/block_fees.rs +++ b/crates/brk_query/src/impl/mining/block_fees.rs @@ -15,7 +15,7 @@ impl Query { let iter = Day1Iter::new(computer, start, current_height.to_usize()); - let cumulative = &computer.transactions.fees.fee.height.sum_cumulative.cumulative; + let cumulative = &computer.mining.rewards.fees.sats.cumulative.height; let first_height = &computer.indexes.day1.first_height; Ok(iter.collect(|di, ts, h| { @@ -30,7 +30,9 @@ impl Query { let cumulative_end = cumulative.collect_one_at(h_end.to_usize() - 1)?; let cumulative_start = if h_start.to_usize() > 0 { - cumulative.collect_one_at(h_start.to_usize() - 1).unwrap_or(Sats::ZERO) + cumulative + .collect_one_at(h_start.to_usize() - 1) + .unwrap_or(Sats::ZERO) } else { Sats::ZERO }; diff --git a/crates/brk_query/src/impl/mining/reward_stats.rs b/crates/brk_query/src/impl/mining/reward_stats.rs index 84e508e17..e4544c80b 100644 --- a/crates/brk_query/src/impl/mining/reward_stats.rs +++ b/crates/brk_query/src/impl/mining/reward_stats.rs @@ -13,7 +13,7 @@ impl Query { let start_block = Height::from(current_height.to_usize().saturating_sub(block_count - 1)); let coinbase_vec = &computer.mining.rewards.coinbase.sats.height; - let fee_vec = &computer.transactions.fees.fee.height.sum_cumulative.sum.0; + let fee_vec = &computer.mining.rewards.fees.sats.height; let tx_count_vec = &computer.transactions.count.tx_count.height; let start = start_block.to_usize(); diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index d2d3f5bf1..44c5d1035 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -186,11 +186,6 @@ * * @typedef {number} CentsSquaredSats */ -/** - * Closing price value for a time period - * - * @typedef {Cents} Close - */ /** * Cohort identifier for cost basis distribution. * @@ -368,11 +363,6 @@ * * @typedef {string} Hex */ -/** - * Highest price value for a time period - * - * @typedef {Cents} High - */ /** @typedef {number} Hour1 */ /** @typedef {number} Hour12 */ /** @typedef {number} Hour4 */ @@ -398,11 +388,6 @@ * @typedef {Object} LimitParam * @property {Limit=} limit */ -/** - * Lowest price value for a time period - * - * @typedef {Cents} Low - */ /** * Block info in a mempool.space like format for fee estimation. * @@ -488,39 +473,7 @@ /** @typedef {number} Month1 */ /** @typedef {number} Month3 */ /** @typedef {number} Month6 */ -/** - * OHLC (Open, High, Low, Close) data in cents - * - * @typedef {Object} OHLCCents - * @property {Open} open - * @property {High} high - * @property {Low} low - * @property {Close} close - */ -/** - * OHLC (Open, High, Low, Close) data in dollars - * - * @typedef {Object} OHLCDollars - * @property {Open} open - * @property {High} high - * @property {Low} low - * @property {Close} close - */ -/** - * OHLC (Open, High, Low, Close) data in satoshis - * - * @typedef {Object} OHLCSats - * @property {Open} open - * @property {High} high - * @property {Low} low - * @property {Close} close - */ /** @typedef {TypeIndex} OpReturnIndex */ -/** - * Opening price value for a time period - * - * @typedef {Cents} Open - */ /** @typedef {number} OutPoint */ /** * Type (P2PKH, P2WPKH, P2SH, P2TR, etc.) @@ -1575,19 +1528,20 @@ function createMetricPattern37(client, name) { return /** @type {MetricPattern37 * @property {MetricPattern20} investorCapRaw * @property {SatsUsdPattern} investorPrice * @property {MetricPattern1} investorPriceCents - * @property {RatioPattern} investorPriceExtra + * @property {RatioPattern2} investorPriceExtra + * @property {RatioPattern3} investorPriceRatioExt * @property {MetricPattern1} lossValueCreated * @property {MetricPattern1} lossValueDestroyed * @property {SatsUsdPattern} lowerPriceBand * @property {MetricPattern1} mvrv - * @property {CumulativeSumPattern2} negRealizedLoss - * @property {CumulativeSumPattern} netRealizedPnl + * @property {MetricPattern1} negRealizedLoss + * @property {CumulativeHeightPattern} netRealizedPnl * @property {MetricPattern1} netRealizedPnl7dEma * @property {MetricPattern1} netRealizedPnlCumulative30dDelta * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToMarketCap * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToRealizedCap - * @property {CumulativeSumPattern} netRealizedPnlRelToRealizedCap - * @property {CumulativeSumPattern} peakRegret + * @property {MetricPattern1} netRealizedPnlRelToRealizedCap + * @property {CumulativeHeightPattern} peakRegret * @property {MetricPattern1} peakRegretRelToRealizedCap * @property {MetricPattern1} profitFlow * @property {MetricPattern1} profitValueCreated @@ -1596,22 +1550,23 @@ function createMetricPattern37(client, name) { return /** @type {MetricPattern37 * @property {MetricPattern1} realizedCap30dDelta * @property {MetricPattern1} realizedCapCents * @property {MetricPattern1} realizedCapRelToOwnMarketCap - * @property {CumulativeSumPattern} realizedLoss + * @property {CumulativeHeightPattern} realizedLoss * @property {MetricPattern1} realizedLoss1y * @property {MetricPattern1} realizedLoss24h * @property {MetricPattern1} realizedLoss30d * @property {MetricPattern1} realizedLoss7d * @property {MetricPattern1} realizedLoss7dEma - * @property {CumulativeSumPattern} realizedLossRelToRealizedCap + * @property {MetricPattern1} realizedLossRelToRealizedCap * @property {SatsUsdPattern} realizedPrice - * @property {RatioPattern} realizedPriceExtra - * @property {CumulativeSumPattern} realizedProfit + * @property {RatioPattern2} realizedPriceExtra + * @property {RatioPattern3} realizedPriceRatioExt + * @property {CumulativeHeightPattern} realizedProfit * @property {MetricPattern1} realizedProfit1y * @property {MetricPattern1} realizedProfit24h * @property {MetricPattern1} realizedProfit30d * @property {MetricPattern1} realizedProfit7d * @property {MetricPattern1} realizedProfit7dEma - * @property {CumulativeSumPattern} realizedProfitRelToRealizedCap + * @property {MetricPattern1} realizedProfitRelToRealizedCap * @property {MetricPattern1} realizedProfitToLossRatio1y * @property {MetricPattern1} realizedProfitToLossRatio24h * @property {MetricPattern1} realizedProfitToLossRatio30d @@ -1689,19 +1644,20 @@ function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitReali investorCapRaw: createMetricPattern20(client, _m(acc, 'investor_cap_raw')), investorPrice: createSatsUsdPattern(client, _m(acc, 'investor_price')), investorPriceCents: createMetricPattern1(client, _m(acc, 'investor_price_cents')), - investorPriceExtra: createRatioPattern(client, _m(acc, 'investor_price_ratio')), + investorPriceExtra: createRatioPattern2(client, _m(acc, 'investor_price_ratio')), + investorPriceRatioExt: createRatioPattern3(client, _m(acc, 'investor_price_ratio')), lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), lowerPriceBand: createSatsUsdPattern(client, _m(acc, 'lower_price_band')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), - negRealizedLoss: createCumulativeSumPattern2(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createCumulativeSumPattern(client, _m(acc, 'net_realized_pnl')), + negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), netRealizedPnl7dEma: createMetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')), netRealizedPnlCumulative30dDelta: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - peakRegret: createCumulativeSumPattern(client, _m(acc, 'realized_peak_regret')), + netRealizedPnlRelToRealizedCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), peakRegretRelToRealizedCap: createMetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')), profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), @@ -1710,22 +1666,23 @@ function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitReali realizedCap30dDelta: createMetricPattern1(client, _m(acc, 'realized_cap_30d_delta')), realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), realizedCapRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), - realizedLoss: createCumulativeSumPattern(client, _m(acc, 'realized_loss')), + realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), realizedLoss1y: createMetricPattern1(client, _m(acc, 'realized_loss_1y')), realizedLoss24h: createMetricPattern1(client, _m(acc, 'realized_loss_24h')), realizedLoss30d: createMetricPattern1(client, _m(acc, 'realized_loss_30d')), realizedLoss7d: createMetricPattern1(client, _m(acc, 'realized_loss_7d')), realizedLoss7dEma: createMetricPattern1(client, _m(acc, 'realized_loss_7d_ema')), - realizedLossRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')), realizedPrice: createSatsUsdPattern(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRatioPattern(client, _m(acc, 'realized_price_ratio')), - realizedProfit: createCumulativeSumPattern(client, _m(acc, 'realized_profit')), + realizedPriceExtra: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), + realizedPriceRatioExt: createRatioPattern3(client, _m(acc, 'realized_price_ratio')), + realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), realizedProfit1y: createMetricPattern1(client, _m(acc, 'realized_profit_1y')), realizedProfit24h: createMetricPattern1(client, _m(acc, 'realized_profit_24h')), realizedProfit30d: createMetricPattern1(client, _m(acc, 'realized_profit_30d')), realizedProfit7d: createMetricPattern1(client, _m(acc, 'realized_profit_7d')), realizedProfit7dEma: createMetricPattern1(client, _m(acc, 'realized_profit_7d_ema')), - realizedProfitRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + realizedProfitRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')), realizedProfitToLossRatio1y: createMetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_1y')), realizedProfitToLossRatio24h: createMetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_24h')), realizedProfitToLossRatio30d: createMetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_30d')), @@ -1803,14 +1760,14 @@ function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitReali * @property {MetricPattern1} lossValueDestroyed * @property {SatsUsdPattern} lowerPriceBand * @property {MetricPattern1} mvrv - * @property {CumulativeSumPattern2} negRealizedLoss - * @property {CumulativeSumPattern} netRealizedPnl + * @property {MetricPattern1} negRealizedLoss + * @property {CumulativeHeightPattern} netRealizedPnl * @property {MetricPattern1} netRealizedPnl7dEma * @property {MetricPattern1} netRealizedPnlCumulative30dDelta * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToMarketCap * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToRealizedCap - * @property {CumulativeSumPattern} netRealizedPnlRelToRealizedCap - * @property {CumulativeSumPattern} peakRegret + * @property {MetricPattern1} netRealizedPnlRelToRealizedCap + * @property {CumulativeHeightPattern} peakRegret * @property {MetricPattern1} peakRegretRelToRealizedCap * @property {MetricPattern1} profitFlow * @property {MetricPattern1} profitValueCreated @@ -1818,14 +1775,14 @@ function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitReali * @property {MetricPattern1} realizedCap * @property {MetricPattern1} realizedCap30dDelta * @property {MetricPattern1} realizedCapCents - * @property {CumulativeSumPattern} realizedLoss + * @property {CumulativeHeightPattern} realizedLoss * @property {MetricPattern1} realizedLoss7dEma - * @property {CumulativeSumPattern} realizedLossRelToRealizedCap + * @property {MetricPattern1} realizedLossRelToRealizedCap * @property {SatsUsdPattern} realizedPrice * @property {RatioPattern2} realizedPriceExtra - * @property {CumulativeSumPattern} realizedProfit + * @property {CumulativeHeightPattern} realizedProfit * @property {MetricPattern1} realizedProfit7dEma - * @property {CumulativeSumPattern} realizedProfitRelToRealizedCap + * @property {MetricPattern1} realizedProfitRelToRealizedCap * @property {MetricPattern1} realizedValue * @property {MetricPattern1} realizedValue1y * @property {MetricPattern1} realizedValue24h @@ -1904,14 +1861,14 @@ function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitReali lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), lowerPriceBand: createSatsUsdPattern(client, _m(acc, 'lower_price_band')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), - negRealizedLoss: createCumulativeSumPattern2(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createCumulativeSumPattern(client, _m(acc, 'net_realized_pnl')), + negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), netRealizedPnl7dEma: createMetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')), netRealizedPnlCumulative30dDelta: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - peakRegret: createCumulativeSumPattern(client, _m(acc, 'realized_peak_regret')), + netRealizedPnlRelToRealizedCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), peakRegretRelToRealizedCap: createMetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')), profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), @@ -1919,14 +1876,14 @@ function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitReali realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), realizedCap30dDelta: createMetricPattern1(client, _m(acc, 'realized_cap_30d_delta')), realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), - realizedLoss: createCumulativeSumPattern(client, _m(acc, 'realized_loss')), + realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), realizedLoss7dEma: createMetricPattern1(client, _m(acc, 'realized_loss_7d_ema')), - realizedLossRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')), realizedPrice: createSatsUsdPattern(client, _m(acc, 'realized_price')), realizedPriceExtra: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), - realizedProfit: createCumulativeSumPattern(client, _m(acc, 'realized_profit')), + realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), realizedProfit7dEma: createMetricPattern1(client, _m(acc, 'realized_profit_7d_ema')), - realizedProfitRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + realizedProfitRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')), realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), realizedValue1y: createMetricPattern1(client, _m(acc, 'realized_value_1y')), realizedValue24h: createMetricPattern1(client, _m(acc, 'realized_value_24h')), @@ -1976,19 +1933,20 @@ function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitReali * @property {MetricPattern20} investorCapRaw * @property {SatsUsdPattern} investorPrice * @property {MetricPattern1} investorPriceCents - * @property {RatioPattern} investorPriceExtra + * @property {RatioPattern2} investorPriceExtra + * @property {RatioPattern3} investorPriceRatioExt * @property {MetricPattern1} lossValueCreated * @property {MetricPattern1} lossValueDestroyed * @property {SatsUsdPattern} lowerPriceBand * @property {MetricPattern1} mvrv - * @property {CumulativeSumPattern2} negRealizedLoss - * @property {CumulativeSumPattern} netRealizedPnl + * @property {MetricPattern1} negRealizedLoss + * @property {CumulativeHeightPattern} netRealizedPnl * @property {MetricPattern1} netRealizedPnl7dEma * @property {MetricPattern1} netRealizedPnlCumulative30dDelta * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToMarketCap * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToRealizedCap - * @property {CumulativeSumPattern} netRealizedPnlRelToRealizedCap - * @property {CumulativeSumPattern} peakRegret + * @property {MetricPattern1} netRealizedPnlRelToRealizedCap + * @property {CumulativeHeightPattern} peakRegret * @property {MetricPattern1} peakRegretRelToRealizedCap * @property {MetricPattern1} profitFlow * @property {MetricPattern1} profitValueCreated @@ -1997,22 +1955,23 @@ function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitReali * @property {MetricPattern1} realizedCap30dDelta * @property {MetricPattern1} realizedCapCents * @property {MetricPattern1} realizedCapRelToOwnMarketCap - * @property {CumulativeSumPattern} realizedLoss + * @property {CumulativeHeightPattern} realizedLoss * @property {MetricPattern1} realizedLoss1y * @property {MetricPattern1} realizedLoss24h * @property {MetricPattern1} realizedLoss30d * @property {MetricPattern1} realizedLoss7d * @property {MetricPattern1} realizedLoss7dEma - * @property {CumulativeSumPattern} realizedLossRelToRealizedCap + * @property {MetricPattern1} realizedLossRelToRealizedCap * @property {SatsUsdPattern} realizedPrice - * @property {RatioPattern} realizedPriceExtra - * @property {CumulativeSumPattern} realizedProfit + * @property {RatioPattern2} realizedPriceExtra + * @property {RatioPattern3} realizedPriceRatioExt + * @property {CumulativeHeightPattern} realizedProfit * @property {MetricPattern1} realizedProfit1y * @property {MetricPattern1} realizedProfit24h * @property {MetricPattern1} realizedProfit30d * @property {MetricPattern1} realizedProfit7d * @property {MetricPattern1} realizedProfit7dEma - * @property {CumulativeSumPattern} realizedProfitRelToRealizedCap + * @property {MetricPattern1} realizedProfitRelToRealizedCap * @property {MetricPattern1} realizedProfitToLossRatio1y * @property {MetricPattern1} realizedProfitToLossRatio24h * @property {MetricPattern1} realizedProfitToLossRatio30d @@ -2071,19 +2030,20 @@ function createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellS investorCapRaw: createMetricPattern20(client, _m(acc, 'investor_cap_raw')), investorPrice: createSatsUsdPattern(client, _m(acc, 'investor_price')), investorPriceCents: createMetricPattern1(client, _m(acc, 'investor_price_cents')), - investorPriceExtra: createRatioPattern(client, _m(acc, 'investor_price_ratio')), + investorPriceExtra: createRatioPattern2(client, _m(acc, 'investor_price_ratio')), + investorPriceRatioExt: createRatioPattern3(client, _m(acc, 'investor_price_ratio')), lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), lowerPriceBand: createSatsUsdPattern(client, _m(acc, 'lower_price_band')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), - negRealizedLoss: createCumulativeSumPattern2(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createCumulativeSumPattern(client, _m(acc, 'net_realized_pnl')), + negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), netRealizedPnl7dEma: createMetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')), netRealizedPnlCumulative30dDelta: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - peakRegret: createCumulativeSumPattern(client, _m(acc, 'realized_peak_regret')), + netRealizedPnlRelToRealizedCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), peakRegretRelToRealizedCap: createMetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')), profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), @@ -2092,22 +2052,23 @@ function createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellS realizedCap30dDelta: createMetricPattern1(client, _m(acc, 'realized_cap_30d_delta')), realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), realizedCapRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), - realizedLoss: createCumulativeSumPattern(client, _m(acc, 'realized_loss')), + realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), realizedLoss1y: createMetricPattern1(client, _m(acc, 'realized_loss_1y')), realizedLoss24h: createMetricPattern1(client, _m(acc, 'realized_loss_24h')), realizedLoss30d: createMetricPattern1(client, _m(acc, 'realized_loss_30d')), realizedLoss7d: createMetricPattern1(client, _m(acc, 'realized_loss_7d')), realizedLoss7dEma: createMetricPattern1(client, _m(acc, 'realized_loss_7d_ema')), - realizedLossRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')), realizedPrice: createSatsUsdPattern(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRatioPattern(client, _m(acc, 'realized_price_ratio')), - realizedProfit: createCumulativeSumPattern(client, _m(acc, 'realized_profit')), + realizedPriceExtra: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), + realizedPriceRatioExt: createRatioPattern3(client, _m(acc, 'realized_price_ratio')), + realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), realizedProfit1y: createMetricPattern1(client, _m(acc, 'realized_profit_1y')), realizedProfit24h: createMetricPattern1(client, _m(acc, 'realized_profit_24h')), realizedProfit30d: createMetricPattern1(client, _m(acc, 'realized_profit_30d')), realizedProfit7d: createMetricPattern1(client, _m(acc, 'realized_profit_7d')), realizedProfit7dEma: createMetricPattern1(client, _m(acc, 'realized_profit_7d_ema')), - realizedProfitRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + realizedProfitRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')), realizedProfitToLossRatio1y: createMetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_1y')), realizedProfitToLossRatio24h: createMetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_24h')), realizedProfitToLossRatio30d: createMetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_30d')), @@ -2166,14 +2127,14 @@ function createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellS * @property {MetricPattern1} lossValueDestroyed * @property {SatsUsdPattern} lowerPriceBand * @property {MetricPattern1} mvrv - * @property {CumulativeSumPattern2} negRealizedLoss - * @property {CumulativeSumPattern} netRealizedPnl + * @property {MetricPattern1} negRealizedLoss + * @property {CumulativeHeightPattern} netRealizedPnl * @property {MetricPattern1} netRealizedPnl7dEma * @property {MetricPattern1} netRealizedPnlCumulative30dDelta * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToMarketCap * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToRealizedCap - * @property {CumulativeSumPattern} netRealizedPnlRelToRealizedCap - * @property {CumulativeSumPattern} peakRegret + * @property {MetricPattern1} netRealizedPnlRelToRealizedCap + * @property {CumulativeHeightPattern} peakRegret * @property {MetricPattern1} peakRegretRelToRealizedCap * @property {MetricPattern1} profitFlow * @property {MetricPattern1} profitValueCreated @@ -2181,14 +2142,14 @@ function createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellS * @property {MetricPattern1} realizedCap * @property {MetricPattern1} realizedCap30dDelta * @property {MetricPattern1} realizedCapCents - * @property {CumulativeSumPattern} realizedLoss + * @property {CumulativeHeightPattern} realizedLoss * @property {MetricPattern1} realizedLoss7dEma - * @property {CumulativeSumPattern} realizedLossRelToRealizedCap + * @property {MetricPattern1} realizedLossRelToRealizedCap * @property {SatsUsdPattern} realizedPrice * @property {RatioPattern2} realizedPriceExtra - * @property {CumulativeSumPattern} realizedProfit + * @property {CumulativeHeightPattern} realizedProfit * @property {MetricPattern1} realizedProfit7dEma - * @property {CumulativeSumPattern} realizedProfitRelToRealizedCap + * @property {MetricPattern1} realizedProfitRelToRealizedCap * @property {MetricPattern1} realizedValue * @property {MetricPattern1} realizedValue1y * @property {MetricPattern1} realizedValue24h @@ -2248,14 +2209,14 @@ function createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellS lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), lowerPriceBand: createSatsUsdPattern(client, _m(acc, 'lower_price_band')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), - negRealizedLoss: createCumulativeSumPattern2(client, _m(acc, 'neg_realized_loss')), - netRealizedPnl: createCumulativeSumPattern(client, _m(acc, 'net_realized_pnl')), + negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), netRealizedPnl7dEma: createMetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')), netRealizedPnlCumulative30dDelta: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')), netRealizedPnlCumulative30dDeltaRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')), netRealizedPnlCumulative30dDeltaRelToRealizedCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')), - netRealizedPnlRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), - peakRegret: createCumulativeSumPattern(client, _m(acc, 'realized_peak_regret')), + netRealizedPnlRelToRealizedCap: createMetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), peakRegretRelToRealizedCap: createMetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')), profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), @@ -2263,14 +2224,14 @@ function createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellS realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), realizedCap30dDelta: createMetricPattern1(client, _m(acc, 'realized_cap_30d_delta')), realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), - realizedLoss: createCumulativeSumPattern(client, _m(acc, 'realized_loss')), + realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), realizedLoss7dEma: createMetricPattern1(client, _m(acc, 'realized_loss_7d_ema')), - realizedLossRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')), realizedPrice: createSatsUsdPattern(client, _m(acc, 'realized_price')), realizedPriceExtra: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), - realizedProfit: createCumulativeSumPattern(client, _m(acc, 'realized_profit')), + realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), realizedProfit7dEma: createMetricPattern1(client, _m(acc, 'realized_profit_7d_ema')), - realizedProfitRelToRealizedCap: createCumulativeSumPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + realizedProfitRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')), realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), realizedValue1y: createMetricPattern1(client, _m(acc, 'realized_value_1y')), realizedValue24h: createMetricPattern1(client, _m(acc, 'realized_value_24h')), @@ -2385,7 +2346,7 @@ function create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client } /** - * @typedef {Object} InvestedNegNetNuplSupplyUnrealizedPattern4 + * @typedef {Object} InvestedNegNetNuplSupplyUnrealizedPattern2 * @property {MetricPattern1} investedCapitalInLossPct * @property {MetricPattern1} investedCapitalInProfitPct * @property {MetricPattern1} negUnrealizedLossRelToMarketCap @@ -2410,12 +2371,12 @@ function create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client */ /** - * Create a InvestedNegNetNuplSupplyUnrealizedPattern4 pattern node + * Create a InvestedNegNetNuplSupplyUnrealizedPattern2 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {InvestedNegNetNuplSupplyUnrealizedPattern4} + * @returns {InvestedNegNetNuplSupplyUnrealizedPattern2} */ -function createInvestedNegNetNuplSupplyUnrealizedPattern4(client, acc) { +function createInvestedNegNetNuplSupplyUnrealizedPattern2(client, acc) { return { investedCapitalInLossPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_loss_pct')), investedCapitalInProfitPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_profit_pct')), @@ -2602,6 +2563,57 @@ function createRatioPattern(client, acc) { }; } +/** + * @typedef {Object} RatioPattern3 + * @property {MetricPattern1} ratio1mSma + * @property {MetricPattern1} ratio1wSma + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio1ySd + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio2ySd + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio4ySd + * @property {MetricPattern1} ratioPct1 + * @property {SatsUsdPattern} ratioPct1Usd + * @property {MetricPattern1} ratioPct2 + * @property {SatsUsdPattern} ratioPct2Usd + * @property {MetricPattern1} ratioPct5 + * @property {SatsUsdPattern} ratioPct5Usd + * @property {MetricPattern1} ratioPct95 + * @property {SatsUsdPattern} ratioPct95Usd + * @property {MetricPattern1} ratioPct98 + * @property {SatsUsdPattern} ratioPct98Usd + * @property {MetricPattern1} ratioPct99 + * @property {SatsUsdPattern} ratioPct99Usd + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd + */ + +/** + * Create a RatioPattern3 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {RatioPattern3} + */ +function createRatioPattern3(client, acc) { + return { + ratio1mSma: createMetricPattern1(client, _m(acc, '1m_sma')), + ratio1wSma: createMetricPattern1(client, _m(acc, '1w_sma')), + ratio1ySd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, '1y')), + ratio2ySd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, '2y')), + ratio4ySd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, '4y')), + ratioPct1: createMetricPattern1(client, _m(acc, 'pct1')), + ratioPct1Usd: createSatsUsdPattern(client, _m(acc, 'pct1_usd')), + ratioPct2: createMetricPattern1(client, _m(acc, 'pct2')), + ratioPct2Usd: createSatsUsdPattern(client, _m(acc, 'pct2_usd')), + ratioPct5: createMetricPattern1(client, _m(acc, 'pct5')), + ratioPct5Usd: createSatsUsdPattern(client, _m(acc, 'pct5_usd')), + ratioPct95: createMetricPattern1(client, _m(acc, 'pct95')), + ratioPct95Usd: createSatsUsdPattern(client, _m(acc, 'pct95_usd')), + ratioPct98: createMetricPattern1(client, _m(acc, 'pct98')), + ratioPct98Usd: createSatsUsdPattern(client, _m(acc, 'pct98_usd')), + ratioPct99: createMetricPattern1(client, _m(acc, 'pct99')), + ratioPct99Usd: createSatsUsdPattern(client, _m(acc, 'pct99_usd')), + ratioSd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), + }; +} + /** * @typedef {Object} GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern * @property {MetricPattern1} greedIndex @@ -2651,6 +2663,57 @@ function createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(c }; } +/** + * @template T + * @typedef {Object} Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern + * @property {MetricPattern10} day1 + * @property {MetricPattern11} day3 + * @property {MetricPattern19} difficultyepoch + * @property {MetricPattern18} halvingepoch + * @property {MetricPattern7} hour1 + * @property {MetricPattern9} hour12 + * @property {MetricPattern8} hour4 + * @property {MetricPattern3} minute1 + * @property {MetricPattern5} minute10 + * @property {MetricPattern6} minute30 + * @property {MetricPattern4} minute5 + * @property {MetricPattern13} month1 + * @property {MetricPattern14} month3 + * @property {MetricPattern15} month6 + * @property {MetricPattern12} week1 + * @property {MetricPattern16} year1 + * @property {MetricPattern17} year10 + */ + +/** + * Create a Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern} + */ +function createDay1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern(client, acc) { + return { + day1: createMetricPattern10(client, _m(acc, 'day1')), + day3: createMetricPattern11(client, _m(acc, 'day3')), + difficultyepoch: createMetricPattern19(client, _m(acc, 'difficultyepoch')), + halvingepoch: createMetricPattern18(client, _m(acc, 'halvingepoch')), + hour1: createMetricPattern7(client, _m(acc, 'hour1')), + hour12: createMetricPattern9(client, _m(acc, 'hour12')), + hour4: createMetricPattern8(client, _m(acc, 'hour4')), + minute1: createMetricPattern3(client, _m(acc, 'minute1')), + minute10: createMetricPattern5(client, _m(acc, 'minute10')), + minute30: createMetricPattern6(client, _m(acc, 'minute30')), + minute5: createMetricPattern4(client, _m(acc, 'minute5')), + month1: createMetricPattern13(client, _m(acc, 'month1')), + month3: createMetricPattern14(client, _m(acc, 'month3')), + month6: createMetricPattern15(client, _m(acc, 'month6')), + week1: createMetricPattern12(client, _m(acc, 'week1')), + year1: createMetricPattern16(client, _m(acc, 'year1')), + year10: createMetricPattern17(client, _m(acc, 'year10')), + }; +} + /** * @typedef {Object} GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern * @property {MetricPattern1} greedIndex @@ -2700,7 +2763,7 @@ function createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(clien /** * @typedef {Object} BlocksCoinbaseDaysDominanceFeeSubsidyPattern - * @property {CumulativeSumPattern} blocksMined + * @property {CumulativeHeightRollingPattern} blocksMined * @property {MetricPattern1} blocksMined1mSum * @property {MetricPattern1} blocksMined1wSum * @property {MetricPattern1} blocksMined1ySum @@ -2713,8 +2776,8 @@ function createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(clien * @property {MetricPattern1} dominance1w * @property {MetricPattern1} dominance1y * @property {MetricPattern1} dominance24h - * @property {BtcSatsUsdPattern2} fee - * @property {BtcSatsUsdPattern2} subsidy + * @property {BtcSatsUsdPattern4} fee + * @property {BtcSatsUsdPattern4} subsidy */ /** @@ -2725,7 +2788,7 @@ function createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(clien */ function createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, acc) { return { - blocksMined: createCumulativeSumPattern(client, _m(acc, 'blocks_mined')), + blocksMined: createCumulativeHeightRollingPattern(client, _m(acc, 'blocks_mined')), blocksMined1mSum: createMetricPattern1(client, _m(acc, 'blocks_mined_1m_sum')), blocksMined1wSum: createMetricPattern1(client, _m(acc, 'blocks_mined_1w_sum')), blocksMined1ySum: createMetricPattern1(client, _m(acc, 'blocks_mined_1y_sum')), @@ -2738,13 +2801,13 @@ function createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, acc) { dominance1w: createMetricPattern1(client, _m(acc, 'dominance_1w')), dominance1y: createMetricPattern1(client, _m(acc, 'dominance_1y')), dominance24h: createMetricPattern1(client, _m(acc, 'dominance_24h')), - fee: createBtcSatsUsdPattern2(client, _m(acc, 'fee')), - subsidy: createBtcSatsUsdPattern2(client, _m(acc, 'subsidy')), + fee: createBtcSatsUsdPattern4(client, _m(acc, 'fee')), + subsidy: createBtcSatsUsdPattern4(client, _m(acc, 'subsidy')), }; } /** - * @typedef {Object} InvestedNegNetNuplSupplyUnrealizedPattern3 + * @typedef {Object} InvestedNegNetNuplSupplyUnrealizedPattern4 * @property {MetricPattern1} investedCapitalInLossPct * @property {MetricPattern1} investedCapitalInProfitPct * @property {MetricPattern1} negUnrealizedLossRelToMarketCap @@ -2761,12 +2824,12 @@ function createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, acc) { */ /** - * Create a InvestedNegNetNuplSupplyUnrealizedPattern3 pattern node + * Create a InvestedNegNetNuplSupplyUnrealizedPattern4 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {InvestedNegNetNuplSupplyUnrealizedPattern3} + * @returns {InvestedNegNetNuplSupplyUnrealizedPattern4} */ -function createInvestedNegNetNuplSupplyUnrealizedPattern3(client, acc) { +function createInvestedNegNetNuplSupplyUnrealizedPattern4(client, acc) { return { investedCapitalInLossPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_loss_pct')), investedCapitalInProfitPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_profit_pct')), @@ -2862,45 +2925,6 @@ function createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc) { }; } -/** - * @typedef {Object} InvestedNegNetSupplyUnrealizedPattern - * @property {MetricPattern1} investedCapitalInLossPct - * @property {MetricPattern1} investedCapitalInProfitPct - * @property {MetricPattern1} negUnrealizedLossRelToOwnMarketCap - * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} netUnrealizedPnlRelToOwnMarketCap - * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} supplyInProfitRelToOwnSupply - * @property {MetricPattern1} unrealizedLossRelToOwnMarketCap - * @property {MetricPattern1} unrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} unrealizedProfitRelToOwnMarketCap - * @property {MetricPattern1} unrealizedProfitRelToOwnTotalUnrealizedPnl - */ - -/** - * Create a InvestedNegNetSupplyUnrealizedPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {InvestedNegNetSupplyUnrealizedPattern} - */ -function createInvestedNegNetSupplyUnrealizedPattern(client, acc) { - return { - investedCapitalInLossPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_loss_pct')), - investedCapitalInProfitPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_profit_pct')), - negUnrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')), - negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')), - netUnrealizedPnlRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')), - netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')), - supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), - unrealizedLossRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')), - unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')), - unrealizedProfitRelToOwnMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')), - unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')), - }; -} - /** * @template T * @typedef {Object} _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 @@ -2984,78 +3008,74 @@ function create_201520162017201820192020202120222023202420252026Pattern2(client, } /** - * @typedef {Object} AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 - * @property {MetricPattern2} average - * @property {MetricPattern20} base - * @property {MetricPattern2} cumulative - * @property {MetricPattern2} max - * @property {MetricPattern2} median - * @property {MetricPattern2} min - * @property {MetricPattern2} pct10 - * @property {MetricPattern2} pct25 - * @property {MetricPattern2} pct75 - * @property {MetricPattern2} pct90 - * @property {MetricPattern2} sum + * @typedef {Object} AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern + * @property {MetricPattern20} average + * @property {MetricPattern20} cumulative + * @property {MetricPattern20} max + * @property {MetricPattern20} median + * @property {MetricPattern20} min + * @property {MetricPattern20} pct10 + * @property {MetricPattern20} pct25 + * @property {MetricPattern20} pct75 + * @property {MetricPattern20} pct90 + * @property {AverageMaxMedianMinP10P25P75P90SumPattern} rolling + * @property {MetricPattern20} sum */ /** - * Create a AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 pattern node + * Create a AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} + * @returns {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern} */ -function createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, acc) { +function createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(client, acc) { return { - average: createMetricPattern2(client, _m(acc, 'average')), - base: createMetricPattern20(client, acc), - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - max: createMetricPattern2(client, _m(acc, 'max')), - median: createMetricPattern2(client, _m(acc, 'median')), - min: createMetricPattern2(client, _m(acc, 'min')), - pct10: createMetricPattern2(client, _m(acc, 'pct10')), - pct25: createMetricPattern2(client, _m(acc, 'pct25')), - pct75: createMetricPattern2(client, _m(acc, 'pct75')), - pct90: createMetricPattern2(client, _m(acc, 'pct90')), - sum: createMetricPattern2(client, _m(acc, 'sum')), + average: createMetricPattern20(client, _m(acc, 'average')), + cumulative: createMetricPattern20(client, _m(acc, 'cumulative')), + max: createMetricPattern20(client, _m(acc, 'max')), + median: createMetricPattern20(client, _m(acc, 'median')), + min: createMetricPattern20(client, _m(acc, 'min')), + pct10: createMetricPattern20(client, _m(acc, 'pct10')), + pct25: createMetricPattern20(client, _m(acc, 'pct25')), + pct75: createMetricPattern20(client, _m(acc, 'pct75')), + pct90: createMetricPattern20(client, _m(acc, 'pct90')), + rolling: createAverageMaxMedianMinP10P25P75P90SumPattern(client, acc), + sum: createMetricPattern20(client, _m(acc, 'sum')), }; } /** - * @template T - * @typedef {Object} AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern - * @property {MetricPattern2} average - * @property {MetricPattern20} base - * @property {MetricPattern1} cumulative - * @property {MetricPattern2} max - * @property {MetricPattern2} median - * @property {MetricPattern2} min - * @property {MetricPattern2} pct10 - * @property {MetricPattern2} pct25 - * @property {MetricPattern2} pct75 - * @property {MetricPattern2} pct90 - * @property {MetricPattern2} sum + * @typedef {Object} AverageCumulativeMaxMedianMinP10P25P75P90SumPattern + * @property {_1y24h30d7dPattern} average + * @property {MetricPattern1} cumulative + * @property {_1y24h30d7dPattern} max + * @property {_1y24h30d7dPattern} median + * @property {_1y24h30d7dPattern} min + * @property {_1y24h30d7dPattern} p10 + * @property {_1y24h30d7dPattern} p25 + * @property {_1y24h30d7dPattern} p75 + * @property {_1y24h30d7dPattern} p90 + * @property {_1y24h30d7dPattern} sum */ /** - * Create a AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern pattern node - * @template T + * Create a AverageCumulativeMaxMedianMinP10P25P75P90SumPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} + * @returns {AverageCumulativeMaxMedianMinP10P25P75P90SumPattern} */ -function createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) { +function createAverageCumulativeMaxMedianMinP10P25P75P90SumPattern(client, acc) { return { - average: createMetricPattern2(client, _m(acc, 'average')), - base: createMetricPattern20(client, acc), + average: create_1y24h30d7dPattern(client, _m(acc, 'average')), cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - max: createMetricPattern2(client, _m(acc, 'max')), - median: createMetricPattern2(client, _m(acc, 'median')), - min: createMetricPattern2(client, _m(acc, 'min')), - pct10: createMetricPattern2(client, _m(acc, 'pct10')), - pct25: createMetricPattern2(client, _m(acc, 'pct25')), - pct75: createMetricPattern2(client, _m(acc, 'pct75')), - pct90: createMetricPattern2(client, _m(acc, 'pct90')), - sum: createMetricPattern2(client, _m(acc, 'sum')), + max: create_1y24h30d7dPattern(client, _m(acc, 'max')), + median: create_1y24h30d7dPattern(client, _m(acc, 'median')), + min: create_1y24h30d7dPattern(client, _m(acc, 'min')), + p10: create_1y24h30d7dPattern(client, _m(acc, 'p10')), + p25: create_1y24h30d7dPattern(client, _m(acc, 'p25')), + p75: create_1y24h30d7dPattern(client, _m(acc, 'p75')), + p90: create_1y24h30d7dPattern(client, _m(acc, 'p90')), + sum: create_1y24h30d7dPattern(client, _m(acc, 'sum')), }; } @@ -3065,7 +3085,7 @@ function createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(c * @property {MetricPattern1} averageLoss * @property {MetricPattern1} gains * @property {MetricPattern1} losses - * @property {MetricPattern20} rsi + * @property {MetricPattern1} rsi * @property {MetricPattern1} rsiMax * @property {MetricPattern1} rsiMin * @property {MetricPattern1} stochRsi @@ -3085,7 +3105,7 @@ function createAverageGainsLossesRsiStochPattern(client, acc) { averageLoss: createMetricPattern1(client, _m(acc, 'avg_loss_1y')), gains: createMetricPattern1(client, _m(acc, 'gains_1y')), losses: createMetricPattern1(client, _m(acc, 'losses_1y')), - rsi: createMetricPattern20(client, _m(acc, '1y')), + rsi: createMetricPattern1(client, _m(acc, '1y')), rsiMax: createMetricPattern1(client, _m(acc, 'rsi_max_1y')), rsiMin: createMetricPattern1(client, _m(acc, 'rsi_min_1y')), stochRsi: createMetricPattern1(client, _m(acc, 'stoch_rsi_1y')), @@ -3094,43 +3114,6 @@ function createAverageGainsLossesRsiStochPattern(client, acc) { }; } -/** - * @template T - * @typedef {Object} AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 - * @property {MetricPattern1} average - * @property {MetricPattern1} cumulative - * @property {MetricPattern1} max - * @property {MetricPattern1} median - * @property {MetricPattern1} min - * @property {MetricPattern1} pct10 - * @property {MetricPattern1} pct25 - * @property {MetricPattern1} pct75 - * @property {MetricPattern1} pct90 - * @property {MetricPattern1} sum - */ - -/** - * Create a AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} - */ -function createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, acc) { - return { - average: createMetricPattern1(client, _m(acc, 'average')), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - max: createMetricPattern1(client, _m(acc, 'max')), - median: createMetricPattern1(client, _m(acc, 'median')), - min: createMetricPattern1(client, _m(acc, 'min')), - pct10: createMetricPattern1(client, _m(acc, 'pct10')), - pct25: createMetricPattern1(client, _m(acc, 'pct25')), - pct75: createMetricPattern1(client, _m(acc, 'pct75')), - pct90: createMetricPattern1(client, _m(acc, 'pct90')), - sum: createMetricPattern1(client, _m(acc, 'sum')), - }; -} - /** * @typedef {Object} ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity @@ -3198,72 +3181,103 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(client, acc) { } /** - * @template T - * @typedef {Object} AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern - * @property {MetricPattern2} average - * @property {MetricPattern20} base - * @property {MetricPattern2} max - * @property {MetricPattern2} median - * @property {MetricPattern2} min - * @property {MetricPattern2} pct10 - * @property {MetricPattern2} pct25 - * @property {MetricPattern2} pct75 - * @property {MetricPattern2} pct90 + * @typedef {Object} AverageMaxMedianMinP10P25P75P90SumPattern + * @property {_1y24h30d7dPattern} average + * @property {_1y24h30d7dPattern} max + * @property {_1y24h30d7dPattern} median + * @property {_1y24h30d7dPattern} min + * @property {_1y24h30d7dPattern} p10 + * @property {_1y24h30d7dPattern} p25 + * @property {_1y24h30d7dPattern} p75 + * @property {_1y24h30d7dPattern} p90 + * @property {_1y24h30d7dPattern} sum */ /** - * Create a AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern pattern node - * @template T + * Create a AverageMaxMedianMinP10P25P75P90SumPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} + * @returns {AverageMaxMedianMinP10P25P75P90SumPattern} */ -function createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) { +function createAverageMaxMedianMinP10P25P75P90SumPattern(client, acc) { return { - average: createMetricPattern2(client, _m(acc, 'average')), - base: createMetricPattern20(client, acc), - max: createMetricPattern2(client, _m(acc, 'max')), - median: createMetricPattern2(client, _m(acc, 'median')), - min: createMetricPattern2(client, _m(acc, 'min')), - pct10: createMetricPattern2(client, _m(acc, 'pct10')), - pct25: createMetricPattern2(client, _m(acc, 'pct25')), - pct75: createMetricPattern2(client, _m(acc, 'pct75')), - pct90: createMetricPattern2(client, _m(acc, 'pct90')), + average: create_1y24h30d7dPattern(client, _m(acc, 'average')), + max: create_1y24h30d7dPattern(client, _m(acc, 'max')), + median: create_1y24h30d7dPattern(client, _m(acc, 'median')), + min: create_1y24h30d7dPattern(client, _m(acc, 'min')), + p10: create_1y24h30d7dPattern(client, _m(acc, 'p10')), + p25: create_1y24h30d7dPattern(client, _m(acc, 'p25')), + p75: create_1y24h30d7dPattern(client, _m(acc, 'p75')), + p90: create_1y24h30d7dPattern(client, _m(acc, 'p90')), + sum: create_1y24h30d7dPattern(client, _m(acc, 'sum')), }; } /** * @template T - * @typedef {Object} AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern - * @property {MetricPattern1} average - * @property {MetricPattern1} max - * @property {MetricPattern1} median - * @property {MetricPattern1} min - * @property {MetricPattern1} pct10 - * @property {MetricPattern1} pct25 - * @property {MetricPattern1} pct75 - * @property {MetricPattern1} pct90 - * @property {MetricPattern21} txindex + * @typedef {Object} AverageHeightMaxMedianMinP10P25P75P90Pattern + * @property {_1y24h30d7dPattern} average + * @property {MetricPattern20} height + * @property {_1y24h30d7dPattern} max + * @property {_1y24h30d7dPattern} median + * @property {_1y24h30d7dPattern} min + * @property {_1y24h30d7dPattern} p10 + * @property {_1y24h30d7dPattern} p25 + * @property {_1y24h30d7dPattern} p75 + * @property {_1y24h30d7dPattern} p90 */ /** - * Create a AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern pattern node + * Create a AverageHeightMaxMedianMinP10P25P75P90Pattern pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern} + * @returns {AverageHeightMaxMedianMinP10P25P75P90Pattern} */ -function createAverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern(client, acc) { +function createAverageHeightMaxMedianMinP10P25P75P90Pattern(client, acc) { return { - average: createMetricPattern1(client, _m(acc, 'average')), - max: createMetricPattern1(client, _m(acc, 'max')), - median: createMetricPattern1(client, _m(acc, 'median')), - min: createMetricPattern1(client, _m(acc, 'min')), - pct10: createMetricPattern1(client, _m(acc, 'pct10')), - pct25: createMetricPattern1(client, _m(acc, 'pct25')), - pct75: createMetricPattern1(client, _m(acc, 'pct75')), - pct90: createMetricPattern1(client, _m(acc, 'pct90')), - txindex: createMetricPattern21(client, acc), + average: create_1y24h30d7dPattern(client, _m(acc, 'average')), + height: createMetricPattern20(client, acc), + max: create_1y24h30d7dPattern(client, _m(acc, 'max')), + median: create_1y24h30d7dPattern(client, _m(acc, 'median')), + min: create_1y24h30d7dPattern(client, _m(acc, 'min')), + p10: create_1y24h30d7dPattern(client, _m(acc, 'p10')), + p25: create_1y24h30d7dPattern(client, _m(acc, 'p25')), + p75: create_1y24h30d7dPattern(client, _m(acc, 'p75')), + p90: create_1y24h30d7dPattern(client, _m(acc, 'p90')), + }; +} + +/** + * @template T + * @typedef {Object} AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern + * @property {MetricPattern20} average + * @property {MetricPattern20} max + * @property {MetricPattern20} median + * @property {MetricPattern20} min + * @property {MetricPattern20} pct10 + * @property {MetricPattern20} pct25 + * @property {MetricPattern20} pct75 + * @property {MetricPattern20} pct90 + */ + +/** + * Create a AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} + */ +function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) { + return { + average: createMetricPattern20(client, _m(acc, 'average')), + max: createMetricPattern20(client, _m(acc, 'max')), + median: createMetricPattern20(client, _m(acc, 'median')), + min: createMetricPattern20(client, _m(acc, 'min')), + pct10: createMetricPattern20(client, _m(acc, 'pct10')), + pct25: createMetricPattern20(client, _m(acc, 'pct25')), + pct75: createMetricPattern20(client, _m(acc, 'pct75')), + pct90: createMetricPattern20(client, _m(acc, 'pct90')), }; } @@ -3302,7 +3316,7 @@ function create_10y2y3y4y5y6y8yPattern(client, acc) { * @property {InvestedMaxMinPercentilesSpotPattern} costBasis * @property {UtxoPattern} outputs * @property {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2} realized - * @property {InvestedNegNetSupplyUnrealizedPattern} relative + * @property {InvestedNegNetNuplSupplyUnrealizedPattern2} relative * @property {_30dHalvedTotalPattern} supply * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized */ @@ -3319,36 +3333,7 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(client costBasis: createInvestedMaxMinPercentilesSpotPattern(client, acc), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), realized: createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc), - relative: createInvestedNegNetSupplyUnrealizedPattern(client, acc), - supply: create_30dHalvedTotalPattern(client, acc), - unrealized: createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, acc), - }; -} - -/** - * @typedef {Object} ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 - * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity - * @property {MaxMinPattern} costBasis - * @property {UtxoPattern} outputs - * @property {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2} realized - * @property {InvestedNegNetNuplSupplyUnrealizedPattern3} relative - * @property {_30dHalvedTotalPattern} supply - * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized - */ - -/** - * Create a ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} - */ -function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, acc) { - return { - activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc), - costBasis: createMaxMinPattern(client, acc), - outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern3(client, acc), + relative: createInvestedNegNetNuplSupplyUnrealizedPattern2(client, acc), supply: create_30dHalvedTotalPattern(client, acc), unrealized: createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, acc), }; @@ -3359,10 +3344,10 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(clien * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity * @property {MaxMinPattern} costBasis * @property {UtxoPattern} outputs - * @property {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized - * @property {InvestedNegNetNuplSupplyUnrealizedPattern} relative + * @property {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2} realized + * @property {InvestedNegNetNuplSupplyUnrealizedPattern4} relative * @property {_30dHalvedTotalPattern} supply - * @property {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} unrealized + * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized */ /** @@ -3376,37 +3361,8 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(clien activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc), costBasis: createMaxMinPattern(client, acc), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc), - supply: create_30dHalvedTotalPattern(client, acc), - unrealized: createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc), - }; -} - -/** - * @typedef {Object} ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 - * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity - * @property {MaxMinPattern} costBasis - * @property {UtxoPattern} outputs - * @property {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized - * @property {InvestedNegNetNuplSupplyUnrealizedPattern3} relative - * @property {_30dHalvedTotalPattern} supply - * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized - */ - -/** - * Create a ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} - */ -function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, acc) { - return { - activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc), - costBasis: createMaxMinPattern(client, acc), - outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern3(client, acc), + realized: createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc), + relative: createInvestedNegNetNuplSupplyUnrealizedPattern4(client, acc), supply: create_30dHalvedTotalPattern(client, acc), unrealized: createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, acc), }; @@ -3418,7 +3374,7 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(clien * @property {MaxMinPattern} costBasis * @property {UtxoPattern} outputs * @property {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized - * @property {InvestedSupplyPattern} relative + * @property {InvestedNegNetNuplSupplyUnrealizedPattern} relative * @property {_30dHalvedTotalPattern} supply * @property {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} unrealized */ @@ -3435,47 +3391,49 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(clien costBasis: createMaxMinPattern(client, acc), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), realized: createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc), - relative: createInvestedSupplyPattern(client, acc), + relative: createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc), supply: create_30dHalvedTotalPattern(client, acc), unrealized: createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc), }; } /** - * @typedef {Object} ActivityCostOutputsRealizedSupplyUnrealizedPattern + * @typedef {Object} ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity * @property {MaxMinPattern} costBasis * @property {UtxoPattern} outputs * @property {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized + * @property {InvestedNegNetNuplSupplyUnrealizedPattern4} relative * @property {_30dHalvedTotalPattern} supply - * @property {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} unrealized + * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized */ /** - * Create a ActivityCostOutputsRealizedSupplyUnrealizedPattern pattern node + * Create a ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {ActivityCostOutputsRealizedSupplyUnrealizedPattern} + * @returns {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} */ -function createActivityCostOutputsRealizedSupplyUnrealizedPattern(client, acc) { +function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, acc) { return { activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc), costBasis: createMaxMinPattern(client, acc), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), realized: createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc), + relative: createInvestedNegNetNuplSupplyUnrealizedPattern4(client, acc), supply: create_30dHalvedTotalPattern(client, acc), - unrealized: createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc), + unrealized: createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, acc), }; } /** * @typedef {Object} BalanceBothReactivatedReceivingSendingPattern - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} balanceDecreased - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} balanceIncreased - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} both - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} reactivated - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} receiving - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} sending + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} balanceDecreased + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} balanceIncreased + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} both + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} reactivated + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} receiving + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} sending */ /** @@ -3486,19 +3444,19 @@ function createActivityCostOutputsRealizedSupplyUnrealizedPattern(client, acc) { */ function createBalanceBothReactivatedReceivingSendingPattern(client, acc) { return { - balanceDecreased: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'balance_decreased')), - balanceIncreased: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'balance_increased')), - both: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'both')), - reactivated: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'reactivated')), - receiving: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'receiving')), - sending: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'sending')), + balanceDecreased: createAverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'balance_decreased')), + balanceIncreased: createAverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'balance_increased')), + both: createAverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'both')), + reactivated: createAverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'reactivated')), + receiving: createAverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'receiving')), + sending: createAverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'sending')), }; } /** * @typedef {Object} CoinblocksCoindaysSatblocksSatdaysSentPattern - * @property {CumulativeSumPattern} coinblocksDestroyed - * @property {CumulativeSumPattern} coindaysDestroyed + * @property {CumulativeHeightRollingPattern} coinblocksDestroyed + * @property {CumulativeHeightRollingPattern} coindaysDestroyed * @property {MetricPattern20} satblocksDestroyed * @property {MetricPattern20} satdaysDestroyed * @property {BtcSatsUsdPattern2} sent @@ -3513,8 +3471,8 @@ function createBalanceBothReactivatedReceivingSendingPattern(client, acc) { */ function createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc) { return { - coinblocksDestroyed: createCumulativeSumPattern(client, _m(acc, 'coinblocks_destroyed')), - coindaysDestroyed: createCumulativeSumPattern(client, _m(acc, 'coindays_destroyed')), + coinblocksDestroyed: createCumulativeHeightRollingPattern(client, _m(acc, 'coinblocks_destroyed')), + coindaysDestroyed: createCumulativeHeightRollingPattern(client, _m(acc, 'coindays_destroyed')), satblocksDestroyed: createMetricPattern20(client, _m(acc, 'satblocks_destroyed')), satdaysDestroyed: createMetricPattern20(client, _m(acc, 'satdays_destroyed')), sent: createBtcSatsUsdPattern2(client, _m(acc, 'sent')), @@ -3550,50 +3508,125 @@ function createInvestedMaxMinPercentilesSpotPattern(client, acc) { } /** - * @typedef {Object} InvestedSupplyPattern - * @property {MetricPattern1} investedCapitalInLossPct - * @property {MetricPattern1} investedCapitalInProfitPct - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} supplyInProfitRelToOwnSupply + * @template T + * @typedef {Object} CloseHighLowOpenPricePattern + * @property {MetricPattern2} close + * @property {Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern} high + * @property {Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern} low + * @property {Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern} open + * @property {MetricPattern20} price */ /** - * Create a InvestedSupplyPattern pattern node + * Create a CloseHighLowOpenPricePattern pattern node + * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {InvestedSupplyPattern} + * @returns {CloseHighLowOpenPricePattern} */ -function createInvestedSupplyPattern(client, acc) { +function createCloseHighLowOpenPricePattern(client, acc) { return { - investedCapitalInLossPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_loss_pct')), - investedCapitalInProfitPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_profit_pct')), - supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), + close: createMetricPattern2(client, _m(acc, 'close')), + high: createDay1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern(client, _m(acc, 'high')), + low: createDay1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern(client, _m(acc, 'low')), + open: createDay1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern(client, _m(acc, 'open')), + price: createMetricPattern20(client, acc), + }; +} + +/** + * @typedef {Object} _1y24h30d7dPattern2 + * @property {BtcSatsUsdPattern} _1y + * @property {BtcSatsUsdPattern} _24h + * @property {BtcSatsUsdPattern} _30d + * @property {BtcSatsUsdPattern} _7d + */ + +/** + * Create a _1y24h30d7dPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_1y24h30d7dPattern2} + */ +function create_1y24h30d7dPattern2(client, acc) { + return { + _1y: createBtcSatsUsdPattern(client, _m(acc, '1y')), + _24h: createBtcSatsUsdPattern(client, _m(acc, '24h')), + _30d: createBtcSatsUsdPattern(client, _m(acc, '30d')), + _7d: createBtcSatsUsdPattern(client, _m(acc, '7d')), + }; +} + +/** + * @typedef {Object} BtcRollingSatsUsdPattern + * @property {MetricPattern20} btc + * @property {_1y24h30d7dPattern2} rolling + * @property {MetricPattern20} sats + * @property {MetricPattern20} usd + */ + +/** + * Create a BtcRollingSatsUsdPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BtcRollingSatsUsdPattern} + */ +function createBtcRollingSatsUsdPattern(client, acc) { + return { + btc: createMetricPattern20(client, _m(acc, 'btc')), + rolling: create_1y24h30d7dPattern2(client, acc), + sats: createMetricPattern20(client, acc), + usd: createMetricPattern20(client, _m(acc, 'usd')), }; } /** * @template T - * @typedef {Object} CloseHighLowOpenPattern - * @property {MetricPattern2} close - * @property {MetricPattern2} high - * @property {MetricPattern2} low - * @property {MetricPattern2} open + * @typedef {Object} _1h24hBlockTxindexPattern + * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} _1h + * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} _24h + * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} block + * @property {MetricPattern21} txindex */ /** - * Create a CloseHighLowOpenPattern pattern node + * Create a _1h24hBlockTxindexPattern pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {CloseHighLowOpenPattern} + * @returns {_1h24hBlockTxindexPattern} */ -function createCloseHighLowOpenPattern(client, acc) { +function create_1h24hBlockTxindexPattern(client, acc) { return { - close: createMetricPattern2(client, _m(acc, 'close')), - high: createMetricPattern2(client, _m(acc, 'high')), - low: createMetricPattern2(client, _m(acc, 'low')), - open: createMetricPattern2(client, _m(acc, 'open')), + _1h: createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, '1h')), + _24h: createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, '24h')), + block: createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc), + txindex: createMetricPattern21(client, acc), + }; +} + +/** + * @template T + * @typedef {Object} _1y24h30d7dPattern + * @property {MetricPattern1} _1y + * @property {MetricPattern1} _24h + * @property {MetricPattern1} _30d + * @property {MetricPattern1} _7d + */ + +/** + * Create a _1y24h30d7dPattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_1y24h30d7dPattern} + */ +function create_1y24h30d7dPattern(client, acc) { + return { + _1y: createMetricPattern1(client, _m(acc, '1y')), + _24h: createMetricPattern1(client, _m(acc, '24h')), + _30d: createMetricPattern1(client, _m(acc, '30d')), + _7d: createMetricPattern1(client, _m(acc, '7d')), }; } @@ -3619,31 +3652,52 @@ function create_30dHalvedTotalPattern(client, acc) { } /** - * @typedef {Object} BaseCumulativeSumPattern - * @property {MetricPattern20} base - * @property {MetricPattern2} cumulative - * @property {MetricPattern2} sum + * @typedef {Object} BtcSatsUsdPattern2 + * @property {MetricPattern1} btc + * @property {CumulativeHeightPattern} sats + * @property {MetricPattern1} usd */ /** - * Create a BaseCumulativeSumPattern pattern node + * Create a BtcSatsUsdPattern2 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {BaseCumulativeSumPattern} + * @returns {BtcSatsUsdPattern2} */ -function createBaseCumulativeSumPattern(client, acc) { +function createBtcSatsUsdPattern2(client, acc) { return { - base: createMetricPattern20(client, acc), - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - sum: createMetricPattern2(client, _m(acc, 'sum')), + btc: createMetricPattern1(client, _m(acc, 'btc')), + sats: createCumulativeHeightPattern(client, acc), + usd: createMetricPattern1(client, _m(acc, 'usd')), + }; +} + +/** + * @typedef {Object} BtcSatsUsdPattern4 + * @property {MetricPattern1} btc + * @property {CumulativeHeightRollingPattern} sats + * @property {CumulativeHeightRollingPattern} usd + */ + +/** + * Create a BtcSatsUsdPattern4 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BtcSatsUsdPattern4} + */ +function createBtcSatsUsdPattern4(client, acc) { + return { + btc: createMetricPattern1(client, _m(acc, 'btc')), + sats: createCumulativeHeightRollingPattern(client, acc), + usd: createCumulativeHeightRollingPattern(client, _m(acc, 'usd')), }; } /** * @typedef {Object} BtcSatsUsdPattern3 - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} btc - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} sats - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} usd + * @property {MetricPattern1} btc + * @property {CumulativeHeightRollingPattern2} sats + * @property {CumulativeHeightRollingPattern2} usd */ /** @@ -3654,9 +3708,9 @@ function createBaseCumulativeSumPattern(client, acc) { */ function createBtcSatsUsdPattern3(client, acc) { return { - btc: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, 'btc')), - sats: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc), - usd: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, _m(acc, 'usd')), + btc: createMetricPattern1(client, _m(acc, 'btc')), + sats: createCumulativeHeightRollingPattern2(client, acc), + usd: createCumulativeHeightRollingPattern2(client, _m(acc, 'usd')), }; } @@ -3681,51 +3735,9 @@ function createBtcSatsUsdPattern(client, acc) { }; } -/** - * @typedef {Object} BtcSatsUsdPattern4 - * @property {CumulativeSumPattern} btc - * @property {CumulativeSumPattern} sats - * @property {CumulativeSumPattern} usd - */ - -/** - * Create a BtcSatsUsdPattern4 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {BtcSatsUsdPattern4} - */ -function createBtcSatsUsdPattern4(client, acc) { - return { - btc: createCumulativeSumPattern(client, _m(acc, 'btc')), - sats: createCumulativeSumPattern(client, acc), - usd: createCumulativeSumPattern(client, _m(acc, 'usd')), - }; -} - -/** - * @typedef {Object} BtcSatsUsdPattern2 - * @property {CumulativeSumPattern2} btc - * @property {CumulativeSumPattern} sats - * @property {CumulativeSumPattern} usd - */ - -/** - * Create a BtcSatsUsdPattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {BtcSatsUsdPattern2} - */ -function createBtcSatsUsdPattern2(client, acc) { - return { - btc: createCumulativeSumPattern2(client, _m(acc, 'btc')), - sats: createCumulativeSumPattern(client, acc), - usd: createCumulativeSumPattern(client, _m(acc, 'usd')), - }; -} - /** * @typedef {Object} HistogramLineSignalPattern - * @property {MetricPattern20} histogram + * @property {MetricPattern1} histogram * @property {MetricPattern1} line * @property {MetricPattern1} signal */ @@ -3738,12 +3750,58 @@ function createBtcSatsUsdPattern2(client, acc) { */ function createHistogramLineSignalPattern(client, acc) { return { - histogram: createMetricPattern20(client, _m(acc, 'histogram_1y')), + histogram: createMetricPattern1(client, _m(acc, 'histogram_1y')), line: createMetricPattern1(client, _m(acc, 'line_1y')), signal: createMetricPattern1(client, _m(acc, 'signal_1y')), }; } +/** + * @template T + * @typedef {Object} CumulativeHeightRollingPattern2 + * @property {MetricPattern1} cumulative + * @property {MetricPattern20} height + * @property {AverageMaxMedianMinP10P25P75P90SumPattern} rolling + */ + +/** + * Create a CumulativeHeightRollingPattern2 pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CumulativeHeightRollingPattern2} + */ +function createCumulativeHeightRollingPattern2(client, acc) { + return { + cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + height: createMetricPattern20(client, acc), + rolling: createAverageMaxMedianMinP10P25P75P90SumPattern(client, acc), + }; +} + +/** + * @template T + * @typedef {Object} CumulativeHeightRollingPattern + * @property {MetricPattern1} cumulative + * @property {MetricPattern20} height + * @property {_1y24h30d7dPattern} rolling + */ + +/** + * Create a CumulativeHeightRollingPattern pattern node + * @template T + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CumulativeHeightRollingPattern} + */ +function createCumulativeHeightRollingPattern(client, acc) { + return { + cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + height: createMetricPattern20(client, acc), + rolling: create_1y24h30d7dPattern(client, acc), + }; +} + /** * @typedef {Object} _30dCountPattern * @property {MetricPattern1} _30dChange @@ -3763,6 +3821,25 @@ function create_30dCountPattern(client, acc) { }; } +/** + * @typedef {Object} BaseRestPattern + * @property {MetricPattern20} base + * @property {AverageCumulativeMaxMedianMinP10P25P75P90SumPattern} rest + */ + +/** + * Create a BaseRestPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BaseRestPattern} + */ +function createBaseRestPattern(client, acc) { + return { + base: createMetricPattern20(client, acc), + rest: createAverageCumulativeMaxMedianMinP10P25P75P90SumPattern(client, acc), + }; +} + /** * @typedef {Object} MaxMinPattern * @property {SatsUsdPattern} max @@ -3841,43 +3918,22 @@ function createUtxoPattern(client, acc) { /** * @template T - * @typedef {Object} CumulativeSumPattern2 - * @property {MetricPattern2} cumulative - * @property {MetricPattern1} sum - */ - -/** - * Create a CumulativeSumPattern2 pattern node - * @template T - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {CumulativeSumPattern2} - */ -function createCumulativeSumPattern2(client, acc) { - return { - cumulative: createMetricPattern2(client, _m(acc, 'cumulative')), - sum: createMetricPattern1(client, acc), - }; -} - -/** - * @template T - * @typedef {Object} CumulativeSumPattern + * @typedef {Object} CumulativeHeightPattern * @property {MetricPattern1} cumulative - * @property {MetricPattern1} sum + * @property {MetricPattern20} height */ /** - * Create a CumulativeSumPattern pattern node + * Create a CumulativeHeightPattern pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {CumulativeSumPattern} + * @returns {CumulativeHeightPattern} */ -function createCumulativeSumPattern(client, acc) { +function createCumulativeHeightPattern(client, acc) { return { cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - sum: createMetricPattern1(client, acc), + height: createMetricPattern20(client, acc), }; } @@ -3926,13 +3982,13 @@ function createRatioPattern2(client, acc) { * @property {MetricsTree_Blocks_Difficulty} difficulty * @property {MetricsTree_Blocks_Time} time * @property {MetricPattern20} totalSize - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} weight + * @property {MetricsTree_Blocks_Weight} weight * @property {MetricsTree_Blocks_Count} count - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} interval + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} interval * @property {MetricsTree_Blocks_Halving} halving - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} vbytes - * @property {MetricsTree_Blocks_Size} size - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} fullness + * @property {CumulativeHeightRollingPattern2} vbytes + * @property {AverageCumulativeMaxMedianMinP10P25P75P90SumPattern} size + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} fullness */ /** @@ -3947,15 +4003,54 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Blocks_Time - * @property {MetricPattern1} timestamp + * @property {MetricsTree_Blocks_Time_Timestamp} timestamp * @property {MetricPattern20} date * @property {MetricPattern20} timestampMonotonic */ +/** + * @typedef {Object} MetricsTree_Blocks_Time_Timestamp + * @property {MetricPattern20} base + * @property {MetricPattern3} minute1 + * @property {MetricPattern4} minute5 + * @property {MetricPattern5} minute10 + * @property {MetricPattern6} minute30 + * @property {MetricPattern7} hour1 + * @property {MetricPattern8} hour4 + * @property {MetricPattern9} hour12 + * @property {MetricPattern10} day1 + * @property {MetricPattern11} day3 + * @property {MetricPattern12} week1 + * @property {MetricPattern13} month1 + * @property {MetricPattern14} month3 + * @property {MetricPattern15} month6 + * @property {MetricPattern16} year1 + * @property {MetricPattern17} year10 + * @property {MetricPattern18} halvingepoch + * @property {MetricPattern19} difficultyepoch + */ + +/** + * @typedef {Object} MetricsTree_Blocks_Weight + * @property {MetricPattern20} base + * @property {MetricPattern1} cumulative + * @property {_1y24h30d7dPattern} sum + * @property {_1y24h30d7dPattern} average + * @property {_1y24h30d7dPattern} min + * @property {_1y24h30d7dPattern} max + * @property {_1y24h30d7dPattern} p10 + * @property {_1y24h30d7dPattern} p25 + * @property {_1y24h30d7dPattern} median + * @property {_1y24h30d7dPattern} p75 + * @property {_1y24h30d7dPattern} p90 + */ + /** * @typedef {Object} MetricsTree_Blocks_Count * @property {MetricPattern1} blockCountTarget - * @property {CumulativeSumPattern} blockCount + * @property {CumulativeHeightRollingPattern} blockCount + * @property {_1y24h30d7dPattern} blockCountSum + * @property {MetricPattern20} height1hAgo * @property {MetricPattern20} height24hAgo * @property {MetricPattern20} height3dAgo * @property {MetricPattern20} height1wAgo @@ -3986,10 +4081,6 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern20} height6yAgo * @property {MetricPattern20} height8yAgo * @property {MetricPattern20} height10yAgo - * @property {MetricPattern1} blockCount24hSum - * @property {MetricPattern1} blockCount1wSum - * @property {MetricPattern1} blockCount1mSum - * @property {MetricPattern1} blockCount1ySum */ /** @@ -3999,20 +4090,6 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern1} daysBeforeNextHalving */ -/** - * @typedef {Object} MetricsTree_Blocks_Size - * @property {MetricPattern1} cumulative - * @property {MetricPattern2} average - * @property {MetricPattern2} min - * @property {MetricPattern2} max - * @property {MetricPattern2} pct10 - * @property {MetricPattern2} pct25 - * @property {MetricPattern2} median - * @property {MetricPattern2} pct75 - * @property {MetricPattern2} pct90 - * @property {MetricPattern2} sum - */ - /** * @typedef {Object} MetricsTree_Transactions * @property {MetricPattern20} firstTxindex @@ -4034,43 +4111,35 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Transactions_Count - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} txCount + * @property {CumulativeHeightRollingPattern2} txCount * @property {MetricPattern21} isCoinbase */ /** * @typedef {Object} MetricsTree_Transactions_Size - * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern} vsize - * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern} weight + * @property {_1h24hBlockTxindexPattern} vsize + * @property {_1h24hBlockTxindexPattern} weight */ /** * @typedef {Object} MetricsTree_Transactions_Fees * @property {MetricPattern21} inputValue * @property {MetricPattern21} outputValue - * @property {MetricsTree_Transactions_Fees_Fee} fee - * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern} feeRate - */ - -/** - * @typedef {Object} MetricsTree_Transactions_Fees_Fee - * @property {MetricPattern21} txindex - * @property {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} sats - * @property {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} btc - * @property {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} usd + * @property {_1h24hBlockTxindexPattern} fee + * @property {_1h24hBlockTxindexPattern} feeRate */ /** * @typedef {Object} MetricsTree_Transactions_Versions - * @property {CumulativeSumPattern} v1 - * @property {CumulativeSumPattern} v2 - * @property {CumulativeSumPattern} v3 + * @property {CumulativeHeightRollingPattern} v1 + * @property {CumulativeHeightRollingPattern} v2 + * @property {CumulativeHeightRollingPattern} v3 */ /** * @typedef {Object} MetricsTree_Transactions_Volume - * @property {BtcSatsUsdPattern} sentSum - * @property {BtcSatsUsdPattern} receivedSum + * @property {BtcRollingSatsUsdPattern} sentSum + * @property {BtcRollingSatsUsdPattern} receivedSum * @property {BtcSatsUsdPattern} annualizedVolume * @property {MetricPattern1} txPerSec * @property {MetricPattern1} outputsPerSec @@ -4085,7 +4154,7 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern22} outputtype * @property {MetricPattern22} typeindex * @property {MetricsTree_Inputs_Spent} spent - * @property {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} count + * @property {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern} count */ /** @@ -4112,7 +4181,7 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Outputs_Count - * @property {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} totalCount + * @property {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern} totalCount * @property {MetricPattern1} utxoCount */ @@ -4152,21 +4221,21 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Scripts_Count - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2a - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2ms - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2pk33 - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2pk65 - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2pkh - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2sh - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2tr - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2wpkh - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2wsh - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} opreturn - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} emptyoutput - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} unknownoutput - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} segwit - * @property {BaseCumulativeSumPattern} taprootAdoption - * @property {BaseCumulativeSumPattern} segwitAdoption + * @property {CumulativeHeightRollingPattern} p2a + * @property {CumulativeHeightRollingPattern} p2ms + * @property {CumulativeHeightRollingPattern} p2pk33 + * @property {CumulativeHeightRollingPattern} p2pk65 + * @property {CumulativeHeightRollingPattern} p2pkh + * @property {CumulativeHeightRollingPattern} p2sh + * @property {CumulativeHeightRollingPattern} p2tr + * @property {CumulativeHeightRollingPattern} p2wpkh + * @property {CumulativeHeightRollingPattern} p2wsh + * @property {CumulativeHeightRollingPattern} opreturn + * @property {CumulativeHeightRollingPattern} emptyoutput + * @property {CumulativeHeightRollingPattern} unknownoutput + * @property {CumulativeHeightRollingPattern} segwit + * @property {MetricPattern1} taprootAdoption + * @property {MetricPattern1} segwitAdoption */ /** @@ -4182,17 +4251,10 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Mining_Rewards - * @property {BtcSatsUsdPattern} coinbase24hSum - * @property {BtcSatsUsdPattern} coinbase7dSum - * @property {BtcSatsUsdPattern} coinbase30dSum - * @property {BtcSatsUsdPattern} coinbase1ySum - * @property {BtcSatsUsdPattern} fee24hSum - * @property {BtcSatsUsdPattern} fee7dSum - * @property {BtcSatsUsdPattern} fee30dSum - * @property {BtcSatsUsdPattern} fee1ySum * @property {BtcSatsUsdPattern3} coinbase * @property {BtcSatsUsdPattern3} subsidy - * @property {BtcSatsUsdPattern2} unclaimedRewards + * @property {BtcSatsUsdPattern3} fees + * @property {BtcSatsUsdPattern4} unclaimedRewards * @property {MetricPattern1} feeDominance * @property {MetricPattern1} feeDominance24h * @property {MetricPattern1} feeDominance7d @@ -4246,8 +4308,8 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Cointime_Activity - * @property {CumulativeSumPattern} coinblocksCreated - * @property {CumulativeSumPattern} coinblocksStored + * @property {CumulativeHeightRollingPattern} coinblocksCreated + * @property {CumulativeHeightRollingPattern} coinblocksStored * @property {MetricPattern1} liveliness * @property {MetricPattern1} vaultedness * @property {MetricPattern1} activityToVaultednessRatio @@ -4261,10 +4323,10 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Cointime_Value - * @property {CumulativeSumPattern} cointimeValueDestroyed - * @property {CumulativeSumPattern} cointimeValueCreated - * @property {CumulativeSumPattern} cointimeValueStored - * @property {CumulativeSumPattern} vocdd + * @property {CumulativeHeightRollingPattern} cointimeValueDestroyed + * @property {CumulativeHeightRollingPattern} cointimeValueCreated + * @property {CumulativeHeightRollingPattern} cointimeValueStored + * @property {CumulativeHeightRollingPattern} vocdd */ /** @@ -4651,12 +4713,12 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern1} price1wVolatility * @property {MetricPattern1} price1mVolatility * @property {MetricPattern1} price1yVolatility - * @property {MetricPattern20} sharpe1w - * @property {MetricPattern20} sharpe1m - * @property {MetricPattern20} sharpe1y - * @property {MetricPattern20} sortino1w - * @property {MetricPattern20} sortino1m - * @property {MetricPattern20} sortino1y + * @property {MetricPattern1} sharpe1w + * @property {MetricPattern1} sharpe1m + * @property {MetricPattern1} sharpe1y + * @property {MetricPattern1} sortino1w + * @property {MetricPattern1} sortino1m + * @property {MetricPattern1} sortino1y */ /** @@ -4877,7 +4939,7 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern1} losses * @property {MetricPattern1} averageGain * @property {MetricPattern1} averageLoss - * @property {MetricPattern20} rsi + * @property {MetricPattern1} rsi * @property {MetricPattern1} rsiMin * @property {MetricPattern1} rsiMax * @property {MetricPattern1} stochRsi @@ -4891,7 +4953,7 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern1} losses * @property {MetricPattern1} averageGain * @property {MetricPattern1} averageLoss - * @property {MetricPattern20} rsi + * @property {MetricPattern1} rsi * @property {MetricPattern1} rsiMin * @property {MetricPattern1} rsiMax * @property {MetricPattern1} stochRsi @@ -4905,7 +4967,7 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern1} losses * @property {MetricPattern1} averageGain * @property {MetricPattern1} averageLoss - * @property {MetricPattern20} rsi + * @property {MetricPattern1} rsi * @property {MetricPattern1} rsiMin * @property {MetricPattern1} rsiMax * @property {MetricPattern1} stochRsi @@ -4925,21 +4987,21 @@ function createRatioPattern2(client, acc) { * @typedef {Object} MetricsTree_Market_Indicators_Macd_1d * @property {MetricPattern1} line * @property {MetricPattern1} signal - * @property {MetricPattern20} histogram + * @property {MetricPattern1} histogram */ /** * @typedef {Object} MetricsTree_Market_Indicators_Macd_1w * @property {MetricPattern1} line * @property {MetricPattern1} signal - * @property {MetricPattern20} histogram + * @property {MetricPattern1} histogram */ /** * @typedef {Object} MetricsTree_Market_Indicators_Macd_1m * @property {MetricPattern1} line * @property {MetricPattern1} signal - * @property {MetricPattern20} histogram + * @property {MetricPattern1} histogram */ /** @@ -5116,30 +5178,9 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Prices - * @property {MetricsTree_Prices_Cents} cents - * @property {MetricsTree_Prices_Usd} usd - * @property {MetricsTree_Prices_Sats} sats - */ - -/** - * @typedef {Object} MetricsTree_Prices_Cents - * @property {MetricPattern20} price - * @property {CloseHighLowOpenPattern} split - * @property {MetricPattern2} ohlc - */ - -/** - * @typedef {Object} MetricsTree_Prices_Usd - * @property {MetricPattern20} price - * @property {CloseHighLowOpenPattern} split - * @property {MetricPattern2} ohlc - */ - -/** - * @typedef {Object} MetricsTree_Prices_Sats - * @property {MetricPattern20} price - * @property {CloseHighLowOpenPattern} split - * @property {MetricPattern2} ohlc + * @property {CloseHighLowOpenPricePattern} cents + * @property {CloseHighLowOpenPricePattern} usd + * @property {CloseHighLowOpenPricePattern} sats */ /** @@ -5180,16 +5221,17 @@ function createRatioPattern2(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_AgeRange} ageRange - * @property {MetricsTree_Distribution_UtxoCohorts_Epoch} epoch - * @property {MetricsTree_Distribution_UtxoCohorts_Year} year + * @property {MetricsTree_Distribution_UtxoCohorts_MaxAge} maxAge * @property {MetricsTree_Distribution_UtxoCohorts_MinAge} minAge * @property {MetricsTree_Distribution_UtxoCohorts_GeAmount} geAmount * @property {MetricsTree_Distribution_UtxoCohorts_AmountRange} amountRange - * @property {MetricsTree_Distribution_UtxoCohorts_Term} term - * @property {MetricsTree_Distribution_UtxoCohorts_Type} type - * @property {MetricsTree_Distribution_UtxoCohorts_MaxAge} maxAge * @property {MetricsTree_Distribution_UtxoCohorts_LtAmount} ltAmount + * @property {MetricsTree_Distribution_UtxoCohorts_Epoch} epoch + * @property {MetricsTree_Distribution_UtxoCohorts_Year} year + * @property {MetricsTree_Distribution_UtxoCohorts_Type} type */ /** @@ -5198,8 +5240,8 @@ function createRatioPattern2(client, acc) { * @property {UtxoPattern} outputs * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity * @property {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized - * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized * @property {InvestedMaxMinPercentilesSpotPattern} costBasis + * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized * @property {MetricsTree_Distribution_UtxoCohorts_All_Relative} relative */ @@ -5212,15 +5254,26 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern1} negUnrealizedLossRelToMarketCap * @property {MetricPattern1} netUnrealizedPnlRelToMarketCap * @property {MetricPattern1} nupl + * @property {MetricPattern1} investedCapitalInProfitPct + * @property {MetricPattern1} investedCapitalInLossPct * @property {MetricPattern1} unrealizedProfitRelToOwnTotalUnrealizedPnl * @property {MetricPattern1} unrealizedLossRelToOwnTotalUnrealizedPnl * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} investedCapitalInProfitPct - * @property {MetricPattern1} investedCapitalInLossPct * @property {MetricPattern1} unrealizedPeakRegretRelToMarketCap */ +/** + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Sth + * @property {_30dHalvedTotalPattern} supply + * @property {UtxoPattern} outputs + * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity + * @property {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized + * @property {InvestedMaxMinPercentilesSpotPattern} costBasis + * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized + * @property {InvestedNegNetNuplSupplyUnrealizedPattern2} relative + */ + /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_AgeRange * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern} upTo1h @@ -5246,6 +5299,103 @@ function createRatioPattern2(client, acc) { * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern} from15y */ +/** + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_MaxAge + * @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 + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _15y + */ + +/** + * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_MinAge + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _1d + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _1w + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _1m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _2m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _3m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _4m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _5m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _6m + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _1y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _2y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _3y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _4y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _5y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _6y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _7y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _8y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _10y + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _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 + */ + +/** + * @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 + */ + +/** + * @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 + */ + /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Epoch * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _0 @@ -5277,144 +5427,19 @@ function createRatioPattern2(client, acc) { * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} _2026 */ -/** - * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_MinAge - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _1d - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _1w - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _1m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _2m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _3m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _4m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _5m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _6m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _1y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _2y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _3y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _4y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _5y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _6y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _7y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _8y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _10y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6} _12y - */ - -/** - * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_GeAmount - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1sat - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _100sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _100kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _100btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1kBtc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _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 - */ - -/** - * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Term - * @property {MetricsTree_Distribution_UtxoCohorts_Term_Short} short - * @property {MetricsTree_Distribution_UtxoCohorts_Term_Long} long - */ - -/** - * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Term_Short - * @property {_30dHalvedTotalPattern} supply - * @property {UtxoPattern} outputs - * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity - * @property {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized - * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized - * @property {InvestedMaxMinPercentilesSpotPattern} costBasis - * @property {InvestedNegNetNuplSupplyUnrealizedPattern4} relative - */ - -/** - * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Term_Long - * @property {_30dHalvedTotalPattern} supply - * @property {UtxoPattern} outputs - * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity - * @property {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2} realized - * @property {GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern} unrealized - * @property {InvestedMaxMinPercentilesSpotPattern} costBasis - * @property {InvestedNegNetNuplSupplyUnrealizedPattern4} relative - */ - /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Type * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2pk65 * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2pk33 * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2pkh - * @property {ActivityCostOutputsRealizedSupplyUnrealizedPattern} p2ms + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2ms * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2sh * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2wpkh * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2wsh * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2tr * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} p2a - * @property {ActivityCostOutputsRealizedSupplyUnrealizedPattern} unknown - * @property {ActivityCostOutputsRealizedSupplyUnrealizedPattern} empty - */ - -/** - * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_MaxAge - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _1w - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _1m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _2m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _3m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _4m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _5m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _6m - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _1y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _2y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _3y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _4y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _5y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _6y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _7y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _8y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _10y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _12y - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5} _15y - */ - -/** - * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_LtAmount - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _100sats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _100kSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10mSats - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _100btc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _1kBtc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _10kBtc - * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4} _100kBtc + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} unknown + * @property {ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3} empty */ /** @@ -5505,28 +5530,28 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Distribution_NewAddrCount - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} all - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2pk65 - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2pk33 - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2pkh - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2sh - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2wpkh - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2wsh - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2tr - * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} p2a + * @property {BaseRestPattern} all + * @property {BaseRestPattern} p2pk65 + * @property {BaseRestPattern} p2pk33 + * @property {BaseRestPattern} p2pkh + * @property {BaseRestPattern} p2sh + * @property {BaseRestPattern} p2wpkh + * @property {BaseRestPattern} p2wsh + * @property {BaseRestPattern} p2tr + * @property {BaseRestPattern} p2a */ /** * @typedef {Object} MetricsTree_Distribution_GrowthRate - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} all - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2pk65 - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2pk33 - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2pkh - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2sh - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2wpkh - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2wsh - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2tr - * @property {AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2a + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} all + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} p2pk65 + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} p2pk33 + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} p2pkh + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} p2sh + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} p2wpkh + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} p2wsh + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} p2tr + * @property {AverageHeightMaxMedianMinP10P25P75P90Pattern} p2a */ /** @@ -5543,8 +5568,8 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Supply_Burned - * @property {BtcSatsUsdPattern2} opreturn - * @property {BtcSatsUsdPattern2} unspendable + * @property {BtcSatsUsdPattern4} opreturn + * @property {BtcSatsUsdPattern4} unspendable */ /** @@ -6512,15 +6537,48 @@ class BrkClient extends BrkClientBase { daysBeforeNextAdjustment: createMetricPattern1(this, 'days_before_next_difficulty_adjustment'), }, time: { - timestamp: createMetricPattern1(this, 'timestamp'), + timestamp: { + base: createMetricPattern20(this, 'timestamp'), + minute1: createMetricPattern3(this, 'timestamp_minute1'), + minute5: createMetricPattern4(this, 'timestamp_minute5'), + minute10: createMetricPattern5(this, 'timestamp_minute10'), + minute30: createMetricPattern6(this, 'timestamp_minute30'), + hour1: createMetricPattern7(this, 'timestamp_hour1'), + hour4: createMetricPattern8(this, 'timestamp_hour4'), + hour12: createMetricPattern9(this, 'timestamp_hour12'), + day1: createMetricPattern10(this, 'timestamp_day1'), + day3: createMetricPattern11(this, 'timestamp_day3'), + week1: createMetricPattern12(this, 'timestamp_week1'), + month1: createMetricPattern13(this, 'timestamp_month1'), + month3: createMetricPattern14(this, 'timestamp_month3'), + month6: createMetricPattern15(this, 'timestamp_month6'), + year1: createMetricPattern16(this, 'timestamp_year1'), + year10: createMetricPattern17(this, 'timestamp_year10'), + halvingepoch: createMetricPattern18(this, 'timestamp_halvingepoch'), + difficultyepoch: createMetricPattern19(this, 'timestamp_difficultyepoch'), + }, date: createMetricPattern20(this, 'date'), timestampMonotonic: createMetricPattern20(this, 'timestamp_monotonic'), }, totalSize: createMetricPattern20(this, 'total_size'), - weight: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'block_weight'), + weight: { + base: createMetricPattern20(this, 'block_weight'), + cumulative: createMetricPattern1(this, 'block_weight_cumulative'), + sum: create_1y24h30d7dPattern(this, 'block_weight_sum'), + average: create_1y24h30d7dPattern(this, 'block_weight_average'), + min: create_1y24h30d7dPattern(this, 'block_weight_min'), + max: create_1y24h30d7dPattern(this, 'block_weight_max'), + p10: create_1y24h30d7dPattern(this, 'block_weight_p10'), + p25: create_1y24h30d7dPattern(this, 'block_weight_p25'), + median: create_1y24h30d7dPattern(this, 'block_weight_median'), + p75: create_1y24h30d7dPattern(this, 'block_weight_p75'), + p90: create_1y24h30d7dPattern(this, 'block_weight_p90'), + }, count: { blockCountTarget: createMetricPattern1(this, 'block_count_target'), - blockCount: createCumulativeSumPattern(this, 'block_count'), + blockCount: createCumulativeHeightRollingPattern(this, 'block_count'), + blockCountSum: create_1y24h30d7dPattern(this, 'block_count_sum'), + height1hAgo: createMetricPattern20(this, 'height_1h_ago'), height24hAgo: createMetricPattern20(this, 'height_24h_ago'), height3dAgo: createMetricPattern20(this, 'height_3d_ago'), height1wAgo: createMetricPattern20(this, 'height_1w_ago'), @@ -6551,31 +6609,16 @@ class BrkClient extends BrkClientBase { height6yAgo: createMetricPattern20(this, 'height_6y_ago'), height8yAgo: createMetricPattern20(this, 'height_8y_ago'), height10yAgo: createMetricPattern20(this, 'height_10y_ago'), - blockCount24hSum: createMetricPattern1(this, 'block_count_24h_sum'), - blockCount1wSum: createMetricPattern1(this, 'block_count_1w_sum'), - blockCount1mSum: createMetricPattern1(this, 'block_count_1m_sum'), - blockCount1ySum: createMetricPattern1(this, 'block_count_1y_sum'), }, - interval: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'block_interval'), + interval: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'block_interval'), halving: { epoch: createMetricPattern1(this, 'halving_epoch'), blocksBeforeNextHalving: createMetricPattern1(this, 'blocks_before_next_halving'), daysBeforeNextHalving: createMetricPattern1(this, 'days_before_next_halving'), }, - vbytes: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'block_vbytes'), - size: { - cumulative: createMetricPattern1(this, 'block_size_cumulative'), - average: createMetricPattern2(this, 'block_size_average'), - min: createMetricPattern2(this, 'block_size_min'), - max: createMetricPattern2(this, 'block_size_max'), - pct10: createMetricPattern2(this, 'block_size_pct10'), - pct25: createMetricPattern2(this, 'block_size_pct25'), - median: createMetricPattern2(this, 'block_size_median'), - pct75: createMetricPattern2(this, 'block_size_pct75'), - pct90: createMetricPattern2(this, 'block_size_pct90'), - sum: createMetricPattern2(this, 'block_size_sum'), - }, - fullness: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'block_fullness'), + vbytes: createCumulativeHeightRollingPattern2(this, 'block_vbytes'), + size: createAverageCumulativeMaxMedianMinP10P25P75P90SumPattern(this, 'block_size'), + fullness: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'block_fullness'), }, transactions: { firstTxindex: createMetricPattern20(this, 'first_txindex'), @@ -6589,32 +6632,27 @@ class BrkClient extends BrkClientBase { firstTxinindex: createMetricPattern21(this, 'first_txinindex'), firstTxoutindex: createMetricPattern21(this, 'first_txoutindex'), count: { - txCount: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'tx_count'), + txCount: createCumulativeHeightRollingPattern2(this, 'tx_count'), isCoinbase: createMetricPattern21(this, 'is_coinbase'), }, size: { - vsize: createAverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern(this, 'tx_vsize'), - weight: createAverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern(this, 'tx_weight'), + vsize: create_1h24hBlockTxindexPattern(this, 'tx_vsize'), + weight: create_1h24hBlockTxindexPattern(this, 'tx_weight'), }, fees: { inputValue: createMetricPattern21(this, 'input_value'), outputValue: createMetricPattern21(this, 'output_value'), - fee: { - txindex: createMetricPattern21(this, 'fee'), - sats: createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(this, 'fee'), - btc: createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(this, 'fee_btc'), - usd: createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(this, 'fee_usd'), - }, - feeRate: createAverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern(this, 'fee_rate'), + fee: create_1h24hBlockTxindexPattern(this, 'fee'), + feeRate: create_1h24hBlockTxindexPattern(this, 'fee_rate'), }, versions: { - v1: createCumulativeSumPattern(this, 'tx_v1'), - v2: createCumulativeSumPattern(this, 'tx_v2'), - v3: createCumulativeSumPattern(this, 'tx_v3'), + v1: createCumulativeHeightRollingPattern(this, 'tx_v1'), + v2: createCumulativeHeightRollingPattern(this, 'tx_v2'), + v3: createCumulativeHeightRollingPattern(this, 'tx_v3'), }, volume: { - sentSum: createBtcSatsUsdPattern(this, 'sent_sum'), - receivedSum: createBtcSatsUsdPattern(this, 'received_sum'), + sentSum: createBtcRollingSatsUsdPattern(this, 'sent_sum'), + receivedSum: createBtcRollingSatsUsdPattern(this, 'received_sum'), annualizedVolume: createBtcSatsUsdPattern(this, 'annualized_volume'), txPerSec: createMetricPattern1(this, 'tx_per_sec'), outputsPerSec: createMetricPattern1(this, 'outputs_per_sec'), @@ -6631,7 +6669,7 @@ class BrkClient extends BrkClientBase { txoutindex: createMetricPattern22(this, 'txoutindex'), value: createMetricPattern22(this, 'value'), }, - count: createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(this, 'input_count'), + count: createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(this, 'input_count'), }, outputs: { firstTxoutindex: createMetricPattern20(this, 'first_txoutindex'), @@ -6643,7 +6681,7 @@ class BrkClient extends BrkClientBase { txinindex: createMetricPattern23(this, 'txinindex'), }, count: { - totalCount: createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(this, 'output_count'), + totalCount: createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(this, 'output_count'), utxoCount: createMetricPattern1(this, 'exact_utxo_count'), }, }, @@ -6675,21 +6713,21 @@ class BrkClient extends BrkClientBase { p2msToTxindex: createMetricPattern27(this, 'txindex'), unknownToTxindex: createMetricPattern35(this, 'txindex'), count: { - p2a: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2a_count'), - p2ms: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2ms_count'), - p2pk33: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2pk33_count'), - p2pk65: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2pk65_count'), - p2pkh: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2pkh_count'), - p2sh: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2sh_count'), - p2tr: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2tr_count'), - p2wpkh: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2wpkh_count'), - p2wsh: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2wsh_count'), - opreturn: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'opreturn_count'), - emptyoutput: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'emptyoutput_count'), - unknownoutput: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'unknownoutput_count'), - segwit: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'segwit_count'), - taprootAdoption: createBaseCumulativeSumPattern(this, 'taproot_adoption'), - segwitAdoption: createBaseCumulativeSumPattern(this, 'segwit_adoption'), + p2a: createCumulativeHeightRollingPattern(this, 'p2a_count'), + p2ms: createCumulativeHeightRollingPattern(this, 'p2ms_count'), + p2pk33: createCumulativeHeightRollingPattern(this, 'p2pk33_count'), + p2pk65: createCumulativeHeightRollingPattern(this, 'p2pk65_count'), + p2pkh: createCumulativeHeightRollingPattern(this, 'p2pkh_count'), + p2sh: createCumulativeHeightRollingPattern(this, 'p2sh_count'), + p2tr: createCumulativeHeightRollingPattern(this, 'p2tr_count'), + p2wpkh: createCumulativeHeightRollingPattern(this, 'p2wpkh_count'), + p2wsh: createCumulativeHeightRollingPattern(this, 'p2wsh_count'), + opreturn: createCumulativeHeightRollingPattern(this, 'opreturn_count'), + emptyoutput: createCumulativeHeightRollingPattern(this, 'emptyoutput_count'), + unknownoutput: createCumulativeHeightRollingPattern(this, 'unknownoutput_count'), + segwit: createCumulativeHeightRollingPattern(this, 'segwit_count'), + taprootAdoption: createMetricPattern1(this, 'taproot_adoption'), + segwitAdoption: createMetricPattern1(this, 'segwit_adoption'), }, value: { opreturn: createBtcSatsUsdPattern3(this, 'opreturn_value'), @@ -6697,17 +6735,10 @@ class BrkClient extends BrkClientBase { }, mining: { rewards: { - coinbase24hSum: createBtcSatsUsdPattern(this, 'coinbase_24h_sum'), - coinbase7dSum: createBtcSatsUsdPattern(this, 'coinbase_7d_sum'), - coinbase30dSum: createBtcSatsUsdPattern(this, 'coinbase_30d_sum'), - coinbase1ySum: createBtcSatsUsdPattern(this, 'coinbase_1y_sum'), - fee24hSum: createBtcSatsUsdPattern(this, 'fee_24h_sum'), - fee7dSum: createBtcSatsUsdPattern(this, 'fee_7d_sum'), - fee30dSum: createBtcSatsUsdPattern(this, 'fee_30d_sum'), - fee1ySum: createBtcSatsUsdPattern(this, 'fee_1y_sum'), coinbase: createBtcSatsUsdPattern3(this, 'coinbase'), subsidy: createBtcSatsUsdPattern3(this, 'subsidy'), - unclaimedRewards: createBtcSatsUsdPattern2(this, 'unclaimed_rewards'), + fees: createBtcSatsUsdPattern3(this, 'fees'), + unclaimedRewards: createBtcSatsUsdPattern4(this, 'unclaimed_rewards'), feeDominance: createMetricPattern1(this, 'fee_dominance'), feeDominance24h: createMetricPattern1(this, 'fee_dominance_24h'), feeDominance7d: createMetricPattern1(this, 'fee_dominance_7d'), @@ -6746,8 +6777,8 @@ class BrkClient extends BrkClientBase { }, cointime: { activity: { - coinblocksCreated: createCumulativeSumPattern(this, 'coinblocks_created'), - coinblocksStored: createCumulativeSumPattern(this, 'coinblocks_stored'), + coinblocksCreated: createCumulativeHeightRollingPattern(this, 'coinblocks_created'), + coinblocksStored: createCumulativeHeightRollingPattern(this, 'coinblocks_stored'), liveliness: createMetricPattern1(this, 'liveliness'), vaultedness: createMetricPattern1(this, 'vaultedness'), activityToVaultednessRatio: createMetricPattern1(this, 'activity_to_vaultedness_ratio'), @@ -6757,10 +6788,10 @@ class BrkClient extends BrkClientBase { activeSupply: createBtcSatsUsdPattern(this, 'active_supply'), }, value: { - cointimeValueDestroyed: createCumulativeSumPattern(this, 'cointime_value_destroyed'), - cointimeValueCreated: createCumulativeSumPattern(this, 'cointime_value_created'), - cointimeValueStored: createCumulativeSumPattern(this, 'cointime_value_stored'), - vocdd: createCumulativeSumPattern(this, 'vocdd'), + cointimeValueDestroyed: createCumulativeHeightRollingPattern(this, 'cointime_value_destroyed'), + cointimeValueCreated: createCumulativeHeightRollingPattern(this, 'cointime_value_created'), + cointimeValueStored: createCumulativeHeightRollingPattern(this, 'cointime_value_stored'), + vocdd: createCumulativeHeightRollingPattern(this, 'vocdd'), }, cap: { thermoCap: createMetricPattern1(this, 'thermo_cap'), @@ -7012,12 +7043,12 @@ class BrkClient extends BrkClientBase { price1wVolatility: createMetricPattern1(this, 'price_1w_volatility'), price1mVolatility: createMetricPattern1(this, 'price_1m_volatility'), price1yVolatility: createMetricPattern1(this, 'price_1y_volatility'), - sharpe1w: createMetricPattern20(this, 'sharpe_1w'), - sharpe1m: createMetricPattern20(this, 'sharpe_1m'), - sharpe1y: createMetricPattern20(this, 'sharpe_1y'), - sortino1w: createMetricPattern20(this, 'sortino_1w'), - sortino1m: createMetricPattern20(this, 'sortino_1m'), - sortino1y: createMetricPattern20(this, 'sortino_1y'), + sharpe1w: createMetricPattern1(this, 'sharpe_1w'), + sharpe1m: createMetricPattern1(this, 'sharpe_1m'), + sharpe1y: createMetricPattern1(this, 'sharpe_1y'), + sortino1w: createMetricPattern1(this, 'sortino_1w'), + sortino1m: createMetricPattern1(this, 'sortino_1m'), + sortino1y: createMetricPattern1(this, 'sortino_1y'), }, range: { price1wMin: createSatsUsdPattern(this, 'price_1w_min'), @@ -7193,7 +7224,7 @@ class BrkClient extends BrkClientBase { losses: createMetricPattern1(this, 'rsi_losses_1d'), averageGain: createMetricPattern1(this, 'rsi_avg_gain_1d'), averageLoss: createMetricPattern1(this, 'rsi_avg_loss_1d'), - rsi: createMetricPattern20(this, 'rsi_1d'), + rsi: createMetricPattern1(this, 'rsi_1d'), rsiMin: createMetricPattern1(this, 'rsi_rsi_min_1d'), rsiMax: createMetricPattern1(this, 'rsi_rsi_max_1d'), stochRsi: createMetricPattern1(this, 'rsi_stoch_rsi_1d'), @@ -7205,7 +7236,7 @@ class BrkClient extends BrkClientBase { losses: createMetricPattern1(this, 'rsi_losses_1w'), averageGain: createMetricPattern1(this, 'rsi_avg_gain_1w'), averageLoss: createMetricPattern1(this, 'rsi_avg_loss_1w'), - rsi: createMetricPattern20(this, 'rsi_1w'), + rsi: createMetricPattern1(this, 'rsi_1w'), rsiMin: createMetricPattern1(this, 'rsi_rsi_min_1w'), rsiMax: createMetricPattern1(this, 'rsi_rsi_max_1w'), stochRsi: createMetricPattern1(this, 'rsi_stoch_rsi_1w'), @@ -7217,7 +7248,7 @@ class BrkClient extends BrkClientBase { losses: createMetricPattern1(this, 'rsi_losses_1m'), averageGain: createMetricPattern1(this, 'rsi_avg_gain_1m'), averageLoss: createMetricPattern1(this, 'rsi_avg_loss_1m'), - rsi: createMetricPattern20(this, 'rsi_1m'), + rsi: createMetricPattern1(this, 'rsi_1m'), rsiMin: createMetricPattern1(this, 'rsi_rsi_min_1m'), rsiMax: createMetricPattern1(this, 'rsi_rsi_max_1m'), stochRsi: createMetricPattern1(this, 'rsi_stoch_rsi_1m'), @@ -7233,17 +7264,17 @@ class BrkClient extends BrkClientBase { _1d: { line: createMetricPattern1(this, 'macd_line_1d'), signal: createMetricPattern1(this, 'macd_signal_1d'), - histogram: createMetricPattern20(this, 'macd_histogram_1d'), + histogram: createMetricPattern1(this, 'macd_histogram_1d'), }, _1w: { line: createMetricPattern1(this, 'macd_line_1w'), signal: createMetricPattern1(this, 'macd_signal_1w'), - histogram: createMetricPattern20(this, 'macd_histogram_1w'), + histogram: createMetricPattern1(this, 'macd_histogram_1w'), }, _1m: { line: createMetricPattern1(this, 'macd_line_1m'), signal: createMetricPattern1(this, 'macd_signal_1m'), - histogram: createMetricPattern20(this, 'macd_histogram_1m'), + histogram: createMetricPattern1(this, 'macd_histogram_1m'), }, _1y: createHistogramLineSignalPattern(this, 'macd'), }, @@ -7418,21 +7449,9 @@ class BrkClient extends BrkClientBase { }, }, prices: { - cents: { - price: createMetricPattern20(this, 'price_cents'), - split: createCloseHighLowOpenPattern(this, 'price_cents'), - ohlc: createMetricPattern2(this, 'price_cents_ohlc'), - }, - usd: { - price: createMetricPattern20(this, 'price_usd'), - split: createCloseHighLowOpenPattern(this, 'price'), - ohlc: createMetricPattern2(this, 'price_usd_ohlc'), - }, - sats: { - price: createMetricPattern20(this, 'price_sats'), - split: createCloseHighLowOpenPattern(this, 'price_sats'), - ohlc: createMetricPattern2(this, 'price_sats_ohlc'), - }, + cents: createCloseHighLowOpenPricePattern(this, 'price_cents'), + usd: createCloseHighLowOpenPricePattern(this, 'price_usd'), + sats: createCloseHighLowOpenPricePattern(this, 'price_sats'), }, distribution: { supplyState: createMetricPattern20(this, 'supply_state'), @@ -7456,8 +7475,8 @@ class BrkClient extends BrkClientBase { outputs: createUtxoPattern(this, 'utxo_count'), activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(this, ''), realized: createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(this, ''), - unrealized: createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(this, ''), costBasis: createInvestedMaxMinPercentilesSpotPattern(this, ''), + unrealized: createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(this, ''), relative: { supplyInProfitRelToOwnSupply: createMetricPattern1(this, 'supply_in_profit_rel_to_own_supply'), supplyInLossRelToOwnSupply: createMetricPattern1(this, 'supply_in_loss_rel_to_own_supply'), @@ -7466,15 +7485,25 @@ class BrkClient extends BrkClientBase { negUnrealizedLossRelToMarketCap: createMetricPattern1(this, 'neg_unrealized_loss_rel_to_market_cap'), netUnrealizedPnlRelToMarketCap: createMetricPattern1(this, 'net_unrealized_pnl_rel_to_market_cap'), nupl: createMetricPattern1(this, 'nupl'), + investedCapitalInProfitPct: createMetricPattern1(this, 'invested_capital_in_profit_pct'), + investedCapitalInLossPct: createMetricPattern1(this, 'invested_capital_in_loss_pct'), unrealizedProfitRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'unrealized_profit_rel_to_own_total_unrealized_pnl'), unrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'unrealized_loss_rel_to_own_total_unrealized_pnl'), negUnrealizedLossRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl'), netUnrealizedPnlRelToOwnTotalUnrealizedPnl: createMetricPattern1(this, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl'), - investedCapitalInProfitPct: createMetricPattern1(this, 'invested_capital_in_profit_pct'), - investedCapitalInLossPct: createMetricPattern1(this, 'invested_capital_in_loss_pct'), unrealizedPeakRegretRelToMarketCap: createMetricPattern1(this, 'unrealized_peak_regret_rel_to_market_cap'), }, }, + sth: { + supply: create_30dHalvedTotalPattern(this, 'sth'), + outputs: createUtxoPattern(this, 'sth_utxo_count'), + activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(this, 'sth'), + realized: createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(this, 'sth'), + costBasis: createInvestedMaxMinPercentilesSpotPattern(this, 'sth'), + unrealized: createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(this, 'sth'), + relative: createInvestedNegNetNuplSupplyUnrealizedPattern2(this, 'sth'), + }, + lth: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'lth'), ageRange: { upTo1h: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_under_1h_old'), _1hTo1d: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_1h_to_1d_old'), @@ -7498,6 +7527,93 @@ class BrkClient extends BrkClientBase { _12yTo15y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_12y_to_15y_old'), from15y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'utxos_over_15y_old'), }, + maxAge: { + _1w: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_1w_old'), + _1m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_1m_old'), + _2m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_2m_old'), + _3m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_3m_old'), + _4m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_4m_old'), + _5m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_5m_old'), + _6m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_6m_old'), + _1y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_1y_old'), + _2y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_2y_old'), + _3y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_3y_old'), + _4y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_4y_old'), + _5y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_5y_old'), + _6y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_6y_old'), + _7y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_7y_old'), + _8y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_8y_old'), + _10y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_10y_old'), + _12y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_12y_old'), + _15y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_15y_old'), + }, + minAge: { + _1d: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_1d_old'), + _1w: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_1w_old'), + _1m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_1m_old'), + _2m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_2m_old'), + _3m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_3m_old'), + _4m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_4m_old'), + _5m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_5m_old'), + _6m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_6m_old'), + _1y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_1y_old'), + _2y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_2y_old'), + _3y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_3y_old'), + _4y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_4y_old'), + _5y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_5y_old'), + _6y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_6y_old'), + _7y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_7y_old'), + _8y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_8y_old'), + _10y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_over_10y_old'), + _12y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(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'), + }, + 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'), + }, + 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'), + }, epoch: { _0: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'epoch_0'), _1: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'epoch_1'), @@ -7525,125 +7641,18 @@ class BrkClient extends BrkClientBase { _2025: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'year_2025'), _2026: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'year_2026'), }, - minAge: { - _1d: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_1d_old'), - _1w: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_1w_old'), - _1m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_1m_old'), - _2m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_2m_old'), - _3m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_3m_old'), - _4m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_4m_old'), - _5m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_5m_old'), - _6m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_6m_old'), - _1y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_1y_old'), - _2y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_2y_old'), - _3y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_3y_old'), - _4y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_4y_old'), - _5y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_5y_old'), - _6y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_6y_old'), - _7y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_7y_old'), - _8y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_8y_old'), - _10y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_10y_old'), - _12y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(this, 'utxos_over_12y_old'), - }, - geAmount: { - _1sat: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_1sat'), - _10sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_10sats'), - _100sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_100sats'), - _1kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_1k_sats'), - _10kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_10k_sats'), - _100kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_100k_sats'), - _1mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_1m_sats'), - _10mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_10m_sats'), - _1btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_1btc'), - _10btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_10btc'), - _100btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_100btc'), - _1kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_over_1k_btc'), - _10kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(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'), - }, - term: { - short: { - supply: create_30dHalvedTotalPattern(this, 'sth'), - outputs: createUtxoPattern(this, 'sth_utxo_count'), - activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(this, 'sth'), - realized: createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(this, 'sth'), - unrealized: createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(this, 'sth'), - costBasis: createInvestedMaxMinPercentilesSpotPattern(this, 'sth'), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern4(this, 'sth'), - }, - long: { - supply: create_30dHalvedTotalPattern(this, 'lth'), - outputs: createUtxoPattern(this, 'lth_utxo_count'), - activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(this, 'lth'), - realized: createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(this, 'lth'), - unrealized: createGreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(this, 'lth'), - costBasis: createInvestedMaxMinPercentilesSpotPattern(this, 'lth'), - relative: createInvestedNegNetNuplSupplyUnrealizedPattern4(this, 'lth'), - }, - }, type: { p2pk65: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2pk65'), p2pk33: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2pk33'), p2pkh: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'p2pkh'), - p2ms: createActivityCostOutputsRealizedSupplyUnrealizedPattern(this, 'p2ms'), + 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: createActivityCostOutputsRealizedSupplyUnrealizedPattern(this, 'unknown_outputs'), - empty: createActivityCostOutputsRealizedSupplyUnrealizedPattern(this, 'empty_outputs'), - }, - maxAge: { - _1w: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_1w_old'), - _1m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_1m_old'), - _2m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_2m_old'), - _3m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_3m_old'), - _4m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_4m_old'), - _5m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_5m_old'), - _6m: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_6m_old'), - _1y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_1y_old'), - _2y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_2y_old'), - _3y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_3y_old'), - _4y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_4y_old'), - _5y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_5y_old'), - _6y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_6y_old'), - _7y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_7y_old'), - _8y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_8y_old'), - _10y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_10y_old'), - _12y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_12y_old'), - _15y: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(this, 'utxos_under_15y_old'), - }, - ltAmount: { - _10sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_10sats'), - _100sats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_100sats'), - _1kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_1k_sats'), - _10kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_10k_sats'), - _100kSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_100k_sats'), - _1mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_1m_sats'), - _10mSats: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_10m_sats'), - _1btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_1btc'), - _10btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_10btc'), - _100btc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_100btc'), - _1kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_1k_btc'), - _10kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_10k_btc'), - _100kBtc: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(this, 'utxos_under_100k_btc'), + unknown: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'unknown_outputs'), + empty: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(this, 'empty_outputs'), }, }, addressCohorts: { @@ -7720,26 +7729,26 @@ class BrkClient extends BrkClientBase { p2a: createMetricPattern1(this, 'p2a_total_addr_count'), }, newAddrCount: { - all: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'new_addr_count'), - p2pk65: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2pk65_new_addr_count'), - p2pk33: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2pk33_new_addr_count'), - p2pkh: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2pkh_new_addr_count'), - p2sh: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2sh_new_addr_count'), - p2wpkh: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2wpkh_new_addr_count'), - p2wsh: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2wsh_new_addr_count'), - p2tr: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2tr_new_addr_count'), - p2a: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2a_new_addr_count'), + all: createBaseRestPattern(this, 'new_addr_count'), + p2pk65: createBaseRestPattern(this, 'p2pk65_new_addr_count'), + p2pk33: createBaseRestPattern(this, 'p2pk33_new_addr_count'), + p2pkh: createBaseRestPattern(this, 'p2pkh_new_addr_count'), + p2sh: createBaseRestPattern(this, 'p2sh_new_addr_count'), + p2wpkh: createBaseRestPattern(this, 'p2wpkh_new_addr_count'), + p2wsh: createBaseRestPattern(this, 'p2wsh_new_addr_count'), + p2tr: createBaseRestPattern(this, 'p2tr_new_addr_count'), + p2a: createBaseRestPattern(this, 'p2a_new_addr_count'), }, growthRate: { - all: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'growth_rate'), - p2pk65: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2pk65_growth_rate'), - p2pk33: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2pk33_growth_rate'), - p2pkh: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2pkh_growth_rate'), - p2sh: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2sh_growth_rate'), - p2wpkh: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2wpkh_growth_rate'), - p2wsh: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2wsh_growth_rate'), - p2tr: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2tr_growth_rate'), - p2a: createAverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2a_growth_rate'), + all: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'growth_rate'), + p2pk65: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'p2pk65_growth_rate'), + p2pk33: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'p2pk33_growth_rate'), + p2pkh: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'p2pkh_growth_rate'), + p2sh: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'p2sh_growth_rate'), + p2wpkh: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'p2wpkh_growth_rate'), + p2wsh: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'p2wsh_growth_rate'), + p2tr: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'p2tr_growth_rate'), + p2a: createAverageHeightMaxMedianMinP10P25P75P90Pattern(this, 'p2a_growth_rate'), }, fundedaddressindex: createMetricPattern36(this, 'fundedaddressindex'), emptyaddressindex: createMetricPattern37(this, 'emptyaddressindex'), @@ -7747,8 +7756,8 @@ class BrkClient extends BrkClientBase { supply: { circulating: createBtcSatsUsdPattern(this, 'circulating_supply'), burned: { - opreturn: createBtcSatsUsdPattern2(this, 'opreturn_supply'), - unspendable: createBtcSatsUsdPattern2(this, 'unspendable_supply'), + opreturn: createBtcSatsUsdPattern4(this, 'opreturn_supply'), + unspendable: createBtcSatsUsdPattern4(this, 'unspendable_supply'), }, inflation: createMetricPattern1(this, 'inflation_rate'), velocity: { diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index 4ed5e7fa1..67dd9d717 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -50,8 +50,6 @@ CentsSats = int # Used for precise accumulation of investor cap values: Σ(price² × sats). # investor_price = investor_cap_raw / realized_cap_raw CentsSquaredSats = int -# Closing price value for a time period -Close = Cents # Cohort identifier for cost basis distribution. Cohort = str # Bucket type for cost basis aggregation. @@ -80,13 +78,9 @@ FundedAddressIndex = TypeIndex HalvingEpoch = int # Hex-encoded string Hex = str -# Highest price value for a time period -High = Cents Hour1 = int Hour12 = int Hour4 = int -# Lowest price value for a time period -Low = Cents # Virtual size in vbytes (weight / 4, rounded up) VSize = int # Metric name @@ -106,8 +100,6 @@ Minute5 = int Month1 = int Month3 = int Month6 = int -# Opening price value for a time period -Open = Cents OpReturnIndex = TypeIndex OutPoint = int # Type (P2PKH, P2WPKH, P2SH, P2TR, etc.) @@ -675,33 +667,6 @@ class MetricWithIndex(TypedDict): metric: Metric index: Index -class OHLCCents(TypedDict): - """ - OHLC (Open, High, Low, Close) data in cents - """ - open: Open - high: High - low: Low - close: Close - -class OHLCDollars(TypedDict): - """ - OHLC (Open, High, Low, Close) data in dollars - """ - open: Open - high: High - low: Low - close: Close - -class OHLCSats(TypedDict): - """ - OHLC (Open, High, Low, Close) data in satoshis - """ - open: Open - high: High - low: Low - close: Close - class PaginatedMetrics(TypedDict): """ A paginated list of available metric names (1000 per page) @@ -2110,19 +2075,20 @@ class AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSe self.investor_cap_raw: MetricPattern20[CentsSquaredSats] = MetricPattern20(client, _m(acc, 'investor_cap_raw')) self.investor_price: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'investor_price')) self.investor_price_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'investor_price_cents')) - self.investor_price_extra: RatioPattern = RatioPattern(client, _m(acc, 'investor_price_ratio')) + self.investor_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'investor_price_ratio')) + self.investor_price_ratio_ext: RatioPattern3 = RatioPattern3(client, _m(acc, 'investor_price_ratio')) self.loss_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'loss_value_created')) self.loss_value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) self.lower_price_band: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'lower_price_band')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) - self.neg_realized_loss: CumulativeSumPattern2[Dollars] = CumulativeSumPattern2(client, _m(acc, 'neg_realized_loss')) - self.net_realized_pnl: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'net_realized_pnl')) + self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_realized_pnl: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) self.net_realized_pnl_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')) self.net_realized_pnl_cumulative_30d_delta: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')) self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')) self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')) - self.net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) - self.peak_regret: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_peak_regret')) + self.net_realized_pnl_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.peak_regret: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) self.peak_regret_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')) self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) self.profit_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_value_created')) @@ -2131,22 +2097,23 @@ class AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSe self.realized_cap_30d_delta: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap_30d_delta')) self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) self.realized_cap_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')) - self.realized_loss: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_loss')) + self.realized_loss: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) self.realized_loss_1y: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_1y')) self.realized_loss_24h: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_24h')) self.realized_loss_30d: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_30d')) self.realized_loss_7d: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_7d')) self.realized_loss_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_7d_ema')) - self.realized_loss_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')) self.realized_price: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'realized_price')) - self.realized_price_extra: RatioPattern = RatioPattern(client, _m(acc, 'realized_price_ratio')) - self.realized_profit: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_profit')) + self.realized_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) + self.realized_price_ratio_ext: RatioPattern3 = RatioPattern3(client, _m(acc, 'realized_price_ratio')) + self.realized_profit: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) self.realized_profit_1y: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_1y')) self.realized_profit_24h: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_24h')) self.realized_profit_30d: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_30d')) self.realized_profit_7d: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_7d')) self.realized_profit_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_7d_ema')) - self.realized_profit_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_profit_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')) self.realized_profit_to_loss_ratio_1y: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_1y')) self.realized_profit_to_loss_ratio_24h: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_24h')) self.realized_profit_to_loss_ratio_30d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_30d')) @@ -2225,14 +2192,14 @@ class AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSe self.loss_value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) self.lower_price_band: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'lower_price_band')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) - self.neg_realized_loss: CumulativeSumPattern2[Dollars] = CumulativeSumPattern2(client, _m(acc, 'neg_realized_loss')) - self.net_realized_pnl: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'net_realized_pnl')) + self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_realized_pnl: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) self.net_realized_pnl_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')) self.net_realized_pnl_cumulative_30d_delta: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')) self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')) self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')) - self.net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) - self.peak_regret: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_peak_regret')) + self.net_realized_pnl_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.peak_regret: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) self.peak_regret_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')) self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) self.profit_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_value_created')) @@ -2240,14 +2207,14 @@ class AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSe self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) self.realized_cap_30d_delta: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap_30d_delta')) self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) - self.realized_loss: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_loss')) + self.realized_loss: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) self.realized_loss_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_7d_ema')) - self.realized_loss_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')) self.realized_price: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'realized_price')) self.realized_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) - self.realized_profit: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_profit')) + self.realized_profit: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) self.realized_profit_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_7d_ema')) - self.realized_profit_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_profit_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')) self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) self.realized_value_1y: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value_1y')) self.realized_value_24h: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value_24h')) @@ -2298,19 +2265,20 @@ class CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTo self.investor_cap_raw: MetricPattern20[CentsSquaredSats] = MetricPattern20(client, _m(acc, 'investor_cap_raw')) self.investor_price: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'investor_price')) self.investor_price_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'investor_price_cents')) - self.investor_price_extra: RatioPattern = RatioPattern(client, _m(acc, 'investor_price_ratio')) + self.investor_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'investor_price_ratio')) + self.investor_price_ratio_ext: RatioPattern3 = RatioPattern3(client, _m(acc, 'investor_price_ratio')) self.loss_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'loss_value_created')) self.loss_value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) self.lower_price_band: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'lower_price_band')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) - self.neg_realized_loss: CumulativeSumPattern2[Dollars] = CumulativeSumPattern2(client, _m(acc, 'neg_realized_loss')) - self.net_realized_pnl: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'net_realized_pnl')) + self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_realized_pnl: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) self.net_realized_pnl_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')) self.net_realized_pnl_cumulative_30d_delta: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')) self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')) self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')) - self.net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) - self.peak_regret: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_peak_regret')) + self.net_realized_pnl_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.peak_regret: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) self.peak_regret_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')) self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) self.profit_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_value_created')) @@ -2319,22 +2287,23 @@ class CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTo self.realized_cap_30d_delta: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap_30d_delta')) self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) self.realized_cap_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_cap_rel_to_own_market_cap')) - self.realized_loss: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_loss')) + self.realized_loss: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) self.realized_loss_1y: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_1y')) self.realized_loss_24h: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_24h')) self.realized_loss_30d: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_30d')) self.realized_loss_7d: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_7d')) self.realized_loss_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_7d_ema')) - self.realized_loss_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')) self.realized_price: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'realized_price')) - self.realized_price_extra: RatioPattern = RatioPattern(client, _m(acc, 'realized_price_ratio')) - self.realized_profit: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_profit')) + self.realized_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) + self.realized_price_ratio_ext: RatioPattern3 = RatioPattern3(client, _m(acc, 'realized_price_ratio')) + self.realized_profit: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) self.realized_profit_1y: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_1y')) self.realized_profit_24h: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_24h')) self.realized_profit_30d: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_30d')) self.realized_profit_7d: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_7d')) self.realized_profit_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_7d_ema')) - self.realized_profit_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_profit_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')) self.realized_profit_to_loss_ratio_1y: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_1y')) self.realized_profit_to_loss_ratio_24h: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_24h')) self.realized_profit_to_loss_ratio_30d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_30d')) @@ -2394,14 +2363,14 @@ class CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTo self.loss_value_destroyed: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) self.lower_price_band: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'lower_price_band')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) - self.neg_realized_loss: CumulativeSumPattern2[Dollars] = CumulativeSumPattern2(client, _m(acc, 'neg_realized_loss')) - self.net_realized_pnl: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'net_realized_pnl')) + self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_realized_pnl: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) self.net_realized_pnl_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')) self.net_realized_pnl_cumulative_30d_delta: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta')) self.net_realized_pnl_cumulative_30d_delta_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_market_cap')) self.net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_cumulative_30d_delta_rel_to_realized_cap')) - self.net_realized_pnl_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) - self.peak_regret: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_peak_regret')) + self.net_realized_pnl_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.peak_regret: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) self.peak_regret_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')) self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) self.profit_value_created: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_value_created')) @@ -2409,14 +2378,14 @@ class CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTo self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) self.realized_cap_30d_delta: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap_30d_delta')) self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) - self.realized_loss: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_loss')) + self.realized_loss: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) self.realized_loss_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_loss_7d_ema')) - self.realized_loss_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')) self.realized_price: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'realized_price')) self.realized_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) - self.realized_profit: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'realized_profit')) + self.realized_profit: CumulativeHeightPattern[Dollars] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) self.realized_profit_7d_ema: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_profit_7d_ema')) - self.realized_profit_rel_to_realized_cap: CumulativeSumPattern[StoredF32] = CumulativeSumPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_profit_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')) self.realized_value: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value')) self.realized_value_1y: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value_1y')) self.realized_value_24h: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_value_24h')) @@ -2491,7 +2460,7 @@ class _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern: self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sma')) self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'zscore')) -class InvestedNegNetNuplSupplyUnrealizedPattern4: +class InvestedNegNetNuplSupplyUnrealizedPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2594,6 +2563,30 @@ class RatioPattern: self.ratio_pct99_usd: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'pct99_usd')) self.ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) +class RatioPattern3: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.ratio_1m_sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, '1m_sma')) + self.ratio_1w_sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, '1w_sma')) + self.ratio_1y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, '1y')) + self.ratio_2y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, '2y')) + self.ratio_4y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, '4y')) + self.ratio_pct1: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct1')) + self.ratio_pct1_usd: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'pct1_usd')) + self.ratio_pct2: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct2')) + self.ratio_pct2_usd: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'pct2_usd')) + self.ratio_pct5: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct5')) + self.ratio_pct5_usd: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'pct5_usd')) + self.ratio_pct95: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct95')) + self.ratio_pct95_usd: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'pct95_usd')) + self.ratio_pct98: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct98')) + self.ratio_pct98_usd: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'pct98_usd')) + self.ratio_pct99: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct99')) + self.ratio_pct99_usd: SatsUsdPattern = SatsUsdPattern(client, _m(acc, 'pct99_usd')) + self.ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) + class GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern: """Pattern struct for repeated tree structure.""" @@ -2617,6 +2610,29 @@ class GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern: self.unrealized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_loss')) self.unrealized_profit: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'unrealized_profit')) +class Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.day1: MetricPattern10[T] = MetricPattern10(client, _m(acc, 'day1')) + self.day3: MetricPattern11[T] = MetricPattern11(client, _m(acc, 'day3')) + self.difficultyepoch: MetricPattern19[T] = MetricPattern19(client, _m(acc, 'difficultyepoch')) + self.halvingepoch: MetricPattern18[T] = MetricPattern18(client, _m(acc, 'halvingepoch')) + self.hour1: MetricPattern7[T] = MetricPattern7(client, _m(acc, 'hour1')) + self.hour12: MetricPattern9[T] = MetricPattern9(client, _m(acc, 'hour12')) + self.hour4: MetricPattern8[T] = MetricPattern8(client, _m(acc, 'hour4')) + self.minute1: MetricPattern3[T] = MetricPattern3(client, _m(acc, 'minute1')) + self.minute10: MetricPattern5[T] = MetricPattern5(client, _m(acc, 'minute10')) + self.minute30: MetricPattern6[T] = MetricPattern6(client, _m(acc, 'minute30')) + self.minute5: MetricPattern4[T] = MetricPattern4(client, _m(acc, 'minute5')) + self.month1: MetricPattern13[T] = MetricPattern13(client, _m(acc, 'month1')) + self.month3: MetricPattern14[T] = MetricPattern14(client, _m(acc, 'month3')) + self.month6: MetricPattern15[T] = MetricPattern15(client, _m(acc, 'month6')) + self.week1: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'week1')) + self.year1: MetricPattern16[T] = MetricPattern16(client, _m(acc, 'year1')) + self.year10: MetricPattern17[T] = MetricPattern17(client, _m(acc, 'year10')) + class GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern: """Pattern struct for repeated tree structure.""" @@ -2644,7 +2660,7 @@ class BlocksCoinbaseDaysDominanceFeeSubsidyPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.blocks_mined: CumulativeSumPattern[StoredU32] = CumulativeSumPattern(client, _m(acc, 'blocks_mined')) + self.blocks_mined: CumulativeHeightRollingPattern[StoredU32] = CumulativeHeightRollingPattern(client, _m(acc, 'blocks_mined')) self.blocks_mined_1m_sum: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, 'blocks_mined_1m_sum')) self.blocks_mined_1w_sum: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, 'blocks_mined_1w_sum')) self.blocks_mined_1y_sum: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, 'blocks_mined_1y_sum')) @@ -2657,10 +2673,10 @@ class BlocksCoinbaseDaysDominanceFeeSubsidyPattern: self.dominance_1w: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'dominance_1w')) self.dominance_1y: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'dominance_1y')) self.dominance_24h: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'dominance_24h')) - self.fee: BtcSatsUsdPattern2 = BtcSatsUsdPattern2(client, _m(acc, 'fee')) - self.subsidy: BtcSatsUsdPattern2 = BtcSatsUsdPattern2(client, _m(acc, 'subsidy')) + self.fee: BtcSatsUsdPattern4 = BtcSatsUsdPattern4(client, _m(acc, 'fee')) + self.subsidy: BtcSatsUsdPattern4 = BtcSatsUsdPattern4(client, _m(acc, 'subsidy')) -class InvestedNegNetNuplSupplyUnrealizedPattern3: +class InvestedNegNetNuplSupplyUnrealizedPattern4: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2715,24 +2731,6 @@ class InvestedNegNetNuplSupplyUnrealizedPattern: self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) -class InvestedNegNetSupplyUnrealizedPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.invested_capital_in_loss_pct: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'invested_capital_in_loss_pct')) - self.invested_capital_in_profit_pct: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'invested_capital_in_profit_pct')) - self.neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) - self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl')) - self.net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) - self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl')) - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) - self.unrealized_loss_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) - self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_own_total_unrealized_pnl')) - self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) - self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl')) - class _10y1m1w1y2y3m3y4y5y6m6y8yPattern2(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2769,39 +2767,38 @@ class _201520162017201820192020202120222023202420252026Pattern2(Generic[T]): self._2025: MetricPattern1[T] = MetricPattern1(client, _m(acc, '2025_returns')) self._2026: MetricPattern1[T] = MetricPattern1(client, _m(acc, '2026_returns')) -class AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2: +class AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'average')) - self.base: MetricPattern20[Bitcoin] = MetricPattern20(client, acc) - self.cumulative: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'cumulative')) - self.max: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'max')) - self.median: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'median')) - self.min: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'min')) - self.pct10: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'pct10')) - self.pct25: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'pct25')) - self.pct75: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'pct75')) - self.pct90: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'pct90')) - self.sum: MetricPattern2[Bitcoin] = MetricPattern2(client, _m(acc, 'sum')) + self.average: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'average')) + self.cumulative: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'cumulative')) + self.max: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'max')) + self.median: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'median')) + self.min: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'min')) + self.pct10: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'pct10')) + self.pct25: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'pct25')) + self.pct75: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'pct75')) + self.pct90: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'pct90')) + self.rolling: AverageMaxMedianMinP10P25P75P90SumPattern = AverageMaxMedianMinP10P25P75P90SumPattern(client, acc) + self.sum: MetricPattern20[StoredU64] = MetricPattern20(client, _m(acc, 'sum')) -class AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(Generic[T]): +class AverageCumulativeMaxMedianMinP10P25P75P90SumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average')) - self.base: MetricPattern20[T] = MetricPattern20(client, acc) - self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) - self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max')) - self.median: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'median')) - self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min')) - self.pct10: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'pct10')) - self.pct25: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'pct25')) - self.pct75: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'pct75')) - self.pct90: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'pct90')) - self.sum: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'sum')) + self.average: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'average')) + self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'cumulative')) + self.max: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'max')) + self.median: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'median')) + self.min: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'min')) + self.p10: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p10')) + self.p25: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p25')) + self.p75: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p75')) + self.p90: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p90')) + self.sum: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'sum')) class AverageGainsLossesRsiStochPattern: """Pattern struct for repeated tree structure.""" @@ -2812,29 +2809,13 @@ class AverageGainsLossesRsiStochPattern: self.average_loss: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'avg_loss_1y')) self.gains: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'gains_1y')) self.losses: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'losses_1y')) - self.rsi: MetricPattern20[StoredF32] = MetricPattern20(client, _m(acc, '1y')) + self.rsi: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, '1y')) self.rsi_max: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'rsi_max_1y')) self.rsi_min: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'rsi_min_1y')) self.stoch_rsi: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'stoch_rsi_1y')) self.stoch_rsi_d: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'stoch_rsi_d_1y')) self.stoch_rsi_k: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'stoch_rsi_k_1y')) -class AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(Generic[T]): - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average')) - self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) - self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'max')) - self.median: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'median')) - self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'min')) - self.pct10: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'pct10')) - self.pct25: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'pct25')) - self.pct75: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'pct75')) - self.pct90: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'pct90')) - self.sum: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'sum')) - class ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern: """Pattern struct for repeated tree structure.""" @@ -2865,35 +2846,49 @@ class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern: self.p2wpkh: _30dCountPattern = _30dCountPattern(client, _p('p2wpkh', acc)) self.p2wsh: _30dCountPattern = _30dCountPattern(client, _p('p2wsh', acc)) -class AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(Generic[T]): +class AverageMaxMedianMinP10P25P75P90SumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average')) - self.base: MetricPattern20[T] = MetricPattern20(client, acc) - self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max')) - self.median: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'median')) - self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min')) - self.pct10: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'pct10')) - self.pct25: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'pct25')) - self.pct75: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'pct75')) - self.pct90: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'pct90')) + self.average: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'average')) + self.max: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'max')) + self.median: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'median')) + self.min: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'min')) + self.p10: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p10')) + self.p25: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p25')) + self.p75: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p75')) + self.p90: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p90')) + self.sum: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'sum')) -class AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern(Generic[T]): +class AverageHeightMaxMedianMinP10P25P75P90Pattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average')) - self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'max')) - self.median: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'median')) - self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'min')) - self.pct10: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'pct10')) - self.pct25: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'pct25')) - self.pct75: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'pct75')) - self.pct90: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'pct90')) - self.txindex: MetricPattern21[T] = MetricPattern21(client, acc) + self.average: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'average')) + self.height: MetricPattern20[T] = MetricPattern20(client, acc) + self.max: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'max')) + self.median: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'median')) + self.min: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'min')) + self.p10: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'p10')) + self.p25: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'p25')) + self.p75: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'p75')) + self.p90: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'p90')) + +class AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.average: MetricPattern20[T] = MetricPattern20(client, _m(acc, 'average')) + self.max: MetricPattern20[T] = MetricPattern20(client, _m(acc, 'max')) + self.median: MetricPattern20[T] = MetricPattern20(client, _m(acc, 'median')) + self.min: MetricPattern20[T] = MetricPattern20(client, _m(acc, 'min')) + self.pct10: MetricPattern20[T] = MetricPattern20(client, _m(acc, 'pct10')) + self.pct25: MetricPattern20[T] = MetricPattern20(client, _m(acc, 'pct25')) + self.pct75: MetricPattern20[T] = MetricPattern20(client, _m(acc, 'pct75')) + self.pct90: MetricPattern20[T] = MetricPattern20(client, _m(acc, 'pct90')) class _10y2y3y4y5y6y8yPattern: """Pattern struct for repeated tree structure.""" @@ -2917,20 +2912,7 @@ class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern: self.cost_basis: InvestedMaxMinPercentilesSpotPattern = InvestedMaxMinPercentilesSpotPattern(client, acc) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) self.realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 = CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc) - self.relative: InvestedNegNetSupplyUnrealizedPattern = InvestedNegNetSupplyUnrealizedPattern(client, acc) - self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) - self.unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, acc) - -class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc) - self.cost_basis: MaxMinPattern = MaxMinPattern(client, acc) - self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 = AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc) - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern3 = InvestedNegNetNuplSupplyUnrealizedPattern3(client, acc) + self.relative: InvestedNegNetNuplSupplyUnrealizedPattern2 = InvestedNegNetNuplSupplyUnrealizedPattern2(client, acc) self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) self.unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, acc) @@ -2942,21 +2924,8 @@ class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4: self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc) self.cost_basis: MaxMinPattern = MaxMinPattern(client, acc) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc) - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern = InvestedNegNetNuplSupplyUnrealizedPattern(client, acc) - self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) - self.unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc) - -class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc) - self.cost_basis: MaxMinPattern = MaxMinPattern(client, acc) - self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc) - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern3 = InvestedNegNetNuplSupplyUnrealizedPattern3(client, acc) + self.realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 = AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc) + self.relative: InvestedNegNetNuplSupplyUnrealizedPattern4 = InvestedNegNetNuplSupplyUnrealizedPattern4(client, acc) self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) self.unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, acc) @@ -2969,11 +2938,11 @@ class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3: self.cost_basis: MaxMinPattern = MaxMinPattern(client, acc) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) self.realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc) - self.relative: InvestedSupplyPattern = InvestedSupplyPattern(client, acc) + self.relative: InvestedNegNetNuplSupplyUnrealizedPattern = InvestedNegNetNuplSupplyUnrealizedPattern(client, acc) self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) self.unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc) -class ActivityCostOutputsRealizedSupplyUnrealizedPattern: +class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2982,28 +2951,29 @@ class ActivityCostOutputsRealizedSupplyUnrealizedPattern: self.cost_basis: MaxMinPattern = MaxMinPattern(client, acc) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) self.realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc) + self.relative: InvestedNegNetNuplSupplyUnrealizedPattern4 = InvestedNegNetNuplSupplyUnrealizedPattern4(client, acc) self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) - self.unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc) + self.unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, acc) class BalanceBothReactivatedReceivingSendingPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.balance_decreased: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredU32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'balance_decreased')) - self.balance_increased: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredU32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'balance_increased')) - self.both: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredU32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'both')) - self.reactivated: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredU32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'reactivated')) - self.receiving: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredU32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'receiving')) - self.sending: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredU32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'sending')) + self.balance_decreased: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredU32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'balance_decreased')) + self.balance_increased: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredU32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'balance_increased')) + self.both: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredU32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'both')) + self.reactivated: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredU32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'reactivated')) + self.receiving: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredU32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'receiving')) + self.sending: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredU32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, _m(acc, 'sending')) class CoinblocksCoindaysSatblocksSatdaysSentPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.coinblocks_destroyed: CumulativeSumPattern[StoredF64] = CumulativeSumPattern(client, _m(acc, 'coinblocks_destroyed')) - self.coindays_destroyed: CumulativeSumPattern[StoredF64] = CumulativeSumPattern(client, _m(acc, 'coindays_destroyed')) + self.coinblocks_destroyed: CumulativeHeightRollingPattern[StoredF64] = CumulativeHeightRollingPattern(client, _m(acc, 'coinblocks_destroyed')) + self.coindays_destroyed: CumulativeHeightRollingPattern[StoredF64] = CumulativeHeightRollingPattern(client, _m(acc, 'coindays_destroyed')) self.satblocks_destroyed: MetricPattern20[Sats] = MetricPattern20(client, _m(acc, 'satblocks_destroyed')) self.satdays_destroyed: MetricPattern20[Sats] = MetricPattern20(client, _m(acc, 'satdays_destroyed')) self.sent: BtcSatsUsdPattern2 = BtcSatsUsdPattern2(client, _m(acc, 'sent')) @@ -3021,25 +2991,56 @@ class InvestedMaxMinPercentilesSpotPattern: self.spot_cost_basis_percentile: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'spot_cost_basis_percentile')) self.spot_invested_capital_percentile: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'spot_invested_capital_percentile')) -class InvestedSupplyPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.invested_capital_in_loss_pct: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'invested_capital_in_loss_pct')) - self.invested_capital_in_profit_pct: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'invested_capital_in_profit_pct')) - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) - -class CloseHighLowOpenPattern(Generic[T]): +class CloseHighLowOpenPricePattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.close: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'close')) - self.high: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'high')) - self.low: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'low')) - self.open: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'open')) + self.high: Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern[T] = Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern(client, _m(acc, 'high')) + self.low: Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern[T] = Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern(client, _m(acc, 'low')) + self.open: Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern[T] = Day1Day3DifficultyepochHalvingepochHour1Hour12Hour4Minute1Minute10Minute30Minute5Month1Month3Month6Week1Year1Year10Pattern(client, _m(acc, 'open')) + self.price: MetricPattern20[T] = MetricPattern20(client, acc) + +class _1y24h30d7dPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._1y: BtcSatsUsdPattern = BtcSatsUsdPattern(client, _m(acc, '1y')) + self._24h: BtcSatsUsdPattern = BtcSatsUsdPattern(client, _m(acc, '24h')) + self._30d: BtcSatsUsdPattern = BtcSatsUsdPattern(client, _m(acc, '30d')) + self._7d: BtcSatsUsdPattern = BtcSatsUsdPattern(client, _m(acc, '7d')) + +class BtcRollingSatsUsdPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.btc: MetricPattern20[Bitcoin] = MetricPattern20(client, _m(acc, 'btc')) + self.rolling: _1y24h30d7dPattern2 = _1y24h30d7dPattern2(client, acc) + self.sats: MetricPattern20[Sats] = MetricPattern20(client, acc) + self.usd: MetricPattern20[Dollars] = MetricPattern20(client, _m(acc, 'usd')) + +class _1h24hBlockTxindexPattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._1h: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern[T] = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, '1h')) + self._24h: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern[T] = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, '24h')) + self.block: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern[T] = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) + self.txindex: MetricPattern21[T] = MetricPattern21(client, acc) + +class _1y24h30d7dPattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._1y: MetricPattern1[T] = MetricPattern1(client, _m(acc, '1y')) + self._24h: MetricPattern1[T] = MetricPattern1(client, _m(acc, '24h')) + self._30d: MetricPattern1[T] = MetricPattern1(client, _m(acc, '30d')) + self._7d: MetricPattern1[T] = MetricPattern1(client, _m(acc, '7d')) class _30dHalvedTotalPattern: """Pattern struct for repeated tree structure.""" @@ -3050,23 +3051,32 @@ class _30dHalvedTotalPattern: self.halved: BtcSatsUsdPattern = BtcSatsUsdPattern(client, _m(acc, 'supply_halved')) self.total: BtcSatsUsdPattern = BtcSatsUsdPattern(client, _m(acc, 'supply')) -class BaseCumulativeSumPattern: +class BtcSatsUsdPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.base: MetricPattern20[StoredF32] = MetricPattern20(client, acc) - self.cumulative: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'cumulative')) - self.sum: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'sum')) + self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, _m(acc, 'btc')) + self.sats: CumulativeHeightPattern[Sats] = CumulativeHeightPattern(client, acc) + self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) + +class BtcSatsUsdPattern4: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, _m(acc, 'btc')) + self.sats: CumulativeHeightRollingPattern[Sats] = CumulativeHeightRollingPattern(client, acc) + self.usd: CumulativeHeightRollingPattern[Dollars] = CumulativeHeightRollingPattern(client, _m(acc, 'usd')) class BtcSatsUsdPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.btc: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, 'btc')) - self.sats: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[Sats] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) - self.usd: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[Dollars] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, _m(acc, 'usd')) + self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, _m(acc, 'btc')) + self.sats: CumulativeHeightRollingPattern2[Sats] = CumulativeHeightRollingPattern2(client, acc) + self.usd: CumulativeHeightRollingPattern2[Dollars] = CumulativeHeightRollingPattern2(client, _m(acc, 'usd')) class BtcSatsUsdPattern: """Pattern struct for repeated tree structure.""" @@ -3077,33 +3087,33 @@ class BtcSatsUsdPattern: self.sats: MetricPattern1[Sats] = MetricPattern1(client, acc) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) -class BtcSatsUsdPattern4: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.btc: CumulativeSumPattern[Bitcoin] = CumulativeSumPattern(client, _m(acc, 'btc')) - self.sats: CumulativeSumPattern[Sats] = CumulativeSumPattern(client, acc) - self.usd: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'usd')) - -class BtcSatsUsdPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.btc: CumulativeSumPattern2[Bitcoin] = CumulativeSumPattern2(client, _m(acc, 'btc')) - self.sats: CumulativeSumPattern[Sats] = CumulativeSumPattern(client, acc) - self.usd: CumulativeSumPattern[Dollars] = CumulativeSumPattern(client, _m(acc, 'usd')) - class HistogramLineSignalPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.histogram: MetricPattern20[StoredF32] = MetricPattern20(client, _m(acc, 'histogram_1y')) + self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'histogram_1y')) self.line: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'line_1y')) self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'signal_1y')) +class CumulativeHeightRollingPattern2(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) + self.height: MetricPattern20[T] = MetricPattern20(client, acc) + self.rolling: AverageMaxMedianMinP10P25P75P90SumPattern = AverageMaxMedianMinP10P25P75P90SumPattern(client, acc) + +class CumulativeHeightRollingPattern(Generic[T]): + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) + self.height: MetricPattern20[T] = MetricPattern20(client, acc) + self.rolling: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, acc) + class _30dCountPattern: """Pattern struct for repeated tree structure.""" @@ -3112,6 +3122,14 @@ class _30dCountPattern: self._30d_change: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, '30d_change')) self.count: MetricPattern1[StoredU64] = MetricPattern1(client, acc) +class BaseRestPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.base: MetricPattern20[StoredU64] = MetricPattern20(client, acc) + self.rest: AverageCumulativeMaxMedianMinP10P25P75P90SumPattern = AverageCumulativeMaxMedianMinP10P25P75P90SumPattern(client, acc) + class MaxMinPattern: """Pattern struct for repeated tree structure.""" @@ -3144,21 +3162,13 @@ class UtxoPattern: self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, acc) self.utxo_count_30d_change: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, '30d_change')) -class CumulativeSumPattern2(Generic[T]): - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'cumulative')) - self.sum: MetricPattern1[T] = MetricPattern1(client, acc) - -class CumulativeSumPattern(Generic[T]): +class CumulativeHeightPattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) - self.sum: MetricPattern1[T] = MetricPattern1(client, acc) + self.height: MetricPattern20[T] = MetricPattern20(client, acc) class RatioPattern2: """Pattern struct for repeated tree structure.""" @@ -3180,20 +3190,61 @@ class MetricsTree_Blocks_Difficulty: self.blocks_before_next_adjustment: MetricPattern1[StoredU32] = MetricPattern1(client, 'blocks_before_next_difficulty_adjustment') self.days_before_next_adjustment: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_before_next_difficulty_adjustment') +class MetricsTree_Blocks_Time_Timestamp: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.base: MetricPattern20[Timestamp] = MetricPattern20(client, 'timestamp') + self.minute1: MetricPattern3[Timestamp] = MetricPattern3(client, 'timestamp_minute1') + self.minute5: MetricPattern4[Timestamp] = MetricPattern4(client, 'timestamp_minute5') + self.minute10: MetricPattern5[Timestamp] = MetricPattern5(client, 'timestamp_minute10') + self.minute30: MetricPattern6[Timestamp] = MetricPattern6(client, 'timestamp_minute30') + self.hour1: MetricPattern7[Timestamp] = MetricPattern7(client, 'timestamp_hour1') + self.hour4: MetricPattern8[Timestamp] = MetricPattern8(client, 'timestamp_hour4') + self.hour12: MetricPattern9[Timestamp] = MetricPattern9(client, 'timestamp_hour12') + self.day1: MetricPattern10[Timestamp] = MetricPattern10(client, 'timestamp_day1') + self.day3: MetricPattern11[Timestamp] = MetricPattern11(client, 'timestamp_day3') + self.week1: MetricPattern12[Timestamp] = MetricPattern12(client, 'timestamp_week1') + self.month1: MetricPattern13[Timestamp] = MetricPattern13(client, 'timestamp_month1') + self.month3: MetricPattern14[Timestamp] = MetricPattern14(client, 'timestamp_month3') + self.month6: MetricPattern15[Timestamp] = MetricPattern15(client, 'timestamp_month6') + self.year1: MetricPattern16[Timestamp] = MetricPattern16(client, 'timestamp_year1') + self.year10: MetricPattern17[Timestamp] = MetricPattern17(client, 'timestamp_year10') + self.halvingepoch: MetricPattern18[Timestamp] = MetricPattern18(client, 'timestamp_halvingepoch') + self.difficultyepoch: MetricPattern19[Timestamp] = MetricPattern19(client, 'timestamp_difficultyepoch') + class MetricsTree_Blocks_Time: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.timestamp: MetricPattern1[Timestamp] = MetricPattern1(client, 'timestamp') + self.timestamp: MetricsTree_Blocks_Time_Timestamp = MetricsTree_Blocks_Time_Timestamp(client) self.date: MetricPattern20[Date] = MetricPattern20(client, 'date') self.timestamp_monotonic: MetricPattern20[Timestamp] = MetricPattern20(client, 'timestamp_monotonic') +class MetricsTree_Blocks_Weight: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.base: MetricPattern20[Weight] = MetricPattern20(client, 'block_weight') + self.cumulative: MetricPattern1[Weight] = MetricPattern1(client, 'block_weight_cumulative') + self.sum: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_sum') + self.average: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_average') + self.min: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_min') + self.max: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_max') + self.p10: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_p10') + self.p25: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_p25') + self.median: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_median') + self.p75: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_p75') + self.p90: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_p90') + class MetricsTree_Blocks_Count: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.block_count_target: MetricPattern1[StoredU64] = MetricPattern1(client, 'block_count_target') - self.block_count: CumulativeSumPattern[StoredU32] = CumulativeSumPattern(client, 'block_count') + self.block_count: CumulativeHeightRollingPattern[StoredU32] = CumulativeHeightRollingPattern(client, 'block_count') + self.block_count_sum: _1y24h30d7dPattern[StoredU32] = _1y24h30d7dPattern(client, 'block_count_sum') + self.height_1h_ago: MetricPattern20[Height] = MetricPattern20(client, 'height_1h_ago') self.height_24h_ago: MetricPattern20[Height] = MetricPattern20(client, 'height_24h_ago') self.height_3d_ago: MetricPattern20[Height] = MetricPattern20(client, 'height_3d_ago') self.height_1w_ago: MetricPattern20[Height] = MetricPattern20(client, 'height_1w_ago') @@ -3224,10 +3275,6 @@ class MetricsTree_Blocks_Count: self.height_6y_ago: MetricPattern20[Height] = MetricPattern20(client, 'height_6y_ago') self.height_8y_ago: MetricPattern20[Height] = MetricPattern20(client, 'height_8y_ago') self.height_10y_ago: MetricPattern20[Height] = MetricPattern20(client, 'height_10y_ago') - self.block_count_24h_sum: MetricPattern1[StoredU32] = MetricPattern1(client, 'block_count_24h_sum') - self.block_count_1w_sum: MetricPattern1[StoredU32] = MetricPattern1(client, 'block_count_1w_sum') - self.block_count_1m_sum: MetricPattern1[StoredU32] = MetricPattern1(client, 'block_count_1m_sum') - self.block_count_1y_sum: MetricPattern1[StoredU32] = MetricPattern1(client, 'block_count_1y_sum') class MetricsTree_Blocks_Halving: """Metrics tree node.""" @@ -3237,21 +3284,6 @@ class MetricsTree_Blocks_Halving: self.blocks_before_next_halving: MetricPattern1[StoredU32] = MetricPattern1(client, 'blocks_before_next_halving') self.days_before_next_halving: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_before_next_halving') -class MetricsTree_Blocks_Size: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, 'block_size_cumulative') - self.average: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_average') - self.min: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_min') - self.max: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_max') - self.pct10: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_pct10') - self.pct25: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_pct25') - self.median: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_median') - self.pct75: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_pct75') - self.pct90: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_pct90') - self.sum: MetricPattern2[StoredU64] = MetricPattern2(client, 'block_size_sum') - class MetricsTree_Blocks: """Metrics tree node.""" @@ -3260,36 +3292,27 @@ class MetricsTree_Blocks: self.difficulty: MetricsTree_Blocks_Difficulty = MetricsTree_Blocks_Difficulty(client) self.time: MetricsTree_Blocks_Time = MetricsTree_Blocks_Time(client) self.total_size: MetricPattern20[StoredU64] = MetricPattern20(client, 'total_size') - self.weight: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[Weight] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'block_weight') + self.weight: MetricsTree_Blocks_Weight = MetricsTree_Blocks_Weight(client) self.count: MetricsTree_Blocks_Count = MetricsTree_Blocks_Count(client) - self.interval: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[Timestamp] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'block_interval') + self.interval: AverageHeightMaxMedianMinP10P25P75P90Pattern[Timestamp] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'block_interval') self.halving: MetricsTree_Blocks_Halving = MetricsTree_Blocks_Halving(client) - self.vbytes: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'block_vbytes') - self.size: MetricsTree_Blocks_Size = MetricsTree_Blocks_Size(client) - self.fullness: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'block_fullness') + self.vbytes: CumulativeHeightRollingPattern2[StoredU64] = CumulativeHeightRollingPattern2(client, 'block_vbytes') + self.size: AverageCumulativeMaxMedianMinP10P25P75P90SumPattern = AverageCumulativeMaxMedianMinP10P25P75P90SumPattern(client, 'block_size') + self.fullness: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'block_fullness') class MetricsTree_Transactions_Count: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.tx_count: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'tx_count') + self.tx_count: CumulativeHeightRollingPattern2[StoredU64] = CumulativeHeightRollingPattern2(client, 'tx_count') self.is_coinbase: MetricPattern21[StoredBool] = MetricPattern21(client, 'is_coinbase') class MetricsTree_Transactions_Size: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.vsize: AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern[VSize] = AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern(client, 'tx_vsize') - self.weight: AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern[Weight] = AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern(client, 'tx_weight') - -class MetricsTree_Transactions_Fees_Fee: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.txindex: MetricPattern21[Sats] = MetricPattern21(client, 'fee') - self.sats: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2[Sats] = AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, 'fee') - self.btc: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2[Bitcoin] = AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, 'fee_btc') - self.usd: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2[Dollars] = AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, 'fee_usd') + self.vsize: _1h24hBlockTxindexPattern[VSize] = _1h24hBlockTxindexPattern(client, 'tx_vsize') + self.weight: _1h24hBlockTxindexPattern[Weight] = _1h24hBlockTxindexPattern(client, 'tx_weight') class MetricsTree_Transactions_Fees: """Metrics tree node.""" @@ -3297,23 +3320,23 @@ class MetricsTree_Transactions_Fees: def __init__(self, client: BrkClientBase, base_path: str = ''): self.input_value: MetricPattern21[Sats] = MetricPattern21(client, 'input_value') self.output_value: MetricPattern21[Sats] = MetricPattern21(client, 'output_value') - self.fee: MetricsTree_Transactions_Fees_Fee = MetricsTree_Transactions_Fees_Fee(client) - self.fee_rate: AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern[FeeRate] = AverageMaxMedianMinPct10Pct25Pct75Pct90TxindexPattern(client, 'fee_rate') + self.fee: _1h24hBlockTxindexPattern[Sats] = _1h24hBlockTxindexPattern(client, 'fee') + self.fee_rate: _1h24hBlockTxindexPattern[FeeRate] = _1h24hBlockTxindexPattern(client, 'fee_rate') class MetricsTree_Transactions_Versions: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.v1: CumulativeSumPattern[StoredU64] = CumulativeSumPattern(client, 'tx_v1') - self.v2: CumulativeSumPattern[StoredU64] = CumulativeSumPattern(client, 'tx_v2') - self.v3: CumulativeSumPattern[StoredU64] = CumulativeSumPattern(client, 'tx_v3') + self.v1: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'tx_v1') + self.v2: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'tx_v2') + self.v3: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'tx_v3') class MetricsTree_Transactions_Volume: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sent_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'sent_sum') - self.received_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'received_sum') + self.sent_sum: BtcRollingSatsUsdPattern = BtcRollingSatsUsdPattern(client, 'sent_sum') + self.received_sum: BtcRollingSatsUsdPattern = BtcRollingSatsUsdPattern(client, 'received_sum') self.annualized_volume: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'annualized_volume') self.tx_per_sec: MetricPattern1[StoredF32] = MetricPattern1(client, 'tx_per_sec') self.outputs_per_sec: MetricPattern1[StoredF32] = MetricPattern1(client, 'outputs_per_sec') @@ -3356,7 +3379,7 @@ class MetricsTree_Inputs: self.outputtype: MetricPattern22[OutputType] = MetricPattern22(client, 'outputtype') self.typeindex: MetricPattern22[TypeIndex] = MetricPattern22(client, 'typeindex') self.spent: MetricsTree_Inputs_Spent = MetricsTree_Inputs_Spent(client) - self.count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2[StoredU64] = AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, 'input_count') + self.count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern = AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(client, 'input_count') class MetricsTree_Outputs_Spent: """Metrics tree node.""" @@ -3368,7 +3391,7 @@ class MetricsTree_Outputs_Count: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.total_count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2[StoredU64] = AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, 'output_count') + self.total_count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern = AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(client, 'output_count') self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, 'exact_utxo_count') class MetricsTree_Outputs: @@ -3408,21 +3431,21 @@ class MetricsTree_Scripts_Count: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.p2a: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2a_count') - self.p2ms: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2ms_count') - self.p2pk33: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2pk33_count') - self.p2pk65: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2pk65_count') - self.p2pkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2pkh_count') - self.p2sh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2sh_count') - self.p2tr: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2tr_count') - self.p2wpkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2wpkh_count') - self.p2wsh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2wsh_count') - self.opreturn: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'opreturn_count') - self.emptyoutput: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'emptyoutput_count') - self.unknownoutput: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'unknownoutput_count') - self.segwit: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'segwit_count') - self.taproot_adoption: BaseCumulativeSumPattern = BaseCumulativeSumPattern(client, 'taproot_adoption') - self.segwit_adoption: BaseCumulativeSumPattern = BaseCumulativeSumPattern(client, 'segwit_adoption') + self.p2a: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'p2a_count') + self.p2ms: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'p2ms_count') + self.p2pk33: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'p2pk33_count') + self.p2pk65: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'p2pk65_count') + self.p2pkh: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'p2pkh_count') + self.p2sh: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'p2sh_count') + self.p2tr: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'p2tr_count') + self.p2wpkh: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'p2wpkh_count') + self.p2wsh: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'p2wsh_count') + self.opreturn: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'opreturn_count') + self.emptyoutput: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'emptyoutput_count') + self.unknownoutput: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'unknownoutput_count') + self.segwit: CumulativeHeightRollingPattern[StoredU64] = CumulativeHeightRollingPattern(client, 'segwit_count') + self.taproot_adoption: MetricPattern1[StoredF32] = MetricPattern1(client, 'taproot_adoption') + self.segwit_adoption: MetricPattern1[StoredF32] = MetricPattern1(client, 'segwit_adoption') class MetricsTree_Scripts_Value: """Metrics tree node.""" @@ -3449,17 +3472,10 @@ class MetricsTree_Mining_Rewards: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.coinbase_24h_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'coinbase_24h_sum') - self.coinbase_7d_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'coinbase_7d_sum') - self.coinbase_30d_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'coinbase_30d_sum') - self.coinbase_1y_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'coinbase_1y_sum') - self.fee_24h_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'fee_24h_sum') - self.fee_7d_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'fee_7d_sum') - self.fee_30d_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'fee_30d_sum') - self.fee_1y_sum: BtcSatsUsdPattern = BtcSatsUsdPattern(client, 'fee_1y_sum') self.coinbase: BtcSatsUsdPattern3 = BtcSatsUsdPattern3(client, 'coinbase') self.subsidy: BtcSatsUsdPattern3 = BtcSatsUsdPattern3(client, 'subsidy') - self.unclaimed_rewards: BtcSatsUsdPattern2 = BtcSatsUsdPattern2(client, 'unclaimed_rewards') + self.fees: BtcSatsUsdPattern3 = BtcSatsUsdPattern3(client, 'fees') + self.unclaimed_rewards: BtcSatsUsdPattern4 = BtcSatsUsdPattern4(client, 'unclaimed_rewards') self.fee_dominance: MetricPattern1[StoredF32] = MetricPattern1(client, 'fee_dominance') self.fee_dominance_24h: MetricPattern1[StoredF32] = MetricPattern1(client, 'fee_dominance_24h') self.fee_dominance_7d: MetricPattern1[StoredF32] = MetricPattern1(client, 'fee_dominance_7d') @@ -3512,8 +3528,8 @@ class MetricsTree_Cointime_Activity: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.coinblocks_created: CumulativeSumPattern[StoredF64] = CumulativeSumPattern(client, 'coinblocks_created') - self.coinblocks_stored: CumulativeSumPattern[StoredF64] = CumulativeSumPattern(client, 'coinblocks_stored') + self.coinblocks_created: CumulativeHeightRollingPattern[StoredF64] = CumulativeHeightRollingPattern(client, 'coinblocks_created') + self.coinblocks_stored: CumulativeHeightRollingPattern[StoredF64] = CumulativeHeightRollingPattern(client, 'coinblocks_stored') self.liveliness: MetricPattern1[StoredF64] = MetricPattern1(client, 'liveliness') self.vaultedness: MetricPattern1[StoredF64] = MetricPattern1(client, 'vaultedness') self.activity_to_vaultedness_ratio: MetricPattern1[StoredF64] = MetricPattern1(client, 'activity_to_vaultedness_ratio') @@ -3529,10 +3545,10 @@ class MetricsTree_Cointime_Value: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.cointime_value_destroyed: CumulativeSumPattern[StoredF64] = CumulativeSumPattern(client, 'cointime_value_destroyed') - self.cointime_value_created: CumulativeSumPattern[StoredF64] = CumulativeSumPattern(client, 'cointime_value_created') - self.cointime_value_stored: CumulativeSumPattern[StoredF64] = CumulativeSumPattern(client, 'cointime_value_stored') - self.vocdd: CumulativeSumPattern[StoredF64] = CumulativeSumPattern(client, 'vocdd') + self.cointime_value_destroyed: CumulativeHeightRollingPattern[StoredF64] = CumulativeHeightRollingPattern(client, 'cointime_value_destroyed') + self.cointime_value_created: CumulativeHeightRollingPattern[StoredF64] = CumulativeHeightRollingPattern(client, 'cointime_value_created') + self.cointime_value_stored: CumulativeHeightRollingPattern[StoredF64] = CumulativeHeightRollingPattern(client, 'cointime_value_stored') + self.vocdd: CumulativeHeightRollingPattern[StoredF64] = CumulativeHeightRollingPattern(client, 'vocdd') class MetricsTree_Cointime_Cap: """Metrics tree node.""" @@ -3964,12 +3980,12 @@ class MetricsTree_Market_Volatility: self.price_1w_volatility: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_1w_volatility') self.price_1m_volatility: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_1m_volatility') self.price_1y_volatility: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_1y_volatility') - self.sharpe_1w: MetricPattern20[StoredF32] = MetricPattern20(client, 'sharpe_1w') - self.sharpe_1m: MetricPattern20[StoredF32] = MetricPattern20(client, 'sharpe_1m') - self.sharpe_1y: MetricPattern20[StoredF32] = MetricPattern20(client, 'sharpe_1y') - self.sortino_1w: MetricPattern20[StoredF32] = MetricPattern20(client, 'sortino_1w') - self.sortino_1m: MetricPattern20[StoredF32] = MetricPattern20(client, 'sortino_1m') - self.sortino_1y: MetricPattern20[StoredF32] = MetricPattern20(client, 'sortino_1y') + self.sharpe_1w: MetricPattern1[StoredF32] = MetricPattern1(client, 'sharpe_1w') + self.sharpe_1m: MetricPattern1[StoredF32] = MetricPattern1(client, 'sharpe_1m') + self.sharpe_1y: MetricPattern1[StoredF32] = MetricPattern1(client, 'sharpe_1y') + self.sortino_1w: MetricPattern1[StoredF32] = MetricPattern1(client, 'sortino_1w') + self.sortino_1m: MetricPattern1[StoredF32] = MetricPattern1(client, 'sortino_1m') + self.sortino_1y: MetricPattern1[StoredF32] = MetricPattern1(client, 'sortino_1y') class MetricsTree_Market_Range: """Metrics tree node.""" @@ -4181,7 +4197,7 @@ class MetricsTree_Market_Indicators_Rsi_1d: self.losses: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_losses_1d') self.average_gain: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_avg_gain_1d') self.average_loss: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_avg_loss_1d') - self.rsi: MetricPattern20[StoredF32] = MetricPattern20(client, 'rsi_1d') + self.rsi: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_1d') self.rsi_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_rsi_min_1d') self.rsi_max: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_rsi_max_1d') self.stoch_rsi: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_stoch_rsi_1d') @@ -4196,7 +4212,7 @@ class MetricsTree_Market_Indicators_Rsi_1w: self.losses: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_losses_1w') self.average_gain: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_avg_gain_1w') self.average_loss: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_avg_loss_1w') - self.rsi: MetricPattern20[StoredF32] = MetricPattern20(client, 'rsi_1w') + self.rsi: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_1w') self.rsi_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_rsi_min_1w') self.rsi_max: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_rsi_max_1w') self.stoch_rsi: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_stoch_rsi_1w') @@ -4211,7 +4227,7 @@ class MetricsTree_Market_Indicators_Rsi_1m: self.losses: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_losses_1m') self.average_gain: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_avg_gain_1m') self.average_loss: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_avg_loss_1m') - self.rsi: MetricPattern20[StoredF32] = MetricPattern20(client, 'rsi_1m') + self.rsi: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_1m') self.rsi_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_rsi_min_1m') self.rsi_max: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_rsi_max_1m') self.stoch_rsi: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_stoch_rsi_1m') @@ -4233,7 +4249,7 @@ class MetricsTree_Market_Indicators_Macd_1d: def __init__(self, client: BrkClientBase, base_path: str = ''): self.line: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_line_1d') self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_1d') - self.histogram: MetricPattern20[StoredF32] = MetricPattern20(client, 'macd_histogram_1d') + self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_1d') class MetricsTree_Market_Indicators_Macd_1w: """Metrics tree node.""" @@ -4241,7 +4257,7 @@ class MetricsTree_Market_Indicators_Macd_1w: def __init__(self, client: BrkClientBase, base_path: str = ''): self.line: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_line_1w') self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_1w') - self.histogram: MetricPattern20[StoredF32] = MetricPattern20(client, 'macd_histogram_1w') + self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_1w') class MetricsTree_Market_Indicators_Macd_1m: """Metrics tree node.""" @@ -4249,7 +4265,7 @@ class MetricsTree_Market_Indicators_Macd_1m: def __init__(self, client: BrkClientBase, base_path: str = ''): self.line: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_line_1m') self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_1m') - self.histogram: MetricPattern20[StoredF32] = MetricPattern20(client, 'macd_histogram_1m') + self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_1m') class MetricsTree_Market_Indicators_Macd: """Metrics tree node.""" @@ -4460,37 +4476,13 @@ class MetricsTree_Pools: self.height_to_pool: MetricPattern20[PoolSlug] = MetricPattern20(client, 'pool') self.vecs: MetricsTree_Pools_Vecs = MetricsTree_Pools_Vecs(client) -class MetricsTree_Prices_Cents: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.price: MetricPattern20[Cents] = MetricPattern20(client, 'price_cents') - self.split: CloseHighLowOpenPattern[Cents] = CloseHighLowOpenPattern(client, 'price_cents') - self.ohlc: MetricPattern2[OHLCCents] = MetricPattern2(client, 'price_cents_ohlc') - -class MetricsTree_Prices_Usd: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.price: MetricPattern20[Dollars] = MetricPattern20(client, 'price_usd') - self.split: CloseHighLowOpenPattern[Dollars] = CloseHighLowOpenPattern(client, 'price') - self.ohlc: MetricPattern2[OHLCDollars] = MetricPattern2(client, 'price_usd_ohlc') - -class MetricsTree_Prices_Sats: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.price: MetricPattern20[Sats] = MetricPattern20(client, 'price_sats') - self.split: CloseHighLowOpenPattern[Sats] = CloseHighLowOpenPattern(client, 'price_sats') - self.ohlc: MetricPattern2[OHLCSats] = MetricPattern2(client, 'price_sats_ohlc') - class MetricsTree_Prices: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.cents: MetricsTree_Prices_Cents = MetricsTree_Prices_Cents(client) - self.usd: MetricsTree_Prices_Usd = MetricsTree_Prices_Usd(client) - self.sats: MetricsTree_Prices_Sats = MetricsTree_Prices_Sats(client) + self.cents: CloseHighLowOpenPricePattern[Cents] = CloseHighLowOpenPricePattern(client, 'price_cents') + self.usd: CloseHighLowOpenPricePattern[Dollars] = CloseHighLowOpenPricePattern(client, 'price_usd') + self.sats: CloseHighLowOpenPricePattern[Sats] = CloseHighLowOpenPricePattern(client, 'price_sats') class MetricsTree_Distribution_AnyAddressIndexes: """Metrics tree node.""" @@ -4523,12 +4515,12 @@ class MetricsTree_Distribution_UtxoCohorts_All_Relative: self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, 'neg_unrealized_loss_rel_to_market_cap') self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, 'net_unrealized_pnl_rel_to_market_cap') self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, 'nupl') + self.invested_capital_in_profit_pct: MetricPattern1[StoredF32] = MetricPattern1(client, 'invested_capital_in_profit_pct') + self.invested_capital_in_loss_pct: MetricPattern1[StoredF32] = MetricPattern1(client, 'invested_capital_in_loss_pct') self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'unrealized_profit_rel_to_own_total_unrealized_pnl') self.unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'unrealized_loss_rel_to_own_total_unrealized_pnl') self.neg_unrealized_loss_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'neg_unrealized_loss_rel_to_own_total_unrealized_pnl') self.net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, 'net_unrealized_pnl_rel_to_own_total_unrealized_pnl') - self.invested_capital_in_profit_pct: MetricPattern1[StoredF32] = MetricPattern1(client, 'invested_capital_in_profit_pct') - self.invested_capital_in_loss_pct: MetricPattern1[StoredF32] = MetricPattern1(client, 'invested_capital_in_loss_pct') self.unrealized_peak_regret_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, 'unrealized_peak_regret_rel_to_market_cap') class MetricsTree_Distribution_UtxoCohorts_All: @@ -4539,10 +4531,22 @@ class MetricsTree_Distribution_UtxoCohorts_All: self.outputs: UtxoPattern = UtxoPattern(client, 'utxo_count') self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, '') self.realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, '') - self.unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, '') self.cost_basis: InvestedMaxMinPercentilesSpotPattern = InvestedMaxMinPercentilesSpotPattern(client, '') + self.unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, '') self.relative: MetricsTree_Distribution_UtxoCohorts_All_Relative = MetricsTree_Distribution_UtxoCohorts_All_Relative(client) +class MetricsTree_Distribution_UtxoCohorts_Sth: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, 'sth') + self.outputs: UtxoPattern = UtxoPattern(client, 'sth_utxo_count') + self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, 'sth') + self.realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, 'sth') + self.cost_basis: InvestedMaxMinPercentilesSpotPattern = InvestedMaxMinPercentilesSpotPattern(client, 'sth') + self.unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, 'sth') + self.relative: InvestedNegNetNuplSupplyUnrealizedPattern2 = InvestedNegNetNuplSupplyUnrealizedPattern2(client, 'sth') + class MetricsTree_Distribution_UtxoCohorts_AgeRange: """Metrics tree node.""" @@ -4569,6 +4573,108 @@ class MetricsTree_Distribution_UtxoCohorts_AgeRange: self._12y_to_15y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_12y_to_15y_old') self.from_15y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(client, 'utxos_over_15y_old') +class MetricsTree_Distribution_UtxoCohorts_MaxAge: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_1w_old') + self._1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_1m_old') + self._2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_2m_old') + self._3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_3m_old') + self._4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_4m_old') + self._5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_5m_old') + self._6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_6m_old') + self._1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_1y_old') + self._2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_2y_old') + self._3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_3y_old') + self._4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_4y_old') + self._5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_5y_old') + self._6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_6y_old') + self._7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_7y_old') + self._8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_8y_old') + self._10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_10y_old') + self._12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_12y_old') + self._15y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_15y_old') + +class MetricsTree_Distribution_UtxoCohorts_MinAge: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self._1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_1d_old') + self._1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_1w_old') + self._1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_1m_old') + self._2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_2m_old') + self._3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_3m_old') + self._4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_4m_old') + self._5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_5m_old') + self._6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_6m_old') + self._1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_1y_old') + self._2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_2y_old') + self._3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_3y_old') + self._4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_4y_old') + self._5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_5y_old') + self._6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_6y_old') + self._7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_7y_old') + self._8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_8y_old') + self._10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_over_10y_old') + self._12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(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') + +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') + +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') + class MetricsTree_Distribution_UtxoCohorts_Epoch: """Metrics tree node.""" @@ -4602,98 +4708,6 @@ class MetricsTree_Distribution_UtxoCohorts_Year: self._2025: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'year_2025') self._2026: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'year_2026') -class MetricsTree_Distribution_UtxoCohorts_MinAge: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1d: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_1d_old') - self._1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_1w_old') - self._1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_1m_old') - self._2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_2m_old') - self._3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_3m_old') - self._4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_4m_old') - self._5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_5m_old') - self._6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_6m_old') - self._1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_1y_old') - self._2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_2y_old') - self._3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_3y_old') - self._4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_4y_old') - self._5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_5y_old') - self._6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_6y_old') - self._7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_7y_old') - self._8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_8y_old') - self._10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_10y_old') - self._12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern6(client, 'utxos_over_12y_old') - -class MetricsTree_Distribution_UtxoCohorts_GeAmount: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1sat: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_1sat') - self._10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_10sats') - self._100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_100sats') - self._1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_1k_sats') - self._10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_10k_sats') - self._100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_100k_sats') - self._1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_1m_sats') - self._10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_10m_sats') - self._1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_1btc') - self._10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_10btc') - self._100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_100btc') - self._1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_over_1k_btc') - self._10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(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') - -class MetricsTree_Distribution_UtxoCohorts_Term_Short: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, 'sth') - self.outputs: UtxoPattern = UtxoPattern(client, 'sth_utxo_count') - self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, 'sth') - self.realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, 'sth') - self.unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, 'sth') - self.cost_basis: InvestedMaxMinPercentilesSpotPattern = InvestedMaxMinPercentilesSpotPattern(client, 'sth') - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern4 = InvestedNegNetNuplSupplyUnrealizedPattern4(client, 'sth') - -class MetricsTree_Distribution_UtxoCohorts_Term_Long: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, 'lth') - self.outputs: UtxoPattern = UtxoPattern(client, 'lth_utxo_count') - self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, 'lth') - self.realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 = CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, 'lth') - self.unrealized: GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainPeakSupplyTotalUnrealizedPattern(client, 'lth') - self.cost_basis: InvestedMaxMinPercentilesSpotPattern = InvestedMaxMinPercentilesSpotPattern(client, 'lth') - self.relative: InvestedNegNetNuplSupplyUnrealizedPattern4 = InvestedNegNetNuplSupplyUnrealizedPattern4(client, 'lth') - -class MetricsTree_Distribution_UtxoCohorts_Term: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.short: MetricsTree_Distribution_UtxoCohorts_Term_Short = MetricsTree_Distribution_UtxoCohorts_Term_Short(client) - self.long: MetricsTree_Distribution_UtxoCohorts_Term_Long = MetricsTree_Distribution_UtxoCohorts_Term_Long(client) - class MetricsTree_Distribution_UtxoCohorts_Type: """Metrics tree node.""" @@ -4701,71 +4715,31 @@ class MetricsTree_Distribution_UtxoCohorts_Type: self.p2pk65: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2pk65') self.p2pk33: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2pk33') self.p2pkh: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'p2pkh') - self.p2ms: ActivityCostOutputsRealizedSupplyUnrealizedPattern = ActivityCostOutputsRealizedSupplyUnrealizedPattern(client, 'p2ms') + 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: ActivityCostOutputsRealizedSupplyUnrealizedPattern = ActivityCostOutputsRealizedSupplyUnrealizedPattern(client, 'unknown_outputs') - self.empty: ActivityCostOutputsRealizedSupplyUnrealizedPattern = ActivityCostOutputsRealizedSupplyUnrealizedPattern(client, 'empty_outputs') - -class MetricsTree_Distribution_UtxoCohorts_MaxAge: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1w: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_1w_old') - self._1m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_1m_old') - self._2m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_2m_old') - self._3m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_3m_old') - self._4m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_4m_old') - self._5m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_5m_old') - self._6m: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_6m_old') - self._1y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_1y_old') - self._2y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_2y_old') - self._3y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_3y_old') - self._4y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_4y_old') - self._5y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_5y_old') - self._6y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_6y_old') - self._7y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_7y_old') - self._8y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_8y_old') - self._10y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_10y_old') - self._12y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_12y_old') - self._15y: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern5(client, 'utxos_under_15y_old') - -class MetricsTree_Distribution_UtxoCohorts_LtAmount: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self._10sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_10sats') - self._100sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_100sats') - self._1k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_1k_sats') - self._10k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_10k_sats') - self._100k_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_100k_sats') - self._1m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_1m_sats') - self._10m_sats: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_10m_sats') - self._1btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_1btc') - self._10btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_10btc') - self._100btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_100btc') - self._1k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_1k_btc') - self._10k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_10k_btc') - self._100k_btc: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, 'utxos_under_100k_btc') + self.unknown: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'unknown_outputs') + self.empty: ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 = ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, 'empty_outputs') class MetricsTree_Distribution_UtxoCohorts: """Metrics tree node.""" 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.age_range: MetricsTree_Distribution_UtxoCohorts_AgeRange = MetricsTree_Distribution_UtxoCohorts_AgeRange(client) - self.epoch: MetricsTree_Distribution_UtxoCohorts_Epoch = MetricsTree_Distribution_UtxoCohorts_Epoch(client) - self.year: MetricsTree_Distribution_UtxoCohorts_Year = MetricsTree_Distribution_UtxoCohorts_Year(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) self.ge_amount: MetricsTree_Distribution_UtxoCohorts_GeAmount = MetricsTree_Distribution_UtxoCohorts_GeAmount(client) self.amount_range: MetricsTree_Distribution_UtxoCohorts_AmountRange = MetricsTree_Distribution_UtxoCohorts_AmountRange(client) - self.term: MetricsTree_Distribution_UtxoCohorts_Term = MetricsTree_Distribution_UtxoCohorts_Term(client) - self.type_: MetricsTree_Distribution_UtxoCohorts_Type = MetricsTree_Distribution_UtxoCohorts_Type(client) - self.max_age: MetricsTree_Distribution_UtxoCohorts_MaxAge = MetricsTree_Distribution_UtxoCohorts_MaxAge(client) self.lt_amount: MetricsTree_Distribution_UtxoCohorts_LtAmount = MetricsTree_Distribution_UtxoCohorts_LtAmount(client) + self.epoch: MetricsTree_Distribution_UtxoCohorts_Epoch = MetricsTree_Distribution_UtxoCohorts_Epoch(client) + self.year: MetricsTree_Distribution_UtxoCohorts_Year = MetricsTree_Distribution_UtxoCohorts_Year(client) + self.type_: MetricsTree_Distribution_UtxoCohorts_Type = MetricsTree_Distribution_UtxoCohorts_Type(client) class MetricsTree_Distribution_AddressCohorts_GeAmount: """Metrics tree node.""" @@ -4863,29 +4837,29 @@ class MetricsTree_Distribution_NewAddrCount: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.all: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'new_addr_count') - self.p2pk65: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2pk65_new_addr_count') - self.p2pk33: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2pk33_new_addr_count') - self.p2pkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2pkh_new_addr_count') - self.p2sh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2sh_new_addr_count') - self.p2wpkh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2wpkh_new_addr_count') - self.p2wsh: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2wsh_new_addr_count') - self.p2tr: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2tr_new_addr_count') - self.p2a: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern[StoredU64] = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'p2a_new_addr_count') + self.all: BaseRestPattern = BaseRestPattern(client, 'new_addr_count') + self.p2pk65: BaseRestPattern = BaseRestPattern(client, 'p2pk65_new_addr_count') + self.p2pk33: BaseRestPattern = BaseRestPattern(client, 'p2pk33_new_addr_count') + self.p2pkh: BaseRestPattern = BaseRestPattern(client, 'p2pkh_new_addr_count') + self.p2sh: BaseRestPattern = BaseRestPattern(client, 'p2sh_new_addr_count') + self.p2wpkh: BaseRestPattern = BaseRestPattern(client, 'p2wpkh_new_addr_count') + self.p2wsh: BaseRestPattern = BaseRestPattern(client, 'p2wsh_new_addr_count') + self.p2tr: BaseRestPattern = BaseRestPattern(client, 'p2tr_new_addr_count') + self.p2a: BaseRestPattern = BaseRestPattern(client, 'p2a_new_addr_count') class MetricsTree_Distribution_GrowthRate: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.all: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'growth_rate') - self.p2pk65: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2pk65_growth_rate') - self.p2pk33: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2pk33_growth_rate') - self.p2pkh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2pkh_growth_rate') - self.p2sh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2sh_growth_rate') - self.p2wpkh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2wpkh_growth_rate') - self.p2wsh: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2wsh_growth_rate') - self.p2tr: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2tr_growth_rate') - self.p2a: AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageBaseMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2a_growth_rate') + self.all: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'growth_rate') + self.p2pk65: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'p2pk65_growth_rate') + self.p2pk33: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'p2pk33_growth_rate') + self.p2pkh: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'p2pkh_growth_rate') + self.p2sh: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'p2sh_growth_rate') + self.p2wpkh: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'p2wpkh_growth_rate') + self.p2wsh: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'p2wsh_growth_rate') + self.p2tr: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'p2tr_growth_rate') + self.p2a: AverageHeightMaxMedianMinP10P25P75P90Pattern[StoredF32] = AverageHeightMaxMedianMinP10P25P75P90Pattern(client, 'p2a_growth_rate') class MetricsTree_Distribution: """Metrics tree node.""" @@ -4909,8 +4883,8 @@ class MetricsTree_Supply_Burned: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.opreturn: BtcSatsUsdPattern2 = BtcSatsUsdPattern2(client, 'opreturn_supply') - self.unspendable: BtcSatsUsdPattern2 = BtcSatsUsdPattern2(client, 'unspendable_supply') + self.opreturn: BtcSatsUsdPattern4 = BtcSatsUsdPattern4(client, 'opreturn_supply') + self.unspendable: BtcSatsUsdPattern4 = BtcSatsUsdPattern4(client, 'unspendable_supply') class MetricsTree_Supply_Velocity: """Metrics tree node."""