diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 4952a568c..b8d1911cc 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -940,753 +940,473 @@ impl MetricPattern for MetricPattern35 { fn get(&self // Reusable pattern structs /// Pattern struct for repeated tree structure. -pub struct AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern { - pub adjusted_sopr: MetricPattern1, - pub adjusted_sopr_1y: MetricPattern1, - pub adjusted_sopr_24h: MetricPattern1, - pub adjusted_sopr_24h_30d_ema: MetricPattern1, - pub adjusted_sopr_24h_7d_ema: MetricPattern1, - pub adjusted_sopr_30d: MetricPattern1, - pub adjusted_sopr_30d_ema: MetricPattern1, - pub adjusted_sopr_7d: MetricPattern1, - pub adjusted_sopr_7d_ema: MetricPattern1, +pub struct AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern { + pub adjusted_sopr: _1m1w1y24hPattern, + pub adjusted_sopr_ema: _1m1wPattern2, pub adjusted_value_created: MetricPattern1, - pub adjusted_value_created_1y: MetricPattern1, - pub adjusted_value_created_24h: MetricPattern1, - pub adjusted_value_created_30d: MetricPattern1, - pub adjusted_value_created_7d: MetricPattern1, + pub adjusted_value_created_sum: _1m1w1y24hPattern, pub adjusted_value_destroyed: MetricPattern1, - pub adjusted_value_destroyed_1y: MetricPattern1, - pub adjusted_value_destroyed_24h: MetricPattern1, - pub adjusted_value_destroyed_30d: MetricPattern1, - pub adjusted_value_destroyed_7d: MetricPattern1, + pub adjusted_value_destroyed_sum: _1m1w1y24hPattern, pub cap_raw: MetricPattern18, pub capitulation_flow: MetricPattern1, + pub gross_pnl: CentsUsdPattern, + pub gross_pnl_sum: _1m1w1y24hPattern, pub investor_cap_raw: MetricPattern18, pub investor_price: CentsSatsUsdPattern, - pub investor_price_extra: RatioPattern2, - pub investor_price_ratio_ext: RatioPattern3, + pub investor_price_ratio: BpsRatioPattern, + pub investor_price_ratio_ext: RatioPattern, pub loss_value_created: MetricPattern1, pub loss_value_destroyed: MetricPattern1, pub lower_price_band: CentsSatsUsdPattern, pub mvrv: MetricPattern1, pub neg_realized_loss: MetricPattern1, + pub net_pnl_change_1m: MetricPattern1, + pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern, + pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern, pub net_realized_pnl: CumulativeHeightPattern, - pub net_realized_pnl_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: MetricPattern1, + pub net_realized_pnl_ema_1w: MetricPattern1, + pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, pub peak_regret: CumulativeHeightPattern, - pub peak_regret_rel_to_realized_cap: MetricPattern1, + pub peak_regret_rel_to_realized_cap: BpsPercentRatioPattern, pub profit_flow: MetricPattern1, pub profit_value_created: MetricPattern1, pub profit_value_destroyed: MetricPattern1, pub realized_cap: MetricPattern1, - pub realized_cap_30d_delta: MetricPattern1, pub realized_cap_cents: MetricPattern1, - pub realized_cap_rel_to_own_market_cap: MetricPattern1, + pub realized_cap_change_1m: MetricPattern1, + pub realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern, 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: MetricPattern1, + pub realized_loss_ema_1w: MetricPattern1, + pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, + pub realized_loss_sum: _1m1w1y24hPattern, pub realized_price: CentsSatsUsdPattern, - pub realized_price_extra: RatioPattern2, - pub realized_price_ratio_ext: RatioPattern3, + pub realized_price_ratio: BpsRatioPattern, + pub realized_price_ratio_ext: RatioPattern, 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: 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, - pub realized_profit_to_loss_ratio_7d: MetricPattern1, - pub realized_value: MetricPattern1, - pub realized_value_1y: MetricPattern1, - pub realized_value_24h: MetricPattern1, - pub realized_value_30d: MetricPattern1, - pub realized_value_7d: MetricPattern1, - pub sell_side_risk_ratio: MetricPattern1, - pub sell_side_risk_ratio_1y: MetricPattern1, - pub sell_side_risk_ratio_24h: MetricPattern1, - pub sell_side_risk_ratio_24h_30d_ema: MetricPattern1, - pub sell_side_risk_ratio_24h_7d_ema: MetricPattern1, - pub sell_side_risk_ratio_30d: MetricPattern1, - pub sell_side_risk_ratio_30d_ema: MetricPattern1, - pub sell_side_risk_ratio_7d: MetricPattern1, - pub sell_side_risk_ratio_7d_ema: MetricPattern1, + pub realized_profit_ema_1w: MetricPattern1, + pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub realized_profit_sum: _1m1w1y24hPattern, + pub realized_profit_to_loss_ratio: _1m1w1y24hPattern, + pub sell_side_risk_ratio: _1m1w1y24hPattern2, + pub sell_side_risk_ratio_24h_ema: _1m1wPattern, pub sent_in_loss: BaseCumulativePattern, - pub sent_in_loss_14d_ema: BtcCentsSatsUsdPattern, + pub sent_in_loss_ema: _2wPattern, pub sent_in_profit: BaseCumulativePattern, - pub sent_in_profit_14d_ema: BtcCentsSatsUsdPattern, - pub sopr: MetricPattern1, - pub sopr_1y: MetricPattern1, - pub sopr_24h: MetricPattern1, - pub sopr_24h_30d_ema: MetricPattern1, - pub sopr_24h_7d_ema: MetricPattern1, - pub sopr_30d: MetricPattern1, - pub sopr_30d_ema: MetricPattern1, - pub sopr_7d: MetricPattern1, - pub sopr_7d_ema: MetricPattern1, - pub total_realized_pnl: MetricPattern1, + pub sent_in_profit_ema: _2wPattern, + pub sopr: _1m1w1y24hPattern, + pub sopr_24h_ema: _1m1wPattern2, pub upper_price_band: CentsSatsUsdPattern, pub value_created: MetricPattern1, - pub value_created_1y: MetricPattern1, - pub value_created_24h: MetricPattern1, - pub value_created_30d: MetricPattern1, - pub value_created_7d: MetricPattern1, + pub value_created_sum: _1m1w1y24hPattern, pub value_destroyed: MetricPattern1, - pub value_destroyed_1y: MetricPattern1, - pub value_destroyed_24h: MetricPattern1, - pub value_destroyed_30d: MetricPattern1, - pub value_destroyed_7d: MetricPattern1, + pub value_destroyed_sum: _1m1w1y24hPattern, } -impl AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern { +impl AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - adjusted_sopr: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr")), - adjusted_sopr_1y: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_1y")), - adjusted_sopr_24h: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_24h")), - adjusted_sopr_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_24h_30d_ema")), - adjusted_sopr_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_24h_7d_ema")), - adjusted_sopr_30d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_30d")), - adjusted_sopr_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_30d_ema")), - adjusted_sopr_7d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_7d")), - adjusted_sopr_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_7d_ema")), + adjusted_sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_sopr")), + adjusted_sopr_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "adjusted_sopr_24h_ema")), adjusted_value_created: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created")), - adjusted_value_created_1y: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created_1y")), - adjusted_value_created_24h: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created_24h")), - adjusted_value_created_30d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created_30d")), - adjusted_value_created_7d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created_7d")), + adjusted_value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_value_created")), adjusted_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), - adjusted_value_destroyed_1y: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed_1y")), - adjusted_value_destroyed_24h: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed_24h")), - adjusted_value_destroyed_30d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed_30d")), - adjusted_value_destroyed_7d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed_7d")), + adjusted_value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "cap_raw")), capitulation_flow: MetricPattern1::new(client.clone(), _m(&acc, "capitulation_flow")), + gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_gross_pnl")), + gross_pnl_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "gross_pnl_sum")), investor_cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "investor_cap_raw")), investor_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "investor_price")), - investor_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "investor_price_ratio")), - investor_price_ratio_ext: RatioPattern3::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_ratio_ext: RatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), loss_value_created: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_created")), loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), lower_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), + net_pnl_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "net_pnl_change_1m")), + net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_market_cap")), + net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_realized_cap")), net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_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: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_ema_1w")), + net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), peak_regret: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), - peak_regret_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "peak_regret_rel_to_realized_cap")), + peak_regret_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_peak_regret_rel_to_realized_cap")), profit_flow: MetricPattern1::new(client.clone(), _m(&acc, "profit_flow")), profit_value_created: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_created")), profit_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_destroyed")), realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_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_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), + realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_cap_rel_to_own_market_cap")), realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), - realized_loss_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: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_ema_1w")), + realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_loss")), realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_price_ratio_ext: RatioPattern3::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_ratio_ext: RatioPattern::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: 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")), - realized_profit_to_loss_ratio_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio_7d")), - 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")), - realized_value_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_30d")), - realized_value_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_7d")), - sell_side_risk_ratio: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_1y: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_1y")), - sell_side_risk_ratio_24h: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h")), - sell_side_risk_ratio_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_30d_ema")), - sell_side_risk_ratio_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_7d_ema")), - sell_side_risk_ratio_30d: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d")), - sell_side_risk_ratio_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d")), - sell_side_risk_ratio_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")), + realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + realized_profit_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit")), + realized_profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), + sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), + sell_side_risk_ratio_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), sent_in_loss: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_loss")), - sent_in_loss_14d_ema: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sent_in_loss_14d_ema")), + sent_in_loss_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_loss_ema_2w")), sent_in_profit: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_profit")), - sent_in_profit_14d_ema: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sent_in_profit_14d_ema")), - sopr: MetricPattern1::new(client.clone(), _m(&acc, "sopr")), - sopr_1y: MetricPattern1::new(client.clone(), _m(&acc, "sopr_1y")), - sopr_24h: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h")), - sopr_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h_30d_ema")), - sopr_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h_7d_ema")), - sopr_30d: MetricPattern1::new(client.clone(), _m(&acc, "sopr_30d")), - sopr_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_30d_ema")), - sopr_7d: MetricPattern1::new(client.clone(), _m(&acc, "sopr_7d")), - sopr_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_7d_ema")), - total_realized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_realized_pnl")), + sent_in_profit_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_profit_ema_2w")), + sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), + sopr_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sopr_24h_ema")), upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), - value_created_1y: MetricPattern1::new(client.clone(), _m(&acc, "value_created_1y")), - value_created_24h: MetricPattern1::new(client.clone(), _m(&acc, "value_created_24h")), - value_created_30d: MetricPattern1::new(client.clone(), _m(&acc, "value_created_30d")), - value_created_7d: MetricPattern1::new(client.clone(), _m(&acc, "value_created_7d")), + value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_created")), value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), - value_destroyed_1y: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_1y")), - value_destroyed_24h: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_24h")), - value_destroyed_30d: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_30d")), - value_destroyed_7d: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_7d")), + value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_destroyed")), } } } /// Pattern struct for repeated tree structure. -pub struct AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 { - pub adjusted_sopr: MetricPattern1, - pub adjusted_sopr_1y: MetricPattern1, - pub adjusted_sopr_24h: MetricPattern1, - pub adjusted_sopr_24h_30d_ema: MetricPattern1, - pub adjusted_sopr_24h_7d_ema: MetricPattern1, - pub adjusted_sopr_30d: MetricPattern1, - pub adjusted_sopr_30d_ema: MetricPattern1, - pub adjusted_sopr_7d: MetricPattern1, - pub adjusted_sopr_7d_ema: MetricPattern1, +pub struct AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 { + pub adjusted_sopr: _1m1w1y24hPattern, + pub adjusted_sopr_ema: _1m1wPattern2, pub adjusted_value_created: MetricPattern1, - pub adjusted_value_created_1y: MetricPattern1, - pub adjusted_value_created_24h: MetricPattern1, - pub adjusted_value_created_30d: MetricPattern1, - pub adjusted_value_created_7d: MetricPattern1, + pub adjusted_value_created_sum: _1m1w1y24hPattern, pub adjusted_value_destroyed: MetricPattern1, - pub adjusted_value_destroyed_1y: MetricPattern1, - pub adjusted_value_destroyed_24h: MetricPattern1, - pub adjusted_value_destroyed_30d: MetricPattern1, - pub adjusted_value_destroyed_7d: MetricPattern1, + pub adjusted_value_destroyed_sum: _1m1w1y24hPattern, pub cap_raw: MetricPattern18, pub capitulation_flow: MetricPattern1, + pub gross_pnl: CentsUsdPattern, + pub gross_pnl_sum: _1m1w1y24hPattern, pub investor_cap_raw: MetricPattern18, pub investor_price: CentsSatsUsdPattern, - pub investor_price_extra: RatioPattern2, + pub investor_price_ratio: BpsRatioPattern, pub loss_value_created: MetricPattern1, pub loss_value_destroyed: MetricPattern1, pub lower_price_band: CentsSatsUsdPattern, pub mvrv: MetricPattern1, pub neg_realized_loss: MetricPattern1, + pub net_pnl_change_1m: MetricPattern1, + pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern, + pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern, pub net_realized_pnl: CumulativeHeightPattern, - pub net_realized_pnl_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: MetricPattern1, + pub net_realized_pnl_ema_1w: MetricPattern1, + pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, pub peak_regret: CumulativeHeightPattern, - pub peak_regret_rel_to_realized_cap: MetricPattern1, + pub peak_regret_rel_to_realized_cap: BpsPercentRatioPattern, pub profit_flow: MetricPattern1, pub profit_value_created: MetricPattern1, pub profit_value_destroyed: MetricPattern1, pub realized_cap: MetricPattern1, - pub realized_cap_30d_delta: MetricPattern1, pub realized_cap_cents: MetricPattern1, + pub realized_cap_change_1m: MetricPattern1, pub realized_loss: CumulativeHeightPattern, - pub realized_loss_7d_ema: MetricPattern1, - pub realized_loss_rel_to_realized_cap: MetricPattern1, + pub realized_loss_ema_1w: MetricPattern1, + pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, pub realized_price: CentsSatsUsdPattern, - pub realized_price_extra: RatioPattern2, + pub realized_price_ratio: BpsRatioPattern, pub realized_profit: CumulativeHeightPattern, - pub realized_profit_7d_ema: MetricPattern1, - pub realized_profit_rel_to_realized_cap: MetricPattern1, - pub realized_value: MetricPattern1, - pub realized_value_1y: MetricPattern1, - pub realized_value_24h: MetricPattern1, - pub realized_value_30d: MetricPattern1, - pub realized_value_7d: MetricPattern1, - pub sell_side_risk_ratio: MetricPattern1, - pub sell_side_risk_ratio_1y: MetricPattern1, - pub sell_side_risk_ratio_24h: MetricPattern1, - pub sell_side_risk_ratio_24h_30d_ema: MetricPattern1, - pub sell_side_risk_ratio_24h_7d_ema: MetricPattern1, - pub sell_side_risk_ratio_30d: MetricPattern1, - pub sell_side_risk_ratio_30d_ema: MetricPattern1, - pub sell_side_risk_ratio_7d: MetricPattern1, - pub sell_side_risk_ratio_7d_ema: MetricPattern1, + pub realized_profit_ema_1w: MetricPattern1, + pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub sell_side_risk_ratio: _1m1w1y24hPattern2, + pub sell_side_risk_ratio_24h_ema: _1m1wPattern, pub sent_in_loss: BaseCumulativePattern, - pub sent_in_loss_14d_ema: BtcCentsSatsUsdPattern, + pub sent_in_loss_ema: _2wPattern, pub sent_in_profit: BaseCumulativePattern, - pub sent_in_profit_14d_ema: BtcCentsSatsUsdPattern, - pub sopr: MetricPattern1, - pub sopr_1y: MetricPattern1, - pub sopr_24h: MetricPattern1, - pub sopr_24h_30d_ema: MetricPattern1, - pub sopr_24h_7d_ema: MetricPattern1, - pub sopr_30d: MetricPattern1, - pub sopr_30d_ema: MetricPattern1, - pub sopr_7d: MetricPattern1, - pub sopr_7d_ema: MetricPattern1, - pub total_realized_pnl: MetricPattern1, + pub sent_in_profit_ema: _2wPattern, + pub sopr: _1m1w1y24hPattern, + pub sopr_24h_ema: _1m1wPattern2, pub upper_price_band: CentsSatsUsdPattern, pub value_created: MetricPattern1, - pub value_created_1y: MetricPattern1, - pub value_created_24h: MetricPattern1, - pub value_created_30d: MetricPattern1, - pub value_created_7d: MetricPattern1, + pub value_created_sum: _1m1w1y24hPattern, pub value_destroyed: MetricPattern1, - pub value_destroyed_1y: MetricPattern1, - pub value_destroyed_24h: MetricPattern1, - pub value_destroyed_30d: MetricPattern1, - pub value_destroyed_7d: MetricPattern1, + pub value_destroyed_sum: _1m1w1y24hPattern, } -impl AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 { +impl AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - adjusted_sopr: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr")), - adjusted_sopr_1y: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_1y")), - adjusted_sopr_24h: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_24h")), - adjusted_sopr_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_24h_30d_ema")), - adjusted_sopr_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_24h_7d_ema")), - adjusted_sopr_30d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_30d")), - adjusted_sopr_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_30d_ema")), - adjusted_sopr_7d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_7d")), - adjusted_sopr_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_sopr_7d_ema")), + adjusted_sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_sopr")), + adjusted_sopr_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "adjusted_sopr_24h_ema")), adjusted_value_created: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created")), - adjusted_value_created_1y: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created_1y")), - adjusted_value_created_24h: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created_24h")), - adjusted_value_created_30d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created_30d")), - adjusted_value_created_7d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_created_7d")), + adjusted_value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_value_created")), adjusted_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), - adjusted_value_destroyed_1y: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed_1y")), - adjusted_value_destroyed_24h: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed_24h")), - adjusted_value_destroyed_30d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed_30d")), - adjusted_value_destroyed_7d: MetricPattern1::new(client.clone(), _m(&acc, "adjusted_value_destroyed_7d")), + adjusted_value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "adjusted_value_destroyed")), cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "cap_raw")), capitulation_flow: MetricPattern1::new(client.clone(), _m(&acc, "capitulation_flow")), + gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_gross_pnl")), + gross_pnl_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "gross_pnl_sum")), investor_cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "investor_cap_raw")), investor_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "investor_price")), - investor_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), loss_value_created: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_created")), loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), lower_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), + net_pnl_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "net_pnl_change_1m")), + net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_market_cap")), + net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_realized_cap")), net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_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: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_ema_1w")), + net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), peak_regret: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), - peak_regret_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "peak_regret_rel_to_realized_cap")), + peak_regret_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_peak_regret_rel_to_realized_cap")), profit_flow: MetricPattern1::new(client.clone(), _m(&acc, "profit_flow")), profit_value_created: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_created")), profit_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_destroyed")), realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_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_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), 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: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_ema_1w")), + realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), 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: 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")), - realized_value_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_30d")), - realized_value_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_7d")), - sell_side_risk_ratio: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_1y: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_1y")), - sell_side_risk_ratio_24h: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h")), - sell_side_risk_ratio_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_30d_ema")), - sell_side_risk_ratio_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_7d_ema")), - sell_side_risk_ratio_30d: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d")), - sell_side_risk_ratio_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d")), - sell_side_risk_ratio_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")), + realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), + sell_side_risk_ratio_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), sent_in_loss: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_loss")), - sent_in_loss_14d_ema: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sent_in_loss_14d_ema")), + sent_in_loss_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_loss_ema_2w")), sent_in_profit: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_profit")), - sent_in_profit_14d_ema: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sent_in_profit_14d_ema")), - sopr: MetricPattern1::new(client.clone(), _m(&acc, "sopr")), - sopr_1y: MetricPattern1::new(client.clone(), _m(&acc, "sopr_1y")), - sopr_24h: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h")), - sopr_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h_30d_ema")), - sopr_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h_7d_ema")), - sopr_30d: MetricPattern1::new(client.clone(), _m(&acc, "sopr_30d")), - sopr_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_30d_ema")), - sopr_7d: MetricPattern1::new(client.clone(), _m(&acc, "sopr_7d")), - sopr_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_7d_ema")), - total_realized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_realized_pnl")), + sent_in_profit_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_profit_ema_2w")), + sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), + sopr_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sopr_24h_ema")), upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), - value_created_1y: MetricPattern1::new(client.clone(), _m(&acc, "value_created_1y")), - value_created_24h: MetricPattern1::new(client.clone(), _m(&acc, "value_created_24h")), - value_created_30d: MetricPattern1::new(client.clone(), _m(&acc, "value_created_30d")), - value_created_7d: MetricPattern1::new(client.clone(), _m(&acc, "value_created_7d")), + value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_created")), value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), - value_destroyed_1y: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_1y")), - value_destroyed_24h: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_24h")), - value_destroyed_30d: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_30d")), - value_destroyed_7d: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_7d")), + value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_destroyed")), } } } /// Pattern struct for repeated tree structure. -pub struct CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 { +pub struct CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 { pub cap_raw: MetricPattern18, pub capitulation_flow: MetricPattern1, + pub gross_pnl: CentsUsdPattern, + pub gross_pnl_sum: _1m1w1y24hPattern, pub investor_cap_raw: MetricPattern18, pub investor_price: CentsSatsUsdPattern, - pub investor_price_extra: RatioPattern2, - pub investor_price_ratio_ext: RatioPattern3, + pub investor_price_ratio: BpsRatioPattern, + pub investor_price_ratio_ext: RatioPattern, pub loss_value_created: MetricPattern1, pub loss_value_destroyed: MetricPattern1, pub lower_price_band: CentsSatsUsdPattern, pub mvrv: MetricPattern1, pub neg_realized_loss: MetricPattern1, + pub net_pnl_change_1m: MetricPattern1, + pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern, + pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern, pub net_realized_pnl: CumulativeHeightPattern, - pub net_realized_pnl_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: MetricPattern1, + pub net_realized_pnl_ema_1w: MetricPattern1, + pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, pub peak_regret: CumulativeHeightPattern, - pub peak_regret_rel_to_realized_cap: MetricPattern1, + pub peak_regret_rel_to_realized_cap: BpsPercentRatioPattern, pub profit_flow: MetricPattern1, pub profit_value_created: MetricPattern1, pub profit_value_destroyed: MetricPattern1, pub realized_cap: MetricPattern1, - pub realized_cap_30d_delta: MetricPattern1, pub realized_cap_cents: MetricPattern1, - pub realized_cap_rel_to_own_market_cap: MetricPattern1, + pub realized_cap_change_1m: MetricPattern1, + pub realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern, 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: MetricPattern1, + pub realized_loss_ema_1w: MetricPattern1, + pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, + pub realized_loss_sum: _1m1w1y24hPattern, pub realized_price: CentsSatsUsdPattern, - pub realized_price_extra: RatioPattern2, - pub realized_price_ratio_ext: RatioPattern3, + pub realized_price_ratio: BpsRatioPattern, + pub realized_price_ratio_ext: RatioPattern, 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: 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, - pub realized_profit_to_loss_ratio_7d: MetricPattern1, - pub realized_value: MetricPattern1, - pub realized_value_1y: MetricPattern1, - pub realized_value_24h: MetricPattern1, - pub realized_value_30d: MetricPattern1, - pub realized_value_7d: MetricPattern1, - pub sell_side_risk_ratio: MetricPattern1, - pub sell_side_risk_ratio_1y: MetricPattern1, - pub sell_side_risk_ratio_24h: MetricPattern1, - pub sell_side_risk_ratio_24h_30d_ema: MetricPattern1, - pub sell_side_risk_ratio_24h_7d_ema: MetricPattern1, - pub sell_side_risk_ratio_30d: MetricPattern1, - pub sell_side_risk_ratio_30d_ema: MetricPattern1, - pub sell_side_risk_ratio_7d: MetricPattern1, - pub sell_side_risk_ratio_7d_ema: MetricPattern1, + pub realized_profit_ema_1w: MetricPattern1, + pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub realized_profit_sum: _1m1w1y24hPattern, + pub realized_profit_to_loss_ratio: _1m1w1y24hPattern, + pub sell_side_risk_ratio: _1m1w1y24hPattern2, + pub sell_side_risk_ratio_24h_ema: _1m1wPattern, pub sent_in_loss: BaseCumulativePattern, - pub sent_in_loss_14d_ema: BtcCentsSatsUsdPattern, + pub sent_in_loss_ema: _2wPattern, pub sent_in_profit: BaseCumulativePattern, - pub sent_in_profit_14d_ema: BtcCentsSatsUsdPattern, - pub sopr: MetricPattern1, - pub sopr_1y: MetricPattern1, - pub sopr_24h: MetricPattern1, - pub sopr_24h_30d_ema: MetricPattern1, - pub sopr_24h_7d_ema: MetricPattern1, - pub sopr_30d: MetricPattern1, - pub sopr_30d_ema: MetricPattern1, - pub sopr_7d: MetricPattern1, - pub sopr_7d_ema: MetricPattern1, - pub total_realized_pnl: MetricPattern1, + pub sent_in_profit_ema: _2wPattern, + pub sopr: _1m1w1y24hPattern, + pub sopr_24h_ema: _1m1wPattern2, pub upper_price_band: CentsSatsUsdPattern, pub value_created: MetricPattern1, - pub value_created_1y: MetricPattern1, - pub value_created_24h: MetricPattern1, - pub value_created_30d: MetricPattern1, - pub value_created_7d: MetricPattern1, + pub value_created_sum: _1m1w1y24hPattern, pub value_destroyed: MetricPattern1, - pub value_destroyed_1y: MetricPattern1, - pub value_destroyed_24h: MetricPattern1, - pub value_destroyed_30d: MetricPattern1, - pub value_destroyed_7d: MetricPattern1, + pub value_destroyed_sum: _1m1w1y24hPattern, } -impl CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 { +impl CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "cap_raw")), capitulation_flow: MetricPattern1::new(client.clone(), _m(&acc, "capitulation_flow")), + gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_gross_pnl")), + gross_pnl_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "gross_pnl_sum")), investor_cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "investor_cap_raw")), investor_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "investor_price")), - investor_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "investor_price_ratio")), - investor_price_ratio_ext: RatioPattern3::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_ratio_ext: RatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), loss_value_created: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_created")), loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), lower_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), + net_pnl_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "net_pnl_change_1m")), + net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_market_cap")), + net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_realized_cap")), net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_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: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_ema_1w")), + net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), peak_regret: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), - peak_regret_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "peak_regret_rel_to_realized_cap")), + peak_regret_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_peak_regret_rel_to_realized_cap")), profit_flow: MetricPattern1::new(client.clone(), _m(&acc, "profit_flow")), profit_value_created: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_created")), profit_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_destroyed")), realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_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_cap_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), + realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_cap_rel_to_own_market_cap")), realized_loss: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_loss")), - realized_loss_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: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_ema_1w")), + realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_loss")), realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), - realized_price_ratio_ext: RatioPattern3::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_ratio_ext: RatioPattern::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: 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")), - realized_profit_to_loss_ratio_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio_7d")), - 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")), - realized_value_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_30d")), - realized_value_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_7d")), - sell_side_risk_ratio: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_1y: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_1y")), - sell_side_risk_ratio_24h: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h")), - sell_side_risk_ratio_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_30d_ema")), - sell_side_risk_ratio_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_7d_ema")), - sell_side_risk_ratio_30d: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d")), - sell_side_risk_ratio_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d")), - sell_side_risk_ratio_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")), + realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + realized_profit_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit")), + realized_profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_profit_to_loss_ratio")), + sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), + sell_side_risk_ratio_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), sent_in_loss: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_loss")), - sent_in_loss_14d_ema: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sent_in_loss_14d_ema")), + sent_in_loss_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_loss_ema_2w")), sent_in_profit: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_profit")), - sent_in_profit_14d_ema: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sent_in_profit_14d_ema")), - sopr: MetricPattern1::new(client.clone(), _m(&acc, "sopr")), - sopr_1y: MetricPattern1::new(client.clone(), _m(&acc, "sopr_1y")), - sopr_24h: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h")), - sopr_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h_30d_ema")), - sopr_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h_7d_ema")), - sopr_30d: MetricPattern1::new(client.clone(), _m(&acc, "sopr_30d")), - sopr_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_30d_ema")), - sopr_7d: MetricPattern1::new(client.clone(), _m(&acc, "sopr_7d")), - sopr_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_7d_ema")), - total_realized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_realized_pnl")), + sent_in_profit_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_profit_ema_2w")), + sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), + sopr_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sopr_24h_ema")), upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), - value_created_1y: MetricPattern1::new(client.clone(), _m(&acc, "value_created_1y")), - value_created_24h: MetricPattern1::new(client.clone(), _m(&acc, "value_created_24h")), - value_created_30d: MetricPattern1::new(client.clone(), _m(&acc, "value_created_30d")), - value_created_7d: MetricPattern1::new(client.clone(), _m(&acc, "value_created_7d")), + value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_created")), value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), - value_destroyed_1y: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_1y")), - value_destroyed_24h: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_24h")), - value_destroyed_30d: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_30d")), - value_destroyed_7d: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_7d")), + value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_destroyed")), } } } /// Pattern struct for repeated tree structure. -pub struct CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern { +pub struct CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern { pub cap_raw: MetricPattern18, pub capitulation_flow: MetricPattern1, + pub gross_pnl: CentsUsdPattern, + pub gross_pnl_sum: _1m1w1y24hPattern, pub investor_cap_raw: MetricPattern18, pub investor_price: CentsSatsUsdPattern, - pub investor_price_extra: RatioPattern2, + pub investor_price_ratio: BpsRatioPattern, pub loss_value_created: MetricPattern1, pub loss_value_destroyed: MetricPattern1, pub lower_price_band: CentsSatsUsdPattern, pub mvrv: MetricPattern1, pub neg_realized_loss: MetricPattern1, + pub net_pnl_change_1m: MetricPattern1, + pub net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern, + pub net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern, pub net_realized_pnl: CumulativeHeightPattern, - pub net_realized_pnl_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: MetricPattern1, + pub net_realized_pnl_ema_1w: MetricPattern1, + pub net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern, pub peak_regret: CumulativeHeightPattern, - pub peak_regret_rel_to_realized_cap: MetricPattern1, + pub peak_regret_rel_to_realized_cap: BpsPercentRatioPattern, pub profit_flow: MetricPattern1, pub profit_value_created: MetricPattern1, pub profit_value_destroyed: MetricPattern1, pub realized_cap: MetricPattern1, - pub realized_cap_30d_delta: MetricPattern1, pub realized_cap_cents: MetricPattern1, + pub realized_cap_change_1m: MetricPattern1, pub realized_loss: CumulativeHeightPattern, - pub realized_loss_7d_ema: MetricPattern1, - pub realized_loss_rel_to_realized_cap: MetricPattern1, + pub realized_loss_ema_1w: MetricPattern1, + pub realized_loss_rel_to_realized_cap: BpsPercentRatioPattern, pub realized_price: CentsSatsUsdPattern, - pub realized_price_extra: RatioPattern2, + pub realized_price_ratio: BpsRatioPattern, pub realized_profit: CumulativeHeightPattern, - pub realized_profit_7d_ema: MetricPattern1, - pub realized_profit_rel_to_realized_cap: MetricPattern1, - pub realized_value: MetricPattern1, - pub realized_value_1y: MetricPattern1, - pub realized_value_24h: MetricPattern1, - pub realized_value_30d: MetricPattern1, - pub realized_value_7d: MetricPattern1, - pub sell_side_risk_ratio: MetricPattern1, - pub sell_side_risk_ratio_1y: MetricPattern1, - pub sell_side_risk_ratio_24h: MetricPattern1, - pub sell_side_risk_ratio_24h_30d_ema: MetricPattern1, - pub sell_side_risk_ratio_24h_7d_ema: MetricPattern1, - pub sell_side_risk_ratio_30d: MetricPattern1, - pub sell_side_risk_ratio_30d_ema: MetricPattern1, - pub sell_side_risk_ratio_7d: MetricPattern1, - pub sell_side_risk_ratio_7d_ema: MetricPattern1, + pub realized_profit_ema_1w: MetricPattern1, + pub realized_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub sell_side_risk_ratio: _1m1w1y24hPattern2, + pub sell_side_risk_ratio_24h_ema: _1m1wPattern, pub sent_in_loss: BaseCumulativePattern, - pub sent_in_loss_14d_ema: BtcCentsSatsUsdPattern, + pub sent_in_loss_ema: _2wPattern, pub sent_in_profit: BaseCumulativePattern, - pub sent_in_profit_14d_ema: BtcCentsSatsUsdPattern, - pub sopr: MetricPattern1, - pub sopr_1y: MetricPattern1, - pub sopr_24h: MetricPattern1, - pub sopr_24h_30d_ema: MetricPattern1, - pub sopr_24h_7d_ema: MetricPattern1, - pub sopr_30d: MetricPattern1, - pub sopr_30d_ema: MetricPattern1, - pub sopr_7d: MetricPattern1, - pub sopr_7d_ema: MetricPattern1, - pub total_realized_pnl: MetricPattern1, + pub sent_in_profit_ema: _2wPattern, + pub sopr: _1m1w1y24hPattern, + pub sopr_24h_ema: _1m1wPattern2, pub upper_price_band: CentsSatsUsdPattern, pub value_created: MetricPattern1, - pub value_created_1y: MetricPattern1, - pub value_created_24h: MetricPattern1, - pub value_created_30d: MetricPattern1, - pub value_created_7d: MetricPattern1, + pub value_created_sum: _1m1w1y24hPattern, pub value_destroyed: MetricPattern1, - pub value_destroyed_1y: MetricPattern1, - pub value_destroyed_24h: MetricPattern1, - pub value_destroyed_30d: MetricPattern1, - pub value_destroyed_7d: MetricPattern1, + pub value_destroyed_sum: _1m1w1y24hPattern, } -impl CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern { +impl CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "cap_raw")), capitulation_flow: MetricPattern1::new(client.clone(), _m(&acc, "capitulation_flow")), + gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_gross_pnl")), + gross_pnl_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "gross_pnl_sum")), investor_cap_raw: MetricPattern18::new(client.clone(), _m(&acc, "investor_cap_raw")), investor_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "investor_price")), - investor_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "investor_price_ratio")), + investor_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "investor_price_ratio")), loss_value_created: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_created")), loss_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "loss_value_destroyed")), lower_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "lower_price_band")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), neg_realized_loss: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), + net_pnl_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "net_pnl_change_1m")), + net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_market_cap")), + net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_pnl_change_1m_rel_to_realized_cap")), net_realized_pnl: CumulativeHeightPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), - net_realized_pnl_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: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), + net_realized_pnl_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "net_realized_pnl_ema_1w")), + net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_realized_pnl_rel_to_realized_cap")), peak_regret: CumulativeHeightPattern::new(client.clone(), _m(&acc, "realized_peak_regret")), - peak_regret_rel_to_realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "peak_regret_rel_to_realized_cap")), + peak_regret_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_peak_regret_rel_to_realized_cap")), profit_flow: MetricPattern1::new(client.clone(), _m(&acc, "profit_flow")), profit_value_created: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_created")), profit_value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "profit_value_destroyed")), realized_cap: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - realized_cap_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_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap_change_1m")), 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: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), + realized_loss_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_ema_1w")), + realized_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_realized_cap")), realized_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - realized_price_extra: RatioPattern2::new(client.clone(), _m(&acc, "realized_price_ratio")), + realized_price_ratio: BpsRatioPattern::new(client.clone(), _m(&acc, "realized_price_ratio")), 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: 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")), - realized_value_30d: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_30d")), - realized_value_7d: MetricPattern1::new(client.clone(), _m(&acc, "realized_value_7d")), - sell_side_risk_ratio: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), - sell_side_risk_ratio_1y: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_1y")), - sell_side_risk_ratio_24h: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h")), - sell_side_risk_ratio_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_30d_ema")), - sell_side_risk_ratio_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_7d_ema")), - sell_side_risk_ratio_30d: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d")), - sell_side_risk_ratio_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_30d_ema")), - sell_side_risk_ratio_7d: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d")), - sell_side_risk_ratio_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sell_side_risk_ratio_7d_ema")), + realized_profit_ema_1w: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_ema_1w")), + realized_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_realized_cap")), + sell_side_risk_ratio: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "sell_side_risk_ratio")), + sell_side_risk_ratio_24h_ema: _1m1wPattern::new(client.clone(), _m(&acc, "sell_side_risk_ratio_24h_ema")), sent_in_loss: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_loss")), - sent_in_loss_14d_ema: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sent_in_loss_14d_ema")), + sent_in_loss_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_loss_ema_2w")), sent_in_profit: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent_in_profit")), - sent_in_profit_14d_ema: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sent_in_profit_14d_ema")), - sopr: MetricPattern1::new(client.clone(), _m(&acc, "sopr")), - sopr_1y: MetricPattern1::new(client.clone(), _m(&acc, "sopr_1y")), - sopr_24h: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h")), - sopr_24h_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h_30d_ema")), - sopr_24h_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_24h_7d_ema")), - sopr_30d: MetricPattern1::new(client.clone(), _m(&acc, "sopr_30d")), - sopr_30d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_30d_ema")), - sopr_7d: MetricPattern1::new(client.clone(), _m(&acc, "sopr_7d")), - sopr_7d_ema: MetricPattern1::new(client.clone(), _m(&acc, "sopr_7d_ema")), - total_realized_pnl: MetricPattern1::new(client.clone(), _m(&acc, "total_realized_pnl")), + sent_in_profit_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_in_profit_ema_2w")), + sopr: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sopr")), + sopr_24h_ema: _1m1wPattern2::new(client.clone(), _m(&acc, "sopr_24h_ema")), upper_price_band: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "upper_price_band")), value_created: MetricPattern1::new(client.clone(), _m(&acc, "value_created")), - value_created_1y: MetricPattern1::new(client.clone(), _m(&acc, "value_created_1y")), - value_created_24h: MetricPattern1::new(client.clone(), _m(&acc, "value_created_24h")), - value_created_30d: MetricPattern1::new(client.clone(), _m(&acc, "value_created_30d")), - value_created_7d: MetricPattern1::new(client.clone(), _m(&acc, "value_created_7d")), + value_created_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_created")), value_destroyed: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed")), - value_destroyed_1y: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_1y")), - value_destroyed_24h: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_24h")), - value_destroyed_30d: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_30d")), - value_destroyed_7d: MetricPattern1::new(client.clone(), _m(&acc, "value_destroyed_7d")), + value_destroyed_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "value_destroyed")), } } } @@ -1727,138 +1447,192 @@ impl _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _0sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "0sd")), - m0_5sd: MetricPattern1::new(client.clone(), _m(&acc, "m0_5sd")), - m0_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m0_5sd")), - m1_5sd: MetricPattern1::new(client.clone(), _m(&acc, "m1_5sd")), - m1_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m1_5sd")), - m1sd: MetricPattern1::new(client.clone(), _m(&acc, "m1sd")), - m1sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m1sd")), - m2_5sd: MetricPattern1::new(client.clone(), _m(&acc, "m2_5sd")), - m2_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m2_5sd")), - m2sd: MetricPattern1::new(client.clone(), _m(&acc, "m2sd")), - m2sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m2sd")), - m3sd: MetricPattern1::new(client.clone(), _m(&acc, "m3sd")), - m3sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m3sd")), - p0_5sd: MetricPattern1::new(client.clone(), _m(&acc, "p0_5sd")), - p0_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p0_5sd")), - p1_5sd: MetricPattern1::new(client.clone(), _m(&acc, "p1_5sd")), - p1_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p1_5sd")), - p1sd: MetricPattern1::new(client.clone(), _m(&acc, "p1sd")), - p1sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p1sd")), - p2_5sd: MetricPattern1::new(client.clone(), _m(&acc, "p2_5sd")), - p2_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p2_5sd")), - p2sd: MetricPattern1::new(client.clone(), _m(&acc, "p2sd")), - p2sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p2sd")), - p3sd: MetricPattern1::new(client.clone(), _m(&acc, "p3sd")), - p3sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p3sd")), - sd: MetricPattern1::new(client.clone(), _m(&acc, "sd")), - sma: MetricPattern1::new(client.clone(), _m(&acc, "sma")), - zscore: MetricPattern1::new(client.clone(), _m(&acc, "zscore")), + _0sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "0sd_4y")), + m0_5sd: MetricPattern1::new(client.clone(), _m(&acc, "m0_5sd_4y")), + m0_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m0_5sd_4y")), + m1_5sd: MetricPattern1::new(client.clone(), _m(&acc, "m1_5sd_4y")), + m1_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m1_5sd_4y")), + m1sd: MetricPattern1::new(client.clone(), _m(&acc, "m1sd_4y")), + m1sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m1sd_4y")), + m2_5sd: MetricPattern1::new(client.clone(), _m(&acc, "m2_5sd_4y")), + m2_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m2_5sd_4y")), + m2sd: MetricPattern1::new(client.clone(), _m(&acc, "m2sd_4y")), + m2sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m2sd_4y")), + m3sd: MetricPattern1::new(client.clone(), _m(&acc, "m3sd_4y")), + m3sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "m3sd_4y")), + p0_5sd: MetricPattern1::new(client.clone(), _m(&acc, "p0_5sd_4y")), + p0_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p0_5sd_4y")), + p1_5sd: MetricPattern1::new(client.clone(), _m(&acc, "p1_5sd_4y")), + p1_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p1_5sd_4y")), + p1sd: MetricPattern1::new(client.clone(), _m(&acc, "p1sd_4y")), + p1sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p1sd_4y")), + p2_5sd: MetricPattern1::new(client.clone(), _m(&acc, "p2_5sd_4y")), + p2_5sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p2_5sd_4y")), + p2sd: MetricPattern1::new(client.clone(), _m(&acc, "p2sd_4y")), + p2sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p2sd_4y")), + p3sd: MetricPattern1::new(client.clone(), _m(&acc, "p3sd_4y")), + p3sd_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "p3sd_4y")), + sd: MetricPattern1::new(client.clone(), _m(&acc, "sd_4y")), + sma: MetricPattern1::new(client.clone(), _m(&acc, "sma_4y")), + zscore: MetricPattern1::new(client.clone(), _m(&acc, "zscore_4y")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct BpsPriceRatioPattern { + pub bps: MetricPattern1, + pub price: CentsSatsUsdPattern, + pub ratio: MetricPattern1, + pub ratio_pct1: BpsRatioPattern, + pub ratio_pct1_price: CentsSatsUsdPattern, + pub ratio_pct2: BpsRatioPattern, + pub ratio_pct2_price: CentsSatsUsdPattern, + pub ratio_pct5: BpsRatioPattern, + pub ratio_pct5_price: CentsSatsUsdPattern, + pub ratio_pct95: BpsRatioPattern, + pub ratio_pct95_price: CentsSatsUsdPattern, + pub ratio_pct98: BpsRatioPattern, + pub ratio_pct98_price: CentsSatsUsdPattern, + pub ratio_pct99: BpsRatioPattern, + pub ratio_pct99_price: CentsSatsUsdPattern, + pub ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sd_1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sd_2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sd_4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sma_1m: BpsRatioPattern, + pub ratio_sma_1w: BpsRatioPattern, +} + +impl BpsPriceRatioPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + bps: MetricPattern1::new(client.clone(), _m(&acc, "ratio_bps")), + price: CentsSatsUsdPattern::new(client.clone(), acc.clone()), + ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), + ratio_pct1: BpsRatioPattern::new(client.clone(), _m(&acc, "ratio_pct1")), + ratio_pct1_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct1")), + ratio_pct2: BpsRatioPattern::new(client.clone(), _m(&acc, "ratio_pct2")), + ratio_pct2_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct2")), + ratio_pct5: BpsRatioPattern::new(client.clone(), _m(&acc, "ratio_pct5")), + ratio_pct5_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct5")), + ratio_pct95: BpsRatioPattern::new(client.clone(), _m(&acc, "ratio_pct95")), + ratio_pct95_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct95")), + ratio_pct98: BpsRatioPattern::new(client.clone(), _m(&acc, "ratio_pct98")), + ratio_pct98_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct98")), + ratio_pct99: BpsRatioPattern::new(client.clone(), _m(&acc, "ratio_pct99")), + ratio_pct99_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct99")), + ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "ratio")), + ratio_sd_1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "ratio")), + ratio_sd_2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "ratio")), + ratio_sd_4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "ratio")), + ratio_sma_1m: BpsRatioPattern::new(client.clone(), _m(&acc, "ratio_sma_1m")), + ratio_sma_1w: BpsRatioPattern::new(client.clone(), _m(&acc, "ratio_sma_1w")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct BpsRatioPattern2 { + pub bps: MetricPattern1, + pub ratio: MetricPattern1, + pub ratio_pct1: BpsRatioPattern, + pub ratio_pct1_price: CentsSatsUsdPattern, + pub ratio_pct2: BpsRatioPattern, + pub ratio_pct2_price: CentsSatsUsdPattern, + pub ratio_pct5: BpsRatioPattern, + pub ratio_pct5_price: CentsSatsUsdPattern, + pub ratio_pct95: BpsRatioPattern, + pub ratio_pct95_price: CentsSatsUsdPattern, + pub ratio_pct98: BpsRatioPattern, + pub ratio_pct98_price: CentsSatsUsdPattern, + pub ratio_pct99: BpsRatioPattern, + pub ratio_pct99_price: CentsSatsUsdPattern, + pub ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sd_1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sd_2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sd_4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sma_1m: BpsRatioPattern, + pub ratio_sma_1w: BpsRatioPattern, +} + +impl BpsRatioPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), + ratio: MetricPattern1::new(client.clone(), acc.clone()), + ratio_pct1: BpsRatioPattern::new(client.clone(), _m(&acc, "pct1")), + ratio_pct1_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct1")), + ratio_pct2: BpsRatioPattern::new(client.clone(), _m(&acc, "pct2")), + ratio_pct2_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct2")), + ratio_pct5: BpsRatioPattern::new(client.clone(), _m(&acc, "pct5")), + ratio_pct5_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct5")), + ratio_pct95: BpsRatioPattern::new(client.clone(), _m(&acc, "pct95")), + ratio_pct95_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct95")), + ratio_pct98: BpsRatioPattern::new(client.clone(), _m(&acc, "pct98")), + ratio_pct98_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct98")), + ratio_pct99: BpsRatioPattern::new(client.clone(), _m(&acc, "pct99")), + ratio_pct99_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct99")), + ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), + ratio_sd_1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), + ratio_sd_2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), + ratio_sd_4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), + ratio_sma_1m: BpsRatioPattern::new(client.clone(), _m(&acc, "sma_1m")), + ratio_sma_1w: BpsRatioPattern::new(client.clone(), _m(&acc, "sma_1w")), } } } /// Pattern struct for repeated tree structure. 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, - 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_market_cap: MetricPattern1, - pub net_unrealized_pnl_rel_to_own_market_cap: MetricPattern1, - pub net_unrealized_pnl_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern, + pub invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, + pub neg_unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern, + pub neg_unrealized_loss_rel_to_own_market_cap: BpsPercentRatioPattern, + pub net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern, + pub net_unrealized_pnl_rel_to_own_gross_pnl: BpsPercentRatioPattern, + pub net_unrealized_pnl_rel_to_own_market_cap: BpsPercentRatioPattern, pub nupl: MetricPattern1, - pub supply_in_loss_rel_to_circulating_supply: MetricPattern1, - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub supply_in_profit_rel_to_circulating_supply: MetricPattern1, - pub supply_in_profit_rel_to_own_supply: MetricPattern1, - pub supply_rel_to_circulating_supply: MetricPattern1, - pub unrealized_loss_rel_to_market_cap: 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_market_cap: MetricPattern1, - pub unrealized_profit_rel_to_own_market_cap: MetricPattern1, - pub unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1, + pub supply_in_loss_rel_to_circulating_supply: BpsPercentRatioPattern, + pub supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern, + pub supply_in_profit_rel_to_circulating_supply: BpsPercentRatioPattern, + pub supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern, + pub supply_rel_to_circulating_supply: BpsPercentRatioPattern, + pub unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, + pub unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern, + pub unrealized_loss_rel_to_own_market_cap: BpsPercentRatioPattern, + pub unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern, + pub unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern, + pub unrealized_profit_rel_to_own_market_cap: BpsPercentRatioPattern, } impl InvestedNegNetNuplSupplyUnrealizedPattern2 { /// 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_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), - 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_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), - 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")), + invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "invested_capital_in_loss_rel_to_realized_cap")), + invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "invested_capital_in_profit_rel_to_realized_cap")), + neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), + neg_unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_gross_pnl")), + neg_unrealized_loss_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_own_market_cap")), + net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), + net_unrealized_pnl_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_gross_pnl")), + net_unrealized_pnl_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_own_market_cap")), nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")), - supply_in_loss_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), - 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_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), - supply_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")), - unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), - 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_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), - 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 PriceRatioPattern { - pub price: CentsSatsUsdPattern, - pub ratio: MetricPattern1, - 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_price: CentsSatsUsdPattern, - pub ratio_pct2: MetricPattern1, - pub ratio_pct2_price: CentsSatsUsdPattern, - pub ratio_pct5: MetricPattern1, - pub ratio_pct5_price: CentsSatsUsdPattern, - pub ratio_pct95: MetricPattern1, - pub ratio_pct95_price: CentsSatsUsdPattern, - pub ratio_pct98: MetricPattern1, - pub ratio_pct98_price: CentsSatsUsdPattern, - pub ratio_pct99: MetricPattern1, - pub ratio_pct99_price: CentsSatsUsdPattern, - pub ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, -} - -impl PriceRatioPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - price: CentsSatsUsdPattern::new(client.clone(), acc.clone()), - ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), - ratio_1m_sma: MetricPattern1::new(client.clone(), _m(&acc, "ratio_1m_sma")), - ratio_1w_sma: MetricPattern1::new(client.clone(), _m(&acc, "ratio_1w_sma")), - ratio_1y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "ratio_1y")), - ratio_2y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "ratio_2y")), - ratio_4y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "ratio_4y")), - ratio_pct1: MetricPattern1::new(client.clone(), _m(&acc, "ratio_pct1")), - ratio_pct1_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct1")), - ratio_pct2: MetricPattern1::new(client.clone(), _m(&acc, "ratio_pct2")), - ratio_pct2_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct2")), - ratio_pct5: MetricPattern1::new(client.clone(), _m(&acc, "ratio_pct5")), - ratio_pct5_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct5")), - ratio_pct95: MetricPattern1::new(client.clone(), _m(&acc, "ratio_pct95")), - ratio_pct95_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct95")), - ratio_pct98: MetricPattern1::new(client.clone(), _m(&acc, "ratio_pct98")), - ratio_pct98_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct98")), - ratio_pct99: MetricPattern1::new(client.clone(), _m(&acc, "ratio_pct99")), - ratio_pct99_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "ratio_pct99")), - ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), _m(&acc, "ratio")), + supply_in_loss_rel_to_circulating_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), + supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), + supply_in_profit_rel_to_circulating_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), + supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), + supply_rel_to_circulating_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")), + unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), + unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_gross_pnl")), + unrealized_loss_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_market_cap")), + unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), + unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_gross_pnl")), + unrealized_profit_rel_to_own_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_own_market_cap")), } } } @@ -1915,105 +1689,56 @@ impl Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75 /// Pattern struct for repeated tree structure. pub struct RatioPattern { - pub ratio: MetricPattern1, - 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: BpsRatioPattern, pub ratio_pct1_price: CentsSatsUsdPattern, - pub ratio_pct2: MetricPattern1, + pub ratio_pct2: BpsRatioPattern, pub ratio_pct2_price: CentsSatsUsdPattern, - pub ratio_pct5: MetricPattern1, + pub ratio_pct5: BpsRatioPattern, pub ratio_pct5_price: CentsSatsUsdPattern, - pub ratio_pct95: MetricPattern1, + pub ratio_pct95: BpsRatioPattern, pub ratio_pct95_price: CentsSatsUsdPattern, - pub ratio_pct98: MetricPattern1, + pub ratio_pct98: BpsRatioPattern, pub ratio_pct98_price: CentsSatsUsdPattern, - pub ratio_pct99: MetricPattern1, + pub ratio_pct99: BpsRatioPattern, pub ratio_pct99_price: CentsSatsUsdPattern, pub ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sd_1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sd_2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sd_4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern, + pub ratio_sma_1m: BpsRatioPattern, + pub ratio_sma_1w: BpsRatioPattern, } impl RatioPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - ratio: MetricPattern1::new(client.clone(), acc.clone()), - 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: BpsRatioPattern::new(client.clone(), _m(&acc, "pct1")), ratio_pct1_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct1")), - ratio_pct2: MetricPattern1::new(client.clone(), _m(&acc, "pct2")), + ratio_pct2: BpsRatioPattern::new(client.clone(), _m(&acc, "pct2")), ratio_pct2_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct2")), - ratio_pct5: MetricPattern1::new(client.clone(), _m(&acc, "pct5")), + ratio_pct5: BpsRatioPattern::new(client.clone(), _m(&acc, "pct5")), ratio_pct5_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct5")), - ratio_pct95: MetricPattern1::new(client.clone(), _m(&acc, "pct95")), + ratio_pct95: BpsRatioPattern::new(client.clone(), _m(&acc, "pct95")), ratio_pct95_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct95")), - ratio_pct98: MetricPattern1::new(client.clone(), _m(&acc, "pct98")), + ratio_pct98: BpsRatioPattern::new(client.clone(), _m(&acc, "pct98")), ratio_pct98_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct98")), - ratio_pct99: MetricPattern1::new(client.clone(), _m(&acc, "pct99")), + ratio_pct99: BpsRatioPattern::new(client.clone(), _m(&acc, "pct99")), ratio_pct99_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct99")), ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), + ratio_sd_1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), + ratio_sd_2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), + ratio_sd_4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), + ratio_sma_1m: BpsRatioPattern::new(client.clone(), _m(&acc, "sma_1m")), + ratio_sma_1w: BpsRatioPattern::new(client.clone(), _m(&acc, "sma_1w")), } } } /// 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_price: CentsSatsUsdPattern, - pub ratio_pct2: MetricPattern1, - pub ratio_pct2_price: CentsSatsUsdPattern, - pub ratio_pct5: MetricPattern1, - pub ratio_pct5_price: CentsSatsUsdPattern, - pub ratio_pct95: MetricPattern1, - pub ratio_pct95_price: CentsSatsUsdPattern, - pub ratio_pct98: MetricPattern1, - pub ratio_pct98_price: CentsSatsUsdPattern, - pub ratio_pct99: MetricPattern1, - pub ratio_pct99_price: CentsSatsUsdPattern, - 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_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct1")), - ratio_pct2: MetricPattern1::new(client.clone(), _m(&acc, "pct2")), - ratio_pct2_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct2")), - ratio_pct5: MetricPattern1::new(client.clone(), _m(&acc, "pct5")), - ratio_pct5_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct5")), - ratio_pct95: MetricPattern1::new(client.clone(), _m(&acc, "pct95")), - ratio_pct95_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct95")), - ratio_pct98: MetricPattern1::new(client.clone(), _m(&acc, "pct98")), - ratio_pct98_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct98")), - ratio_pct99: MetricPattern1::new(client.clone(), _m(&acc, "pct99")), - ratio_pct99_price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct99")), - ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern { +pub struct GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern { pub greed_index: CentsUsdPattern, + pub gross_pnl: CentsUsdPattern, pub invested_capital_in_loss: CentsUsdPattern, pub invested_capital_in_loss_raw: MetricPattern18, pub invested_capital_in_profit: CentsUsdPattern, @@ -2026,16 +1751,16 @@ pub struct GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern { pub pain_index: CentsUsdPattern, pub supply_in_loss: BtcCentsSatsUsdPattern, pub supply_in_profit: BtcCentsSatsUsdPattern, - pub total_unrealized_pnl: CentsUsdPattern, pub unrealized_loss: CentsUsdPattern, pub unrealized_profit: CentsUsdPattern, } -impl GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern { +impl GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { greed_index: CentsUsdPattern::new(client.clone(), _m(&acc, "greed_index")), + gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "unrealized_gross_pnl")), invested_capital_in_loss: CentsUsdPattern::new(client.clone(), _m(&acc, "invested_capital_in_loss")), invested_capital_in_loss_raw: MetricPattern18::new(client.clone(), _m(&acc, "invested_capital_in_loss_raw")), invested_capital_in_profit: CentsUsdPattern::new(client.clone(), _m(&acc, "invested_capital_in_profit")), @@ -2048,7 +1773,6 @@ impl GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern { pain_index: CentsUsdPattern::new(client.clone(), _m(&acc, "pain_index")), supply_in_loss: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "supply_in_loss")), supply_in_profit: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "supply_in_profit")), - total_unrealized_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "total_unrealized_pnl")), unrealized_loss: CentsUsdPattern::new(client.clone(), _m(&acc, "unrealized_loss")), unrealized_profit: CentsUsdPattern::new(client.clone(), _m(&acc, "unrealized_profit")), } @@ -2056,43 +1780,37 @@ impl GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern { } /// Pattern struct for repeated tree structure. -pub struct BlocksCoinbaseDaysDominanceFeeSubsidyPattern { - pub blocks_mined: CumulativeHeightSumPattern, - pub blocks_mined_1m_sum: MetricPattern1, - pub blocks_mined_1w_sum: MetricPattern1, - pub blocks_mined_1y_sum: MetricPattern1, - pub blocks_mined_24h_sum: MetricPattern1, - pub blocks_since_block: MetricPattern1, - pub coinbase: BaseCumulativeSumPattern, - pub days_since_block: MetricPattern1, - pub dominance: MetricPattern1, - pub dominance_1m: MetricPattern1, - pub dominance_1w: MetricPattern1, - pub dominance_1y: MetricPattern1, - pub dominance_24h: MetricPattern1, - pub fee: BaseCumulativeSumPattern, - pub subsidy: BaseCumulativeSumPattern, +pub struct _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 { + pub _10y: BpsPercentRatioPattern, + pub _1m: BpsPercentRatioPattern, + pub _1w: BpsPercentRatioPattern, + pub _1y: BpsPercentRatioPattern, + pub _2y: BpsPercentRatioPattern, + pub _3m: BpsPercentRatioPattern, + pub _3y: BpsPercentRatioPattern, + pub _4y: BpsPercentRatioPattern, + pub _5y: BpsPercentRatioPattern, + pub _6m: BpsPercentRatioPattern, + pub _6y: BpsPercentRatioPattern, + pub _8y: BpsPercentRatioPattern, } -impl BlocksCoinbaseDaysDominanceFeeSubsidyPattern { +impl _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - blocks_mined: CumulativeHeightSumPattern::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")), - blocks_mined_24h_sum: MetricPattern1::new(client.clone(), _m(&acc, "blocks_mined_24h_sum")), - blocks_since_block: MetricPattern1::new(client.clone(), _m(&acc, "blocks_since_block")), - coinbase: BaseCumulativeSumPattern::new(client.clone(), _m(&acc, "coinbase")), - days_since_block: MetricPattern1::new(client.clone(), _m(&acc, "days_since_block")), - dominance: MetricPattern1::new(client.clone(), _m(&acc, "dominance")), - dominance_1m: MetricPattern1::new(client.clone(), _m(&acc, "dominance_1m")), - 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: BaseCumulativeSumPattern::new(client.clone(), _m(&acc, "fee")), - subsidy: BaseCumulativeSumPattern::new(client.clone(), _m(&acc, "subsidy")), + _10y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "10y")), + _1m: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1m")), + _1w: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1w")), + _1y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1y")), + _2y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "2y")), + _3m: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "3m")), + _3y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "3y")), + _4y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "4y")), + _5y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "5y")), + _6m: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "6m")), + _6y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "6y")), + _8y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "8y")), } } } @@ -2117,90 +1835,54 @@ impl _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _10y: BtcCentsSatsUsdPattern::new(client.clone(), _p("10y", &acc)), - _1m: BtcCentsSatsUsdPattern::new(client.clone(), _p("1m", &acc)), - _1w: BtcCentsSatsUsdPattern::new(client.clone(), _p("1w", &acc)), - _1y: BtcCentsSatsUsdPattern::new(client.clone(), _p("1y", &acc)), - _2y: BtcCentsSatsUsdPattern::new(client.clone(), _p("2y", &acc)), - _3m: BtcCentsSatsUsdPattern::new(client.clone(), _p("3m", &acc)), - _3y: BtcCentsSatsUsdPattern::new(client.clone(), _p("3y", &acc)), - _4y: BtcCentsSatsUsdPattern::new(client.clone(), _p("4y", &acc)), - _5y: BtcCentsSatsUsdPattern::new(client.clone(), _p("5y", &acc)), - _6m: BtcCentsSatsUsdPattern::new(client.clone(), _p("6m", &acc)), - _6y: BtcCentsSatsUsdPattern::new(client.clone(), _p("6y", &acc)), - _8y: BtcCentsSatsUsdPattern::new(client.clone(), _p("8y", &acc)), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 { - pub _10y: MetricPattern1, - pub _1m: MetricPattern1, - pub _1w: MetricPattern1, - pub _1y: MetricPattern1, - pub _2y: MetricPattern1, - pub _3m: MetricPattern1, - pub _3y: MetricPattern1, - pub _4y: MetricPattern1, - pub _5y: MetricPattern1, - pub _6m: MetricPattern1, - pub _6y: MetricPattern1, - pub _8y: MetricPattern1, -} - -impl _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - _10y: MetricPattern1::new(client.clone(), _p("10y", &acc)), - _1m: MetricPattern1::new(client.clone(), _p("1m", &acc)), - _1w: MetricPattern1::new(client.clone(), _p("1w", &acc)), - _1y: MetricPattern1::new(client.clone(), _p("1y", &acc)), - _2y: MetricPattern1::new(client.clone(), _p("2y", &acc)), - _3m: MetricPattern1::new(client.clone(), _p("3m", &acc)), - _3y: MetricPattern1::new(client.clone(), _p("3y", &acc)), - _4y: MetricPattern1::new(client.clone(), _p("4y", &acc)), - _5y: MetricPattern1::new(client.clone(), _p("5y", &acc)), - _6m: MetricPattern1::new(client.clone(), _p("6m", &acc)), - _6y: MetricPattern1::new(client.clone(), _p("6y", &acc)), - _8y: MetricPattern1::new(client.clone(), _p("8y", &acc)), + _10y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10y")), + _1m: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1m")), + _1w: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1w")), + _1y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1y")), + _2y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "2y")), + _3m: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "3m")), + _3y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "3y")), + _4y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "4y")), + _5y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "5y")), + _6m: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "6m")), + _6y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "6y")), + _8y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "8y")), } } } /// Pattern struct for repeated tree structure. pub struct InvestedNegNetNuplSupplyUnrealizedPattern { - pub invested_capital_in_loss_pct: MetricPattern1, - pub invested_capital_in_profit_pct: MetricPattern1, - pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, - pub net_unrealized_pnl_rel_to_market_cap: MetricPattern1, + pub invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern, + pub invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern, + pub neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, + pub net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern, pub nupl: MetricPattern1, - pub supply_in_loss_rel_to_circulating_supply: MetricPattern1, - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub supply_in_profit_rel_to_circulating_supply: MetricPattern1, - pub supply_in_profit_rel_to_own_supply: MetricPattern1, - pub supply_rel_to_circulating_supply: MetricPattern1, - pub unrealized_loss_rel_to_market_cap: MetricPattern1, - pub unrealized_profit_rel_to_market_cap: MetricPattern1, + pub supply_in_loss_rel_to_circulating_supply: BpsPercentRatioPattern, + pub supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern, + pub supply_in_profit_rel_to_circulating_supply: BpsPercentRatioPattern, + pub supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern, + pub supply_rel_to_circulating_supply: BpsPercentRatioPattern, + pub unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, + pub unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern, } impl InvestedNegNetNuplSupplyUnrealizedPattern { /// 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_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), - net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), + invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "invested_capital_in_loss_rel_to_realized_cap")), + invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "invested_capital_in_profit_rel_to_realized_cap")), + neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")), + net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")), nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")), - supply_in_loss_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), - 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_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), - supply_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")), - unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), - unrealized_profit_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), + supply_in_loss_rel_to_circulating_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")), + supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")), + supply_in_profit_rel_to_circulating_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")), + supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")), + supply_rel_to_circulating_supply: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")), + unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")), + unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")), } } } @@ -2241,34 +1923,34 @@ impl AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern { /// Pattern struct for repeated tree structure. pub struct AverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern { - pub average: _1y24h30d7dPattern, + pub average: _1m1w1y24hPattern, pub cumulative: MetricPattern1, pub height: MetricPattern18, - pub max: _1y24h30d7dPattern, - pub median: _1y24h30d7dPattern, - pub min: _1y24h30d7dPattern, - pub pct10: _1y24h30d7dPattern, - pub pct25: _1y24h30d7dPattern, - pub pct75: _1y24h30d7dPattern, - pub pct90: _1y24h30d7dPattern, - pub sum: _1y24h30d7dPattern, + pub max: _1m1w1y24hPattern, + pub median: _1m1w1y24hPattern, + pub min: _1m1w1y24hPattern, + pub pct10: _1m1w1y24hPattern, + pub pct25: _1m1w1y24hPattern, + pub pct75: _1m1w1y24hPattern, + pub pct90: _1m1w1y24hPattern, + pub sum: _1m1w1y24hPattern, } impl AverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "average")), + average: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "average")), cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), height: MetricPattern18::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")), - pct10: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p10")), - pct25: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p25")), - pct75: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p75")), - pct90: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p90")), - sum: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "sum")), + max: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "max")), + median: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "median")), + min: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "min")), + pct10: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p10")), + pct25: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p25")), + pct75: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p75")), + pct90: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p90")), + sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sum")), } } } @@ -2279,28 +1961,28 @@ pub struct AverageGainsLossesRsiStochPattern { pub average_loss: MetricPattern1, pub gains: MetricPattern1, pub losses: MetricPattern1, - pub rsi: MetricPattern1, - pub rsi_max: MetricPattern1, - pub rsi_min: MetricPattern1, - pub stoch_rsi: MetricPattern1, - pub stoch_rsi_d: MetricPattern1, - pub stoch_rsi_k: MetricPattern1, + pub rsi: BpsPercentRatioPattern, + pub rsi_max: BpsPercentRatioPattern, + pub rsi_min: BpsPercentRatioPattern, + pub stoch_rsi: BpsPercentRatioPattern, + pub stoch_rsi_d: BpsPercentRatioPattern, + pub stoch_rsi_k: BpsPercentRatioPattern, } impl AverageGainsLossesRsiStochPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - average_gain: MetricPattern1::new(client.clone(), _m(&acc, "avg_gain_1y")), - 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: 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")), - stoch_rsi_d: MetricPattern1::new(client.clone(), _m(&acc, "stoch_rsi_d_1y")), - stoch_rsi_k: MetricPattern1::new(client.clone(), _m(&acc, "stoch_rsi_k_1y")), + average_gain: MetricPattern1::new(client.clone(), _m(&acc, "average_gain_24h")), + average_loss: MetricPattern1::new(client.clone(), _m(&acc, "average_loss_24h")), + gains: MetricPattern1::new(client.clone(), _m(&acc, "gains_24h")), + losses: MetricPattern1::new(client.clone(), _m(&acc, "losses_24h")), + rsi: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "24h")), + rsi_max: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "max_24h")), + rsi_min: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "min_24h")), + stoch_rsi: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "stoch_24h")), + stoch_rsi_d: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "stoch_d_24h")), + stoch_rsi_k: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "stoch_k_24h")), } } } @@ -2309,13 +1991,13 @@ impl AverageGainsLossesRsiStochPattern { pub struct ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern { pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, pub addr_count: MetricPattern1, - pub addr_count_30d_change: MetricPattern1, + pub addr_count_change_1m: MetricPattern1, pub cost_basis: MaxMinPattern, pub outputs: UtxoPattern, - pub realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, + pub realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern, pub relative: InvestedNegNetNuplSupplyUnrealizedPattern, - pub supply: _30dHalvedTotalPattern, - pub unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern, + pub supply: ChangeHalvedTotalPattern, + pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, } impl ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern { @@ -2324,43 +2006,43 @@ impl ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern { Self { activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), acc.clone()), addr_count: MetricPattern1::new(client.clone(), _m(&acc, "addr_count")), - addr_count_30d_change: MetricPattern1::new(client.clone(), _m(&acc, "addr_count_30d_change")), - cost_basis: MaxMinPattern::new(client.clone(), acc.clone()), + addr_count_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "addr_count_change_1m")), + cost_basis: MaxMinPattern::new(client.clone(), _m(&acc, "cost_basis")), outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern::new(client.clone(), acc.clone()), + realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern::new(client.clone(), acc.clone()), relative: InvestedNegNetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), - supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), - unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), + supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), + unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern { - pub all: _30dCountPattern, - pub p2a: _30dCountPattern, - pub p2pk33: _30dCountPattern, - pub p2pk65: _30dCountPattern, - pub p2pkh: _30dCountPattern, - pub p2sh: _30dCountPattern, - pub p2tr: _30dCountPattern, - pub p2wpkh: _30dCountPattern, - pub p2wsh: _30dCountPattern, + pub all: ChangeCountPattern, + pub p2a: ChangeCountPattern, + pub p2pk33: ChangeCountPattern, + pub p2pk65: ChangeCountPattern, + pub p2pkh: ChangeCountPattern, + pub p2sh: ChangeCountPattern, + pub p2tr: ChangeCountPattern, + pub p2wpkh: ChangeCountPattern, + pub p2wsh: ChangeCountPattern, } impl AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - all: _30dCountPattern::new(client.clone(), acc.clone()), - p2a: _30dCountPattern::new(client.clone(), _p("p2a", &acc)), - p2pk33: _30dCountPattern::new(client.clone(), _p("p2pk33", &acc)), - p2pk65: _30dCountPattern::new(client.clone(), _p("p2pk65", &acc)), - p2pkh: _30dCountPattern::new(client.clone(), _p("p2pkh", &acc)), - p2sh: _30dCountPattern::new(client.clone(), _p("p2sh", &acc)), - p2tr: _30dCountPattern::new(client.clone(), _p("p2tr", &acc)), - p2wpkh: _30dCountPattern::new(client.clone(), _p("p2wpkh", &acc)), - p2wsh: _30dCountPattern::new(client.clone(), _p("p2wsh", &acc)), + all: ChangeCountPattern::new(client.clone(), acc.clone()), + p2a: ChangeCountPattern::new(client.clone(), _p("p2a", &acc)), + p2pk33: ChangeCountPattern::new(client.clone(), _p("p2pk33", &acc)), + p2pk65: ChangeCountPattern::new(client.clone(), _p("p2pk65", &acc)), + p2pkh: ChangeCountPattern::new(client.clone(), _p("p2pkh", &acc)), + p2sh: ChangeCountPattern::new(client.clone(), _p("p2sh", &acc)), + p2tr: ChangeCountPattern::new(client.clone(), _p("p2tr", &acc)), + p2wpkh: ChangeCountPattern::new(client.clone(), _p("p2wpkh", &acc)), + p2wsh: ChangeCountPattern::new(client.clone(), _p("p2wsh", &acc)), } } } @@ -2397,84 +2079,84 @@ impl AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 { /// Pattern struct for repeated tree structure. pub struct AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern { - pub average: _1y24h30d7dPattern, - pub max: _1y24h30d7dPattern, - pub median: _1y24h30d7dPattern, - pub min: _1y24h30d7dPattern, - pub pct10: _1y24h30d7dPattern, - pub pct25: _1y24h30d7dPattern, - pub pct75: _1y24h30d7dPattern, - pub pct90: _1y24h30d7dPattern, - pub sum: _1y24h30d7dPattern, + pub average: _1m1w1y24hPattern, + pub max: _1m1w1y24hPattern, + pub median: _1m1w1y24hPattern, + pub min: _1m1w1y24hPattern, + pub pct10: _1m1w1y24hPattern, + pub pct25: _1m1w1y24hPattern, + pub pct75: _1m1w1y24hPattern, + pub pct90: _1m1w1y24hPattern, + pub sum: _1m1w1y24hPattern, } impl AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - 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")), - pct10: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p10")), - pct25: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p25")), - pct75: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p75")), - pct90: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p90")), - sum: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "sum")), + average: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "average")), + max: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "max")), + median: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "median")), + min: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "min")), + pct10: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p10")), + pct25: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p25")), + pct75: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p75")), + pct90: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p90")), + sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sum")), } } } /// Pattern struct for repeated tree structure. pub struct AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern { - pub average: _1y24h30d7dPattern, + pub average: _1m1w1y24hPattern, pub height: MetricPattern18, - pub max: _1y24h30d7dPattern, - pub median: _1y24h30d7dPattern, - pub min: _1y24h30d7dPattern, - pub pct10: _1y24h30d7dPattern, - pub pct25: _1y24h30d7dPattern, - pub pct75: _1y24h30d7dPattern, - pub pct90: _1y24h30d7dPattern, + pub max: _1m1w1y24hPattern, + pub median: _1m1w1y24hPattern, + pub min: _1m1w1y24hPattern, + pub pct10: _1m1w1y24hPattern, + pub pct25: _1m1w1y24hPattern, + pub pct75: _1m1w1y24hPattern, + pub pct90: _1m1w1y24hPattern, } impl AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "average")), + average: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "average")), height: MetricPattern18::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")), - pct10: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p10")), - pct25: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p25")), - pct75: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p75")), - pct90: _1y24h30d7dPattern::new(client.clone(), _m(&acc, "p90")), + max: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "max")), + median: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "median")), + min: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "min")), + pct10: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p10")), + pct25: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p25")), + pct75: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p75")), + pct90: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "p90")), } } } /// Pattern struct for repeated tree structure. -pub struct _1y24h30d7dBtcCentsSatsUsdPattern { +pub struct _1m1w1y24hBtcCentsSatsUsdPattern { + pub _1m: BtcCentsSatsUsdPattern, + pub _1w: BtcCentsSatsUsdPattern, pub _1y: BtcCentsSatsUsdPattern, pub _24h: BtcCentsSatsUsdPattern, - pub _30d: BtcCentsSatsUsdPattern, - pub _7d: BtcCentsSatsUsdPattern, pub btc: MetricPattern18, pub cents: MetricPattern18, pub sats: MetricPattern18, pub usd: MetricPattern18, } -impl _1y24h30d7dBtcCentsSatsUsdPattern { +impl _1m1w1y24hBtcCentsSatsUsdPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { + _1m: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1m")), + _1w: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1w")), _1y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1y")), _24h: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "24h")), - _30d: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "30d")), - _7d: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "7d")), btc: MetricPattern18::new(client.clone(), _m(&acc, "btc")), cents: MetricPattern18::new(client.clone(), _m(&acc, "cents")), sats: MetricPattern18::new(client.clone(), acc.clone()), @@ -2483,6 +2165,34 @@ impl _1y24h30d7dBtcCentsSatsUsdPattern { } } +/// Pattern struct for repeated tree structure. +pub struct BlocksCoinbaseDominanceFeeSubsidyPattern { + pub blocks_mined: CumulativeHeightSumPattern, + pub blocks_mined_sum: _1m1w1y24hPattern, + pub blocks_since_last_mined: MetricPattern1, + pub coinbase: BaseCumulativeSumPattern, + pub dominance: BpsPercentRatioPattern, + pub dominance_rolling: _1m1w1y24hPattern2, + pub fee: BaseCumulativeSumPattern, + pub subsidy: BaseCumulativeSumPattern, +} + +impl BlocksCoinbaseDominanceFeeSubsidyPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + blocks_mined: CumulativeHeightSumPattern::new(client.clone(), _m(&acc, "blocks_mined")), + blocks_mined_sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "blocks_mined_sum")), + blocks_since_last_mined: MetricPattern1::new(client.clone(), _m(&acc, "blocks_since_last_mined")), + coinbase: BaseCumulativeSumPattern::new(client.clone(), _m(&acc, "coinbase")), + dominance: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "dominance")), + dominance_rolling: _1m1w1y24hPattern2::new(client.clone(), _m(&acc, "dominance")), + fee: BaseCumulativeSumPattern::new(client.clone(), _m(&acc, "fee")), + subsidy: BaseCumulativeSumPattern::new(client.clone(), _m(&acc, "subsidy")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern { pub average: MetricPattern18, @@ -2513,26 +2223,26 @@ impl AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern { /// Pattern struct for repeated tree structure. pub struct _10y2y3y4y5y6y8yPattern { - pub _10y: MetricPattern1, - pub _2y: MetricPattern1, - pub _3y: MetricPattern1, - pub _4y: MetricPattern1, - pub _5y: MetricPattern1, - pub _6y: MetricPattern1, - pub _8y: MetricPattern1, + pub _10y: BpsPercentRatioPattern, + pub _2y: BpsPercentRatioPattern, + pub _3y: BpsPercentRatioPattern, + pub _4y: BpsPercentRatioPattern, + pub _5y: BpsPercentRatioPattern, + pub _6y: BpsPercentRatioPattern, + pub _8y: BpsPercentRatioPattern, } impl _10y2y3y4y5y6y8yPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _10y: MetricPattern1::new(client.clone(), _p("10y", &acc)), - _2y: MetricPattern1::new(client.clone(), _p("2y", &acc)), - _3y: MetricPattern1::new(client.clone(), _p("3y", &acc)), - _4y: MetricPattern1::new(client.clone(), _p("4y", &acc)), - _5y: MetricPattern1::new(client.clone(), _p("5y", &acc)), - _6y: MetricPattern1::new(client.clone(), _p("6y", &acc)), - _8y: MetricPattern1::new(client.clone(), _p("8y", &acc)), + _10y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "10y")), + _2y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "2y")), + _3y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "3y")), + _4y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "4y")), + _5y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "5y")), + _6y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "6y")), + _8y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "8y")), } } } @@ -2542,10 +2252,10 @@ pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern { pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, pub cost_basis: InvestedMaxMinPercentilesSpotPattern, pub outputs: UtxoPattern, - pub realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2, + pub realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2, pub relative: InvestedNegNetNuplSupplyUnrealizedPattern2, - pub supply: _30dHalvedTotalPattern, - pub unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern, + pub supply: ChangeHalvedTotalPattern, + pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, } impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern { @@ -2555,10 +2265,10 @@ impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern { activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), acc.clone()), cost_basis: InvestedMaxMinPercentilesSpotPattern::new(client.clone(), acc.clone()), outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2::new(client.clone(), acc.clone()), + realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2::new(client.clone(), acc.clone()), relative: InvestedNegNetNuplSupplyUnrealizedPattern2::new(client.clone(), acc.clone()), - supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), - unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), + supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), + unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), acc.clone()), } } } @@ -2568,10 +2278,10 @@ pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, pub cost_basis: MaxMinPattern, pub outputs: UtxoPattern, - pub realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2, + pub realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2, pub relative: InvestedNegNetNuplSupplyUnrealizedPattern, - pub supply: _30dHalvedTotalPattern, - pub unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern, + pub supply: ChangeHalvedTotalPattern, + pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, } impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { @@ -2579,12 +2289,12 @@ impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4 { pub fn new(client: Arc, acc: String) -> Self { Self { activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), acc.clone()), - cost_basis: MaxMinPattern::new(client.clone(), acc.clone()), + cost_basis: MaxMinPattern::new(client.clone(), _m(&acc, "cost_basis")), outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2::new(client.clone(), acc.clone()), + realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2::new(client.clone(), acc.clone()), relative: InvestedNegNetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), - supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), - unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), + supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), + unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), acc.clone()), } } } @@ -2594,10 +2304,10 @@ pub struct ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 { pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, pub cost_basis: MaxMinPattern, pub outputs: UtxoPattern, - pub realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, + pub realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern, pub relative: InvestedNegNetNuplSupplyUnrealizedPattern, - pub supply: _30dHalvedTotalPattern, - pub unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern, + pub supply: ChangeHalvedTotalPattern, + pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, } impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 { @@ -2605,34 +2315,34 @@ impl ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3 { pub fn new(client: Arc, acc: String) -> Self { Self { activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), acc.clone()), - cost_basis: MaxMinPattern::new(client.clone(), acc.clone()), + cost_basis: MaxMinPattern::new(client.clone(), _m(&acc, "cost_basis")), outputs: UtxoPattern::new(client.clone(), _m(&acc, "utxo_count")), - realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern::new(client.clone(), acc.clone()), + realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern::new(client.clone(), acc.clone()), relative: InvestedNegNetNuplSupplyUnrealizedPattern::new(client.clone(), acc.clone()), - supply: _30dHalvedTotalPattern::new(client.clone(), acc.clone()), - unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern::new(client.clone(), acc.clone()), + supply: ChangeHalvedTotalPattern::new(client.clone(), _m(&acc, "supply")), + unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. -pub struct _1y24h30d7dBaseCumulativePattern { +pub struct _1m1w1y24hBaseCumulativePattern { + pub _1m: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, + pub _1w: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, pub _1y: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, pub _24h: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, - pub _30d: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, - pub _7d: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2, pub base: BtcCentsSatsUsdPattern, pub cumulative: BtcCentsSatsUsdPattern, } -impl _1y24h30d7dBaseCumulativePattern { +impl _1m1w1y24hBaseCumulativePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { + _1m: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), _m(&acc, "1m")), + _1w: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), _m(&acc, "1w")), _1y: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), _m(&acc, "1y")), _24h: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), _m(&acc, "24h")), - _30d: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), _m(&acc, "30d")), - _7d: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2::new(client.clone(), _m(&acc, "7d")), base: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), cumulative: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "cumulative")), } @@ -2670,7 +2380,7 @@ pub struct CoinblocksCoindaysSatblocksSatdaysSentPattern { pub satblocks_destroyed: MetricPattern18, pub satdays_destroyed: MetricPattern18, pub sent: BaseCumulativePattern, - pub sent_14d_ema: BtcCentsSatsUsdPattern, + pub sent_ema: _2wPattern, } impl CoinblocksCoindaysSatblocksSatdaysSentPattern { @@ -2682,7 +2392,7 @@ impl CoinblocksCoindaysSatblocksSatdaysSentPattern { satblocks_destroyed: MetricPattern18::new(client.clone(), _m(&acc, "satblocks_destroyed")), satdays_destroyed: MetricPattern18::new(client.clone(), _m(&acc, "satdays_destroyed")), sent: BaseCumulativePattern::new(client.clone(), _m(&acc, "sent")), - sent_14d_ema: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "sent_14d_ema")), + sent_ema: _2wPattern::new(client.clone(), _m(&acc, "sent_ema_2w")), } } } @@ -2693,8 +2403,8 @@ pub struct InvestedMaxMinPercentilesSpotPattern { pub max: CentsSatsUsdPattern, pub min: CentsSatsUsdPattern, pub percentiles: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, - pub spot_cost_basis_percentile: MetricPattern1, - pub spot_invested_capital_percentile: MetricPattern1, + pub spot_cost_basis_percentile: BpsPercentRatioPattern, + pub spot_invested_capital_percentile: BpsPercentRatioPattern, } impl InvestedMaxMinPercentilesSpotPattern { @@ -2702,11 +2412,11 @@ impl InvestedMaxMinPercentilesSpotPattern { pub fn new(client: Arc, acc: String) -> Self { Self { invested_capital: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern::new(client.clone(), _m(&acc, "invested_capital")), - max: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "max_cost_basis")), - min: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "min_cost_basis")), + max: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "cost_basis_max")), + min: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "cost_basis_min")), percentiles: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern::new(client.clone(), _m(&acc, "cost_basis")), - spot_cost_basis_percentile: MetricPattern1::new(client.clone(), _m(&acc, "spot_cost_basis_percentile")), - spot_invested_capital_percentile: MetricPattern1::new(client.clone(), _m(&acc, "spot_invested_capital_percentile")), + spot_cost_basis_percentile: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "spot_cost_basis_percentile")), + spot_invested_capital_percentile: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "spot_invested_capital_percentile")), } } } @@ -2724,31 +2434,51 @@ impl EmaHistogramLineSignalPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - ema_fast: MetricPattern1::new(client.clone(), _m(&acc, "ema_fast_1y")), - ema_slow: MetricPattern1::new(client.clone(), _m(&acc, "ema_slow_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")), + ema_fast: MetricPattern1::new(client.clone(), _m(&acc, "ema_fast_24h")), + ema_slow: MetricPattern1::new(client.clone(), _m(&acc, "ema_slow_24h")), + histogram: MetricPattern1::new(client.clone(), _m(&acc, "histogram_24h")), + line: MetricPattern1::new(client.clone(), _m(&acc, "line_24h")), + signal: MetricPattern1::new(client.clone(), _m(&acc, "signal_24h")), } } } /// Pattern struct for repeated tree structure. -pub struct _1y24h30d7dPattern2 { - pub _1y: BtcCentsSatsUsdPattern, - pub _24h: BtcCentsSatsUsdPattern, - pub _30d: BtcCentsSatsUsdPattern, - pub _7d: BtcCentsSatsUsdPattern, +pub struct _1m1w1y24hPattern2 { + pub _1m: BpsPercentRatioPattern, + pub _1w: BpsPercentRatioPattern, + pub _1y: BpsPercentRatioPattern, + pub _24h: BpsPercentRatioPattern, } -impl _1y24h30d7dPattern2 { +impl _1m1w1y24hPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { + _1m: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1m")), + _1w: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1w")), + _1y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1y")), + _24h: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "24h")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _1m1w1y24hPattern5 { + pub _1m: BtcCentsSatsUsdPattern, + pub _1w: BtcCentsSatsUsdPattern, + pub _1y: BtcCentsSatsUsdPattern, + pub _24h: BtcCentsSatsUsdPattern, +} + +impl _1m1w1y24hPattern5 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _1m: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1m")), + _1w: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1w")), _1y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1y")), _24h: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "24h")), - _30d: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "30d")), - _7d: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "7d")), } } } @@ -2774,39 +2504,21 @@ impl BtcCentsSatsUsdPattern { } /// Pattern struct for repeated tree structure. -pub struct _1y24h30d7dPattern { +pub struct _1m1w1y24hPattern { + pub _1m: MetricPattern1, + pub _1w: MetricPattern1, pub _1y: MetricPattern1, pub _24h: MetricPattern1, - pub _30d: MetricPattern1, - pub _7d: MetricPattern1, } -impl _1y24h30d7dPattern { +impl _1m1w1y24hPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { + _1m: MetricPattern1::new(client.clone(), _m(&acc, "1m")), + _1w: MetricPattern1::new(client.clone(), _m(&acc, "1w")), _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")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct _30dHalvedTotalPattern { - pub _30d_change: BtcCentsSatsUsdPattern, - pub halved: BtcCentsSatsUsdPattern, - pub total: BtcCentsSatsUsdPattern, -} - -impl _30dHalvedTotalPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - _30d_change: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "_30d_change")), - halved: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "supply_halved")), - total: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "supply")), } } } @@ -2815,7 +2527,7 @@ impl _30dHalvedTotalPattern { pub struct BaseCumulativeSumPattern { pub base: BtcCentsSatsUsdPattern, pub cumulative: BtcCentsSatsUsdPattern, - pub sum: _1y24h30d7dPattern2, + pub sum: _1m1w1y24hPattern5, } impl BaseCumulativeSumPattern { @@ -2824,7 +2536,43 @@ impl BaseCumulativeSumPattern { Self { base: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), cumulative: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "cumulative")), - sum: _1y24h30d7dPattern2::new(client.clone(), _m(&acc, "sum")), + sum: _1m1w1y24hPattern5::new(client.clone(), _m(&acc, "sum")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct BpsPercentRatioPattern2 { + pub bps: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub percent: MetricPattern1, + pub ratio: MetricPattern1, +} + +impl BpsPercentRatioPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + bps: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), _m(&acc, "bps")), + percent: MetricPattern1::new(client.clone(), acc.clone()), + ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct BpsPercentRatioPattern { + pub bps: MetricPattern1, + pub percent: MetricPattern1, + pub ratio: MetricPattern1, +} + +impl BpsPercentRatioPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), + percent: MetricPattern1::new(client.clone(), acc.clone()), + ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), } } } @@ -2865,6 +2613,24 @@ impl CentsSatsUsdPattern { } } +/// Pattern struct for repeated tree structure. +pub struct ChangeHalvedTotalPattern { + pub change_1m: BtcCentsSatsUsdPattern, + pub halved: BtcCentsSatsUsdPattern, + pub total: BtcCentsSatsUsdPattern, +} + +impl ChangeHalvedTotalPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + change_1m: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "change_1m")), + halved: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "halved")), + total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct _6bBlockTxindexPattern { pub _6b: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern, @@ -2887,7 +2653,7 @@ impl _6bBlockTxindexPattern { pub struct CumulativeHeightSumPattern { pub cumulative: MetricPattern1, pub height: MetricPattern18, - pub sum: _1y24h30d7dPattern, + pub sum: _1m1w1y24hPattern, } impl CumulativeHeightSumPattern { @@ -2896,23 +2662,39 @@ impl CumulativeHeightSumPattern { Self { cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), height: MetricPattern18::new(client.clone(), acc.clone()), - sum: _1y24h30d7dPattern::new(client.clone(), acc.clone()), + sum: _1m1w1y24hPattern::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. -pub struct _30dCountPattern { - pub _30d_change: MetricPattern1, - pub count: MetricPattern1, +pub struct _1m1wPattern { + pub _1m: BpsPercentRatioPattern, + pub _1w: BpsPercentRatioPattern, } -impl _30dCountPattern { +impl _1m1wPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _30d_change: MetricPattern1::new(client.clone(), _m(&acc, "30d_change")), - count: MetricPattern1::new(client.clone(), acc.clone()), + _1m: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1m")), + _1w: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1w")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _1m1wPattern2 { + pub _1m: MetricPattern1, + pub _1w: MetricPattern1, +} + +impl _1m1wPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _1m: MetricPattern1::new(client.clone(), _m(&acc, "1m")), + _1w: MetricPattern1::new(client.clone(), _m(&acc, "1w")), } } } @@ -2933,6 +2715,22 @@ impl BaseCumulativePattern { } } +/// Pattern struct for repeated tree structure. +pub struct BpsRatioPattern { + pub bps: MetricPattern1, + pub ratio: MetricPattern1, +} + +impl BpsRatioPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), + ratio: MetricPattern1::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct CentsUsdPattern { pub cents: MetricPattern1, @@ -2949,6 +2747,22 @@ impl CentsUsdPattern { } } +/// Pattern struct for repeated tree structure. +pub struct ChangeCountPattern { + pub change_1m: MetricPattern1, + pub count: MetricPattern1, +} + +impl ChangeCountPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + change_1m: MetricPattern1::new(client.clone(), _m(&acc, "change_1m")), + count: MetricPattern1::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct MaxMinPattern { pub max: CentsSatsUsdPattern, @@ -2959,8 +2773,8 @@ impl MaxMinPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - max: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "max_cost_basis")), - min: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "min_cost_basis")), + max: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "max")), + min: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "min")), } } } @@ -2975,8 +2789,8 @@ impl SdSmaPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), _m(&acc, "sd")), - sma: MetricPattern1::new(client.clone(), _m(&acc, "sma")), + sd: MetricPattern1::new(client.clone(), _m(&acc, "sd_1y")), + sma: MetricPattern1::new(client.clone(), _m(&acc, "sma_1y")), } } } @@ -2984,7 +2798,7 @@ impl SdSmaPattern { /// Pattern struct for repeated tree structure. pub struct UtxoPattern { pub utxo_count: MetricPattern1, - pub utxo_count_30d_change: MetricPattern1, + pub utxo_count_change_1m: MetricPattern1, } impl UtxoPattern { @@ -2992,7 +2806,7 @@ impl UtxoPattern { pub fn new(client: Arc, acc: String) -> Self { Self { utxo_count: MetricPattern1::new(client.clone(), acc.clone()), - utxo_count_30d_change: MetricPattern1::new(client.clone(), _m(&acc, "30d_change")), + utxo_count_change_1m: MetricPattern1::new(client.clone(), _m(&acc, "change_1m")), } } } @@ -3014,15 +2828,15 @@ impl CumulativeHeightPattern { } /// Pattern struct for repeated tree structure. -pub struct RatioPattern2 { - pub ratio: MetricPattern1, +pub struct _2wPattern { + pub _2w: BtcCentsSatsUsdPattern, } -impl RatioPattern2 { +impl _2wPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - ratio: MetricPattern1::new(client.clone(), acc.clone()), + _2w: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), } } } @@ -3084,7 +2898,7 @@ pub struct MetricsTree_Blocks { pub halving: MetricsTree_Blocks_Halving, pub vbytes: AverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern, pub size: MetricsTree_Blocks_Size, - pub fullness: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub fullness: BpsPercentRatioPattern2, } impl MetricsTree_Blocks { @@ -3100,7 +2914,7 @@ impl MetricsTree_Blocks { halving: MetricsTree_Blocks_Halving::new(client.clone(), format!("{base_path}_halving")), vbytes: AverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "block_vbytes".to_string()), size: MetricsTree_Blocks_Size::new(client.clone(), format!("{base_path}_size")), - fullness: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "block_fullness".to_string()), + fullness: BpsPercentRatioPattern2::new(client.clone(), "block_fullness".to_string()), } } } @@ -3109,7 +2923,7 @@ impl MetricsTree_Blocks { pub struct MetricsTree_Blocks_Difficulty { pub raw: MetricPattern1, pub as_hash: MetricPattern1, - pub adjustment: MetricPattern1, + pub adjustment: BpsPercentRatioPattern, pub epoch: MetricPattern1, pub blocks_before_next_adjustment: MetricPattern1, pub days_before_next_adjustment: MetricPattern1, @@ -3120,7 +2934,7 @@ impl MetricsTree_Blocks_Difficulty { Self { raw: MetricPattern1::new(client.clone(), "difficulty".to_string()), as_hash: MetricPattern1::new(client.clone(), "difficulty_as_hash".to_string()), - adjustment: MetricPattern1::new(client.clone(), "difficulty_adjustment".to_string()), + adjustment: BpsPercentRatioPattern::new(client.clone(), "difficulty_adjustment".to_string()), epoch: MetricPattern1::new(client.clone(), "difficulty_epoch".to_string()), blocks_before_next_adjustment: MetricPattern1::new(client.clone(), "blocks_before_next_difficulty_adjustment".to_string()), days_before_next_adjustment: MetricPattern1::new(client.clone(), "days_before_next_difficulty_adjustment".to_string()), @@ -3149,15 +2963,15 @@ impl MetricsTree_Blocks_Time { pub struct MetricsTree_Blocks_Weight { pub base: MetricPattern18, pub cumulative: MetricPattern1, - pub sum: _1y24h30d7dPattern, - pub average: _1y24h30d7dPattern, - pub min: _1y24h30d7dPattern, - pub max: _1y24h30d7dPattern, - pub pct10: _1y24h30d7dPattern, - pub pct25: _1y24h30d7dPattern, - pub median: _1y24h30d7dPattern, - pub pct75: _1y24h30d7dPattern, - pub pct90: _1y24h30d7dPattern, + pub sum: _1m1w1y24hPattern, + pub average: _1m1w1y24hPattern, + pub min: _1m1w1y24hPattern, + pub max: _1m1w1y24hPattern, + pub pct10: _1m1w1y24hPattern, + pub pct25: _1m1w1y24hPattern, + pub median: _1m1w1y24hPattern, + pub pct75: _1m1w1y24hPattern, + pub pct90: _1m1w1y24hPattern, } impl MetricsTree_Blocks_Weight { @@ -3165,15 +2979,15 @@ impl MetricsTree_Blocks_Weight { Self { base: MetricPattern18::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()), - pct10: _1y24h30d7dPattern::new(client.clone(), "block_weight_p10".to_string()), - pct25: _1y24h30d7dPattern::new(client.clone(), "block_weight_p25".to_string()), - median: _1y24h30d7dPattern::new(client.clone(), "block_weight_median".to_string()), - pct75: _1y24h30d7dPattern::new(client.clone(), "block_weight_p75".to_string()), - pct90: _1y24h30d7dPattern::new(client.clone(), "block_weight_p90".to_string()), + sum: _1m1w1y24hPattern::new(client.clone(), "block_weight_sum".to_string()), + average: _1m1w1y24hPattern::new(client.clone(), "block_weight_average".to_string()), + min: _1m1w1y24hPattern::new(client.clone(), "block_weight_min".to_string()), + max: _1m1w1y24hPattern::new(client.clone(), "block_weight_max".to_string()), + pct10: _1m1w1y24hPattern::new(client.clone(), "block_weight_p10".to_string()), + pct25: _1m1w1y24hPattern::new(client.clone(), "block_weight_p25".to_string()), + median: _1m1w1y24hPattern::new(client.clone(), "block_weight_median".to_string()), + pct75: _1m1w1y24hPattern::new(client.clone(), "block_weight_p75".to_string()), + pct90: _1m1w1y24hPattern::new(client.clone(), "block_weight_p90".to_string()), } } } @@ -3182,7 +2996,7 @@ impl MetricsTree_Blocks_Weight { pub struct MetricsTree_Blocks_Count { pub block_count_target: MetricPattern1, pub block_count: CumulativeHeightSumPattern, - pub block_count_sum: _1y24h30d7dPattern, + pub block_count_sum: _1m1w1y24hPattern, pub height_1h_ago: MetricPattern18, pub height_24h_ago: MetricPattern18, pub height_3d_ago: MetricPattern18, @@ -3233,7 +3047,7 @@ impl MetricsTree_Blocks_Count { Self { block_count_target: MetricPattern1::new(client.clone(), "block_count_target".to_string()), block_count: CumulativeHeightSumPattern::new(client.clone(), "block_count".to_string()), - block_count_sum: _1y24h30d7dPattern::new(client.clone(), "block_count_sum".to_string()), + block_count_sum: _1m1w1y24hPattern::new(client.clone(), "block_count_sum".to_string()), height_1h_ago: MetricPattern18::new(client.clone(), "height_1h_ago".to_string()), height_24h_ago: MetricPattern18::new(client.clone(), "height_24h_ago".to_string()), height_3d_ago: MetricPattern18::new(client.clone(), "height_3d_ago".to_string()), @@ -3301,30 +3115,30 @@ impl MetricsTree_Blocks_Halving { /// Metrics tree node. pub struct MetricsTree_Blocks_Size { pub cumulative: MetricPattern1, - pub sum: _1y24h30d7dPattern, - pub average: _1y24h30d7dPattern, - pub min: _1y24h30d7dPattern, - pub max: _1y24h30d7dPattern, - pub pct10: _1y24h30d7dPattern, - pub pct25: _1y24h30d7dPattern, - pub median: _1y24h30d7dPattern, - pub pct75: _1y24h30d7dPattern, - pub pct90: _1y24h30d7dPattern, + pub sum: _1m1w1y24hPattern, + pub average: _1m1w1y24hPattern, + pub min: _1m1w1y24hPattern, + pub max: _1m1w1y24hPattern, + pub pct10: _1m1w1y24hPattern, + pub pct25: _1m1w1y24hPattern, + pub median: _1m1w1y24hPattern, + pub pct75: _1m1w1y24hPattern, + pub pct90: _1m1w1y24hPattern, } impl MetricsTree_Blocks_Size { pub fn new(client: Arc, base_path: String) -> Self { Self { cumulative: MetricPattern1::new(client.clone(), "block_size_cumulative".to_string()), - sum: _1y24h30d7dPattern::new(client.clone(), "block_size_sum".to_string()), - average: _1y24h30d7dPattern::new(client.clone(), "block_size_average".to_string()), - min: _1y24h30d7dPattern::new(client.clone(), "block_size_min".to_string()), - max: _1y24h30d7dPattern::new(client.clone(), "block_size_max".to_string()), - pct10: _1y24h30d7dPattern::new(client.clone(), "block_size_p10".to_string()), - pct25: _1y24h30d7dPattern::new(client.clone(), "block_size_p25".to_string()), - median: _1y24h30d7dPattern::new(client.clone(), "block_size_median".to_string()), - pct75: _1y24h30d7dPattern::new(client.clone(), "block_size_p75".to_string()), - pct90: _1y24h30d7dPattern::new(client.clone(), "block_size_p90".to_string()), + sum: _1m1w1y24hPattern::new(client.clone(), "block_size_sum".to_string()), + average: _1m1w1y24hPattern::new(client.clone(), "block_size_average".to_string()), + min: _1m1w1y24hPattern::new(client.clone(), "block_size_min".to_string()), + max: _1m1w1y24hPattern::new(client.clone(), "block_size_max".to_string()), + pct10: _1m1w1y24hPattern::new(client.clone(), "block_size_p10".to_string()), + pct25: _1m1w1y24hPattern::new(client.clone(), "block_size_p25".to_string()), + median: _1m1w1y24hPattern::new(client.clone(), "block_size_median".to_string()), + pct75: _1m1w1y24hPattern::new(client.clone(), "block_size_p75".to_string()), + pct90: _1m1w1y24hPattern::new(client.clone(), "block_size_p90".to_string()), } } } @@ -3438,8 +3252,8 @@ impl MetricsTree_Transactions_Versions { /// Metrics tree node. pub struct MetricsTree_Transactions_Volume { - pub sent_sum: _1y24h30d7dBtcCentsSatsUsdPattern, - pub received_sum: _1y24h30d7dBtcCentsSatsUsdPattern, + pub sent_sum: _1m1w1y24hBtcCentsSatsUsdPattern, + pub received_sum: _1m1w1y24hBtcCentsSatsUsdPattern, pub annualized_volume: BtcCentsSatsUsdPattern, pub tx_per_sec: MetricPattern1, pub outputs_per_sec: MetricPattern1, @@ -3449,8 +3263,8 @@ pub struct MetricsTree_Transactions_Volume { impl MetricsTree_Transactions_Volume { pub fn new(client: Arc, base_path: String) -> Self { Self { - sent_sum: _1y24h30d7dBtcCentsSatsUsdPattern::new(client.clone(), "sent_sum".to_string()), - received_sum: _1y24h30d7dBtcCentsSatsUsdPattern::new(client.clone(), "received_sum".to_string()), + sent_sum: _1m1w1y24hBtcCentsSatsUsdPattern::new(client.clone(), "sent_sum".to_string()), + received_sum: _1m1w1y24hBtcCentsSatsUsdPattern::new(client.clone(), "received_sum".to_string()), annualized_volume: BtcCentsSatsUsdPattern::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()), @@ -3667,28 +3481,28 @@ impl MetricsTree_Scripts_Count { /// Metrics tree node. pub struct MetricsTree_Scripts_Value { - pub opreturn: _1y24h30d7dBaseCumulativePattern, + pub opreturn: _1m1w1y24hBaseCumulativePattern, } impl MetricsTree_Scripts_Value { pub fn new(client: Arc, base_path: String) -> Self { Self { - opreturn: _1y24h30d7dBaseCumulativePattern::new(client.clone(), "opreturn_value".to_string()), + opreturn: _1m1w1y24hBaseCumulativePattern::new(client.clone(), "opreturn_value".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Scripts_Adoption { - pub taproot: MetricPattern1, - pub segwit: MetricPattern1, + pub taproot: BpsPercentRatioPattern, + pub segwit: BpsPercentRatioPattern, } impl MetricsTree_Scripts_Adoption { pub fn new(client: Arc, base_path: String) -> Self { Self { - taproot: MetricPattern1::new(client.clone(), "taproot_adoption".to_string()), - segwit: MetricPattern1::new(client.clone(), "segwit_adoption".to_string()), + taproot: BpsPercentRatioPattern::new(client.clone(), "taproot_adoption".to_string()), + segwit: BpsPercentRatioPattern::new(client.clone(), "segwit_adoption".to_string()), } } } @@ -3710,41 +3524,29 @@ impl MetricsTree_Mining { /// Metrics tree node. pub struct MetricsTree_Mining_Rewards { - pub coinbase: _1y24h30d7dBaseCumulativePattern, - pub subsidy: _1y24h30d7dBaseCumulativePattern, - pub fees: _1y24h30d7dBaseCumulativePattern, + pub coinbase: _1m1w1y24hBaseCumulativePattern, + pub subsidy: _1m1w1y24hBaseCumulativePattern, + pub fees: _1m1w1y24hBaseCumulativePattern, pub unclaimed_rewards: BaseCumulativeSumPattern, - pub fee_dominance: MetricPattern1, - pub fee_dominance_24h: MetricPattern1, - pub fee_dominance_7d: MetricPattern1, - pub fee_dominance_30d: MetricPattern1, - pub fee_dominance_1y: MetricPattern1, - pub subsidy_dominance: MetricPattern1, - pub subsidy_dominance_24h: MetricPattern1, - pub subsidy_dominance_7d: MetricPattern1, - pub subsidy_dominance_30d: MetricPattern1, - pub subsidy_dominance_1y: MetricPattern1, - pub subsidy_usd_1y_sma: CentsUsdPattern, + pub fee_dominance: BpsPercentRatioPattern, + pub fee_dominance_rolling: _1m1w1y24hPattern2, + pub subsidy_dominance: BpsPercentRatioPattern, + pub subsidy_dominance_rolling: _1m1w1y24hPattern2, + pub subsidy_sma_1y: CentsUsdPattern, } impl MetricsTree_Mining_Rewards { pub fn new(client: Arc, base_path: String) -> Self { Self { - coinbase: _1y24h30d7dBaseCumulativePattern::new(client.clone(), "coinbase".to_string()), - subsidy: _1y24h30d7dBaseCumulativePattern::new(client.clone(), "subsidy".to_string()), - fees: _1y24h30d7dBaseCumulativePattern::new(client.clone(), "fees".to_string()), + coinbase: _1m1w1y24hBaseCumulativePattern::new(client.clone(), "coinbase".to_string()), + subsidy: _1m1w1y24hBaseCumulativePattern::new(client.clone(), "subsidy".to_string()), + fees: _1m1w1y24hBaseCumulativePattern::new(client.clone(), "fees".to_string()), unclaimed_rewards: BaseCumulativeSumPattern::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()), - fee_dominance_30d: MetricPattern1::new(client.clone(), "fee_dominance_30d".to_string()), - fee_dominance_1y: MetricPattern1::new(client.clone(), "fee_dominance_1y".to_string()), - subsidy_dominance: MetricPattern1::new(client.clone(), "subsidy_dominance".to_string()), - subsidy_dominance_24h: MetricPattern1::new(client.clone(), "subsidy_dominance_24h".to_string()), - subsidy_dominance_7d: MetricPattern1::new(client.clone(), "subsidy_dominance_7d".to_string()), - subsidy_dominance_30d: MetricPattern1::new(client.clone(), "subsidy_dominance_30d".to_string()), - subsidy_dominance_1y: MetricPattern1::new(client.clone(), "subsidy_dominance_1y".to_string()), - subsidy_usd_1y_sma: CentsUsdPattern::new(client.clone(), "subsidy_usd_1y_sma".to_string()), + fee_dominance: BpsPercentRatioPattern::new(client.clone(), "fee_dominance".to_string()), + fee_dominance_rolling: _1m1w1y24hPattern2::new(client.clone(), "fee_dominance".to_string()), + subsidy_dominance: BpsPercentRatioPattern::new(client.clone(), "subsidy_dominance".to_string()), + subsidy_dominance_rolling: _1m1w1y24hPattern2::new(client.clone(), "subsidy_dominance".to_string()), + subsidy_sma_1y: CentsUsdPattern::new(client.clone(), "subsidy_sma_1y".to_string()), } } } @@ -3752,44 +3554,44 @@ impl MetricsTree_Mining_Rewards { /// Metrics tree node. pub struct MetricsTree_Mining_Hashrate { pub hash_rate: MetricPattern1, - pub hash_rate_1w_sma: MetricPattern1, - pub hash_rate_1m_sma: MetricPattern1, - pub hash_rate_2m_sma: MetricPattern1, - pub hash_rate_1y_sma: MetricPattern1, + pub hash_rate_sma_1w: MetricPattern1, + pub hash_rate_sma_1m: MetricPattern1, + pub hash_rate_sma_2m: MetricPattern1, + pub hash_rate_sma_1y: MetricPattern1, pub hash_rate_ath: MetricPattern1, - pub hash_rate_drawdown: MetricPattern1, + pub hash_rate_drawdown: BpsPercentRatioPattern, pub hash_price_ths: MetricPattern1, pub hash_price_ths_min: MetricPattern1, pub hash_price_phs: MetricPattern1, pub hash_price_phs_min: MetricPattern1, - pub hash_price_rebound: MetricPattern1, + pub hash_price_rebound: BpsPercentRatioPattern, pub hash_value_ths: MetricPattern1, pub hash_value_ths_min: MetricPattern1, pub hash_value_phs: MetricPattern1, pub hash_value_phs_min: MetricPattern1, - pub hash_value_rebound: MetricPattern1, + pub hash_value_rebound: BpsPercentRatioPattern, } impl MetricsTree_Mining_Hashrate { pub fn new(client: Arc, base_path: String) -> Self { Self { hash_rate: MetricPattern1::new(client.clone(), "hash_rate".to_string()), - hash_rate_1w_sma: MetricPattern1::new(client.clone(), "hash_rate_1w_sma".to_string()), - hash_rate_1m_sma: MetricPattern1::new(client.clone(), "hash_rate_1m_sma".to_string()), - hash_rate_2m_sma: MetricPattern1::new(client.clone(), "hash_rate_2m_sma".to_string()), - hash_rate_1y_sma: MetricPattern1::new(client.clone(), "hash_rate_1y_sma".to_string()), + hash_rate_sma_1w: MetricPattern1::new(client.clone(), "hash_rate_sma_1w".to_string()), + hash_rate_sma_1m: MetricPattern1::new(client.clone(), "hash_rate_sma_1m".to_string()), + hash_rate_sma_2m: MetricPattern1::new(client.clone(), "hash_rate_sma_2m".to_string()), + hash_rate_sma_1y: MetricPattern1::new(client.clone(), "hash_rate_sma_1y".to_string()), hash_rate_ath: MetricPattern1::new(client.clone(), "hash_rate_ath".to_string()), - hash_rate_drawdown: MetricPattern1::new(client.clone(), "hash_rate_drawdown".to_string()), + hash_rate_drawdown: BpsPercentRatioPattern::new(client.clone(), "hash_rate_drawdown".to_string()), hash_price_ths: MetricPattern1::new(client.clone(), "hash_price_ths".to_string()), hash_price_ths_min: MetricPattern1::new(client.clone(), "hash_price_ths_min".to_string()), hash_price_phs: MetricPattern1::new(client.clone(), "hash_price_phs".to_string()), hash_price_phs_min: MetricPattern1::new(client.clone(), "hash_price_phs_min".to_string()), - hash_price_rebound: MetricPattern1::new(client.clone(), "hash_price_rebound".to_string()), + hash_price_rebound: BpsPercentRatioPattern::new(client.clone(), "hash_price_rebound".to_string()), hash_value_ths: MetricPattern1::new(client.clone(), "hash_value_ths".to_string()), hash_value_ths_min: MetricPattern1::new(client.clone(), "hash_value_ths_min".to_string()), hash_value_phs: MetricPattern1::new(client.clone(), "hash_value_phs".to_string()), hash_value_phs_min: MetricPattern1::new(client.clone(), "hash_value_phs_min".to_string()), - hash_value_rebound: MetricPattern1::new(client.clone(), "hash_value_rebound".to_string()), + hash_value_rebound: BpsPercentRatioPattern::new(client.clone(), "hash_value_rebound".to_string()), } } } @@ -3913,50 +3715,50 @@ impl MetricsTree_Cointime_Cap { /// Metrics tree node. pub struct MetricsTree_Cointime_Pricing { pub vaulted_price: CentsSatsUsdPattern, - pub vaulted_price_ratio: RatioPattern, + pub vaulted_price_ratio: BpsRatioPattern2, pub active_price: CentsSatsUsdPattern, - pub active_price_ratio: RatioPattern, + pub active_price_ratio: BpsRatioPattern2, pub true_market_mean: CentsSatsUsdPattern, - pub true_market_mean_ratio: RatioPattern, + pub true_market_mean_ratio: BpsRatioPattern2, pub cointime_price: CentsSatsUsdPattern, - pub cointime_price_ratio: RatioPattern, + pub cointime_price_ratio: BpsRatioPattern2, } impl MetricsTree_Cointime_Pricing { pub fn new(client: Arc, base_path: String) -> Self { Self { vaulted_price: CentsSatsUsdPattern::new(client.clone(), "vaulted_price".to_string()), - vaulted_price_ratio: RatioPattern::new(client.clone(), "vaulted_price_ratio".to_string()), + vaulted_price_ratio: BpsRatioPattern2::new(client.clone(), "vaulted_price_ratio".to_string()), active_price: CentsSatsUsdPattern::new(client.clone(), "active_price".to_string()), - active_price_ratio: RatioPattern::new(client.clone(), "active_price_ratio".to_string()), + active_price_ratio: BpsRatioPattern2::new(client.clone(), "active_price_ratio".to_string()), true_market_mean: CentsSatsUsdPattern::new(client.clone(), "true_market_mean".to_string()), - true_market_mean_ratio: RatioPattern::new(client.clone(), "true_market_mean_ratio".to_string()), + true_market_mean_ratio: BpsRatioPattern2::new(client.clone(), "true_market_mean_ratio".to_string()), cointime_price: CentsSatsUsdPattern::new(client.clone(), "cointime_price".to_string()), - cointime_price_ratio: RatioPattern::new(client.clone(), "cointime_price_ratio".to_string()), + cointime_price_ratio: BpsRatioPattern2::new(client.clone(), "cointime_price_ratio".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Cointime_Adjusted { - pub cointime_adj_inflation_rate: MetricPattern1, - pub cointime_adj_tx_btc_velocity: MetricPattern1, - pub cointime_adj_tx_usd_velocity: MetricPattern1, + pub cointime_adj_inflation_rate: BpsPercentRatioPattern, + pub cointime_adj_tx_velocity_btc: MetricPattern1, + pub cointime_adj_tx_velocity_usd: MetricPattern1, } impl MetricsTree_Cointime_Adjusted { pub fn new(client: Arc, base_path: String) -> Self { Self { - cointime_adj_inflation_rate: MetricPattern1::new(client.clone(), "cointime_adj_inflation_rate".to_string()), - cointime_adj_tx_btc_velocity: MetricPattern1::new(client.clone(), "cointime_adj_tx_btc_velocity".to_string()), - cointime_adj_tx_usd_velocity: MetricPattern1::new(client.clone(), "cointime_adj_tx_usd_velocity".to_string()), + cointime_adj_inflation_rate: BpsPercentRatioPattern::new(client.clone(), "cointime_adj_inflation_rate".to_string()), + cointime_adj_tx_velocity_btc: MetricPattern1::new(client.clone(), "cointime_adj_tx_velocity_btc".to_string()), + cointime_adj_tx_velocity_usd: MetricPattern1::new(client.clone(), "cointime_adj_tx_velocity_usd".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Cointime_ReserveRisk { - pub vocdd_365d_median: MetricPattern18, + pub vocdd_median_1y: MetricPattern18, pub hodl_bank: MetricPattern18, pub reserve_risk: MetricPattern1, } @@ -3964,7 +3766,7 @@ pub struct MetricsTree_Cointime_ReserveRisk { impl MetricsTree_Cointime_ReserveRisk { pub fn new(client: Arc, base_path: String) -> Self { Self { - vocdd_365d_median: MetricPattern18::new(client.clone(), "vocdd_365d_median".to_string()), + vocdd_median_1y: MetricPattern18::new(client.clone(), "vocdd_median_1y".to_string()), hodl_bank: MetricPattern18::new(client.clone(), "hodl_bank".to_string()), reserve_risk: MetricPattern1::new(client.clone(), "reserve_risk".to_string()), } @@ -4621,22 +4423,22 @@ impl MetricsTree_Market { /// Metrics tree node. pub struct MetricsTree_Market_Ath { pub price_ath: CentsSatsUsdPattern, - pub price_drawdown: MetricPattern1, + pub price_drawdown: BpsPercentRatioPattern, pub days_since_price_ath: MetricPattern1, pub years_since_price_ath: MetricPattern2, - pub max_days_between_price_aths: MetricPattern1, - pub max_years_between_price_aths: MetricPattern2, + pub max_days_between_price_ath: MetricPattern1, + pub max_years_between_price_ath: MetricPattern2, } impl MetricsTree_Market_Ath { pub fn new(client: Arc, base_path: String) -> Self { Self { price_ath: CentsSatsUsdPattern::new(client.clone(), "price_ath".to_string()), - price_drawdown: MetricPattern1::new(client.clone(), "price_drawdown".to_string()), + price_drawdown: BpsPercentRatioPattern::new(client.clone(), "price_drawdown".to_string()), days_since_price_ath: MetricPattern1::new(client.clone(), "days_since_price_ath".to_string()), years_since_price_ath: MetricPattern2::new(client.clone(), "years_since_price_ath".to_string()), - max_days_between_price_aths: MetricPattern1::new(client.clone(), "max_days_between_price_aths".to_string()), - max_years_between_price_aths: MetricPattern2::new(client.clone(), "max_years_between_price_aths".to_string()), + max_days_between_price_ath: MetricPattern1::new(client.clone(), "max_days_between_price_ath".to_string()), + max_years_between_price_ath: MetricPattern2::new(client.clone(), "max_years_between_price_ath".to_string()), } } } @@ -4661,228 +4463,288 @@ pub struct MetricsTree_Market_Lookback { impl MetricsTree_Market_Lookback { pub fn new(client: Arc, base_path: String) -> Self { Self { - _24h: CentsSatsUsdPattern::new(client.clone(), "price_24h_ago".to_string()), - _1w: CentsSatsUsdPattern::new(client.clone(), "price_1w_ago".to_string()), - _1m: CentsSatsUsdPattern::new(client.clone(), "price_1m_ago".to_string()), - _3m: CentsSatsUsdPattern::new(client.clone(), "price_3m_ago".to_string()), - _6m: CentsSatsUsdPattern::new(client.clone(), "price_6m_ago".to_string()), - _1y: CentsSatsUsdPattern::new(client.clone(), "price_1y_ago".to_string()), - _2y: CentsSatsUsdPattern::new(client.clone(), "price_2y_ago".to_string()), - _3y: CentsSatsUsdPattern::new(client.clone(), "price_3y_ago".to_string()), - _4y: CentsSatsUsdPattern::new(client.clone(), "price_4y_ago".to_string()), - _5y: CentsSatsUsdPattern::new(client.clone(), "price_5y_ago".to_string()), - _6y: CentsSatsUsdPattern::new(client.clone(), "price_6y_ago".to_string()), - _8y: CentsSatsUsdPattern::new(client.clone(), "price_8y_ago".to_string()), - _10y: CentsSatsUsdPattern::new(client.clone(), "price_10y_ago".to_string()), + _24h: CentsSatsUsdPattern::new(client.clone(), "price_lookback_24h".to_string()), + _1w: CentsSatsUsdPattern::new(client.clone(), "price_lookback_1w".to_string()), + _1m: CentsSatsUsdPattern::new(client.clone(), "price_lookback_1m".to_string()), + _3m: CentsSatsUsdPattern::new(client.clone(), "price_lookback_3m".to_string()), + _6m: CentsSatsUsdPattern::new(client.clone(), "price_lookback_6m".to_string()), + _1y: CentsSatsUsdPattern::new(client.clone(), "price_lookback_1y".to_string()), + _2y: CentsSatsUsdPattern::new(client.clone(), "price_lookback_2y".to_string()), + _3y: CentsSatsUsdPattern::new(client.clone(), "price_lookback_3y".to_string()), + _4y: CentsSatsUsdPattern::new(client.clone(), "price_lookback_4y".to_string()), + _5y: CentsSatsUsdPattern::new(client.clone(), "price_lookback_5y".to_string()), + _6y: CentsSatsUsdPattern::new(client.clone(), "price_lookback_6y".to_string()), + _8y: CentsSatsUsdPattern::new(client.clone(), "price_lookback_8y".to_string()), + _10y: CentsSatsUsdPattern::new(client.clone(), "price_lookback_10y".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Market_Returns { - pub price_returns: MetricsTree_Market_Returns_PriceReturns, - pub cagr: _10y2y3y4y5y6y8yPattern, - pub _1d_returns_1w_sd: SdSmaPattern, - pub _1d_returns_1m_sd: SdSmaPattern, - pub _1d_returns_1y_sd: SdSmaPattern, - pub downside_returns: MetricPattern18, - pub downside_1w_sd: SdSmaPattern, - pub downside_1m_sd: SdSmaPattern, - pub downside_1y_sd: SdSmaPattern, + pub price_return: MetricsTree_Market_Returns_PriceReturn, + pub price_cagr: _10y2y3y4y5y6y8yPattern, + pub price_return_24h_sd_1w: MetricsTree_Market_Returns_PriceReturn24hSd1w, + pub price_return_24h_sd_1m: MetricsTree_Market_Returns_PriceReturn24hSd1m, + pub price_return_24h_sd_1y: SdSmaPattern, + pub price_downside_24h: MetricPattern18, + pub price_downside_24h_sd_1w: MetricsTree_Market_Returns_PriceDownside24hSd1w, + pub price_downside_24h_sd_1m: MetricsTree_Market_Returns_PriceDownside24hSd1m, + pub price_downside_24h_sd_1y: SdSmaPattern, } impl MetricsTree_Market_Returns { pub fn new(client: Arc, base_path: String) -> Self { Self { - price_returns: MetricsTree_Market_Returns_PriceReturns::new(client.clone(), format!("{base_path}_price_returns")), - cagr: _10y2y3y4y5y6y8yPattern::new(client.clone(), "cagr".to_string()), - _1d_returns_1w_sd: SdSmaPattern::new(client.clone(), "1d_returns_1w_sd".to_string()), - _1d_returns_1m_sd: SdSmaPattern::new(client.clone(), "1d_returns_1m_sd".to_string()), - _1d_returns_1y_sd: SdSmaPattern::new(client.clone(), "1d_returns_1y_sd".to_string()), - downside_returns: MetricPattern18::new(client.clone(), "downside_returns".to_string()), - downside_1w_sd: SdSmaPattern::new(client.clone(), "downside_1w_sd".to_string()), - downside_1m_sd: SdSmaPattern::new(client.clone(), "downside_1m_sd".to_string()), - downside_1y_sd: SdSmaPattern::new(client.clone(), "downside_1y_sd".to_string()), + price_return: MetricsTree_Market_Returns_PriceReturn::new(client.clone(), format!("{base_path}_price_return")), + price_cagr: _10y2y3y4y5y6y8yPattern::new(client.clone(), "price_cagr".to_string()), + price_return_24h_sd_1w: MetricsTree_Market_Returns_PriceReturn24hSd1w::new(client.clone(), format!("{base_path}_price_return_24h_sd_1w")), + price_return_24h_sd_1m: MetricsTree_Market_Returns_PriceReturn24hSd1m::new(client.clone(), format!("{base_path}_price_return_24h_sd_1m")), + price_return_24h_sd_1y: SdSmaPattern::new(client.clone(), "price_return_24h".to_string()), + price_downside_24h: MetricPattern18::new(client.clone(), "price_downside_24h".to_string()), + price_downside_24h_sd_1w: MetricsTree_Market_Returns_PriceDownside24hSd1w::new(client.clone(), format!("{base_path}_price_downside_24h_sd_1w")), + price_downside_24h_sd_1m: MetricsTree_Market_Returns_PriceDownside24hSd1m::new(client.clone(), format!("{base_path}_price_downside_24h_sd_1m")), + price_downside_24h_sd_1y: SdSmaPattern::new(client.clone(), "price_downside_24h".to_string()), } } } /// Metrics tree node. -pub struct MetricsTree_Market_Returns_PriceReturns { - pub _24h: MetricPattern1, - pub _1w: MetricPattern1, - pub _1m: MetricPattern1, - pub _3m: MetricPattern1, - pub _6m: MetricPattern1, - pub _1y: MetricPattern1, - pub _2y: MetricPattern1, - pub _3y: MetricPattern1, - pub _4y: MetricPattern1, - pub _5y: MetricPattern1, - pub _6y: MetricPattern1, - pub _8y: MetricPattern1, - pub _10y: MetricPattern1, +pub struct MetricsTree_Market_Returns_PriceReturn { + pub _24h: BpsPercentRatioPattern, + pub _1w: BpsPercentRatioPattern, + pub _1m: BpsPercentRatioPattern, + pub _3m: BpsPercentRatioPattern, + pub _6m: BpsPercentRatioPattern, + pub _1y: BpsPercentRatioPattern, + pub _2y: BpsPercentRatioPattern, + pub _3y: BpsPercentRatioPattern, + pub _4y: BpsPercentRatioPattern, + pub _5y: BpsPercentRatioPattern, + pub _6y: BpsPercentRatioPattern, + pub _8y: BpsPercentRatioPattern, + pub _10y: BpsPercentRatioPattern, } -impl MetricsTree_Market_Returns_PriceReturns { +impl MetricsTree_Market_Returns_PriceReturn { pub fn new(client: Arc, base_path: String) -> Self { Self { - _24h: MetricPattern1::new(client.clone(), "24h_price_returns".to_string()), - _1w: MetricPattern1::new(client.clone(), "1w_price_returns".to_string()), - _1m: MetricPattern1::new(client.clone(), "1m_price_returns".to_string()), - _3m: MetricPattern1::new(client.clone(), "3m_price_returns".to_string()), - _6m: MetricPattern1::new(client.clone(), "6m_price_returns".to_string()), - _1y: MetricPattern1::new(client.clone(), "1y_price_returns".to_string()), - _2y: MetricPattern1::new(client.clone(), "2y_price_returns".to_string()), - _3y: MetricPattern1::new(client.clone(), "3y_price_returns".to_string()), - _4y: MetricPattern1::new(client.clone(), "4y_price_returns".to_string()), - _5y: MetricPattern1::new(client.clone(), "5y_price_returns".to_string()), - _6y: MetricPattern1::new(client.clone(), "6y_price_returns".to_string()), - _8y: MetricPattern1::new(client.clone(), "8y_price_returns".to_string()), - _10y: MetricPattern1::new(client.clone(), "10y_price_returns".to_string()), + _24h: BpsPercentRatioPattern::new(client.clone(), "price_return_24h".to_string()), + _1w: BpsPercentRatioPattern::new(client.clone(), "price_return_1w".to_string()), + _1m: BpsPercentRatioPattern::new(client.clone(), "price_return_1m".to_string()), + _3m: BpsPercentRatioPattern::new(client.clone(), "price_return_3m".to_string()), + _6m: BpsPercentRatioPattern::new(client.clone(), "price_return_6m".to_string()), + _1y: BpsPercentRatioPattern::new(client.clone(), "price_return_1y".to_string()), + _2y: BpsPercentRatioPattern::new(client.clone(), "price_return_2y".to_string()), + _3y: BpsPercentRatioPattern::new(client.clone(), "price_return_3y".to_string()), + _4y: BpsPercentRatioPattern::new(client.clone(), "price_return_4y".to_string()), + _5y: BpsPercentRatioPattern::new(client.clone(), "price_return_5y".to_string()), + _6y: BpsPercentRatioPattern::new(client.clone(), "price_return_6y".to_string()), + _8y: BpsPercentRatioPattern::new(client.clone(), "price_return_8y".to_string()), + _10y: BpsPercentRatioPattern::new(client.clone(), "price_return_10y".to_string()), + } + } +} + +/// Metrics tree node. +pub struct MetricsTree_Market_Returns_PriceReturn24hSd1w { + pub sma: MetricPattern1, + pub sd: MetricPattern1, +} + +impl MetricsTree_Market_Returns_PriceReturn24hSd1w { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + sma: MetricPattern1::new(client.clone(), "price_return_24h_sma_1w".to_string()), + sd: MetricPattern1::new(client.clone(), "price_return_24h_sd_1w".to_string()), + } + } +} + +/// Metrics tree node. +pub struct MetricsTree_Market_Returns_PriceReturn24hSd1m { + pub sma: MetricPattern1, + pub sd: MetricPattern1, +} + +impl MetricsTree_Market_Returns_PriceReturn24hSd1m { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + sma: MetricPattern1::new(client.clone(), "price_return_24h_sma_1m".to_string()), + sd: MetricPattern1::new(client.clone(), "price_return_24h_sd_1m".to_string()), + } + } +} + +/// Metrics tree node. +pub struct MetricsTree_Market_Returns_PriceDownside24hSd1w { + pub sma: MetricPattern1, + pub sd: MetricPattern1, +} + +impl MetricsTree_Market_Returns_PriceDownside24hSd1w { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + sma: MetricPattern1::new(client.clone(), "price_downside_24h_sma_1w".to_string()), + sd: MetricPattern1::new(client.clone(), "price_downside_24h_sd_1w".to_string()), + } + } +} + +/// Metrics tree node. +pub struct MetricsTree_Market_Returns_PriceDownside24hSd1m { + pub sma: MetricPattern1, + pub sd: MetricPattern1, +} + +impl MetricsTree_Market_Returns_PriceDownside24hSd1m { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + sma: MetricPattern1::new(client.clone(), "price_downside_24h_sma_1m".to_string()), + sd: MetricPattern1::new(client.clone(), "price_downside_24h_sd_1m".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Market_Volatility { - pub price_1w_volatility: MetricPattern1, - pub price_1m_volatility: MetricPattern1, - pub price_1y_volatility: MetricPattern1, - pub sharpe_1w: MetricPattern1, - pub sharpe_1m: MetricPattern1, - pub sharpe_1y: MetricPattern1, - pub sortino_1w: MetricPattern1, - pub sortino_1m: MetricPattern1, - pub sortino_1y: MetricPattern1, + pub price_volatility_1w: MetricPattern1, + pub price_volatility_1m: MetricPattern1, + pub price_volatility_1y: MetricPattern1, + pub price_sharpe_1w: MetricPattern1, + pub price_sharpe_1m: MetricPattern1, + pub price_sharpe_1y: MetricPattern1, + pub price_sortino_1w: MetricPattern1, + pub price_sortino_1m: MetricPattern1, + pub price_sortino_1y: MetricPattern1, } impl MetricsTree_Market_Volatility { pub fn new(client: Arc, base_path: String) -> Self { Self { - 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: 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()), + price_volatility_1w: MetricPattern1::new(client.clone(), "price_volatility_1w".to_string()), + price_volatility_1m: MetricPattern1::new(client.clone(), "price_volatility_1m".to_string()), + price_volatility_1y: MetricPattern1::new(client.clone(), "price_volatility_1y".to_string()), + price_sharpe_1w: MetricPattern1::new(client.clone(), "price_sharpe_1w".to_string()), + price_sharpe_1m: MetricPattern1::new(client.clone(), "price_sharpe_1m".to_string()), + price_sharpe_1y: MetricPattern1::new(client.clone(), "price_sharpe_1y".to_string()), + price_sortino_1w: MetricPattern1::new(client.clone(), "price_sortino_1w".to_string()), + price_sortino_1m: MetricPattern1::new(client.clone(), "price_sortino_1m".to_string()), + price_sortino_1y: MetricPattern1::new(client.clone(), "price_sortino_1y".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Market_Range { - pub price_1w_min: CentsSatsUsdPattern, - pub price_1w_max: CentsSatsUsdPattern, - pub price_2w_min: CentsSatsUsdPattern, - pub price_2w_max: CentsSatsUsdPattern, - pub price_1m_min: CentsSatsUsdPattern, - pub price_1m_max: CentsSatsUsdPattern, - pub price_1y_min: CentsSatsUsdPattern, - pub price_1y_max: CentsSatsUsdPattern, + pub price_min_1w: CentsSatsUsdPattern, + pub price_max_1w: CentsSatsUsdPattern, + pub price_min_2w: CentsSatsUsdPattern, + pub price_max_2w: CentsSatsUsdPattern, + pub price_min_1m: CentsSatsUsdPattern, + pub price_max_1m: CentsSatsUsdPattern, + pub price_min_1y: CentsSatsUsdPattern, + pub price_max_1y: CentsSatsUsdPattern, pub price_true_range: MetricPattern1, - pub price_true_range_2w_sum: MetricPattern1, - pub price_2w_choppiness_index: MetricPattern1, + pub price_true_range_sum_2w: MetricPattern1, + pub price_choppiness_index_2w: BpsPercentRatioPattern, } impl MetricsTree_Market_Range { pub fn new(client: Arc, base_path: String) -> Self { Self { - price_1w_min: CentsSatsUsdPattern::new(client.clone(), "price_1w_min".to_string()), - price_1w_max: CentsSatsUsdPattern::new(client.clone(), "price_1w_max".to_string()), - price_2w_min: CentsSatsUsdPattern::new(client.clone(), "price_2w_min".to_string()), - price_2w_max: CentsSatsUsdPattern::new(client.clone(), "price_2w_max".to_string()), - price_1m_min: CentsSatsUsdPattern::new(client.clone(), "price_1m_min".to_string()), - price_1m_max: CentsSatsUsdPattern::new(client.clone(), "price_1m_max".to_string()), - price_1y_min: CentsSatsUsdPattern::new(client.clone(), "price_1y_min".to_string()), - price_1y_max: CentsSatsUsdPattern::new(client.clone(), "price_1y_max".to_string()), + price_min_1w: CentsSatsUsdPattern::new(client.clone(), "price_min_1w".to_string()), + price_max_1w: CentsSatsUsdPattern::new(client.clone(), "price_max_1w".to_string()), + price_min_2w: CentsSatsUsdPattern::new(client.clone(), "price_min_2w".to_string()), + price_max_2w: CentsSatsUsdPattern::new(client.clone(), "price_max_2w".to_string()), + price_min_1m: CentsSatsUsdPattern::new(client.clone(), "price_min_1m".to_string()), + price_max_1m: CentsSatsUsdPattern::new(client.clone(), "price_max_1m".to_string()), + price_min_1y: CentsSatsUsdPattern::new(client.clone(), "price_min_1y".to_string()), + price_max_1y: CentsSatsUsdPattern::new(client.clone(), "price_max_1y".to_string()), price_true_range: MetricPattern1::new(client.clone(), "price_true_range".to_string()), - price_true_range_2w_sum: MetricPattern1::new(client.clone(), "price_true_range_2w_sum".to_string()), - price_2w_choppiness_index: MetricPattern1::new(client.clone(), "price_2w_choppiness_index".to_string()), + price_true_range_sum_2w: MetricPattern1::new(client.clone(), "price_true_range_sum_2w".to_string()), + price_choppiness_index_2w: BpsPercentRatioPattern::new(client.clone(), "price_choppiness_index_2w".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Market_MovingAverage { - pub price_1w_sma: PriceRatioPattern, - pub price_8d_sma: PriceRatioPattern, - pub price_13d_sma: PriceRatioPattern, - pub price_21d_sma: PriceRatioPattern, - pub price_1m_sma: PriceRatioPattern, - pub price_34d_sma: PriceRatioPattern, - pub price_55d_sma: PriceRatioPattern, - pub price_89d_sma: PriceRatioPattern, - pub price_111d_sma: PriceRatioPattern, - pub price_144d_sma: PriceRatioPattern, - pub price_200d_sma: PriceRatioPattern, - pub price_350d_sma: PriceRatioPattern, - pub price_1y_sma: PriceRatioPattern, - pub price_2y_sma: PriceRatioPattern, - pub price_200w_sma: PriceRatioPattern, - pub price_4y_sma: PriceRatioPattern, - pub price_1w_ema: PriceRatioPattern, - pub price_8d_ema: PriceRatioPattern, - pub price_12d_ema: PriceRatioPattern, - pub price_13d_ema: PriceRatioPattern, - pub price_21d_ema: PriceRatioPattern, - pub price_26d_ema: PriceRatioPattern, - pub price_1m_ema: PriceRatioPattern, - pub price_34d_ema: PriceRatioPattern, - pub price_55d_ema: PriceRatioPattern, - pub price_89d_ema: PriceRatioPattern, - pub price_144d_ema: PriceRatioPattern, - pub price_200d_ema: PriceRatioPattern, - pub price_1y_ema: PriceRatioPattern, - pub price_2y_ema: PriceRatioPattern, - pub price_200w_ema: PriceRatioPattern, - pub price_4y_ema: PriceRatioPattern, - pub price_200d_sma_x2_4: CentsSatsUsdPattern, - pub price_200d_sma_x0_8: CentsSatsUsdPattern, - pub price_350d_sma_x2: CentsSatsUsdPattern, + pub price_sma_1w: BpsPriceRatioPattern, + pub price_sma_8d: BpsPriceRatioPattern, + pub price_sma_13d: BpsPriceRatioPattern, + pub price_sma_21d: BpsPriceRatioPattern, + pub price_sma_1m: BpsPriceRatioPattern, + pub price_sma_34d: BpsPriceRatioPattern, + pub price_sma_55d: BpsPriceRatioPattern, + pub price_sma_89d: BpsPriceRatioPattern, + pub price_sma_111d: BpsPriceRatioPattern, + pub price_sma_144d: BpsPriceRatioPattern, + pub price_sma_200d: BpsPriceRatioPattern, + pub price_sma_350d: BpsPriceRatioPattern, + pub price_sma_1y: BpsPriceRatioPattern, + pub price_sma_2y: BpsPriceRatioPattern, + pub price_sma_200w: BpsPriceRatioPattern, + pub price_sma_4y: BpsPriceRatioPattern, + pub price_ema_1w: BpsPriceRatioPattern, + pub price_ema_8d: BpsPriceRatioPattern, + pub price_ema_12d: BpsPriceRatioPattern, + pub price_ema_13d: BpsPriceRatioPattern, + pub price_ema_21d: BpsPriceRatioPattern, + pub price_ema_26d: BpsPriceRatioPattern, + pub price_ema_1m: BpsPriceRatioPattern, + pub price_ema_34d: BpsPriceRatioPattern, + pub price_ema_55d: BpsPriceRatioPattern, + pub price_ema_89d: BpsPriceRatioPattern, + pub price_ema_144d: BpsPriceRatioPattern, + pub price_ema_200d: BpsPriceRatioPattern, + pub price_ema_1y: BpsPriceRatioPattern, + pub price_ema_2y: BpsPriceRatioPattern, + pub price_ema_200w: BpsPriceRatioPattern, + pub price_ema_4y: BpsPriceRatioPattern, + pub price_sma_200d_x2_4: CentsSatsUsdPattern, + pub price_sma_200d_x0_8: CentsSatsUsdPattern, + pub price_sma_350d_x2: CentsSatsUsdPattern, } impl MetricsTree_Market_MovingAverage { pub fn new(client: Arc, base_path: String) -> Self { Self { - price_1w_sma: PriceRatioPattern::new(client.clone(), "price_1w_sma".to_string()), - price_8d_sma: PriceRatioPattern::new(client.clone(), "price_8d_sma".to_string()), - price_13d_sma: PriceRatioPattern::new(client.clone(), "price_13d_sma".to_string()), - price_21d_sma: PriceRatioPattern::new(client.clone(), "price_21d_sma".to_string()), - price_1m_sma: PriceRatioPattern::new(client.clone(), "price_1m_sma".to_string()), - price_34d_sma: PriceRatioPattern::new(client.clone(), "price_34d_sma".to_string()), - price_55d_sma: PriceRatioPattern::new(client.clone(), "price_55d_sma".to_string()), - price_89d_sma: PriceRatioPattern::new(client.clone(), "price_89d_sma".to_string()), - price_111d_sma: PriceRatioPattern::new(client.clone(), "price_111d_sma".to_string()), - price_144d_sma: PriceRatioPattern::new(client.clone(), "price_144d_sma".to_string()), - price_200d_sma: PriceRatioPattern::new(client.clone(), "price_200d_sma".to_string()), - price_350d_sma: PriceRatioPattern::new(client.clone(), "price_350d_sma".to_string()), - price_1y_sma: PriceRatioPattern::new(client.clone(), "price_1y_sma".to_string()), - price_2y_sma: PriceRatioPattern::new(client.clone(), "price_2y_sma".to_string()), - price_200w_sma: PriceRatioPattern::new(client.clone(), "price_200w_sma".to_string()), - price_4y_sma: PriceRatioPattern::new(client.clone(), "price_4y_sma".to_string()), - price_1w_ema: PriceRatioPattern::new(client.clone(), "price_1w_ema".to_string()), - price_8d_ema: PriceRatioPattern::new(client.clone(), "price_8d_ema".to_string()), - price_12d_ema: PriceRatioPattern::new(client.clone(), "price_12d_ema".to_string()), - price_13d_ema: PriceRatioPattern::new(client.clone(), "price_13d_ema".to_string()), - price_21d_ema: PriceRatioPattern::new(client.clone(), "price_21d_ema".to_string()), - price_26d_ema: PriceRatioPattern::new(client.clone(), "price_26d_ema".to_string()), - price_1m_ema: PriceRatioPattern::new(client.clone(), "price_1m_ema".to_string()), - price_34d_ema: PriceRatioPattern::new(client.clone(), "price_34d_ema".to_string()), - price_55d_ema: PriceRatioPattern::new(client.clone(), "price_55d_ema".to_string()), - price_89d_ema: PriceRatioPattern::new(client.clone(), "price_89d_ema".to_string()), - price_144d_ema: PriceRatioPattern::new(client.clone(), "price_144d_ema".to_string()), - price_200d_ema: PriceRatioPattern::new(client.clone(), "price_200d_ema".to_string()), - price_1y_ema: PriceRatioPattern::new(client.clone(), "price_1y_ema".to_string()), - price_2y_ema: PriceRatioPattern::new(client.clone(), "price_2y_ema".to_string()), - price_200w_ema: PriceRatioPattern::new(client.clone(), "price_200w_ema".to_string()), - price_4y_ema: PriceRatioPattern::new(client.clone(), "price_4y_ema".to_string()), - price_200d_sma_x2_4: CentsSatsUsdPattern::new(client.clone(), "price_200d_sma_x2_4".to_string()), - price_200d_sma_x0_8: CentsSatsUsdPattern::new(client.clone(), "price_200d_sma_x0_8".to_string()), - price_350d_sma_x2: CentsSatsUsdPattern::new(client.clone(), "price_350d_sma_x2".to_string()), + price_sma_1w: BpsPriceRatioPattern::new(client.clone(), "price_sma_1w".to_string()), + price_sma_8d: BpsPriceRatioPattern::new(client.clone(), "price_sma_8d".to_string()), + price_sma_13d: BpsPriceRatioPattern::new(client.clone(), "price_sma_13d".to_string()), + price_sma_21d: BpsPriceRatioPattern::new(client.clone(), "price_sma_21d".to_string()), + price_sma_1m: BpsPriceRatioPattern::new(client.clone(), "price_sma_1m".to_string()), + price_sma_34d: BpsPriceRatioPattern::new(client.clone(), "price_sma_34d".to_string()), + price_sma_55d: BpsPriceRatioPattern::new(client.clone(), "price_sma_55d".to_string()), + price_sma_89d: BpsPriceRatioPattern::new(client.clone(), "price_sma_89d".to_string()), + price_sma_111d: BpsPriceRatioPattern::new(client.clone(), "price_sma_111d".to_string()), + price_sma_144d: BpsPriceRatioPattern::new(client.clone(), "price_sma_144d".to_string()), + price_sma_200d: BpsPriceRatioPattern::new(client.clone(), "price_sma_200d".to_string()), + price_sma_350d: BpsPriceRatioPattern::new(client.clone(), "price_sma_350d".to_string()), + price_sma_1y: BpsPriceRatioPattern::new(client.clone(), "price_sma_1y".to_string()), + price_sma_2y: BpsPriceRatioPattern::new(client.clone(), "price_sma_2y".to_string()), + price_sma_200w: BpsPriceRatioPattern::new(client.clone(), "price_sma_200w".to_string()), + price_sma_4y: BpsPriceRatioPattern::new(client.clone(), "price_sma_4y".to_string()), + price_ema_1w: BpsPriceRatioPattern::new(client.clone(), "price_ema_1w".to_string()), + price_ema_8d: BpsPriceRatioPattern::new(client.clone(), "price_ema_8d".to_string()), + price_ema_12d: BpsPriceRatioPattern::new(client.clone(), "price_ema_12d".to_string()), + price_ema_13d: BpsPriceRatioPattern::new(client.clone(), "price_ema_13d".to_string()), + price_ema_21d: BpsPriceRatioPattern::new(client.clone(), "price_ema_21d".to_string()), + price_ema_26d: BpsPriceRatioPattern::new(client.clone(), "price_ema_26d".to_string()), + price_ema_1m: BpsPriceRatioPattern::new(client.clone(), "price_ema_1m".to_string()), + price_ema_34d: BpsPriceRatioPattern::new(client.clone(), "price_ema_34d".to_string()), + price_ema_55d: BpsPriceRatioPattern::new(client.clone(), "price_ema_55d".to_string()), + price_ema_89d: BpsPriceRatioPattern::new(client.clone(), "price_ema_89d".to_string()), + price_ema_144d: BpsPriceRatioPattern::new(client.clone(), "price_ema_144d".to_string()), + price_ema_200d: BpsPriceRatioPattern::new(client.clone(), "price_ema_200d".to_string()), + price_ema_1y: BpsPriceRatioPattern::new(client.clone(), "price_ema_1y".to_string()), + price_ema_2y: BpsPriceRatioPattern::new(client.clone(), "price_ema_2y".to_string()), + price_ema_200w: BpsPriceRatioPattern::new(client.clone(), "price_ema_200w".to_string()), + price_ema_4y: BpsPriceRatioPattern::new(client.clone(), "price_ema_4y".to_string()), + price_sma_200d_x2_4: CentsSatsUsdPattern::new(client.clone(), "price_sma_200d_x2_4".to_string()), + price_sma_200d_x0_8: CentsSatsUsdPattern::new(client.clone(), "price_sma_200d_x0_8".to_string()), + price_sma_350d_x2: CentsSatsUsdPattern::new(client.clone(), "price_sma_350d_x2".to_string()), } } } @@ -4891,14 +4753,14 @@ impl MetricsTree_Market_MovingAverage { pub struct MetricsTree_Market_Dca { pub dca_sats_per_day: MetricPattern18, pub period_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3, - pub period_average_price: MetricsTree_Market_Dca_PeriodAveragePrice, - pub period_returns: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2, + pub period_cost_basis: MetricsTree_Market_Dca_PeriodCostBasis, + pub period_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2, pub period_cagr: _10y2y3y4y5y6y8yPattern, pub period_lump_sum_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3, - pub period_lump_sum_returns: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2, + pub period_lump_sum_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2, pub class_stack: MetricsTree_Market_Dca_ClassStack, - pub class_average_price: MetricsTree_Market_Dca_ClassAveragePrice, - pub class_returns: MetricsTree_Market_Dca_ClassReturns, + pub class_cost_basis: MetricsTree_Market_Dca_ClassCostBasis, + pub class_return: MetricsTree_Market_Dca_ClassReturn, } impl MetricsTree_Market_Dca { @@ -4906,20 +4768,20 @@ impl MetricsTree_Market_Dca { Self { dca_sats_per_day: MetricPattern18::new(client.clone(), "dca_sats_per_day".to_string()), period_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3::new(client.clone(), "dca_stack".to_string()), - period_average_price: MetricsTree_Market_Dca_PeriodAveragePrice::new(client.clone(), format!("{base_path}_period_average_price")), - period_returns: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2::new(client.clone(), "dca_returns".to_string()), + period_cost_basis: MetricsTree_Market_Dca_PeriodCostBasis::new(client.clone(), format!("{base_path}_period_cost_basis")), + period_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2::new(client.clone(), "dca_return".to_string()), period_cagr: _10y2y3y4y5y6y8yPattern::new(client.clone(), "dca_cagr".to_string()), period_lump_sum_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3::new(client.clone(), "lump_sum_stack".to_string()), - period_lump_sum_returns: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2::new(client.clone(), "lump_sum_returns".to_string()), + period_lump_sum_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2::new(client.clone(), "lump_sum_return".to_string()), class_stack: MetricsTree_Market_Dca_ClassStack::new(client.clone(), format!("{base_path}_class_stack")), - class_average_price: MetricsTree_Market_Dca_ClassAveragePrice::new(client.clone(), format!("{base_path}_class_average_price")), - class_returns: MetricsTree_Market_Dca_ClassReturns::new(client.clone(), format!("{base_path}_class_returns")), + class_cost_basis: MetricsTree_Market_Dca_ClassCostBasis::new(client.clone(), format!("{base_path}_class_cost_basis")), + class_return: MetricsTree_Market_Dca_ClassReturn::new(client.clone(), format!("{base_path}_class_return")), } } } /// Metrics tree node. -pub struct MetricsTree_Market_Dca_PeriodAveragePrice { +pub struct MetricsTree_Market_Dca_PeriodCostBasis { pub _1w: CentsSatsUsdPattern, pub _1m: CentsSatsUsdPattern, pub _3m: CentsSatsUsdPattern, @@ -4934,203 +4796,172 @@ pub struct MetricsTree_Market_Dca_PeriodAveragePrice { pub _10y: CentsSatsUsdPattern, } -impl MetricsTree_Market_Dca_PeriodAveragePrice { +impl MetricsTree_Market_Dca_PeriodCostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1w: CentsSatsUsdPattern::new(client.clone(), "1w_dca_average_price".to_string()), - _1m: CentsSatsUsdPattern::new(client.clone(), "1m_dca_average_price".to_string()), - _3m: CentsSatsUsdPattern::new(client.clone(), "3m_dca_average_price".to_string()), - _6m: CentsSatsUsdPattern::new(client.clone(), "6m_dca_average_price".to_string()), - _1y: CentsSatsUsdPattern::new(client.clone(), "1y_dca_average_price".to_string()), - _2y: CentsSatsUsdPattern::new(client.clone(), "2y_dca_average_price".to_string()), - _3y: CentsSatsUsdPattern::new(client.clone(), "3y_dca_average_price".to_string()), - _4y: CentsSatsUsdPattern::new(client.clone(), "4y_dca_average_price".to_string()), - _5y: CentsSatsUsdPattern::new(client.clone(), "5y_dca_average_price".to_string()), - _6y: CentsSatsUsdPattern::new(client.clone(), "6y_dca_average_price".to_string()), - _8y: CentsSatsUsdPattern::new(client.clone(), "8y_dca_average_price".to_string()), - _10y: CentsSatsUsdPattern::new(client.clone(), "10y_dca_average_price".to_string()), + _1w: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_1w".to_string()), + _1m: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_1m".to_string()), + _3m: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_3m".to_string()), + _6m: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_6m".to_string()), + _1y: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_1y".to_string()), + _2y: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_2y".to_string()), + _3y: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_3y".to_string()), + _4y: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_4y".to_string()), + _5y: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_5y".to_string()), + _6y: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_6y".to_string()), + _8y: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_8y".to_string()), + _10y: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_10y".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Market_Dca_ClassStack { - pub _2015: BtcCentsSatsUsdPattern, - pub _2016: BtcCentsSatsUsdPattern, - pub _2017: BtcCentsSatsUsdPattern, - pub _2018: BtcCentsSatsUsdPattern, - pub _2019: BtcCentsSatsUsdPattern, - pub _2020: BtcCentsSatsUsdPattern, - pub _2021: BtcCentsSatsUsdPattern, - pub _2022: BtcCentsSatsUsdPattern, - pub _2023: BtcCentsSatsUsdPattern, - pub _2024: BtcCentsSatsUsdPattern, - pub _2025: BtcCentsSatsUsdPattern, - pub _2026: BtcCentsSatsUsdPattern, + pub from_2015: BtcCentsSatsUsdPattern, + pub from_2016: BtcCentsSatsUsdPattern, + pub from_2017: BtcCentsSatsUsdPattern, + pub from_2018: BtcCentsSatsUsdPattern, + pub from_2019: BtcCentsSatsUsdPattern, + pub from_2020: BtcCentsSatsUsdPattern, + pub from_2021: BtcCentsSatsUsdPattern, + pub from_2022: BtcCentsSatsUsdPattern, + pub from_2023: BtcCentsSatsUsdPattern, + pub from_2024: BtcCentsSatsUsdPattern, + pub from_2025: BtcCentsSatsUsdPattern, + pub from_2026: BtcCentsSatsUsdPattern, } impl MetricsTree_Market_Dca_ClassStack { pub fn new(client: Arc, base_path: String) -> Self { Self { - _2015: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2015_stack".to_string()), - _2016: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2016_stack".to_string()), - _2017: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2017_stack".to_string()), - _2018: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2018_stack".to_string()), - _2019: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2019_stack".to_string()), - _2020: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2020_stack".to_string()), - _2021: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2021_stack".to_string()), - _2022: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2022_stack".to_string()), - _2023: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2023_stack".to_string()), - _2024: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2024_stack".to_string()), - _2025: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2025_stack".to_string()), - _2026: BtcCentsSatsUsdPattern::new(client.clone(), "dca_class_2026_stack".to_string()), + from_2015: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2015".to_string()), + from_2016: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2016".to_string()), + from_2017: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2017".to_string()), + from_2018: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2018".to_string()), + from_2019: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2019".to_string()), + from_2020: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2020".to_string()), + from_2021: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2021".to_string()), + from_2022: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2022".to_string()), + from_2023: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2023".to_string()), + from_2024: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2024".to_string()), + from_2025: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2025".to_string()), + from_2026: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2026".to_string()), } } } /// Metrics tree node. -pub struct MetricsTree_Market_Dca_ClassAveragePrice { - pub _2015: CentsSatsUsdPattern, - pub _2016: CentsSatsUsdPattern, - pub _2017: CentsSatsUsdPattern, - pub _2018: CentsSatsUsdPattern, - pub _2019: CentsSatsUsdPattern, - pub _2020: CentsSatsUsdPattern, - pub _2021: CentsSatsUsdPattern, - pub _2022: CentsSatsUsdPattern, - pub _2023: CentsSatsUsdPattern, - pub _2024: CentsSatsUsdPattern, - pub _2025: CentsSatsUsdPattern, - pub _2026: CentsSatsUsdPattern, +pub struct MetricsTree_Market_Dca_ClassCostBasis { + pub from_2015: CentsSatsUsdPattern, + pub from_2016: CentsSatsUsdPattern, + pub from_2017: CentsSatsUsdPattern, + pub from_2018: CentsSatsUsdPattern, + pub from_2019: CentsSatsUsdPattern, + pub from_2020: CentsSatsUsdPattern, + pub from_2021: CentsSatsUsdPattern, + pub from_2022: CentsSatsUsdPattern, + pub from_2023: CentsSatsUsdPattern, + pub from_2024: CentsSatsUsdPattern, + pub from_2025: CentsSatsUsdPattern, + pub from_2026: CentsSatsUsdPattern, } -impl MetricsTree_Market_Dca_ClassAveragePrice { +impl MetricsTree_Market_Dca_ClassCostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { - _2015: CentsSatsUsdPattern::new(client.clone(), "dca_class_2015_average_price".to_string()), - _2016: CentsSatsUsdPattern::new(client.clone(), "dca_class_2016_average_price".to_string()), - _2017: CentsSatsUsdPattern::new(client.clone(), "dca_class_2017_average_price".to_string()), - _2018: CentsSatsUsdPattern::new(client.clone(), "dca_class_2018_average_price".to_string()), - _2019: CentsSatsUsdPattern::new(client.clone(), "dca_class_2019_average_price".to_string()), - _2020: CentsSatsUsdPattern::new(client.clone(), "dca_class_2020_average_price".to_string()), - _2021: CentsSatsUsdPattern::new(client.clone(), "dca_class_2021_average_price".to_string()), - _2022: CentsSatsUsdPattern::new(client.clone(), "dca_class_2022_average_price".to_string()), - _2023: CentsSatsUsdPattern::new(client.clone(), "dca_class_2023_average_price".to_string()), - _2024: CentsSatsUsdPattern::new(client.clone(), "dca_class_2024_average_price".to_string()), - _2025: CentsSatsUsdPattern::new(client.clone(), "dca_class_2025_average_price".to_string()), - _2026: CentsSatsUsdPattern::new(client.clone(), "dca_class_2026_average_price".to_string()), + from_2015: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2015".to_string()), + from_2016: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2016".to_string()), + from_2017: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2017".to_string()), + from_2018: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2018".to_string()), + from_2019: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2019".to_string()), + from_2020: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2020".to_string()), + from_2021: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2021".to_string()), + from_2022: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2022".to_string()), + from_2023: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2023".to_string()), + from_2024: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2024".to_string()), + from_2025: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2025".to_string()), + from_2026: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2026".to_string()), } } } /// Metrics tree node. -pub struct MetricsTree_Market_Dca_ClassReturns { - pub _2015: MetricPattern1, - pub _2016: MetricPattern1, - pub _2017: MetricPattern1, - pub _2018: MetricPattern1, - pub _2019: MetricPattern1, - pub _2020: MetricPattern1, - pub _2021: MetricPattern1, - pub _2022: MetricPattern1, - pub _2023: MetricPattern1, - pub _2024: MetricPattern1, - pub _2025: MetricPattern1, - pub _2026: MetricPattern1, +pub struct MetricsTree_Market_Dca_ClassReturn { + pub from_2015: BpsPercentRatioPattern, + pub from_2016: BpsPercentRatioPattern, + pub from_2017: BpsPercentRatioPattern, + pub from_2018: BpsPercentRatioPattern, + pub from_2019: BpsPercentRatioPattern, + pub from_2020: BpsPercentRatioPattern, + pub from_2021: BpsPercentRatioPattern, + pub from_2022: BpsPercentRatioPattern, + pub from_2023: BpsPercentRatioPattern, + pub from_2024: BpsPercentRatioPattern, + pub from_2025: BpsPercentRatioPattern, + pub from_2026: BpsPercentRatioPattern, } -impl MetricsTree_Market_Dca_ClassReturns { +impl MetricsTree_Market_Dca_ClassReturn { pub fn new(client: Arc, base_path: String) -> Self { Self { - _2015: MetricPattern1::new(client.clone(), "dca_class_2015_returns".to_string()), - _2016: MetricPattern1::new(client.clone(), "dca_class_2016_returns".to_string()), - _2017: MetricPattern1::new(client.clone(), "dca_class_2017_returns".to_string()), - _2018: MetricPattern1::new(client.clone(), "dca_class_2018_returns".to_string()), - _2019: MetricPattern1::new(client.clone(), "dca_class_2019_returns".to_string()), - _2020: MetricPattern1::new(client.clone(), "dca_class_2020_returns".to_string()), - _2021: MetricPattern1::new(client.clone(), "dca_class_2021_returns".to_string()), - _2022: MetricPattern1::new(client.clone(), "dca_class_2022_returns".to_string()), - _2023: MetricPattern1::new(client.clone(), "dca_class_2023_returns".to_string()), - _2024: MetricPattern1::new(client.clone(), "dca_class_2024_returns".to_string()), - _2025: MetricPattern1::new(client.clone(), "dca_class_2025_returns".to_string()), - _2026: MetricPattern1::new(client.clone(), "dca_class_2026_returns".to_string()), + from_2015: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2015".to_string()), + from_2016: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2016".to_string()), + from_2017: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2017".to_string()), + from_2018: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2018".to_string()), + from_2019: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2019".to_string()), + from_2020: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2020".to_string()), + from_2021: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2021".to_string()), + from_2022: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2022".to_string()), + from_2023: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2023".to_string()), + from_2024: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2024".to_string()), + from_2025: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2025".to_string()), + from_2026: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2026".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Market_Indicators { - pub puell_multiple: MetricPattern1, - pub nvt: MetricPattern1, + pub puell_multiple: BpsRatioPattern, + pub nvt: BpsRatioPattern, pub rsi: MetricsTree_Market_Indicators_Rsi, - pub stoch_k: MetricPattern1, - pub stoch_d: MetricPattern1, - pub pi_cycle: MetricPattern1, + pub stoch_k: BpsPercentRatioPattern, + pub stoch_d: BpsPercentRatioPattern, + pub pi_cycle: BpsRatioPattern, pub macd: MetricsTree_Market_Indicators_Macd, - pub gini: MetricPattern1, + pub gini: BpsPercentRatioPattern, } impl MetricsTree_Market_Indicators { pub fn new(client: Arc, base_path: String) -> Self { Self { - puell_multiple: MetricPattern1::new(client.clone(), "puell_multiple".to_string()), - nvt: MetricPattern1::new(client.clone(), "nvt".to_string()), + puell_multiple: BpsRatioPattern::new(client.clone(), "puell_multiple".to_string()), + nvt: BpsRatioPattern::new(client.clone(), "nvt".to_string()), rsi: MetricsTree_Market_Indicators_Rsi::new(client.clone(), format!("{base_path}_rsi")), - stoch_k: MetricPattern1::new(client.clone(), "stoch_k".to_string()), - stoch_d: MetricPattern1::new(client.clone(), "stoch_d".to_string()), - pi_cycle: MetricPattern1::new(client.clone(), "pi_cycle".to_string()), + stoch_k: BpsPercentRatioPattern::new(client.clone(), "stoch_k".to_string()), + stoch_d: BpsPercentRatioPattern::new(client.clone(), "stoch_d".to_string()), + pi_cycle: BpsRatioPattern::new(client.clone(), "pi_cycle".to_string()), macd: MetricsTree_Market_Indicators_Macd::new(client.clone(), format!("{base_path}_macd")), - gini: MetricPattern1::new(client.clone(), "gini".to_string()), + gini: BpsPercentRatioPattern::new(client.clone(), "gini".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Market_Indicators_Rsi { - pub _1d: MetricsTree_Market_Indicators_Rsi_1d, + pub _24h: AverageGainsLossesRsiStochPattern, pub _1w: MetricsTree_Market_Indicators_Rsi_1w, pub _1m: MetricsTree_Market_Indicators_Rsi_1m, - pub _1y: AverageGainsLossesRsiStochPattern, + pub _1y: MetricsTree_Market_Indicators_Rsi_1y, } impl MetricsTree_Market_Indicators_Rsi { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1d: MetricsTree_Market_Indicators_Rsi_1d::new(client.clone(), format!("{base_path}_1d")), + _24h: AverageGainsLossesRsiStochPattern::new(client.clone(), "rsi".to_string()), _1w: MetricsTree_Market_Indicators_Rsi_1w::new(client.clone(), format!("{base_path}_1w")), _1m: MetricsTree_Market_Indicators_Rsi_1m::new(client.clone(), format!("{base_path}_1m")), - _1y: AverageGainsLossesRsiStochPattern::new(client.clone(), "rsi".to_string()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Market_Indicators_Rsi_1d { - pub gains: MetricPattern1, - pub losses: MetricPattern1, - pub average_gain: MetricPattern1, - pub average_loss: MetricPattern1, - pub rsi: MetricPattern1, - pub rsi_min: MetricPattern1, - pub rsi_max: MetricPattern1, - pub stoch_rsi: MetricPattern1, - pub stoch_rsi_k: MetricPattern1, - pub stoch_rsi_d: MetricPattern1, -} - -impl MetricsTree_Market_Indicators_Rsi_1d { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - gains: MetricPattern1::new(client.clone(), "rsi_gains_1d".to_string()), - 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: 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()), - stoch_rsi_k: MetricPattern1::new(client.clone(), "rsi_stoch_rsi_k_1d".to_string()), - stoch_rsi_d: MetricPattern1::new(client.clone(), "rsi_stoch_rsi_d_1d".to_string()), + _1y: MetricsTree_Market_Indicators_Rsi_1y::new(client.clone(), format!("{base_path}_1y")), } } } @@ -5141,12 +4972,12 @@ pub struct MetricsTree_Market_Indicators_Rsi_1w { pub losses: MetricPattern1, pub average_gain: MetricPattern1, pub average_loss: MetricPattern1, - pub rsi: MetricPattern1, - pub rsi_min: MetricPattern1, - pub rsi_max: MetricPattern1, - pub stoch_rsi: MetricPattern1, - pub stoch_rsi_k: MetricPattern1, - pub stoch_rsi_d: MetricPattern1, + pub rsi: BpsPercentRatioPattern, + pub rsi_min: BpsPercentRatioPattern, + pub rsi_max: BpsPercentRatioPattern, + pub stoch_rsi: BpsPercentRatioPattern, + pub stoch_rsi_k: BpsPercentRatioPattern, + pub stoch_rsi_d: BpsPercentRatioPattern, } impl MetricsTree_Market_Indicators_Rsi_1w { @@ -5154,14 +4985,14 @@ impl MetricsTree_Market_Indicators_Rsi_1w { Self { gains: MetricPattern1::new(client.clone(), "rsi_gains_1w".to_string()), 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: 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()), - stoch_rsi_k: MetricPattern1::new(client.clone(), "rsi_stoch_rsi_k_1w".to_string()), - stoch_rsi_d: MetricPattern1::new(client.clone(), "rsi_stoch_rsi_d_1w".to_string()), + average_gain: MetricPattern1::new(client.clone(), "rsi_average_gain_1w".to_string()), + average_loss: MetricPattern1::new(client.clone(), "rsi_average_loss_1w".to_string()), + rsi: BpsPercentRatioPattern::new(client.clone(), "rsi_1w".to_string()), + rsi_min: BpsPercentRatioPattern::new(client.clone(), "rsi_min_1w".to_string()), + rsi_max: BpsPercentRatioPattern::new(client.clone(), "rsi_max_1w".to_string()), + stoch_rsi: BpsPercentRatioPattern::new(client.clone(), "rsi_stoch_1w".to_string()), + stoch_rsi_k: BpsPercentRatioPattern::new(client.clone(), "rsi_stoch_k_1w".to_string()), + stoch_rsi_d: BpsPercentRatioPattern::new(client.clone(), "rsi_stoch_d_1w".to_string()), } } } @@ -5172,12 +5003,12 @@ pub struct MetricsTree_Market_Indicators_Rsi_1m { pub losses: MetricPattern1, pub average_gain: MetricPattern1, pub average_loss: MetricPattern1, - pub rsi: MetricPattern1, - pub rsi_min: MetricPattern1, - pub rsi_max: MetricPattern1, - pub stoch_rsi: MetricPattern1, - pub stoch_rsi_k: MetricPattern1, - pub stoch_rsi_d: MetricPattern1, + pub rsi: BpsPercentRatioPattern, + pub rsi_min: BpsPercentRatioPattern, + pub rsi_max: BpsPercentRatioPattern, + pub stoch_rsi: BpsPercentRatioPattern, + pub stoch_rsi_k: BpsPercentRatioPattern, + pub stoch_rsi_d: BpsPercentRatioPattern, } impl MetricsTree_Market_Indicators_Rsi_1m { @@ -5185,54 +5016,64 @@ impl MetricsTree_Market_Indicators_Rsi_1m { Self { gains: MetricPattern1::new(client.clone(), "rsi_gains_1m".to_string()), 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: 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()), - stoch_rsi_k: MetricPattern1::new(client.clone(), "rsi_stoch_rsi_k_1m".to_string()), - stoch_rsi_d: MetricPattern1::new(client.clone(), "rsi_stoch_rsi_d_1m".to_string()), + average_gain: MetricPattern1::new(client.clone(), "rsi_average_gain_1m".to_string()), + average_loss: MetricPattern1::new(client.clone(), "rsi_average_loss_1m".to_string()), + rsi: BpsPercentRatioPattern::new(client.clone(), "rsi_1m".to_string()), + rsi_min: BpsPercentRatioPattern::new(client.clone(), "rsi_min_1m".to_string()), + rsi_max: BpsPercentRatioPattern::new(client.clone(), "rsi_max_1m".to_string()), + stoch_rsi: BpsPercentRatioPattern::new(client.clone(), "rsi_stoch_1m".to_string()), + stoch_rsi_k: BpsPercentRatioPattern::new(client.clone(), "rsi_stoch_k_1m".to_string()), + stoch_rsi_d: BpsPercentRatioPattern::new(client.clone(), "rsi_stoch_d_1m".to_string()), + } + } +} + +/// Metrics tree node. +pub struct MetricsTree_Market_Indicators_Rsi_1y { + pub gains: MetricPattern1, + pub losses: MetricPattern1, + pub average_gain: MetricPattern1, + pub average_loss: MetricPattern1, + pub rsi: BpsPercentRatioPattern, + pub rsi_min: BpsPercentRatioPattern, + pub rsi_max: BpsPercentRatioPattern, + pub stoch_rsi: BpsPercentRatioPattern, + pub stoch_rsi_k: BpsPercentRatioPattern, + pub stoch_rsi_d: BpsPercentRatioPattern, +} + +impl MetricsTree_Market_Indicators_Rsi_1y { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + gains: MetricPattern1::new(client.clone(), "rsi_gains_1y".to_string()), + losses: MetricPattern1::new(client.clone(), "rsi_losses_1y".to_string()), + average_gain: MetricPattern1::new(client.clone(), "rsi_average_gain_1y".to_string()), + average_loss: MetricPattern1::new(client.clone(), "rsi_average_loss_1y".to_string()), + rsi: BpsPercentRatioPattern::new(client.clone(), "rsi_1y".to_string()), + rsi_min: BpsPercentRatioPattern::new(client.clone(), "rsi_min_1y".to_string()), + rsi_max: BpsPercentRatioPattern::new(client.clone(), "rsi_max_1y".to_string()), + stoch_rsi: BpsPercentRatioPattern::new(client.clone(), "rsi_stoch_1y".to_string()), + stoch_rsi_k: BpsPercentRatioPattern::new(client.clone(), "rsi_stoch_k_1y".to_string()), + stoch_rsi_d: BpsPercentRatioPattern::new(client.clone(), "rsi_stoch_d_1y".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Market_Indicators_Macd { - pub _1d: MetricsTree_Market_Indicators_Macd_1d, + pub _24h: EmaHistogramLineSignalPattern, pub _1w: MetricsTree_Market_Indicators_Macd_1w, pub _1m: MetricsTree_Market_Indicators_Macd_1m, - pub _1y: EmaHistogramLineSignalPattern, + pub _1y: MetricsTree_Market_Indicators_Macd_1y, } impl MetricsTree_Market_Indicators_Macd { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1d: MetricsTree_Market_Indicators_Macd_1d::new(client.clone(), format!("{base_path}_1d")), + _24h: EmaHistogramLineSignalPattern::new(client.clone(), "macd".to_string()), _1w: MetricsTree_Market_Indicators_Macd_1w::new(client.clone(), format!("{base_path}_1w")), _1m: MetricsTree_Market_Indicators_Macd_1m::new(client.clone(), format!("{base_path}_1m")), - _1y: EmaHistogramLineSignalPattern::new(client.clone(), "macd".to_string()), - } - } -} - -/// Metrics tree node. -pub struct MetricsTree_Market_Indicators_Macd_1d { - pub ema_fast: MetricPattern1, - pub ema_slow: MetricPattern1, - pub line: MetricPattern1, - pub signal: MetricPattern1, - pub histogram: MetricPattern1, -} - -impl MetricsTree_Market_Indicators_Macd_1d { - pub fn new(client: Arc, base_path: String) -> Self { - Self { - ema_fast: MetricPattern1::new(client.clone(), "macd_ema_fast_1d".to_string()), - ema_slow: MetricPattern1::new(client.clone(), "macd_ema_slow_1d".to_string()), - line: MetricPattern1::new(client.clone(), "macd_line_1d".to_string()), - signal: MetricPattern1::new(client.clone(), "macd_signal_1d".to_string()), - histogram: MetricPattern1::new(client.clone(), "macd_histogram_1d".to_string()), + _1y: MetricsTree_Market_Indicators_Macd_1y::new(client.clone(), format!("{base_path}_1y")), } } } @@ -5279,6 +5120,27 @@ impl MetricsTree_Market_Indicators_Macd_1m { } } +/// Metrics tree node. +pub struct MetricsTree_Market_Indicators_Macd_1y { + pub ema_fast: MetricPattern1, + pub ema_slow: MetricPattern1, + pub line: MetricPattern1, + pub signal: MetricPattern1, + pub histogram: MetricPattern1, +} + +impl MetricsTree_Market_Indicators_Macd_1y { + pub fn new(client: Arc, base_path: String) -> Self { + Self { + ema_fast: MetricPattern1::new(client.clone(), "macd_ema_fast_1y".to_string()), + ema_slow: MetricPattern1::new(client.clone(), "macd_ema_slow_1y".to_string()), + line: MetricPattern1::new(client.clone(), "macd_line_1y".to_string()), + signal: MetricPattern1::new(client.clone(), "macd_signal_1y".to_string()), + histogram: MetricPattern1::new(client.clone(), "macd_histogram_1y".to_string()), + } + } +} + /// Metrics tree node. pub struct MetricsTree_Pools { pub height_to_pool: MetricPattern18, @@ -5296,335 +5158,335 @@ impl MetricsTree_Pools { /// Metrics tree node. pub struct MetricsTree_Pools_Vecs { - pub unknown: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub blockfills: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub ultimuspool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub terrapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub luxor: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub onethash: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btccom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitfarms: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub huobipool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub wayicn: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub canoepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btctop: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitcoincom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub pool175btc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub gbminers: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub axbt: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub asicminer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitminter: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitcoinrussia: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btcserv: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub simplecoinus: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btcguild: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub eligius: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub ozcoin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub eclipsemc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub maxbtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub triplemining: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub coinlab: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub pool50btc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub ghashio: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub stminingcorp: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitparking: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub mmpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub polmine: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub kncminer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitalo: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub f2pool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub hhtt: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub megabigpower: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub mtred: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub nmcbit: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub yourbtcnet: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub givemecoins: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub braiinspool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub antpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub multicoinco: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bcpoolio: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub cointerra: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub kanopool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub solock: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub ckpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub nicehash: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitclub: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitcoinaffiliatenetwork: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btcc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bwpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub exxbw: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitsolo: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitfury: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub twentyoneinc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub digitalbtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub eightbaochi: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub mybtccoinpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub tbdice: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub hashpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub nexious: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bravomining: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub hotpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub okexpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bcmonster: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub onehash: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bixin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub tatmaspool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub viabtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub connectbtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub batpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub waterhole: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub dcexploration: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub dcex: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub fiftyeightcoin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitcoinindia: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub shawnp0wers: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub phashio: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub rigpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub haozhuzhu: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub sevenpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub miningkings: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub hashbx: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub dpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub rawpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub haominer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub helix: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitcoinukraine: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub poolin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub secretsuperstar: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub tigerpoolnet: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub sigmapoolcom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub okpooltop: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub hummerpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub tangpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bytepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub spiderpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub novablock: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub miningcity: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub binancepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub minerium: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub lubiancom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub okkong: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub aaopool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub emcdpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub foundryusa: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub sbicrypto: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub arkpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub purebtccom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub marapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub kucoinpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub entrustcharitypool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub okminer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub titan: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub pegapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btcnuggets: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub cloudhashing: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub digitalxmintsy: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub telco214: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btcpoolparty: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub multipool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub transactioncoinmining: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btcdig: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub trickysbtcpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btcmp: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub eobot: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub unomp: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub patels: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub gogreenlight: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitcoinindiapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub ekanembtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub canoe: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub tiger: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub onem1x: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub zulupool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub secpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub ocean: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub whitepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub wiz: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub wk057: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub futurebitapollosolo: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub carbonnegative: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub portlandhodl: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub phoenix: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub neopool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub maxipool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub bitfufupool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub gdpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub miningdutch: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub publicpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub miningsquared: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub innopolistech: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub btclab: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub parasite: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub redrockpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, - pub est3lar: BlocksCoinbaseDaysDominanceFeeSubsidyPattern, + pub unknown: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub blockfills: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub ultimuspool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub terrapool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub luxor: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub onethash: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btccom: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitfarms: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub huobipool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub wayicn: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub canoepool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btctop: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitcoincom: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub pool175btc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub gbminers: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub axbt: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub asicminer: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitminter: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitcoinrussia: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btcserv: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub simplecoinus: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btcguild: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub eligius: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub ozcoin: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub eclipsemc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub maxbtc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub triplemining: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub coinlab: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub pool50btc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub ghashio: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub stminingcorp: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitparking: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub mmpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub polmine: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub kncminer: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitalo: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub f2pool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub hhtt: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub megabigpower: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub mtred: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub nmcbit: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub yourbtcnet: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub givemecoins: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub braiinspool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub antpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub multicoinco: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bcpoolio: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub cointerra: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub kanopool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub solock: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub ckpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub nicehash: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitclub: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitcoinaffiliatenetwork: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btcc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bwpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub exxbw: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitsolo: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitfury: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub twentyoneinc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub digitalbtc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub eightbaochi: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub mybtccoinpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub tbdice: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub hashpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub nexious: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bravomining: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub hotpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub okexpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bcmonster: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub onehash: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bixin: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub tatmaspool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub viabtc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub connectbtc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub batpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub waterhole: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub dcexploration: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub dcex: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub fiftyeightcoin: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitcoinindia: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub shawnp0wers: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub phashio: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub rigpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub haozhuzhu: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub sevenpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub miningkings: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub hashbx: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub dpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub rawpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub haominer: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub helix: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitcoinukraine: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub poolin: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub secretsuperstar: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub tigerpoolnet: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub sigmapoolcom: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub okpooltop: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub hummerpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub tangpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bytepool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub spiderpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub novablock: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub miningcity: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub binancepool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub minerium: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub lubiancom: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub okkong: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub aaopool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub emcdpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub foundryusa: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub sbicrypto: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub arkpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub purebtccom: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub marapool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub kucoinpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub entrustcharitypool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub okminer: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub titan: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub pegapool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btcnuggets: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub cloudhashing: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub digitalxmintsy: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub telco214: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btcpoolparty: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub multipool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub transactioncoinmining: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btcdig: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub trickysbtcpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btcmp: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub eobot: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub unomp: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub patels: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub gogreenlight: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitcoinindiapool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub ekanembtc: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub canoe: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub tiger: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub onem1x: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub zulupool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub secpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub ocean: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub whitepool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub wiz: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub wk057: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub futurebitapollosolo: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub carbonnegative: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub portlandhodl: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub phoenix: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub neopool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub maxipool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub bitfufupool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub gdpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub miningdutch: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub publicpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub miningsquared: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub innopolistech: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub btclab: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub parasite: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub redrockpool: BlocksCoinbaseDominanceFeeSubsidyPattern, + pub est3lar: BlocksCoinbaseDominanceFeeSubsidyPattern, } impl MetricsTree_Pools_Vecs { pub fn new(client: Arc, base_path: String) -> Self { Self { - unknown: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "unknown".to_string()), - blockfills: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "blockfills".to_string()), - ultimuspool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "ultimuspool".to_string()), - terrapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "terrapool".to_string()), - luxor: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "luxor".to_string()), - onethash: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "onethash".to_string()), - btccom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btccom".to_string()), - bitfarms: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitfarms".to_string()), - huobipool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "huobipool".to_string()), - wayicn: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "wayicn".to_string()), - canoepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "canoepool".to_string()), - btctop: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btctop".to_string()), - bitcoincom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitcoincom".to_string()), - pool175btc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "pool175btc".to_string()), - gbminers: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "gbminers".to_string()), - axbt: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "axbt".to_string()), - asicminer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "asicminer".to_string()), - bitminter: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitminter".to_string()), - bitcoinrussia: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinrussia".to_string()), - btcserv: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btcserv".to_string()), - simplecoinus: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "simplecoinus".to_string()), - btcguild: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btcguild".to_string()), - eligius: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "eligius".to_string()), - ozcoin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "ozcoin".to_string()), - eclipsemc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "eclipsemc".to_string()), - maxbtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "maxbtc".to_string()), - triplemining: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "triplemining".to_string()), - coinlab: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "coinlab".to_string()), - pool50btc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "pool50btc".to_string()), - ghashio: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "ghashio".to_string()), - stminingcorp: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "stminingcorp".to_string()), - bitparking: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitparking".to_string()), - mmpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "mmpool".to_string()), - polmine: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "polmine".to_string()), - kncminer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "kncminer".to_string()), - bitalo: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitalo".to_string()), - f2pool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "f2pool".to_string()), - hhtt: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "hhtt".to_string()), - megabigpower: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "megabigpower".to_string()), - mtred: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "mtred".to_string()), - nmcbit: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "nmcbit".to_string()), - yourbtcnet: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "yourbtcnet".to_string()), - givemecoins: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "givemecoins".to_string()), - braiinspool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "braiinspool".to_string()), - antpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "antpool".to_string()), - multicoinco: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "multicoinco".to_string()), - bcpoolio: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bcpoolio".to_string()), - cointerra: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "cointerra".to_string()), - kanopool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "kanopool".to_string()), - solock: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "solock".to_string()), - ckpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "ckpool".to_string()), - nicehash: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "nicehash".to_string()), - bitclub: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitclub".to_string()), - bitcoinaffiliatenetwork: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinaffiliatenetwork".to_string()), - btcc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btcc".to_string()), - bwpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bwpool".to_string()), - exxbw: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "exxbw".to_string()), - bitsolo: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitsolo".to_string()), - bitfury: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitfury".to_string()), - twentyoneinc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "twentyoneinc".to_string()), - digitalbtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "digitalbtc".to_string()), - eightbaochi: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "eightbaochi".to_string()), - mybtccoinpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "mybtccoinpool".to_string()), - tbdice: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "tbdice".to_string()), - hashpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "hashpool".to_string()), - nexious: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "nexious".to_string()), - bravomining: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bravomining".to_string()), - hotpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "hotpool".to_string()), - okexpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "okexpool".to_string()), - bcmonster: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bcmonster".to_string()), - onehash: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "onehash".to_string()), - bixin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bixin".to_string()), - tatmaspool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "tatmaspool".to_string()), - viabtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "viabtc".to_string()), - connectbtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "connectbtc".to_string()), - batpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "batpool".to_string()), - waterhole: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "waterhole".to_string()), - dcexploration: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "dcexploration".to_string()), - dcex: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "dcex".to_string()), - btpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btpool".to_string()), - fiftyeightcoin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "fiftyeightcoin".to_string()), - bitcoinindia: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinindia".to_string()), - shawnp0wers: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "shawnp0wers".to_string()), - phashio: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "phashio".to_string()), - rigpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "rigpool".to_string()), - haozhuzhu: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "haozhuzhu".to_string()), - sevenpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "sevenpool".to_string()), - miningkings: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "miningkings".to_string()), - hashbx: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "hashbx".to_string()), - dpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "dpool".to_string()), - rawpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "rawpool".to_string()), - haominer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "haominer".to_string()), - helix: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "helix".to_string()), - bitcoinukraine: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinukraine".to_string()), - poolin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "poolin".to_string()), - secretsuperstar: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "secretsuperstar".to_string()), - tigerpoolnet: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "tigerpoolnet".to_string()), - sigmapoolcom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "sigmapoolcom".to_string()), - okpooltop: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "okpooltop".to_string()), - hummerpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "hummerpool".to_string()), - tangpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "tangpool".to_string()), - bytepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bytepool".to_string()), - spiderpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "spiderpool".to_string()), - novablock: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "novablock".to_string()), - miningcity: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "miningcity".to_string()), - binancepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "binancepool".to_string()), - minerium: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "minerium".to_string()), - lubiancom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "lubiancom".to_string()), - okkong: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "okkong".to_string()), - aaopool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "aaopool".to_string()), - emcdpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "emcdpool".to_string()), - foundryusa: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "foundryusa".to_string()), - sbicrypto: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "sbicrypto".to_string()), - arkpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "arkpool".to_string()), - purebtccom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "purebtccom".to_string()), - marapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "marapool".to_string()), - kucoinpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "kucoinpool".to_string()), - entrustcharitypool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "entrustcharitypool".to_string()), - okminer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "okminer".to_string()), - titan: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "titan".to_string()), - pegapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "pegapool".to_string()), - btcnuggets: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btcnuggets".to_string()), - cloudhashing: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "cloudhashing".to_string()), - digitalxmintsy: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "digitalxmintsy".to_string()), - telco214: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "telco214".to_string()), - btcpoolparty: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btcpoolparty".to_string()), - multipool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "multipool".to_string()), - transactioncoinmining: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "transactioncoinmining".to_string()), - btcdig: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btcdig".to_string()), - trickysbtcpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "trickysbtcpool".to_string()), - btcmp: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btcmp".to_string()), - eobot: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "eobot".to_string()), - unomp: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "unomp".to_string()), - patels: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "patels".to_string()), - gogreenlight: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "gogreenlight".to_string()), - bitcoinindiapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinindiapool".to_string()), - ekanembtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "ekanembtc".to_string()), - canoe: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "canoe".to_string()), - tiger: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "tiger".to_string()), - onem1x: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "onem1x".to_string()), - zulupool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "zulupool".to_string()), - secpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "secpool".to_string()), - ocean: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "ocean".to_string()), - whitepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "whitepool".to_string()), - wiz: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "wiz".to_string()), - wk057: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "wk057".to_string()), - futurebitapollosolo: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "futurebitapollosolo".to_string()), - carbonnegative: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "carbonnegative".to_string()), - portlandhodl: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "portlandhodl".to_string()), - phoenix: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "phoenix".to_string()), - neopool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "neopool".to_string()), - maxipool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "maxipool".to_string()), - bitfufupool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "bitfufupool".to_string()), - gdpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "gdpool".to_string()), - miningdutch: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "miningdutch".to_string()), - publicpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "publicpool".to_string()), - miningsquared: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "miningsquared".to_string()), - innopolistech: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "innopolistech".to_string()), - btclab: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "btclab".to_string()), - parasite: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "parasite".to_string()), - redrockpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "redrockpool".to_string()), - est3lar: BlocksCoinbaseDaysDominanceFeeSubsidyPattern::new(client.clone(), "est3lar".to_string()), + unknown: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "unknown".to_string()), + blockfills: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "blockfills".to_string()), + ultimuspool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "ultimuspool".to_string()), + terrapool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "terrapool".to_string()), + luxor: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "luxor".to_string()), + onethash: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "onethash".to_string()), + btccom: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btccom".to_string()), + bitfarms: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitfarms".to_string()), + huobipool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "huobipool".to_string()), + wayicn: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "wayicn".to_string()), + canoepool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "canoepool".to_string()), + btctop: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btctop".to_string()), + bitcoincom: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitcoincom".to_string()), + pool175btc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "pool175btc".to_string()), + gbminers: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "gbminers".to_string()), + axbt: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "axbt".to_string()), + asicminer: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "asicminer".to_string()), + bitminter: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitminter".to_string()), + bitcoinrussia: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinrussia".to_string()), + btcserv: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btcserv".to_string()), + simplecoinus: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "simplecoinus".to_string()), + btcguild: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btcguild".to_string()), + eligius: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "eligius".to_string()), + ozcoin: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "ozcoin".to_string()), + eclipsemc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "eclipsemc".to_string()), + maxbtc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "maxbtc".to_string()), + triplemining: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "triplemining".to_string()), + coinlab: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "coinlab".to_string()), + pool50btc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "pool50btc".to_string()), + ghashio: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "ghashio".to_string()), + stminingcorp: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "stminingcorp".to_string()), + bitparking: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitparking".to_string()), + mmpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "mmpool".to_string()), + polmine: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "polmine".to_string()), + kncminer: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "kncminer".to_string()), + bitalo: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitalo".to_string()), + f2pool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "f2pool".to_string()), + hhtt: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "hhtt".to_string()), + megabigpower: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "megabigpower".to_string()), + mtred: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "mtred".to_string()), + nmcbit: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "nmcbit".to_string()), + yourbtcnet: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "yourbtcnet".to_string()), + givemecoins: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "givemecoins".to_string()), + braiinspool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "braiinspool".to_string()), + antpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "antpool".to_string()), + multicoinco: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "multicoinco".to_string()), + bcpoolio: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bcpoolio".to_string()), + cointerra: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "cointerra".to_string()), + kanopool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "kanopool".to_string()), + solock: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "solock".to_string()), + ckpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "ckpool".to_string()), + nicehash: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "nicehash".to_string()), + bitclub: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitclub".to_string()), + bitcoinaffiliatenetwork: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinaffiliatenetwork".to_string()), + btcc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btcc".to_string()), + bwpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bwpool".to_string()), + exxbw: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "exxbw".to_string()), + bitsolo: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitsolo".to_string()), + bitfury: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitfury".to_string()), + twentyoneinc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "twentyoneinc".to_string()), + digitalbtc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "digitalbtc".to_string()), + eightbaochi: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "eightbaochi".to_string()), + mybtccoinpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "mybtccoinpool".to_string()), + tbdice: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "tbdice".to_string()), + hashpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "hashpool".to_string()), + nexious: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "nexious".to_string()), + bravomining: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bravomining".to_string()), + hotpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "hotpool".to_string()), + okexpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "okexpool".to_string()), + bcmonster: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bcmonster".to_string()), + onehash: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "onehash".to_string()), + bixin: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bixin".to_string()), + tatmaspool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "tatmaspool".to_string()), + viabtc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "viabtc".to_string()), + connectbtc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "connectbtc".to_string()), + batpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "batpool".to_string()), + waterhole: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "waterhole".to_string()), + dcexploration: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "dcexploration".to_string()), + dcex: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "dcex".to_string()), + btpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btpool".to_string()), + fiftyeightcoin: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "fiftyeightcoin".to_string()), + bitcoinindia: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinindia".to_string()), + shawnp0wers: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "shawnp0wers".to_string()), + phashio: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "phashio".to_string()), + rigpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "rigpool".to_string()), + haozhuzhu: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "haozhuzhu".to_string()), + sevenpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "sevenpool".to_string()), + miningkings: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "miningkings".to_string()), + hashbx: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "hashbx".to_string()), + dpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "dpool".to_string()), + rawpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "rawpool".to_string()), + haominer: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "haominer".to_string()), + helix: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "helix".to_string()), + bitcoinukraine: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinukraine".to_string()), + poolin: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "poolin".to_string()), + secretsuperstar: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "secretsuperstar".to_string()), + tigerpoolnet: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "tigerpoolnet".to_string()), + sigmapoolcom: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "sigmapoolcom".to_string()), + okpooltop: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "okpooltop".to_string()), + hummerpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "hummerpool".to_string()), + tangpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "tangpool".to_string()), + bytepool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bytepool".to_string()), + spiderpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "spiderpool".to_string()), + novablock: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "novablock".to_string()), + miningcity: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "miningcity".to_string()), + binancepool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "binancepool".to_string()), + minerium: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "minerium".to_string()), + lubiancom: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "lubiancom".to_string()), + okkong: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "okkong".to_string()), + aaopool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "aaopool".to_string()), + emcdpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "emcdpool".to_string()), + foundryusa: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "foundryusa".to_string()), + sbicrypto: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "sbicrypto".to_string()), + arkpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "arkpool".to_string()), + purebtccom: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "purebtccom".to_string()), + marapool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "marapool".to_string()), + kucoinpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "kucoinpool".to_string()), + entrustcharitypool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "entrustcharitypool".to_string()), + okminer: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "okminer".to_string()), + titan: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "titan".to_string()), + pegapool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "pegapool".to_string()), + btcnuggets: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btcnuggets".to_string()), + cloudhashing: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "cloudhashing".to_string()), + digitalxmintsy: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "digitalxmintsy".to_string()), + telco214: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "telco214".to_string()), + btcpoolparty: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btcpoolparty".to_string()), + multipool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "multipool".to_string()), + transactioncoinmining: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "transactioncoinmining".to_string()), + btcdig: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btcdig".to_string()), + trickysbtcpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "trickysbtcpool".to_string()), + btcmp: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btcmp".to_string()), + eobot: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "eobot".to_string()), + unomp: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "unomp".to_string()), + patels: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "patels".to_string()), + gogreenlight: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "gogreenlight".to_string()), + bitcoinindiapool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitcoinindiapool".to_string()), + ekanembtc: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "ekanembtc".to_string()), + canoe: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "canoe".to_string()), + tiger: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "tiger".to_string()), + onem1x: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "onem1x".to_string()), + zulupool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "zulupool".to_string()), + secpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "secpool".to_string()), + ocean: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "ocean".to_string()), + whitepool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "whitepool".to_string()), + wiz: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "wiz".to_string()), + wk057: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "wk057".to_string()), + futurebitapollosolo: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "futurebitapollosolo".to_string()), + carbonnegative: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "carbonnegative".to_string()), + portlandhodl: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "portlandhodl".to_string()), + phoenix: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "phoenix".to_string()), + neopool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "neopool".to_string()), + maxipool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "maxipool".to_string()), + bitfufupool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "bitfufupool".to_string()), + gdpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "gdpool".to_string()), + miningdutch: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "miningdutch".to_string()), + publicpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "publicpool".to_string()), + miningsquared: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "miningsquared".to_string()), + innopolistech: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "innopolistech".to_string()), + btclab: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "btclab".to_string()), + parasite: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "parasite".to_string()), + redrockpool: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "redrockpool".to_string()), + est3lar: BlocksCoinbaseDominanceFeeSubsidyPattern::new(client.clone(), "est3lar".to_string()), } } } @@ -5832,24 +5694,24 @@ impl MetricsTree_Distribution_UtxoCohorts { /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_All { - pub supply: _30dHalvedTotalPattern, + pub supply: ChangeHalvedTotalPattern, pub outputs: UtxoPattern, pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, - pub realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, + pub realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern, pub cost_basis: InvestedMaxMinPercentilesSpotPattern, - pub unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern, + pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, pub relative: MetricsTree_Distribution_UtxoCohorts_All_Relative, } impl MetricsTree_Distribution_UtxoCohorts_All { pub fn new(client: Arc, base_path: String) -> Self { Self { - supply: _30dHalvedTotalPattern::new(client.clone(), "".to_string()), + supply: ChangeHalvedTotalPattern::new(client.clone(), "supply".to_string()), outputs: UtxoPattern::new(client.clone(), "utxo_count".to_string()), activity: CoinblocksCoindaysSatblocksSatdaysSentPattern::new(client.clone(), "".to_string()), - realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern::new(client.clone(), "".to_string()), + realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern::new(client.clone(), "".to_string()), cost_basis: InvestedMaxMinPercentilesSpotPattern::new(client.clone(), "".to_string()), - unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern::new(client.clone(), "".to_string()), + unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), "".to_string()), relative: MetricsTree_Distribution_UtxoCohorts_All_Relative::new(client.clone(), format!("{base_path}_relative")), } } @@ -5857,61 +5719,61 @@ impl MetricsTree_Distribution_UtxoCohorts_All { /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_All_Relative { - pub supply_in_profit_rel_to_own_supply: MetricPattern1, - pub supply_in_loss_rel_to_own_supply: MetricPattern1, - pub unrealized_profit_rel_to_market_cap: MetricPattern1, - pub unrealized_loss_rel_to_market_cap: MetricPattern1, - pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1, - pub net_unrealized_pnl_rel_to_market_cap: MetricPattern1, + pub supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern, + pub supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern, + pub unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern, + pub unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, + pub neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern, + pub net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern, pub nupl: MetricPattern1, - pub invested_capital_in_profit_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_rel_to_realized_cap: BpsPercentRatioPattern, + pub invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern, + pub unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern, + pub unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern, + pub neg_unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern, + pub net_unrealized_pnl_rel_to_own_gross_pnl: BpsPercentRatioPattern, } impl MetricsTree_Distribution_UtxoCohorts_All_Relative { pub fn new(client: Arc, base_path: String) -> Self { Self { - supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), "supply_in_profit_rel_to_own_supply".to_string()), - supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), "supply_in_loss_rel_to_own_supply".to_string()), - unrealized_profit_rel_to_market_cap: MetricPattern1::new(client.clone(), "unrealized_profit_rel_to_market_cap".to_string()), - unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), "unrealized_loss_rel_to_market_cap".to_string()), - 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()), + supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), "supply_in_profit_rel_to_own_supply".to_string()), + supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern::new(client.clone(), "supply_in_loss_rel_to_own_supply".to_string()), + unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "unrealized_profit_rel_to_market_cap".to_string()), + unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "unrealized_loss_rel_to_market_cap".to_string()), + neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "neg_unrealized_loss_rel_to_market_cap".to_string()), + net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern::new(client.clone(), "net_unrealized_pnl_rel_to_market_cap".to_string()), nupl: MetricPattern1::new(client.clone(), "nupl".to_string()), - invested_capital_in_profit_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_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "invested_capital_in_profit_rel_to_realized_cap".to_string()), + invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern::new(client.clone(), "invested_capital_in_loss_rel_to_realized_cap".to_string()), + unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), "unrealized_profit_rel_to_own_gross_pnl".to_string()), + unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), "unrealized_loss_rel_to_own_gross_pnl".to_string()), + neg_unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), "neg_unrealized_loss_rel_to_own_gross_pnl".to_string()), + net_unrealized_pnl_rel_to_own_gross_pnl: BpsPercentRatioPattern::new(client.clone(), "net_unrealized_pnl_rel_to_own_gross_pnl".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Distribution_UtxoCohorts_Sth { - pub supply: _30dHalvedTotalPattern, + pub supply: ChangeHalvedTotalPattern, pub outputs: UtxoPattern, pub activity: CoinblocksCoindaysSatblocksSatdaysSentPattern, - pub realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern, + pub realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern, pub cost_basis: InvestedMaxMinPercentilesSpotPattern, - pub unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern, + pub unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern, 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()), + supply: ChangeHalvedTotalPattern::new(client.clone(), "sth_supply".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()), + realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern::new(client.clone(), "sth".to_string()), cost_basis: InvestedMaxMinPercentilesSpotPattern::new(client.clone(), "sth".to_string()), - unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern::new(client.clone(), "sth".to_string()), + unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern::new(client.clone(), "sth".to_string()), relative: InvestedNegNetNuplSupplyUnrealizedPattern2::new(client.clone(), "sth".to_string()), } } @@ -6501,29 +6363,29 @@ impl MetricsTree_Distribution_NewAddrCount { /// Metrics tree node. pub struct MetricsTree_Distribution_GrowthRate { - pub all: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2pk65: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2pk33: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2pkh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2sh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2wpkh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2wsh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2tr: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, - pub p2a: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern, + pub all: BpsPercentRatioPattern2, + pub p2pk65: BpsPercentRatioPattern2, + pub p2pk33: BpsPercentRatioPattern2, + pub p2pkh: BpsPercentRatioPattern2, + pub p2sh: BpsPercentRatioPattern2, + pub p2wpkh: BpsPercentRatioPattern2, + pub p2wsh: BpsPercentRatioPattern2, + pub p2tr: BpsPercentRatioPattern2, + pub p2a: BpsPercentRatioPattern2, } impl MetricsTree_Distribution_GrowthRate { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "growth_rate".to_string()), - p2pk65: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2pk65_growth_rate".to_string()), - p2pk33: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2pk33_growth_rate".to_string()), - p2pkh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2pkh_growth_rate".to_string()), - p2sh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2sh_growth_rate".to_string()), - p2wpkh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2wpkh_growth_rate".to_string()), - p2wsh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2wsh_growth_rate".to_string()), - p2tr: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2tr_growth_rate".to_string()), - p2a: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "p2a_growth_rate".to_string()), + all: BpsPercentRatioPattern2::new(client.clone(), "growth_rate".to_string()), + p2pk65: BpsPercentRatioPattern2::new(client.clone(), "p2pk65_growth_rate".to_string()), + p2pk33: BpsPercentRatioPattern2::new(client.clone(), "p2pk33_growth_rate".to_string()), + p2pkh: BpsPercentRatioPattern2::new(client.clone(), "p2pkh_growth_rate".to_string()), + p2sh: BpsPercentRatioPattern2::new(client.clone(), "p2sh_growth_rate".to_string()), + p2wpkh: BpsPercentRatioPattern2::new(client.clone(), "p2wpkh_growth_rate".to_string()), + p2wsh: BpsPercentRatioPattern2::new(client.clone(), "p2wsh_growth_rate".to_string()), + p2tr: BpsPercentRatioPattern2::new(client.clone(), "p2tr_growth_rate".to_string()), + p2a: BpsPercentRatioPattern2::new(client.clone(), "p2a_growth_rate".to_string()), } } } @@ -6532,12 +6394,12 @@ impl MetricsTree_Distribution_GrowthRate { pub struct MetricsTree_Supply { pub circulating: BtcCentsSatsUsdPattern, pub burned: MetricsTree_Supply_Burned, - pub inflation: MetricPattern1, + pub inflation_rate: BpsPercentRatioPattern, pub velocity: MetricsTree_Supply_Velocity, pub market_cap: MetricPattern1, - pub market_cap_growth_rate: MetricPattern1, - pub realized_cap_growth_rate: MetricPattern1, - pub cap_growth_rate_diff: MetricPattern1, + pub market_cap_growth_rate: BpsPercentRatioPattern, + pub realized_cap_growth_rate: BpsPercentRatioPattern, + pub market_minus_realized_cap_growth_rate: MetricPattern1, } impl MetricsTree_Supply { @@ -6545,12 +6407,12 @@ impl MetricsTree_Supply { Self { circulating: BtcCentsSatsUsdPattern::new(client.clone(), "circulating_supply".to_string()), burned: MetricsTree_Supply_Burned::new(client.clone(), format!("{base_path}_burned")), - inflation: MetricPattern1::new(client.clone(), "inflation_rate".to_string()), + inflation_rate: BpsPercentRatioPattern::new(client.clone(), "inflation_rate".to_string()), velocity: MetricsTree_Supply_Velocity::new(client.clone(), format!("{base_path}_velocity")), market_cap: MetricPattern1::new(client.clone(), "market_cap".to_string()), - market_cap_growth_rate: MetricPattern1::new(client.clone(), "market_cap_growth_rate".to_string()), - realized_cap_growth_rate: MetricPattern1::new(client.clone(), "realized_cap_growth_rate".to_string()), - cap_growth_rate_diff: MetricPattern1::new(client.clone(), "cap_growth_rate_diff".to_string()), + market_cap_growth_rate: BpsPercentRatioPattern::new(client.clone(), "market_cap_growth_rate".to_string()), + realized_cap_growth_rate: BpsPercentRatioPattern::new(client.clone(), "realized_cap_growth_rate".to_string()), + market_minus_realized_cap_growth_rate: MetricPattern1::new(client.clone(), "market_minus_realized_cap_growth_rate".to_string()), } } } @@ -6579,8 +6441,8 @@ pub struct MetricsTree_Supply_Velocity { impl MetricsTree_Supply_Velocity { pub fn new(client: Arc, base_path: String) -> Self { Self { - btc: MetricPattern1::new(client.clone(), "btc_velocity".to_string()), - usd: MetricPattern1::new(client.clone(), "usd_velocity".to_string()), + btc: MetricPattern1::new(client.clone(), "velocity_btc".to_string()), + usd: MetricPattern1::new(client.clone(), "velocity_usd".to_string()), } } } diff --git a/crates/brk_computer/src/blocks/compute.rs b/crates/brk_computer/src/blocks/compute.rs index 413f21a9c..dd8f6ca5c 100644 --- a/crates/brk_computer/src/blocks/compute.rs +++ b/crates/brk_computer/src/blocks/compute.rs @@ -1,8 +1,9 @@ use brk_error::Result; use brk_indexer::Indexer; +use brk_types::Indexes; use vecdb::Exit; -use crate::{ComputeIndexes, indexes}; +use crate::indexes; use super::Vecs; @@ -11,7 +12,7 @@ impl Vecs { &mut self, indexer: &Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.time diff --git a/crates/brk_computer/src/blocks/count/compute.rs b/crates/brk_computer/src/blocks/count/compute.rs index 26b0d990b..ef3c292ee 100644 --- a/crates/brk_computer/src/blocks/count/compute.rs +++ b/crates/brk_computer/src/blocks/count/compute.rs @@ -1,9 +1,9 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{Height, StoredU32, Timestamp}; +use brk_types::{Height, Indexes, StoredU32, Timestamp}; use vecdb::{AnyVec, Cursor, EagerVec, Exit, PcoVec, ReadableVec, VecIndex}; -use crate::{internal::WindowStarts, ComputeIndexes}; +use crate::internal::WindowStarts; use super::{super::time, Vecs}; @@ -12,7 +12,7 @@ impl Vecs { &mut self, indexer: &Indexer, time: &time::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // Block count height + cumulative first (rolling computed after window starts) @@ -185,7 +185,7 @@ impl Vecs { fn compute_rolling_start( &mut self, time: &time::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, days: usize, get_field: F, @@ -205,7 +205,7 @@ impl Vecs { fn compute_rolling_start_hours( &mut self, time: &time::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, hours: usize, get_field: F, @@ -225,7 +225,7 @@ impl Vecs { fn compute_rolling_start_inner( &mut self, time: &time::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, get_field: F, expired: D, diff --git a/crates/brk_computer/src/blocks/difficulty/compute.rs b/crates/brk_computer/src/blocks/difficulty/compute.rs index 9c8bc5a23..9ab53ac53 100644 --- a/crates/brk_computer/src/blocks/difficulty/compute.rs +++ b/crates/brk_computer/src/blocks/difficulty/compute.rs @@ -1,18 +1,18 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{StoredF64, StoredU32}; +use brk_types::{Indexes, StoredF64, StoredU32}; use vecdb::Exit; use super::super::TARGET_BLOCKS_PER_DAY_F32; use super::Vecs; -use crate::{ComputeIndexes, indexes}; +use crate::indexes; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // raw is fully lazy from indexer height source — no compute needed diff --git a/crates/brk_computer/src/blocks/halving/compute.rs b/crates/brk_computer/src/blocks/halving/compute.rs index 92e150f16..bf7ceb029 100644 --- a/crates/brk_computer/src/blocks/halving/compute.rs +++ b/crates/brk_computer/src/blocks/halving/compute.rs @@ -1,16 +1,16 @@ use brk_error::Result; -use brk_types::StoredU32; +use brk_types::{Indexes, StoredU32}; use vecdb::Exit; use super::super::TARGET_BLOCKS_PER_DAY_F32; use super::Vecs; -use crate::{ComputeIndexes, indexes}; +use crate::indexes; impl Vecs { pub(crate) fn compute( &mut self, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.epoch.height.compute_transform( diff --git a/crates/brk_computer/src/blocks/interval/compute.rs b/crates/brk_computer/src/blocks/interval/compute.rs index 9d8e9274a..6ce98b497 100644 --- a/crates/brk_computer/src/blocks/interval/compute.rs +++ b/crates/brk_computer/src/blocks/interval/compute.rs @@ -1,17 +1,17 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{CheckedSub, Timestamp}; +use brk_types::{CheckedSub, Indexes, Timestamp}; use vecdb::{Exit, ReadableVec}; use super::Vecs; -use crate::{blocks, ComputeIndexes}; +use crate::blocks; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, count_vecs: &blocks::CountVecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let mut prev_timestamp = None; diff --git a/crates/brk_computer/src/blocks/size/compute.rs b/crates/brk_computer/src/blocks/size/compute.rs index 7dc1c8b72..ad8d7340a 100644 --- a/crates/brk_computer/src/blocks/size/compute.rs +++ b/crates/brk_computer/src/blocks/size/compute.rs @@ -1,17 +1,17 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::StoredU64; +use brk_types::{Indexes, StoredU64}; use vecdb::Exit; use super::Vecs; -use crate::{blocks, ComputeIndexes}; +use crate::blocks; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, count_vecs: &blocks::CountVecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = count_vecs.window_starts(); diff --git a/crates/brk_computer/src/blocks/time/vecs.rs b/crates/brk_computer/src/blocks/time/vecs.rs index 878e88fab..027582ac4 100644 --- a/crates/brk_computer/src/blocks/time/vecs.rs +++ b/crates/brk_computer/src/blocks/time/vecs.rs @@ -2,12 +2,12 @@ use brk_error::Result; use brk_traversable::Traversable; use brk_types::{ Date, Day1, Day3, DifficultyEpoch, HalvingEpoch, Height, Hour1, Hour12, Hour4, - Minute10, Minute30, Month1, Month3, Month6, Timestamp, Week1, Year1, Year10, + Indexes, Minute10, Minute30, Month1, Month3, Month6, Timestamp, Week1, Year1, Year10, }; use derive_more::{Deref, DerefMut}; -use vecdb::{EagerVec, Exit, LazyVecFrom1, PcoVec, Rw, StorageMode}; +use vecdb::{EagerVec, Exit, LazyVecFrom1, PcoVec, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, indexes, internal::Indexes}; +use crate::{indexes, internal::PerPeriod}; /// Timestamp and date metrics for blocks #[derive(Traversable)] @@ -27,7 +27,7 @@ pub struct Vecs { #[traversable(transparent)] pub struct TimestampIndexes( #[allow(clippy::type_complexity)] - pub Indexes< + pub PerPeriod< LazyVecFrom1, LazyVecFrom1, LazyVecFrom1, @@ -53,17 +53,18 @@ impl TimestampIndexes { &mut self, indexer: &brk_indexer::Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { + let prev_height = starting_indexes.height.decremented().unwrap_or_default(); self.halvingepoch.compute_indirect_sequential( - starting_indexes.halvingepoch, + indexes.height.halvingepoch.collect_one(prev_height).unwrap_or_default(), &indexes.halvingepoch.first_height, &indexer.vecs.blocks.timestamp, exit, )?; self.difficultyepoch.compute_indirect_sequential( - starting_indexes.difficultyepoch, + indexes.height.difficultyepoch.collect_one(prev_height).unwrap_or_default(), &indexes.difficultyepoch.first_height, &indexer.vecs.blocks.timestamp, exit, diff --git a/crates/brk_computer/src/blocks/weight/compute.rs b/crates/brk_computer/src/blocks/weight/compute.rs index b7bc6b7c2..ad023b4e2 100644 --- a/crates/brk_computer/src/blocks/weight/compute.rs +++ b/crates/brk_computer/src/blocks/weight/compute.rs @@ -1,17 +1,17 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::BasisPoints16; +use brk_types::{BasisPoints16, Indexes}; use vecdb::Exit; use super::Vecs; -use crate::{blocks, ComputeIndexes}; +use crate::blocks; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, count_vecs: &blocks::CountVecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = count_vecs.window_starts(); diff --git a/crates/brk_computer/src/cointime/activity/compute.rs b/crates/brk_computer/src/cointime/activity/compute.rs index 746a7685f..ce621ef87 100644 --- a/crates/brk_computer/src/cointime/activity/compute.rs +++ b/crates/brk_computer/src/cointime/activity/compute.rs @@ -1,14 +1,14 @@ use brk_error::Result; -use brk_types::{Bitcoin, CheckedSub, StoredF64}; +use brk_types::{Bitcoin, CheckedSub, Indexes, StoredF64}; use vecdb::Exit; use super::Vecs; -use crate::{ComputeIndexes, blocks, distribution}; +use crate::{blocks, distribution}; impl Vecs { pub(crate) fn compute( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, blocks: &blocks::Vecs, distribution: &distribution::Vecs, exit: &Exit, diff --git a/crates/brk_computer/src/cointime/adjusted/compute.rs b/crates/brk_computer/src/cointime/adjusted/compute.rs index 7fbfb1b15..1c235e5cb 100644 --- a/crates/brk_computer/src/cointime/adjusted/compute.rs +++ b/crates/brk_computer/src/cointime/adjusted/compute.rs @@ -1,15 +1,15 @@ use brk_error::Result; -use brk_types::BasisPointsSigned32; +use brk_types::{BasisPointsSigned32, Indexes}; use vecdb::Exit; use super::super::activity; use super::Vecs; -use crate::{ComputeIndexes, supply}; +use crate::supply; impl Vecs { pub(crate) fn compute( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, supply: &supply::Vecs, activity: &activity::Vecs, exit: &Exit, diff --git a/crates/brk_computer/src/cointime/cap/compute.rs b/crates/brk_computer/src/cointime/cap/compute.rs index 572e7fc50..28677c3d9 100644 --- a/crates/brk_computer/src/cointime/cap/compute.rs +++ b/crates/brk_computer/src/cointime/cap/compute.rs @@ -1,16 +1,16 @@ use brk_error::Result; -use brk_types::Cents; +use brk_types::{Cents, Indexes}; use vecdb::Exit; use super::super::{activity, value}; use super::Vecs; -use crate::{ComputeIndexes, distribution, mining}; +use crate::{distribution, mining}; impl Vecs { #[allow(clippy::too_many_arguments)] pub(crate) fn compute( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, mining: &mining::Vecs, distribution: &distribution::Vecs, activity: &activity::Vecs, diff --git a/crates/brk_computer/src/cointime/compute.rs b/crates/brk_computer/src/cointime/compute.rs index 248b5b012..e906cd0aa 100644 --- a/crates/brk_computer/src/cointime/compute.rs +++ b/crates/brk_computer/src/cointime/compute.rs @@ -1,14 +1,15 @@ use brk_error::Result; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{ComputeIndexes, blocks, distribution, mining, prices, supply}; +use crate::{blocks, distribution, mining, prices, supply}; impl Vecs { #[allow(clippy::too_many_arguments)] pub(crate) fn compute( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, prices: &prices::Vecs, blocks: &blocks::Vecs, mining: &mining::Vecs, diff --git a/crates/brk_computer/src/cointime/pricing/compute.rs b/crates/brk_computer/src/cointime/pricing/compute.rs index ec886af37..8c32bdc03 100644 --- a/crates/brk_computer/src/cointime/pricing/compute.rs +++ b/crates/brk_computer/src/cointime/pricing/compute.rs @@ -1,16 +1,16 @@ use brk_error::Result; -use brk_types::Cents; +use brk_types::{Cents, Indexes}; use vecdb::Exit; use super::super::{activity, cap, supply}; use super::Vecs; -use crate::{ComputeIndexes, blocks, distribution, prices}; +use crate::{blocks, distribution, prices}; impl Vecs { #[allow(clippy::too_many_arguments)] pub(crate) fn compute( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, prices: &prices::Vecs, blocks: &blocks::Vecs, distribution: &distribution::Vecs, diff --git a/crates/brk_computer/src/cointime/reserve_risk/compute.rs b/crates/brk_computer/src/cointime/reserve_risk/compute.rs index e1a9b24aa..b2a647cc8 100644 --- a/crates/brk_computer/src/cointime/reserve_risk/compute.rs +++ b/crates/brk_computer/src/cointime/reserve_risk/compute.rs @@ -1,14 +1,14 @@ use brk_error::Result; -use brk_types::StoredF64; +use brk_types::{Indexes, StoredF64}; use vecdb::Exit; use super::{super::value, Vecs}; -use crate::{blocks, ComputeIndexes, prices, traits::ComputeRollingMedianFromStarts}; +use crate::{blocks, prices, traits::ComputeRollingMedianFromStarts}; impl Vecs { pub(crate) fn compute( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, blocks: &blocks::Vecs, prices: &prices::Vecs, value: &value::Vecs, diff --git a/crates/brk_computer/src/cointime/supply/compute.rs b/crates/brk_computer/src/cointime/supply/compute.rs index 5563d9b43..3b6ae4c3a 100644 --- a/crates/brk_computer/src/cointime/supply/compute.rs +++ b/crates/brk_computer/src/cointime/supply/compute.rs @@ -1,14 +1,15 @@ use brk_error::Result; +use brk_types::Indexes; use vecdb::Exit; use super::super::activity; use super::Vecs; -use crate::{ComputeIndexes, distribution}; +use crate::distribution; impl Vecs { pub(crate) fn compute( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, distribution: &distribution::Vecs, activity: &activity::Vecs, exit: &Exit, diff --git a/crates/brk_computer/src/cointime/value/compute.rs b/crates/brk_computer/src/cointime/value/compute.rs index fe78ce962..02f42764b 100644 --- a/crates/brk_computer/src/cointime/value/compute.rs +++ b/crates/brk_computer/src/cointime/value/compute.rs @@ -1,15 +1,15 @@ use brk_error::Result; -use brk_types::{Bitcoin, Dollars, StoredF64}; +use brk_types::{Bitcoin, Dollars, Indexes, StoredF64}; use vecdb::Exit; use super::super::activity; use super::Vecs; -use crate::{ComputeIndexes, blocks, distribution, prices}; +use crate::{blocks, distribution, prices}; impl Vecs { pub(crate) fn compute( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, prices: &prices::Vecs, blocks: &blocks::Vecs, distribution: &distribution::Vecs, diff --git a/crates/brk_computer/src/distribution/address/activity.rs b/crates/brk_computer/src/distribution/address/activity.rs index c70c1637e..ec0bfe250 100644 --- a/crates/brk_computer/src/distribution/address/activity.rs +++ b/crates/brk_computer/src/distribution/address/activity.rs @@ -233,18 +233,8 @@ impl AddressTypeToActivityCountVecs { } pub(crate) fn par_iter_height_mut(&mut self) -> impl ParallelIterator { - let inner = &mut self.0; let mut vecs: Vec<&mut dyn AnyStoredVec> = Vec::new(); - for type_vecs in [ - &mut inner.p2pk65, - &mut inner.p2pk33, - &mut inner.p2pkh, - &mut inner.p2sh, - &mut inner.p2wpkh, - &mut inner.p2wsh, - &mut inner.p2tr, - &mut inner.p2a, - ] { + for type_vecs in self.0.values_mut() { vecs.push(&mut type_vecs.reactivated.height); vecs.push(&mut type_vecs.sending.height); vecs.push(&mut type_vecs.receiving.height); @@ -256,14 +246,9 @@ impl AddressTypeToActivityCountVecs { } pub(crate) fn reset_height(&mut self) -> Result<()> { - self.p2pk65.reset_height()?; - self.p2pk33.reset_height()?; - self.p2pkh.reset_height()?; - self.p2sh.reset_height()?; - self.p2wpkh.reset_height()?; - self.p2wsh.reset_height()?; - self.p2tr.reset_height()?; - self.p2a.reset_height()?; + for v in self.0.values_mut() { + v.reset_height()?; + } Ok(()) } @@ -284,19 +269,9 @@ impl AddressTypeToActivityCountVecs { height: Height, counts: &AddressTypeToActivityCounts, ) -> Result<()> { - self.p2pk65 - .truncate_push_height(height, &counts.p2pk65)?; - self.p2pk33 - .truncate_push_height(height, &counts.p2pk33)?; - self.p2pkh - .truncate_push_height(height, &counts.p2pkh)?; - self.p2sh.truncate_push_height(height, &counts.p2sh)?; - self.p2wpkh - .truncate_push_height(height, &counts.p2wpkh)?; - self.p2wsh - .truncate_push_height(height, &counts.p2wsh)?; - self.p2tr.truncate_push_height(height, &counts.p2tr)?; - self.p2a.truncate_push_height(height, &counts.p2a)?; + for (vecs, c) in self.0.values_mut().zip(counts.0.values()) { + vecs.truncate_push_height(height, c)?; + } Ok(()) } diff --git a/crates/brk_computer/src/distribution/address/address_count.rs b/crates/brk_computer/src/distribution/address/address_count.rs index d7286cadc..a4ef99b3e 100644 --- a/crates/brk_computer/src/distribution/address/address_count.rs +++ b/crates/brk_computer/src/distribution/address/address_count.rs @@ -1,7 +1,7 @@ use brk_cohort::ByAddressType; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Height, StoredF64, StoredU64, Version}; +use brk_types::{Height, Indexes, StoredF64, StoredU64, Version}; use derive_more::{Deref, DerefMut}; use rayon::prelude::*; use vecdb::{ @@ -9,7 +9,7 @@ use vecdb::{ WritableVec, }; -use crate::{ComputeIndexes, blocks, indexes, internal::ComputedFromHeight}; +use crate::{blocks, indexes, internal::ComputedFromHeight}; /// Address count with 1m change metric for a single type. #[derive(Traversable)] @@ -40,7 +40,7 @@ impl AddrCountVecs { pub(crate) fn compute_rest( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.change_1m.height.compute_rolling_change( @@ -116,32 +116,11 @@ impl AddressTypeToAddrCountVecs { } pub(crate) fn min_stateful_height(&self) -> usize { - self.p2pk65 - .count - .height - .len() - .min(self.p2pk33.count.height.len()) - .min(self.p2pkh.count.height.len()) - .min(self.p2sh.count.height.len()) - .min(self.p2wpkh.count.height.len()) - .min(self.p2wsh.count.height.len()) - .min(self.p2tr.count.height.len()) - .min(self.p2a.count.height.len()) + self.0.values().map(|v| v.count.height.len()).min().unwrap() } pub(crate) fn par_iter_height_mut(&mut self) -> impl ParallelIterator { - let inner = &mut self.0; - [ - &mut inner.p2pk65.count.height as &mut dyn AnyStoredVec, - &mut inner.p2pk33.count.height as &mut dyn AnyStoredVec, - &mut inner.p2pkh.count.height as &mut dyn AnyStoredVec, - &mut inner.p2sh.count.height as &mut dyn AnyStoredVec, - &mut inner.p2wpkh.count.height as &mut dyn AnyStoredVec, - &mut inner.p2wsh.count.height as &mut dyn AnyStoredVec, - &mut inner.p2tr.count.height as &mut dyn AnyStoredVec, - &mut inner.p2a.count.height as &mut dyn AnyStoredVec, - ] - .into_par_iter() + self.0.par_values_mut().map(|v| &mut v.count.height as &mut dyn AnyStoredVec) } pub(crate) fn truncate_push_height( @@ -149,82 +128,34 @@ impl AddressTypeToAddrCountVecs { height: Height, addr_counts: &AddressTypeToAddressCount, ) -> Result<()> { - self.p2pk65 - .count - .height - .truncate_push(height, addr_counts.p2pk65.into())?; - self.p2pk33 - .count - .height - .truncate_push(height, addr_counts.p2pk33.into())?; - self.p2pkh - .count - .height - .truncate_push(height, addr_counts.p2pkh.into())?; - self.p2sh - .count - .height - .truncate_push(height, addr_counts.p2sh.into())?; - self.p2wpkh - .count - .height - .truncate_push(height, addr_counts.p2wpkh.into())?; - self.p2wsh - .count - .height - .truncate_push(height, addr_counts.p2wsh.into())?; - self.p2tr - .count - .height - .truncate_push(height, addr_counts.p2tr.into())?; - self.p2a - .count - .height - .truncate_push(height, addr_counts.p2a.into())?; + for (vecs, &count) in self.0.values_mut().zip(addr_counts.values()) { + vecs.count.height.truncate_push(height, count.into())?; + } Ok(()) } pub(crate) fn reset_height(&mut self) -> Result<()> { use vecdb::WritableVec; - self.p2pk65.count.height.reset()?; - self.p2pk33.count.height.reset()?; - self.p2pkh.count.height.reset()?; - self.p2sh.count.height.reset()?; - self.p2wpkh.count.height.reset()?; - self.p2wsh.count.height.reset()?; - self.p2tr.count.height.reset()?; - self.p2a.count.height.reset()?; + for v in self.0.values_mut() { + v.count.height.reset()?; + } Ok(()) } pub(crate) fn compute_rest( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { - self.p2pk65.compute_rest(blocks, starting_indexes, exit)?; - self.p2pk33.compute_rest(blocks, starting_indexes, exit)?; - self.p2pkh.compute_rest(blocks, starting_indexes, exit)?; - self.p2sh.compute_rest(blocks, starting_indexes, exit)?; - self.p2wpkh.compute_rest(blocks, starting_indexes, exit)?; - self.p2wsh.compute_rest(blocks, starting_indexes, exit)?; - self.p2tr.compute_rest(blocks, starting_indexes, exit)?; - self.p2a.compute_rest(blocks, starting_indexes, exit)?; + for v in self.0.values_mut() { + v.compute_rest(blocks, starting_indexes, exit)?; + } Ok(()) } pub(crate) fn by_height(&self) -> Vec<&EagerVec>> { - vec![ - &self.p2pk65.count.height, - &self.p2pk33.count.height, - &self.p2pkh.count.height, - &self.p2sh.count.height, - &self.p2wpkh.count.height, - &self.p2wsh.count.height, - &self.p2tr.count.height, - &self.p2a.count.height, - ] + self.0.values().map(|v| &v.count.height).collect() } } @@ -278,7 +209,7 @@ impl AddrCountsVecs { pub(crate) fn compute_rest( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.by_addresstype diff --git a/crates/brk_computer/src/distribution/address/total_addr_count.rs b/crates/brk_computer/src/distribution/address/total_addr_count.rs index 9078cb3c2..f8bd57fa2 100644 --- a/crates/brk_computer/src/distribution/address/total_addr_count.rs +++ b/crates/brk_computer/src/distribution/address/total_addr_count.rs @@ -53,11 +53,10 @@ impl TotalAddrCountVecs { empty_addr_count: &AddrCountsVecs, exit: &Exit, ) -> Result<()> { - self.all.height.compute_transform2( + self.all.height.compute_add( max_from, &addr_count.all.count.height, &empty_addr_count.all.count.height, - |(h, a, b, ..)| (h, StoredU64::from(*a + *b)), exit, )?; @@ -71,11 +70,10 @@ impl TotalAddrCountVecs { .zip(empty_addr_count.by_addresstype.iter()), ) { - total.height.compute_transform2( + total.height.compute_add( max_from, &addr.count.height, &empty.count.height, - |(h, a, b, ..)| (h, StoredU64::from(*a + *b)), exit, )?; } diff --git a/crates/brk_computer/src/distribution/cohorts/address/groups.rs b/crates/brk_computer/src/distribution/cohorts/address/groups.rs index fcd1b67ea..65e328a14 100644 --- a/crates/brk_computer/src/distribution/cohorts/address/groups.rs +++ b/crates/brk_computer/src/distribution/cohorts/address/groups.rs @@ -5,12 +5,12 @@ use brk_cohort::{ }; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Dollars, Height, Sats, Version}; +use brk_types::{Dollars, Height, Indexes, Sats, Version}; use derive_more::{Deref, DerefMut}; use rayon::prelude::*; use vecdb::{AnyStoredVec, Database, Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, distribution::DynCohortVecs, indexes, prices}; +use crate::{blocks, distribution::DynCohortVecs, indexes, prices}; use crate::distribution::metrics::CohortMetricsBase; @@ -83,7 +83,7 @@ impl AddressCohorts { /// Compute overlapping cohorts from component amount_range cohorts. pub(crate) fn compute_overlapping_vecs( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.for_each_aggregate(|vecs, sources| { @@ -96,7 +96,7 @@ impl AddressCohorts { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // 1. Compute addr_count_change_1m using rolling window @@ -134,7 +134,7 @@ impl AddressCohorts { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &HM, all_supply_sats: &AS, exit: &Exit, diff --git a/crates/brk_computer/src/distribution/cohorts/address/vecs.rs b/crates/brk_computer/src/distribution/cohorts/address/vecs.rs index 646c8a2ed..7c87163fb 100644 --- a/crates/brk_computer/src/distribution/cohorts/address/vecs.rs +++ b/crates/brk_computer/src/distribution/cohorts/address/vecs.rs @@ -3,12 +3,12 @@ use std::path::Path; use brk_cohort::{CohortContext, Filter, Filtered}; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Dollars, Height, Sats, StoredF64, StoredU64, Version}; +use brk_types::{Cents, Dollars, Height, Indexes, Sats, StoredF64, StoredU64, Version}; use rayon::prelude::*; use vecdb::{AnyStoredVec, AnyVec, Database, Exit, WritableVec, ReadableVec, Rw, StorageMode}; use crate::{ - ComputeIndexes, blocks, + blocks, distribution::state::AddressCohortState, indexes, internal::ComputedFromHeight, @@ -53,7 +53,7 @@ impl AddressCohortVecs { let cfg = ImportConfig { db, - filter, + filter: &filter, full_name: &full_name, version, indexes, @@ -211,7 +211,7 @@ impl DynCohortVecs for AddressCohortVecs { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.metrics @@ -221,7 +221,7 @@ impl DynCohortVecs for AddressCohortVecs { fn compute_net_sentiment_height( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.metrics @@ -252,7 +252,7 @@ impl DynCohortVecs for AddressCohortVecs { impl CohortVecs for AddressCohortVecs { fn compute_from_stateful( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> { @@ -277,7 +277,7 @@ impl CohortVecs for AddressCohortVecs { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &impl ReadableVec, all_supply_sats: &impl ReadableVec, exit: &Exit, diff --git a/crates/brk_computer/src/distribution/cohorts/traits.rs b/crates/brk_computer/src/distribution/cohorts/traits.rs index 9576c6c56..8616a717d 100644 --- a/crates/brk_computer/src/distribution/cohorts/traits.rs +++ b/crates/brk_computer/src/distribution/cohorts/traits.rs @@ -1,8 +1,8 @@ use brk_error::Result; -use brk_types::{Cents, Dollars, Height, Sats, Version}; +use brk_types::{Cents, Dollars, Height, Indexes, Sats, Version}; use vecdb::{Exit, ReadableVec}; -use crate::{ComputeIndexes, blocks, prices}; +use crate::{blocks, prices}; /// Dynamic dispatch trait for cohort vectors. /// @@ -35,14 +35,14 @@ pub trait DynCohortVecs: Send + Sync { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()>; /// Compute net_sentiment.height for separate cohorts (greed - pain). fn compute_net_sentiment_height( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()>; @@ -63,7 +63,7 @@ pub trait CohortVecs: DynCohortVecs { /// Compute aggregate cohort from component cohorts. fn compute_from_stateful( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()>; @@ -73,7 +73,7 @@ pub trait CohortVecs: DynCohortVecs { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &impl ReadableVec, all_supply_sats: &impl ReadableVec, exit: &Exit, diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs b/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs index 194c29ec0..a3deaa6e4 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs +++ b/crates/brk_computer/src/distribution/cohorts/utxo/groups.rs @@ -7,14 +7,14 @@ use brk_cohort::{ use brk_error::Result; use brk_traversable::Traversable; use brk_types::{ - BasisPoints16, Cents, CentsCompact, CostBasisDistribution, Date, Dollars, Height, Sats, - Version, + BasisPoints16, Cents, CentsCompact, CostBasisDistribution, Date, Dollars, Height, Indexes, + Sats, Version, }; use rayon::prelude::*; use vecdb::{AnyStoredVec, Database, Exit, ReadOnlyClone, ReadableVec, Rw, StorageMode, WritableVec}; use crate::{ - ComputeIndexes, blocks, + blocks, distribution::DynCohortVecs, indexes, internal::{PERCENTILES, PERCENTILES_LEN, compute_spot_percentile_rank}, @@ -76,7 +76,7 @@ impl UTXOCohorts { let all_full_name = CohortContext::Utxo.full_name(&Filter::All, ""); let all_cfg = ImportConfig { db, - filter: Filter::All, + filter: &Filter::All, full_name: &all_full_name, version: v + Version::ONE, indexes, @@ -91,7 +91,7 @@ impl UTXOCohorts { let full_name = CohortContext::Utxo.full_name(&f, name); let cfg = ImportConfig { db, - filter: f, + filter: &f, full_name: &full_name, version: v, indexes, @@ -110,7 +110,7 @@ impl UTXOCohorts { let full_name = CohortContext::Utxo.full_name(&f, name); let cfg = ImportConfig { db, - filter: f, + filter: &f, full_name: &full_name, version: v, indexes, @@ -141,7 +141,7 @@ impl UTXOCohorts { let full_name = CohortContext::Utxo.full_name(&f, "sth"); let cfg = ImportConfig { db, - filter: f, + filter: &f, full_name: &full_name, version: v, indexes, @@ -160,7 +160,7 @@ impl UTXOCohorts { let full_name = CohortContext::Utxo.full_name(&f, "lth"); let cfg = ImportConfig { db, - filter: f, + filter: &f, full_name: &full_name, version: v, indexes, @@ -177,7 +177,7 @@ impl UTXOCohorts { let full_name = CohortContext::Utxo.full_name(&f, name); let cfg = ImportConfig { db, - filter: f, + filter: &f, full_name: &full_name, version: v, indexes, @@ -195,7 +195,7 @@ impl UTXOCohorts { let full_name = CohortContext::Utxo.full_name(&f, name); let cfg = ImportConfig { db, - filter: f, + filter: &f, full_name: &full_name, version: v, indexes, @@ -213,7 +213,7 @@ impl UTXOCohorts { let full_name = CohortContext::Utxo.full_name(&f, name); let cfg = ImportConfig { db, - filter: f, + filter: &f, full_name: &full_name, version: v, indexes, @@ -301,7 +301,7 @@ impl UTXOCohorts { /// Compute overlapping cohorts from component age/amount range cohorts. pub(crate) fn compute_overlapping_vecs( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let age_range = &self.age_range; @@ -423,7 +423,7 @@ impl UTXOCohorts { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // 1. Compute all metrics except net_sentiment (all cohorts via DynCohortVecs) @@ -565,7 +565,7 @@ impl UTXOCohorts { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &HM, exit: &Exit, ) -> Result<()> diff --git a/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs b/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs index 01a2024b6..5d2510c5b 100644 --- a/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs +++ b/crates/brk_computer/src/distribution/cohorts/utxo/vecs.rs @@ -1,10 +1,10 @@ use brk_cohort::{Filter, Filtered}; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Height, Version}; +use brk_types::{Cents, Height, Indexes, Version}; use vecdb::{Exit, ReadableVec}; -use crate::{ComputeIndexes, blocks, distribution::state::UTXOCohortState, prices}; +use crate::{blocks, distribution::state::UTXOCohortState, prices}; use crate::distribution::metrics::CohortMetricsBase; @@ -127,7 +127,7 @@ impl DynCohortVecs for UTXOCohortVecs< &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.metrics @@ -136,7 +136,7 @@ impl DynCohortVecs for UTXOCohortVecs< fn compute_net_sentiment_height( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.metrics diff --git a/crates/brk_computer/src/distribution/compute/aggregates.rs b/crates/brk_computer/src/distribution/compute/aggregates.rs index 4007b8c01..f780492b3 100644 --- a/crates/brk_computer/src/distribution/compute/aggregates.rs +++ b/crates/brk_computer/src/distribution/compute/aggregates.rs @@ -1,9 +1,9 @@ use brk_error::Result; -use brk_types::{Dollars, Height}; +use brk_types::{Dollars, Height, Indexes}; use tracing::info; use vecdb::{Exit, ReadableVec}; -use crate::{ComputeIndexes, blocks, prices}; +use crate::{blocks, prices}; use super::super::cohorts::{AddressCohorts, UTXOCohorts}; @@ -15,7 +15,7 @@ use super::super::cohorts::{AddressCohorts, UTXOCohorts}; pub(crate) fn compute_overlapping( utxo_cohorts: &mut UTXOCohorts, address_cohorts: &mut AddressCohorts, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { info!("Computing overlapping cohorts..."); @@ -34,7 +34,7 @@ pub(crate) fn compute_rest_part1( address_cohorts: &mut AddressCohorts, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { info!("Computing rest part 1..."); @@ -53,7 +53,7 @@ pub(crate) fn compute_rest_part2( address_cohorts: &mut AddressCohorts, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &HM, exit: &Exit, ) -> Result<()> diff --git a/crates/brk_computer/src/distribution/metrics/activity.rs b/crates/brk_computer/src/distribution/metrics/activity.rs index d9131a812..44d2b7570 100644 --- a/crates/brk_computer/src/distribution/metrics/activity.rs +++ b/crates/brk_computer/src/distribution/metrics/activity.rs @@ -1,11 +1,11 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Bitcoin, Height, Sats, StoredF64, Version}; +use brk_types::{Bitcoin, Height, Indexes, Sats, StoredF64, Version}; use rayon::prelude::*; use vecdb::{AnyStoredVec, AnyVec, EagerVec, Exit, ImportableVec, PcoVec, Rw, StorageMode, WritableVec}; use crate::{ - ComputeIndexes, blocks, + blocks, internal::{ComputedFromHeightCumulativeSum, RollingEmas2w, ValueFromHeightCumulative}, }; @@ -37,45 +37,22 @@ impl ActivityMetrics { /// Import activity metrics from database. pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { Ok(Self { - sent: ValueFromHeightCumulative::forced_import( - cfg.db, - &cfg.name("sent"), - cfg.version, - cfg.indexes, - )?, - - sent_ema: RollingEmas2w::forced_import( - cfg.db, - &cfg.name("sent"), - cfg.version, - cfg.indexes, - )?, + sent: cfg.import_value_cumulative("sent", Version::ZERO)?, + sent_ema: cfg.import_emas_2w("sent", Version::ZERO)?, satblocks_destroyed: EagerVec::forced_import( cfg.db, &cfg.name("satblocks_destroyed"), cfg.version, )?, - satdays_destroyed: EagerVec::forced_import( cfg.db, &cfg.name("satdays_destroyed"), cfg.version, )?, - coinblocks_destroyed: ComputedFromHeightCumulativeSum::forced_import( - cfg.db, - &cfg.name("coinblocks_destroyed"), - cfg.version, - cfg.indexes, - )?, - - coindays_destroyed: ComputedFromHeightCumulativeSum::forced_import( - cfg.db, - &cfg.name("coindays_destroyed"), - cfg.version, - cfg.indexes, - )?, + coinblocks_destroyed: cfg.import_cumulative_sum("coinblocks_destroyed", Version::ZERO)?, + coindays_destroyed: cfg.import_cumulative_sum("coindays_destroyed", Version::ZERO)?, }) } @@ -125,7 +102,7 @@ impl ActivityMetrics { /// Compute aggregate values from separate cohorts. pub(crate) fn compute_from_stateful( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> { @@ -160,7 +137,7 @@ impl ActivityMetrics { pub(crate) fn compute_rest_part1( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = blocks.count.window_starts(); diff --git a/crates/brk_computer/src/distribution/metrics/cohort/adjusted.rs b/crates/brk_computer/src/distribution/metrics/cohort/adjusted.rs index 21e937b03..aa411d226 100644 --- a/crates/brk_computer/src/distribution/metrics/cohort/adjusted.rs +++ b/crates/brk_computer/src/distribution/metrics/cohort/adjusted.rs @@ -1,11 +1,11 @@ use brk_cohort::Filter; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Dollars, Height, Sats, Version}; +use brk_types::{Cents, Dollars, Height, Indexes, Sats, Version}; use rayon::prelude::*; use vecdb::{AnyStoredVec, Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, distribution::state::CohortState, prices}; +use crate::{blocks, distribution::state::CohortState, prices}; use crate::distribution::metrics::{ ActivityMetrics, CohortMetricsBase, CostBasisBase, ImportConfig, OutputsMetrics, RealizedBase, @@ -95,7 +95,7 @@ impl AdjustedCohortMetrics { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &impl ReadableVec, up_to_1h_value_created: &impl ReadableVec, up_to_1h_value_destroyed: &impl ReadableVec, diff --git a/crates/brk_computer/src/distribution/metrics/cohort/all.rs b/crates/brk_computer/src/distribution/metrics/cohort/all.rs index 8a5130a2b..3d3699099 100644 --- a/crates/brk_computer/src/distribution/metrics/cohort/all.rs +++ b/crates/brk_computer/src/distribution/metrics/cohort/all.rs @@ -1,11 +1,11 @@ use brk_cohort::Filter; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Dollars, Height, Version}; +use brk_types::{Cents, Dollars, Height, Indexes, Version}; use rayon::prelude::*; use vecdb::{AnyStoredVec, Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, distribution::state::CohortState, prices}; +use crate::{blocks, distribution::state::CohortState, prices}; use crate::distribution::metrics::{ ActivityMetrics, CohortMetricsBase, CostBasisBase, CostBasisWithExtended, ImportConfig, @@ -135,7 +135,7 @@ impl AllCohortMetrics { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &impl ReadableVec, up_to_1h_value_created: &impl ReadableVec, up_to_1h_value_destroyed: &impl ReadableVec, diff --git a/crates/brk_computer/src/distribution/metrics/cohort/basic.rs b/crates/brk_computer/src/distribution/metrics/cohort/basic.rs index dfe77f1a4..affe7903d 100644 --- a/crates/brk_computer/src/distribution/metrics/cohort/basic.rs +++ b/crates/brk_computer/src/distribution/metrics/cohort/basic.rs @@ -1,11 +1,11 @@ use brk_cohort::Filter; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Dollars, Height, Sats, Version}; +use brk_types::{Cents, Dollars, Height, Indexes, Sats, Version}; use rayon::prelude::*; use vecdb::{AnyStoredVec, Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, distribution::state::CohortState, prices}; +use crate::{blocks, distribution::state::CohortState, prices}; use crate::distribution::metrics::{ ActivityMetrics, CohortMetricsBase, CostBasisBase, ImportConfig, OutputsMetrics, @@ -97,7 +97,7 @@ impl BasicCohortMetrics { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &impl ReadableVec, all_supply_sats: &impl ReadableVec, exit: &Exit, @@ -126,7 +126,7 @@ impl BasicCohortMetrics { pub(crate) fn compute_from_stateful( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> { diff --git a/crates/brk_computer/src/distribution/metrics/cohort/extended.rs b/crates/brk_computer/src/distribution/metrics/cohort/extended.rs index 31fc4048e..7cc2c868c 100644 --- a/crates/brk_computer/src/distribution/metrics/cohort/extended.rs +++ b/crates/brk_computer/src/distribution/metrics/cohort/extended.rs @@ -1,11 +1,11 @@ use brk_cohort::Filter; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Dollars, Height, Sats, Version}; +use brk_types::{Cents, Dollars, Height, Indexes, Sats, Version}; use rayon::prelude::*; use vecdb::{AnyStoredVec, Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, distribution::state::CohortState, prices}; +use crate::{blocks, distribution::state::CohortState, prices}; use crate::distribution::metrics::{ ActivityMetrics, CohortMetricsBase, CostBasisBase, CostBasisWithExtended, ImportConfig, @@ -98,7 +98,7 @@ impl ExtendedCohortMetrics { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &impl ReadableVec, all_supply_sats: &impl ReadableVec, exit: &Exit, diff --git a/crates/brk_computer/src/distribution/metrics/cohort/extended_adjusted.rs b/crates/brk_computer/src/distribution/metrics/cohort/extended_adjusted.rs index 266f88351..3c90b5129 100644 --- a/crates/brk_computer/src/distribution/metrics/cohort/extended_adjusted.rs +++ b/crates/brk_computer/src/distribution/metrics/cohort/extended_adjusted.rs @@ -1,11 +1,11 @@ use brk_cohort::Filter; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Dollars, Height, Sats, Version}; +use brk_types::{Cents, Dollars, Height, Indexes, Sats, Version}; use rayon::prelude::*; use vecdb::{AnyStoredVec, Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, distribution::state::CohortState, prices}; +use crate::{blocks, distribution::state::CohortState, prices}; use crate::distribution::metrics::{ ActivityMetrics, CohortMetricsBase, CostBasisBase, CostBasisWithExtended, ImportConfig, @@ -98,7 +98,7 @@ impl ExtendedAdjustedCohortMetrics { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &impl ReadableVec, up_to_1h_value_created: &impl ReadableVec, up_to_1h_value_destroyed: &impl ReadableVec, diff --git a/crates/brk_computer/src/distribution/metrics/config.rs b/crates/brk_computer/src/distribution/metrics/config.rs index 1a3a70996..551558a36 100644 --- a/crates/brk_computer/src/distribution/metrics/config.rs +++ b/crates/brk_computer/src/distribution/metrics/config.rs @@ -1,13 +1,24 @@ use brk_cohort::Filter; -use brk_types::Version; -use vecdb::Database; +use brk_error::Result; +use brk_types::{BasisPoints16, BasisPointsSigned16, Cents, Height, Version}; +use schemars::JsonSchema; +use vecdb::{BytesVec, BytesVecValue, Database, ImportableVec}; -use crate::indexes; +use crate::{ + indexes, + internal::{ + CentsType, ComputedFromHeight, ComputedFromHeightCumulative, ComputedFromHeightCumulativeSum, + ComputedFromHeightRatio, FiatFromHeight, NumericValue, PercentFromHeight, + PercentRollingEmas1w1m, PercentRollingWindows, Price, RollingEmas1w1m, RollingEmas2w, + RollingWindows, ValueFromHeight, ValueFromHeightChange, ValueFromHeightCumulative, + }, +}; /// Configuration for importing metrics. +#[derive(Clone, Copy)] pub struct ImportConfig<'a> { pub db: &'a Database, - pub filter: Filter, + pub filter: &'a Filter, pub full_name: &'a str, pub version: Version, pub indexes: &'a indexes::Vecs, @@ -25,4 +36,103 @@ impl<'a> ImportConfig<'a> { } } + // --- Computed types --- + + pub(crate) fn import_computed( + &self, + suffix: &str, + offset: Version, + ) -> Result> { + ComputedFromHeight::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_cumulative( + &self, + suffix: &str, + offset: Version, + ) -> Result> { + ComputedFromHeightCumulative::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_cumulative_sum( + &self, + suffix: &str, + offset: Version, + ) -> Result> { + ComputedFromHeightCumulativeSum::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + // --- Percent types --- + + pub(crate) fn import_percent_bp16( + &self, + suffix: &str, + offset: Version, + ) -> Result> { + PercentFromHeight::forced_import_bp16(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_percent_bps16( + &self, + suffix: &str, + offset: Version, + ) -> Result> { + PercentFromHeight::forced_import_bps16(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + // --- Value types --- + + pub(crate) fn import_fiat(&self, suffix: &str, offset: Version) -> Result> { + FiatFromHeight::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_value(&self, suffix: &str, offset: Version) -> Result { + ValueFromHeight::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_value_cumulative(&self, suffix: &str, offset: Version) -> Result { + ValueFromHeightCumulative::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_value_change(&self, suffix: &str, offset: Version) -> Result { + ValueFromHeightChange::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + // --- Price and ratio --- + + pub(crate) fn import_price(&self, suffix: &str, offset: Version) -> Result>> { + Price::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_ratio(&self, suffix: &str, offset: Version) -> Result { + ComputedFromHeightRatio::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + // --- Bytes --- + + pub(crate) fn import_bytes(&self, suffix: &str, offset: Version) -> Result> { + Ok(BytesVec::forced_import(self.db, &self.name(suffix), self.version + offset)?) + } + + // --- Rolling --- + + pub(crate) fn import_rolling(&self, suffix: &str, offset: Version) -> Result> { + RollingWindows::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_percent_rolling_bp16(&self, suffix: &str, offset: Version) -> Result> { + PercentRollingWindows::forced_import_bp16(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_emas_1w_1m(&self, suffix: &str, offset: Version) -> Result> { + RollingEmas1w1m::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_percent_emas_1w_1m_bp16(&self, suffix: &str, offset: Version) -> Result> { + PercentRollingEmas1w1m::forced_import_bp16(self.db, &self.name(suffix), self.version + offset, self.indexes) + } + + pub(crate) fn import_emas_2w(&self, suffix: &str, offset: Version) -> Result { + RollingEmas2w::forced_import(self.db, &self.name(suffix), self.version + offset, self.indexes) + } } diff --git a/crates/brk_computer/src/distribution/metrics/cost_basis/base.rs b/crates/brk_computer/src/distribution/metrics/cost_basis/base.rs index dfeee4417..f3d81d7a5 100644 --- a/crates/brk_computer/src/distribution/metrics/cost_basis/base.rs +++ b/crates/brk_computer/src/distribution/metrics/cost_basis/base.rs @@ -1,10 +1,9 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Height}; +use brk_types::{Cents, Height, Indexes, Version}; use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec}; use crate::{ - ComputeIndexes, distribution::state::CohortState, internal::{ComputedFromHeight, Price}, }; @@ -24,18 +23,8 @@ pub struct CostBasisBase { impl CostBasisBase { pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { Ok(Self { - min: Price::forced_import( - cfg.db, - &cfg.name("cost_basis_min"), - cfg.version, - cfg.indexes, - )?, - max: Price::forced_import( - cfg.db, - &cfg.name("cost_basis_max"), - cfg.version, - cfg.indexes, - )?, + min: cfg.import_price("cost_basis_min", Version::ZERO)?, + max: cfg.import_price("cost_basis_max", Version::ZERO)?, }) } @@ -74,7 +63,7 @@ impl CostBasisBase { pub(crate) fn compute_from_stateful( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> { diff --git a/crates/brk_computer/src/distribution/metrics/cost_basis/extended.rs b/crates/brk_computer/src/distribution/metrics/cost_basis/extended.rs index c3803fac5..268e3e91e 100644 --- a/crates/brk_computer/src/distribution/metrics/cost_basis/extended.rs +++ b/crates/brk_computer/src/distribution/metrics/cost_basis/extended.rs @@ -44,18 +44,8 @@ impl CostBasisExtended { cfg.version, cfg.indexes, )?, - spot_cost_basis_percentile: PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("spot_cost_basis_percentile"), - cfg.version, - cfg.indexes, - )?, - spot_invested_capital_percentile: PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("spot_invested_capital_percentile"), - cfg.version, - cfg.indexes, - )?, + spot_cost_basis_percentile: cfg.import_percent_bp16("spot_cost_basis_percentile", Version::ZERO)?, + spot_invested_capital_percentile: cfg.import_percent_bp16("spot_invested_capital_percentile", Version::ZERO)?, }) } diff --git a/crates/brk_computer/src/distribution/metrics/mod.rs b/crates/brk_computer/src/distribution/metrics/mod.rs index 2c70fc046..1bf51f20f 100644 --- a/crates/brk_computer/src/distribution/metrics/mod.rs +++ b/crates/brk_computer/src/distribution/metrics/mod.rs @@ -20,10 +20,10 @@ pub use unrealized::*; use brk_cohort::Filter; use brk_error::Result; -use brk_types::{Cents, Height, Version}; +use brk_types::{Cents, Height, Indexes, Version}; use vecdb::{AnyStoredVec, Exit}; -use crate::{ComputeIndexes, blocks, distribution::state::CohortState, prices}; +use crate::{blocks, distribution::state::CohortState, prices}; /// Trait defining the interface for cohort metrics containers. /// @@ -96,7 +96,7 @@ pub trait CohortMetricsBase: Send + Sync { /// Compute net_sentiment.height as capital-weighted average of component cohorts (same type). fn compute_net_sentiment_from_others( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> @@ -124,7 +124,7 @@ pub trait CohortMetricsBase: Send + Sync { /// Compute net_sentiment.height as capital-weighted average from heterogeneous sources. fn compute_net_sentiment_from_others_dyn( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&dyn CohortMetricsBase], exit: &Exit, ) -> Result<()> { @@ -151,7 +151,7 @@ pub trait CohortMetricsBase: Send + Sync { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.supply_mut() @@ -184,7 +184,7 @@ pub trait CohortMetricsBase: Send + Sync { /// Compute net_sentiment.height for separate cohorts (greed - pain). fn compute_net_sentiment_height( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.unrealized_base_mut() @@ -196,7 +196,7 @@ pub trait CohortMetricsBase: Send + Sync { /// Uses only base fields (supply, outputs, activity, realized_base, unrealized_base, cost_basis_base). fn compute_base_from_others( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&dyn CohortMetricsBase], exit: &Exit, ) -> Result<()> diff --git a/crates/brk_computer/src/distribution/metrics/outputs.rs b/crates/brk_computer/src/distribution/metrics/outputs.rs index 7ae4f9dc5..03823c151 100644 --- a/crates/brk_computer/src/distribution/metrics/outputs.rs +++ b/crates/brk_computer/src/distribution/metrics/outputs.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Height, StoredF64, StoredU64}; +use brk_types::{Height, Indexes, StoredF64, StoredU64, Version}; use rayon::prelude::*; use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec}; -use crate::{ComputeIndexes, blocks, internal::ComputedFromHeight}; +use crate::{blocks, internal::ComputedFromHeight}; use super::ImportConfig; @@ -19,18 +19,8 @@ impl OutputsMetrics { /// Import output metrics from database. pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { Ok(Self { - utxo_count: ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("utxo_count"), - cfg.version, - cfg.indexes, - )?, - utxo_count_change_1m: ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("utxo_count_change_1m"), - cfg.version, - cfg.indexes, - )?, + utxo_count: cfg.import_computed("utxo_count", Version::ZERO)?, + utxo_count_change_1m: cfg.import_computed("utxo_count_change_1m", Version::ZERO)?, }) } @@ -55,7 +45,7 @@ impl OutputsMetrics { /// Compute aggregate values from separate cohorts. pub(crate) fn compute_from_stateful( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> { @@ -74,7 +64,7 @@ impl OutputsMetrics { pub(crate) fn compute_rest( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.utxo_count_change_1m.height.compute_rolling_change( diff --git a/crates/brk_computer/src/distribution/metrics/realized/adjusted.rs b/crates/brk_computer/src/distribution/metrics/realized/adjusted.rs index cc6f54d60..1b02e5f55 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/adjusted.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/adjusted.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Height, StoredF64, Version}; +use brk_types::{Cents, Height, Indexes, StoredF64, Version}; use vecdb::{Exit, ReadableVec, Rw, StorageMode}; use crate::{ - ComputeIndexes, blocks, + blocks, internal::{ComputedFromHeight, RatioCents64, RollingEmas1w1m, RollingWindows}, }; @@ -28,41 +28,13 @@ pub struct RealizedAdjusted { impl RealizedAdjusted { pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - - let adjusted_value_created = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("adjusted_value_created"), - cfg.version, - cfg.indexes, - )?; - let adjusted_value_destroyed = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("adjusted_value_destroyed"), - cfg.version, - cfg.indexes, - )?; - - let adjusted_value_created_sum = RollingWindows::forced_import( - cfg.db, &cfg.name("adjusted_value_created"), cfg.version + v1, cfg.indexes, - )?; - let adjusted_value_destroyed_sum = RollingWindows::forced_import( - cfg.db, &cfg.name("adjusted_value_destroyed"), cfg.version + v1, cfg.indexes, - )?; - let adjusted_sopr = RollingWindows::forced_import( - cfg.db, &cfg.name("adjusted_sopr"), cfg.version + v1, cfg.indexes, - )?; - let adjusted_sopr_ema = RollingEmas1w1m::forced_import( - cfg.db, &cfg.name("adjusted_sopr_24h"), cfg.version + v1, cfg.indexes, - )?; - Ok(RealizedAdjusted { - adjusted_value_created, - adjusted_value_destroyed, - adjusted_value_created_sum, - adjusted_value_destroyed_sum, - adjusted_sopr, - adjusted_sopr_ema, + adjusted_value_created: cfg.import_computed("adjusted_value_created", Version::ZERO)?, + adjusted_value_destroyed: cfg.import_computed("adjusted_value_destroyed", Version::ZERO)?, + adjusted_value_created_sum: cfg.import_rolling("adjusted_value_created", Version::ONE)?, + adjusted_value_destroyed_sum: cfg.import_rolling("adjusted_value_destroyed", Version::ONE)?, + adjusted_sopr: cfg.import_rolling("adjusted_sopr", Version::ONE)?, + adjusted_sopr_ema: cfg.import_emas_1w_1m("adjusted_sopr_24h", Version::ONE)?, }) } @@ -70,7 +42,7 @@ impl RealizedAdjusted { pub(crate) fn compute_rest_part2_adj( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, base_value_created: &impl ReadableVec, base_value_destroyed: &impl ReadableVec, up_to_1h_value_created: &impl ReadableVec, diff --git a/crates/brk_computer/src/distribution/metrics/realized/base.rs b/crates/brk_computer/src/distribution/metrics/realized/base.rs index 3ca2e47c8..584596e52 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/base.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/base.rs @@ -2,15 +2,15 @@ use brk_error::Result; use brk_traversable::Traversable; use brk_types::{ BasisPoints16, BasisPoints32, BasisPointsSigned16, - Bitcoin, Cents, CentsSats, CentsSigned, CentsSquaredSats, Dollars, Height, Sats, StoredF32, StoredF64, Version, + Bitcoin, Cents, CentsSats, CentsSigned, CentsSquaredSats, Dollars, Height, Indexes, Sats, StoredF32, StoredF64, Version, }; use vecdb::{ - AnyStoredVec, AnyVec, BytesVec, Exit, ImportableVec, ReadableCloneableVec, + AnyStoredVec, AnyVec, BytesVec, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode, WritableVec, }; use crate::{ - ComputeIndexes, blocks, + blocks, distribution::state::RealizedState, internal::{ CentsPlus, CentsUnsignedToDollars, ComputedFromHeightCumulative, ComputedFromHeight, @@ -113,258 +113,87 @@ pub struct RealizedBase { impl RealizedBase { /// Import realized base metrics from database. pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + let v0 = Version::ZERO; let v1 = Version::ONE; - let v2 = Version::new(2); - let v3 = Version::new(3); - // Import combined types using forced_import which handles height + derived - let realized_cap_cents = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("realized_cap_cents"), - cfg.version, - cfg.indexes, - )?; + let realized_cap_cents = cfg.import_computed("realized_cap_cents", v0)?; let realized_cap = LazyFromHeight::from_computed::( - &cfg.name("realized_cap"), - cfg.version, - realized_cap_cents.height.read_only_boxed_clone(), - &realized_cap_cents, + &cfg.name("realized_cap"), cfg.version, + realized_cap_cents.height.read_only_boxed_clone(), &realized_cap_cents, ); - let realized_profit = ComputedFromHeightCumulative::forced_import( - cfg.db, - &cfg.name("realized_profit"), - cfg.version, - cfg.indexes, - )?; - - let realized_profit_ema_1w = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("realized_profit_ema_1w"), - cfg.version, - cfg.indexes, - )?; - - let realized_loss = ComputedFromHeightCumulative::forced_import( - cfg.db, - &cfg.name("realized_loss"), - cfg.version, - cfg.indexes, - )?; - - let realized_loss_ema_1w = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("realized_loss_ema_1w"), - cfg.version, - cfg.indexes, - )?; + let realized_profit = cfg.import_cumulative("realized_profit", v0)?; + let realized_profit_ema_1w = cfg.import_computed("realized_profit_ema_1w", v0)?; + let realized_loss = cfg.import_cumulative("realized_loss", v0)?; + let realized_loss_ema_1w = cfg.import_computed("realized_loss_ema_1w", v0)?; let neg_realized_loss = LazyFromHeight::from_height_source::( - &cfg.name("neg_realized_loss"), - cfg.version + v1, - realized_loss.height.read_only_boxed_clone(), - cfg.indexes, + &cfg.name("neg_realized_loss"), cfg.version + Version::ONE, + realized_loss.height.read_only_boxed_clone(), cfg.indexes, ); - let net_realized_pnl = ComputedFromHeightCumulative::forced_import( - cfg.db, - &cfg.name("net_realized_pnl"), - cfg.version, - cfg.indexes, - )?; - - let net_realized_pnl_ema_1w = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("net_realized_pnl_ema_1w"), - cfg.version, - cfg.indexes, - )?; - - let peak_regret = ComputedFromHeightCumulative::forced_import( - cfg.db, - &cfg.name("realized_peak_regret"), - cfg.version + v2, - cfg.indexes, - )?; - - let gross_pnl = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("gross_pnl"), - cfg.version, - cfg.indexes, - )?; + let net_realized_pnl = cfg.import_cumulative("net_realized_pnl", v0)?; + let net_realized_pnl_ema_1w = cfg.import_computed("net_realized_pnl_ema_1w", v0)?; + let peak_regret = cfg.import_cumulative("realized_peak_regret", Version::new(2))?; + let gross_pnl = cfg.import_fiat("realized_gross_pnl", v0)?; let realized_profit_rel_to_realized_cap = - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("realized_profit_rel_to_realized_cap"), - cfg.version + v1, - cfg.indexes, - )?; - + cfg.import_percent_bp16("realized_profit_rel_to_realized_cap", v1)?; let realized_loss_rel_to_realized_cap = - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("realized_loss_rel_to_realized_cap"), - cfg.version + v1, - cfg.indexes, - )?; - + cfg.import_percent_bp16("realized_loss_rel_to_realized_cap", v1)?; let net_realized_pnl_rel_to_realized_cap = - PercentFromHeight::forced_import_bps16( - cfg.db, - &cfg.name("net_realized_pnl_rel_to_realized_cap"), - cfg.version + v1, - cfg.indexes, - )?; + cfg.import_percent_bps16("net_realized_pnl_rel_to_realized_cap", v1)?; - let realized_price = Price::forced_import( - cfg.db, - &cfg.name("realized_price"), - cfg.version + v1, - cfg.indexes, - )?; + let realized_price = cfg.import_price("realized_price", v1)?; + let investor_price = cfg.import_price("investor_price", v0)?; + let investor_price_ratio = cfg.import_ratio("investor_price", v0)?; + let lower_price_band = cfg.import_price("lower_price_band", v0)?; + let upper_price_band = cfg.import_price("upper_price_band", v0)?; - let investor_price = Price::forced_import( - cfg.db, - &cfg.name("investor_price"), - cfg.version, - cfg.indexes, - )?; + let cap_raw = cfg.import_bytes("cap_raw", v0)?; + let investor_cap_raw = cfg.import_bytes("investor_cap_raw", v0)?; - let investor_price_ratio = ComputedFromHeightRatio::forced_import( - cfg.db, - &cfg.name("investor_price"), - cfg.version, - cfg.indexes, - )?; - - let lower_price_band = Price::forced_import( - cfg.db, - &cfg.name("lower_price_band"), - cfg.version, - cfg.indexes, - )?; - - let upper_price_band = Price::forced_import( - cfg.db, - &cfg.name("upper_price_band"), - cfg.version, - cfg.indexes, - )?; - - let cap_raw = BytesVec::forced_import(cfg.db, &cfg.name("cap_raw"), cfg.version)?; - let investor_cap_raw = - BytesVec::forced_import(cfg.db, &cfg.name("investor_cap_raw"), cfg.version)?; - - let profit_value_created = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("profit_value_created"), - cfg.version, - cfg.indexes, - )?; - let profit_value_destroyed = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("profit_value_destroyed"), - cfg.version, - cfg.indexes, - )?; - let loss_value_created = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("loss_value_created"), - cfg.version, - cfg.indexes, - )?; - let loss_value_destroyed = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("loss_value_destroyed"), - cfg.version, - cfg.indexes, - )?; - - let value_created = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("value_created"), - cfg.version, - cfg.indexes, - )?; - let value_destroyed = ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("value_destroyed"), - cfg.version, - cfg.indexes, - )?; + let profit_value_created = cfg.import_computed("profit_value_created", v0)?; + let profit_value_destroyed = cfg.import_computed("profit_value_destroyed", v0)?; + let loss_value_created = cfg.import_computed("loss_value_created", v0)?; + let loss_value_destroyed = cfg.import_computed("loss_value_destroyed", v0)?; + let value_created = cfg.import_computed("value_created", v0)?; + let value_destroyed = cfg.import_computed("value_destroyed", v0)?; let capitulation_flow = LazyFromHeight::from_computed::( - &cfg.name("capitulation_flow"), - cfg.version, - loss_value_destroyed.height.read_only_boxed_clone(), - &loss_value_destroyed, + &cfg.name("capitulation_flow"), cfg.version, + loss_value_destroyed.height.read_only_boxed_clone(), &loss_value_destroyed, ); let profit_flow = LazyFromHeight::from_computed::( - &cfg.name("profit_flow"), - cfg.version, - profit_value_destroyed.height.read_only_boxed_clone(), - &profit_value_destroyed, + &cfg.name("profit_flow"), cfg.version, + profit_value_destroyed.height.read_only_boxed_clone(), &profit_value_destroyed, ); - let realized_price_ratio = ComputedFromHeightRatio::forced_import( - cfg.db, - &cfg.name("realized_price"), - cfg.version + v1, - cfg.indexes, - )?; - + let realized_price_ratio = cfg.import_ratio("realized_price", v1)?; let mvrv = LazyFromHeight::from_lazy::, BasisPoints32>( - &cfg.name("mvrv"), - cfg.version, - &realized_price_ratio.ratio, + &cfg.name("mvrv"), cfg.version, &realized_price_ratio.ratio, ); - // === Rolling windows === - let value_created_sum = RollingWindows::forced_import( - cfg.db, &cfg.name("value_created"), cfg.version + v1, cfg.indexes, - )?; - let value_destroyed_sum = RollingWindows::forced_import( - cfg.db, &cfg.name("value_destroyed"), cfg.version + v1, cfg.indexes, - )?; - let gross_pnl_sum = RollingWindows::forced_import( - cfg.db, &cfg.name("gross_pnl_sum"), cfg.version + v1, cfg.indexes, - )?; - let sopr = RollingWindows::forced_import( - cfg.db, &cfg.name("sopr"), cfg.version + v1, cfg.indexes, - )?; - let sell_side_risk_ratio = PercentRollingWindows::forced_import_bp16( - cfg.db, &cfg.name("sell_side_risk_ratio"), cfg.version + v1, cfg.indexes, - )?; + // Rolling windows + let value_created_sum = cfg.import_rolling("value_created", v1)?; + let value_destroyed_sum = cfg.import_rolling("value_destroyed", v1)?; + let gross_pnl_sum = cfg.import_rolling("gross_pnl_sum", v1)?; + let sopr = cfg.import_rolling("sopr", v1)?; + let sell_side_risk_ratio = cfg.import_percent_rolling_bp16("sell_side_risk_ratio", v1)?; - // === EMA imports === - let sopr_24h_ema = RollingEmas1w1m::forced_import( - cfg.db, &cfg.name("sopr_24h"), cfg.version + v1, cfg.indexes, - )?; - let sell_side_risk_ratio_24h_ema = PercentRollingEmas1w1m::forced_import_bp16( - cfg.db, &cfg.name("sell_side_risk_ratio_24h"), cfg.version + v1, cfg.indexes, - )?; + // EMAs + let sopr_24h_ema = cfg.import_emas_1w_1m("sopr_24h", v1)?; + let sell_side_risk_ratio_24h_ema = cfg.import_percent_emas_1w_1m_bp16("sell_side_risk_ratio_24h", v1)?; let peak_regret_rel_to_realized_cap = - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("realized_peak_regret_rel_to_realized_cap"), - cfg.version + v1, - cfg.indexes, - )?; + cfg.import_percent_bp16("realized_peak_regret_rel_to_realized_cap", v1)?; Ok(Self { realized_cap_cents, realized_cap, realized_price, realized_price_ratio, - realized_cap_change_1m: ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("realized_cap_change_1m"), - cfg.version, - cfg.indexes, - )?, + realized_cap_change_1m: cfg.import_computed("realized_cap_change_1m", v0)?, investor_price, investor_price_ratio, lower_price_band, @@ -398,52 +227,17 @@ impl RealizedBase { gross_pnl_sum, sell_side_risk_ratio, sell_side_risk_ratio_24h_ema, - net_pnl_change_1m: ComputedFromHeight::forced_import( - cfg.db, - &cfg.name("net_pnl_change_1m"), - cfg.version + v3, - cfg.indexes, - )?, + net_pnl_change_1m: cfg.import_computed("net_pnl_change_1m", Version::new(3))?, net_pnl_change_1m_rel_to_realized_cap: - PercentFromHeight::forced_import_bps16( - cfg.db, - &cfg.name("net_pnl_change_1m_rel_to_realized_cap"), - cfg.version + v3, - cfg.indexes, - )?, + cfg.import_percent_bps16("net_pnl_change_1m_rel_to_realized_cap", Version::new(3))?, net_pnl_change_1m_rel_to_market_cap: - PercentFromHeight::forced_import_bps16( - cfg.db, - &cfg.name("net_pnl_change_1m_rel_to_market_cap"), - cfg.version + v3, - cfg.indexes, - )?, + cfg.import_percent_bps16("net_pnl_change_1m_rel_to_market_cap", Version::new(3))?, peak_regret, peak_regret_rel_to_realized_cap, - sent_in_profit: ValueFromHeightCumulative::forced_import( - cfg.db, - &cfg.name("sent_in_profit"), - cfg.version, - cfg.indexes, - )?, - sent_in_profit_ema: RollingEmas2w::forced_import( - cfg.db, - &cfg.name("sent_in_profit"), - cfg.version, - cfg.indexes, - )?, - sent_in_loss: ValueFromHeightCumulative::forced_import( - cfg.db, - &cfg.name("sent_in_loss"), - cfg.version, - cfg.indexes, - )?, - sent_in_loss_ema: RollingEmas2w::forced_import( - cfg.db, - &cfg.name("sent_in_loss"), - cfg.version, - cfg.indexes, - )?, + sent_in_profit: cfg.import_value_cumulative("sent_in_profit", v0)?, + sent_in_profit_ema: cfg.import_emas_2w("sent_in_profit", v0)?, + sent_in_loss: cfg.import_value_cumulative("sent_in_loss", v0)?, + sent_in_loss_ema: cfg.import_emas_2w("sent_in_loss", v0)?, }) } @@ -534,7 +328,7 @@ impl RealizedBase { /// Compute aggregate values from separate cohorts. pub(crate) fn compute_from_stateful( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> { @@ -683,7 +477,7 @@ impl RealizedBase { /// First phase of computed metrics (indexes from height). pub(crate) fn compute_rest_part1( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.realized_profit @@ -724,7 +518,7 @@ impl RealizedBase { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_supply: &impl ReadableVec, height_to_market_cap: &impl ReadableVec, exit: &Exit, diff --git a/crates/brk_computer/src/distribution/metrics/realized/extended.rs b/crates/brk_computer/src/distribution/metrics/realized/extended.rs index 45d48fe47..2d38ff1d9 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/extended.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/extended.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{BasisPoints16, Cents, Dollars, Height, StoredF64, Version}; +use brk_types::{BasisPoints16, Cents, Dollars, Height, Indexes, StoredF64, Version}; use vecdb::{Exit, ReadableVec, Rw, StorageMode}; use crate::{ - ComputeIndexes, blocks, + blocks, internal::{ ComputedFromHeightRatioExtension, PercentFromHeight, RatioCents64, RatioDollarsBp16, RollingWindows, @@ -34,35 +34,16 @@ pub struct RealizedExtended { impl RealizedExtended { pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let v1 = Version::ONE; - Ok(RealizedExtended { - realized_cap_rel_to_own_market_cap: PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("realized_cap_rel_to_own_market_cap"), - cfg.version, - cfg.indexes, - )?, - realized_profit_sum: RollingWindows::forced_import( - cfg.db, &cfg.name("realized_profit"), cfg.version + v1, cfg.indexes, - )?, - realized_loss_sum: RollingWindows::forced_import( - cfg.db, &cfg.name("realized_loss"), cfg.version + v1, cfg.indexes, - )?, - realized_profit_to_loss_ratio: RollingWindows::forced_import( - cfg.db, &cfg.name("realized_profit_to_loss_ratio"), cfg.version + v1, cfg.indexes, - )?, + realized_cap_rel_to_own_market_cap: cfg.import_percent_bp16("realized_cap_rel_to_own_market_cap", Version::ZERO)?, + realized_profit_sum: cfg.import_rolling("realized_profit", Version::ONE)?, + realized_loss_sum: cfg.import_rolling("realized_loss", Version::ONE)?, + realized_profit_to_loss_ratio: cfg.import_rolling("realized_profit_to_loss_ratio", Version::ONE)?, realized_price_ratio_ext: ComputedFromHeightRatioExtension::forced_import( - cfg.db, - &cfg.name("realized_price"), - cfg.version + v1, - cfg.indexes, + cfg.db, &cfg.name("realized_price"), cfg.version + Version::ONE, cfg.indexes, )?, investor_price_ratio_ext: ComputedFromHeightRatioExtension::forced_import( - cfg.db, - &cfg.name("investor_price"), - cfg.version, - cfg.indexes, + cfg.db, &cfg.name("investor_price"), cfg.version, cfg.indexes, )?, }) } @@ -72,7 +53,7 @@ impl RealizedExtended { &mut self, base: &RealizedBase, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_market_cap: &impl ReadableVec, exit: &Exit, ) -> Result<()> { 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 0486df4ac..80ec6fb3b 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/with_adjusted.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/with_adjusted.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Bitcoin, Cents, Dollars, Height}; +use brk_types::{Bitcoin, Cents, Dollars, Height, Indexes}; use derive_more::{Deref, DerefMut}; use vecdb::{Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, prices}; +use crate::{blocks, prices}; use crate::distribution::metrics::ImportConfig; @@ -33,7 +33,7 @@ impl RealizedWithAdjusted { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_supply: &impl ReadableVec, height_to_market_cap: &impl ReadableVec, up_to_1h_value_created: &impl ReadableVec, 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 f4522639e..24aee0bcc 100644 --- a/crates/brk_computer/src/distribution/metrics/realized/with_extended.rs +++ b/crates/brk_computer/src/distribution/metrics/realized/with_extended.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Bitcoin, Dollars, Height}; +use brk_types::{Bitcoin, Dollars, Height, Indexes}; use derive_more::{Deref, DerefMut}; use vecdb::{Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, prices}; +use crate::{blocks, prices}; use crate::distribution::metrics::ImportConfig; @@ -33,7 +33,7 @@ impl RealizedWithExtended { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_supply: &impl ReadableVec, height_to_market_cap: &impl ReadableVec, exit: &Exit, 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 0989af4ca..45a0a9ee8 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 @@ -1,10 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Bitcoin, Cents, Dollars, Height}; +use brk_types::{Bitcoin, Cents, Dollars, Height, Indexes}; use derive_more::{Deref, DerefMut}; use vecdb::{Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, prices}; +use crate::{blocks, prices}; use crate::distribution::metrics::ImportConfig; @@ -40,7 +40,7 @@ impl RealizedWithExtendedAdjusted { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_supply: &impl ReadableVec, height_to_market_cap: &impl ReadableVec, up_to_1h_value_created: &impl ReadableVec, diff --git a/crates/brk_computer/src/distribution/metrics/relative/base.rs b/crates/brk_computer/src/distribution/metrics/relative/base.rs index c9bda2c1f..193b8b647 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/base.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/base.rs @@ -37,9 +37,7 @@ impl RelativeBase { let v2 = Version::new(2); let net_unrealized_pnl_rel_to_market_cap = - PercentFromHeight::forced_import_bps16( - cfg.db, &cfg.name("net_unrealized_pnl_rel_to_market_cap"), cfg.version + v2, cfg.indexes, - )?; + cfg.import_percent_bps16("net_unrealized_pnl_rel_to_market_cap", v2)?; let nupl = LazyFromHeight::from_computed::( &cfg.name("nupl"), @@ -50,35 +48,21 @@ impl RelativeBase { Ok(Self { supply_in_profit_rel_to_own_supply: - PercentFromHeight::forced_import_bp16( - cfg.db, &cfg.name("supply_in_profit_rel_to_own_supply"), cfg.version + v1, cfg.indexes, - )?, + cfg.import_percent_bp16("supply_in_profit_rel_to_own_supply", v1)?, supply_in_loss_rel_to_own_supply: - PercentFromHeight::forced_import_bp16( - cfg.db, &cfg.name("supply_in_loss_rel_to_own_supply"), cfg.version + v1, cfg.indexes, - )?, + cfg.import_percent_bp16("supply_in_loss_rel_to_own_supply", v1)?, unrealized_profit_rel_to_market_cap: - PercentFromHeight::forced_import_bp16( - cfg.db, &cfg.name("unrealized_profit_rel_to_market_cap"), cfg.version + v2, cfg.indexes, - )?, + cfg.import_percent_bp16("unrealized_profit_rel_to_market_cap", v2)?, unrealized_loss_rel_to_market_cap: - PercentFromHeight::forced_import_bp16( - cfg.db, &cfg.name("unrealized_loss_rel_to_market_cap"), cfg.version + v2, cfg.indexes, - )?, + cfg.import_percent_bp16("unrealized_loss_rel_to_market_cap", v2)?, neg_unrealized_loss_rel_to_market_cap: - PercentFromHeight::forced_import_bps16( - cfg.db, &cfg.name("neg_unrealized_loss_rel_to_market_cap"), cfg.version + v2, cfg.indexes, - )?, + cfg.import_percent_bps16("neg_unrealized_loss_rel_to_market_cap", v2)?, net_unrealized_pnl_rel_to_market_cap, nupl, invested_capital_in_profit_rel_to_realized_cap: - PercentFromHeight::forced_import_bp16( - cfg.db, &cfg.name("invested_capital_in_profit_rel_to_realized_cap"), cfg.version, cfg.indexes, - )?, + cfg.import_percent_bp16("invested_capital_in_profit_rel_to_realized_cap", Version::ZERO)?, invested_capital_in_loss_rel_to_realized_cap: - PercentFromHeight::forced_import_bp16( - cfg.db, &cfg.name("invested_capital_in_loss_rel_to_realized_cap"), cfg.version, cfg.indexes, - )?, + cfg.import_percent_bp16("invested_capital_in_loss_rel_to_realized_cap", Version::ZERO)?, }) } diff --git a/crates/brk_computer/src/distribution/metrics/relative/extended_own_market_cap.rs b/crates/brk_computer/src/distribution/metrics/relative/extended_own_market_cap.rs index b4b04e201..86fae4b7c 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/extended_own_market_cap.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/extended_own_market_cap.rs @@ -1,6 +1,6 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{BasisPoints16, BasisPointsSigned16, Dollars, Height}; +use brk_types::{BasisPoints16, BasisPointsSigned16, Dollars, Height, Version}; use vecdb::{Exit, ReadableVec, Rw, StorageMode}; use crate::internal::{ @@ -23,40 +23,18 @@ pub struct RelativeExtendedOwnMarketCap { } impl RelativeExtendedOwnMarketCap { - pub(crate) fn forced_import( - cfg: &ImportConfig, - ) -> Result { - let v2 = brk_types::Version::new(2); + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + let v2 = Version::new(2); Ok(Self { unrealized_profit_rel_to_own_market_cap: - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("unrealized_profit_rel_to_own_market_cap"), - cfg.version + v2, - cfg.indexes, - )?, + cfg.import_percent_bp16("unrealized_profit_rel_to_own_market_cap", v2)?, unrealized_loss_rel_to_own_market_cap: - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("unrealized_loss_rel_to_own_market_cap"), - cfg.version + v2, - cfg.indexes, - )?, + cfg.import_percent_bp16("unrealized_loss_rel_to_own_market_cap", v2)?, neg_unrealized_loss_rel_to_own_market_cap: - PercentFromHeight::forced_import_bps16( - cfg.db, - &cfg.name("neg_unrealized_loss_rel_to_own_market_cap"), - cfg.version + v2, - cfg.indexes, - )?, + cfg.import_percent_bps16("neg_unrealized_loss_rel_to_own_market_cap", v2)?, net_unrealized_pnl_rel_to_own_market_cap: - PercentFromHeight::forced_import_bps16( - cfg.db, - &cfg.name("net_unrealized_pnl_rel_to_own_market_cap"), - cfg.version + v2, - cfg.indexes, - )?, + cfg.import_percent_bps16("net_unrealized_pnl_rel_to_own_market_cap", v2)?, }) } diff --git a/crates/brk_computer/src/distribution/metrics/relative/extended_own_pnl.rs b/crates/brk_computer/src/distribution/metrics/relative/extended_own_pnl.rs index c245d6630..2ad5ec999 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/extended_own_pnl.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/extended_own_pnl.rs @@ -1,6 +1,6 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{BasisPoints16, BasisPointsSigned16, Dollars, Height}; +use brk_types::{BasisPoints16, BasisPointsSigned16, Dollars, Height, Version}; use vecdb::{Exit, Rw, StorageMode}; use crate::internal::{ @@ -23,41 +23,19 @@ pub struct RelativeExtendedOwnPnl { } impl RelativeExtendedOwnPnl { - pub(crate) fn forced_import( - cfg: &ImportConfig, - ) -> Result { - let v1 = brk_types::Version::ONE; - let v2 = brk_types::Version::new(2); + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { + let v1 = Version::ONE; + let v2 = Version::new(2); Ok(Self { unrealized_profit_rel_to_own_gross_pnl: - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("unrealized_profit_rel_to_own_gross_pnl"), - cfg.version + v1, - cfg.indexes, - )?, + cfg.import_percent_bp16("unrealized_profit_rel_to_own_gross_pnl", v1)?, unrealized_loss_rel_to_own_gross_pnl: - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("unrealized_loss_rel_to_own_gross_pnl"), - cfg.version + v1, - cfg.indexes, - )?, + cfg.import_percent_bp16("unrealized_loss_rel_to_own_gross_pnl", v1)?, neg_unrealized_loss_rel_to_own_gross_pnl: - PercentFromHeight::forced_import_bps16( - cfg.db, - &cfg.name("neg_unrealized_loss_rel_to_own_gross_pnl"), - cfg.version + v1, - cfg.indexes, - )?, + cfg.import_percent_bps16("neg_unrealized_loss_rel_to_own_gross_pnl", v1)?, net_unrealized_pnl_rel_to_own_gross_pnl: - PercentFromHeight::forced_import_bps16( - cfg.db, - &cfg.name("net_unrealized_pnl_rel_to_own_gross_pnl"), - cfg.version + v2, - cfg.indexes, - )?, + cfg.import_percent_bps16("net_unrealized_pnl_rel_to_own_gross_pnl", v2)?, }) } diff --git a/crates/brk_computer/src/distribution/metrics/relative/to_all.rs b/crates/brk_computer/src/distribution/metrics/relative/to_all.rs index f62173cc4..8194001c7 100644 --- a/crates/brk_computer/src/distribution/metrics/relative/to_all.rs +++ b/crates/brk_computer/src/distribution/metrics/relative/to_all.rs @@ -1,6 +1,6 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{BasisPoints16, Height, Sats}; +use brk_types::{BasisPoints16, Height, Sats, Version}; use vecdb::{Exit, ReadableVec, Rw, StorageMode}; use crate::internal::{PercentFromHeight, RatioSatsBp16}; @@ -19,31 +19,14 @@ pub struct RelativeToAll { } impl RelativeToAll { - pub(crate) fn forced_import( - cfg: &ImportConfig, - ) -> Result { + pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { Ok(Self { supply_rel_to_circulating_supply: - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("supply_rel_to_circulating_supply"), - cfg.version + brk_types::Version::ONE, - cfg.indexes, - )?, + cfg.import_percent_bp16("supply_rel_to_circulating_supply", Version::ONE)?, supply_in_profit_rel_to_circulating_supply: - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("supply_in_profit_rel_to_circulating_supply"), - cfg.version + brk_types::Version::ONE, - cfg.indexes, - )?, + cfg.import_percent_bp16("supply_in_profit_rel_to_circulating_supply", Version::ONE)?, supply_in_loss_rel_to_circulating_supply: - PercentFromHeight::forced_import_bp16( - cfg.db, - &cfg.name("supply_in_loss_rel_to_circulating_supply"), - cfg.version + brk_types::Version::ONE, - cfg.indexes, - )?, + cfg.import_percent_bp16("supply_in_loss_rel_to_circulating_supply", Version::ONE)?, }) } diff --git a/crates/brk_computer/src/distribution/metrics/supply.rs b/crates/brk_computer/src/distribution/metrics/supply.rs index 997ec4d30..c04b3c73c 100644 --- a/crates/brk_computer/src/distribution/metrics/supply.rs +++ b/crates/brk_computer/src/distribution/metrics/supply.rs @@ -1,8 +1,8 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Height, Sats, Version}; +use brk_types::{Height, Indexes, Sats, Version}; -use crate::{ComputeIndexes, blocks, prices}; +use crate::{blocks, prices}; use rayon::prelude::*; use vecdb::{AnyStoredVec, AnyVec, Exit, Rw, StorageMode, WritableVec}; @@ -25,12 +25,7 @@ pub struct SupplyMetrics { impl SupplyMetrics { /// Import supply metrics from database. pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let supply = ValueFromHeight::forced_import( - cfg.db, - &cfg.name("supply"), - cfg.version, - cfg.indexes, - )?; + let supply = cfg.import_value("supply", Version::ZERO)?; let supply_halved = LazyValueFromHeight::from_block_source::< HalveSats, @@ -39,12 +34,7 @@ impl SupplyMetrics { HalveDollars, >(&cfg.name("supply_halved"), &supply, cfg.version); - let change_1m = ValueFromHeightChange::forced_import( - cfg.db, - &cfg.name("supply_change_1m"), - cfg.version, - cfg.indexes, - )?; + let change_1m = cfg.import_value_change("supply_change_1m", Version::ZERO)?; Ok(Self { total: supply, @@ -92,7 +82,7 @@ impl SupplyMetrics { /// Compute aggregate values from separate cohorts. pub(crate) fn compute_from_stateful( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> { @@ -111,7 +101,7 @@ impl SupplyMetrics { pub(crate) fn compute_rest_part1( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.change_1m.compute_rolling( diff --git a/crates/brk_computer/src/distribution/metrics/unrealized/base.rs b/crates/brk_computer/src/distribution/metrics/unrealized/base.rs index 2d37d13d1..3f5d1ad0c 100644 --- a/crates/brk_computer/src/distribution/metrics/unrealized/base.rs +++ b/crates/brk_computer/src/distribution/metrics/unrealized/base.rs @@ -1,13 +1,12 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, CentsSats, CentsSigned, CentsSquaredSats, Height, Version}; +use brk_types::{Cents, CentsSats, CentsSigned, CentsSquaredSats, Height, Indexes, Version}; use vecdb::{ - AnyStoredVec, AnyVec, BytesVec, Exit, ImportableVec, ReadableCloneableVec, ReadableVec, + AnyStoredVec, AnyVec, BytesVec, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode, WritableVec, }; use crate::{ - ComputeIndexes, distribution::state::UnrealizedState, internal::{ CentsSubtractToCentsSigned, FiatFromHeight, LazyFromHeight, NegCentsUnsignedToDollars, @@ -56,84 +55,24 @@ pub struct UnrealizedBase { impl UnrealizedBase { pub(crate) fn forced_import(cfg: &ImportConfig) -> Result { - let supply_in_profit = ValueFromHeight::forced_import( - cfg.db, - &cfg.name("supply_in_profit"), - cfg.version, - cfg.indexes, - )?; - let supply_in_loss = ValueFromHeight::forced_import( - cfg.db, - &cfg.name("supply_in_loss"), - cfg.version, - cfg.indexes, - )?; + let v0 = Version::ZERO; + let supply_in_profit = cfg.import_value("supply_in_profit", v0)?; + let supply_in_loss = cfg.import_value("supply_in_loss", v0)?; - let unrealized_profit = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("unrealized_profit"), - cfg.version, - cfg.indexes, - )?; - let unrealized_loss = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("unrealized_loss"), - cfg.version, - cfg.indexes, - )?; + let unrealized_profit = cfg.import_fiat("unrealized_profit", v0)?; + let unrealized_loss = cfg.import_fiat("unrealized_loss", v0)?; - let invested_capital_in_profit = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("invested_capital_in_profit"), - cfg.version, - cfg.indexes, - )?; - let invested_capital_in_loss = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("invested_capital_in_loss"), - cfg.version, - cfg.indexes, - )?; + let invested_capital_in_profit = cfg.import_fiat("invested_capital_in_profit", v0)?; + let invested_capital_in_loss = cfg.import_fiat("invested_capital_in_loss", v0)?; - let invested_capital_in_profit_raw = BytesVec::forced_import( - cfg.db, - &cfg.name("invested_capital_in_profit_raw"), - cfg.version, - )?; - let invested_capital_in_loss_raw = BytesVec::forced_import( - cfg.db, - &cfg.name("invested_capital_in_loss_raw"), - cfg.version, - )?; - let investor_cap_in_profit_raw = BytesVec::forced_import( - cfg.db, - &cfg.name("investor_cap_in_profit_raw"), - cfg.version, - )?; - let investor_cap_in_loss_raw = BytesVec::forced_import( - cfg.db, - &cfg.name("investor_cap_in_loss_raw"), - cfg.version, - )?; + let invested_capital_in_profit_raw = cfg.import_bytes("invested_capital_in_profit_raw", v0)?; + let invested_capital_in_loss_raw = cfg.import_bytes("invested_capital_in_loss_raw", v0)?; + let investor_cap_in_profit_raw = cfg.import_bytes("investor_cap_in_profit_raw", v0)?; + let investor_cap_in_loss_raw = cfg.import_bytes("investor_cap_in_loss_raw", v0)?; - let pain_index = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("pain_index"), - cfg.version, - cfg.indexes, - )?; - let greed_index = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("greed_index"), - cfg.version, - cfg.indexes, - )?; - let net_sentiment = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("net_sentiment"), - cfg.version + Version::ONE, - cfg.indexes, - )?; + let pain_index = cfg.import_fiat("pain_index", v0)?; + let greed_index = cfg.import_fiat("greed_index", v0)?; + let net_sentiment = cfg.import_fiat("net_sentiment", Version::ONE)?; let neg_unrealized_loss = LazyFromHeight::from_computed::( &cfg.name("neg_unrealized_loss"), @@ -142,18 +81,8 @@ impl UnrealizedBase { &unrealized_loss.cents, ); - let net_unrealized_pnl = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("net_unrealized_pnl"), - cfg.version, - cfg.indexes, - )?; - let gross_pnl = FiatFromHeight::forced_import( - cfg.db, - &cfg.name("gross_pnl"), - cfg.version, - cfg.indexes, - )?; + let net_unrealized_pnl = cfg.import_fiat("net_unrealized_pnl", v0)?; + let gross_pnl = cfg.import_fiat("unrealized_gross_pnl", v0)?; Ok(Self { supply_in_profit, @@ -260,7 +189,7 @@ impl UnrealizedBase { pub(crate) fn compute_from_stateful( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, others: &[&Self], exit: &Exit, ) -> Result<()> { @@ -392,7 +321,7 @@ impl UnrealizedBase { pub(crate) fn compute_rest( &mut self, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // Pain index: investor_price_of_losers - spot @@ -457,7 +386,7 @@ impl UnrealizedBase { /// Compute net_sentiment.height for separate cohorts (greed - pain). pub(crate) fn compute_net_sentiment_height( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.net_sentiment diff --git a/crates/brk_computer/src/distribution/vecs.rs b/crates/brk_computer/src/distribution/vecs.rs index e40c11c09..38094f33f 100644 --- a/crates/brk_computer/src/distribution/vecs.rs +++ b/crates/brk_computer/src/distribution/vecs.rs @@ -4,8 +4,8 @@ use brk_error::Result; use brk_indexer::Indexer; use brk_traversable::Traversable; use brk_types::{ - Cents, Day1, EmptyAddressData, EmptyAddressIndex, FundedAddressData, FundedAddressIndex, - Height, SupplyState, Timestamp, TxIndex, Version, + Cents, EmptyAddressData, EmptyAddressIndex, FundedAddressData, FundedAddressIndex, + Height, Indexes, SupplyState, Timestamp, TxIndex, Version, }; use tracing::{debug, info}; use vecdb::{ @@ -14,7 +14,7 @@ use vecdb::{ }; use crate::{ - ComputeIndexes, blocks, + blocks, distribution::{ compute::{ PriceRangeMax, StartMode, determine_start_mode, process_blocks, recover_state, @@ -208,7 +208,7 @@ impl Vecs { transactions: &transactions::Vecs, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &mut ComputeIndexes, + starting_indexes: &mut Indexes, exit: &Exit, ) -> Result<()> { let cache_target_len = prices @@ -336,16 +336,6 @@ impl Vecs { // Update starting_indexes if we need to recompute from an earlier point if starting_height < starting_indexes.height { starting_indexes.height = starting_height; - // Also update day1 to match - if starting_height.is_zero() { - starting_indexes.day1 = Day1::from(0); - } else { - starting_indexes.day1 = indexes - .height - .day1 - .collect_one(starting_height.decremented().unwrap()) - .unwrap(); - } } // 2b. Validate computed versions diff --git a/crates/brk_computer/src/indexes/mod.rs b/crates/brk_computer/src/indexes/mod.rs index c4ba9e81b..b9de0f230 100644 --- a/crates/brk_computer/src/indexes/mod.rs +++ b/crates/brk_computer/src/indexes/mod.rs @@ -33,7 +33,6 @@ use vecdb::{Database, Exit, PAGE_SIZE, ReadableVec, Rw, StorageMode}; use crate::blocks; pub use address::Vecs as AddressVecs; -pub use brk_types::ComputeIndexes; pub use day1::Vecs as Day1Vecs; pub use day3::Vecs as Day3Vecs; pub use difficultyepoch::Vecs as DifficultyEpochVecs; @@ -133,7 +132,7 @@ impl Vecs { blocks: &mut blocks::Vecs, starting_indexes: Indexes, exit: &Exit, - ) -> Result { + ) -> Result { blocks .time .compute(indexer, starting_indexes.height, exit)?; @@ -149,7 +148,7 @@ impl Vecs { blocks_time: &blocks::time::Vecs, starting_indexes: Indexes, exit: &Exit, - ) -> Result { + ) -> Result { // Transaction indexes - compute input/output counts self.txindex.input_count.compute_count_from_indexes( starting_indexes.txindex, @@ -350,71 +349,10 @@ impl Vecs { exit, )?; - // --- Starting values from height → period mappings --- - - let starting_minute10 = self - .height - .minute10 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_minute30 = self - .height - .minute30 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_hour1 = self - .height - .hour1 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_hour4 = self - .height - .hour4 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_hour12 = self - .height - .hour12 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_day3 = self - .height - .day3 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_week1 = self - .height - .week1 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_month1 = self - .height - .month1 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_month3 = self - .height - .month3 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_month6 = self - .height - .month6 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_year1 = self - .height - .year1 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - let starting_year10 = self - .height - .year10 - .collect_one(decremented_starting_height) - .unwrap_or_default(); - // --- Compute period-level vecs (first_height + identity) --- + let prev_height = decremented_starting_height; + // Minute10 self.minute10.first_height.compute_first_per_index( starting_indexes.height, @@ -422,7 +360,7 @@ impl Vecs { exit, )?; self.minute10.identity.compute_from_index( - starting_minute10, + self.height.minute10.collect_one(prev_height).unwrap_or_default(), &self.minute10.first_height, exit, )?; @@ -434,7 +372,7 @@ impl Vecs { exit, )?; self.minute30.identity.compute_from_index( - starting_minute30, + self.height.minute30.collect_one(prev_height).unwrap_or_default(), &self.minute30.first_height, exit, )?; @@ -445,9 +383,11 @@ impl Vecs { &self.height.hour1, exit, )?; - self.hour1 - .identity - .compute_from_index(starting_hour1, &self.hour1.first_height, exit)?; + self.hour1.identity.compute_from_index( + self.height.hour1.collect_one(prev_height).unwrap_or_default(), + &self.hour1.first_height, + exit, + )?; // Hour4 self.hour4.first_height.compute_first_per_index( @@ -455,9 +395,11 @@ impl Vecs { &self.height.hour4, exit, )?; - self.hour4 - .identity - .compute_from_index(starting_hour4, &self.hour4.first_height, exit)?; + self.hour4.identity.compute_from_index( + self.height.hour4.collect_one(prev_height).unwrap_or_default(), + &self.hour4.first_height, + exit, + )?; // Hour12 self.hour12.first_height.compute_first_per_index( @@ -466,7 +408,7 @@ impl Vecs { exit, )?; self.hour12.identity.compute_from_index( - starting_hour12, + self.height.hour12.collect_one(prev_height).unwrap_or_default(), &self.hour12.first_height, exit, )?; @@ -477,9 +419,11 @@ impl Vecs { &self.height.day1, exit, )?; - self.day1 - .identity - .compute_from_index(starting_day1, &self.day1.first_height, exit)?; + self.day1.identity.compute_from_index( + starting_day1, + &self.day1.first_height, + exit, + )?; self.day1.date.compute_transform( starting_day1, &self.day1.identity, @@ -499,9 +443,11 @@ impl Vecs { &self.height.day3, exit, )?; - self.day3 - .identity - .compute_from_index(starting_day3, &self.day3.first_height, exit)?; + self.day3.identity.compute_from_index( + self.height.day3.collect_one(prev_height).unwrap_or_default(), + &self.day3.first_height, + exit, + )?; let blocks_time_date = &blocks_time.date; @@ -511,9 +457,12 @@ impl Vecs { &self.height.week1, exit, )?; - self.week1 - .identity - .compute_from_index(starting_week1, &self.week1.first_height, exit)?; + let starting_week1 = self.height.week1.collect_one(prev_height).unwrap_or_default(); + self.week1.identity.compute_from_index( + starting_week1, + &self.week1.first_height, + exit, + )?; self.week1.date.compute_transform( starting_week1, &self.week1.first_height, @@ -527,6 +476,7 @@ impl Vecs { &self.height.month1, exit, )?; + let starting_month1 = self.height.month1.collect_one(prev_height).unwrap_or_default(); self.month1.identity.compute_from_index( starting_month1, &self.month1.first_height, @@ -545,6 +495,7 @@ impl Vecs { &self.height.month3, exit, )?; + let starting_month3 = self.height.month3.collect_one(prev_height).unwrap_or_default(); self.month3.identity.compute_from_index( starting_month3, &self.month3.first_height, @@ -563,6 +514,7 @@ impl Vecs { &self.height.month6, exit, )?; + let starting_month6 = self.height.month6.collect_one(prev_height).unwrap_or_default(); self.month6.identity.compute_from_index( starting_month6, &self.month6.first_height, @@ -581,9 +533,12 @@ impl Vecs { &self.height.year1, exit, )?; - self.year1 - .identity - .compute_from_index(starting_year1, &self.year1.first_height, exit)?; + let starting_year1 = self.height.year1.collect_one(prev_height).unwrap_or_default(); + self.year1.identity.compute_from_index( + starting_year1, + &self.year1.first_height, + exit, + )?; self.year1.date.compute_transform( starting_year1, &self.year1.first_height, @@ -597,6 +552,7 @@ impl Vecs { &self.height.year10, exit, )?; + let starting_year10 = self.height.year10.collect_one(prev_height).unwrap_or_default(); self.year10.identity.compute_from_index( starting_year10, &self.year10.first_height, @@ -609,23 +565,6 @@ impl Vecs { exit, )?; - Ok(ComputeIndexes::new( - starting_indexes, - starting_minute10, - starting_minute30, - starting_hour1, - starting_hour4, - starting_hour12, - starting_day1, - starting_day3, - starting_week1, - starting_month1, - starting_month3, - starting_month6, - starting_year1, - starting_year10, - starting_halvingepoch, - starting_difficultyepoch, - )) + Ok(starting_indexes) } } diff --git a/crates/brk_computer/src/inputs/compute.rs b/crates/brk_computer/src/inputs/compute.rs index d596cc7c1..b50b5381c 100644 --- a/crates/brk_computer/src/inputs/compute.rs +++ b/crates/brk_computer/src/inputs/compute.rs @@ -1,9 +1,10 @@ use brk_error::Result; use brk_indexer::Indexer; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{blocks, indexes, ComputeIndexes}; +use crate::{blocks, indexes}; impl Vecs { pub(crate) fn compute( @@ -11,7 +12,7 @@ impl Vecs { indexer: &Indexer, indexes: &indexes::Vecs, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.spent diff --git a/crates/brk_computer/src/inputs/count/compute.rs b/crates/brk_computer/src/inputs/count/compute.rs index 1bde1ded1..dbbd01c39 100644 --- a/crates/brk_computer/src/inputs/count/compute.rs +++ b/crates/brk_computer/src/inputs/count/compute.rs @@ -1,9 +1,10 @@ use brk_error::Result; use brk_indexer::Indexer; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{blocks, indexes, ComputeIndexes}; +use crate::{blocks, indexes}; impl Vecs { pub(crate) fn compute( @@ -11,7 +12,7 @@ impl Vecs { indexer: &Indexer, indexes: &indexes::Vecs, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = blocks.count.window_starts(); diff --git a/crates/brk_computer/src/inputs/spent/compute.rs b/crates/brk_computer/src/inputs/spent/compute.rs index 6f31f9213..0f6ee520a 100644 --- a/crates/brk_computer/src/inputs/spent/compute.rs +++ b/crates/brk_computer/src/inputs/spent/compute.rs @@ -1,11 +1,10 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{Sats, TxInIndex, TxIndex, TxOutIndex, Vout}; +use brk_types::{Indexes, Sats, TxInIndex, TxIndex, TxOutIndex, Vout}; use tracing::info; use vecdb::{AnyStoredVec, AnyVec, Database, Exit, WritableVec, ReadableVec, VecIndex}; use super::Vecs; -use crate::ComputeIndexes; const BATCH_SIZE: usize = 2 * 1024 * 1024 * 1024 / size_of::(); @@ -14,7 +13,7 @@ impl Vecs { &mut self, db: &Database, indexer: &Indexer, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // Validate computed versions against dependencies diff --git a/crates/brk_computer/src/internal/distribution_stats.rs b/crates/brk_computer/src/internal/distribution_stats.rs index a854c35f2..5d64bc6c8 100644 --- a/crates/brk_computer/src/internal/distribution_stats.rs +++ b/crates/brk_computer/src/internal/distribution_stats.rs @@ -17,6 +17,23 @@ pub struct DistributionStats } impl DistributionStats { + pub const SUFFIXES: [&'static str; 8] = ["average", "min", "max", "p10", "p25", "median", "p75", "p90"]; + + pub fn try_from_fn( + mut f: impl FnMut(&str) -> std::result::Result, + ) -> std::result::Result { + Ok(Self { + average: f(Self::SUFFIXES[0])?, + min: f(Self::SUFFIXES[1])?, + max: f(Self::SUFFIXES[2])?, + pct10: f(Self::SUFFIXES[3])?, + pct25: f(Self::SUFFIXES[4])?, + median: f(Self::SUFFIXES[5])?, + pct75: f(Self::SUFFIXES[6])?, + pct90: f(Self::SUFFIXES[7])?, + }) + } + /// Apply a fallible operation to each of the 8 fields. pub fn try_for_each_mut(&mut self, mut f: impl FnMut(&mut A) -> brk_error::Result<()>) -> brk_error::Result<()> { f(&mut self.average)?; diff --git a/crates/brk_computer/src/internal/eager_indexes.rs b/crates/brk_computer/src/internal/eager_indexes.rs index fedea873e..25f08e3ed 100644 --- a/crates/brk_computer/src/internal/eager_indexes.rs +++ b/crates/brk_computer/src/internal/eager_indexes.rs @@ -1,4 +1,4 @@ -//! EagerIndexes - newtype on Indexes with EagerVec> per field. +//! EagerIndexes - newtype on PerPeriod with EagerVec> per field. //! //! Used for data eagerly computed and stored per period during indexing, //! such as timestamp (first value per period) and OHLC (first/min/max per period). @@ -8,7 +8,7 @@ use brk_error::Result; use brk_traversable::Traversable; use brk_types::{ Day1, Day3, DifficultyEpoch, HalvingEpoch, Height, Hour1, Hour4, Hour12, - Minute10, Minute30, Month1, Month3, Month6, Version, Week1, Year1, Year10, + Indexes, Minute10, Minute30, Month1, Month3, Month6, Version, Week1, Year1, Year10, }; use derive_more::{Deref, DerefMut}; use schemars::JsonSchema; @@ -18,15 +18,15 @@ use vecdb::{ }; use crate::{ - ComputeIndexes, indexes, indexes_apply, indexes_from, - internal::{ComputedVecValue, Indexes, NumericValue}, + indexes, indexes_apply, indexes_from, + internal::{ComputedVecValue, NumericValue, PerPeriod}, }; #[derive(Deref, DerefMut, Traversable)] #[traversable(transparent)] pub struct EagerIndexes( #[allow(clippy::type_complexity)] - pub Indexes< + pub PerPeriod< ::Stored>>, ::Stored>>, ::Stored>>, @@ -68,15 +68,17 @@ where /// Compute "first value per period" — for each period, looks up `source[first_height[period]]`. pub(crate) fn compute_first( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_source: &impl ReadableVec, indexes: &indexes::Vecs, exit: &Exit, ) -> Result<()> { + let prev_height = starting_indexes.height.decremented().unwrap_or_default(); + macro_rules! period { ($field:ident) => { self.0.$field.compute_indirect_sequential( - starting_indexes.$field, + indexes.height.$field.collect_one(prev_height).unwrap_or_default(), &indexes.$field.first_height, height_source, exit, @@ -92,18 +94,19 @@ where /// Compute "max value per period" — for each period, finds `max(source[first_height[period]..first_height[period+1]])`. pub(crate) fn compute_max( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_source: &impl ReadableVec, indexes: &indexes::Vecs, exit: &Exit, ) -> Result<()> { let src_len = height_source.len(); + let prev_height = starting_indexes.height.decremented().unwrap_or_default(); macro_rules! period { ($field:ident) => { compute_period_extremum( &mut self.0.$field, - starting_indexes.$field, + indexes.height.$field.collect_one(prev_height).unwrap_or_default(), &indexes.$field.first_height, height_source, src_len, @@ -121,18 +124,19 @@ where /// Compute "min value per period" — for each period, finds `min(source[first_height[period]..first_height[period+1]])`. pub(crate) fn compute_min( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_source: &impl ReadableVec, indexes: &indexes::Vecs, exit: &Exit, ) -> Result<()> { let src_len = height_source.len(); + let prev_height = starting_indexes.height.decremented().unwrap_or_default(); macro_rules! period { ($field:ident) => { compute_period_extremum( &mut self.0.$field, - starting_indexes.$field, + indexes.height.$field.collect_one(prev_height).unwrap_or_default(), &indexes.$field.first_height, height_source, src_len, diff --git a/crates/brk_computer/src/internal/emas/emas_1w_1m.rs b/crates/brk_computer/src/internal/emas/emas_1w_1m.rs new file mode 100644 index 000000000..762ddce52 --- /dev/null +++ b/crates/brk_computer/src/internal/emas/emas_1w_1m.rs @@ -0,0 +1,32 @@ +//! Generic 2-slot container for 1w + 1m EMA pairs. + +use brk_traversable::Traversable; + +#[derive(Clone, Traversable)] +pub struct Emas1w1m { + #[traversable(rename = "1w")] + pub _1w: A, + #[traversable(rename = "1m")] + pub _1m: B, +} + +impl Emas1w1m { + pub const SUFFIXES: [&'static str; 2] = ["ema_1w", "ema_1m"]; + + pub fn try_from_fn( + mut f: impl FnMut(&str) -> std::result::Result, + ) -> std::result::Result { + Ok(Self { + _1w: f(Self::SUFFIXES[0])?, + _1m: f(Self::SUFFIXES[1])?, + }) + } + + pub fn as_array(&self) -> [&A; 2] { + [&self._1w, &self._1m] + } + + pub fn as_mut_array(&mut self) -> [&mut A; 2] { + [&mut self._1w, &mut self._1m] + } +} diff --git a/crates/brk_computer/src/internal/emas/emas_2w.rs b/crates/brk_computer/src/internal/emas/emas_2w.rs new file mode 100644 index 000000000..3cc14c26f --- /dev/null +++ b/crates/brk_computer/src/internal/emas/emas_2w.rs @@ -0,0 +1,29 @@ +//! Generic 1-slot container for 2w EMA. + +use brk_traversable::Traversable; + +#[derive(Clone, Traversable)] +pub struct Emas2w { + #[traversable(rename = "2w")] + pub _2w: A, +} + +impl Emas2w { + pub const SUFFIXES: [&'static str; 1] = ["ema_2w"]; + + pub fn try_from_fn( + mut f: impl FnMut(&str) -> std::result::Result, + ) -> std::result::Result { + Ok(Self { + _2w: f(Self::SUFFIXES[0])?, + }) + } + + pub fn as_array(&self) -> [&A; 1] { + [&self._2w] + } + + pub fn as_mut_array(&mut self) -> [&mut A; 1] { + [&mut self._2w] + } +} diff --git a/crates/brk_computer/src/internal/emas/mod.rs b/crates/brk_computer/src/internal/emas/mod.rs index 0d2f00275..560095304 100644 --- a/crates/brk_computer/src/internal/emas/mod.rs +++ b/crates/brk_computer/src/internal/emas/mod.rs @@ -1,5 +1,5 @@ -mod _1w_1m; -mod _2w; +mod emas_1w_1m; +mod emas_2w; -pub use _1w_1m::*; -pub use _2w::*; +pub use emas_1w_1m::*; +pub use emas_2w::*; diff --git a/crates/brk_computer/src/internal/from_height/by_unit/rolling_full.rs b/crates/brk_computer/src/internal/from_height/by_unit/rolling_full.rs index 06197f398..1e3678f9a 100644 --- a/crates/brk_computer/src/internal/from_height/by_unit/rolling_full.rs +++ b/crates/brk_computer/src/internal/from_height/by_unit/rolling_full.rs @@ -29,16 +29,9 @@ impl RollingFullSlot { ) -> Result { Ok(Self { sum: ByUnit::forced_import(db, &format!("{name}_sum"), version, indexes)?, - distribution: DistributionStats { - average: ByUnit::forced_import(db, &format!("{name}_average"), version, indexes)?, - min: ByUnit::forced_import(db, &format!("{name}_min"), version, indexes)?, - max: ByUnit::forced_import(db, &format!("{name}_max"), version, indexes)?, - pct10: ByUnit::forced_import(db, &format!("{name}_p10"), version, indexes)?, - pct25: ByUnit::forced_import(db, &format!("{name}_p25"), version, indexes)?, - median: ByUnit::forced_import(db, &format!("{name}_median"), version, indexes)?, - pct75: ByUnit::forced_import(db, &format!("{name}_p75"), version, indexes)?, - pct90: ByUnit::forced_import(db, &format!("{name}_p90"), version, indexes)?, - }, + distribution: DistributionStats::try_from_fn(|suffix| { + ByUnit::forced_import(db, &format!("{name}_{suffix}"), version, indexes) + })?, }) } @@ -55,21 +48,19 @@ impl RollingFullSlot { let d = &mut self.distribution; - compute_rolling_distribution_from_starts( - max_from, starts, sats_source, - &mut d.average.sats.height, &mut d.min.sats.height, - &mut d.max.sats.height, &mut d.pct10.sats.height, - &mut d.pct25.sats.height, &mut d.median.sats.height, - &mut d.pct75.sats.height, &mut d.pct90.sats.height, exit, - )?; - - compute_rolling_distribution_from_starts( - max_from, starts, cents_source, - &mut d.average.cents.height, &mut d.min.cents.height, - &mut d.max.cents.height, &mut d.pct10.cents.height, - &mut d.pct25.cents.height, &mut d.median.cents.height, - &mut d.pct75.cents.height, &mut d.pct90.cents.height, exit, - )?; + macro_rules! compute_unit { + ($unit:ident, $source:expr) => { + compute_rolling_distribution_from_starts( + max_from, starts, $source, + &mut d.average.$unit.height, &mut d.min.$unit.height, + &mut d.max.$unit.height, &mut d.pct10.$unit.height, + &mut d.pct25.$unit.height, &mut d.median.$unit.height, + &mut d.pct75.$unit.height, &mut d.pct90.$unit.height, exit, + )? + }; + } + compute_unit!(sats, sats_source); + compute_unit!(cents, cents_source); Ok(()) } diff --git a/crates/brk_computer/src/internal/from_height/ratio/extended.rs b/crates/brk_computer/src/internal/from_height/ratio/extended.rs index b7d2ccf36..8d7d9e70e 100644 --- a/crates/brk_computer/src/internal/from_height/ratio/extended.rs +++ b/crates/brk_computer/src/internal/from_height/ratio/extended.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Height, Version}; +use brk_types::{Cents, Height, Indexes, Version}; use derive_more::{Deref, DerefMut}; use vecdb::{Database, Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, indexes, prices}; +use crate::{blocks, indexes, prices}; use super::{ComputedFromHeightRatio, ComputedFromHeightRatioExtension}; @@ -36,7 +36,7 @@ impl ComputedFromHeightRatioExtended { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, metric_price: &impl ReadableVec, ) -> Result<()> { diff --git a/crates/brk_computer/src/internal/from_height/ratio/extension.rs b/crates/brk_computer/src/internal/from_height/ratio/extension.rs index 875835c94..f572255de 100644 --- a/crates/brk_computer/src/internal/from_height/ratio/extension.rs +++ b/crates/brk_computer/src/internal/from_height/ratio/extension.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{BasisPoints32, Cents, Height, StoredF32, Version}; +use brk_types::{BasisPoints32, Cents, Height, Indexes, StoredF32, Version}; use vecdb::{AnyStoredVec, AnyVec, Database, EagerVec, Exit, PcoVec, ReadableVec, Rw, StorageMode, VecIndex, WritableVec}; use crate::{ - ComputeIndexes, blocks, indexes, + blocks, indexes, internal::{ComputedFromHeightStdDevExtended, Price, TDigest}, }; @@ -104,7 +104,7 @@ impl ComputedFromHeightRatioExtension { pub(crate) fn compute_rest( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ratio_source: &impl ReadableVec, ) -> Result<()> { @@ -182,14 +182,9 @@ impl ComputedFromHeightRatioExtension { } // Compute stddev at height level - self.ratio_sd - .compute_all(blocks, starting_indexes, exit, ratio_source)?; - self.ratio_sd_4y - .compute_all(blocks, starting_indexes, exit, ratio_source)?; - self.ratio_sd_2y - .compute_all(blocks, starting_indexes, exit, ratio_source)?; - self.ratio_sd_1y - .compute_all(blocks, starting_indexes, exit, ratio_source)?; + for sd in [&mut self.ratio_sd, &mut self.ratio_sd_4y, &mut self.ratio_sd_2y, &mut self.ratio_sd_1y] { + sd.compute_all(blocks, starting_indexes, exit, ratio_source)?; + } Ok(()) } @@ -197,7 +192,7 @@ impl ComputedFromHeightRatioExtension { /// Compute cents ratio bands: cents_band = metric_price_cents * ratio_percentile pub(crate) fn compute_cents_bands( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, metric_price: &impl ReadableVec, exit: &Exit, ) -> Result<()> { @@ -224,14 +219,9 @@ impl ComputedFromHeightRatioExtension { compute_band!(ratio_pct1_price, &self.ratio_pct1.bps.height); // Stddev cents bands - self.ratio_sd - .compute_cents_bands(starting_indexes, metric_price, exit)?; - self.ratio_sd_4y - .compute_cents_bands(starting_indexes, metric_price, exit)?; - self.ratio_sd_2y - .compute_cents_bands(starting_indexes, metric_price, exit)?; - self.ratio_sd_1y - .compute_cents_bands(starting_indexes, metric_price, exit)?; + for sd in [&mut self.ratio_sd, &mut self.ratio_sd_4y, &mut self.ratio_sd_2y, &mut self.ratio_sd_1y] { + sd.compute_cents_bands(starting_indexes, metric_price, exit)?; + } Ok(()) } diff --git a/crates/brk_computer/src/internal/from_height/ratio/mod.rs b/crates/brk_computer/src/internal/from_height/ratio/mod.rs index b9276fc3e..c8c93c25a 100644 --- a/crates/brk_computer/src/internal/from_height/ratio/mod.rs +++ b/crates/brk_computer/src/internal/from_height/ratio/mod.rs @@ -8,10 +8,10 @@ pub use price_extended::*; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{BasisPoints32, Cents, Height, StoredF32, Version}; +use brk_types::{BasisPoints32, Cents, Height, Indexes, StoredF32, Version}; use vecdb::{Database, Exit, ReadableCloneableVec, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, indexes, internal::Bp32ToFloat}; +use crate::{indexes, internal::Bp32ToFloat}; use super::{ComputedFromHeight, LazyFromHeight}; @@ -56,7 +56,7 @@ impl ComputedFromHeightRatio { /// Compute ratio = close_price / metric_price at height level (both in cents) pub(crate) fn compute_ratio( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, close_price: &impl ReadableVec, metric_price: &impl ReadableVec, exit: &Exit, diff --git a/crates/brk_computer/src/internal/from_height/ratio/price_extended.rs b/crates/brk_computer/src/internal/from_height/ratio/price_extended.rs index 05d6909c9..891ee841b 100644 --- a/crates/brk_computer/src/internal/from_height/ratio/price_extended.rs +++ b/crates/brk_computer/src/internal/from_height/ratio/price_extended.rs @@ -1,11 +1,11 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Height, Version}; +use brk_types::{Cents, Height, Indexes, Version}; use derive_more::{Deref, DerefMut}; use vecdb::{Database, EagerVec, Exit, PcoVec, Rw, StorageMode}; use crate::internal::{ComputedFromHeight, Price}; -use crate::{ComputeIndexes, blocks, indexes, prices}; +use crate::{blocks, indexes, prices}; use super::ComputedFromHeightRatioExtended; @@ -37,7 +37,7 @@ impl ComputedFromHeightPriceWithRatioExtended { &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, mut compute_price: F, ) -> Result<()> diff --git a/crates/brk_computer/src/internal/from_height/stddev/extended.rs b/crates/brk_computer/src/internal/from_height/stddev/extended.rs index 2444e012d..fade86999 100644 --- a/crates/brk_computer/src/internal/from_height/stddev/extended.rs +++ b/crates/brk_computer/src/internal/from_height/stddev/extended.rs @@ -1,12 +1,12 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Cents, Height, StoredF32, Version}; +use brk_types::{Cents, Height, Indexes, StoredF32, Version}; use vecdb::{ AnyStoredVec, AnyVec, Database, EagerVec, Exit, PcoVec, ReadableVec, Rw, StorageMode, VecIndex, WritableVec, }; -use crate::{ComputeIndexes, blocks, indexes}; +use crate::{blocks, indexes}; use crate::internal::{ComputedFromHeight, Price}; @@ -110,7 +110,7 @@ impl ComputedFromHeightStdDevExtended { pub(crate) fn compute_all( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, source: &impl ReadableVec, ) -> Result<()> { @@ -123,7 +123,7 @@ impl ComputedFromHeightStdDevExtended { pub(crate) fn compute_bands( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, sma_opt: Option<&impl ReadableVec>, source: &impl ReadableVec, @@ -202,7 +202,7 @@ impl ComputedFromHeightStdDevExtended { /// Compute cents price bands: cents_band = metric_price_cents * band_ratio pub(crate) fn compute_cents_bands( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, metric_price: &impl ReadableVec, exit: &Exit, ) -> Result<()> { diff --git a/crates/brk_computer/src/internal/from_height/stddev/mod.rs b/crates/brk_computer/src/internal/from_height/stddev/mod.rs index bc1d2d178..521a945f5 100644 --- a/crates/brk_computer/src/internal/from_height/stddev/mod.rs +++ b/crates/brk_computer/src/internal/from_height/stddev/mod.rs @@ -4,10 +4,10 @@ pub use extended::*; use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{Height, StoredF32, Version}; +use brk_types::{Height, Indexes, StoredF32, Version}; use vecdb::{Database, Exit, ReadableVec, Rw, StorageMode}; -use crate::{ComputeIndexes, blocks, indexes}; +use crate::{blocks, indexes}; use crate::internal::ComputedFromHeight; @@ -57,7 +57,7 @@ impl ComputedFromHeightStdDev { pub(crate) fn compute_all( &mut self, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, source: &impl ReadableVec, ) -> Result<()> { diff --git a/crates/brk_computer/src/internal/from_tx/distribution.rs b/crates/brk_computer/src/internal/from_tx/distribution.rs index ff9436db5..5e00e2952 100644 --- a/crates/brk_computer/src/internal/from_tx/distribution.rs +++ b/crates/brk_computer/src/internal/from_tx/distribution.rs @@ -6,12 +6,12 @@ use brk_error::Result; use brk_indexer::Indexer; use brk_traversable::Traversable; -use brk_types::TxIndex; +use brk_types::{Indexes, TxIndex}; use schemars::JsonSchema; use vecdb::{Database, EagerVec, Exit, ImportableVec, PcoVec, Rw, StorageMode, Version}; use crate::{ - ComputeIndexes, indexes, + indexes, internal::{ComputedVecValue, NumericValue, TxDerivedDistribution}, }; @@ -43,7 +43,7 @@ where &mut self, indexer: &Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, skip_count: usize, ) -> Result<()> diff --git a/crates/brk_computer/src/internal/from_tx/lazy_distribution.rs b/crates/brk_computer/src/internal/from_tx/lazy_distribution.rs index fe61b2aa2..59584858b 100644 --- a/crates/brk_computer/src/internal/from_tx/lazy_distribution.rs +++ b/crates/brk_computer/src/internal/from_tx/lazy_distribution.rs @@ -3,12 +3,12 @@ use brk_error::Result; use brk_indexer::Indexer; use brk_traversable::Traversable; -use brk_types::TxIndex; +use brk_types::{Indexes, TxIndex}; use schemars::JsonSchema; use vecdb::{Database, Exit, LazyVecFrom2, ReadableVec, Rw, StorageMode, Version}; use crate::{ - ComputeIndexes, indexes, + indexes, internal::{ComputedVecValue, NumericValue, TxDerivedDistribution}, }; @@ -47,7 +47,7 @@ where &mut self, indexer: &Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> where diff --git a/crates/brk_computer/src/internal/height_derived/last.rs b/crates/brk_computer/src/internal/height_derived/last.rs index 8e7666965..f7bd5129a 100644 --- a/crates/brk_computer/src/internal/height_derived/last.rs +++ b/crates/brk_computer/src/internal/height_derived/last.rs @@ -13,14 +13,14 @@ use vecdb::{ use crate::{ indexes, indexes_from, - internal::{ComputedVecValue, Indexes, NumericValue}, + internal::{ComputedVecValue, NumericValue, PerPeriod}, }; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(transparent)] pub struct ComputedHeightDerived( #[allow(clippy::type_complexity)] - pub Indexes< + pub PerPeriod< LazyAggVec, Height, Height, T>, LazyAggVec, Height, Height, T>, LazyAggVec, Height, Height, T>, diff --git a/crates/brk_computer/src/internal/height_derived/lazy_last.rs b/crates/brk_computer/src/internal/height_derived/lazy_last.rs index a88ea31de..98b0ba062 100644 --- a/crates/brk_computer/src/internal/height_derived/lazy_last.rs +++ b/crates/brk_computer/src/internal/height_derived/lazy_last.rs @@ -16,7 +16,7 @@ use vecdb::{ use crate::{ indexes, indexes_from, internal::{ - ComputedFromHeight, ComputedHeightDerived, ComputedVecValue, Indexes, NumericValue, + ComputedFromHeight, ComputedHeightDerived, ComputedVecValue, NumericValue, PerPeriod, }, }; @@ -59,7 +59,7 @@ where #[traversable(transparent)] pub struct LazyHeightDerived( #[allow(clippy::type_complexity)] - pub Indexes< + pub PerPeriod< LazyTransformLast, Option>, LazyTransformLast, Option>, LazyTransformLast, Option>, diff --git a/crates/brk_computer/src/internal/indexes.rs b/crates/brk_computer/src/internal/indexes.rs index a5a1869ee..5cd3f5c9a 100644 --- a/crates/brk_computer/src/internal/indexes.rs +++ b/crates/brk_computer/src/internal/indexes.rs @@ -7,7 +7,7 @@ use brk_traversable::Traversable; #[derive(Clone, Traversable)] #[traversable(merge)] -pub struct Indexes { +pub struct PerPeriod { pub minute10: M10, pub minute30: M30, pub hour1: H1, @@ -25,7 +25,7 @@ pub struct Indexes { - $crate::internal::Indexes { + $crate::internal::PerPeriod { minute10: $period!(minute10), minute30: $period!(minute30), hour1: $period!(hour1), diff --git a/crates/brk_computer/src/internal/lazy_eager_indexes.rs b/crates/brk_computer/src/internal/lazy_eager_indexes.rs index 52a2d1c0b..a04c90649 100644 --- a/crates/brk_computer/src/internal/lazy_eager_indexes.rs +++ b/crates/brk_computer/src/internal/lazy_eager_indexes.rs @@ -14,14 +14,14 @@ use vecdb::{LazyVecFrom1, ReadableCloneableVec, UnaryTransform}; use crate::{ indexes_from, - internal::{ComputedVecValue, EagerIndexes, Indexes}, + internal::{ComputedVecValue, EagerIndexes, PerPeriod}, }; #[derive(Clone, Deref, DerefMut, Traversable)] #[traversable(transparent)] pub struct LazyEagerIndexes( #[allow(clippy::type_complexity)] - pub Indexes< + pub PerPeriod< LazyVecFrom1, LazyVecFrom1, LazyVecFrom1, diff --git a/crates/brk_computer/src/internal/rolling/distribution.rs b/crates/brk_computer/src/internal/rolling/distribution.rs index c7713dedd..eb4dd5557 100644 --- a/crates/brk_computer/src/internal/rolling/distribution.rs +++ b/crates/brk_computer/src/internal/rolling/distribution.rs @@ -37,16 +37,9 @@ where indexes: &indexes::Vecs, ) -> Result { let v = version + VERSION; - Ok(Self(DistributionStats { - average: RollingWindows::forced_import(db, &format!("{name}_average"), v, indexes)?, - min: RollingWindows::forced_import(db, &format!("{name}_min"), v, indexes)?, - max: RollingWindows::forced_import(db, &format!("{name}_max"), v, indexes)?, - pct10: RollingWindows::forced_import(db, &format!("{name}_p10"), v, indexes)?, - pct25: RollingWindows::forced_import(db, &format!("{name}_p25"), v, indexes)?, - median: RollingWindows::forced_import(db, &format!("{name}_median"), v, indexes)?, - pct75: RollingWindows::forced_import(db, &format!("{name}_p75"), v, indexes)?, - pct90: RollingWindows::forced_import(db, &format!("{name}_p90"), v, indexes)?, - })) + Ok(Self(DistributionStats::try_from_fn(|suffix| { + RollingWindows::forced_import(db, &format!("{name}_{suffix}"), v, indexes) + })?)) } /// Compute all 8 distribution stats across all 4 windows from a single source. @@ -66,34 +59,21 @@ where T: Copy + Ord + From + Default, f64: From, { - compute_rolling_distribution_from_starts( - max_from, windows._24h, source, - &mut self.0.average._24h.height, &mut self.0.min._24h.height, - &mut self.0.max._24h.height, &mut self.0.pct10._24h.height, - &mut self.0.pct25._24h.height, &mut self.0.median._24h.height, - &mut self.0.pct75._24h.height, &mut self.0.pct90._24h.height, exit, - )?; - compute_rolling_distribution_from_starts( - max_from, windows._1w, source, - &mut self.0.average._1w.height, &mut self.0.min._1w.height, - &mut self.0.max._1w.height, &mut self.0.pct10._1w.height, - &mut self.0.pct25._1w.height, &mut self.0.median._1w.height, - &mut self.0.pct75._1w.height, &mut self.0.pct90._1w.height, exit, - )?; - compute_rolling_distribution_from_starts( - max_from, windows._1m, source, - &mut self.0.average._1m.height, &mut self.0.min._1m.height, - &mut self.0.max._1m.height, &mut self.0.pct10._1m.height, - &mut self.0.pct25._1m.height, &mut self.0.median._1m.height, - &mut self.0.pct75._1m.height, &mut self.0.pct90._1m.height, exit, - )?; - compute_rolling_distribution_from_starts( - max_from, windows._1y, source, - &mut self.0.average._1y.height, &mut self.0.min._1y.height, - &mut self.0.max._1y.height, &mut self.0.pct10._1y.height, - &mut self.0.pct25._1y.height, &mut self.0.median._1y.height, - &mut self.0.pct75._1y.height, &mut self.0.pct90._1y.height, exit, - )?; + macro_rules! compute_window { + ($w:ident) => { + compute_rolling_distribution_from_starts( + max_from, windows.$w, source, + &mut self.0.average.$w.height, &mut self.0.min.$w.height, + &mut self.0.max.$w.height, &mut self.0.pct10.$w.height, + &mut self.0.pct25.$w.height, &mut self.0.median.$w.height, + &mut self.0.pct75.$w.height, &mut self.0.pct90.$w.height, exit, + )? + }; + } + compute_window!(_24h); + compute_window!(_1w); + compute_window!(_1m); + compute_window!(_1y); Ok(()) } diff --git a/crates/brk_computer/src/internal/tx_derived/distribution.rs b/crates/brk_computer/src/internal/tx_derived/distribution.rs index eb5e96394..56591b9b8 100644 --- a/crates/brk_computer/src/internal/tx_derived/distribution.rs +++ b/crates/brk_computer/src/internal/tx_derived/distribution.rs @@ -7,12 +7,12 @@ use brk_error::Result; use brk_indexer::Indexer; use brk_traversable::Traversable; -use brk_types::{Height, TxIndex}; +use brk_types::{Height, Indexes, TxIndex}; use schemars::JsonSchema; use vecdb::{Database, Exit, ReadableVec, Rw, StorageMode, Version}; use crate::{ - ComputeIndexes, indexes, + indexes, internal::{ComputedVecValue, Distribution, NumericValue}, }; @@ -66,7 +66,7 @@ where &mut self, indexer: &Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, txindex_source: &impl ReadableVec, exit: &Exit, ) -> Result<()> @@ -93,7 +93,7 @@ where &mut self, indexer: &Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, txindex_source: &impl ReadableVec, exit: &Exit, skip_count: usize, diff --git a/crates/brk_computer/src/lib.rs b/crates/brk_computer/src/lib.rs index 7f3a02ff1..39d2f2893 100644 --- a/crates/brk_computer/src/lib.rs +++ b/crates/brk_computer/src/lib.rs @@ -28,7 +28,6 @@ mod supply; mod traits; mod transactions; -use indexes::ComputeIndexes; #[derive(Traversable)] pub struct Computer { diff --git a/crates/brk_computer/src/market/ath/compute.rs b/crates/brk_computer/src/market/ath/compute.rs index 7c40f0d17..5f321532a 100644 --- a/crates/brk_computer/src/market/ath/compute.rs +++ b/crates/brk_computer/src/market/ath/compute.rs @@ -1,16 +1,16 @@ use brk_error::Result; -use brk_types::{StoredF32, Timestamp}; +use brk_types::{Indexes, StoredF32, Timestamp}; use vecdb::{Exit, ReadableVec, VecIndex}; use super::Vecs; -use crate::{blocks, ComputeIndexes, prices}; +use crate::{blocks, prices}; impl Vecs { pub(crate) fn compute( &mut self, prices: &prices::Vecs, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.price_ath.cents.height.compute_all_time_high( diff --git a/crates/brk_computer/src/market/compute.rs b/crates/brk_computer/src/market/compute.rs index cc69bc92d..8d033a453 100644 --- a/crates/brk_computer/src/market/compute.rs +++ b/crates/brk_computer/src/market/compute.rs @@ -1,7 +1,8 @@ use brk_error::Result; +use brk_types::Indexes; use vecdb::Exit; -use crate::{ComputeIndexes, blocks, distribution, indexes, mining, prices, transactions}; +use crate::{blocks, distribution, indexes, mining, prices, transactions}; use super::Vecs; @@ -15,7 +16,7 @@ impl Vecs { mining: &mining::Vecs, distribution: &distribution::Vecs, transactions: &transactions::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.ath.compute(prices, blocks, starting_indexes, exit)?; diff --git a/crates/brk_computer/src/market/dca/compute.rs b/crates/brk_computer/src/market/dca/compute.rs index 134c4f847..9cde2b38a 100644 --- a/crates/brk_computer/src/market/dca/compute.rs +++ b/crates/brk_computer/src/market/dca/compute.rs @@ -1,10 +1,10 @@ use brk_error::Result; -use brk_types::{BasisPointsSigned32, Bitcoin, Cents, Date, Day1, Dollars, Sats}; +use brk_types::{BasisPointsSigned32, Bitcoin, Cents, Date, Day1, Dollars, Indexes, Sats}; use vecdb::{AnyVec, Exit, ReadableOptionVec, ReadableVec, VecIndex}; use super::Vecs; use crate::{ - ComputeIndexes, blocks, indexes, internal::RatioDiffCentsBps32, market::lookback, prices, + blocks, indexes, internal::RatioDiffCentsBps32, market::lookback, prices, }; const DCA_AMOUNT: Dollars = Dollars::mint(100.0); @@ -16,7 +16,7 @@ impl Vecs { prices: &prices::Vecs, blocks: &blocks::Vecs, lookback: &lookback::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let h2d = &indexes.height.day1; diff --git a/crates/brk_computer/src/market/indicators/compute.rs b/crates/brk_computer/src/market/indicators/compute.rs index c2adc4a13..397dcbef4 100644 --- a/crates/brk_computer/src/market/indicators/compute.rs +++ b/crates/brk_computer/src/market/indicators/compute.rs @@ -1,10 +1,10 @@ use brk_error::Result; -use brk_types::{BasisPoints16, Dollars}; +use brk_types::{BasisPoints16, Dollars, Indexes}; use vecdb::Exit; use super::{super::range, Vecs}; use crate::{ - ComputeIndexes, blocks, distribution, + blocks, distribution, internal::{RatioDollarsBp32, Windows}, mining, prices, transactions, }; @@ -31,15 +31,17 @@ impl Vecs { distribution: &distribution::Vecs, transactions: &transactions::Vecs, moving_average: &super::super::moving_average::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { - self.puell_multiple.bps.compute_binary::( - starting_indexes.height, - &rewards.subsidy.base.usd.height, - &rewards.subsidy_sma_1y.usd.height, - exit, - )?; + self.puell_multiple + .bps + .compute_binary::( + starting_indexes.height, + &rewards.subsidy.base.usd.height, + &rewards.subsidy_sma_1y.usd.height, + exit, + )?; // Stochastic Oscillator: K = (close - low_2w) / (high_2w - low_2w), stored as ratio (0–1) { @@ -54,7 +56,7 @@ impl Vecs { let stoch = if range == 0.0 { BasisPoints16::ZERO } else { - BasisPoints16::from(((*close - *low) / range) as f64) + BasisPoints16::from((*close - *low) / range) }; (h, stoch) }, @@ -70,7 +72,8 @@ impl Vecs { } // RSI per timeframe - for (tf, rsi_chain) in Windows::<()>::SUFFIXES.into_iter() + for (tf, rsi_chain) in Windows::<()>::SUFFIXES + .into_iter() .zip(self.rsi.as_mut_array()) { let m = tf_multiplier(tf); @@ -93,7 +96,8 @@ impl Vecs { } // MACD per timeframe - for (tf, macd_chain) in Windows::<()>::SUFFIXES.into_iter() + for (tf, macd_chain) in Windows::<()>::SUFFIXES + .into_iter() .zip(self.macd.as_mut_array()) { let m = tf_multiplier(tf); @@ -110,28 +114,34 @@ impl Vecs { } // Gini (per height) - super::gini::compute( - &mut self.gini, - distribution, - starting_indexes, - exit, - )?; + super::gini::compute(&mut self.gini, distribution, starting_indexes, exit)?; // NVT: market_cap / tx_volume_24h - self.nvt.bps.compute_binary::( - starting_indexes.height, - &distribution.utxo_cohorts.all.metrics.supply.total.usd.height, - &transactions.volume.sent_sum.rolling._24h.usd.height, - exit, - )?; + self.nvt + .bps + .compute_binary::( + starting_indexes.height, + &distribution + .utxo_cohorts + .all + .metrics + .supply + .total + .usd + .height, + &transactions.volume.sent_sum.rolling._24h.usd.height, + exit, + )?; // Pi Cycle: sma_111d / sma_350d_x2 - self.pi_cycle.bps.compute_binary::( - starting_indexes.height, - &moving_average.price_sma_111d.price.usd.height, - &moving_average.price_sma_350d_x2.usd.height, - exit, - )?; + self.pi_cycle + .bps + .compute_binary::( + starting_indexes.height, + &moving_average.price_sma_111d.price.usd.height, + &moving_average.price_sma_350d_x2.usd.height, + exit, + )?; Ok(()) } diff --git a/crates/brk_computer/src/market/indicators/gini.rs b/crates/brk_computer/src/market/indicators/gini.rs index c5b662d63..715bf988d 100644 --- a/crates/brk_computer/src/market/indicators/gini.rs +++ b/crates/brk_computer/src/market/indicators/gini.rs @@ -1,13 +1,13 @@ use brk_error::Result; -use brk_types::{BasisPoints16, Sats, StoredU64, Version}; +use brk_types::{BasisPoints16, Indexes, Sats, StoredU64, Version}; use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableVec, VecIndex, WritableVec}; -use crate::{ComputeIndexes, distribution, internal::PercentFromHeight}; +use crate::{distribution, internal::PercentFromHeight}; pub(super) fn compute( gini: &mut PercentFromHeight, distribution: &distribution::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let amount_range = &distribution.utxo_cohorts.amount_range; diff --git a/crates/brk_computer/src/market/indicators/macd.rs b/crates/brk_computer/src/market/indicators/macd.rs index 2999548aa..053a6257e 100644 --- a/crates/brk_computer/src/market/indicators/macd.rs +++ b/crates/brk_computer/src/market/indicators/macd.rs @@ -1,8 +1,9 @@ use brk_error::Result; +use brk_types::Indexes; use vecdb::Exit; use super::MacdChain; -use crate::{ComputeIndexes, blocks, prices}; +use crate::{blocks, prices}; #[allow(clippy::too_many_arguments)] pub(super) fn compute( @@ -12,7 +13,7 @@ pub(super) fn compute( fast_days: usize, slow_days: usize, signal_days: usize, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let close = &prices.price.usd.height; diff --git a/crates/brk_computer/src/market/indicators/rsi.rs b/crates/brk_computer/src/market/indicators/rsi.rs index 41602f9c8..6837ed062 100644 --- a/crates/brk_computer/src/market/indicators/rsi.rs +++ b/crates/brk_computer/src/market/indicators/rsi.rs @@ -1,9 +1,9 @@ use brk_error::Result; -use brk_types::{BasisPoints16, Height, StoredF32}; +use brk_types::{BasisPoints16, Height, Indexes, StoredF32}; use vecdb::{Exit, ReadableVec}; use super::RsiChain; -use crate::{ComputeIndexes, blocks}; +use crate::blocks; pub(super) fn compute( chain: &mut RsiChain, @@ -11,7 +11,7 @@ pub(super) fn compute( returns_source: &impl ReadableVec, rma_days: usize, stoch_sma_days: usize, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let ws_rma = blocks.count.start_vec(rma_days); diff --git a/crates/brk_computer/src/market/lookback/compute.rs b/crates/brk_computer/src/market/lookback/compute.rs index ec1baa422..e4ec3ff85 100644 --- a/crates/brk_computer/src/market/lookback/compute.rs +++ b/crates/brk_computer/src/market/lookback/compute.rs @@ -1,15 +1,16 @@ use brk_error::Result; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{blocks, ComputeIndexes, prices}; +use crate::{blocks, prices}; impl Vecs { pub(crate) fn compute( &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let price = &prices.price.cents.height; diff --git a/crates/brk_computer/src/market/moving_average/compute.rs b/crates/brk_computer/src/market/moving_average/compute.rs index e52afe487..0ab14881b 100644 --- a/crates/brk_computer/src/market/moving_average/compute.rs +++ b/crates/brk_computer/src/market/moving_average/compute.rs @@ -1,15 +1,16 @@ use brk_error::Result; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{ComputeIndexes, blocks, prices}; +use crate::{blocks, prices}; impl Vecs { pub(crate) fn compute( &mut self, blocks: &blocks::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let close = &prices.price.cents.height; diff --git a/crates/brk_computer/src/market/range/compute.rs b/crates/brk_computer/src/market/range/compute.rs index 5c1230ea7..daae024c8 100644 --- a/crates/brk_computer/src/market/range/compute.rs +++ b/crates/brk_computer/src/market/range/compute.rs @@ -1,16 +1,16 @@ use brk_error::Result; -use brk_types::{BasisPoints16, StoredF32}; +use brk_types::{BasisPoints16, Indexes, StoredF32}; use vecdb::{Exit, ReadableVec, VecIndex}; use super::Vecs; -use crate::{blocks, ComputeIndexes, prices}; +use crate::{blocks, prices}; impl Vecs { pub(crate) fn compute( &mut self, prices: &prices::Vecs, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let price = &prices.price.cents.height; diff --git a/crates/brk_computer/src/market/returns/compute.rs b/crates/brk_computer/src/market/returns/compute.rs index 4a122981d..f4b8a1e8b 100644 --- a/crates/brk_computer/src/market/returns/compute.rs +++ b/crates/brk_computer/src/market/returns/compute.rs @@ -1,9 +1,9 @@ use brk_error::Result; -use brk_types::{BasisPointsSigned32, Dollars, StoredF32}; +use brk_types::{BasisPointsSigned32, Dollars, Indexes, StoredF32}; use vecdb::Exit; use super::Vecs; -use crate::{ComputeIndexes, blocks, internal::RatioDiffDollarsBps32, market::lookback, prices}; +use crate::{blocks, internal::RatioDiffDollarsBps32, market::lookback, prices}; impl Vecs { pub(crate) fn compute( @@ -11,7 +11,7 @@ impl Vecs { prices: &prices::Vecs, blocks: &blocks::Vecs, lookback: &lookback::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // Compute price returns at height level diff --git a/crates/brk_computer/src/market/volatility/compute.rs b/crates/brk_computer/src/market/volatility/compute.rs index 4ab2d0ad6..6a8abf2c0 100644 --- a/crates/brk_computer/src/market/volatility/compute.rs +++ b/crates/brk_computer/src/market/volatility/compute.rs @@ -14,17 +14,50 @@ impl Vecs { ) -> Result<()> { // Sharpe ratios: returns / volatility for (out, ret, vol) in [ - (&mut self.price_sharpe_1w, &returns.price_return._1w.ratio.height, &self.price_volatility_1w.height), - (&mut self.price_sharpe_1m, &returns.price_return._1m.ratio.height, &self.price_volatility_1m.height), - (&mut self.price_sharpe_1y, &returns.price_return._1y.ratio.height, &self.price_volatility_1y.height), + ( + &mut self.price_sharpe_1w, + &returns.price_return._1w.ratio.height, + &self.price_volatility_1w.height, + ), + ( + &mut self.price_sharpe_1m, + &returns.price_return._1m.ratio.height, + &self.price_volatility_1m.height, + ), + ( + &mut self.price_sharpe_1y, + &returns.price_return._1y.ratio.height, + &self.price_volatility_1y.height, + ), ] { compute_ratio(&mut out.height, starting_indexes_height, ret, vol, exit)?; } // Sortino ratios: returns / downside volatility (sd * sqrt(days)) - compute_sortino(&mut self.price_sortino_1w.height, starting_indexes_height, &returns.price_return._1w.ratio.height, &returns.price_downside_24h_sd_1w.sd.height, 7.0_f32.sqrt(), exit)?; - compute_sortino(&mut self.price_sortino_1m.height, starting_indexes_height, &returns.price_return._1m.ratio.height, &returns.price_downside_24h_sd_1m.sd.height, 30.0_f32.sqrt(), exit)?; - compute_sortino(&mut self.price_sortino_1y.height, starting_indexes_height, &returns.price_return._1y.ratio.height, &returns.price_downside_24h_sd_1y.sd.height, 365.0_f32.sqrt(), exit)?; + compute_sortino( + &mut self.price_sortino_1w.height, + starting_indexes_height, + &returns.price_return._1w.ratio.height, + &returns.price_downside_24h_sd_1w.sd.height, + 7.0_f32.sqrt(), + exit, + )?; + compute_sortino( + &mut self.price_sortino_1m.height, + starting_indexes_height, + &returns.price_return._1m.ratio.height, + &returns.price_downside_24h_sd_1m.sd.height, + 30.0_f32.sqrt(), + exit, + )?; + compute_sortino( + &mut self.price_sortino_1y.height, + starting_indexes_height, + &returns.price_return._1y.ratio.height, + &returns.price_downside_24h_sd_1y.sd.height, + 365.0_f32.sqrt(), + exit, + )?; Ok(()) } @@ -63,8 +96,12 @@ fn compute_sortino( ret, sd, |(h, ret, sd, ..)| { - let downside_vol = f32::from(*sd) * sqrt_days; - let ratio = if downside_vol == 0.0 { 0.0 } else { f32::from(*ret) / downside_vol }; + let downside_vol = (*sd) * sqrt_days; + let ratio = if downside_vol == 0.0 { + 0.0 + } else { + (*ret) / downside_vol + }; (h, StoredF32::from(ratio)) }, exit, diff --git a/crates/brk_computer/src/mining/compute.rs b/crates/brk_computer/src/mining/compute.rs index 8f197ec08..7bc8a07a1 100644 --- a/crates/brk_computer/src/mining/compute.rs +++ b/crates/brk_computer/src/mining/compute.rs @@ -1,9 +1,10 @@ use brk_error::Result; use brk_indexer::Indexer; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{ComputeIndexes, blocks, indexes, prices, transactions}; +use crate::{blocks, indexes, prices, transactions}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -14,7 +15,7 @@ impl Vecs { blocks: &blocks::Vecs, transactions: &transactions::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // Block rewards (coinbase, subsidy, fee_dominance, etc.) diff --git a/crates/brk_computer/src/mining/hashrate/compute.rs b/crates/brk_computer/src/mining/hashrate/compute.rs index e6171b379..e9218922c 100644 --- a/crates/brk_computer/src/mining/hashrate/compute.rs +++ b/crates/brk_computer/src/mining/hashrate/compute.rs @@ -1,12 +1,11 @@ use brk_error::Result; -use brk_types::{Dollars, Height, Sats, StoredF32, StoredF64}; +use brk_types::{Dollars, Height, Indexes, Sats, StoredF32, StoredF64}; use vecdb::{Exit, ReadableVec}; use super::Vecs; use crate::{ blocks::{self, ONE_TERA_HASH, TARGET_BLOCKS_PER_DAY_F64}, internal::RatioDiffF32Bps32, - ComputeIndexes, }; impl Vecs { @@ -16,7 +15,7 @@ impl Vecs { difficulty_vecs: &blocks::DifficultyVecs, coinbase_sats_24h_sum: &impl ReadableVec, coinbase_usd_24h_sum: &impl ReadableVec, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.hash_rate.height.compute_transform2( diff --git a/crates/brk_computer/src/mining/rewards/compute.rs b/crates/brk_computer/src/mining/rewards/compute.rs index 1e82072a5..eadf662ee 100644 --- a/crates/brk_computer/src/mining/rewards/compute.rs +++ b/crates/brk_computer/src/mining/rewards/compute.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{BasisPoints16, CheckedSub, HalvingEpoch, Sats}; +use brk_types::{BasisPoints16, CheckedSub, HalvingEpoch, Indexes, Sats}; use vecdb::{Exit, ReadableVec, VecIndex}; use super::Vecs; -use crate::{ComputeIndexes, blocks, indexes, internal::RatioSatsBp16, prices, transactions}; +use crate::{blocks, indexes, internal::RatioSatsBp16, prices, transactions}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -15,7 +15,7 @@ impl Vecs { count_vecs: &blocks::CountVecs, transactions_fees: &transactions::FeesVecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = count_vecs.window_starts(); diff --git a/crates/brk_computer/src/outputs/compute.rs b/crates/brk_computer/src/outputs/compute.rs index 89bfa8f6f..55e87dd6a 100644 --- a/crates/brk_computer/src/outputs/compute.rs +++ b/crates/brk_computer/src/outputs/compute.rs @@ -1,9 +1,10 @@ use brk_error::Result; use brk_indexer::Indexer; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{ComputeIndexes, blocks, indexes, inputs, scripts}; +use crate::{blocks, indexes, inputs, scripts}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -14,7 +15,7 @@ impl Vecs { inputs: &inputs::Vecs, scripts: &scripts::Vecs, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.spent diff --git a/crates/brk_computer/src/outputs/count/compute.rs b/crates/brk_computer/src/outputs/count/compute.rs index ee5516a63..50ef75f95 100644 --- a/crates/brk_computer/src/outputs/count/compute.rs +++ b/crates/brk_computer/src/outputs/count/compute.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{Height, StoredU64}; +use brk_types::{Height, Indexes, StoredU64}; use vecdb::Exit; use super::Vecs; -use crate::{ComputeIndexes, blocks, indexes, inputs, scripts}; +use crate::{blocks, indexes, inputs, scripts}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -15,7 +15,7 @@ impl Vecs { inputs_count: &inputs::CountVecs, scripts_count: &scripts::CountVecs, blocks: &blocks::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = blocks.count.window_starts(); diff --git a/crates/brk_computer/src/outputs/spent/compute.rs b/crates/brk_computer/src/outputs/spent/compute.rs index 8a8e2f83d..43f2aaef7 100644 --- a/crates/brk_computer/src/outputs/spent/compute.rs +++ b/crates/brk_computer/src/outputs/spent/compute.rs @@ -1,13 +1,13 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{Height, TxInIndex, TxOutIndex}; +use brk_types::{Height, Indexes, TxInIndex, TxOutIndex}; use tracing::info; use vecdb::{ AnyStoredVec, AnyVec, Database, Exit, WritableVec, ReadableVec, Stamp, VecIndex, }; use super::Vecs; -use crate::{inputs, ComputeIndexes}; +use crate::inputs; const HEIGHT_BATCH: u32 = 10_000; @@ -17,7 +17,7 @@ impl Vecs { db: &Database, indexer: &Indexer, inputs: &inputs::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let target_height = indexer.vecs.blocks.blockhash.len(); diff --git a/crates/brk_computer/src/pools/mod.rs b/crates/brk_computer/src/pools/mod.rs index 549e58b6e..8928d8015 100644 --- a/crates/brk_computer/src/pools/mod.rs +++ b/crates/brk_computer/src/pools/mod.rs @@ -4,7 +4,7 @@ use brk_error::Result; use brk_indexer::Indexer; use brk_store::AnyStore; use brk_traversable::Traversable; -use brk_types::{Address, AddressBytes, Height, OutputType, PoolSlug, Pools, TxOutIndex, pools}; +use brk_types::{Address, AddressBytes, Height, Indexes, OutputType, PoolSlug, Pools, TxOutIndex, pools}; use rayon::prelude::*; use vecdb::{ AnyStoredVec, AnyVec, BytesVec, Database, Exit, ImportableVec, PAGE_SIZE, ReadableVec, Rw, @@ -15,7 +15,7 @@ mod vecs; use crate::{ blocks, - indexes::{self, ComputeIndexes}, + indexes, mining, prices, }; @@ -73,7 +73,7 @@ impl Vecs { blocks: &blocks::Vecs, prices: &prices::Vecs, mining: &mining::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.compute_( @@ -98,7 +98,7 @@ impl Vecs { blocks: &blocks::Vecs, prices: &prices::Vecs, mining: &mining::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.compute_height_to_pool(indexer, indexes, starting_indexes, exit)?; @@ -121,7 +121,7 @@ impl Vecs { &mut self, indexer: &Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.height_to_pool diff --git a/crates/brk_computer/src/pools/vecs.rs b/crates/brk_computer/src/pools/vecs.rs index 8733f4955..445493e22 100644 --- a/crates/brk_computer/src/pools/vecs.rs +++ b/crates/brk_computer/src/pools/vecs.rs @@ -1,11 +1,11 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{BasisPoints16, Height, PoolSlug, StoredU32}; +use brk_types::{BasisPoints16, Height, Indexes, PoolSlug, StoredU32}; use vecdb::{AnyVec, BinaryTransform, Database, Exit, ReadableVec, Rw, StorageMode, VecIndex, Version}; use crate::{ blocks, - indexes::{self, ComputeIndexes}, + indexes, internal::{ ComputedFromHeightCumulativeSum, ComputedFromHeight, MaskSats, PercentFromHeight, PercentRollingWindows, RatioU32Bp16, RollingWindows, @@ -83,7 +83,7 @@ impl Vecs { #[allow(clippy::too_many_arguments)] pub(crate) fn compute( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, height_to_pool: &impl ReadableVec, blocks: &blocks::Vecs, prices: &prices::Vecs, diff --git a/crates/brk_computer/src/positions.rs b/crates/brk_computer/src/positions.rs index 8145ae2c4..583336823 100644 --- a/crates/brk_computer/src/positions.rs +++ b/crates/brk_computer/src/positions.rs @@ -4,13 +4,12 @@ use brk_error::Result; use brk_indexer::Indexer; use brk_reader::Reader; use brk_traversable::Traversable; -use brk_types::{BlkPosition, Height, TxIndex, Version}; +use brk_types::{BlkPosition, Height, Indexes, TxIndex, Version}; use vecdb::{ AnyStoredVec, AnyVec, Database, Exit, WritableVec, ImportableVec, PAGE_SIZE, PcoVec, ReadableVec, Rw, StorageMode, VecIndex, }; -use super::ComputeIndexes; pub const DB_NAME: &str = "positions"; @@ -49,7 +48,7 @@ impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, reader: &Reader, exit: &Exit, ) -> Result<()> { @@ -62,7 +61,7 @@ impl Vecs { fn compute_( &mut self, indexer: &Indexer, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, parser: &Reader, exit: &Exit, ) -> Result<()> { diff --git a/crates/brk_computer/src/prices/compute.rs b/crates/brk_computer/src/prices/compute.rs index 4f5d4d00e..bb76ee260 100644 --- a/crates/brk_computer/src/prices/compute.rs +++ b/crates/brk_computer/src/prices/compute.rs @@ -3,19 +3,19 @@ use std::ops::Range; use brk_error::Result; use brk_indexer::Indexer; use brk_oracle::{Config, NUM_BINS, Oracle, START_HEIGHT, bin_to_cents, cents_to_bin}; -use brk_types::{Cents, OutputType, Sats, TxIndex, TxOutIndex}; +use brk_types::{Cents, Indexes, OutputType, Sats, TxIndex, TxOutIndex}; use tracing::info; use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableVec, StorageMode, VecIndex, WritableVec}; use super::Vecs; -use crate::{ComputeIndexes, indexes}; +use crate::indexes; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.compute_prices(indexer, starting_indexes, exit)?; @@ -33,6 +33,7 @@ impl Vecs { .compute_min(starting_indexes, &self.price.cents.height, indexes, exit)?; self.ohlc.cents.compute_from_split( starting_indexes, + indexes, &self.split.open.cents, &self.split.high.cents, &self.split.low.cents, @@ -48,7 +49,7 @@ impl Vecs { fn compute_prices( &mut self, indexer: &Indexer, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let source_version = diff --git a/crates/brk_computer/src/prices/ohlcs.rs b/crates/brk_computer/src/prices/ohlcs.rs index bd99f951a..6c60e6cda 100644 --- a/crates/brk_computer/src/prices/ohlcs.rs +++ b/crates/brk_computer/src/prices/ohlcs.rs @@ -1,9 +1,9 @@ use brk_error::Result; use brk_traversable::Traversable; use brk_types::{ - Cents, Close, Day1, Day3, DifficultyEpoch, HalvingEpoch, High, Hour1, Hour4, Hour12, Low, - Minute10, Minute30, Month1, Month3, Month6, OHLCCents, Open, Version, Week1, - Year1, Year10, + Cents, Close, Day1, Day3, DifficultyEpoch, HalvingEpoch, High, Hour1, Hour4, Hour12, Indexes, + Low, Minute10, Minute30, Month1, Month3, Month6, OHLCCents, Open, Version, Week1, Year1, + Year10, }; use derive_more::{Deref, DerefMut}; use schemars::JsonSchema; @@ -14,8 +14,8 @@ use vecdb::{ }; use crate::{ - ComputeIndexes, indexes_apply, indexes_from, - internal::{ComputedHeightDerived, EagerIndexes, Indexes}, + indexes, indexes_apply, indexes_from, + internal::{ComputedHeightDerived, EagerIndexes, PerPeriod}, }; // ── EagerOhlcIndexes ───────────────────────────────────────────────── @@ -24,7 +24,7 @@ use crate::{ #[traversable(merge)] pub struct OhlcVecs( #[allow(clippy::type_complexity)] - pub Indexes< + pub PerPeriod< ::Stored>>, ::Stored>>, ::Stored>>, @@ -65,19 +65,27 @@ where } impl OhlcVecs { + #[allow(clippy::too_many_arguments)] pub(crate) fn compute_from_split( &mut self, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, + indexes: &indexes::Vecs, open: &EagerIndexes, high: &EagerIndexes, low: &EagerIndexes, close: &ComputedHeightDerived, exit: &Exit, ) -> Result<()> { + let prev_height = starting_indexes.height.decremented().unwrap_or_default(); + macro_rules! period { ($field:ident) => { self.0.$field.compute_transform4( - starting_indexes.$field, + indexes + .height + .$field + .collect_one(prev_height) + .unwrap_or_default(), &open.$field, &high.$field, &low.$field, @@ -94,9 +102,8 @@ impl OhlcVecs { } } else { // Empty period (no blocks): flat candle at previous close - let prev_close = Close::new( - this.collect_last().map_or(o, |prev| *prev.close), - ); + let prev_close = + Close::new(this.collect_last().map_or(o, |prev| *prev.close)); OHLCCents::from(prev_close) }, ) @@ -109,7 +116,11 @@ impl OhlcVecs { macro_rules! epoch { ($field:ident) => { self.0.$field.compute_transform4( - starting_indexes.$field, + indexes + .height + .$field + .collect_one(prev_height) + .unwrap_or_default(), &open.$field, &high.$field, &low.$field, @@ -142,7 +153,7 @@ impl OhlcVecs { #[traversable(merge)] pub struct LazyOhlcVecs( #[allow(clippy::type_complexity)] - pub Indexes< + pub PerPeriod< LazyVecFrom1, LazyVecFrom1, LazyVecFrom1, diff --git a/crates/brk_computer/src/scripts/adoption.rs b/crates/brk_computer/src/scripts/adoption.rs index 4facee13f..3cae9db6e 100644 --- a/crates/brk_computer/src/scripts/adoption.rs +++ b/crates/brk_computer/src/scripts/adoption.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_traversable::Traversable; -use brk_types::{BasisPoints16, Version}; +use brk_types::{BasisPoints16, Indexes, Version}; use vecdb::{Database, Exit, Rw, StorageMode}; use crate::{ - ComputeIndexes, indexes, + indexes, internal::{PercentFromHeight, RatioU64Bp16}, outputs, }; @@ -43,7 +43,7 @@ impl Vecs { &mut self, count: &CountVecs, outputs_count: &outputs::CountVecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.taproot.compute_binary::<_, _, RatioU64Bp16>( diff --git a/crates/brk_computer/src/scripts/compute.rs b/crates/brk_computer/src/scripts/compute.rs index b0da212a8..d25cd9e02 100644 --- a/crates/brk_computer/src/scripts/compute.rs +++ b/crates/brk_computer/src/scripts/compute.rs @@ -1,8 +1,9 @@ use brk_error::Result; use brk_indexer::Indexer; +use brk_types::Indexes; use vecdb::Exit; -use crate::{blocks, outputs, prices, ComputeIndexes}; +use crate::{blocks, outputs, prices}; use super::Vecs; @@ -13,7 +14,7 @@ impl Vecs { blocks: &blocks::Vecs, outputs: &outputs::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.count diff --git a/crates/brk_computer/src/scripts/count/compute.rs b/crates/brk_computer/src/scripts/count/compute.rs index 4d9c4a04b..917fa19f0 100644 --- a/crates/brk_computer/src/scripts/count/compute.rs +++ b/crates/brk_computer/src/scripts/count/compute.rs @@ -1,17 +1,17 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::StoredU64; +use brk_types::{Indexes, StoredU64}; use vecdb::Exit; use super::Vecs; -use crate::{ComputeIndexes, blocks}; +use crate::blocks; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, count_vecs: &blocks::CountVecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = count_vecs.window_starts(); diff --git a/crates/brk_computer/src/scripts/value/compute.rs b/crates/brk_computer/src/scripts/value/compute.rs index 6a92f8033..81749d64f 100644 --- a/crates/brk_computer/src/scripts/value/compute.rs +++ b/crates/brk_computer/src/scripts/value/compute.rs @@ -1,10 +1,10 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{Height, OutputType, Sats, TxOutIndex}; +use brk_types::{Height, Indexes, OutputType, Sats, TxOutIndex}; use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableVec, WritableVec, VecIndex}; use super::Vecs; -use crate::{ComputeIndexes, blocks, prices}; +use crate::{blocks, prices}; impl Vecs { pub(crate) fn compute( @@ -12,7 +12,7 @@ impl Vecs { indexer: &Indexer, count_vecs: &blocks::CountVecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = count_vecs.window_starts(); diff --git a/crates/brk_computer/src/supply/burned/compute.rs b/crates/brk_computer/src/supply/burned/compute.rs index 739ec47e7..dc9fbd7e1 100644 --- a/crates/brk_computer/src/supply/burned/compute.rs +++ b/crates/brk_computer/src/supply/burned/compute.rs @@ -1,9 +1,9 @@ use brk_error::Result; -use brk_types::{Height, Sats}; +use brk_types::{Height, Indexes, Sats}; use vecdb::{AnyStoredVec, AnyVec, Exit, ReadableVec, WritableVec, VecIndex}; use super::Vecs; -use crate::{ComputeIndexes, blocks, mining, prices, scripts}; +use crate::{blocks, mining, prices, scripts}; impl Vecs { pub(crate) fn compute( @@ -12,7 +12,7 @@ impl Vecs { mining: &mining::Vecs, count_vecs: &blocks::CountVecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = count_vecs.window_starts(); diff --git a/crates/brk_computer/src/supply/compute.rs b/crates/brk_computer/src/supply/compute.rs index 8ffb924c9..571d9ad9b 100644 --- a/crates/brk_computer/src/supply/compute.rs +++ b/crates/brk_computer/src/supply/compute.rs @@ -1,8 +1,9 @@ use brk_error::Result; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{ComputeIndexes, blocks, distribution, mining, prices, scripts, transactions}; +use crate::{blocks, distribution, mining, prices, scripts, transactions}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -14,7 +15,7 @@ impl Vecs { transactions: &transactions::Vecs, prices: &prices::Vecs, distribution: &distribution::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // 1. Compute burned/unspendable supply diff --git a/crates/brk_computer/src/supply/velocity/compute.rs b/crates/brk_computer/src/supply/velocity/compute.rs index 5370eaa7a..255bd5173 100644 --- a/crates/brk_computer/src/supply/velocity/compute.rs +++ b/crates/brk_computer/src/supply/velocity/compute.rs @@ -1,8 +1,9 @@ use brk_error::Result; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{blocks, ComputeIndexes, distribution, transactions}; +use crate::{blocks, distribution, transactions}; impl Vecs { pub(crate) fn compute( @@ -10,7 +11,7 @@ impl Vecs { blocks: &blocks::Vecs, transactions: &transactions::Vecs, distribution: &distribution::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // velocity = rolling_1y_sum(volume) / circulating_supply diff --git a/crates/brk_computer/src/transactions/compute.rs b/crates/brk_computer/src/transactions/compute.rs index 7573f1af1..0db342a92 100644 --- a/crates/brk_computer/src/transactions/compute.rs +++ b/crates/brk_computer/src/transactions/compute.rs @@ -1,8 +1,9 @@ use brk_error::Result; use brk_indexer::Indexer; +use brk_types::Indexes; use vecdb::Exit; -use crate::{blocks, indexes, inputs, outputs, prices, ComputeIndexes}; +use crate::{blocks, indexes, inputs, outputs, prices}; use super::Vecs; @@ -16,7 +17,7 @@ impl Vecs { inputs: &inputs::Vecs, outputs: &outputs::Vecs, prices: &prices::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { // Count computes first diff --git a/crates/brk_computer/src/transactions/count/compute.rs b/crates/brk_computer/src/transactions/count/compute.rs index 8443e36d0..46a2fff38 100644 --- a/crates/brk_computer/src/transactions/count/compute.rs +++ b/crates/brk_computer/src/transactions/count/compute.rs @@ -1,16 +1,17 @@ use brk_error::Result; use brk_indexer::Indexer; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{blocks, ComputeIndexes}; +use crate::blocks; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, count_vecs: &blocks::CountVecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = count_vecs.window_starts(); diff --git a/crates/brk_computer/src/transactions/fees/compute.rs b/crates/brk_computer/src/transactions/fees/compute.rs index 845c3ff9f..d0c65d2d9 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::{FeeRate, Sats}; +use brk_types::{FeeRate, Indexes, Sats}; use vecdb::{Exit, unlikely}; use super::super::size; use super::Vecs; -use crate::{ComputeIndexes, indexes, inputs}; +use crate::{indexes, inputs}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -15,7 +15,7 @@ impl Vecs { indexes: &indexes::Vecs, txins: &inputs::Vecs, size_vecs: &size::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.input_value.compute_sum_from_indexes( diff --git a/crates/brk_computer/src/transactions/size/compute.rs b/crates/brk_computer/src/transactions/size/compute.rs index dafd1f190..b840fda0e 100644 --- a/crates/brk_computer/src/transactions/size/compute.rs +++ b/crates/brk_computer/src/transactions/size/compute.rs @@ -1,16 +1,17 @@ use brk_error::Result; use brk_indexer::Indexer; +use brk_types::Indexes; use vecdb::Exit; use super::Vecs; -use crate::{indexes, ComputeIndexes}; +use crate::indexes; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, indexes: &indexes::Vecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { self.weight diff --git a/crates/brk_computer/src/transactions/versions/compute.rs b/crates/brk_computer/src/transactions/versions/compute.rs index b072f8f55..81e4a5f12 100644 --- a/crates/brk_computer/src/transactions/versions/compute.rs +++ b/crates/brk_computer/src/transactions/versions/compute.rs @@ -1,17 +1,17 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::{StoredU64, TxVersion}; +use brk_types::{Indexes, StoredU64, TxVersion}; use vecdb::{Exit, ReadableVec, VecIndex}; use super::Vecs; -use crate::{ComputeIndexes, blocks, internal::ComputedFromHeightCumulativeSum}; +use crate::{blocks, internal::ComputedFromHeightCumulativeSum}; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, count_vecs: &blocks::CountVecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = count_vecs.window_starts(); diff --git a/crates/brk_computer/src/transactions/volume/compute.rs b/crates/brk_computer/src/transactions/volume/compute.rs index be8599b98..7b172fc00 100644 --- a/crates/brk_computer/src/transactions/volume/compute.rs +++ b/crates/brk_computer/src/transactions/volume/compute.rs @@ -1,11 +1,11 @@ use brk_error::Result; use brk_indexer::Indexer; -use brk_types::Timestamp; +use brk_types::{Indexes, Timestamp}; use vecdb::Exit; use super::Vecs; use crate::transactions::{count, fees}; -use crate::{ComputeIndexes, blocks, indexes, inputs, internal::PerSec, outputs, prices}; +use crate::{blocks, indexes, inputs, internal::PerSec, outputs, prices}; impl Vecs { #[allow(clippy::too_many_arguments)] @@ -19,7 +19,7 @@ impl Vecs { fees_vecs: &fees::Vecs, inputs_count: &inputs::CountVecs, outputs_count: &outputs::CountVecs, - starting_indexes: &ComputeIndexes, + starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { let window_starts = blocks.count.window_starts(); diff --git a/crates/brk_server/src/api/openapi/mod.rs b/crates/brk_server/src/api/openapi/mod.rs index b0ace4475..0228760ab 100644 --- a/crates/brk_server/src/api/openapi/mod.rs +++ b/crates/brk_server/src/api/openapi/mod.rs @@ -72,7 +72,8 @@ pub fn create_openapi() -> OpenApi { name: "Metrics".to_string(), description: Some( "Access thousands of Bitcoin network metrics and time-series data. Query historical statistics \ - across various indexes (date, week, month, block height) with JSON or CSV output." + across various indexes (date, week, month, block height) with JSON or CSV output.\n\n\ + **Note:** Metric names are subject to change while the project is in active development." .to_string(), ), ..Default::default() diff --git a/crates/brk_types/src/indexes.rs b/crates/brk_types/src/indexes.rs index dc425e400..26e1df964 100644 --- a/crates/brk_types/src/indexes.rs +++ b/crates/brk_types/src/indexes.rs @@ -1,12 +1,9 @@ -use derive_more::{Deref, DerefMut}; - use crate::{ - Day1, Day3, Year10, DifficultyEpoch, EmptyOutputIndex, HalvingEpoch, Height, - Hour1, Hour4, Hour12, Minute10, Minute30, Month1, + EmptyOutputIndex, Height, OpReturnIndex, OutputType, P2AAddressIndex, P2MSOutputIndex, P2PK33AddressIndex, P2PK65AddressIndex, P2PKHAddressIndex, P2SHAddressIndex, P2TRAddressIndex, P2WPKHAddressIndex, - P2WSHAddressIndex, Month3, Month6, TxInIndex, TxIndex, TxOutIndex, TypeIndex, - UnknownOutputIndex, Week1, Year1, + P2WSHAddressIndex, TxInIndex, TxIndex, TxOutIndex, TypeIndex, + UnknownOutputIndex, }; /// Blockchain-level indexes tracking current positions for various entity types. @@ -67,68 +64,3 @@ impl Indexes { } } -/// Extended indexes with time-based granularities. -/// Used by brk_computer for time-series aggregation. -#[derive(Debug, Clone, Deref, DerefMut)] -pub struct ComputeIndexes { - #[deref] - #[deref_mut] - indexes: Indexes, - pub minute10: Minute10, - pub minute30: Minute30, - pub hour1: Hour1, - pub hour4: Hour4, - pub hour12: Hour12, - pub day1: Day1, - pub day3: Day3, - pub week1: Week1, - pub month1: Month1, - pub month3: Month3, - pub month6: Month6, - pub year1: Year1, - pub year10: Year10, - pub halvingepoch: HalvingEpoch, - pub difficultyepoch: DifficultyEpoch, -} - -impl ComputeIndexes { - #[allow(clippy::too_many_arguments)] - pub fn new( - indexes: Indexes, - minute10: Minute10, - minute30: Minute30, - hour1: Hour1, - hour4: Hour4, - hour12: Hour12, - day1: Day1, - day3: Day3, - week1: Week1, - month1: Month1, - month3: Month3, - month6: Month6, - year1: Year1, - year10: Year10, - halvingepoch: HalvingEpoch, - difficultyepoch: DifficultyEpoch, - ) -> Self { - Self { - indexes, - minute10, - minute30, - hour1, - hour4, - hour12, - day1, - day3, - week1, - month1, - month3, - month6, - year1, - year10, - halvingepoch, - difficultyepoch, - } - } -} - diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index cda8f6060..9ec4f0339 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -67,6 +67,34 @@ * * @typedef {TypeIndex} AnyAddressIndex */ +/** + * Unsigned basis points stored as u16. + * 1 bp = 0.0001. Range: 0–6.5535. + * Use for bounded 0–1 ratios (dominance, adoption, liveliness, etc.). + * + * @typedef {number} BasisPoints16 + */ +/** + * Unsigned basis points stored as u32. + * 1 bp = 0.0001. Range: 0–429,496.7295. + * Use for unbounded unsigned ratios (MVRV, NVT, SOPR, etc.). + * + * @typedef {number} BasisPoints32 + */ +/** + * Signed basis points stored as i16. + * 1 bp = 0.0001. Range: -3.2767 to +3.2767. + * Use for signed bounded ratios (NUPL, net PnL ratios, etc.). + * + * @typedef {number} BasisPointsSigned16 + */ +/** + * Signed basis points stored as i32. + * 1 bp = 0.0001. Range: -214,748.3647 to +214,748.3647. + * Use for unbounded signed values (returns, growth rates, volatility, z-scores, etc.). + * + * @typedef {number} BasisPointsSigned32 + */ /** * Bitcoin amount as floating point (1 BTC = 100,000,000 satoshis) * @@ -1542,766 +1570,486 @@ function createMetricPattern35(client, name) { return /** @type {MetricPattern35 // Reusable structural pattern factories /** - * @typedef {Object} AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern - * @property {MetricPattern1} adjustedSopr - * @property {MetricPattern1} adjustedSopr1y - * @property {MetricPattern1} adjustedSopr24h - * @property {MetricPattern1} adjustedSopr24h30dEma - * @property {MetricPattern1} adjustedSopr24h7dEma - * @property {MetricPattern1} adjustedSopr30d - * @property {MetricPattern1} adjustedSopr30dEma - * @property {MetricPattern1} adjustedSopr7d - * @property {MetricPattern1} adjustedSopr7dEma + * @typedef {Object} AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern + * @property {_1m1w1y24hPattern} adjustedSopr + * @property {_1m1wPattern2} adjustedSoprEma * @property {MetricPattern1} adjustedValueCreated - * @property {MetricPattern1} adjustedValueCreated1y - * @property {MetricPattern1} adjustedValueCreated24h - * @property {MetricPattern1} adjustedValueCreated30d - * @property {MetricPattern1} adjustedValueCreated7d + * @property {_1m1w1y24hPattern} adjustedValueCreatedSum * @property {MetricPattern1} adjustedValueDestroyed - * @property {MetricPattern1} adjustedValueDestroyed1y - * @property {MetricPattern1} adjustedValueDestroyed24h - * @property {MetricPattern1} adjustedValueDestroyed30d - * @property {MetricPattern1} adjustedValueDestroyed7d + * @property {_1m1w1y24hPattern} adjustedValueDestroyedSum * @property {MetricPattern18} capRaw * @property {MetricPattern1} capitulationFlow + * @property {CentsUsdPattern} grossPnl + * @property {_1m1w1y24hPattern} grossPnlSum * @property {MetricPattern18} investorCapRaw * @property {CentsSatsUsdPattern} investorPrice - * @property {RatioPattern2} investorPriceExtra - * @property {RatioPattern3} investorPriceRatioExt + * @property {BpsRatioPattern} investorPriceRatio + * @property {RatioPattern} investorPriceRatioExt * @property {MetricPattern1} lossValueCreated * @property {MetricPattern1} lossValueDestroyed * @property {CentsSatsUsdPattern} lowerPriceBand * @property {MetricPattern1} mvrv * @property {MetricPattern1} negRealizedLoss + * @property {MetricPattern1} netPnlChange1m + * @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap + * @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap * @property {CumulativeHeightPattern} netRealizedPnl - * @property {MetricPattern1} netRealizedPnl7dEma - * @property {MetricPattern1} netRealizedPnlCumulative30dDelta - * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToMarketCap - * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToRealizedCap - * @property {MetricPattern1} netRealizedPnlRelToRealizedCap + * @property {MetricPattern1} netRealizedPnlEma1w + * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap * @property {CumulativeHeightPattern} peakRegret - * @property {MetricPattern1} peakRegretRelToRealizedCap + * @property {BpsPercentRatioPattern} peakRegretRelToRealizedCap * @property {MetricPattern1} profitFlow * @property {MetricPattern1} profitValueCreated * @property {MetricPattern1} profitValueDestroyed * @property {MetricPattern1} realizedCap - * @property {MetricPattern1} realizedCap30dDelta * @property {MetricPattern1} realizedCapCents - * @property {MetricPattern1} realizedCapRelToOwnMarketCap + * @property {MetricPattern1} realizedCapChange1m + * @property {BpsPercentRatioPattern} realizedCapRelToOwnMarketCap * @property {CumulativeHeightPattern} realizedLoss - * @property {MetricPattern1} realizedLoss1y - * @property {MetricPattern1} realizedLoss24h - * @property {MetricPattern1} realizedLoss30d - * @property {MetricPattern1} realizedLoss7d - * @property {MetricPattern1} realizedLoss7dEma - * @property {MetricPattern1} realizedLossRelToRealizedCap + * @property {MetricPattern1} realizedLossEma1w + * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap + * @property {_1m1w1y24hPattern} realizedLossSum * @property {CentsSatsUsdPattern} realizedPrice - * @property {RatioPattern2} realizedPriceExtra - * @property {RatioPattern3} realizedPriceRatioExt + * @property {BpsRatioPattern} realizedPriceRatio + * @property {RatioPattern} realizedPriceRatioExt * @property {CumulativeHeightPattern} realizedProfit - * @property {MetricPattern1} realizedProfit1y - * @property {MetricPattern1} realizedProfit24h - * @property {MetricPattern1} realizedProfit30d - * @property {MetricPattern1} realizedProfit7d - * @property {MetricPattern1} realizedProfit7dEma - * @property {MetricPattern1} realizedProfitRelToRealizedCap - * @property {MetricPattern1} realizedProfitToLossRatio1y - * @property {MetricPattern1} realizedProfitToLossRatio24h - * @property {MetricPattern1} realizedProfitToLossRatio30d - * @property {MetricPattern1} realizedProfitToLossRatio7d - * @property {MetricPattern1} realizedValue - * @property {MetricPattern1} realizedValue1y - * @property {MetricPattern1} realizedValue24h - * @property {MetricPattern1} realizedValue30d - * @property {MetricPattern1} realizedValue7d - * @property {MetricPattern1} sellSideRiskRatio - * @property {MetricPattern1} sellSideRiskRatio1y - * @property {MetricPattern1} sellSideRiskRatio24h - * @property {MetricPattern1} sellSideRiskRatio24h30dEma - * @property {MetricPattern1} sellSideRiskRatio24h7dEma - * @property {MetricPattern1} sellSideRiskRatio30d - * @property {MetricPattern1} sellSideRiskRatio30dEma - * @property {MetricPattern1} sellSideRiskRatio7d - * @property {MetricPattern1} sellSideRiskRatio7dEma + * @property {MetricPattern1} realizedProfitEma1w + * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap + * @property {_1m1w1y24hPattern} realizedProfitSum + * @property {_1m1w1y24hPattern} realizedProfitToLossRatio + * @property {_1m1w1y24hPattern2} sellSideRiskRatio + * @property {_1m1wPattern} sellSideRiskRatio24hEma * @property {BaseCumulativePattern} sentInLoss - * @property {BtcCentsSatsUsdPattern} sentInLoss14dEma + * @property {_2wPattern} sentInLossEma * @property {BaseCumulativePattern} sentInProfit - * @property {BtcCentsSatsUsdPattern} sentInProfit14dEma - * @property {MetricPattern1} sopr - * @property {MetricPattern1} sopr1y - * @property {MetricPattern1} sopr24h - * @property {MetricPattern1} sopr24h30dEma - * @property {MetricPattern1} sopr24h7dEma - * @property {MetricPattern1} sopr30d - * @property {MetricPattern1} sopr30dEma - * @property {MetricPattern1} sopr7d - * @property {MetricPattern1} sopr7dEma - * @property {MetricPattern1} totalRealizedPnl + * @property {_2wPattern} sentInProfitEma + * @property {_1m1w1y24hPattern} sopr + * @property {_1m1wPattern2} sopr24hEma * @property {CentsSatsUsdPattern} upperPriceBand * @property {MetricPattern1} valueCreated - * @property {MetricPattern1} valueCreated1y - * @property {MetricPattern1} valueCreated24h - * @property {MetricPattern1} valueCreated30d - * @property {MetricPattern1} valueCreated7d + * @property {_1m1w1y24hPattern} valueCreatedSum * @property {MetricPattern1} valueDestroyed - * @property {MetricPattern1} valueDestroyed1y - * @property {MetricPattern1} valueDestroyed24h - * @property {MetricPattern1} valueDestroyed30d - * @property {MetricPattern1} valueDestroyed7d + * @property {_1m1w1y24hPattern} valueDestroyedSum */ /** - * Create a AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern pattern node + * Create a AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} + * @returns {AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} */ -function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc) { +function createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc) { return { - adjustedSopr: createMetricPattern1(client, _m(acc, 'adjusted_sopr')), - adjustedSopr1y: createMetricPattern1(client, _m(acc, 'adjusted_sopr_1y')), - adjustedSopr24h: createMetricPattern1(client, _m(acc, 'adjusted_sopr_24h')), - adjustedSopr24h30dEma: createMetricPattern1(client, _m(acc, 'adjusted_sopr_24h_30d_ema')), - adjustedSopr24h7dEma: createMetricPattern1(client, _m(acc, 'adjusted_sopr_24h_7d_ema')), - adjustedSopr30d: createMetricPattern1(client, _m(acc, 'adjusted_sopr_30d')), - adjustedSopr30dEma: createMetricPattern1(client, _m(acc, 'adjusted_sopr_30d_ema')), - adjustedSopr7d: createMetricPattern1(client, _m(acc, 'adjusted_sopr_7d')), - adjustedSopr7dEma: createMetricPattern1(client, _m(acc, 'adjusted_sopr_7d_ema')), + adjustedSopr: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_sopr')), + adjustedSoprEma: create_1m1wPattern2(client, _m(acc, 'adjusted_sopr_24h_ema')), adjustedValueCreated: createMetricPattern1(client, _m(acc, 'adjusted_value_created')), - adjustedValueCreated1y: createMetricPattern1(client, _m(acc, 'adjusted_value_created_1y')), - adjustedValueCreated24h: createMetricPattern1(client, _m(acc, 'adjusted_value_created_24h')), - adjustedValueCreated30d: createMetricPattern1(client, _m(acc, 'adjusted_value_created_30d')), - adjustedValueCreated7d: createMetricPattern1(client, _m(acc, 'adjusted_value_created_7d')), + adjustedValueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_value_created')), adjustedValueDestroyed: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed')), - adjustedValueDestroyed1y: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed_1y')), - adjustedValueDestroyed24h: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed_24h')), - adjustedValueDestroyed30d: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed_30d')), - adjustedValueDestroyed7d: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed_7d')), + adjustedValueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_value_destroyed')), capRaw: createMetricPattern18(client, _m(acc, 'cap_raw')), capitulationFlow: createMetricPattern1(client, _m(acc, 'capitulation_flow')), + grossPnl: createCentsUsdPattern(client, _m(acc, 'realized_gross_pnl')), + grossPnlSum: create_1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')), investorCapRaw: createMetricPattern18(client, _m(acc, 'investor_cap_raw')), investorPrice: createCentsSatsUsdPattern(client, _m(acc, 'investor_price')), - investorPriceExtra: createRatioPattern2(client, _m(acc, 'investor_price_ratio')), - investorPriceRatioExt: createRatioPattern3(client, _m(acc, 'investor_price_ratio')), + investorPriceRatio: createBpsRatioPattern(client, _m(acc, 'investor_price_ratio')), + investorPriceRatioExt: createRatioPattern(client, _m(acc, 'investor_price_ratio')), lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), lowerPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'lower_price_band')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netPnlChange1m: createMetricPattern1(client, _m(acc, 'net_pnl_change_1m')), + netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')), + netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')), netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), - 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: createMetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + netRealizedPnlEma1w: createMetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')), + netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), - peakRegretRelToRealizedCap: createMetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')), + peakRegretRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')), profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), profitValueDestroyed: createMetricPattern1(client, _m(acc, 'profit_value_destroyed')), realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - 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')), + realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), + realizedCapRelToOwnMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), - 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: createMetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossEma1w: createMetricPattern1(client, _m(acc, 'realized_loss_ema_1w')), + realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossSum: create_1m1w1y24hPattern(client, _m(acc, 'realized_loss')), realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), - realizedPriceRatioExt: createRatioPattern3(client, _m(acc, 'realized_price_ratio')), + realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), + realizedPriceRatioExt: createRatioPattern(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: 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')), - realizedProfitToLossRatio7d: createMetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_7d')), - realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - realizedValue1y: createMetricPattern1(client, _m(acc, 'realized_value_1y')), - realizedValue24h: createMetricPattern1(client, _m(acc, 'realized_value_24h')), - realizedValue30d: createMetricPattern1(client, _m(acc, 'realized_value_30d')), - realizedValue7d: createMetricPattern1(client, _m(acc, 'realized_value_7d')), - sellSideRiskRatio: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio1y: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_1y')), - sellSideRiskRatio24h: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h')), - sellSideRiskRatio24h30dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_30d_ema')), - sellSideRiskRatio24h7dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_7d_ema')), - sellSideRiskRatio30d: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d')), - sellSideRiskRatio30dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7d: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d')), - sellSideRiskRatio7dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), + realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')), + realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + realizedProfitSum: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit')), + realizedProfitToLossRatio: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')), + sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')), + sellSideRiskRatio24hEma: create_1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), sentInLoss: createBaseCumulativePattern(client, _m(acc, 'sent_in_loss')), - sentInLoss14dEma: createBtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_loss_14d_ema')), + sentInLossEma: create_2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')), sentInProfit: createBaseCumulativePattern(client, _m(acc, 'sent_in_profit')), - sentInProfit14dEma: createBtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_profit_14d_ema')), - sopr: createMetricPattern1(client, _m(acc, 'sopr')), - sopr1y: createMetricPattern1(client, _m(acc, 'sopr_1y')), - sopr24h: createMetricPattern1(client, _m(acc, 'sopr_24h')), - sopr24h30dEma: createMetricPattern1(client, _m(acc, 'sopr_24h_30d_ema')), - sopr24h7dEma: createMetricPattern1(client, _m(acc, 'sopr_24h_7d_ema')), - sopr30d: createMetricPattern1(client, _m(acc, 'sopr_30d')), - sopr30dEma: createMetricPattern1(client, _m(acc, 'sopr_30d_ema')), - sopr7d: createMetricPattern1(client, _m(acc, 'sopr_7d')), - sopr7dEma: createMetricPattern1(client, _m(acc, 'sopr_7d_ema')), - totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), + sentInProfitEma: create_2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')), + sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), + sopr24hEma: create_1m1wPattern2(client, _m(acc, 'sopr_24h_ema')), upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueCreated1y: createMetricPattern1(client, _m(acc, 'value_created_1y')), - valueCreated24h: createMetricPattern1(client, _m(acc, 'value_created_24h')), - valueCreated30d: createMetricPattern1(client, _m(acc, 'value_created_30d')), - valueCreated7d: createMetricPattern1(client, _m(acc, 'value_created_7d')), + valueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_created')), valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), - valueDestroyed1y: createMetricPattern1(client, _m(acc, 'value_destroyed_1y')), - valueDestroyed24h: createMetricPattern1(client, _m(acc, 'value_destroyed_24h')), - valueDestroyed30d: createMetricPattern1(client, _m(acc, 'value_destroyed_30d')), - valueDestroyed7d: createMetricPattern1(client, _m(acc, 'value_destroyed_7d')), + valueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_destroyed')), }; } /** - * @typedef {Object} AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 - * @property {MetricPattern1} adjustedSopr - * @property {MetricPattern1} adjustedSopr1y - * @property {MetricPattern1} adjustedSopr24h - * @property {MetricPattern1} adjustedSopr24h30dEma - * @property {MetricPattern1} adjustedSopr24h7dEma - * @property {MetricPattern1} adjustedSopr30d - * @property {MetricPattern1} adjustedSopr30dEma - * @property {MetricPattern1} adjustedSopr7d - * @property {MetricPattern1} adjustedSopr7dEma + * @typedef {Object} AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 + * @property {_1m1w1y24hPattern} adjustedSopr + * @property {_1m1wPattern2} adjustedSoprEma * @property {MetricPattern1} adjustedValueCreated - * @property {MetricPattern1} adjustedValueCreated1y - * @property {MetricPattern1} adjustedValueCreated24h - * @property {MetricPattern1} adjustedValueCreated30d - * @property {MetricPattern1} adjustedValueCreated7d + * @property {_1m1w1y24hPattern} adjustedValueCreatedSum * @property {MetricPattern1} adjustedValueDestroyed - * @property {MetricPattern1} adjustedValueDestroyed1y - * @property {MetricPattern1} adjustedValueDestroyed24h - * @property {MetricPattern1} adjustedValueDestroyed30d - * @property {MetricPattern1} adjustedValueDestroyed7d + * @property {_1m1w1y24hPattern} adjustedValueDestroyedSum * @property {MetricPattern18} capRaw * @property {MetricPattern1} capitulationFlow + * @property {CentsUsdPattern} grossPnl + * @property {_1m1w1y24hPattern} grossPnlSum * @property {MetricPattern18} investorCapRaw * @property {CentsSatsUsdPattern} investorPrice - * @property {RatioPattern2} investorPriceExtra + * @property {BpsRatioPattern} investorPriceRatio * @property {MetricPattern1} lossValueCreated * @property {MetricPattern1} lossValueDestroyed * @property {CentsSatsUsdPattern} lowerPriceBand * @property {MetricPattern1} mvrv * @property {MetricPattern1} negRealizedLoss + * @property {MetricPattern1} netPnlChange1m + * @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap + * @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap * @property {CumulativeHeightPattern} netRealizedPnl - * @property {MetricPattern1} netRealizedPnl7dEma - * @property {MetricPattern1} netRealizedPnlCumulative30dDelta - * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToMarketCap - * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToRealizedCap - * @property {MetricPattern1} netRealizedPnlRelToRealizedCap + * @property {MetricPattern1} netRealizedPnlEma1w + * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap * @property {CumulativeHeightPattern} peakRegret - * @property {MetricPattern1} peakRegretRelToRealizedCap + * @property {BpsPercentRatioPattern} peakRegretRelToRealizedCap * @property {MetricPattern1} profitFlow * @property {MetricPattern1} profitValueCreated * @property {MetricPattern1} profitValueDestroyed * @property {MetricPattern1} realizedCap - * @property {MetricPattern1} realizedCap30dDelta * @property {MetricPattern1} realizedCapCents + * @property {MetricPattern1} realizedCapChange1m * @property {CumulativeHeightPattern} realizedLoss - * @property {MetricPattern1} realizedLoss7dEma - * @property {MetricPattern1} realizedLossRelToRealizedCap + * @property {MetricPattern1} realizedLossEma1w + * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap * @property {CentsSatsUsdPattern} realizedPrice - * @property {RatioPattern2} realizedPriceExtra + * @property {BpsRatioPattern} realizedPriceRatio * @property {CumulativeHeightPattern} realizedProfit - * @property {MetricPattern1} realizedProfit7dEma - * @property {MetricPattern1} realizedProfitRelToRealizedCap - * @property {MetricPattern1} realizedValue - * @property {MetricPattern1} realizedValue1y - * @property {MetricPattern1} realizedValue24h - * @property {MetricPattern1} realizedValue30d - * @property {MetricPattern1} realizedValue7d - * @property {MetricPattern1} sellSideRiskRatio - * @property {MetricPattern1} sellSideRiskRatio1y - * @property {MetricPattern1} sellSideRiskRatio24h - * @property {MetricPattern1} sellSideRiskRatio24h30dEma - * @property {MetricPattern1} sellSideRiskRatio24h7dEma - * @property {MetricPattern1} sellSideRiskRatio30d - * @property {MetricPattern1} sellSideRiskRatio30dEma - * @property {MetricPattern1} sellSideRiskRatio7d - * @property {MetricPattern1} sellSideRiskRatio7dEma + * @property {MetricPattern1} realizedProfitEma1w + * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap + * @property {_1m1w1y24hPattern2} sellSideRiskRatio + * @property {_1m1wPattern} sellSideRiskRatio24hEma * @property {BaseCumulativePattern} sentInLoss - * @property {BtcCentsSatsUsdPattern} sentInLoss14dEma + * @property {_2wPattern} sentInLossEma * @property {BaseCumulativePattern} sentInProfit - * @property {BtcCentsSatsUsdPattern} sentInProfit14dEma - * @property {MetricPattern1} sopr - * @property {MetricPattern1} sopr1y - * @property {MetricPattern1} sopr24h - * @property {MetricPattern1} sopr24h30dEma - * @property {MetricPattern1} sopr24h7dEma - * @property {MetricPattern1} sopr30d - * @property {MetricPattern1} sopr30dEma - * @property {MetricPattern1} sopr7d - * @property {MetricPattern1} sopr7dEma - * @property {MetricPattern1} totalRealizedPnl + * @property {_2wPattern} sentInProfitEma + * @property {_1m1w1y24hPattern} sopr + * @property {_1m1wPattern2} sopr24hEma * @property {CentsSatsUsdPattern} upperPriceBand * @property {MetricPattern1} valueCreated - * @property {MetricPattern1} valueCreated1y - * @property {MetricPattern1} valueCreated24h - * @property {MetricPattern1} valueCreated30d - * @property {MetricPattern1} valueCreated7d + * @property {_1m1w1y24hPattern} valueCreatedSum * @property {MetricPattern1} valueDestroyed - * @property {MetricPattern1} valueDestroyed1y - * @property {MetricPattern1} valueDestroyed24h - * @property {MetricPattern1} valueDestroyed30d - * @property {MetricPattern1} valueDestroyed7d + * @property {_1m1w1y24hPattern} valueDestroyedSum */ /** - * Create a AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 pattern node + * Create a AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2} + * @returns {AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2} */ -function createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc) { +function createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc) { return { - adjustedSopr: createMetricPattern1(client, _m(acc, 'adjusted_sopr')), - adjustedSopr1y: createMetricPattern1(client, _m(acc, 'adjusted_sopr_1y')), - adjustedSopr24h: createMetricPattern1(client, _m(acc, 'adjusted_sopr_24h')), - adjustedSopr24h30dEma: createMetricPattern1(client, _m(acc, 'adjusted_sopr_24h_30d_ema')), - adjustedSopr24h7dEma: createMetricPattern1(client, _m(acc, 'adjusted_sopr_24h_7d_ema')), - adjustedSopr30d: createMetricPattern1(client, _m(acc, 'adjusted_sopr_30d')), - adjustedSopr30dEma: createMetricPattern1(client, _m(acc, 'adjusted_sopr_30d_ema')), - adjustedSopr7d: createMetricPattern1(client, _m(acc, 'adjusted_sopr_7d')), - adjustedSopr7dEma: createMetricPattern1(client, _m(acc, 'adjusted_sopr_7d_ema')), + adjustedSopr: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_sopr')), + adjustedSoprEma: create_1m1wPattern2(client, _m(acc, 'adjusted_sopr_24h_ema')), adjustedValueCreated: createMetricPattern1(client, _m(acc, 'adjusted_value_created')), - adjustedValueCreated1y: createMetricPattern1(client, _m(acc, 'adjusted_value_created_1y')), - adjustedValueCreated24h: createMetricPattern1(client, _m(acc, 'adjusted_value_created_24h')), - adjustedValueCreated30d: createMetricPattern1(client, _m(acc, 'adjusted_value_created_30d')), - adjustedValueCreated7d: createMetricPattern1(client, _m(acc, 'adjusted_value_created_7d')), + adjustedValueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_value_created')), adjustedValueDestroyed: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed')), - adjustedValueDestroyed1y: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed_1y')), - adjustedValueDestroyed24h: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed_24h')), - adjustedValueDestroyed30d: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed_30d')), - adjustedValueDestroyed7d: createMetricPattern1(client, _m(acc, 'adjusted_value_destroyed_7d')), + adjustedValueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'adjusted_value_destroyed')), capRaw: createMetricPattern18(client, _m(acc, 'cap_raw')), capitulationFlow: createMetricPattern1(client, _m(acc, 'capitulation_flow')), + grossPnl: createCentsUsdPattern(client, _m(acc, 'realized_gross_pnl')), + grossPnlSum: create_1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')), investorCapRaw: createMetricPattern18(client, _m(acc, 'investor_cap_raw')), investorPrice: createCentsSatsUsdPattern(client, _m(acc, 'investor_price')), - investorPriceExtra: createRatioPattern2(client, _m(acc, 'investor_price_ratio')), + investorPriceRatio: createBpsRatioPattern(client, _m(acc, 'investor_price_ratio')), lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), lowerPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'lower_price_band')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netPnlChange1m: createMetricPattern1(client, _m(acc, 'net_pnl_change_1m')), + netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')), + netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')), netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), - 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: createMetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + netRealizedPnlEma1w: createMetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')), + netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), - peakRegretRelToRealizedCap: createMetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')), + peakRegretRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')), profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), profitValueDestroyed: createMetricPattern1(client, _m(acc, 'profit_value_destroyed')), realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern1(client, _m(acc, 'realized_cap_30d_delta')), realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), + realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), - realizedLoss7dEma: createMetricPattern1(client, _m(acc, 'realized_loss_7d_ema')), - realizedLossRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossEma1w: createMetricPattern1(client, _m(acc, 'realized_loss_ema_1w')), + realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), + realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), - realizedProfit7dEma: createMetricPattern1(client, _m(acc, 'realized_profit_7d_ema')), - 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')), - realizedValue30d: createMetricPattern1(client, _m(acc, 'realized_value_30d')), - realizedValue7d: createMetricPattern1(client, _m(acc, 'realized_value_7d')), - sellSideRiskRatio: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio1y: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_1y')), - sellSideRiskRatio24h: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h')), - sellSideRiskRatio24h30dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_30d_ema')), - sellSideRiskRatio24h7dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_7d_ema')), - sellSideRiskRatio30d: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d')), - sellSideRiskRatio30dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7d: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d')), - sellSideRiskRatio7dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), + realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')), + realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')), + sellSideRiskRatio24hEma: create_1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), sentInLoss: createBaseCumulativePattern(client, _m(acc, 'sent_in_loss')), - sentInLoss14dEma: createBtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_loss_14d_ema')), + sentInLossEma: create_2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')), sentInProfit: createBaseCumulativePattern(client, _m(acc, 'sent_in_profit')), - sentInProfit14dEma: createBtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_profit_14d_ema')), - sopr: createMetricPattern1(client, _m(acc, 'sopr')), - sopr1y: createMetricPattern1(client, _m(acc, 'sopr_1y')), - sopr24h: createMetricPattern1(client, _m(acc, 'sopr_24h')), - sopr24h30dEma: createMetricPattern1(client, _m(acc, 'sopr_24h_30d_ema')), - sopr24h7dEma: createMetricPattern1(client, _m(acc, 'sopr_24h_7d_ema')), - sopr30d: createMetricPattern1(client, _m(acc, 'sopr_30d')), - sopr30dEma: createMetricPattern1(client, _m(acc, 'sopr_30d_ema')), - sopr7d: createMetricPattern1(client, _m(acc, 'sopr_7d')), - sopr7dEma: createMetricPattern1(client, _m(acc, 'sopr_7d_ema')), - totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), + sentInProfitEma: create_2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')), + sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), + sopr24hEma: create_1m1wPattern2(client, _m(acc, 'sopr_24h_ema')), upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueCreated1y: createMetricPattern1(client, _m(acc, 'value_created_1y')), - valueCreated24h: createMetricPattern1(client, _m(acc, 'value_created_24h')), - valueCreated30d: createMetricPattern1(client, _m(acc, 'value_created_30d')), - valueCreated7d: createMetricPattern1(client, _m(acc, 'value_created_7d')), + valueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_created')), valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), - valueDestroyed1y: createMetricPattern1(client, _m(acc, 'value_destroyed_1y')), - valueDestroyed24h: createMetricPattern1(client, _m(acc, 'value_destroyed_24h')), - valueDestroyed30d: createMetricPattern1(client, _m(acc, 'value_destroyed_30d')), - valueDestroyed7d: createMetricPattern1(client, _m(acc, 'value_destroyed_7d')), + valueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_destroyed')), }; } /** - * @typedef {Object} CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 + * @typedef {Object} CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 * @property {MetricPattern18} capRaw * @property {MetricPattern1} capitulationFlow + * @property {CentsUsdPattern} grossPnl + * @property {_1m1w1y24hPattern} grossPnlSum * @property {MetricPattern18} investorCapRaw * @property {CentsSatsUsdPattern} investorPrice - * @property {RatioPattern2} investorPriceExtra - * @property {RatioPattern3} investorPriceRatioExt + * @property {BpsRatioPattern} investorPriceRatio + * @property {RatioPattern} investorPriceRatioExt * @property {MetricPattern1} lossValueCreated * @property {MetricPattern1} lossValueDestroyed * @property {CentsSatsUsdPattern} lowerPriceBand * @property {MetricPattern1} mvrv * @property {MetricPattern1} negRealizedLoss + * @property {MetricPattern1} netPnlChange1m + * @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap + * @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap * @property {CumulativeHeightPattern} netRealizedPnl - * @property {MetricPattern1} netRealizedPnl7dEma - * @property {MetricPattern1} netRealizedPnlCumulative30dDelta - * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToMarketCap - * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToRealizedCap - * @property {MetricPattern1} netRealizedPnlRelToRealizedCap + * @property {MetricPattern1} netRealizedPnlEma1w + * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap * @property {CumulativeHeightPattern} peakRegret - * @property {MetricPattern1} peakRegretRelToRealizedCap + * @property {BpsPercentRatioPattern} peakRegretRelToRealizedCap * @property {MetricPattern1} profitFlow * @property {MetricPattern1} profitValueCreated * @property {MetricPattern1} profitValueDestroyed * @property {MetricPattern1} realizedCap - * @property {MetricPattern1} realizedCap30dDelta * @property {MetricPattern1} realizedCapCents - * @property {MetricPattern1} realizedCapRelToOwnMarketCap + * @property {MetricPattern1} realizedCapChange1m + * @property {BpsPercentRatioPattern} realizedCapRelToOwnMarketCap * @property {CumulativeHeightPattern} realizedLoss - * @property {MetricPattern1} realizedLoss1y - * @property {MetricPattern1} realizedLoss24h - * @property {MetricPattern1} realizedLoss30d - * @property {MetricPattern1} realizedLoss7d - * @property {MetricPattern1} realizedLoss7dEma - * @property {MetricPattern1} realizedLossRelToRealizedCap + * @property {MetricPattern1} realizedLossEma1w + * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap + * @property {_1m1w1y24hPattern} realizedLossSum * @property {CentsSatsUsdPattern} realizedPrice - * @property {RatioPattern2} realizedPriceExtra - * @property {RatioPattern3} realizedPriceRatioExt + * @property {BpsRatioPattern} realizedPriceRatio + * @property {RatioPattern} realizedPriceRatioExt * @property {CumulativeHeightPattern} realizedProfit - * @property {MetricPattern1} realizedProfit1y - * @property {MetricPattern1} realizedProfit24h - * @property {MetricPattern1} realizedProfit30d - * @property {MetricPattern1} realizedProfit7d - * @property {MetricPattern1} realizedProfit7dEma - * @property {MetricPattern1} realizedProfitRelToRealizedCap - * @property {MetricPattern1} realizedProfitToLossRatio1y - * @property {MetricPattern1} realizedProfitToLossRatio24h - * @property {MetricPattern1} realizedProfitToLossRatio30d - * @property {MetricPattern1} realizedProfitToLossRatio7d - * @property {MetricPattern1} realizedValue - * @property {MetricPattern1} realizedValue1y - * @property {MetricPattern1} realizedValue24h - * @property {MetricPattern1} realizedValue30d - * @property {MetricPattern1} realizedValue7d - * @property {MetricPattern1} sellSideRiskRatio - * @property {MetricPattern1} sellSideRiskRatio1y - * @property {MetricPattern1} sellSideRiskRatio24h - * @property {MetricPattern1} sellSideRiskRatio24h30dEma - * @property {MetricPattern1} sellSideRiskRatio24h7dEma - * @property {MetricPattern1} sellSideRiskRatio30d - * @property {MetricPattern1} sellSideRiskRatio30dEma - * @property {MetricPattern1} sellSideRiskRatio7d - * @property {MetricPattern1} sellSideRiskRatio7dEma + * @property {MetricPattern1} realizedProfitEma1w + * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap + * @property {_1m1w1y24hPattern} realizedProfitSum + * @property {_1m1w1y24hPattern} realizedProfitToLossRatio + * @property {_1m1w1y24hPattern2} sellSideRiskRatio + * @property {_1m1wPattern} sellSideRiskRatio24hEma * @property {BaseCumulativePattern} sentInLoss - * @property {BtcCentsSatsUsdPattern} sentInLoss14dEma + * @property {_2wPattern} sentInLossEma * @property {BaseCumulativePattern} sentInProfit - * @property {BtcCentsSatsUsdPattern} sentInProfit14dEma - * @property {MetricPattern1} sopr - * @property {MetricPattern1} sopr1y - * @property {MetricPattern1} sopr24h - * @property {MetricPattern1} sopr24h30dEma - * @property {MetricPattern1} sopr24h7dEma - * @property {MetricPattern1} sopr30d - * @property {MetricPattern1} sopr30dEma - * @property {MetricPattern1} sopr7d - * @property {MetricPattern1} sopr7dEma - * @property {MetricPattern1} totalRealizedPnl + * @property {_2wPattern} sentInProfitEma + * @property {_1m1w1y24hPattern} sopr + * @property {_1m1wPattern2} sopr24hEma * @property {CentsSatsUsdPattern} upperPriceBand * @property {MetricPattern1} valueCreated - * @property {MetricPattern1} valueCreated1y - * @property {MetricPattern1} valueCreated24h - * @property {MetricPattern1} valueCreated30d - * @property {MetricPattern1} valueCreated7d + * @property {_1m1w1y24hPattern} valueCreatedSum * @property {MetricPattern1} valueDestroyed - * @property {MetricPattern1} valueDestroyed1y - * @property {MetricPattern1} valueDestroyed24h - * @property {MetricPattern1} valueDestroyed30d - * @property {MetricPattern1} valueDestroyed7d + * @property {_1m1w1y24hPattern} valueDestroyedSum */ /** - * Create a CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 pattern node + * Create a CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2} + * @returns {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2} */ -function createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc) { +function createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc) { return { capRaw: createMetricPattern18(client, _m(acc, 'cap_raw')), capitulationFlow: createMetricPattern1(client, _m(acc, 'capitulation_flow')), + grossPnl: createCentsUsdPattern(client, _m(acc, 'realized_gross_pnl')), + grossPnlSum: create_1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')), investorCapRaw: createMetricPattern18(client, _m(acc, 'investor_cap_raw')), investorPrice: createCentsSatsUsdPattern(client, _m(acc, 'investor_price')), - investorPriceExtra: createRatioPattern2(client, _m(acc, 'investor_price_ratio')), - investorPriceRatioExt: createRatioPattern3(client, _m(acc, 'investor_price_ratio')), + investorPriceRatio: createBpsRatioPattern(client, _m(acc, 'investor_price_ratio')), + investorPriceRatioExt: createRatioPattern(client, _m(acc, 'investor_price_ratio')), lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), lowerPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'lower_price_band')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netPnlChange1m: createMetricPattern1(client, _m(acc, 'net_pnl_change_1m')), + netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')), + netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')), netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), - 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: createMetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + netRealizedPnlEma1w: createMetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')), + netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), - peakRegretRelToRealizedCap: createMetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')), + peakRegretRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')), profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), profitValueDestroyed: createMetricPattern1(client, _m(acc, 'profit_value_destroyed')), realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - 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')), + realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), + realizedCapRelToOwnMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap')), realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), - 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: createMetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossEma1w: createMetricPattern1(client, _m(acc, 'realized_loss_ema_1w')), + realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossSum: create_1m1w1y24hPattern(client, _m(acc, 'realized_loss')), realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), - realizedPriceRatioExt: createRatioPattern3(client, _m(acc, 'realized_price_ratio')), + realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), + realizedPriceRatioExt: createRatioPattern(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: 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')), - realizedProfitToLossRatio7d: createMetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_7d')), - realizedValue: createMetricPattern1(client, _m(acc, 'realized_value')), - realizedValue1y: createMetricPattern1(client, _m(acc, 'realized_value_1y')), - realizedValue24h: createMetricPattern1(client, _m(acc, 'realized_value_24h')), - realizedValue30d: createMetricPattern1(client, _m(acc, 'realized_value_30d')), - realizedValue7d: createMetricPattern1(client, _m(acc, 'realized_value_7d')), - sellSideRiskRatio: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio1y: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_1y')), - sellSideRiskRatio24h: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h')), - sellSideRiskRatio24h30dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_30d_ema')), - sellSideRiskRatio24h7dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_7d_ema')), - sellSideRiskRatio30d: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d')), - sellSideRiskRatio30dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7d: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d')), - sellSideRiskRatio7dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), + realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')), + realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + realizedProfitSum: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit')), + realizedProfitToLossRatio: create_1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')), + sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')), + sellSideRiskRatio24hEma: create_1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), sentInLoss: createBaseCumulativePattern(client, _m(acc, 'sent_in_loss')), - sentInLoss14dEma: createBtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_loss_14d_ema')), + sentInLossEma: create_2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')), sentInProfit: createBaseCumulativePattern(client, _m(acc, 'sent_in_profit')), - sentInProfit14dEma: createBtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_profit_14d_ema')), - sopr: createMetricPattern1(client, _m(acc, 'sopr')), - sopr1y: createMetricPattern1(client, _m(acc, 'sopr_1y')), - sopr24h: createMetricPattern1(client, _m(acc, 'sopr_24h')), - sopr24h30dEma: createMetricPattern1(client, _m(acc, 'sopr_24h_30d_ema')), - sopr24h7dEma: createMetricPattern1(client, _m(acc, 'sopr_24h_7d_ema')), - sopr30d: createMetricPattern1(client, _m(acc, 'sopr_30d')), - sopr30dEma: createMetricPattern1(client, _m(acc, 'sopr_30d_ema')), - sopr7d: createMetricPattern1(client, _m(acc, 'sopr_7d')), - sopr7dEma: createMetricPattern1(client, _m(acc, 'sopr_7d_ema')), - totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), + sentInProfitEma: create_2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')), + sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), + sopr24hEma: create_1m1wPattern2(client, _m(acc, 'sopr_24h_ema')), upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueCreated1y: createMetricPattern1(client, _m(acc, 'value_created_1y')), - valueCreated24h: createMetricPattern1(client, _m(acc, 'value_created_24h')), - valueCreated30d: createMetricPattern1(client, _m(acc, 'value_created_30d')), - valueCreated7d: createMetricPattern1(client, _m(acc, 'value_created_7d')), + valueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_created')), valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), - valueDestroyed1y: createMetricPattern1(client, _m(acc, 'value_destroyed_1y')), - valueDestroyed24h: createMetricPattern1(client, _m(acc, 'value_destroyed_24h')), - valueDestroyed30d: createMetricPattern1(client, _m(acc, 'value_destroyed_30d')), - valueDestroyed7d: createMetricPattern1(client, _m(acc, 'value_destroyed_7d')), + valueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_destroyed')), }; } /** - * @typedef {Object} CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern + * @typedef {Object} CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern * @property {MetricPattern18} capRaw * @property {MetricPattern1} capitulationFlow + * @property {CentsUsdPattern} grossPnl + * @property {_1m1w1y24hPattern} grossPnlSum * @property {MetricPattern18} investorCapRaw * @property {CentsSatsUsdPattern} investorPrice - * @property {RatioPattern2} investorPriceExtra + * @property {BpsRatioPattern} investorPriceRatio * @property {MetricPattern1} lossValueCreated * @property {MetricPattern1} lossValueDestroyed * @property {CentsSatsUsdPattern} lowerPriceBand * @property {MetricPattern1} mvrv * @property {MetricPattern1} negRealizedLoss + * @property {MetricPattern1} netPnlChange1m + * @property {BpsPercentRatioPattern} netPnlChange1mRelToMarketCap + * @property {BpsPercentRatioPattern} netPnlChange1mRelToRealizedCap * @property {CumulativeHeightPattern} netRealizedPnl - * @property {MetricPattern1} netRealizedPnl7dEma - * @property {MetricPattern1} netRealizedPnlCumulative30dDelta - * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToMarketCap - * @property {MetricPattern1} netRealizedPnlCumulative30dDeltaRelToRealizedCap - * @property {MetricPattern1} netRealizedPnlRelToRealizedCap + * @property {MetricPattern1} netRealizedPnlEma1w + * @property {BpsPercentRatioPattern} netRealizedPnlRelToRealizedCap * @property {CumulativeHeightPattern} peakRegret - * @property {MetricPattern1} peakRegretRelToRealizedCap + * @property {BpsPercentRatioPattern} peakRegretRelToRealizedCap * @property {MetricPattern1} profitFlow * @property {MetricPattern1} profitValueCreated * @property {MetricPattern1} profitValueDestroyed * @property {MetricPattern1} realizedCap - * @property {MetricPattern1} realizedCap30dDelta * @property {MetricPattern1} realizedCapCents + * @property {MetricPattern1} realizedCapChange1m * @property {CumulativeHeightPattern} realizedLoss - * @property {MetricPattern1} realizedLoss7dEma - * @property {MetricPattern1} realizedLossRelToRealizedCap + * @property {MetricPattern1} realizedLossEma1w + * @property {BpsPercentRatioPattern} realizedLossRelToRealizedCap * @property {CentsSatsUsdPattern} realizedPrice - * @property {RatioPattern2} realizedPriceExtra + * @property {BpsRatioPattern} realizedPriceRatio * @property {CumulativeHeightPattern} realizedProfit - * @property {MetricPattern1} realizedProfit7dEma - * @property {MetricPattern1} realizedProfitRelToRealizedCap - * @property {MetricPattern1} realizedValue - * @property {MetricPattern1} realizedValue1y - * @property {MetricPattern1} realizedValue24h - * @property {MetricPattern1} realizedValue30d - * @property {MetricPattern1} realizedValue7d - * @property {MetricPattern1} sellSideRiskRatio - * @property {MetricPattern1} sellSideRiskRatio1y - * @property {MetricPattern1} sellSideRiskRatio24h - * @property {MetricPattern1} sellSideRiskRatio24h30dEma - * @property {MetricPattern1} sellSideRiskRatio24h7dEma - * @property {MetricPattern1} sellSideRiskRatio30d - * @property {MetricPattern1} sellSideRiskRatio30dEma - * @property {MetricPattern1} sellSideRiskRatio7d - * @property {MetricPattern1} sellSideRiskRatio7dEma + * @property {MetricPattern1} realizedProfitEma1w + * @property {BpsPercentRatioPattern} realizedProfitRelToRealizedCap + * @property {_1m1w1y24hPattern2} sellSideRiskRatio + * @property {_1m1wPattern} sellSideRiskRatio24hEma * @property {BaseCumulativePattern} sentInLoss - * @property {BtcCentsSatsUsdPattern} sentInLoss14dEma + * @property {_2wPattern} sentInLossEma * @property {BaseCumulativePattern} sentInProfit - * @property {BtcCentsSatsUsdPattern} sentInProfit14dEma - * @property {MetricPattern1} sopr - * @property {MetricPattern1} sopr1y - * @property {MetricPattern1} sopr24h - * @property {MetricPattern1} sopr24h30dEma - * @property {MetricPattern1} sopr24h7dEma - * @property {MetricPattern1} sopr30d - * @property {MetricPattern1} sopr30dEma - * @property {MetricPattern1} sopr7d - * @property {MetricPattern1} sopr7dEma - * @property {MetricPattern1} totalRealizedPnl + * @property {_2wPattern} sentInProfitEma + * @property {_1m1w1y24hPattern} sopr + * @property {_1m1wPattern2} sopr24hEma * @property {CentsSatsUsdPattern} upperPriceBand * @property {MetricPattern1} valueCreated - * @property {MetricPattern1} valueCreated1y - * @property {MetricPattern1} valueCreated24h - * @property {MetricPattern1} valueCreated30d - * @property {MetricPattern1} valueCreated7d + * @property {_1m1w1y24hPattern} valueCreatedSum * @property {MetricPattern1} valueDestroyed - * @property {MetricPattern1} valueDestroyed1y - * @property {MetricPattern1} valueDestroyed24h - * @property {MetricPattern1} valueDestroyed30d - * @property {MetricPattern1} valueDestroyed7d + * @property {_1m1w1y24hPattern} valueDestroyedSum */ /** - * Create a CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern pattern node + * Create a CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} + * @returns {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} */ -function createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc) { +function createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc) { return { capRaw: createMetricPattern18(client, _m(acc, 'cap_raw')), capitulationFlow: createMetricPattern1(client, _m(acc, 'capitulation_flow')), + grossPnl: createCentsUsdPattern(client, _m(acc, 'realized_gross_pnl')), + grossPnlSum: create_1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')), investorCapRaw: createMetricPattern18(client, _m(acc, 'investor_cap_raw')), investorPrice: createCentsSatsUsdPattern(client, _m(acc, 'investor_price')), - investorPriceExtra: createRatioPattern2(client, _m(acc, 'investor_price_ratio')), + investorPriceRatio: createBpsRatioPattern(client, _m(acc, 'investor_price_ratio')), lossValueCreated: createMetricPattern1(client, _m(acc, 'loss_value_created')), lossValueDestroyed: createMetricPattern1(client, _m(acc, 'loss_value_destroyed')), lowerPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'lower_price_band')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), negRealizedLoss: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), + netPnlChange1m: createMetricPattern1(client, _m(acc, 'net_pnl_change_1m')), + netPnlChange1mRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')), + netPnlChange1mRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')), netRealizedPnl: createCumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')), - 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: createMetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), + netRealizedPnlEma1w: createMetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')), + netRealizedPnlRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')), peakRegret: createCumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')), - peakRegretRelToRealizedCap: createMetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')), + peakRegretRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')), profitFlow: createMetricPattern1(client, _m(acc, 'profit_flow')), profitValueCreated: createMetricPattern1(client, _m(acc, 'profit_value_created')), profitValueDestroyed: createMetricPattern1(client, _m(acc, 'profit_value_destroyed')), realizedCap: createMetricPattern1(client, _m(acc, 'realized_cap')), - realizedCap30dDelta: createMetricPattern1(client, _m(acc, 'realized_cap_30d_delta')), realizedCapCents: createMetricPattern1(client, _m(acc, 'realized_cap_cents')), + realizedCapChange1m: createMetricPattern1(client, _m(acc, 'realized_cap_change_1m')), realizedLoss: createCumulativeHeightPattern(client, _m(acc, 'realized_loss')), - realizedLoss7dEma: createMetricPattern1(client, _m(acc, 'realized_loss_7d_ema')), - realizedLossRelToRealizedCap: createMetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')), + realizedLossEma1w: createMetricPattern1(client, _m(acc, 'realized_loss_ema_1w')), + realizedLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')), realizedPrice: createCentsSatsUsdPattern(client, _m(acc, 'realized_price')), - realizedPriceExtra: createRatioPattern2(client, _m(acc, 'realized_price_ratio')), + realizedPriceRatio: createBpsRatioPattern(client, _m(acc, 'realized_price_ratio')), realizedProfit: createCumulativeHeightPattern(client, _m(acc, 'realized_profit')), - realizedProfit7dEma: createMetricPattern1(client, _m(acc, 'realized_profit_7d_ema')), - 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')), - realizedValue30d: createMetricPattern1(client, _m(acc, 'realized_value_30d')), - realizedValue7d: createMetricPattern1(client, _m(acc, 'realized_value_7d')), - sellSideRiskRatio: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio')), - sellSideRiskRatio1y: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_1y')), - sellSideRiskRatio24h: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h')), - sellSideRiskRatio24h30dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_30d_ema')), - sellSideRiskRatio24h7dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_7d_ema')), - sellSideRiskRatio30d: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d')), - sellSideRiskRatio30dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d_ema')), - sellSideRiskRatio7d: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d')), - sellSideRiskRatio7dEma: createMetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d_ema')), + realizedProfitEma1w: createMetricPattern1(client, _m(acc, 'realized_profit_ema_1w')), + realizedProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')), + sellSideRiskRatio: create_1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')), + sellSideRiskRatio24hEma: create_1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')), sentInLoss: createBaseCumulativePattern(client, _m(acc, 'sent_in_loss')), - sentInLoss14dEma: createBtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_loss_14d_ema')), + sentInLossEma: create_2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')), sentInProfit: createBaseCumulativePattern(client, _m(acc, 'sent_in_profit')), - sentInProfit14dEma: createBtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_profit_14d_ema')), - sopr: createMetricPattern1(client, _m(acc, 'sopr')), - sopr1y: createMetricPattern1(client, _m(acc, 'sopr_1y')), - sopr24h: createMetricPattern1(client, _m(acc, 'sopr_24h')), - sopr24h30dEma: createMetricPattern1(client, _m(acc, 'sopr_24h_30d_ema')), - sopr24h7dEma: createMetricPattern1(client, _m(acc, 'sopr_24h_7d_ema')), - sopr30d: createMetricPattern1(client, _m(acc, 'sopr_30d')), - sopr30dEma: createMetricPattern1(client, _m(acc, 'sopr_30d_ema')), - sopr7d: createMetricPattern1(client, _m(acc, 'sopr_7d')), - sopr7dEma: createMetricPattern1(client, _m(acc, 'sopr_7d_ema')), - totalRealizedPnl: createMetricPattern1(client, _m(acc, 'total_realized_pnl')), + sentInProfitEma: create_2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')), + sopr: create_1m1w1y24hPattern(client, _m(acc, 'sopr')), + sopr24hEma: create_1m1wPattern2(client, _m(acc, 'sopr_24h_ema')), upperPriceBand: createCentsSatsUsdPattern(client, _m(acc, 'upper_price_band')), valueCreated: createMetricPattern1(client, _m(acc, 'value_created')), - valueCreated1y: createMetricPattern1(client, _m(acc, 'value_created_1y')), - valueCreated24h: createMetricPattern1(client, _m(acc, 'value_created_24h')), - valueCreated30d: createMetricPattern1(client, _m(acc, 'value_created_30d')), - valueCreated7d: createMetricPattern1(client, _m(acc, 'value_created_7d')), + valueCreatedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_created')), valueDestroyed: createMetricPattern1(client, _m(acc, 'value_destroyed')), - valueDestroyed1y: createMetricPattern1(client, _m(acc, 'value_destroyed_1y')), - valueDestroyed24h: createMetricPattern1(client, _m(acc, 'value_destroyed_24h')), - valueDestroyed30d: createMetricPattern1(client, _m(acc, 'value_destroyed_30d')), - valueDestroyed7d: createMetricPattern1(client, _m(acc, 'value_destroyed_7d')), + valueDestroyedSum: create_1m1w1y24hPattern(client, _m(acc, 'value_destroyed')), }; } @@ -2345,59 +2093,171 @@ function createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellS */ function create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) { return { - _0sdPrice: createCentsSatsUsdPattern(client, _m(acc, '0sd')), - m05sd: createMetricPattern1(client, _m(acc, 'm0_5sd')), - m05sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm0_5sd')), - m15sd: createMetricPattern1(client, _m(acc, 'm1_5sd')), - m15sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm1_5sd')), - m1sd: createMetricPattern1(client, _m(acc, 'm1sd')), - m1sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm1sd')), - m25sd: createMetricPattern1(client, _m(acc, 'm2_5sd')), - m25sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm2_5sd')), - m2sd: createMetricPattern1(client, _m(acc, 'm2sd')), - m2sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm2sd')), - m3sd: createMetricPattern1(client, _m(acc, 'm3sd')), - m3sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm3sd')), - p05sd: createMetricPattern1(client, _m(acc, 'p0_5sd')), - p05sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p0_5sd')), - p15sd: createMetricPattern1(client, _m(acc, 'p1_5sd')), - p15sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p1_5sd')), - p1sd: createMetricPattern1(client, _m(acc, 'p1sd')), - p1sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p1sd')), - p25sd: createMetricPattern1(client, _m(acc, 'p2_5sd')), - p25sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p2_5sd')), - p2sd: createMetricPattern1(client, _m(acc, 'p2sd')), - p2sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p2sd')), - p3sd: createMetricPattern1(client, _m(acc, 'p3sd')), - p3sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p3sd')), - sd: createMetricPattern1(client, _m(acc, 'sd')), - sma: createMetricPattern1(client, _m(acc, 'sma')), - zscore: createMetricPattern1(client, _m(acc, 'zscore')), + _0sdPrice: createCentsSatsUsdPattern(client, _m(acc, '0sd_4y')), + m05sd: createMetricPattern1(client, _m(acc, 'm0_5sd_4y')), + m05sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm0_5sd_4y')), + m15sd: createMetricPattern1(client, _m(acc, 'm1_5sd_4y')), + m15sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm1_5sd_4y')), + m1sd: createMetricPattern1(client, _m(acc, 'm1sd_4y')), + m1sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm1sd_4y')), + m25sd: createMetricPattern1(client, _m(acc, 'm2_5sd_4y')), + m25sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm2_5sd_4y')), + m2sd: createMetricPattern1(client, _m(acc, 'm2sd_4y')), + m2sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm2sd_4y')), + m3sd: createMetricPattern1(client, _m(acc, 'm3sd_4y')), + m3sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'm3sd_4y')), + p05sd: createMetricPattern1(client, _m(acc, 'p0_5sd_4y')), + p05sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p0_5sd_4y')), + p15sd: createMetricPattern1(client, _m(acc, 'p1_5sd_4y')), + p15sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p1_5sd_4y')), + p1sd: createMetricPattern1(client, _m(acc, 'p1sd_4y')), + p1sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p1sd_4y')), + p25sd: createMetricPattern1(client, _m(acc, 'p2_5sd_4y')), + p25sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p2_5sd_4y')), + p2sd: createMetricPattern1(client, _m(acc, 'p2sd_4y')), + p2sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p2sd_4y')), + p3sd: createMetricPattern1(client, _m(acc, 'p3sd_4y')), + p3sdPrice: createCentsSatsUsdPattern(client, _m(acc, 'p3sd_4y')), + sd: createMetricPattern1(client, _m(acc, 'sd_4y')), + sma: createMetricPattern1(client, _m(acc, 'sma_4y')), + zscore: createMetricPattern1(client, _m(acc, 'zscore_4y')), + }; +} + +/** + * @typedef {Object} BpsPriceRatioPattern + * @property {MetricPattern1} bps + * @property {CentsSatsUsdPattern} price + * @property {MetricPattern1} ratio + * @property {BpsRatioPattern} ratioPct1 + * @property {CentsSatsUsdPattern} ratioPct1Price + * @property {BpsRatioPattern} ratioPct2 + * @property {CentsSatsUsdPattern} ratioPct2Price + * @property {BpsRatioPattern} ratioPct5 + * @property {CentsSatsUsdPattern} ratioPct5Price + * @property {BpsRatioPattern} ratioPct95 + * @property {CentsSatsUsdPattern} ratioPct95Price + * @property {BpsRatioPattern} ratioPct98 + * @property {CentsSatsUsdPattern} ratioPct98Price + * @property {BpsRatioPattern} ratioPct99 + * @property {CentsSatsUsdPattern} ratioPct99Price + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd1y + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd2y + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd4y + * @property {BpsRatioPattern} ratioSma1m + * @property {BpsRatioPattern} ratioSma1w + */ + +/** + * Create a BpsPriceRatioPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BpsPriceRatioPattern} + */ +function createBpsPriceRatioPattern(client, acc) { + return { + bps: createMetricPattern1(client, _m(acc, 'ratio_bps')), + price: createCentsSatsUsdPattern(client, acc), + ratio: createMetricPattern1(client, _m(acc, 'ratio')), + ratioPct1: createBpsRatioPattern(client, _m(acc, 'ratio_pct1')), + ratioPct1Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct1')), + ratioPct2: createBpsRatioPattern(client, _m(acc, 'ratio_pct2')), + ratioPct2Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct2')), + ratioPct5: createBpsRatioPattern(client, _m(acc, 'ratio_pct5')), + ratioPct5Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct5')), + ratioPct95: createBpsRatioPattern(client, _m(acc, 'ratio_pct95')), + ratioPct95Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct95')), + ratioPct98: createBpsRatioPattern(client, _m(acc, 'ratio_pct98')), + ratioPct98Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct98')), + ratioPct99: createBpsRatioPattern(client, _m(acc, 'ratio_pct99')), + ratioPct99Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct99')), + ratioSd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')), + ratioSd1y: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')), + ratioSd2y: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')), + ratioSd4y: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')), + ratioSma1m: createBpsRatioPattern(client, _m(acc, 'ratio_sma_1m')), + ratioSma1w: createBpsRatioPattern(client, _m(acc, 'ratio_sma_1w')), + }; +} + +/** + * @typedef {Object} BpsRatioPattern2 + * @property {MetricPattern1} bps + * @property {MetricPattern1} ratio + * @property {BpsRatioPattern} ratioPct1 + * @property {CentsSatsUsdPattern} ratioPct1Price + * @property {BpsRatioPattern} ratioPct2 + * @property {CentsSatsUsdPattern} ratioPct2Price + * @property {BpsRatioPattern} ratioPct5 + * @property {CentsSatsUsdPattern} ratioPct5Price + * @property {BpsRatioPattern} ratioPct95 + * @property {CentsSatsUsdPattern} ratioPct95Price + * @property {BpsRatioPattern} ratioPct98 + * @property {CentsSatsUsdPattern} ratioPct98Price + * @property {BpsRatioPattern} ratioPct99 + * @property {CentsSatsUsdPattern} ratioPct99Price + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd1y + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd2y + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd4y + * @property {BpsRatioPattern} ratioSma1m + * @property {BpsRatioPattern} ratioSma1w + */ + +/** + * Create a BpsRatioPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BpsRatioPattern2} + */ +function createBpsRatioPattern2(client, acc) { + return { + bps: createMetricPattern1(client, _m(acc, 'bps')), + ratio: createMetricPattern1(client, acc), + ratioPct1: createBpsRatioPattern(client, _m(acc, 'pct1')), + ratioPct1Price: createCentsSatsUsdPattern(client, _m(acc, 'pct1')), + ratioPct2: createBpsRatioPattern(client, _m(acc, 'pct2')), + ratioPct2Price: createCentsSatsUsdPattern(client, _m(acc, 'pct2')), + ratioPct5: createBpsRatioPattern(client, _m(acc, 'pct5')), + ratioPct5Price: createCentsSatsUsdPattern(client, _m(acc, 'pct5')), + ratioPct95: createBpsRatioPattern(client, _m(acc, 'pct95')), + ratioPct95Price: createCentsSatsUsdPattern(client, _m(acc, 'pct95')), + ratioPct98: createBpsRatioPattern(client, _m(acc, 'pct98')), + ratioPct98Price: createCentsSatsUsdPattern(client, _m(acc, 'pct98')), + ratioPct99: createBpsRatioPattern(client, _m(acc, 'pct99')), + ratioPct99Price: createCentsSatsUsdPattern(client, _m(acc, 'pct99')), + ratioSd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), + ratioSd1y: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), + ratioSd2y: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), + ratioSd4y: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), + ratioSma1m: createBpsRatioPattern(client, _m(acc, 'sma_1m')), + ratioSma1w: createBpsRatioPattern(client, _m(acc, 'sma_1w')), }; } /** * @typedef {Object} InvestedNegNetNuplSupplyUnrealizedPattern2 - * @property {MetricPattern1} investedCapitalInLossPct - * @property {MetricPattern1} investedCapitalInProfitPct - * @property {MetricPattern1} negUnrealizedLossRelToMarketCap - * @property {MetricPattern1} negUnrealizedLossRelToOwnMarketCap - * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} netUnrealizedPnlRelToMarketCap - * @property {MetricPattern1} netUnrealizedPnlRelToOwnMarketCap - * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl + * @property {BpsPercentRatioPattern} investedCapitalInLossRelToRealizedCap + * @property {BpsPercentRatioPattern} investedCapitalInProfitRelToRealizedCap + * @property {BpsPercentRatioPattern} negUnrealizedLossRelToMarketCap + * @property {BpsPercentRatioPattern} negUnrealizedLossRelToOwnGrossPnl + * @property {BpsPercentRatioPattern} negUnrealizedLossRelToOwnMarketCap + * @property {BpsPercentRatioPattern} netUnrealizedPnlRelToMarketCap + * @property {BpsPercentRatioPattern} netUnrealizedPnlRelToOwnGrossPnl + * @property {BpsPercentRatioPattern} netUnrealizedPnlRelToOwnMarketCap * @property {MetricPattern1} nupl - * @property {MetricPattern1} supplyInLossRelToCirculatingSupply - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} supplyInProfitRelToCirculatingSupply - * @property {MetricPattern1} supplyInProfitRelToOwnSupply - * @property {MetricPattern1} supplyRelToCirculatingSupply - * @property {MetricPattern1} unrealizedLossRelToMarketCap - * @property {MetricPattern1} unrealizedLossRelToOwnMarketCap - * @property {MetricPattern1} unrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} unrealizedProfitRelToMarketCap - * @property {MetricPattern1} unrealizedProfitRelToOwnMarketCap - * @property {MetricPattern1} unrealizedProfitRelToOwnTotalUnrealizedPnl + * @property {BpsPercentRatioPattern} supplyInLossRelToCirculatingSupply + * @property {BpsPercentRatioPattern} supplyInLossRelToOwnSupply + * @property {BpsPercentRatioPattern} supplyInProfitRelToCirculatingSupply + * @property {BpsPercentRatioPattern} supplyInProfitRelToOwnSupply + * @property {BpsPercentRatioPattern} supplyRelToCirculatingSupply + * @property {BpsPercentRatioPattern} unrealizedLossRelToMarketCap + * @property {BpsPercentRatioPattern} unrealizedLossRelToOwnGrossPnl + * @property {BpsPercentRatioPattern} unrealizedLossRelToOwnMarketCap + * @property {BpsPercentRatioPattern} unrealizedProfitRelToMarketCap + * @property {BpsPercentRatioPattern} unrealizedProfitRelToOwnGrossPnl + * @property {BpsPercentRatioPattern} unrealizedProfitRelToOwnMarketCap */ /** @@ -2408,81 +2268,26 @@ function create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client */ 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')), - negUnrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), - 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')), - netUnrealizedPnlRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), - 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')), + investedCapitalInLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_loss_rel_to_realized_cap')), + investedCapitalInProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_profit_rel_to_realized_cap')), + negUnrealizedLossRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), + negUnrealizedLossRelToOwnGrossPnl: createBpsPercentRatioPattern(client, _m(acc, 'neg_unrealized_loss_rel_to_own_gross_pnl')), + negUnrealizedLossRelToOwnMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')), + netUnrealizedPnlRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), + netUnrealizedPnlRelToOwnGrossPnl: createBpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_own_gross_pnl')), + netUnrealizedPnlRelToOwnMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')), nupl: createMetricPattern1(client, _m(acc, 'nupl')), - supplyInLossRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), - supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), - supplyRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_rel_to_circulating_supply')), - unrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), - 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')), - unrealizedProfitRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), - 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')), - }; -} - -/** - * @typedef {Object} PriceRatioPattern - * @property {CentsSatsUsdPattern} price - * @property {MetricPattern1} ratio - * @property {MetricPattern1} ratio1mSma - * @property {MetricPattern1} ratio1wSma - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio1ySd - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio2ySd - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio4ySd - * @property {MetricPattern1} ratioPct1 - * @property {CentsSatsUsdPattern} ratioPct1Price - * @property {MetricPattern1} ratioPct2 - * @property {CentsSatsUsdPattern} ratioPct2Price - * @property {MetricPattern1} ratioPct5 - * @property {CentsSatsUsdPattern} ratioPct5Price - * @property {MetricPattern1} ratioPct95 - * @property {CentsSatsUsdPattern} ratioPct95Price - * @property {MetricPattern1} ratioPct98 - * @property {CentsSatsUsdPattern} ratioPct98Price - * @property {MetricPattern1} ratioPct99 - * @property {CentsSatsUsdPattern} ratioPct99Price - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd - */ - -/** - * Create a PriceRatioPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {PriceRatioPattern} - */ -function createPriceRatioPattern(client, acc) { - return { - price: createCentsSatsUsdPattern(client, acc), - ratio: createMetricPattern1(client, _m(acc, 'ratio')), - ratio1mSma: createMetricPattern1(client, _m(acc, 'ratio_1m_sma')), - ratio1wSma: createMetricPattern1(client, _m(acc, 'ratio_1w_sma')), - ratio1ySd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio_1y')), - ratio2ySd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio_2y')), - ratio4ySd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio_4y')), - ratioPct1: createMetricPattern1(client, _m(acc, 'ratio_pct1')), - ratioPct1Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct1')), - ratioPct2: createMetricPattern1(client, _m(acc, 'ratio_pct2')), - ratioPct2Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct2')), - ratioPct5: createMetricPattern1(client, _m(acc, 'ratio_pct5')), - ratioPct5Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct5')), - ratioPct95: createMetricPattern1(client, _m(acc, 'ratio_pct95')), - ratioPct95Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct95')), - ratioPct98: createMetricPattern1(client, _m(acc, 'ratio_pct98')), - ratioPct98Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct98')), - ratioPct99: createMetricPattern1(client, _m(acc, 'ratio_pct99')), - ratioPct99Price: createCentsSatsUsdPattern(client, _m(acc, 'ratio_pct99')), - ratioSd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')), + supplyInLossRelToCirculatingSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), + supplyInLossRelToOwnSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), + supplyInProfitRelToCirculatingSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), + supplyInProfitRelToOwnSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), + supplyRelToCirculatingSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_rel_to_circulating_supply')), + unrealizedLossRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), + unrealizedLossRelToOwnGrossPnl: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_own_gross_pnl')), + unrealizedLossRelToOwnMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')), + unrealizedProfitRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), + unrealizedProfitRelToOwnGrossPnl: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_own_gross_pnl')), + unrealizedProfitRelToOwnMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')), }; } @@ -2541,25 +2346,24 @@ function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65 /** * @typedef {Object} RatioPattern - * @property {MetricPattern1} ratio - * @property {MetricPattern1} ratio1mSma - * @property {MetricPattern1} ratio1wSma - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio1ySd - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio2ySd - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio4ySd - * @property {MetricPattern1} ratioPct1 + * @property {BpsRatioPattern} ratioPct1 * @property {CentsSatsUsdPattern} ratioPct1Price - * @property {MetricPattern1} ratioPct2 + * @property {BpsRatioPattern} ratioPct2 * @property {CentsSatsUsdPattern} ratioPct2Price - * @property {MetricPattern1} ratioPct5 + * @property {BpsRatioPattern} ratioPct5 * @property {CentsSatsUsdPattern} ratioPct5Price - * @property {MetricPattern1} ratioPct95 + * @property {BpsRatioPattern} ratioPct95 * @property {CentsSatsUsdPattern} ratioPct95Price - * @property {MetricPattern1} ratioPct98 + * @property {BpsRatioPattern} ratioPct98 * @property {CentsSatsUsdPattern} ratioPct98Price - * @property {MetricPattern1} ratioPct99 + * @property {BpsRatioPattern} ratioPct99 * @property {CentsSatsUsdPattern} ratioPct99Price * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd1y + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd2y + * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratioSd4y + * @property {BpsRatioPattern} ratioSma1m + * @property {BpsRatioPattern} ratioSma1w */ /** @@ -2570,82 +2374,31 @@ function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65 */ function createRatioPattern(client, acc) { return { - ratio: createMetricPattern1(client, acc), - 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')), + ratioPct1: createBpsRatioPattern(client, _m(acc, 'pct1')), ratioPct1Price: createCentsSatsUsdPattern(client, _m(acc, 'pct1')), - ratioPct2: createMetricPattern1(client, _m(acc, 'pct2')), + ratioPct2: createBpsRatioPattern(client, _m(acc, 'pct2')), ratioPct2Price: createCentsSatsUsdPattern(client, _m(acc, 'pct2')), - ratioPct5: createMetricPattern1(client, _m(acc, 'pct5')), + ratioPct5: createBpsRatioPattern(client, _m(acc, 'pct5')), ratioPct5Price: createCentsSatsUsdPattern(client, _m(acc, 'pct5')), - ratioPct95: createMetricPattern1(client, _m(acc, 'pct95')), + ratioPct95: createBpsRatioPattern(client, _m(acc, 'pct95')), ratioPct95Price: createCentsSatsUsdPattern(client, _m(acc, 'pct95')), - ratioPct98: createMetricPattern1(client, _m(acc, 'pct98')), + ratioPct98: createBpsRatioPattern(client, _m(acc, 'pct98')), ratioPct98Price: createCentsSatsUsdPattern(client, _m(acc, 'pct98')), - ratioPct99: createMetricPattern1(client, _m(acc, 'pct99')), + ratioPct99: createBpsRatioPattern(client, _m(acc, 'pct99')), ratioPct99Price: createCentsSatsUsdPattern(client, _m(acc, 'pct99')), ratioSd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), + ratioSd1y: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), + ratioSd2y: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), + ratioSd4y: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), + ratioSma1m: createBpsRatioPattern(client, _m(acc, 'sma_1m')), + ratioSma1w: createBpsRatioPattern(client, _m(acc, 'sma_1w')), }; } /** - * @typedef {Object} RatioPattern3 - * @property {MetricPattern1} ratio1mSma - * @property {MetricPattern1} ratio1wSma - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio1ySd - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio2ySd - * @property {_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern} ratio4ySd - * @property {MetricPattern1} ratioPct1 - * @property {CentsSatsUsdPattern} ratioPct1Price - * @property {MetricPattern1} ratioPct2 - * @property {CentsSatsUsdPattern} ratioPct2Price - * @property {MetricPattern1} ratioPct5 - * @property {CentsSatsUsdPattern} ratioPct5Price - * @property {MetricPattern1} ratioPct95 - * @property {CentsSatsUsdPattern} ratioPct95Price - * @property {MetricPattern1} ratioPct98 - * @property {CentsSatsUsdPattern} ratioPct98Price - * @property {MetricPattern1} ratioPct99 - * @property {CentsSatsUsdPattern} ratioPct99Price - * @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')), - ratioPct1Price: createCentsSatsUsdPattern(client, _m(acc, 'pct1')), - ratioPct2: createMetricPattern1(client, _m(acc, 'pct2')), - ratioPct2Price: createCentsSatsUsdPattern(client, _m(acc, 'pct2')), - ratioPct5: createMetricPattern1(client, _m(acc, 'pct5')), - ratioPct5Price: createCentsSatsUsdPattern(client, _m(acc, 'pct5')), - ratioPct95: createMetricPattern1(client, _m(acc, 'pct95')), - ratioPct95Price: createCentsSatsUsdPattern(client, _m(acc, 'pct95')), - ratioPct98: createMetricPattern1(client, _m(acc, 'pct98')), - ratioPct98Price: createCentsSatsUsdPattern(client, _m(acc, 'pct98')), - ratioPct99: createMetricPattern1(client, _m(acc, 'pct99')), - ratioPct99Price: createCentsSatsUsdPattern(client, _m(acc, 'pct99')), - ratioSd: create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc), - }; -} - -/** - * @typedef {Object} GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern + * @typedef {Object} GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern * @property {CentsUsdPattern} greedIndex + * @property {CentsUsdPattern} grossPnl * @property {CentsUsdPattern} investedCapitalInLoss * @property {MetricPattern18} investedCapitalInLossRaw * @property {CentsUsdPattern} investedCapitalInProfit @@ -2658,20 +2411,20 @@ function createRatioPattern3(client, acc) { * @property {CentsUsdPattern} painIndex * @property {BtcCentsSatsUsdPattern} supplyInLoss * @property {BtcCentsSatsUsdPattern} supplyInProfit - * @property {CentsUsdPattern} totalUnrealizedPnl * @property {CentsUsdPattern} unrealizedLoss * @property {CentsUsdPattern} unrealizedProfit */ /** - * Create a GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern pattern node + * Create a GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} + * @returns {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} */ -function createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc) { +function createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc) { return { greedIndex: createCentsUsdPattern(client, _m(acc, 'greed_index')), + grossPnl: createCentsUsdPattern(client, _m(acc, 'unrealized_gross_pnl')), investedCapitalInLoss: createCentsUsdPattern(client, _m(acc, 'invested_capital_in_loss')), investedCapitalInLossRaw: createMetricPattern18(client, _m(acc, 'invested_capital_in_loss_raw')), investedCapitalInProfit: createCentsUsdPattern(client, _m(acc, 'invested_capital_in_profit')), @@ -2684,54 +2437,47 @@ function createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(clien painIndex: createCentsUsdPattern(client, _m(acc, 'pain_index')), supplyInLoss: createBtcCentsSatsUsdPattern(client, _m(acc, 'supply_in_loss')), supplyInProfit: createBtcCentsSatsUsdPattern(client, _m(acc, 'supply_in_profit')), - totalUnrealizedPnl: createCentsUsdPattern(client, _m(acc, 'total_unrealized_pnl')), unrealizedLoss: createCentsUsdPattern(client, _m(acc, 'unrealized_loss')), unrealizedProfit: createCentsUsdPattern(client, _m(acc, 'unrealized_profit')), }; } /** - * @typedef {Object} BlocksCoinbaseDaysDominanceFeeSubsidyPattern - * @property {CumulativeHeightSumPattern} blocksMined - * @property {MetricPattern1} blocksMined1mSum - * @property {MetricPattern1} blocksMined1wSum - * @property {MetricPattern1} blocksMined1ySum - * @property {MetricPattern1} blocksMined24hSum - * @property {MetricPattern1} blocksSinceBlock - * @property {BaseCumulativeSumPattern} coinbase - * @property {MetricPattern1} daysSinceBlock - * @property {MetricPattern1} dominance - * @property {MetricPattern1} dominance1m - * @property {MetricPattern1} dominance1w - * @property {MetricPattern1} dominance1y - * @property {MetricPattern1} dominance24h - * @property {BaseCumulativeSumPattern} fee - * @property {BaseCumulativeSumPattern} subsidy + * @typedef {Object} _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 + * @property {BpsPercentRatioPattern} _10y + * @property {BpsPercentRatioPattern} _1m + * @property {BpsPercentRatioPattern} _1w + * @property {BpsPercentRatioPattern} _1y + * @property {BpsPercentRatioPattern} _2y + * @property {BpsPercentRatioPattern} _3m + * @property {BpsPercentRatioPattern} _3y + * @property {BpsPercentRatioPattern} _4y + * @property {BpsPercentRatioPattern} _5y + * @property {BpsPercentRatioPattern} _6m + * @property {BpsPercentRatioPattern} _6y + * @property {BpsPercentRatioPattern} _8y */ /** - * Create a BlocksCoinbaseDaysDominanceFeeSubsidyPattern pattern node + * Create a _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} + * @returns {_10y1m1w1y2y3m3y4y5y6m6y8yPattern2} */ -function createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, acc) { +function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, acc) { return { - blocksMined: createCumulativeHeightSumPattern(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')), - blocksMined24hSum: createMetricPattern1(client, _m(acc, 'blocks_mined_24h_sum')), - blocksSinceBlock: createMetricPattern1(client, _m(acc, 'blocks_since_block')), - coinbase: createBaseCumulativeSumPattern(client, _m(acc, 'coinbase')), - daysSinceBlock: createMetricPattern1(client, _m(acc, 'days_since_block')), - dominance: createMetricPattern1(client, _m(acc, 'dominance')), - dominance1m: createMetricPattern1(client, _m(acc, 'dominance_1m')), - dominance1w: createMetricPattern1(client, _m(acc, 'dominance_1w')), - dominance1y: createMetricPattern1(client, _m(acc, 'dominance_1y')), - dominance24h: createMetricPattern1(client, _m(acc, 'dominance_24h')), - fee: createBaseCumulativeSumPattern(client, _m(acc, 'fee')), - subsidy: createBaseCumulativeSumPattern(client, _m(acc, 'subsidy')), + _10y: createBpsPercentRatioPattern(client, _m(acc, '10y')), + _1m: createBpsPercentRatioPattern(client, _m(acc, '1m')), + _1w: createBpsPercentRatioPattern(client, _m(acc, '1w')), + _1y: createBpsPercentRatioPattern(client, _m(acc, '1y')), + _2y: createBpsPercentRatioPattern(client, _m(acc, '2y')), + _3m: createBpsPercentRatioPattern(client, _m(acc, '3m')), + _3y: createBpsPercentRatioPattern(client, _m(acc, '3y')), + _4y: createBpsPercentRatioPattern(client, _m(acc, '4y')), + _5y: createBpsPercentRatioPattern(client, _m(acc, '5y')), + _6m: createBpsPercentRatioPattern(client, _m(acc, '6m')), + _6y: createBpsPercentRatioPattern(client, _m(acc, '6y')), + _8y: createBpsPercentRatioPattern(client, _m(acc, '8y')), }; } @@ -2759,74 +2505,35 @@ function createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, acc) { */ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) { return { - _10y: createBtcCentsSatsUsdPattern(client, _p('10y', acc)), - _1m: createBtcCentsSatsUsdPattern(client, _p('1m', acc)), - _1w: createBtcCentsSatsUsdPattern(client, _p('1w', acc)), - _1y: createBtcCentsSatsUsdPattern(client, _p('1y', acc)), - _2y: createBtcCentsSatsUsdPattern(client, _p('2y', acc)), - _3m: createBtcCentsSatsUsdPattern(client, _p('3m', acc)), - _3y: createBtcCentsSatsUsdPattern(client, _p('3y', acc)), - _4y: createBtcCentsSatsUsdPattern(client, _p('4y', acc)), - _5y: createBtcCentsSatsUsdPattern(client, _p('5y', acc)), - _6m: createBtcCentsSatsUsdPattern(client, _p('6m', acc)), - _6y: createBtcCentsSatsUsdPattern(client, _p('6y', acc)), - _8y: createBtcCentsSatsUsdPattern(client, _p('8y', acc)), - }; -} - -/** - * @typedef {Object} _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 - * @property {MetricPattern1} _10y - * @property {MetricPattern1} _1m - * @property {MetricPattern1} _1w - * @property {MetricPattern1} _1y - * @property {MetricPattern1} _2y - * @property {MetricPattern1} _3m - * @property {MetricPattern1} _3y - * @property {MetricPattern1} _4y - * @property {MetricPattern1} _5y - * @property {MetricPattern1} _6m - * @property {MetricPattern1} _6y - * @property {MetricPattern1} _8y - */ - -/** - * Create a _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_10y1m1w1y2y3m3y4y5y6m6y8yPattern2} - */ -function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, acc) { - return { - _10y: createMetricPattern1(client, _p('10y', acc)), - _1m: createMetricPattern1(client, _p('1m', acc)), - _1w: createMetricPattern1(client, _p('1w', acc)), - _1y: createMetricPattern1(client, _p('1y', acc)), - _2y: createMetricPattern1(client, _p('2y', acc)), - _3m: createMetricPattern1(client, _p('3m', acc)), - _3y: createMetricPattern1(client, _p('3y', acc)), - _4y: createMetricPattern1(client, _p('4y', acc)), - _5y: createMetricPattern1(client, _p('5y', acc)), - _6m: createMetricPattern1(client, _p('6m', acc)), - _6y: createMetricPattern1(client, _p('6y', acc)), - _8y: createMetricPattern1(client, _p('8y', acc)), + _10y: createBtcCentsSatsUsdPattern(client, _m(acc, '10y')), + _1m: createBtcCentsSatsUsdPattern(client, _m(acc, '1m')), + _1w: createBtcCentsSatsUsdPattern(client, _m(acc, '1w')), + _1y: createBtcCentsSatsUsdPattern(client, _m(acc, '1y')), + _2y: createBtcCentsSatsUsdPattern(client, _m(acc, '2y')), + _3m: createBtcCentsSatsUsdPattern(client, _m(acc, '3m')), + _3y: createBtcCentsSatsUsdPattern(client, _m(acc, '3y')), + _4y: createBtcCentsSatsUsdPattern(client, _m(acc, '4y')), + _5y: createBtcCentsSatsUsdPattern(client, _m(acc, '5y')), + _6m: createBtcCentsSatsUsdPattern(client, _m(acc, '6m')), + _6y: createBtcCentsSatsUsdPattern(client, _m(acc, '6y')), + _8y: createBtcCentsSatsUsdPattern(client, _m(acc, '8y')), }; } /** * @typedef {Object} InvestedNegNetNuplSupplyUnrealizedPattern - * @property {MetricPattern1} investedCapitalInLossPct - * @property {MetricPattern1} investedCapitalInProfitPct - * @property {MetricPattern1} negUnrealizedLossRelToMarketCap - * @property {MetricPattern1} netUnrealizedPnlRelToMarketCap + * @property {BpsPercentRatioPattern} investedCapitalInLossRelToRealizedCap + * @property {BpsPercentRatioPattern} investedCapitalInProfitRelToRealizedCap + * @property {BpsPercentRatioPattern} negUnrealizedLossRelToMarketCap + * @property {BpsPercentRatioPattern} netUnrealizedPnlRelToMarketCap * @property {MetricPattern1} nupl - * @property {MetricPattern1} supplyInLossRelToCirculatingSupply - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} supplyInProfitRelToCirculatingSupply - * @property {MetricPattern1} supplyInProfitRelToOwnSupply - * @property {MetricPattern1} supplyRelToCirculatingSupply - * @property {MetricPattern1} unrealizedLossRelToMarketCap - * @property {MetricPattern1} unrealizedProfitRelToMarketCap + * @property {BpsPercentRatioPattern} supplyInLossRelToCirculatingSupply + * @property {BpsPercentRatioPattern} supplyInLossRelToOwnSupply + * @property {BpsPercentRatioPattern} supplyInProfitRelToCirculatingSupply + * @property {BpsPercentRatioPattern} supplyInProfitRelToOwnSupply + * @property {BpsPercentRatioPattern} supplyRelToCirculatingSupply + * @property {BpsPercentRatioPattern} unrealizedLossRelToMarketCap + * @property {BpsPercentRatioPattern} unrealizedProfitRelToMarketCap */ /** @@ -2837,18 +2544,18 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, acc) { */ function createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc) { return { - investedCapitalInLossPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_loss_pct')), - investedCapitalInProfitPct: createMetricPattern1(client, _m(acc, 'invested_capital_in_profit_pct')), - negUnrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), - netUnrealizedPnlRelToMarketCap: createMetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), + investedCapitalInLossRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_loss_rel_to_realized_cap')), + investedCapitalInProfitRelToRealizedCap: createBpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_profit_rel_to_realized_cap')), + negUnrealizedLossRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')), + netUnrealizedPnlRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')), nupl: createMetricPattern1(client, _m(acc, 'nupl')), - supplyInLossRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), - supplyInLossRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), - supplyInProfitRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), - supplyInProfitRelToOwnSupply: createMetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), - supplyRelToCirculatingSupply: createMetricPattern1(client, _m(acc, 'supply_rel_to_circulating_supply')), - unrealizedLossRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), - unrealizedProfitRelToMarketCap: createMetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), + supplyInLossRelToCirculatingSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')), + supplyInLossRelToOwnSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_own_supply')), + supplyInProfitRelToCirculatingSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')), + supplyInProfitRelToOwnSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_own_supply')), + supplyRelToCirculatingSupply: createBpsPercentRatioPattern(client, _m(acc, 'supply_rel_to_circulating_supply')), + unrealizedLossRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_market_cap')), + unrealizedProfitRelToMarketCap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_market_cap')), }; } @@ -2891,17 +2598,17 @@ function createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPatter /** * @typedef {Object} AverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern - * @property {_1y24h30d7dPattern} average + * @property {_1m1w1y24hPattern} average * @property {MetricPattern1} cumulative * @property {MetricPattern18} height - * @property {_1y24h30d7dPattern} max - * @property {_1y24h30d7dPattern} median - * @property {_1y24h30d7dPattern} min - * @property {_1y24h30d7dPattern} pct10 - * @property {_1y24h30d7dPattern} pct25 - * @property {_1y24h30d7dPattern} pct75 - * @property {_1y24h30d7dPattern} pct90 - * @property {_1y24h30d7dPattern} sum + * @property {_1m1w1y24hPattern} max + * @property {_1m1w1y24hPattern} median + * @property {_1m1w1y24hPattern} min + * @property {_1m1w1y24hPattern} pct10 + * @property {_1m1w1y24hPattern} pct25 + * @property {_1m1w1y24hPattern} pct75 + * @property {_1m1w1y24hPattern} pct90 + * @property {_1m1w1y24hPattern} sum */ /** @@ -2912,17 +2619,17 @@ function createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPatter */ function createAverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) { return { - average: create_1y24h30d7dPattern(client, _m(acc, 'average')), + average: create_1m1w1y24hPattern(client, _m(acc, 'average')), cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), height: createMetricPattern18(client, acc), - max: create_1y24h30d7dPattern(client, _m(acc, 'max')), - median: create_1y24h30d7dPattern(client, _m(acc, 'median')), - min: create_1y24h30d7dPattern(client, _m(acc, 'min')), - pct10: create_1y24h30d7dPattern(client, _m(acc, 'p10')), - pct25: create_1y24h30d7dPattern(client, _m(acc, 'p25')), - pct75: create_1y24h30d7dPattern(client, _m(acc, 'p75')), - pct90: create_1y24h30d7dPattern(client, _m(acc, 'p90')), - sum: create_1y24h30d7dPattern(client, _m(acc, 'sum')), + max: create_1m1w1y24hPattern(client, _m(acc, 'max')), + median: create_1m1w1y24hPattern(client, _m(acc, 'median')), + min: create_1m1w1y24hPattern(client, _m(acc, 'min')), + pct10: create_1m1w1y24hPattern(client, _m(acc, 'p10')), + pct25: create_1m1w1y24hPattern(client, _m(acc, 'p25')), + pct75: create_1m1w1y24hPattern(client, _m(acc, 'p75')), + pct90: create_1m1w1y24hPattern(client, _m(acc, 'p90')), + sum: create_1m1w1y24hPattern(client, _m(acc, 'sum')), }; } @@ -2932,12 +2639,12 @@ function createAverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern * @property {MetricPattern1} averageLoss * @property {MetricPattern1} gains * @property {MetricPattern1} losses - * @property {MetricPattern1} rsi - * @property {MetricPattern1} rsiMax - * @property {MetricPattern1} rsiMin - * @property {MetricPattern1} stochRsi - * @property {MetricPattern1} stochRsiD - * @property {MetricPattern1} stochRsiK + * @property {BpsPercentRatioPattern} rsi + * @property {BpsPercentRatioPattern} rsiMax + * @property {BpsPercentRatioPattern} rsiMin + * @property {BpsPercentRatioPattern} stochRsi + * @property {BpsPercentRatioPattern} stochRsiD + * @property {BpsPercentRatioPattern} stochRsiK */ /** @@ -2948,16 +2655,16 @@ function createAverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern */ function createAverageGainsLossesRsiStochPattern(client, acc) { return { - averageGain: createMetricPattern1(client, _m(acc, 'avg_gain_1y')), - averageLoss: createMetricPattern1(client, _m(acc, 'avg_loss_1y')), - gains: createMetricPattern1(client, _m(acc, 'gains_1y')), - losses: createMetricPattern1(client, _m(acc, 'losses_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')), - stochRsiD: createMetricPattern1(client, _m(acc, 'stoch_rsi_d_1y')), - stochRsiK: createMetricPattern1(client, _m(acc, 'stoch_rsi_k_1y')), + averageGain: createMetricPattern1(client, _m(acc, 'average_gain_24h')), + averageLoss: createMetricPattern1(client, _m(acc, 'average_loss_24h')), + gains: createMetricPattern1(client, _m(acc, 'gains_24h')), + losses: createMetricPattern1(client, _m(acc, 'losses_24h')), + rsi: createBpsPercentRatioPattern(client, _m(acc, '24h')), + rsiMax: createBpsPercentRatioPattern(client, _m(acc, 'max_24h')), + rsiMin: createBpsPercentRatioPattern(client, _m(acc, 'min_24h')), + stochRsi: createBpsPercentRatioPattern(client, _m(acc, 'stoch_24h')), + stochRsiD: createBpsPercentRatioPattern(client, _m(acc, 'stoch_d_24h')), + stochRsiK: createBpsPercentRatioPattern(client, _m(acc, 'stoch_k_24h')), }; } @@ -2965,13 +2672,13 @@ function createAverageGainsLossesRsiStochPattern(client, acc) { * @typedef {Object} ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity * @property {MetricPattern1} addrCount - * @property {MetricPattern1} addrCount30dChange + * @property {MetricPattern1} addrCountChange1m * @property {MaxMinPattern} costBasis * @property {UtxoPattern} outputs - * @property {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized + * @property {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} realized * @property {InvestedNegNetNuplSupplyUnrealizedPattern} relative - * @property {_30dHalvedTotalPattern} supply - * @property {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} unrealized + * @property {ChangeHalvedTotalPattern} supply + * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized */ /** @@ -2984,27 +2691,27 @@ function createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(cl return { activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc), addrCount: createMetricPattern1(client, _m(acc, 'addr_count')), - addrCount30dChange: createMetricPattern1(client, _m(acc, 'addr_count_30d_change')), - costBasis: createMaxMinPattern(client, acc), + addrCountChange1m: createMetricPattern1(client, _m(acc, 'addr_count_change_1m')), + costBasis: createMaxMinPattern(client, _m(acc, 'cost_basis')), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc), + realized: createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc), relative: createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc), - supply: create_30dHalvedTotalPattern(client, acc), - unrealized: createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc), + supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), + unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc), }; } /** * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern - * @property {_30dCountPattern} all - * @property {_30dCountPattern} p2a - * @property {_30dCountPattern} p2pk33 - * @property {_30dCountPattern} p2pk65 - * @property {_30dCountPattern} p2pkh - * @property {_30dCountPattern} p2sh - * @property {_30dCountPattern} p2tr - * @property {_30dCountPattern} p2wpkh - * @property {_30dCountPattern} p2wsh + * @property {ChangeCountPattern} all + * @property {ChangeCountPattern} p2a + * @property {ChangeCountPattern} p2pk33 + * @property {ChangeCountPattern} p2pk65 + * @property {ChangeCountPattern} p2pkh + * @property {ChangeCountPattern} p2sh + * @property {ChangeCountPattern} p2tr + * @property {ChangeCountPattern} p2wpkh + * @property {ChangeCountPattern} p2wsh */ /** @@ -3015,15 +2722,15 @@ function createActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern(cl */ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern(client, acc) { return { - all: create_30dCountPattern(client, acc), - p2a: create_30dCountPattern(client, _p('p2a', acc)), - p2pk33: create_30dCountPattern(client, _p('p2pk33', acc)), - p2pk65: create_30dCountPattern(client, _p('p2pk65', acc)), - p2pkh: create_30dCountPattern(client, _p('p2pkh', acc)), - p2sh: create_30dCountPattern(client, _p('p2sh', acc)), - p2tr: create_30dCountPattern(client, _p('p2tr', acc)), - p2wpkh: create_30dCountPattern(client, _p('p2wpkh', acc)), - p2wsh: create_30dCountPattern(client, _p('p2wsh', acc)), + all: createChangeCountPattern(client, acc), + p2a: createChangeCountPattern(client, _p('p2a', acc)), + p2pk33: createChangeCountPattern(client, _p('p2pk33', acc)), + p2pk65: createChangeCountPattern(client, _p('p2pk65', acc)), + p2pkh: createChangeCountPattern(client, _p('p2pkh', acc)), + p2sh: createChangeCountPattern(client, _p('p2sh', acc)), + p2tr: createChangeCountPattern(client, _p('p2tr', acc)), + p2wpkh: createChangeCountPattern(client, _p('p2wpkh', acc)), + p2wsh: createChangeCountPattern(client, _p('p2wsh', acc)), }; } @@ -3062,15 +2769,15 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, acc) { /** * @typedef {Object} AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern - * @property {_1y24h30d7dPattern} average - * @property {_1y24h30d7dPattern} max - * @property {_1y24h30d7dPattern} median - * @property {_1y24h30d7dPattern} min - * @property {_1y24h30d7dPattern} pct10 - * @property {_1y24h30d7dPattern} pct25 - * @property {_1y24h30d7dPattern} pct75 - * @property {_1y24h30d7dPattern} pct90 - * @property {_1y24h30d7dPattern} sum + * @property {_1m1w1y24hPattern} average + * @property {_1m1w1y24hPattern} max + * @property {_1m1w1y24hPattern} median + * @property {_1m1w1y24hPattern} min + * @property {_1m1w1y24hPattern} pct10 + * @property {_1m1w1y24hPattern} pct25 + * @property {_1m1w1y24hPattern} pct75 + * @property {_1m1w1y24hPattern} pct90 + * @property {_1m1w1y24hPattern} sum */ /** @@ -3081,30 +2788,30 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, acc) { */ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) { return { - 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')), - pct10: create_1y24h30d7dPattern(client, _m(acc, 'p10')), - pct25: create_1y24h30d7dPattern(client, _m(acc, 'p25')), - pct75: create_1y24h30d7dPattern(client, _m(acc, 'p75')), - pct90: create_1y24h30d7dPattern(client, _m(acc, 'p90')), - sum: create_1y24h30d7dPattern(client, _m(acc, 'sum')), + average: create_1m1w1y24hPattern(client, _m(acc, 'average')), + max: create_1m1w1y24hPattern(client, _m(acc, 'max')), + median: create_1m1w1y24hPattern(client, _m(acc, 'median')), + min: create_1m1w1y24hPattern(client, _m(acc, 'min')), + pct10: create_1m1w1y24hPattern(client, _m(acc, 'p10')), + pct25: create_1m1w1y24hPattern(client, _m(acc, 'p25')), + pct75: create_1m1w1y24hPattern(client, _m(acc, 'p75')), + pct90: create_1m1w1y24hPattern(client, _m(acc, 'p90')), + sum: create_1m1w1y24hPattern(client, _m(acc, 'sum')), }; } /** * @template T * @typedef {Object} AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern - * @property {_1y24h30d7dPattern} average + * @property {_1m1w1y24hPattern} average * @property {MetricPattern18} height - * @property {_1y24h30d7dPattern} max - * @property {_1y24h30d7dPattern} median - * @property {_1y24h30d7dPattern} min - * @property {_1y24h30d7dPattern} pct10 - * @property {_1y24h30d7dPattern} pct25 - * @property {_1y24h30d7dPattern} pct75 - * @property {_1y24h30d7dPattern} pct90 + * @property {_1m1w1y24hPattern} max + * @property {_1m1w1y24hPattern} median + * @property {_1m1w1y24hPattern} min + * @property {_1m1w1y24hPattern} pct10 + * @property {_1m1w1y24hPattern} pct25 + * @property {_1m1w1y24hPattern} pct75 + * @property {_1m1w1y24hPattern} pct90 */ /** @@ -3116,24 +2823,24 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) { */ function createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) { return { - average: create_1y24h30d7dPattern(client, _m(acc, 'average')), + average: create_1m1w1y24hPattern(client, _m(acc, 'average')), height: createMetricPattern18(client, acc), - max: create_1y24h30d7dPattern(client, _m(acc, 'max')), - median: create_1y24h30d7dPattern(client, _m(acc, 'median')), - min: create_1y24h30d7dPattern(client, _m(acc, 'min')), - pct10: create_1y24h30d7dPattern(client, _m(acc, 'p10')), - pct25: create_1y24h30d7dPattern(client, _m(acc, 'p25')), - pct75: create_1y24h30d7dPattern(client, _m(acc, 'p75')), - pct90: create_1y24h30d7dPattern(client, _m(acc, 'p90')), + max: create_1m1w1y24hPattern(client, _m(acc, 'max')), + median: create_1m1w1y24hPattern(client, _m(acc, 'median')), + min: create_1m1w1y24hPattern(client, _m(acc, 'min')), + pct10: create_1m1w1y24hPattern(client, _m(acc, 'p10')), + pct25: create_1m1w1y24hPattern(client, _m(acc, 'p25')), + pct75: create_1m1w1y24hPattern(client, _m(acc, 'p75')), + pct90: create_1m1w1y24hPattern(client, _m(acc, 'p90')), }; } /** - * @typedef {Object} _1y24h30d7dBtcCentsSatsUsdPattern + * @typedef {Object} _1m1w1y24hBtcCentsSatsUsdPattern + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _1w * @property {BtcCentsSatsUsdPattern} _1y * @property {BtcCentsSatsUsdPattern} _24h - * @property {BtcCentsSatsUsdPattern} _30d - * @property {BtcCentsSatsUsdPattern} _7d * @property {MetricPattern18} btc * @property {MetricPattern18} cents * @property {MetricPattern18} sats @@ -3141,17 +2848,17 @@ function createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) */ /** - * Create a _1y24h30d7dBtcCentsSatsUsdPattern pattern node + * Create a _1m1w1y24hBtcCentsSatsUsdPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {_1y24h30d7dBtcCentsSatsUsdPattern} + * @returns {_1m1w1y24hBtcCentsSatsUsdPattern} */ -function create_1y24h30d7dBtcCentsSatsUsdPattern(client, acc) { +function create_1m1w1y24hBtcCentsSatsUsdPattern(client, acc) { return { + _1m: createBtcCentsSatsUsdPattern(client, _m(acc, '1m')), + _1w: createBtcCentsSatsUsdPattern(client, _m(acc, '1w')), _1y: createBtcCentsSatsUsdPattern(client, _m(acc, '1y')), _24h: createBtcCentsSatsUsdPattern(client, _m(acc, '24h')), - _30d: createBtcCentsSatsUsdPattern(client, _m(acc, '30d')), - _7d: createBtcCentsSatsUsdPattern(client, _m(acc, '7d')), btc: createMetricPattern18(client, _m(acc, 'btc')), cents: createMetricPattern18(client, _m(acc, 'cents')), sats: createMetricPattern18(client, acc), @@ -3159,6 +2866,37 @@ function create_1y24h30d7dBtcCentsSatsUsdPattern(client, acc) { }; } +/** + * @typedef {Object} BlocksCoinbaseDominanceFeeSubsidyPattern + * @property {CumulativeHeightSumPattern} blocksMined + * @property {_1m1w1y24hPattern} blocksMinedSum + * @property {MetricPattern1} blocksSinceLastMined + * @property {BaseCumulativeSumPattern} coinbase + * @property {BpsPercentRatioPattern} dominance + * @property {_1m1w1y24hPattern2} dominanceRolling + * @property {BaseCumulativeSumPattern} fee + * @property {BaseCumulativeSumPattern} subsidy + */ + +/** + * Create a BlocksCoinbaseDominanceFeeSubsidyPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BlocksCoinbaseDominanceFeeSubsidyPattern} + */ +function createBlocksCoinbaseDominanceFeeSubsidyPattern(client, acc) { + return { + blocksMined: createCumulativeHeightSumPattern(client, _m(acc, 'blocks_mined')), + blocksMinedSum: create_1m1w1y24hPattern(client, _m(acc, 'blocks_mined_sum')), + blocksSinceLastMined: createMetricPattern1(client, _m(acc, 'blocks_since_last_mined')), + coinbase: createBaseCumulativeSumPattern(client, _m(acc, 'coinbase')), + dominance: createBpsPercentRatioPattern(client, _m(acc, 'dominance')), + dominanceRolling: create_1m1w1y24hPattern2(client, _m(acc, 'dominance')), + fee: createBaseCumulativeSumPattern(client, _m(acc, 'fee')), + subsidy: createBaseCumulativeSumPattern(client, _m(acc, 'subsidy')), + }; +} + /** * @template T * @typedef {Object} AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern @@ -3194,13 +2932,13 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) { /** * @typedef {Object} _10y2y3y4y5y6y8yPattern - * @property {MetricPattern1} _10y - * @property {MetricPattern1} _2y - * @property {MetricPattern1} _3y - * @property {MetricPattern1} _4y - * @property {MetricPattern1} _5y - * @property {MetricPattern1} _6y - * @property {MetricPattern1} _8y + * @property {BpsPercentRatioPattern} _10y + * @property {BpsPercentRatioPattern} _2y + * @property {BpsPercentRatioPattern} _3y + * @property {BpsPercentRatioPattern} _4y + * @property {BpsPercentRatioPattern} _5y + * @property {BpsPercentRatioPattern} _6y + * @property {BpsPercentRatioPattern} _8y */ /** @@ -3211,13 +2949,13 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) { */ function create_10y2y3y4y5y6y8yPattern(client, acc) { return { - _10y: createMetricPattern1(client, _p('10y', acc)), - _2y: createMetricPattern1(client, _p('2y', acc)), - _3y: createMetricPattern1(client, _p('3y', acc)), - _4y: createMetricPattern1(client, _p('4y', acc)), - _5y: createMetricPattern1(client, _p('5y', acc)), - _6y: createMetricPattern1(client, _p('6y', acc)), - _8y: createMetricPattern1(client, _p('8y', acc)), + _10y: createBpsPercentRatioPattern(client, _m(acc, '10y')), + _2y: createBpsPercentRatioPattern(client, _m(acc, '2y')), + _3y: createBpsPercentRatioPattern(client, _m(acc, '3y')), + _4y: createBpsPercentRatioPattern(client, _m(acc, '4y')), + _5y: createBpsPercentRatioPattern(client, _m(acc, '5y')), + _6y: createBpsPercentRatioPattern(client, _m(acc, '6y')), + _8y: createBpsPercentRatioPattern(client, _m(acc, '8y')), }; } @@ -3226,10 +2964,10 @@ function create_10y2y3y4y5y6y8yPattern(client, acc) { * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity * @property {InvestedMaxMinPercentilesSpotPattern} costBasis * @property {UtxoPattern} outputs - * @property {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2} realized + * @property {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2} realized * @property {InvestedNegNetNuplSupplyUnrealizedPattern2} relative - * @property {_30dHalvedTotalPattern} supply - * @property {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} unrealized + * @property {ChangeHalvedTotalPattern} supply + * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized */ /** @@ -3243,10 +2981,10 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(client activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc), costBasis: createInvestedMaxMinPercentilesSpotPattern(client, acc), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc), + realized: createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc), relative: createInvestedNegNetNuplSupplyUnrealizedPattern2(client, acc), - supply: create_30dHalvedTotalPattern(client, acc), - unrealized: createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc), + supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), + unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc), }; } @@ -3255,10 +2993,10 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(client * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity * @property {MaxMinPattern} costBasis * @property {UtxoPattern} outputs - * @property {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2} realized + * @property {AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2} realized * @property {InvestedNegNetNuplSupplyUnrealizedPattern} relative - * @property {_30dHalvedTotalPattern} supply - * @property {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} unrealized + * @property {ChangeHalvedTotalPattern} supply + * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized */ /** @@ -3270,12 +3008,12 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(client function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(client, acc) { return { activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc), - costBasis: createMaxMinPattern(client, acc), + costBasis: createMaxMinPattern(client, _m(acc, 'cost_basis')), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc), + realized: createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc), relative: createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc), - supply: create_30dHalvedTotalPattern(client, acc), - unrealized: createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc), + supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), + unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc), }; } @@ -3284,10 +3022,10 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(clien * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity * @property {MaxMinPattern} costBasis * @property {UtxoPattern} outputs - * @property {CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized + * @property {CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} realized * @property {InvestedNegNetNuplSupplyUnrealizedPattern} relative - * @property {_30dHalvedTotalPattern} supply - * @property {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} unrealized + * @property {ChangeHalvedTotalPattern} supply + * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized */ /** @@ -3299,37 +3037,37 @@ function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4(clien function createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3(client, acc) { return { activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc), - costBasis: createMaxMinPattern(client, acc), + costBasis: createMaxMinPattern(client, _m(acc, 'cost_basis')), outputs: createUtxoPattern(client, _m(acc, 'utxo_count')), - realized: createCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc), + realized: createCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc), relative: createInvestedNegNetNuplSupplyUnrealizedPattern(client, acc), - supply: create_30dHalvedTotalPattern(client, acc), - unrealized: createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc), + supply: createChangeHalvedTotalPattern(client, _m(acc, 'supply')), + unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc), }; } /** - * @typedef {Object} _1y24h30d7dBaseCumulativePattern + * @typedef {Object} _1m1w1y24hBaseCumulativePattern + * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} _1m + * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} _1w * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} _1y * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} _24h - * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} _30d - * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2} _7d * @property {BtcCentsSatsUsdPattern} base * @property {BtcCentsSatsUsdPattern} cumulative */ /** - * Create a _1y24h30d7dBaseCumulativePattern pattern node + * Create a _1m1w1y24hBaseCumulativePattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {_1y24h30d7dBaseCumulativePattern} + * @returns {_1m1w1y24hBaseCumulativePattern} */ -function create_1y24h30d7dBaseCumulativePattern(client, acc) { +function create_1m1w1y24hBaseCumulativePattern(client, acc) { return { + _1m: createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '1m')), + _1w: createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '1w')), _1y: createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '1y')), _24h: createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '24h')), - _30d: createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '30d')), - _7d: createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '7d')), base: createBtcCentsSatsUsdPattern(client, acc), cumulative: createBtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')), }; @@ -3369,7 +3107,7 @@ function createBalanceBothReactivatedReceivingSendingPattern(client, acc) { * @property {MetricPattern18} satblocksDestroyed * @property {MetricPattern18} satdaysDestroyed * @property {BaseCumulativePattern} sent - * @property {BtcCentsSatsUsdPattern} sent14dEma + * @property {_2wPattern} sentEma */ /** @@ -3385,7 +3123,7 @@ function createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc) { satblocksDestroyed: createMetricPattern18(client, _m(acc, 'satblocks_destroyed')), satdaysDestroyed: createMetricPattern18(client, _m(acc, 'satdays_destroyed')), sent: createBaseCumulativePattern(client, _m(acc, 'sent')), - sent14dEma: createBtcCentsSatsUsdPattern(client, _m(acc, 'sent_14d_ema')), + sentEma: create_2wPattern(client, _m(acc, 'sent_ema_2w')), }; } @@ -3395,8 +3133,8 @@ function createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc) { * @property {CentsSatsUsdPattern} max * @property {CentsSatsUsdPattern} min * @property {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} percentiles - * @property {MetricPattern1} spotCostBasisPercentile - * @property {MetricPattern1} spotInvestedCapitalPercentile + * @property {BpsPercentRatioPattern} spotCostBasisPercentile + * @property {BpsPercentRatioPattern} spotInvestedCapitalPercentile */ /** @@ -3408,11 +3146,11 @@ function createCoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc) { function createInvestedMaxMinPercentilesSpotPattern(client, acc) { return { investedCapital: createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'invested_capital')), - max: createCentsSatsUsdPattern(client, _m(acc, 'max_cost_basis')), - min: createCentsSatsUsdPattern(client, _m(acc, 'min_cost_basis')), + max: createCentsSatsUsdPattern(client, _m(acc, 'cost_basis_max')), + min: createCentsSatsUsdPattern(client, _m(acc, 'cost_basis_min')), percentiles: createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis')), - spotCostBasisPercentile: createMetricPattern1(client, _m(acc, 'spot_cost_basis_percentile')), - spotInvestedCapitalPercentile: createMetricPattern1(client, _m(acc, 'spot_invested_capital_percentile')), + spotCostBasisPercentile: createBpsPercentRatioPattern(client, _m(acc, 'spot_cost_basis_percentile')), + spotInvestedCapitalPercentile: createBpsPercentRatioPattern(client, _m(acc, 'spot_invested_capital_percentile')), }; } @@ -3433,34 +3171,57 @@ function createInvestedMaxMinPercentilesSpotPattern(client, acc) { */ function createEmaHistogramLineSignalPattern(client, acc) { return { - emaFast: createMetricPattern1(client, _m(acc, 'ema_fast_1y')), - emaSlow: createMetricPattern1(client, _m(acc, 'ema_slow_1y')), - histogram: createMetricPattern1(client, _m(acc, 'histogram_1y')), - line: createMetricPattern1(client, _m(acc, 'line_1y')), - signal: createMetricPattern1(client, _m(acc, 'signal_1y')), + emaFast: createMetricPattern1(client, _m(acc, 'ema_fast_24h')), + emaSlow: createMetricPattern1(client, _m(acc, 'ema_slow_24h')), + histogram: createMetricPattern1(client, _m(acc, 'histogram_24h')), + line: createMetricPattern1(client, _m(acc, 'line_24h')), + signal: createMetricPattern1(client, _m(acc, 'signal_24h')), }; } /** - * @typedef {Object} _1y24h30d7dPattern2 - * @property {BtcCentsSatsUsdPattern} _1y - * @property {BtcCentsSatsUsdPattern} _24h - * @property {BtcCentsSatsUsdPattern} _30d - * @property {BtcCentsSatsUsdPattern} _7d + * @typedef {Object} _1m1w1y24hPattern2 + * @property {BpsPercentRatioPattern} _1m + * @property {BpsPercentRatioPattern} _1w + * @property {BpsPercentRatioPattern} _1y + * @property {BpsPercentRatioPattern} _24h */ /** - * Create a _1y24h30d7dPattern2 pattern node + * Create a _1m1w1y24hPattern2 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {_1y24h30d7dPattern2} + * @returns {_1m1w1y24hPattern2} */ -function create_1y24h30d7dPattern2(client, acc) { +function create_1m1w1y24hPattern2(client, acc) { return { + _1m: createBpsPercentRatioPattern(client, _m(acc, '1m')), + _1w: createBpsPercentRatioPattern(client, _m(acc, '1w')), + _1y: createBpsPercentRatioPattern(client, _m(acc, '1y')), + _24h: createBpsPercentRatioPattern(client, _m(acc, '24h')), + }; +} + +/** + * @typedef {Object} _1m1w1y24hPattern5 + * @property {BtcCentsSatsUsdPattern} _1m + * @property {BtcCentsSatsUsdPattern} _1w + * @property {BtcCentsSatsUsdPattern} _1y + * @property {BtcCentsSatsUsdPattern} _24h + */ + +/** + * Create a _1m1w1y24hPattern5 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_1m1w1y24hPattern5} + */ +function create_1m1w1y24hPattern5(client, acc) { + return { + _1m: createBtcCentsSatsUsdPattern(client, _m(acc, '1m')), + _1w: createBtcCentsSatsUsdPattern(client, _m(acc, '1w')), _1y: createBtcCentsSatsUsdPattern(client, _m(acc, '1y')), _24h: createBtcCentsSatsUsdPattern(client, _m(acc, '24h')), - _30d: createBtcCentsSatsUsdPattern(client, _m(acc, '30d')), - _7d: createBtcCentsSatsUsdPattern(client, _m(acc, '7d')), }; } @@ -3489,47 +3250,26 @@ function createBtcCentsSatsUsdPattern(client, acc) { /** * @template T - * @typedef {Object} _1y24h30d7dPattern + * @typedef {Object} _1m1w1y24hPattern + * @property {MetricPattern1} _1m + * @property {MetricPattern1} _1w * @property {MetricPattern1} _1y * @property {MetricPattern1} _24h - * @property {MetricPattern1} _30d - * @property {MetricPattern1} _7d */ /** - * Create a _1y24h30d7dPattern pattern node + * Create a _1m1w1y24hPattern pattern node * @template T * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {_1y24h30d7dPattern} + * @returns {_1m1w1y24hPattern} */ -function create_1y24h30d7dPattern(client, acc) { +function create_1m1w1y24hPattern(client, acc) { return { + _1m: createMetricPattern1(client, _m(acc, '1m')), + _1w: createMetricPattern1(client, _m(acc, '1w')), _1y: createMetricPattern1(client, _m(acc, '1y')), _24h: createMetricPattern1(client, _m(acc, '24h')), - _30d: createMetricPattern1(client, _m(acc, '30d')), - _7d: createMetricPattern1(client, _m(acc, '7d')), - }; -} - -/** - * @typedef {Object} _30dHalvedTotalPattern - * @property {BtcCentsSatsUsdPattern} _30dChange - * @property {BtcCentsSatsUsdPattern} halved - * @property {BtcCentsSatsUsdPattern} total - */ - -/** - * Create a _30dHalvedTotalPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {_30dHalvedTotalPattern} - */ -function create_30dHalvedTotalPattern(client, acc) { - return { - _30dChange: createBtcCentsSatsUsdPattern(client, _m(acc, '_30d_change')), - halved: createBtcCentsSatsUsdPattern(client, _m(acc, 'supply_halved')), - total: createBtcCentsSatsUsdPattern(client, _m(acc, 'supply')), }; } @@ -3537,7 +3277,7 @@ function create_30dHalvedTotalPattern(client, acc) { * @typedef {Object} BaseCumulativeSumPattern * @property {BtcCentsSatsUsdPattern} base * @property {BtcCentsSatsUsdPattern} cumulative - * @property {_1y24h30d7dPattern2} sum + * @property {_1m1w1y24hPattern5} sum */ /** @@ -3550,7 +3290,49 @@ function createBaseCumulativeSumPattern(client, acc) { return { base: createBtcCentsSatsUsdPattern(client, acc), cumulative: createBtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')), - sum: create_1y24h30d7dPattern2(client, _m(acc, 'sum')), + sum: create_1m1w1y24hPattern5(client, _m(acc, 'sum')), + }; +} + +/** + * @typedef {Object} BpsPercentRatioPattern2 + * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} bps + * @property {MetricPattern1} percent + * @property {MetricPattern1} ratio + */ + +/** + * Create a BpsPercentRatioPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BpsPercentRatioPattern2} + */ +function createBpsPercentRatioPattern2(client, acc) { + return { + bps: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'bps')), + percent: createMetricPattern1(client, acc), + ratio: createMetricPattern1(client, _m(acc, 'ratio')), + }; +} + +/** + * @typedef {Object} BpsPercentRatioPattern + * @property {MetricPattern1} bps + * @property {MetricPattern1} percent + * @property {MetricPattern1} ratio + */ + +/** + * Create a BpsPercentRatioPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BpsPercentRatioPattern} + */ +function createBpsPercentRatioPattern(client, acc) { + return { + bps: createMetricPattern1(client, _m(acc, 'bps')), + percent: createMetricPattern1(client, acc), + ratio: createMetricPattern1(client, _m(acc, 'ratio')), }; } @@ -3596,6 +3378,27 @@ function createCentsSatsUsdPattern(client, acc) { }; } +/** + * @typedef {Object} ChangeHalvedTotalPattern + * @property {BtcCentsSatsUsdPattern} change1m + * @property {BtcCentsSatsUsdPattern} halved + * @property {BtcCentsSatsUsdPattern} total + */ + +/** + * Create a ChangeHalvedTotalPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {ChangeHalvedTotalPattern} + */ +function createChangeHalvedTotalPattern(client, acc) { + return { + change1m: createBtcCentsSatsUsdPattern(client, _m(acc, 'change_1m')), + halved: createBtcCentsSatsUsdPattern(client, _m(acc, 'halved')), + total: createBtcCentsSatsUsdPattern(client, acc), + }; +} + /** * @template T * @typedef {Object} _6bBlockTxindexPattern @@ -3624,7 +3427,7 @@ function create_6bBlockTxindexPattern(client, acc) { * @typedef {Object} CumulativeHeightSumPattern * @property {MetricPattern1} cumulative * @property {MetricPattern18} height - * @property {_1y24h30d7dPattern} sum + * @property {_1m1w1y24hPattern} sum */ /** @@ -3638,26 +3441,45 @@ function createCumulativeHeightSumPattern(client, acc) { return { cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), height: createMetricPattern18(client, acc), - sum: create_1y24h30d7dPattern(client, acc), + sum: create_1m1w1y24hPattern(client, acc), }; } /** - * @typedef {Object} _30dCountPattern - * @property {MetricPattern1} _30dChange - * @property {MetricPattern1} count + * @typedef {Object} _1m1wPattern + * @property {BpsPercentRatioPattern} _1m + * @property {BpsPercentRatioPattern} _1w */ /** - * Create a _30dCountPattern pattern node + * Create a _1m1wPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {_30dCountPattern} + * @returns {_1m1wPattern} */ -function create_30dCountPattern(client, acc) { +function create_1m1wPattern(client, acc) { return { - _30dChange: createMetricPattern1(client, _m(acc, '30d_change')), - count: createMetricPattern1(client, acc), + _1m: createBpsPercentRatioPattern(client, _m(acc, '1m')), + _1w: createBpsPercentRatioPattern(client, _m(acc, '1w')), + }; +} + +/** + * @typedef {Object} _1m1wPattern2 + * @property {MetricPattern1} _1m + * @property {MetricPattern1} _1w + */ + +/** + * Create a _1m1wPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_1m1wPattern2} + */ +function create_1m1wPattern2(client, acc) { + return { + _1m: createMetricPattern1(client, _m(acc, '1m')), + _1w: createMetricPattern1(client, _m(acc, '1w')), }; } @@ -3680,6 +3502,25 @@ function createBaseCumulativePattern(client, acc) { }; } +/** + * @typedef {Object} BpsRatioPattern + * @property {MetricPattern1} bps + * @property {MetricPattern1} ratio + */ + +/** + * Create a BpsRatioPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BpsRatioPattern} + */ +function createBpsRatioPattern(client, acc) { + return { + bps: createMetricPattern1(client, _m(acc, 'bps')), + ratio: createMetricPattern1(client, acc), + }; +} + /** * @typedef {Object} CentsUsdPattern * @property {MetricPattern1} cents @@ -3699,6 +3540,25 @@ function createCentsUsdPattern(client, acc) { }; } +/** + * @typedef {Object} ChangeCountPattern + * @property {MetricPattern1} change1m + * @property {MetricPattern1} count + */ + +/** + * Create a ChangeCountPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {ChangeCountPattern} + */ +function createChangeCountPattern(client, acc) { + return { + change1m: createMetricPattern1(client, _m(acc, 'change_1m')), + count: createMetricPattern1(client, acc), + }; +} + /** * @typedef {Object} MaxMinPattern * @property {CentsSatsUsdPattern} max @@ -3713,8 +3573,8 @@ function createCentsUsdPattern(client, acc) { */ function createMaxMinPattern(client, acc) { return { - max: createCentsSatsUsdPattern(client, _m(acc, 'max_cost_basis')), - min: createCentsSatsUsdPattern(client, _m(acc, 'min_cost_basis')), + max: createCentsSatsUsdPattern(client, _m(acc, 'max')), + min: createCentsSatsUsdPattern(client, _m(acc, 'min')), }; } @@ -3732,15 +3592,15 @@ function createMaxMinPattern(client, acc) { */ function createSdSmaPattern(client, acc) { return { - sd: createMetricPattern1(client, _m(acc, 'sd')), - sma: createMetricPattern1(client, _m(acc, 'sma')), + sd: createMetricPattern1(client, _m(acc, 'sd_1y')), + sma: createMetricPattern1(client, _m(acc, 'sma_1y')), }; } /** * @typedef {Object} UtxoPattern * @property {MetricPattern1} utxoCount - * @property {MetricPattern1} utxoCount30dChange + * @property {MetricPattern1} utxoCountChange1m */ /** @@ -3752,7 +3612,7 @@ function createSdSmaPattern(client, acc) { function createUtxoPattern(client, acc) { return { utxoCount: createMetricPattern1(client, acc), - utxoCount30dChange: createMetricPattern1(client, _m(acc, '30d_change')), + utxoCountChange1m: createMetricPattern1(client, _m(acc, 'change_1m')), }; } @@ -3778,19 +3638,19 @@ function createCumulativeHeightPattern(client, acc) { } /** - * @typedef {Object} RatioPattern2 - * @property {MetricPattern1} ratio + * @typedef {Object} _2wPattern + * @property {BtcCentsSatsUsdPattern} _2w */ /** - * Create a RatioPattern2 pattern node + * Create a _2wPattern pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {RatioPattern2} + * @returns {_2wPattern} */ -function createRatioPattern2(client, acc) { +function create_2wPattern(client, acc) { return { - ratio: createMetricPattern1(client, acc), + _2w: createBtcCentsSatsUsdPattern(client, acc), }; } @@ -3828,14 +3688,14 @@ function createRatioPattern2(client, acc) { * @property {MetricsTree_Blocks_Halving} halving * @property {AverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern} vbytes * @property {MetricsTree_Blocks_Size} size - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} fullness + * @property {BpsPercentRatioPattern2} fullness */ /** * @typedef {Object} MetricsTree_Blocks_Difficulty * @property {MetricPattern1} raw * @property {MetricPattern1} asHash - * @property {MetricPattern1} adjustment + * @property {BpsPercentRatioPattern} adjustment * @property {MetricPattern1} epoch * @property {MetricPattern1} blocksBeforeNextAdjustment * @property {MetricPattern1} daysBeforeNextAdjustment @@ -3852,22 +3712,22 @@ function createRatioPattern2(client, acc) { * @typedef {Object} MetricsTree_Blocks_Weight * @property {MetricPattern18} base * @property {MetricPattern1} cumulative - * @property {_1y24h30d7dPattern} sum - * @property {_1y24h30d7dPattern} average - * @property {_1y24h30d7dPattern} min - * @property {_1y24h30d7dPattern} max - * @property {_1y24h30d7dPattern} pct10 - * @property {_1y24h30d7dPattern} pct25 - * @property {_1y24h30d7dPattern} median - * @property {_1y24h30d7dPattern} pct75 - * @property {_1y24h30d7dPattern} pct90 + * @property {_1m1w1y24hPattern} sum + * @property {_1m1w1y24hPattern} average + * @property {_1m1w1y24hPattern} min + * @property {_1m1w1y24hPattern} max + * @property {_1m1w1y24hPattern} pct10 + * @property {_1m1w1y24hPattern} pct25 + * @property {_1m1w1y24hPattern} median + * @property {_1m1w1y24hPattern} pct75 + * @property {_1m1w1y24hPattern} pct90 */ /** * @typedef {Object} MetricsTree_Blocks_Count * @property {MetricPattern1} blockCountTarget * @property {CumulativeHeightSumPattern} blockCount - * @property {_1y24h30d7dPattern} blockCountSum + * @property {_1m1w1y24hPattern} blockCountSum * @property {MetricPattern18} height1hAgo * @property {MetricPattern18} height24hAgo * @property {MetricPattern18} height3dAgo @@ -3923,15 +3783,15 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Blocks_Size * @property {MetricPattern1} cumulative - * @property {_1y24h30d7dPattern} sum - * @property {_1y24h30d7dPattern} average - * @property {_1y24h30d7dPattern} min - * @property {_1y24h30d7dPattern} max - * @property {_1y24h30d7dPattern} pct10 - * @property {_1y24h30d7dPattern} pct25 - * @property {_1y24h30d7dPattern} median - * @property {_1y24h30d7dPattern} pct75 - * @property {_1y24h30d7dPattern} pct90 + * @property {_1m1w1y24hPattern} sum + * @property {_1m1w1y24hPattern} average + * @property {_1m1w1y24hPattern} min + * @property {_1m1w1y24hPattern} max + * @property {_1m1w1y24hPattern} pct10 + * @property {_1m1w1y24hPattern} pct25 + * @property {_1m1w1y24hPattern} median + * @property {_1m1w1y24hPattern} pct75 + * @property {_1m1w1y24hPattern} pct90 */ /** @@ -3982,8 +3842,8 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Transactions_Volume - * @property {_1y24h30d7dBtcCentsSatsUsdPattern} sentSum - * @property {_1y24h30d7dBtcCentsSatsUsdPattern} receivedSum + * @property {_1m1w1y24hBtcCentsSatsUsdPattern} sentSum + * @property {_1m1w1y24hBtcCentsSatsUsdPattern} receivedSum * @property {BtcCentsSatsUsdPattern} annualizedVolume * @property {MetricPattern1} txPerSec * @property {MetricPattern1} outputsPerSec @@ -4083,13 +3943,13 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Scripts_Value - * @property {_1y24h30d7dBaseCumulativePattern} opreturn + * @property {_1m1w1y24hBaseCumulativePattern} opreturn */ /** * @typedef {Object} MetricsTree_Scripts_Adoption - * @property {MetricPattern1} taproot - * @property {MetricPattern1} segwit + * @property {BpsPercentRatioPattern} taproot + * @property {BpsPercentRatioPattern} segwit */ /** @@ -4100,42 +3960,36 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Mining_Rewards - * @property {_1y24h30d7dBaseCumulativePattern} coinbase - * @property {_1y24h30d7dBaseCumulativePattern} subsidy - * @property {_1y24h30d7dBaseCumulativePattern} fees + * @property {_1m1w1y24hBaseCumulativePattern} coinbase + * @property {_1m1w1y24hBaseCumulativePattern} subsidy + * @property {_1m1w1y24hBaseCumulativePattern} fees * @property {BaseCumulativeSumPattern} unclaimedRewards - * @property {MetricPattern1} feeDominance - * @property {MetricPattern1} feeDominance24h - * @property {MetricPattern1} feeDominance7d - * @property {MetricPattern1} feeDominance30d - * @property {MetricPattern1} feeDominance1y - * @property {MetricPattern1} subsidyDominance - * @property {MetricPattern1} subsidyDominance24h - * @property {MetricPattern1} subsidyDominance7d - * @property {MetricPattern1} subsidyDominance30d - * @property {MetricPattern1} subsidyDominance1y - * @property {CentsUsdPattern} subsidyUsd1ySma + * @property {BpsPercentRatioPattern} feeDominance + * @property {_1m1w1y24hPattern2} feeDominanceRolling + * @property {BpsPercentRatioPattern} subsidyDominance + * @property {_1m1w1y24hPattern2} subsidyDominanceRolling + * @property {CentsUsdPattern} subsidySma1y */ /** * @typedef {Object} MetricsTree_Mining_Hashrate * @property {MetricPattern1} hashRate - * @property {MetricPattern1} hashRate1wSma - * @property {MetricPattern1} hashRate1mSma - * @property {MetricPattern1} hashRate2mSma - * @property {MetricPattern1} hashRate1ySma + * @property {MetricPattern1} hashRateSma1w + * @property {MetricPattern1} hashRateSma1m + * @property {MetricPattern1} hashRateSma2m + * @property {MetricPattern1} hashRateSma1y * @property {MetricPattern1} hashRateAth - * @property {MetricPattern1} hashRateDrawdown + * @property {BpsPercentRatioPattern} hashRateDrawdown * @property {MetricPattern1} hashPriceThs * @property {MetricPattern1} hashPriceThsMin * @property {MetricPattern1} hashPricePhs * @property {MetricPattern1} hashPricePhsMin - * @property {MetricPattern1} hashPriceRebound + * @property {BpsPercentRatioPattern} hashPriceRebound * @property {MetricPattern1} hashValueThs * @property {MetricPattern1} hashValueThsMin * @property {MetricPattern1} hashValuePhs * @property {MetricPattern1} hashValuePhsMin - * @property {MetricPattern1} hashValueRebound + * @property {BpsPercentRatioPattern} hashValueRebound */ /** @@ -4190,25 +4044,25 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Cointime_Pricing * @property {CentsSatsUsdPattern} vaultedPrice - * @property {RatioPattern} vaultedPriceRatio + * @property {BpsRatioPattern2} vaultedPriceRatio * @property {CentsSatsUsdPattern} activePrice - * @property {RatioPattern} activePriceRatio + * @property {BpsRatioPattern2} activePriceRatio * @property {CentsSatsUsdPattern} trueMarketMean - * @property {RatioPattern} trueMarketMeanRatio + * @property {BpsRatioPattern2} trueMarketMeanRatio * @property {CentsSatsUsdPattern} cointimePrice - * @property {RatioPattern} cointimePriceRatio + * @property {BpsRatioPattern2} cointimePriceRatio */ /** * @typedef {Object} MetricsTree_Cointime_Adjusted - * @property {MetricPattern1} cointimeAdjInflationRate - * @property {MetricPattern1} cointimeAdjTxBtcVelocity - * @property {MetricPattern1} cointimeAdjTxUsdVelocity + * @property {BpsPercentRatioPattern} cointimeAdjInflationRate + * @property {MetricPattern1} cointimeAdjTxVelocityBtc + * @property {MetricPattern1} cointimeAdjTxVelocityUsd */ /** * @typedef {Object} MetricsTree_Cointime_ReserveRisk - * @property {MetricPattern18} vocdd365dMedian + * @property {MetricPattern18} vocddMedian1y * @property {MetricPattern18} hodlBank * @property {MetricPattern1} reserveRisk */ @@ -4487,11 +4341,11 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Market_Ath * @property {CentsSatsUsdPattern} priceAth - * @property {MetricPattern1} priceDrawdown + * @property {BpsPercentRatioPattern} priceDrawdown * @property {MetricPattern1} daysSincePriceAth * @property {MetricPattern2} yearsSincePriceAth - * @property {MetricPattern1} maxDaysBetweenPriceAths - * @property {MetricPattern2} maxYearsBetweenPriceAths + * @property {MetricPattern1} maxDaysBetweenPriceAth + * @property {MetricPattern2} maxYearsBetweenPriceAth */ /** @@ -4513,117 +4367,141 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Market_Returns - * @property {MetricsTree_Market_Returns_PriceReturns} priceReturns - * @property {_10y2y3y4y5y6y8yPattern} cagr - * @property {SdSmaPattern} _1dReturns1wSd - * @property {SdSmaPattern} _1dReturns1mSd - * @property {SdSmaPattern} _1dReturns1ySd - * @property {MetricPattern18} downsideReturns - * @property {SdSmaPattern} downside1wSd - * @property {SdSmaPattern} downside1mSd - * @property {SdSmaPattern} downside1ySd + * @property {MetricsTree_Market_Returns_PriceReturn} priceReturn + * @property {_10y2y3y4y5y6y8yPattern} priceCagr + * @property {MetricsTree_Market_Returns_PriceReturn24hSd1w} priceReturn24hSd1w + * @property {MetricsTree_Market_Returns_PriceReturn24hSd1m} priceReturn24hSd1m + * @property {SdSmaPattern} priceReturn24hSd1y + * @property {MetricPattern18} priceDownside24h + * @property {MetricsTree_Market_Returns_PriceDownside24hSd1w} priceDownside24hSd1w + * @property {MetricsTree_Market_Returns_PriceDownside24hSd1m} priceDownside24hSd1m + * @property {SdSmaPattern} priceDownside24hSd1y */ /** - * @typedef {Object} MetricsTree_Market_Returns_PriceReturns - * @property {MetricPattern1} _24h - * @property {MetricPattern1} _1w - * @property {MetricPattern1} _1m - * @property {MetricPattern1} _3m - * @property {MetricPattern1} _6m - * @property {MetricPattern1} _1y - * @property {MetricPattern1} _2y - * @property {MetricPattern1} _3y - * @property {MetricPattern1} _4y - * @property {MetricPattern1} _5y - * @property {MetricPattern1} _6y - * @property {MetricPattern1} _8y - * @property {MetricPattern1} _10y + * @typedef {Object} MetricsTree_Market_Returns_PriceReturn + * @property {BpsPercentRatioPattern} _24h + * @property {BpsPercentRatioPattern} _1w + * @property {BpsPercentRatioPattern} _1m + * @property {BpsPercentRatioPattern} _3m + * @property {BpsPercentRatioPattern} _6m + * @property {BpsPercentRatioPattern} _1y + * @property {BpsPercentRatioPattern} _2y + * @property {BpsPercentRatioPattern} _3y + * @property {BpsPercentRatioPattern} _4y + * @property {BpsPercentRatioPattern} _5y + * @property {BpsPercentRatioPattern} _6y + * @property {BpsPercentRatioPattern} _8y + * @property {BpsPercentRatioPattern} _10y + */ + +/** + * @typedef {Object} MetricsTree_Market_Returns_PriceReturn24hSd1w + * @property {MetricPattern1} sma + * @property {MetricPattern1} sd + */ + +/** + * @typedef {Object} MetricsTree_Market_Returns_PriceReturn24hSd1m + * @property {MetricPattern1} sma + * @property {MetricPattern1} sd + */ + +/** + * @typedef {Object} MetricsTree_Market_Returns_PriceDownside24hSd1w + * @property {MetricPattern1} sma + * @property {MetricPattern1} sd + */ + +/** + * @typedef {Object} MetricsTree_Market_Returns_PriceDownside24hSd1m + * @property {MetricPattern1} sma + * @property {MetricPattern1} sd */ /** * @typedef {Object} MetricsTree_Market_Volatility - * @property {MetricPattern1} price1wVolatility - * @property {MetricPattern1} price1mVolatility - * @property {MetricPattern1} price1yVolatility - * @property {MetricPattern1} sharpe1w - * @property {MetricPattern1} sharpe1m - * @property {MetricPattern1} sharpe1y - * @property {MetricPattern1} sortino1w - * @property {MetricPattern1} sortino1m - * @property {MetricPattern1} sortino1y + * @property {MetricPattern1} priceVolatility1w + * @property {MetricPattern1} priceVolatility1m + * @property {MetricPattern1} priceVolatility1y + * @property {MetricPattern1} priceSharpe1w + * @property {MetricPattern1} priceSharpe1m + * @property {MetricPattern1} priceSharpe1y + * @property {MetricPattern1} priceSortino1w + * @property {MetricPattern1} priceSortino1m + * @property {MetricPattern1} priceSortino1y */ /** * @typedef {Object} MetricsTree_Market_Range - * @property {CentsSatsUsdPattern} price1wMin - * @property {CentsSatsUsdPattern} price1wMax - * @property {CentsSatsUsdPattern} price2wMin - * @property {CentsSatsUsdPattern} price2wMax - * @property {CentsSatsUsdPattern} price1mMin - * @property {CentsSatsUsdPattern} price1mMax - * @property {CentsSatsUsdPattern} price1yMin - * @property {CentsSatsUsdPattern} price1yMax + * @property {CentsSatsUsdPattern} priceMin1w + * @property {CentsSatsUsdPattern} priceMax1w + * @property {CentsSatsUsdPattern} priceMin2w + * @property {CentsSatsUsdPattern} priceMax2w + * @property {CentsSatsUsdPattern} priceMin1m + * @property {CentsSatsUsdPattern} priceMax1m + * @property {CentsSatsUsdPattern} priceMin1y + * @property {CentsSatsUsdPattern} priceMax1y * @property {MetricPattern1} priceTrueRange - * @property {MetricPattern1} priceTrueRange2wSum - * @property {MetricPattern1} price2wChoppinessIndex + * @property {MetricPattern1} priceTrueRangeSum2w + * @property {BpsPercentRatioPattern} priceChoppinessIndex2w */ /** * @typedef {Object} MetricsTree_Market_MovingAverage - * @property {PriceRatioPattern} price1wSma - * @property {PriceRatioPattern} price8dSma - * @property {PriceRatioPattern} price13dSma - * @property {PriceRatioPattern} price21dSma - * @property {PriceRatioPattern} price1mSma - * @property {PriceRatioPattern} price34dSma - * @property {PriceRatioPattern} price55dSma - * @property {PriceRatioPattern} price89dSma - * @property {PriceRatioPattern} price111dSma - * @property {PriceRatioPattern} price144dSma - * @property {PriceRatioPattern} price200dSma - * @property {PriceRatioPattern} price350dSma - * @property {PriceRatioPattern} price1ySma - * @property {PriceRatioPattern} price2ySma - * @property {PriceRatioPattern} price200wSma - * @property {PriceRatioPattern} price4ySma - * @property {PriceRatioPattern} price1wEma - * @property {PriceRatioPattern} price8dEma - * @property {PriceRatioPattern} price12dEma - * @property {PriceRatioPattern} price13dEma - * @property {PriceRatioPattern} price21dEma - * @property {PriceRatioPattern} price26dEma - * @property {PriceRatioPattern} price1mEma - * @property {PriceRatioPattern} price34dEma - * @property {PriceRatioPattern} price55dEma - * @property {PriceRatioPattern} price89dEma - * @property {PriceRatioPattern} price144dEma - * @property {PriceRatioPattern} price200dEma - * @property {PriceRatioPattern} price1yEma - * @property {PriceRatioPattern} price2yEma - * @property {PriceRatioPattern} price200wEma - * @property {PriceRatioPattern} price4yEma - * @property {CentsSatsUsdPattern} price200dSmaX24 - * @property {CentsSatsUsdPattern} price200dSmaX08 - * @property {CentsSatsUsdPattern} price350dSmaX2 + * @property {BpsPriceRatioPattern} priceSma1w + * @property {BpsPriceRatioPattern} priceSma8d + * @property {BpsPriceRatioPattern} priceSma13d + * @property {BpsPriceRatioPattern} priceSma21d + * @property {BpsPriceRatioPattern} priceSma1m + * @property {BpsPriceRatioPattern} priceSma34d + * @property {BpsPriceRatioPattern} priceSma55d + * @property {BpsPriceRatioPattern} priceSma89d + * @property {BpsPriceRatioPattern} priceSma111d + * @property {BpsPriceRatioPattern} priceSma144d + * @property {BpsPriceRatioPattern} priceSma200d + * @property {BpsPriceRatioPattern} priceSma350d + * @property {BpsPriceRatioPattern} priceSma1y + * @property {BpsPriceRatioPattern} priceSma2y + * @property {BpsPriceRatioPattern} priceSma200w + * @property {BpsPriceRatioPattern} priceSma4y + * @property {BpsPriceRatioPattern} priceEma1w + * @property {BpsPriceRatioPattern} priceEma8d + * @property {BpsPriceRatioPattern} priceEma12d + * @property {BpsPriceRatioPattern} priceEma13d + * @property {BpsPriceRatioPattern} priceEma21d + * @property {BpsPriceRatioPattern} priceEma26d + * @property {BpsPriceRatioPattern} priceEma1m + * @property {BpsPriceRatioPattern} priceEma34d + * @property {BpsPriceRatioPattern} priceEma55d + * @property {BpsPriceRatioPattern} priceEma89d + * @property {BpsPriceRatioPattern} priceEma144d + * @property {BpsPriceRatioPattern} priceEma200d + * @property {BpsPriceRatioPattern} priceEma1y + * @property {BpsPriceRatioPattern} priceEma2y + * @property {BpsPriceRatioPattern} priceEma200w + * @property {BpsPriceRatioPattern} priceEma4y + * @property {CentsSatsUsdPattern} priceSma200dX24 + * @property {CentsSatsUsdPattern} priceSma200dX08 + * @property {CentsSatsUsdPattern} priceSma350dX2 */ /** * @typedef {Object} MetricsTree_Market_Dca * @property {MetricPattern18} dcaSatsPerDay * @property {_10y1m1w1y2y3m3y4y5y6m6y8yPattern3} periodStack - * @property {MetricsTree_Market_Dca_PeriodAveragePrice} periodAveragePrice - * @property {_10y1m1w1y2y3m3y4y5y6m6y8yPattern2} periodReturns + * @property {MetricsTree_Market_Dca_PeriodCostBasis} periodCostBasis + * @property {_10y1m1w1y2y3m3y4y5y6m6y8yPattern2} periodReturn * @property {_10y2y3y4y5y6y8yPattern} periodCagr * @property {_10y1m1w1y2y3m3y4y5y6m6y8yPattern3} periodLumpSumStack - * @property {_10y1m1w1y2y3m3y4y5y6m6y8yPattern2} periodLumpSumReturns + * @property {_10y1m1w1y2y3m3y4y5y6m6y8yPattern2} periodLumpSumReturn * @property {MetricsTree_Market_Dca_ClassStack} classStack - * @property {MetricsTree_Market_Dca_ClassAveragePrice} classAveragePrice - * @property {MetricsTree_Market_Dca_ClassReturns} classReturns + * @property {MetricsTree_Market_Dca_ClassCostBasis} classCostBasis + * @property {MetricsTree_Market_Dca_ClassReturn} classReturn */ /** - * @typedef {Object} MetricsTree_Market_Dca_PeriodAveragePrice + * @typedef {Object} MetricsTree_Market_Dca_PeriodCostBasis * @property {CentsSatsUsdPattern} _1w * @property {CentsSatsUsdPattern} _1m * @property {CentsSatsUsdPattern} _3m @@ -4640,84 +4518,70 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Market_Dca_ClassStack - * @property {BtcCentsSatsUsdPattern} _2015 - * @property {BtcCentsSatsUsdPattern} _2016 - * @property {BtcCentsSatsUsdPattern} _2017 - * @property {BtcCentsSatsUsdPattern} _2018 - * @property {BtcCentsSatsUsdPattern} _2019 - * @property {BtcCentsSatsUsdPattern} _2020 - * @property {BtcCentsSatsUsdPattern} _2021 - * @property {BtcCentsSatsUsdPattern} _2022 - * @property {BtcCentsSatsUsdPattern} _2023 - * @property {BtcCentsSatsUsdPattern} _2024 - * @property {BtcCentsSatsUsdPattern} _2025 - * @property {BtcCentsSatsUsdPattern} _2026 + * @property {BtcCentsSatsUsdPattern} from2015 + * @property {BtcCentsSatsUsdPattern} from2016 + * @property {BtcCentsSatsUsdPattern} from2017 + * @property {BtcCentsSatsUsdPattern} from2018 + * @property {BtcCentsSatsUsdPattern} from2019 + * @property {BtcCentsSatsUsdPattern} from2020 + * @property {BtcCentsSatsUsdPattern} from2021 + * @property {BtcCentsSatsUsdPattern} from2022 + * @property {BtcCentsSatsUsdPattern} from2023 + * @property {BtcCentsSatsUsdPattern} from2024 + * @property {BtcCentsSatsUsdPattern} from2025 + * @property {BtcCentsSatsUsdPattern} from2026 */ /** - * @typedef {Object} MetricsTree_Market_Dca_ClassAveragePrice - * @property {CentsSatsUsdPattern} _2015 - * @property {CentsSatsUsdPattern} _2016 - * @property {CentsSatsUsdPattern} _2017 - * @property {CentsSatsUsdPattern} _2018 - * @property {CentsSatsUsdPattern} _2019 - * @property {CentsSatsUsdPattern} _2020 - * @property {CentsSatsUsdPattern} _2021 - * @property {CentsSatsUsdPattern} _2022 - * @property {CentsSatsUsdPattern} _2023 - * @property {CentsSatsUsdPattern} _2024 - * @property {CentsSatsUsdPattern} _2025 - * @property {CentsSatsUsdPattern} _2026 + * @typedef {Object} MetricsTree_Market_Dca_ClassCostBasis + * @property {CentsSatsUsdPattern} from2015 + * @property {CentsSatsUsdPattern} from2016 + * @property {CentsSatsUsdPattern} from2017 + * @property {CentsSatsUsdPattern} from2018 + * @property {CentsSatsUsdPattern} from2019 + * @property {CentsSatsUsdPattern} from2020 + * @property {CentsSatsUsdPattern} from2021 + * @property {CentsSatsUsdPattern} from2022 + * @property {CentsSatsUsdPattern} from2023 + * @property {CentsSatsUsdPattern} from2024 + * @property {CentsSatsUsdPattern} from2025 + * @property {CentsSatsUsdPattern} from2026 */ /** - * @typedef {Object} MetricsTree_Market_Dca_ClassReturns - * @property {MetricPattern1} _2015 - * @property {MetricPattern1} _2016 - * @property {MetricPattern1} _2017 - * @property {MetricPattern1} _2018 - * @property {MetricPattern1} _2019 - * @property {MetricPattern1} _2020 - * @property {MetricPattern1} _2021 - * @property {MetricPattern1} _2022 - * @property {MetricPattern1} _2023 - * @property {MetricPattern1} _2024 - * @property {MetricPattern1} _2025 - * @property {MetricPattern1} _2026 + * @typedef {Object} MetricsTree_Market_Dca_ClassReturn + * @property {BpsPercentRatioPattern} from2015 + * @property {BpsPercentRatioPattern} from2016 + * @property {BpsPercentRatioPattern} from2017 + * @property {BpsPercentRatioPattern} from2018 + * @property {BpsPercentRatioPattern} from2019 + * @property {BpsPercentRatioPattern} from2020 + * @property {BpsPercentRatioPattern} from2021 + * @property {BpsPercentRatioPattern} from2022 + * @property {BpsPercentRatioPattern} from2023 + * @property {BpsPercentRatioPattern} from2024 + * @property {BpsPercentRatioPattern} from2025 + * @property {BpsPercentRatioPattern} from2026 */ /** * @typedef {Object} MetricsTree_Market_Indicators - * @property {MetricPattern1} puellMultiple - * @property {MetricPattern1} nvt + * @property {BpsRatioPattern} puellMultiple + * @property {BpsRatioPattern} nvt * @property {MetricsTree_Market_Indicators_Rsi} rsi - * @property {MetricPattern1} stochK - * @property {MetricPattern1} stochD - * @property {MetricPattern1} piCycle + * @property {BpsPercentRatioPattern} stochK + * @property {BpsPercentRatioPattern} stochD + * @property {BpsRatioPattern} piCycle * @property {MetricsTree_Market_Indicators_Macd} macd - * @property {MetricPattern1} gini + * @property {BpsPercentRatioPattern} gini */ /** * @typedef {Object} MetricsTree_Market_Indicators_Rsi - * @property {MetricsTree_Market_Indicators_Rsi_1d} _1d + * @property {AverageGainsLossesRsiStochPattern} _24h * @property {MetricsTree_Market_Indicators_Rsi_1w} _1w * @property {MetricsTree_Market_Indicators_Rsi_1m} _1m - * @property {AverageGainsLossesRsiStochPattern} _1y - */ - -/** - * @typedef {Object} MetricsTree_Market_Indicators_Rsi_1d - * @property {MetricPattern1} gains - * @property {MetricPattern1} losses - * @property {MetricPattern1} averageGain - * @property {MetricPattern1} averageLoss - * @property {MetricPattern1} rsi - * @property {MetricPattern1} rsiMin - * @property {MetricPattern1} rsiMax - * @property {MetricPattern1} stochRsi - * @property {MetricPattern1} stochRsiK - * @property {MetricPattern1} stochRsiD + * @property {MetricsTree_Market_Indicators_Rsi_1y} _1y */ /** @@ -4726,12 +4590,12 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern1} losses * @property {MetricPattern1} averageGain * @property {MetricPattern1} averageLoss - * @property {MetricPattern1} rsi - * @property {MetricPattern1} rsiMin - * @property {MetricPattern1} rsiMax - * @property {MetricPattern1} stochRsi - * @property {MetricPattern1} stochRsiK - * @property {MetricPattern1} stochRsiD + * @property {BpsPercentRatioPattern} rsi + * @property {BpsPercentRatioPattern} rsiMin + * @property {BpsPercentRatioPattern} rsiMax + * @property {BpsPercentRatioPattern} stochRsi + * @property {BpsPercentRatioPattern} stochRsiK + * @property {BpsPercentRatioPattern} stochRsiD */ /** @@ -4740,29 +4604,34 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern1} losses * @property {MetricPattern1} averageGain * @property {MetricPattern1} averageLoss - * @property {MetricPattern1} rsi - * @property {MetricPattern1} rsiMin - * @property {MetricPattern1} rsiMax - * @property {MetricPattern1} stochRsi - * @property {MetricPattern1} stochRsiK - * @property {MetricPattern1} stochRsiD + * @property {BpsPercentRatioPattern} rsi + * @property {BpsPercentRatioPattern} rsiMin + * @property {BpsPercentRatioPattern} rsiMax + * @property {BpsPercentRatioPattern} stochRsi + * @property {BpsPercentRatioPattern} stochRsiK + * @property {BpsPercentRatioPattern} stochRsiD + */ + +/** + * @typedef {Object} MetricsTree_Market_Indicators_Rsi_1y + * @property {MetricPattern1} gains + * @property {MetricPattern1} losses + * @property {MetricPattern1} averageGain + * @property {MetricPattern1} averageLoss + * @property {BpsPercentRatioPattern} rsi + * @property {BpsPercentRatioPattern} rsiMin + * @property {BpsPercentRatioPattern} rsiMax + * @property {BpsPercentRatioPattern} stochRsi + * @property {BpsPercentRatioPattern} stochRsiK + * @property {BpsPercentRatioPattern} stochRsiD */ /** * @typedef {Object} MetricsTree_Market_Indicators_Macd - * @property {MetricsTree_Market_Indicators_Macd_1d} _1d + * @property {EmaHistogramLineSignalPattern} _24h * @property {MetricsTree_Market_Indicators_Macd_1w} _1w * @property {MetricsTree_Market_Indicators_Macd_1m} _1m - * @property {EmaHistogramLineSignalPattern} _1y - */ - -/** - * @typedef {Object} MetricsTree_Market_Indicators_Macd_1d - * @property {MetricPattern1} emaFast - * @property {MetricPattern1} emaSlow - * @property {MetricPattern1} line - * @property {MetricPattern1} signal - * @property {MetricPattern1} histogram + * @property {MetricsTree_Market_Indicators_Macd_1y} _1y */ /** @@ -4783,6 +4652,15 @@ function createRatioPattern2(client, acc) { * @property {MetricPattern1} histogram */ +/** + * @typedef {Object} MetricsTree_Market_Indicators_Macd_1y + * @property {MetricPattern1} emaFast + * @property {MetricPattern1} emaSlow + * @property {MetricPattern1} line + * @property {MetricPattern1} signal + * @property {MetricPattern1} histogram + */ + /** * @typedef {Object} MetricsTree_Pools * @property {MetricPattern18} heightToPool @@ -4791,168 +4669,168 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Pools_Vecs - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} unknown - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} blockfills - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} ultimuspool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} terrapool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} luxor - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} onethash - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btccom - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitfarms - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} huobipool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} wayicn - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} canoepool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btctop - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitcoincom - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} pool175btc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} gbminers - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} axbt - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} asicminer - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitminter - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitcoinrussia - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btcserv - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} simplecoinus - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btcguild - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} eligius - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} ozcoin - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} eclipsemc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} maxbtc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} triplemining - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} coinlab - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} pool50btc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} ghashio - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} stminingcorp - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitparking - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} mmpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} polmine - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} kncminer - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitalo - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} f2pool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} hhtt - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} megabigpower - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} mtred - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} nmcbit - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} yourbtcnet - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} givemecoins - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} braiinspool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} antpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} multicoinco - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bcpoolio - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} cointerra - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} kanopool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} solock - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} ckpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} nicehash - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitclub - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitcoinaffiliatenetwork - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btcc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bwpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} exxbw - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitsolo - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitfury - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} twentyoneinc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} digitalbtc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} eightbaochi - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} mybtccoinpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} tbdice - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} hashpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} nexious - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bravomining - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} hotpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} okexpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bcmonster - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} onehash - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bixin - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} tatmaspool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} viabtc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} connectbtc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} batpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} waterhole - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} dcexploration - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} dcex - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} fiftyeightcoin - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitcoinindia - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} shawnp0wers - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} phashio - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} rigpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} haozhuzhu - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} sevenpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} miningkings - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} hashbx - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} dpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} rawpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} haominer - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} helix - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitcoinukraine - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} poolin - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} secretsuperstar - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} tigerpoolnet - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} sigmapoolcom - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} okpooltop - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} hummerpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} tangpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bytepool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} spiderpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} novablock - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} miningcity - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} binancepool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} minerium - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} lubiancom - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} okkong - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} aaopool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} emcdpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} foundryusa - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} sbicrypto - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} arkpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} purebtccom - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} marapool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} kucoinpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} entrustcharitypool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} okminer - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} titan - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} pegapool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btcnuggets - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} cloudhashing - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} digitalxmintsy - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} telco214 - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btcpoolparty - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} multipool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} transactioncoinmining - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btcdig - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} trickysbtcpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btcmp - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} eobot - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} unomp - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} patels - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} gogreenlight - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitcoinindiapool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} ekanembtc - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} canoe - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} tiger - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} onem1x - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} zulupool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} secpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} ocean - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} whitepool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} wiz - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} wk057 - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} futurebitapollosolo - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} carbonnegative - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} portlandhodl - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} phoenix - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} neopool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} maxipool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} bitfufupool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} gdpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} miningdutch - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} publicpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} miningsquared - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} innopolistech - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} btclab - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} parasite - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} redrockpool - * @property {BlocksCoinbaseDaysDominanceFeeSubsidyPattern} est3lar + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} unknown + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} blockfills + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} ultimuspool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} terrapool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} luxor + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} onethash + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btccom + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitfarms + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} huobipool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} wayicn + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} canoepool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btctop + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitcoincom + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} pool175btc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} gbminers + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} axbt + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} asicminer + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitminter + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitcoinrussia + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btcserv + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} simplecoinus + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btcguild + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} eligius + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} ozcoin + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} eclipsemc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} maxbtc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} triplemining + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} coinlab + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} pool50btc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} ghashio + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} stminingcorp + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitparking + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} mmpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} polmine + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} kncminer + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitalo + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} f2pool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} hhtt + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} megabigpower + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} mtred + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} nmcbit + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} yourbtcnet + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} givemecoins + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} braiinspool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} antpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} multicoinco + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bcpoolio + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} cointerra + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} kanopool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} solock + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} ckpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} nicehash + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitclub + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitcoinaffiliatenetwork + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btcc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bwpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} exxbw + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitsolo + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitfury + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} twentyoneinc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} digitalbtc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} eightbaochi + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} mybtccoinpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} tbdice + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} hashpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} nexious + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bravomining + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} hotpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} okexpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bcmonster + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} onehash + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bixin + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} tatmaspool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} viabtc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} connectbtc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} batpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} waterhole + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} dcexploration + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} dcex + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} fiftyeightcoin + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitcoinindia + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} shawnp0wers + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} phashio + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} rigpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} haozhuzhu + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} sevenpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} miningkings + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} hashbx + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} dpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} rawpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} haominer + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} helix + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitcoinukraine + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} poolin + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} secretsuperstar + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} tigerpoolnet + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} sigmapoolcom + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} okpooltop + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} hummerpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} tangpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bytepool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} spiderpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} novablock + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} miningcity + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} binancepool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} minerium + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} lubiancom + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} okkong + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} aaopool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} emcdpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} foundryusa + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} sbicrypto + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} arkpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} purebtccom + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} marapool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} kucoinpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} entrustcharitypool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} okminer + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} titan + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} pegapool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btcnuggets + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} cloudhashing + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} digitalxmintsy + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} telco214 + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btcpoolparty + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} multipool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} transactioncoinmining + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btcdig + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} trickysbtcpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btcmp + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} eobot + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} unomp + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} patels + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} gogreenlight + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitcoinindiapool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} ekanembtc + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} canoe + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} tiger + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} onem1x + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} zulupool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} secpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} ocean + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} whitepool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} wiz + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} wk057 + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} futurebitapollosolo + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} carbonnegative + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} portlandhodl + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} phoenix + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} neopool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} maxipool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} bitfufupool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} gdpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} miningdutch + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} publicpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} miningsquared + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} innopolistech + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} btclab + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} parasite + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} redrockpool + * @property {BlocksCoinbaseDominanceFeeSubsidyPattern} est3lar */ /** @@ -5044,40 +4922,40 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_All - * @property {_30dHalvedTotalPattern} supply + * @property {ChangeHalvedTotalPattern} supply * @property {UtxoPattern} outputs * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity - * @property {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized + * @property {AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} realized * @property {InvestedMaxMinPercentilesSpotPattern} costBasis - * @property {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} unrealized + * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized * @property {MetricsTree_Distribution_UtxoCohorts_All_Relative} relative */ /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_All_Relative - * @property {MetricPattern1} supplyInProfitRelToOwnSupply - * @property {MetricPattern1} supplyInLossRelToOwnSupply - * @property {MetricPattern1} unrealizedProfitRelToMarketCap - * @property {MetricPattern1} unrealizedLossRelToMarketCap - * @property {MetricPattern1} negUnrealizedLossRelToMarketCap - * @property {MetricPattern1} netUnrealizedPnlRelToMarketCap + * @property {BpsPercentRatioPattern} supplyInProfitRelToOwnSupply + * @property {BpsPercentRatioPattern} supplyInLossRelToOwnSupply + * @property {BpsPercentRatioPattern} unrealizedProfitRelToMarketCap + * @property {BpsPercentRatioPattern} unrealizedLossRelToMarketCap + * @property {BpsPercentRatioPattern} negUnrealizedLossRelToMarketCap + * @property {BpsPercentRatioPattern} netUnrealizedPnlRelToMarketCap * @property {MetricPattern1} nupl - * @property {MetricPattern1} investedCapitalInProfitPct - * @property {MetricPattern1} investedCapitalInLossPct - * @property {MetricPattern1} unrealizedProfitRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} unrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} negUnrealizedLossRelToOwnTotalUnrealizedPnl - * @property {MetricPattern1} netUnrealizedPnlRelToOwnTotalUnrealizedPnl + * @property {BpsPercentRatioPattern} investedCapitalInProfitRelToRealizedCap + * @property {BpsPercentRatioPattern} investedCapitalInLossRelToRealizedCap + * @property {BpsPercentRatioPattern} unrealizedProfitRelToOwnGrossPnl + * @property {BpsPercentRatioPattern} unrealizedLossRelToOwnGrossPnl + * @property {BpsPercentRatioPattern} negUnrealizedLossRelToOwnGrossPnl + * @property {BpsPercentRatioPattern} netUnrealizedPnlRelToOwnGrossPnl */ /** * @typedef {Object} MetricsTree_Distribution_UtxoCohorts_Sth - * @property {_30dHalvedTotalPattern} supply + * @property {ChangeHalvedTotalPattern} supply * @property {UtxoPattern} outputs * @property {CoinblocksCoindaysSatblocksSatdaysSentPattern} activity - * @property {AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern} realized + * @property {AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern} realized * @property {InvestedMaxMinPercentilesSpotPattern} costBasis - * @property {GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern} unrealized + * @property {GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern} unrealized * @property {InvestedNegNetNuplSupplyUnrealizedPattern2} relative */ @@ -5350,27 +5228,27 @@ function createRatioPattern2(client, acc) { /** * @typedef {Object} MetricsTree_Distribution_GrowthRate - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} all - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2pk65 - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2pk33 - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2pkh - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2sh - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2wpkh - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2wsh - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2tr - * @property {AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern} p2a + * @property {BpsPercentRatioPattern2} all + * @property {BpsPercentRatioPattern2} p2pk65 + * @property {BpsPercentRatioPattern2} p2pk33 + * @property {BpsPercentRatioPattern2} p2pkh + * @property {BpsPercentRatioPattern2} p2sh + * @property {BpsPercentRatioPattern2} p2wpkh + * @property {BpsPercentRatioPattern2} p2wsh + * @property {BpsPercentRatioPattern2} p2tr + * @property {BpsPercentRatioPattern2} p2a */ /** * @typedef {Object} MetricsTree_Supply * @property {BtcCentsSatsUsdPattern} circulating * @property {MetricsTree_Supply_Burned} burned - * @property {MetricPattern1} inflation + * @property {BpsPercentRatioPattern} inflationRate * @property {MetricsTree_Supply_Velocity} velocity * @property {MetricPattern1} marketCap - * @property {MetricPattern1} marketCapGrowthRate - * @property {MetricPattern1} realizedCapGrowthRate - * @property {MetricPattern1} capGrowthRateDiff + * @property {BpsPercentRatioPattern} marketCapGrowthRate + * @property {BpsPercentRatioPattern} realizedCapGrowthRate + * @property {MetricPattern1} marketMinusRealizedCapGrowthRate */ /** @@ -6336,7 +6214,7 @@ class BrkClient extends BrkClientBase { difficulty: { raw: createMetricPattern1(this, 'difficulty'), asHash: createMetricPattern1(this, 'difficulty_as_hash'), - adjustment: createMetricPattern1(this, 'difficulty_adjustment'), + adjustment: createBpsPercentRatioPattern(this, 'difficulty_adjustment'), epoch: createMetricPattern1(this, 'difficulty_epoch'), blocksBeforeNextAdjustment: createMetricPattern1(this, 'blocks_before_next_difficulty_adjustment'), daysBeforeNextAdjustment: createMetricPattern1(this, 'days_before_next_difficulty_adjustment'), @@ -6350,20 +6228,20 @@ class BrkClient extends BrkClientBase { weight: { base: createMetricPattern18(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'), - pct10: create_1y24h30d7dPattern(this, 'block_weight_p10'), - pct25: create_1y24h30d7dPattern(this, 'block_weight_p25'), - median: create_1y24h30d7dPattern(this, 'block_weight_median'), - pct75: create_1y24h30d7dPattern(this, 'block_weight_p75'), - pct90: create_1y24h30d7dPattern(this, 'block_weight_p90'), + sum: create_1m1w1y24hPattern(this, 'block_weight_sum'), + average: create_1m1w1y24hPattern(this, 'block_weight_average'), + min: create_1m1w1y24hPattern(this, 'block_weight_min'), + max: create_1m1w1y24hPattern(this, 'block_weight_max'), + pct10: create_1m1w1y24hPattern(this, 'block_weight_p10'), + pct25: create_1m1w1y24hPattern(this, 'block_weight_p25'), + median: create_1m1w1y24hPattern(this, 'block_weight_median'), + pct75: create_1m1w1y24hPattern(this, 'block_weight_p75'), + pct90: create_1m1w1y24hPattern(this, 'block_weight_p90'), }, count: { blockCountTarget: createMetricPattern1(this, 'block_count_target'), blockCount: createCumulativeHeightSumPattern(this, 'block_count'), - blockCountSum: create_1y24h30d7dPattern(this, 'block_count_sum'), + blockCountSum: create_1m1w1y24hPattern(this, 'block_count_sum'), height1hAgo: createMetricPattern18(this, 'height_1h_ago'), height24hAgo: createMetricPattern18(this, 'height_24h_ago'), height3dAgo: createMetricPattern18(this, 'height_3d_ago'), @@ -6417,17 +6295,17 @@ class BrkClient extends BrkClientBase { vbytes: createAverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'block_vbytes'), size: { cumulative: createMetricPattern1(this, 'block_size_cumulative'), - sum: create_1y24h30d7dPattern(this, 'block_size_sum'), - average: create_1y24h30d7dPattern(this, 'block_size_average'), - min: create_1y24h30d7dPattern(this, 'block_size_min'), - max: create_1y24h30d7dPattern(this, 'block_size_max'), - pct10: create_1y24h30d7dPattern(this, 'block_size_p10'), - pct25: create_1y24h30d7dPattern(this, 'block_size_p25'), - median: create_1y24h30d7dPattern(this, 'block_size_median'), - pct75: create_1y24h30d7dPattern(this, 'block_size_p75'), - pct90: create_1y24h30d7dPattern(this, 'block_size_p90'), + sum: create_1m1w1y24hPattern(this, 'block_size_sum'), + average: create_1m1w1y24hPattern(this, 'block_size_average'), + min: create_1m1w1y24hPattern(this, 'block_size_min'), + max: create_1m1w1y24hPattern(this, 'block_size_max'), + pct10: create_1m1w1y24hPattern(this, 'block_size_p10'), + pct25: create_1m1w1y24hPattern(this, 'block_size_p25'), + median: create_1m1w1y24hPattern(this, 'block_size_median'), + pct75: create_1m1w1y24hPattern(this, 'block_size_p75'), + pct90: create_1m1w1y24hPattern(this, 'block_size_p90'), }, - fullness: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'block_fullness'), + fullness: createBpsPercentRatioPattern2(this, 'block_fullness'), }, transactions: { firstTxindex: createMetricPattern18(this, 'first_txindex'), @@ -6460,8 +6338,8 @@ class BrkClient extends BrkClientBase { v3: createCumulativeHeightSumPattern(this, 'tx_v3'), }, volume: { - sentSum: create_1y24h30d7dBtcCentsSatsUsdPattern(this, 'sent_sum'), - receivedSum: create_1y24h30d7dBtcCentsSatsUsdPattern(this, 'received_sum'), + sentSum: create_1m1w1y24hBtcCentsSatsUsdPattern(this, 'sent_sum'), + receivedSum: create_1m1w1y24hBtcCentsSatsUsdPattern(this, 'received_sum'), annualizedVolume: createBtcCentsSatsUsdPattern(this, 'annualized_volume'), txPerSec: createMetricPattern1(this, 'tx_per_sec'), outputsPerSec: createMetricPattern1(this, 'outputs_per_sec'), @@ -6537,49 +6415,43 @@ class BrkClient extends BrkClientBase { segwit: createCumulativeHeightSumPattern(this, 'segwit_count'), }, value: { - opreturn: create_1y24h30d7dBaseCumulativePattern(this, 'opreturn_value'), + opreturn: create_1m1w1y24hBaseCumulativePattern(this, 'opreturn_value'), }, adoption: { - taproot: createMetricPattern1(this, 'taproot_adoption'), - segwit: createMetricPattern1(this, 'segwit_adoption'), + taproot: createBpsPercentRatioPattern(this, 'taproot_adoption'), + segwit: createBpsPercentRatioPattern(this, 'segwit_adoption'), }, }, mining: { rewards: { - coinbase: create_1y24h30d7dBaseCumulativePattern(this, 'coinbase'), - subsidy: create_1y24h30d7dBaseCumulativePattern(this, 'subsidy'), - fees: create_1y24h30d7dBaseCumulativePattern(this, 'fees'), + coinbase: create_1m1w1y24hBaseCumulativePattern(this, 'coinbase'), + subsidy: create_1m1w1y24hBaseCumulativePattern(this, 'subsidy'), + fees: create_1m1w1y24hBaseCumulativePattern(this, 'fees'), unclaimedRewards: createBaseCumulativeSumPattern(this, 'unclaimed_rewards'), - feeDominance: createMetricPattern1(this, 'fee_dominance'), - feeDominance24h: createMetricPattern1(this, 'fee_dominance_24h'), - feeDominance7d: createMetricPattern1(this, 'fee_dominance_7d'), - feeDominance30d: createMetricPattern1(this, 'fee_dominance_30d'), - feeDominance1y: createMetricPattern1(this, 'fee_dominance_1y'), - subsidyDominance: createMetricPattern1(this, 'subsidy_dominance'), - subsidyDominance24h: createMetricPattern1(this, 'subsidy_dominance_24h'), - subsidyDominance7d: createMetricPattern1(this, 'subsidy_dominance_7d'), - subsidyDominance30d: createMetricPattern1(this, 'subsidy_dominance_30d'), - subsidyDominance1y: createMetricPattern1(this, 'subsidy_dominance_1y'), - subsidyUsd1ySma: createCentsUsdPattern(this, 'subsidy_usd_1y_sma'), + feeDominance: createBpsPercentRatioPattern(this, 'fee_dominance'), + feeDominanceRolling: create_1m1w1y24hPattern2(this, 'fee_dominance'), + subsidyDominance: createBpsPercentRatioPattern(this, 'subsidy_dominance'), + subsidyDominanceRolling: create_1m1w1y24hPattern2(this, 'subsidy_dominance'), + subsidySma1y: createCentsUsdPattern(this, 'subsidy_sma_1y'), }, hashrate: { hashRate: createMetricPattern1(this, 'hash_rate'), - hashRate1wSma: createMetricPattern1(this, 'hash_rate_1w_sma'), - hashRate1mSma: createMetricPattern1(this, 'hash_rate_1m_sma'), - hashRate2mSma: createMetricPattern1(this, 'hash_rate_2m_sma'), - hashRate1ySma: createMetricPattern1(this, 'hash_rate_1y_sma'), + hashRateSma1w: createMetricPattern1(this, 'hash_rate_sma_1w'), + hashRateSma1m: createMetricPattern1(this, 'hash_rate_sma_1m'), + hashRateSma2m: createMetricPattern1(this, 'hash_rate_sma_2m'), + hashRateSma1y: createMetricPattern1(this, 'hash_rate_sma_1y'), hashRateAth: createMetricPattern1(this, 'hash_rate_ath'), - hashRateDrawdown: createMetricPattern1(this, 'hash_rate_drawdown'), + hashRateDrawdown: createBpsPercentRatioPattern(this, 'hash_rate_drawdown'), hashPriceThs: createMetricPattern1(this, 'hash_price_ths'), hashPriceThsMin: createMetricPattern1(this, 'hash_price_ths_min'), hashPricePhs: createMetricPattern1(this, 'hash_price_phs'), hashPricePhsMin: createMetricPattern1(this, 'hash_price_phs_min'), - hashPriceRebound: createMetricPattern1(this, 'hash_price_rebound'), + hashPriceRebound: createBpsPercentRatioPattern(this, 'hash_price_rebound'), hashValueThs: createMetricPattern1(this, 'hash_value_ths'), hashValueThsMin: createMetricPattern1(this, 'hash_value_ths_min'), hashValuePhs: createMetricPattern1(this, 'hash_value_phs'), hashValuePhsMin: createMetricPattern1(this, 'hash_value_phs_min'), - hashValueRebound: createMetricPattern1(this, 'hash_value_rebound'), + hashValueRebound: createBpsPercentRatioPattern(this, 'hash_value_rebound'), }, }, positions: { @@ -6613,21 +6485,21 @@ class BrkClient extends BrkClientBase { }, pricing: { vaultedPrice: createCentsSatsUsdPattern(this, 'vaulted_price'), - vaultedPriceRatio: createRatioPattern(this, 'vaulted_price_ratio'), + vaultedPriceRatio: createBpsRatioPattern2(this, 'vaulted_price_ratio'), activePrice: createCentsSatsUsdPattern(this, 'active_price'), - activePriceRatio: createRatioPattern(this, 'active_price_ratio'), + activePriceRatio: createBpsRatioPattern2(this, 'active_price_ratio'), trueMarketMean: createCentsSatsUsdPattern(this, 'true_market_mean'), - trueMarketMeanRatio: createRatioPattern(this, 'true_market_mean_ratio'), + trueMarketMeanRatio: createBpsRatioPattern2(this, 'true_market_mean_ratio'), cointimePrice: createCentsSatsUsdPattern(this, 'cointime_price'), - cointimePriceRatio: createRatioPattern(this, 'cointime_price_ratio'), + cointimePriceRatio: createBpsRatioPattern2(this, 'cointime_price_ratio'), }, adjusted: { - cointimeAdjInflationRate: createMetricPattern1(this, 'cointime_adj_inflation_rate'), - cointimeAdjTxBtcVelocity: createMetricPattern1(this, 'cointime_adj_tx_btc_velocity'), - cointimeAdjTxUsdVelocity: createMetricPattern1(this, 'cointime_adj_tx_usd_velocity'), + cointimeAdjInflationRate: createBpsPercentRatioPattern(this, 'cointime_adj_inflation_rate'), + cointimeAdjTxVelocityBtc: createMetricPattern1(this, 'cointime_adj_tx_velocity_btc'), + cointimeAdjTxVelocityUsd: createMetricPattern1(this, 'cointime_adj_tx_velocity_usd'), }, reserveRisk: { - vocdd365dMedian: createMetricPattern18(this, 'vocdd_365d_median'), + vocddMedian1y: createMetricPattern18(this, 'vocdd_median_1y'), hodlBank: createMetricPattern18(this, 'hodl_bank'), reserveRisk: createMetricPattern1(this, 'reserve_risk'), }, @@ -6794,230 +6666,236 @@ class BrkClient extends BrkClientBase { market: { ath: { priceAth: createCentsSatsUsdPattern(this, 'price_ath'), - priceDrawdown: createMetricPattern1(this, 'price_drawdown'), + priceDrawdown: createBpsPercentRatioPattern(this, 'price_drawdown'), daysSincePriceAth: createMetricPattern1(this, 'days_since_price_ath'), yearsSincePriceAth: createMetricPattern2(this, 'years_since_price_ath'), - maxDaysBetweenPriceAths: createMetricPattern1(this, 'max_days_between_price_aths'), - maxYearsBetweenPriceAths: createMetricPattern2(this, 'max_years_between_price_aths'), + maxDaysBetweenPriceAth: createMetricPattern1(this, 'max_days_between_price_ath'), + maxYearsBetweenPriceAth: createMetricPattern2(this, 'max_years_between_price_ath'), }, lookback: { - _24h: createCentsSatsUsdPattern(this, 'price_24h_ago'), - _1w: createCentsSatsUsdPattern(this, 'price_1w_ago'), - _1m: createCentsSatsUsdPattern(this, 'price_1m_ago'), - _3m: createCentsSatsUsdPattern(this, 'price_3m_ago'), - _6m: createCentsSatsUsdPattern(this, 'price_6m_ago'), - _1y: createCentsSatsUsdPattern(this, 'price_1y_ago'), - _2y: createCentsSatsUsdPattern(this, 'price_2y_ago'), - _3y: createCentsSatsUsdPattern(this, 'price_3y_ago'), - _4y: createCentsSatsUsdPattern(this, 'price_4y_ago'), - _5y: createCentsSatsUsdPattern(this, 'price_5y_ago'), - _6y: createCentsSatsUsdPattern(this, 'price_6y_ago'), - _8y: createCentsSatsUsdPattern(this, 'price_8y_ago'), - _10y: createCentsSatsUsdPattern(this, 'price_10y_ago'), + _24h: createCentsSatsUsdPattern(this, 'price_lookback_24h'), + _1w: createCentsSatsUsdPattern(this, 'price_lookback_1w'), + _1m: createCentsSatsUsdPattern(this, 'price_lookback_1m'), + _3m: createCentsSatsUsdPattern(this, 'price_lookback_3m'), + _6m: createCentsSatsUsdPattern(this, 'price_lookback_6m'), + _1y: createCentsSatsUsdPattern(this, 'price_lookback_1y'), + _2y: createCentsSatsUsdPattern(this, 'price_lookback_2y'), + _3y: createCentsSatsUsdPattern(this, 'price_lookback_3y'), + _4y: createCentsSatsUsdPattern(this, 'price_lookback_4y'), + _5y: createCentsSatsUsdPattern(this, 'price_lookback_5y'), + _6y: createCentsSatsUsdPattern(this, 'price_lookback_6y'), + _8y: createCentsSatsUsdPattern(this, 'price_lookback_8y'), + _10y: createCentsSatsUsdPattern(this, 'price_lookback_10y'), }, returns: { - priceReturns: { - _24h: createMetricPattern1(this, '24h_price_returns'), - _1w: createMetricPattern1(this, '1w_price_returns'), - _1m: createMetricPattern1(this, '1m_price_returns'), - _3m: createMetricPattern1(this, '3m_price_returns'), - _6m: createMetricPattern1(this, '6m_price_returns'), - _1y: createMetricPattern1(this, '1y_price_returns'), - _2y: createMetricPattern1(this, '2y_price_returns'), - _3y: createMetricPattern1(this, '3y_price_returns'), - _4y: createMetricPattern1(this, '4y_price_returns'), - _5y: createMetricPattern1(this, '5y_price_returns'), - _6y: createMetricPattern1(this, '6y_price_returns'), - _8y: createMetricPattern1(this, '8y_price_returns'), - _10y: createMetricPattern1(this, '10y_price_returns'), + priceReturn: { + _24h: createBpsPercentRatioPattern(this, 'price_return_24h'), + _1w: createBpsPercentRatioPattern(this, 'price_return_1w'), + _1m: createBpsPercentRatioPattern(this, 'price_return_1m'), + _3m: createBpsPercentRatioPattern(this, 'price_return_3m'), + _6m: createBpsPercentRatioPattern(this, 'price_return_6m'), + _1y: createBpsPercentRatioPattern(this, 'price_return_1y'), + _2y: createBpsPercentRatioPattern(this, 'price_return_2y'), + _3y: createBpsPercentRatioPattern(this, 'price_return_3y'), + _4y: createBpsPercentRatioPattern(this, 'price_return_4y'), + _5y: createBpsPercentRatioPattern(this, 'price_return_5y'), + _6y: createBpsPercentRatioPattern(this, 'price_return_6y'), + _8y: createBpsPercentRatioPattern(this, 'price_return_8y'), + _10y: createBpsPercentRatioPattern(this, 'price_return_10y'), }, - cagr: create_10y2y3y4y5y6y8yPattern(this, 'cagr'), - _1dReturns1wSd: createSdSmaPattern(this, '1d_returns_1w_sd'), - _1dReturns1mSd: createSdSmaPattern(this, '1d_returns_1m_sd'), - _1dReturns1ySd: createSdSmaPattern(this, '1d_returns_1y_sd'), - downsideReturns: createMetricPattern18(this, 'downside_returns'), - downside1wSd: createSdSmaPattern(this, 'downside_1w_sd'), - downside1mSd: createSdSmaPattern(this, 'downside_1m_sd'), - downside1ySd: createSdSmaPattern(this, 'downside_1y_sd'), + priceCagr: create_10y2y3y4y5y6y8yPattern(this, 'price_cagr'), + priceReturn24hSd1w: { + sma: createMetricPattern1(this, 'price_return_24h_sma_1w'), + sd: createMetricPattern1(this, 'price_return_24h_sd_1w'), + }, + priceReturn24hSd1m: { + sma: createMetricPattern1(this, 'price_return_24h_sma_1m'), + sd: createMetricPattern1(this, 'price_return_24h_sd_1m'), + }, + priceReturn24hSd1y: createSdSmaPattern(this, 'price_return_24h'), + priceDownside24h: createMetricPattern18(this, 'price_downside_24h'), + priceDownside24hSd1w: { + sma: createMetricPattern1(this, 'price_downside_24h_sma_1w'), + sd: createMetricPattern1(this, 'price_downside_24h_sd_1w'), + }, + priceDownside24hSd1m: { + sma: createMetricPattern1(this, 'price_downside_24h_sma_1m'), + sd: createMetricPattern1(this, 'price_downside_24h_sd_1m'), + }, + priceDownside24hSd1y: createSdSmaPattern(this, 'price_downside_24h'), }, volatility: { - price1wVolatility: createMetricPattern1(this, 'price_1w_volatility'), - price1mVolatility: createMetricPattern1(this, 'price_1m_volatility'), - price1yVolatility: createMetricPattern1(this, 'price_1y_volatility'), - 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'), + priceVolatility1w: createMetricPattern1(this, 'price_volatility_1w'), + priceVolatility1m: createMetricPattern1(this, 'price_volatility_1m'), + priceVolatility1y: createMetricPattern1(this, 'price_volatility_1y'), + priceSharpe1w: createMetricPattern1(this, 'price_sharpe_1w'), + priceSharpe1m: createMetricPattern1(this, 'price_sharpe_1m'), + priceSharpe1y: createMetricPattern1(this, 'price_sharpe_1y'), + priceSortino1w: createMetricPattern1(this, 'price_sortino_1w'), + priceSortino1m: createMetricPattern1(this, 'price_sortino_1m'), + priceSortino1y: createMetricPattern1(this, 'price_sortino_1y'), }, range: { - price1wMin: createCentsSatsUsdPattern(this, 'price_1w_min'), - price1wMax: createCentsSatsUsdPattern(this, 'price_1w_max'), - price2wMin: createCentsSatsUsdPattern(this, 'price_2w_min'), - price2wMax: createCentsSatsUsdPattern(this, 'price_2w_max'), - price1mMin: createCentsSatsUsdPattern(this, 'price_1m_min'), - price1mMax: createCentsSatsUsdPattern(this, 'price_1m_max'), - price1yMin: createCentsSatsUsdPattern(this, 'price_1y_min'), - price1yMax: createCentsSatsUsdPattern(this, 'price_1y_max'), + priceMin1w: createCentsSatsUsdPattern(this, 'price_min_1w'), + priceMax1w: createCentsSatsUsdPattern(this, 'price_max_1w'), + priceMin2w: createCentsSatsUsdPattern(this, 'price_min_2w'), + priceMax2w: createCentsSatsUsdPattern(this, 'price_max_2w'), + priceMin1m: createCentsSatsUsdPattern(this, 'price_min_1m'), + priceMax1m: createCentsSatsUsdPattern(this, 'price_max_1m'), + priceMin1y: createCentsSatsUsdPattern(this, 'price_min_1y'), + priceMax1y: createCentsSatsUsdPattern(this, 'price_max_1y'), priceTrueRange: createMetricPattern1(this, 'price_true_range'), - priceTrueRange2wSum: createMetricPattern1(this, 'price_true_range_2w_sum'), - price2wChoppinessIndex: createMetricPattern1(this, 'price_2w_choppiness_index'), + priceTrueRangeSum2w: createMetricPattern1(this, 'price_true_range_sum_2w'), + priceChoppinessIndex2w: createBpsPercentRatioPattern(this, 'price_choppiness_index_2w'), }, movingAverage: { - price1wSma: createPriceRatioPattern(this, 'price_1w_sma'), - price8dSma: createPriceRatioPattern(this, 'price_8d_sma'), - price13dSma: createPriceRatioPattern(this, 'price_13d_sma'), - price21dSma: createPriceRatioPattern(this, 'price_21d_sma'), - price1mSma: createPriceRatioPattern(this, 'price_1m_sma'), - price34dSma: createPriceRatioPattern(this, 'price_34d_sma'), - price55dSma: createPriceRatioPattern(this, 'price_55d_sma'), - price89dSma: createPriceRatioPattern(this, 'price_89d_sma'), - price111dSma: createPriceRatioPattern(this, 'price_111d_sma'), - price144dSma: createPriceRatioPattern(this, 'price_144d_sma'), - price200dSma: createPriceRatioPattern(this, 'price_200d_sma'), - price350dSma: createPriceRatioPattern(this, 'price_350d_sma'), - price1ySma: createPriceRatioPattern(this, 'price_1y_sma'), - price2ySma: createPriceRatioPattern(this, 'price_2y_sma'), - price200wSma: createPriceRatioPattern(this, 'price_200w_sma'), - price4ySma: createPriceRatioPattern(this, 'price_4y_sma'), - price1wEma: createPriceRatioPattern(this, 'price_1w_ema'), - price8dEma: createPriceRatioPattern(this, 'price_8d_ema'), - price12dEma: createPriceRatioPattern(this, 'price_12d_ema'), - price13dEma: createPriceRatioPattern(this, 'price_13d_ema'), - price21dEma: createPriceRatioPattern(this, 'price_21d_ema'), - price26dEma: createPriceRatioPattern(this, 'price_26d_ema'), - price1mEma: createPriceRatioPattern(this, 'price_1m_ema'), - price34dEma: createPriceRatioPattern(this, 'price_34d_ema'), - price55dEma: createPriceRatioPattern(this, 'price_55d_ema'), - price89dEma: createPriceRatioPattern(this, 'price_89d_ema'), - price144dEma: createPriceRatioPattern(this, 'price_144d_ema'), - price200dEma: createPriceRatioPattern(this, 'price_200d_ema'), - price1yEma: createPriceRatioPattern(this, 'price_1y_ema'), - price2yEma: createPriceRatioPattern(this, 'price_2y_ema'), - price200wEma: createPriceRatioPattern(this, 'price_200w_ema'), - price4yEma: createPriceRatioPattern(this, 'price_4y_ema'), - price200dSmaX24: createCentsSatsUsdPattern(this, 'price_200d_sma_x2_4'), - price200dSmaX08: createCentsSatsUsdPattern(this, 'price_200d_sma_x0_8'), - price350dSmaX2: createCentsSatsUsdPattern(this, 'price_350d_sma_x2'), + priceSma1w: createBpsPriceRatioPattern(this, 'price_sma_1w'), + priceSma8d: createBpsPriceRatioPattern(this, 'price_sma_8d'), + priceSma13d: createBpsPriceRatioPattern(this, 'price_sma_13d'), + priceSma21d: createBpsPriceRatioPattern(this, 'price_sma_21d'), + priceSma1m: createBpsPriceRatioPattern(this, 'price_sma_1m'), + priceSma34d: createBpsPriceRatioPattern(this, 'price_sma_34d'), + priceSma55d: createBpsPriceRatioPattern(this, 'price_sma_55d'), + priceSma89d: createBpsPriceRatioPattern(this, 'price_sma_89d'), + priceSma111d: createBpsPriceRatioPattern(this, 'price_sma_111d'), + priceSma144d: createBpsPriceRatioPattern(this, 'price_sma_144d'), + priceSma200d: createBpsPriceRatioPattern(this, 'price_sma_200d'), + priceSma350d: createBpsPriceRatioPattern(this, 'price_sma_350d'), + priceSma1y: createBpsPriceRatioPattern(this, 'price_sma_1y'), + priceSma2y: createBpsPriceRatioPattern(this, 'price_sma_2y'), + priceSma200w: createBpsPriceRatioPattern(this, 'price_sma_200w'), + priceSma4y: createBpsPriceRatioPattern(this, 'price_sma_4y'), + priceEma1w: createBpsPriceRatioPattern(this, 'price_ema_1w'), + priceEma8d: createBpsPriceRatioPattern(this, 'price_ema_8d'), + priceEma12d: createBpsPriceRatioPattern(this, 'price_ema_12d'), + priceEma13d: createBpsPriceRatioPattern(this, 'price_ema_13d'), + priceEma21d: createBpsPriceRatioPattern(this, 'price_ema_21d'), + priceEma26d: createBpsPriceRatioPattern(this, 'price_ema_26d'), + priceEma1m: createBpsPriceRatioPattern(this, 'price_ema_1m'), + priceEma34d: createBpsPriceRatioPattern(this, 'price_ema_34d'), + priceEma55d: createBpsPriceRatioPattern(this, 'price_ema_55d'), + priceEma89d: createBpsPriceRatioPattern(this, 'price_ema_89d'), + priceEma144d: createBpsPriceRatioPattern(this, 'price_ema_144d'), + priceEma200d: createBpsPriceRatioPattern(this, 'price_ema_200d'), + priceEma1y: createBpsPriceRatioPattern(this, 'price_ema_1y'), + priceEma2y: createBpsPriceRatioPattern(this, 'price_ema_2y'), + priceEma200w: createBpsPriceRatioPattern(this, 'price_ema_200w'), + priceEma4y: createBpsPriceRatioPattern(this, 'price_ema_4y'), + priceSma200dX24: createCentsSatsUsdPattern(this, 'price_sma_200d_x2_4'), + priceSma200dX08: createCentsSatsUsdPattern(this, 'price_sma_200d_x0_8'), + priceSma350dX2: createCentsSatsUsdPattern(this, 'price_sma_350d_x2'), }, dca: { dcaSatsPerDay: createMetricPattern18(this, 'dca_sats_per_day'), periodStack: create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(this, 'dca_stack'), - periodAveragePrice: { - _1w: createCentsSatsUsdPattern(this, '1w_dca_average_price'), - _1m: createCentsSatsUsdPattern(this, '1m_dca_average_price'), - _3m: createCentsSatsUsdPattern(this, '3m_dca_average_price'), - _6m: createCentsSatsUsdPattern(this, '6m_dca_average_price'), - _1y: createCentsSatsUsdPattern(this, '1y_dca_average_price'), - _2y: createCentsSatsUsdPattern(this, '2y_dca_average_price'), - _3y: createCentsSatsUsdPattern(this, '3y_dca_average_price'), - _4y: createCentsSatsUsdPattern(this, '4y_dca_average_price'), - _5y: createCentsSatsUsdPattern(this, '5y_dca_average_price'), - _6y: createCentsSatsUsdPattern(this, '6y_dca_average_price'), - _8y: createCentsSatsUsdPattern(this, '8y_dca_average_price'), - _10y: createCentsSatsUsdPattern(this, '10y_dca_average_price'), + periodCostBasis: { + _1w: createCentsSatsUsdPattern(this, 'dca_cost_basis_1w'), + _1m: createCentsSatsUsdPattern(this, 'dca_cost_basis_1m'), + _3m: createCentsSatsUsdPattern(this, 'dca_cost_basis_3m'), + _6m: createCentsSatsUsdPattern(this, 'dca_cost_basis_6m'), + _1y: createCentsSatsUsdPattern(this, 'dca_cost_basis_1y'), + _2y: createCentsSatsUsdPattern(this, 'dca_cost_basis_2y'), + _3y: createCentsSatsUsdPattern(this, 'dca_cost_basis_3y'), + _4y: createCentsSatsUsdPattern(this, 'dca_cost_basis_4y'), + _5y: createCentsSatsUsdPattern(this, 'dca_cost_basis_5y'), + _6y: createCentsSatsUsdPattern(this, 'dca_cost_basis_6y'), + _8y: createCentsSatsUsdPattern(this, 'dca_cost_basis_8y'), + _10y: createCentsSatsUsdPattern(this, 'dca_cost_basis_10y'), }, - periodReturns: create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(this, 'dca_returns'), + periodReturn: create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(this, 'dca_return'), periodCagr: create_10y2y3y4y5y6y8yPattern(this, 'dca_cagr'), periodLumpSumStack: create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(this, 'lump_sum_stack'), - periodLumpSumReturns: create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(this, 'lump_sum_returns'), + periodLumpSumReturn: create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(this, 'lump_sum_return'), classStack: { - _2015: createBtcCentsSatsUsdPattern(this, 'dca_class_2015_stack'), - _2016: createBtcCentsSatsUsdPattern(this, 'dca_class_2016_stack'), - _2017: createBtcCentsSatsUsdPattern(this, 'dca_class_2017_stack'), - _2018: createBtcCentsSatsUsdPattern(this, 'dca_class_2018_stack'), - _2019: createBtcCentsSatsUsdPattern(this, 'dca_class_2019_stack'), - _2020: createBtcCentsSatsUsdPattern(this, 'dca_class_2020_stack'), - _2021: createBtcCentsSatsUsdPattern(this, 'dca_class_2021_stack'), - _2022: createBtcCentsSatsUsdPattern(this, 'dca_class_2022_stack'), - _2023: createBtcCentsSatsUsdPattern(this, 'dca_class_2023_stack'), - _2024: createBtcCentsSatsUsdPattern(this, 'dca_class_2024_stack'), - _2025: createBtcCentsSatsUsdPattern(this, 'dca_class_2025_stack'), - _2026: createBtcCentsSatsUsdPattern(this, 'dca_class_2026_stack'), + from2015: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2015'), + from2016: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2016'), + from2017: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2017'), + from2018: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2018'), + from2019: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2019'), + from2020: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2020'), + from2021: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2021'), + from2022: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2022'), + from2023: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2023'), + from2024: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2024'), + from2025: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2025'), + from2026: createBtcCentsSatsUsdPattern(this, 'dca_stack_from_2026'), }, - classAveragePrice: { - _2015: createCentsSatsUsdPattern(this, 'dca_class_2015_average_price'), - _2016: createCentsSatsUsdPattern(this, 'dca_class_2016_average_price'), - _2017: createCentsSatsUsdPattern(this, 'dca_class_2017_average_price'), - _2018: createCentsSatsUsdPattern(this, 'dca_class_2018_average_price'), - _2019: createCentsSatsUsdPattern(this, 'dca_class_2019_average_price'), - _2020: createCentsSatsUsdPattern(this, 'dca_class_2020_average_price'), - _2021: createCentsSatsUsdPattern(this, 'dca_class_2021_average_price'), - _2022: createCentsSatsUsdPattern(this, 'dca_class_2022_average_price'), - _2023: createCentsSatsUsdPattern(this, 'dca_class_2023_average_price'), - _2024: createCentsSatsUsdPattern(this, 'dca_class_2024_average_price'), - _2025: createCentsSatsUsdPattern(this, 'dca_class_2025_average_price'), - _2026: createCentsSatsUsdPattern(this, 'dca_class_2026_average_price'), + classCostBasis: { + from2015: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2015'), + from2016: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2016'), + from2017: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2017'), + from2018: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2018'), + from2019: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2019'), + from2020: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2020'), + from2021: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2021'), + from2022: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2022'), + from2023: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2023'), + from2024: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2024'), + from2025: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2025'), + from2026: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2026'), }, - classReturns: { - _2015: createMetricPattern1(this, 'dca_class_2015_returns'), - _2016: createMetricPattern1(this, 'dca_class_2016_returns'), - _2017: createMetricPattern1(this, 'dca_class_2017_returns'), - _2018: createMetricPattern1(this, 'dca_class_2018_returns'), - _2019: createMetricPattern1(this, 'dca_class_2019_returns'), - _2020: createMetricPattern1(this, 'dca_class_2020_returns'), - _2021: createMetricPattern1(this, 'dca_class_2021_returns'), - _2022: createMetricPattern1(this, 'dca_class_2022_returns'), - _2023: createMetricPattern1(this, 'dca_class_2023_returns'), - _2024: createMetricPattern1(this, 'dca_class_2024_returns'), - _2025: createMetricPattern1(this, 'dca_class_2025_returns'), - _2026: createMetricPattern1(this, 'dca_class_2026_returns'), + classReturn: { + from2015: createBpsPercentRatioPattern(this, 'dca_return_from_2015'), + from2016: createBpsPercentRatioPattern(this, 'dca_return_from_2016'), + from2017: createBpsPercentRatioPattern(this, 'dca_return_from_2017'), + from2018: createBpsPercentRatioPattern(this, 'dca_return_from_2018'), + from2019: createBpsPercentRatioPattern(this, 'dca_return_from_2019'), + from2020: createBpsPercentRatioPattern(this, 'dca_return_from_2020'), + from2021: createBpsPercentRatioPattern(this, 'dca_return_from_2021'), + from2022: createBpsPercentRatioPattern(this, 'dca_return_from_2022'), + from2023: createBpsPercentRatioPattern(this, 'dca_return_from_2023'), + from2024: createBpsPercentRatioPattern(this, 'dca_return_from_2024'), + from2025: createBpsPercentRatioPattern(this, 'dca_return_from_2025'), + from2026: createBpsPercentRatioPattern(this, 'dca_return_from_2026'), }, }, indicators: { - puellMultiple: createMetricPattern1(this, 'puell_multiple'), - nvt: createMetricPattern1(this, 'nvt'), + puellMultiple: createBpsRatioPattern(this, 'puell_multiple'), + nvt: createBpsRatioPattern(this, 'nvt'), rsi: { - _1d: { - gains: createMetricPattern1(this, 'rsi_gains_1d'), - losses: createMetricPattern1(this, 'rsi_losses_1d'), - averageGain: createMetricPattern1(this, 'rsi_avg_gain_1d'), - averageLoss: createMetricPattern1(this, 'rsi_avg_loss_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'), - stochRsiK: createMetricPattern1(this, 'rsi_stoch_rsi_k_1d'), - stochRsiD: createMetricPattern1(this, 'rsi_stoch_rsi_d_1d'), - }, + _24h: createAverageGainsLossesRsiStochPattern(this, 'rsi'), _1w: { gains: createMetricPattern1(this, 'rsi_gains_1w'), losses: createMetricPattern1(this, 'rsi_losses_1w'), - averageGain: createMetricPattern1(this, 'rsi_avg_gain_1w'), - averageLoss: createMetricPattern1(this, 'rsi_avg_loss_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'), - stochRsiK: createMetricPattern1(this, 'rsi_stoch_rsi_k_1w'), - stochRsiD: createMetricPattern1(this, 'rsi_stoch_rsi_d_1w'), + averageGain: createMetricPattern1(this, 'rsi_average_gain_1w'), + averageLoss: createMetricPattern1(this, 'rsi_average_loss_1w'), + rsi: createBpsPercentRatioPattern(this, 'rsi_1w'), + rsiMin: createBpsPercentRatioPattern(this, 'rsi_min_1w'), + rsiMax: createBpsPercentRatioPattern(this, 'rsi_max_1w'), + stochRsi: createBpsPercentRatioPattern(this, 'rsi_stoch_1w'), + stochRsiK: createBpsPercentRatioPattern(this, 'rsi_stoch_k_1w'), + stochRsiD: createBpsPercentRatioPattern(this, 'rsi_stoch_d_1w'), }, _1m: { gains: createMetricPattern1(this, 'rsi_gains_1m'), losses: createMetricPattern1(this, 'rsi_losses_1m'), - averageGain: createMetricPattern1(this, 'rsi_avg_gain_1m'), - averageLoss: createMetricPattern1(this, 'rsi_avg_loss_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'), - stochRsiK: createMetricPattern1(this, 'rsi_stoch_rsi_k_1m'), - stochRsiD: createMetricPattern1(this, 'rsi_stoch_rsi_d_1m'), + averageGain: createMetricPattern1(this, 'rsi_average_gain_1m'), + averageLoss: createMetricPattern1(this, 'rsi_average_loss_1m'), + rsi: createBpsPercentRatioPattern(this, 'rsi_1m'), + rsiMin: createBpsPercentRatioPattern(this, 'rsi_min_1m'), + rsiMax: createBpsPercentRatioPattern(this, 'rsi_max_1m'), + stochRsi: createBpsPercentRatioPattern(this, 'rsi_stoch_1m'), + stochRsiK: createBpsPercentRatioPattern(this, 'rsi_stoch_k_1m'), + stochRsiD: createBpsPercentRatioPattern(this, 'rsi_stoch_d_1m'), + }, + _1y: { + gains: createMetricPattern1(this, 'rsi_gains_1y'), + losses: createMetricPattern1(this, 'rsi_losses_1y'), + averageGain: createMetricPattern1(this, 'rsi_average_gain_1y'), + averageLoss: createMetricPattern1(this, 'rsi_average_loss_1y'), + rsi: createBpsPercentRatioPattern(this, 'rsi_1y'), + rsiMin: createBpsPercentRatioPattern(this, 'rsi_min_1y'), + rsiMax: createBpsPercentRatioPattern(this, 'rsi_max_1y'), + stochRsi: createBpsPercentRatioPattern(this, 'rsi_stoch_1y'), + stochRsiK: createBpsPercentRatioPattern(this, 'rsi_stoch_k_1y'), + stochRsiD: createBpsPercentRatioPattern(this, 'rsi_stoch_d_1y'), }, - _1y: createAverageGainsLossesRsiStochPattern(this, 'rsi'), }, - stochK: createMetricPattern1(this, 'stoch_k'), - stochD: createMetricPattern1(this, 'stoch_d'), - piCycle: createMetricPattern1(this, 'pi_cycle'), + stochK: createBpsPercentRatioPattern(this, 'stoch_k'), + stochD: createBpsPercentRatioPattern(this, 'stoch_d'), + piCycle: createBpsRatioPattern(this, 'pi_cycle'), macd: { - _1d: { - emaFast: createMetricPattern1(this, 'macd_ema_fast_1d'), - emaSlow: createMetricPattern1(this, 'macd_ema_slow_1d'), - line: createMetricPattern1(this, 'macd_line_1d'), - signal: createMetricPattern1(this, 'macd_signal_1d'), - histogram: createMetricPattern1(this, 'macd_histogram_1d'), - }, + _24h: createEmaHistogramLineSignalPattern(this, 'macd'), _1w: { emaFast: createMetricPattern1(this, 'macd_ema_fast_1w'), emaSlow: createMetricPattern1(this, 'macd_ema_slow_1w'), @@ -7032,176 +6910,182 @@ class BrkClient extends BrkClientBase { signal: createMetricPattern1(this, 'macd_signal_1m'), histogram: createMetricPattern1(this, 'macd_histogram_1m'), }, - _1y: createEmaHistogramLineSignalPattern(this, 'macd'), + _1y: { + emaFast: createMetricPattern1(this, 'macd_ema_fast_1y'), + emaSlow: createMetricPattern1(this, 'macd_ema_slow_1y'), + line: createMetricPattern1(this, 'macd_line_1y'), + signal: createMetricPattern1(this, 'macd_signal_1y'), + histogram: createMetricPattern1(this, 'macd_histogram_1y'), + }, }, - gini: createMetricPattern1(this, 'gini'), + gini: createBpsPercentRatioPattern(this, 'gini'), }, }, pools: { heightToPool: createMetricPattern18(this, 'pool'), vecs: { - unknown: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'unknown'), - blockfills: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'blockfills'), - ultimuspool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'ultimuspool'), - terrapool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'terrapool'), - luxor: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'luxor'), - onethash: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'onethash'), - btccom: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btccom'), - bitfarms: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitfarms'), - huobipool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'huobipool'), - wayicn: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'wayicn'), - canoepool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'canoepool'), - btctop: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btctop'), - bitcoincom: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitcoincom'), - pool175btc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'pool175btc'), - gbminers: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'gbminers'), - axbt: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'axbt'), - asicminer: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'asicminer'), - bitminter: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitminter'), - bitcoinrussia: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitcoinrussia'), - btcserv: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btcserv'), - simplecoinus: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'simplecoinus'), - btcguild: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btcguild'), - eligius: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'eligius'), - ozcoin: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'ozcoin'), - eclipsemc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'eclipsemc'), - maxbtc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'maxbtc'), - triplemining: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'triplemining'), - coinlab: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'coinlab'), - pool50btc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'pool50btc'), - ghashio: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'ghashio'), - stminingcorp: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'stminingcorp'), - bitparking: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitparking'), - mmpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'mmpool'), - polmine: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'polmine'), - kncminer: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'kncminer'), - bitalo: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitalo'), - f2pool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'f2pool'), - hhtt: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'hhtt'), - megabigpower: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'megabigpower'), - mtred: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'mtred'), - nmcbit: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'nmcbit'), - yourbtcnet: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'yourbtcnet'), - givemecoins: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'givemecoins'), - braiinspool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'braiinspool'), - antpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'antpool'), - multicoinco: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'multicoinco'), - bcpoolio: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bcpoolio'), - cointerra: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'cointerra'), - kanopool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'kanopool'), - solock: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'solock'), - ckpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'ckpool'), - nicehash: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'nicehash'), - bitclub: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitclub'), - bitcoinaffiliatenetwork: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitcoinaffiliatenetwork'), - btcc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btcc'), - bwpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bwpool'), - exxbw: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'exxbw'), - bitsolo: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitsolo'), - bitfury: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitfury'), - twentyoneinc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'twentyoneinc'), - digitalbtc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'digitalbtc'), - eightbaochi: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'eightbaochi'), - mybtccoinpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'mybtccoinpool'), - tbdice: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'tbdice'), - hashpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'hashpool'), - nexious: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'nexious'), - bravomining: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bravomining'), - hotpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'hotpool'), - okexpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'okexpool'), - bcmonster: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bcmonster'), - onehash: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'onehash'), - bixin: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bixin'), - tatmaspool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'tatmaspool'), - viabtc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'viabtc'), - connectbtc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'connectbtc'), - batpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'batpool'), - waterhole: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'waterhole'), - dcexploration: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'dcexploration'), - dcex: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'dcex'), - btpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btpool'), - fiftyeightcoin: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'fiftyeightcoin'), - bitcoinindia: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitcoinindia'), - shawnp0wers: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'shawnp0wers'), - phashio: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'phashio'), - rigpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'rigpool'), - haozhuzhu: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'haozhuzhu'), - sevenpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'sevenpool'), - miningkings: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'miningkings'), - hashbx: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'hashbx'), - dpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'dpool'), - rawpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'rawpool'), - haominer: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'haominer'), - helix: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'helix'), - bitcoinukraine: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitcoinukraine'), - poolin: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'poolin'), - secretsuperstar: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'secretsuperstar'), - tigerpoolnet: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'tigerpoolnet'), - sigmapoolcom: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'sigmapoolcom'), - okpooltop: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'okpooltop'), - hummerpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'hummerpool'), - tangpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'tangpool'), - bytepool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bytepool'), - spiderpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'spiderpool'), - novablock: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'novablock'), - miningcity: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'miningcity'), - binancepool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'binancepool'), - minerium: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'minerium'), - lubiancom: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'lubiancom'), - okkong: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'okkong'), - aaopool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'aaopool'), - emcdpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'emcdpool'), - foundryusa: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'foundryusa'), - sbicrypto: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'sbicrypto'), - arkpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'arkpool'), - purebtccom: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'purebtccom'), - marapool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'marapool'), - kucoinpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'kucoinpool'), - entrustcharitypool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'entrustcharitypool'), - okminer: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'okminer'), - titan: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'titan'), - pegapool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'pegapool'), - btcnuggets: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btcnuggets'), - cloudhashing: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'cloudhashing'), - digitalxmintsy: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'digitalxmintsy'), - telco214: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'telco214'), - btcpoolparty: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btcpoolparty'), - multipool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'multipool'), - transactioncoinmining: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'transactioncoinmining'), - btcdig: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btcdig'), - trickysbtcpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'trickysbtcpool'), - btcmp: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btcmp'), - eobot: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'eobot'), - unomp: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'unomp'), - patels: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'patels'), - gogreenlight: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'gogreenlight'), - bitcoinindiapool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitcoinindiapool'), - ekanembtc: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'ekanembtc'), - canoe: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'canoe'), - tiger: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'tiger'), - onem1x: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'onem1x'), - zulupool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'zulupool'), - secpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'secpool'), - ocean: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'ocean'), - whitepool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'whitepool'), - wiz: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'wiz'), - wk057: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'wk057'), - futurebitapollosolo: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'futurebitapollosolo'), - carbonnegative: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'carbonnegative'), - portlandhodl: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'portlandhodl'), - phoenix: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'phoenix'), - neopool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'neopool'), - maxipool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'maxipool'), - bitfufupool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'bitfufupool'), - gdpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'gdpool'), - miningdutch: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'miningdutch'), - publicpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'publicpool'), - miningsquared: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'miningsquared'), - innopolistech: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'innopolistech'), - btclab: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'btclab'), - parasite: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'parasite'), - redrockpool: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'redrockpool'), - est3lar: createBlocksCoinbaseDaysDominanceFeeSubsidyPattern(this, 'est3lar'), + unknown: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'unknown'), + blockfills: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'blockfills'), + ultimuspool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'ultimuspool'), + terrapool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'terrapool'), + luxor: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'luxor'), + onethash: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'onethash'), + btccom: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btccom'), + bitfarms: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitfarms'), + huobipool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'huobipool'), + wayicn: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'wayicn'), + canoepool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'canoepool'), + btctop: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btctop'), + bitcoincom: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitcoincom'), + pool175btc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'pool175btc'), + gbminers: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'gbminers'), + axbt: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'axbt'), + asicminer: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'asicminer'), + bitminter: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitminter'), + bitcoinrussia: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitcoinrussia'), + btcserv: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btcserv'), + simplecoinus: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'simplecoinus'), + btcguild: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btcguild'), + eligius: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'eligius'), + ozcoin: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'ozcoin'), + eclipsemc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'eclipsemc'), + maxbtc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'maxbtc'), + triplemining: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'triplemining'), + coinlab: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'coinlab'), + pool50btc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'pool50btc'), + ghashio: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'ghashio'), + stminingcorp: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'stminingcorp'), + bitparking: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitparking'), + mmpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'mmpool'), + polmine: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'polmine'), + kncminer: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'kncminer'), + bitalo: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitalo'), + f2pool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'f2pool'), + hhtt: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'hhtt'), + megabigpower: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'megabigpower'), + mtred: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'mtred'), + nmcbit: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'nmcbit'), + yourbtcnet: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'yourbtcnet'), + givemecoins: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'givemecoins'), + braiinspool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'braiinspool'), + antpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'antpool'), + multicoinco: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'multicoinco'), + bcpoolio: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bcpoolio'), + cointerra: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'cointerra'), + kanopool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'kanopool'), + solock: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'solock'), + ckpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'ckpool'), + nicehash: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'nicehash'), + bitclub: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitclub'), + bitcoinaffiliatenetwork: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitcoinaffiliatenetwork'), + btcc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btcc'), + bwpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bwpool'), + exxbw: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'exxbw'), + bitsolo: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitsolo'), + bitfury: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitfury'), + twentyoneinc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'twentyoneinc'), + digitalbtc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'digitalbtc'), + eightbaochi: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'eightbaochi'), + mybtccoinpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'mybtccoinpool'), + tbdice: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'tbdice'), + hashpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'hashpool'), + nexious: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'nexious'), + bravomining: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bravomining'), + hotpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'hotpool'), + okexpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'okexpool'), + bcmonster: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bcmonster'), + onehash: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'onehash'), + bixin: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bixin'), + tatmaspool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'tatmaspool'), + viabtc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'viabtc'), + connectbtc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'connectbtc'), + batpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'batpool'), + waterhole: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'waterhole'), + dcexploration: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'dcexploration'), + dcex: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'dcex'), + btpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btpool'), + fiftyeightcoin: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'fiftyeightcoin'), + bitcoinindia: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitcoinindia'), + shawnp0wers: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'shawnp0wers'), + phashio: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'phashio'), + rigpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'rigpool'), + haozhuzhu: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'haozhuzhu'), + sevenpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'sevenpool'), + miningkings: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'miningkings'), + hashbx: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'hashbx'), + dpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'dpool'), + rawpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'rawpool'), + haominer: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'haominer'), + helix: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'helix'), + bitcoinukraine: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitcoinukraine'), + poolin: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'poolin'), + secretsuperstar: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'secretsuperstar'), + tigerpoolnet: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'tigerpoolnet'), + sigmapoolcom: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'sigmapoolcom'), + okpooltop: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'okpooltop'), + hummerpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'hummerpool'), + tangpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'tangpool'), + bytepool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bytepool'), + spiderpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'spiderpool'), + novablock: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'novablock'), + miningcity: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'miningcity'), + binancepool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'binancepool'), + minerium: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'minerium'), + lubiancom: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'lubiancom'), + okkong: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'okkong'), + aaopool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'aaopool'), + emcdpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'emcdpool'), + foundryusa: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'foundryusa'), + sbicrypto: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'sbicrypto'), + arkpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'arkpool'), + purebtccom: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'purebtccom'), + marapool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'marapool'), + kucoinpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'kucoinpool'), + entrustcharitypool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'entrustcharitypool'), + okminer: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'okminer'), + titan: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'titan'), + pegapool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'pegapool'), + btcnuggets: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btcnuggets'), + cloudhashing: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'cloudhashing'), + digitalxmintsy: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'digitalxmintsy'), + telco214: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'telco214'), + btcpoolparty: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btcpoolparty'), + multipool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'multipool'), + transactioncoinmining: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'transactioncoinmining'), + btcdig: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btcdig'), + trickysbtcpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'trickysbtcpool'), + btcmp: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btcmp'), + eobot: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'eobot'), + unomp: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'unomp'), + patels: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'patels'), + gogreenlight: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'gogreenlight'), + bitcoinindiapool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitcoinindiapool'), + ekanembtc: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'ekanembtc'), + canoe: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'canoe'), + tiger: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'tiger'), + onem1x: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'onem1x'), + zulupool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'zulupool'), + secpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'secpool'), + ocean: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'ocean'), + whitepool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'whitepool'), + wiz: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'wiz'), + wk057: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'wk057'), + futurebitapollosolo: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'futurebitapollosolo'), + carbonnegative: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'carbonnegative'), + portlandhodl: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'portlandhodl'), + phoenix: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'phoenix'), + neopool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'neopool'), + maxipool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'maxipool'), + bitfufupool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'bitfufupool'), + gdpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'gdpool'), + miningdutch: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'miningdutch'), + publicpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'publicpool'), + miningsquared: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'miningsquared'), + innopolistech: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'innopolistech'), + btclab: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'btclab'), + parasite: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'parasite'), + redrockpool: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'redrockpool'), + est3lar: createBlocksCoinbaseDominanceFeeSubsidyPattern(this, 'est3lar'), }, }, prices: { @@ -7244,35 +7128,35 @@ class BrkClient extends BrkClientBase { }, utxoCohorts: { all: { - supply: create_30dHalvedTotalPattern(this, ''), + supply: createChangeHalvedTotalPattern(this, 'supply'), outputs: createUtxoPattern(this, 'utxo_count'), activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(this, ''), - realized: createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(this, ''), + realized: createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(this, ''), costBasis: createInvestedMaxMinPercentilesSpotPattern(this, ''), - unrealized: createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(this, ''), + unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(this, ''), relative: { - supplyInProfitRelToOwnSupply: createMetricPattern1(this, 'supply_in_profit_rel_to_own_supply'), - supplyInLossRelToOwnSupply: createMetricPattern1(this, 'supply_in_loss_rel_to_own_supply'), - unrealizedProfitRelToMarketCap: createMetricPattern1(this, 'unrealized_profit_rel_to_market_cap'), - unrealizedLossRelToMarketCap: createMetricPattern1(this, 'unrealized_loss_rel_to_market_cap'), - negUnrealizedLossRelToMarketCap: createMetricPattern1(this, 'neg_unrealized_loss_rel_to_market_cap'), - netUnrealizedPnlRelToMarketCap: createMetricPattern1(this, 'net_unrealized_pnl_rel_to_market_cap'), + supplyInProfitRelToOwnSupply: createBpsPercentRatioPattern(this, 'supply_in_profit_rel_to_own_supply'), + supplyInLossRelToOwnSupply: createBpsPercentRatioPattern(this, 'supply_in_loss_rel_to_own_supply'), + unrealizedProfitRelToMarketCap: createBpsPercentRatioPattern(this, 'unrealized_profit_rel_to_market_cap'), + unrealizedLossRelToMarketCap: createBpsPercentRatioPattern(this, 'unrealized_loss_rel_to_market_cap'), + negUnrealizedLossRelToMarketCap: createBpsPercentRatioPattern(this, 'neg_unrealized_loss_rel_to_market_cap'), + netUnrealizedPnlRelToMarketCap: createBpsPercentRatioPattern(this, 'net_unrealized_pnl_rel_to_market_cap'), nupl: createMetricPattern1(this, 'nupl'), - 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'), + investedCapitalInProfitRelToRealizedCap: createBpsPercentRatioPattern(this, 'invested_capital_in_profit_rel_to_realized_cap'), + investedCapitalInLossRelToRealizedCap: createBpsPercentRatioPattern(this, 'invested_capital_in_loss_rel_to_realized_cap'), + unrealizedProfitRelToOwnGrossPnl: createBpsPercentRatioPattern(this, 'unrealized_profit_rel_to_own_gross_pnl'), + unrealizedLossRelToOwnGrossPnl: createBpsPercentRatioPattern(this, 'unrealized_loss_rel_to_own_gross_pnl'), + negUnrealizedLossRelToOwnGrossPnl: createBpsPercentRatioPattern(this, 'neg_unrealized_loss_rel_to_own_gross_pnl'), + netUnrealizedPnlRelToOwnGrossPnl: createBpsPercentRatioPattern(this, 'net_unrealized_pnl_rel_to_own_gross_pnl'), }, }, sth: { - supply: create_30dHalvedTotalPattern(this, 'sth'), + supply: createChangeHalvedTotalPattern(this, 'sth_supply'), outputs: createUtxoPattern(this, 'sth_utxo_count'), activity: createCoinblocksCoindaysSatblocksSatdaysSentPattern(this, 'sth'), - realized: createAdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(this, 'sth'), + realized: createAdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(this, 'sth'), costBasis: createInvestedMaxMinPercentilesSpotPattern(this, 'sth'), - unrealized: createGreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(this, 'sth'), + unrealized: createGreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(this, 'sth'), relative: createInvestedNegNetNuplSupplyUnrealizedPattern2(this, 'sth'), }, lth: createActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern(this, 'lth'), @@ -7512,15 +7396,15 @@ class BrkClient extends BrkClientBase { p2a: createAverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'p2a_new_addr_count'), }, growthRate: { - all: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'growth_rate'), - p2pk65: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2pk65_growth_rate'), - p2pk33: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2pk33_growth_rate'), - p2pkh: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2pkh_growth_rate'), - p2sh: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2sh_growth_rate'), - p2wpkh: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2wpkh_growth_rate'), - p2wsh: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2wsh_growth_rate'), - p2tr: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2tr_growth_rate'), - p2a: createAverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'p2a_growth_rate'), + all: createBpsPercentRatioPattern2(this, 'growth_rate'), + p2pk65: createBpsPercentRatioPattern2(this, 'p2pk65_growth_rate'), + p2pk33: createBpsPercentRatioPattern2(this, 'p2pk33_growth_rate'), + p2pkh: createBpsPercentRatioPattern2(this, 'p2pkh_growth_rate'), + p2sh: createBpsPercentRatioPattern2(this, 'p2sh_growth_rate'), + p2wpkh: createBpsPercentRatioPattern2(this, 'p2wpkh_growth_rate'), + p2wsh: createBpsPercentRatioPattern2(this, 'p2wsh_growth_rate'), + p2tr: createBpsPercentRatioPattern2(this, 'p2tr_growth_rate'), + p2a: createBpsPercentRatioPattern2(this, 'p2a_growth_rate'), }, fundedaddressindex: createMetricPattern34(this, 'fundedaddressindex'), emptyaddressindex: createMetricPattern35(this, 'emptyaddressindex'), @@ -7531,15 +7415,15 @@ class BrkClient extends BrkClientBase { opreturn: createBaseCumulativeSumPattern(this, 'opreturn_supply'), unspendable: createBaseCumulativeSumPattern(this, 'unspendable_supply'), }, - inflation: createMetricPattern1(this, 'inflation_rate'), + inflationRate: createBpsPercentRatioPattern(this, 'inflation_rate'), velocity: { - btc: createMetricPattern1(this, 'btc_velocity'), - usd: createMetricPattern1(this, 'usd_velocity'), + btc: createMetricPattern1(this, 'velocity_btc'), + usd: createMetricPattern1(this, 'velocity_usd'), }, marketCap: createMetricPattern1(this, 'market_cap'), - marketCapGrowthRate: createMetricPattern1(this, 'market_cap_growth_rate'), - realizedCapGrowthRate: createMetricPattern1(this, 'realized_cap_growth_rate'), - capGrowthRateDiff: createMetricPattern1(this, 'cap_growth_rate_diff'), + marketCapGrowthRate: createBpsPercentRatioPattern(this, 'market_cap_growth_rate'), + realizedCapGrowthRate: createBpsPercentRatioPattern(this, 'realized_cap_growth_rate'), + marketMinusRealizedCapGrowthRate: createMetricPattern1(this, 'market_minus_realized_cap_growth_rate'), }, }; } diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index 5d16036c3..841a161bc 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -27,6 +27,22 @@ TypeIndex = int Txid = str # Unified index for any address type (funded or empty) AnyAddressIndex = TypeIndex +# Unsigned basis points stored as u16. +# 1 bp = 0.0001. Range: 0–6.5535. +# Use for bounded 0–1 ratios (dominance, adoption, liveliness, etc.). +BasisPoints16 = int +# Unsigned basis points stored as u32. +# 1 bp = 0.0001. Range: 0–429,496.7295. +# Use for unbounded unsigned ratios (MVRV, NVT, SOPR, etc.). +BasisPoints32 = int +# Signed basis points stored as i16. +# 1 bp = 0.0001. Range: -3.2767 to +3.2767. +# Use for signed bounded ratios (NUPL, net PnL ratios, etc.). +BasisPointsSigned16 = int +# Signed basis points stored as i32. +# 1 bp = 0.0001. Range: -214,748.3647 to +214,748.3647. +# Use for unbounded signed values (returns, growth rates, volatility, z-scores, etc.). +BasisPointsSigned32 = int # Bitcoin amount as floating point (1 BTC = 100,000,000 satoshis) Bitcoin = float # Position within a .blk file, encoding file index and byte offset @@ -2048,467 +2064,354 @@ class MetricPattern35(Generic[T]): # Reusable structural pattern classes -class AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern: +class AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.adjusted_sopr: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr')) - self.adjusted_sopr_1y: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_1y')) - self.adjusted_sopr_24h: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_24h')) - self.adjusted_sopr_24h_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_24h_30d_ema')) - self.adjusted_sopr_24h_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_24h_7d_ema')) - self.adjusted_sopr_30d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_30d')) - self.adjusted_sopr_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_30d_ema')) - self.adjusted_sopr_7d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_7d')) - self.adjusted_sopr_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_7d_ema')) + self.adjusted_sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_sopr')) + self.adjusted_sopr_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'adjusted_sopr_24h_ema')) self.adjusted_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created')) - self.adjusted_value_created_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created_1y')) - self.adjusted_value_created_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created_24h')) - self.adjusted_value_created_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created_30d')) - self.adjusted_value_created_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created_7d')) + self.adjusted_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_value_created')) self.adjusted_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed')) - self.adjusted_value_destroyed_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed_1y')) - self.adjusted_value_destroyed_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed_24h')) - self.adjusted_value_destroyed_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed_30d')) - self.adjusted_value_destroyed_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed_7d')) + self.adjusted_value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_value_destroyed')) self.cap_raw: MetricPattern18[CentsSats] = MetricPattern18(client, _m(acc, 'cap_raw')) self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'capitulation_flow')) + self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_gross_pnl')) + self.gross_pnl_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')) self.investor_cap_raw: MetricPattern18[CentsSquaredSats] = MetricPattern18(client, _m(acc, 'investor_cap_raw')) self.investor_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'investor_price')) - self.investor_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'investor_price_ratio')) - self.investor_price_ratio_ext: RatioPattern3 = RatioPattern3(client, _m(acc, 'investor_price_ratio')) + self.investor_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'investor_price_ratio')) + self.investor_price_ratio_ext: RatioPattern = RatioPattern(client, _m(acc, 'investor_price_ratio')) self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_created')) self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'lower_price_band')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_pnl_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_pnl_change_1m')) + self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')) + self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')) self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) - self.net_realized_pnl_7d_ema: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')) - self.net_realized_pnl_cumulative_30d_delta: MetricPattern1[CentsSigned] = 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: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')) + self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) self.peak_regret: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) - self.peak_regret_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')) + self.peak_regret_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')) self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_created')) self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_destroyed')) self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) - self.realized_cap_30d_delta: MetricPattern1[CentsSigned] = 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_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) + self.realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap')) self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) - self.realized_loss_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_1y')) - self.realized_loss_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_24h')) - self.realized_loss_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_30d')) - self.realized_loss_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_7d')) - self.realized_loss_7d_ema: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_7d_ema')) - self.realized_loss_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_ema_1w')) + self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'realized_loss')) self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) - self.realized_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) - self.realized_price_ratio_ext: RatioPattern3 = RatioPattern3(client, _m(acc, 'realized_price_ratio')) + self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) + self.realized_price_ratio_ext: RatioPattern = RatioPattern(client, _m(acc, 'realized_price_ratio')) self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) - self.realized_profit_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_1y')) - self.realized_profit_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_24h')) - self.realized_profit_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_30d')) - self.realized_profit_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_7d')) - self.realized_profit_7d_ema: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_7d_ema')) - 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')) - self.realized_profit_to_loss_ratio_7d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_7d')) - self.realized_value: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value')) - self.realized_value_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_1y')) - self.realized_value_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_24h')) - self.realized_value_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_30d')) - self.realized_value_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_7d')) - self.sell_side_risk_ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_1y: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_1y')) - self.sell_side_risk_ratio_24h: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h')) - self.sell_side_risk_ratio_24h_30d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_30d_ema')) - self.sell_side_risk_ratio_24h_7d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_7d_ema')) - self.sell_side_risk_ratio_30d: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d')) - self.sell_side_risk_ratio_30d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) - self.sell_side_risk_ratio_7d: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d')) - self.sell_side_risk_ratio_7d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w')) + self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_profit_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit')) + self.realized_profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')) + self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_loss')) - self.sent_in_loss_14d_ema: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_loss_14d_ema')) + self.sent_in_loss_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')) self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_profit')) - self.sent_in_profit_14d_ema: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_profit_14d_ema')) - self.sopr: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr')) - self.sopr_1y: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_1y')) - self.sopr_24h: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h')) - self.sopr_24h_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h_30d_ema')) - self.sopr_24h_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h_7d_ema')) - self.sopr_30d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_30d')) - self.sopr_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_30d_ema')) - self.sopr_7d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_7d')) - self.sopr_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_7d_ema')) - self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) + self.sent_in_profit_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')) + self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) + self.sopr_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sopr_24h_ema')) self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band')) self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) - self.value_created_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_1y')) - self.value_created_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_24h')) - self.value_created_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_30d')) - self.value_created_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_7d')) + self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_created')) self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed')) - self.value_destroyed_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_1y')) - self.value_destroyed_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_24h')) - self.value_destroyed_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_30d')) - self.value_destroyed_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_7d')) + self.value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_destroyed')) -class AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2: +class AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.adjusted_sopr: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr')) - self.adjusted_sopr_1y: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_1y')) - self.adjusted_sopr_24h: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_24h')) - self.adjusted_sopr_24h_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_24h_30d_ema')) - self.adjusted_sopr_24h_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_24h_7d_ema')) - self.adjusted_sopr_30d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_30d')) - self.adjusted_sopr_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_30d_ema')) - self.adjusted_sopr_7d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_7d')) - self.adjusted_sopr_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'adjusted_sopr_7d_ema')) + self.adjusted_sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_sopr')) + self.adjusted_sopr_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'adjusted_sopr_24h_ema')) self.adjusted_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created')) - self.adjusted_value_created_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created_1y')) - self.adjusted_value_created_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created_24h')) - self.adjusted_value_created_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created_30d')) - self.adjusted_value_created_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_created_7d')) + self.adjusted_value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_value_created')) self.adjusted_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed')) - self.adjusted_value_destroyed_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed_1y')) - self.adjusted_value_destroyed_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed_24h')) - self.adjusted_value_destroyed_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed_30d')) - self.adjusted_value_destroyed_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'adjusted_value_destroyed_7d')) + self.adjusted_value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'adjusted_value_destroyed')) self.cap_raw: MetricPattern18[CentsSats] = MetricPattern18(client, _m(acc, 'cap_raw')) self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'capitulation_flow')) + self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_gross_pnl')) + self.gross_pnl_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')) self.investor_cap_raw: MetricPattern18[CentsSquaredSats] = MetricPattern18(client, _m(acc, 'investor_cap_raw')) self.investor_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'investor_price')) - self.investor_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'investor_price_ratio')) + self.investor_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'investor_price_ratio')) self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_created')) self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'lower_price_band')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_pnl_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_pnl_change_1m')) + self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')) + self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')) self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) - self.net_realized_pnl_7d_ema: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')) - self.net_realized_pnl_cumulative_30d_delta: MetricPattern1[CentsSigned] = 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: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')) + self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) self.peak_regret: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) - self.peak_regret_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')) + self.peak_regret_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')) self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_created')) self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_destroyed')) self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) - self.realized_cap_30d_delta: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_30d_delta')) self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) + self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) - self.realized_loss_7d_ema: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_7d_ema')) - self.realized_loss_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_ema_1w')) + self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) - self.realized_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) + self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) - self.realized_profit_7d_ema: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_7d_ema')) - self.realized_profit_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')) - self.realized_value: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value')) - self.realized_value_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_1y')) - self.realized_value_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_24h')) - self.realized_value_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_30d')) - self.realized_value_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_7d')) - self.sell_side_risk_ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_1y: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_1y')) - self.sell_side_risk_ratio_24h: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h')) - self.sell_side_risk_ratio_24h_30d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_30d_ema')) - self.sell_side_risk_ratio_24h_7d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_7d_ema')) - self.sell_side_risk_ratio_30d: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d')) - self.sell_side_risk_ratio_30d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) - self.sell_side_risk_ratio_7d: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d')) - self.sell_side_risk_ratio_7d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w')) + self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_loss')) - self.sent_in_loss_14d_ema: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_loss_14d_ema')) + self.sent_in_loss_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')) self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_profit')) - self.sent_in_profit_14d_ema: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_profit_14d_ema')) - self.sopr: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr')) - self.sopr_1y: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_1y')) - self.sopr_24h: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h')) - self.sopr_24h_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h_30d_ema')) - self.sopr_24h_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h_7d_ema')) - self.sopr_30d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_30d')) - self.sopr_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_30d_ema')) - self.sopr_7d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_7d')) - self.sopr_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_7d_ema')) - self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) + self.sent_in_profit_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')) + self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) + self.sopr_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sopr_24h_ema')) self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band')) self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) - self.value_created_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_1y')) - self.value_created_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_24h')) - self.value_created_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_30d')) - self.value_created_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_7d')) + self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_created')) self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed')) - self.value_destroyed_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_1y')) - self.value_destroyed_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_24h')) - self.value_destroyed_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_30d')) - self.value_destroyed_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_7d')) + self.value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_destroyed')) -class CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2: +class CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cap_raw: MetricPattern18[CentsSats] = MetricPattern18(client, _m(acc, 'cap_raw')) self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'capitulation_flow')) + self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_gross_pnl')) + self.gross_pnl_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')) self.investor_cap_raw: MetricPattern18[CentsSquaredSats] = MetricPattern18(client, _m(acc, 'investor_cap_raw')) self.investor_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'investor_price')) - self.investor_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'investor_price_ratio')) - self.investor_price_ratio_ext: RatioPattern3 = RatioPattern3(client, _m(acc, 'investor_price_ratio')) + self.investor_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'investor_price_ratio')) + self.investor_price_ratio_ext: RatioPattern = RatioPattern(client, _m(acc, 'investor_price_ratio')) self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_created')) self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'lower_price_band')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_pnl_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_pnl_change_1m')) + self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')) + self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')) self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) - self.net_realized_pnl_7d_ema: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')) - self.net_realized_pnl_cumulative_30d_delta: MetricPattern1[CentsSigned] = 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: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')) + self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) self.peak_regret: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) - self.peak_regret_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')) + self.peak_regret_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')) self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_created')) self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_destroyed')) self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) - self.realized_cap_30d_delta: MetricPattern1[CentsSigned] = 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_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) + self.realized_cap_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_cap_rel_to_own_market_cap')) self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) - self.realized_loss_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_1y')) - self.realized_loss_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_24h')) - self.realized_loss_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_30d')) - self.realized_loss_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_7d')) - self.realized_loss_7d_ema: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_7d_ema')) - self.realized_loss_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_ema_1w')) + self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'realized_loss')) self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) - self.realized_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) - self.realized_price_ratio_ext: RatioPattern3 = RatioPattern3(client, _m(acc, 'realized_price_ratio')) + self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) + self.realized_price_ratio_ext: RatioPattern = RatioPattern(client, _m(acc, 'realized_price_ratio')) self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) - self.realized_profit_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_1y')) - self.realized_profit_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_24h')) - self.realized_profit_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_30d')) - self.realized_profit_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_7d')) - self.realized_profit_7d_ema: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_7d_ema')) - 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')) - self.realized_profit_to_loss_ratio_7d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'realized_profit_to_loss_ratio_7d')) - self.realized_value: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value')) - self.realized_value_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_1y')) - self.realized_value_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_24h')) - self.realized_value_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_30d')) - self.realized_value_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_7d')) - self.sell_side_risk_ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_1y: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_1y')) - self.sell_side_risk_ratio_24h: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h')) - self.sell_side_risk_ratio_24h_30d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_30d_ema')) - self.sell_side_risk_ratio_24h_7d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_7d_ema')) - self.sell_side_risk_ratio_30d: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d')) - self.sell_side_risk_ratio_30d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) - self.sell_side_risk_ratio_7d: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d')) - self.sell_side_risk_ratio_7d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w')) + self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.realized_profit_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit')) + self.realized_profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'realized_profit_to_loss_ratio')) + self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_loss')) - self.sent_in_loss_14d_ema: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_loss_14d_ema')) + self.sent_in_loss_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')) self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_profit')) - self.sent_in_profit_14d_ema: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_profit_14d_ema')) - self.sopr: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr')) - self.sopr_1y: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_1y')) - self.sopr_24h: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h')) - self.sopr_24h_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h_30d_ema')) - self.sopr_24h_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h_7d_ema')) - self.sopr_30d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_30d')) - self.sopr_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_30d_ema')) - self.sopr_7d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_7d')) - self.sopr_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_7d_ema')) - self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) + self.sent_in_profit_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')) + self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) + self.sopr_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sopr_24h_ema')) self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band')) self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) - self.value_created_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_1y')) - self.value_created_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_24h')) - self.value_created_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_30d')) - self.value_created_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_7d')) + self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_created')) self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed')) - self.value_destroyed_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_1y')) - self.value_destroyed_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_24h')) - self.value_destroyed_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_30d')) - self.value_destroyed_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_7d')) + self.value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_destroyed')) -class CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern: +class CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cap_raw: MetricPattern18[CentsSats] = MetricPattern18(client, _m(acc, 'cap_raw')) self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'capitulation_flow')) + self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_gross_pnl')) + self.gross_pnl_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'gross_pnl_sum')) self.investor_cap_raw: MetricPattern18[CentsSquaredSats] = MetricPattern18(client, _m(acc, 'investor_cap_raw')) self.investor_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'investor_price')) - self.investor_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'investor_price_ratio')) + self.investor_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'investor_price_ratio')) self.loss_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_created')) self.loss_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'loss_value_destroyed')) self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'lower_price_band')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) self.neg_realized_loss: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) + self.net_pnl_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_pnl_change_1m')) + self.net_pnl_change_1m_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_market_cap')) + self.net_pnl_change_1m_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_pnl_change_1m_rel_to_realized_cap')) self.net_realized_pnl: CumulativeHeightPattern[CentsSigned] = CumulativeHeightPattern(client, _m(acc, 'net_realized_pnl')) - self.net_realized_pnl_7d_ema: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_7d_ema')) - self.net_realized_pnl_cumulative_30d_delta: MetricPattern1[CentsSigned] = 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: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) + self.net_realized_pnl_ema_1w: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'net_realized_pnl_ema_1w')) + self.net_realized_pnl_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_realized_pnl_rel_to_realized_cap')) self.peak_regret: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_peak_regret')) - self.peak_regret_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'peak_regret_rel_to_realized_cap')) + self.peak_regret_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_peak_regret_rel_to_realized_cap')) self.profit_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'profit_flow')) self.profit_value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_created')) self.profit_value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'profit_value_destroyed')) self.realized_cap: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) - self.realized_cap_30d_delta: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_30d_delta')) self.realized_cap_cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_cap_cents')) + self.realized_cap_change_1m: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_cap_change_1m')) self.realized_loss: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_loss')) - self.realized_loss_7d_ema: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_7d_ema')) - self.realized_loss_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_loss_rel_to_realized_cap')) + self.realized_loss_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_ema_1w')) + self.realized_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_realized_cap')) self.realized_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'realized_price')) - self.realized_price_extra: RatioPattern2 = RatioPattern2(client, _m(acc, 'realized_price_ratio')) + self.realized_price_ratio: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'realized_price_ratio')) self.realized_profit: CumulativeHeightPattern[Cents] = CumulativeHeightPattern(client, _m(acc, 'realized_profit')) - self.realized_profit_7d_ema: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_7d_ema')) - self.realized_profit_rel_to_realized_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'realized_profit_rel_to_realized_cap')) - self.realized_value: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value')) - self.realized_value_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_1y')) - self.realized_value_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_24h')) - self.realized_value_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_30d')) - self.realized_value_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_value_7d')) - self.sell_side_risk_ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio')) - self.sell_side_risk_ratio_1y: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_1y')) - self.sell_side_risk_ratio_24h: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h')) - self.sell_side_risk_ratio_24h_30d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_30d_ema')) - self.sell_side_risk_ratio_24h_7d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_24h_7d_ema')) - self.sell_side_risk_ratio_30d: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d')) - self.sell_side_risk_ratio_30d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_30d_ema')) - self.sell_side_risk_ratio_7d: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d')) - self.sell_side_risk_ratio_7d_ema: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sell_side_risk_ratio_7d_ema')) + self.realized_profit_ema_1w: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_ema_1w')) + self.realized_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_realized_cap')) + self.sell_side_risk_ratio: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'sell_side_risk_ratio')) + self.sell_side_risk_ratio_24h_ema: _1m1wPattern = _1m1wPattern(client, _m(acc, 'sell_side_risk_ratio_24h_ema')) self.sent_in_loss: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_loss')) - self.sent_in_loss_14d_ema: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_loss_14d_ema')) + self.sent_in_loss_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_loss_ema_2w')) self.sent_in_profit: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent_in_profit')) - self.sent_in_profit_14d_ema: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sent_in_profit_14d_ema')) - self.sopr: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr')) - self.sopr_1y: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_1y')) - self.sopr_24h: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h')) - self.sopr_24h_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h_30d_ema')) - self.sopr_24h_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_24h_7d_ema')) - self.sopr_30d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_30d')) - self.sopr_30d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_30d_ema')) - self.sopr_7d: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_7d')) - self.sopr_7d_ema: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'sopr_7d_ema')) - self.total_realized_pnl: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'total_realized_pnl')) + self.sent_in_profit_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_in_profit_ema_2w')) + self.sopr: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, _m(acc, 'sopr')) + self.sopr_24h_ema: _1m1wPattern2 = _1m1wPattern2(client, _m(acc, 'sopr_24h_ema')) self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'upper_price_band')) self.value_created: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created')) - self.value_created_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_1y')) - self.value_created_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_24h')) - self.value_created_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_30d')) - self.value_created_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_created_7d')) + self.value_created_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_created')) self.value_destroyed: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed')) - self.value_destroyed_1y: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_1y')) - self.value_destroyed_24h: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_24h')) - self.value_destroyed_30d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_30d')) - self.value_destroyed_7d: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'value_destroyed_7d')) + self.value_destroyed_sum: _1m1w1y24hPattern[Cents] = _1m1w1y24hPattern(client, _m(acc, 'value_destroyed')) class _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._0sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, '0sd')) - self.m0_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm0_5sd')) - self.m0_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm0_5sd')) - self.m1_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm1_5sd')) - self.m1_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm1_5sd')) - self.m1sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm1sd')) - self.m1sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm1sd')) - self.m2_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm2_5sd')) - self.m2_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm2_5sd')) - self.m2sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm2sd')) - self.m2sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm2sd')) - self.m3sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm3sd')) - self.m3sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm3sd')) - self.p0_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p0_5sd')) - self.p0_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p0_5sd')) - self.p1_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p1_5sd')) - self.p1_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p1_5sd')) - self.p1sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p1sd')) - self.p1sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p1sd')) - self.p2_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p2_5sd')) - self.p2_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p2_5sd')) - self.p2sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p2sd')) - self.p2sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p2sd')) - self.p3sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p3sd')) - self.p3sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p3sd')) - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sd')) - self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sma')) - self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'zscore')) + self._0sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, '0sd_4y')) + self.m0_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm0_5sd_4y')) + self.m0_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm0_5sd_4y')) + self.m1_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm1_5sd_4y')) + self.m1_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm1_5sd_4y')) + self.m1sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm1sd_4y')) + self.m1sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm1sd_4y')) + self.m2_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm2_5sd_4y')) + self.m2_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm2_5sd_4y')) + self.m2sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm2sd_4y')) + self.m2sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm2sd_4y')) + self.m3sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'm3sd_4y')) + self.m3sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'm3sd_4y')) + self.p0_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p0_5sd_4y')) + self.p0_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p0_5sd_4y')) + self.p1_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p1_5sd_4y')) + self.p1_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p1_5sd_4y')) + self.p1sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p1sd_4y')) + self.p1sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p1sd_4y')) + self.p2_5sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p2_5sd_4y')) + self.p2_5sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p2_5sd_4y')) + self.p2sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p2sd_4y')) + self.p2sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p2sd_4y')) + self.p3sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'p3sd_4y')) + self.p3sd_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'p3sd_4y')) + self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sd_4y')) + self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sma_4y')) + self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'zscore_4y')) + +class BpsPriceRatioPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, _m(acc, 'ratio_bps')) + self.price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, acc) + self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) + self.ratio_pct1: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'ratio_pct1')) + self.ratio_pct1_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct1')) + self.ratio_pct2: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'ratio_pct2')) + self.ratio_pct2_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct2')) + self.ratio_pct5: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'ratio_pct5')) + self.ratio_pct5_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct5')) + self.ratio_pct95: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'ratio_pct95')) + self.ratio_pct95_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct95')) + self.ratio_pct98: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'ratio_pct98')) + self.ratio_pct98_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct98')) + self.ratio_pct99: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'ratio_pct99')) + self.ratio_pct99_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct99')) + self.ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')) + self.ratio_sd_1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')) + self.ratio_sd_2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')) + self.ratio_sd_4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')) + self.ratio_sma_1m: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'ratio_sma_1m')) + self.ratio_sma_1w: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'ratio_sma_1w')) + +class BpsRatioPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, _m(acc, 'bps')) + self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + self.ratio_pct1: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct1')) + self.ratio_pct1_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct1')) + self.ratio_pct2: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct2')) + self.ratio_pct2_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct2')) + self.ratio_pct5: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct5')) + self.ratio_pct5_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct5')) + self.ratio_pct95: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct95')) + self.ratio_pct95_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct95')) + self.ratio_pct98: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct98')) + self.ratio_pct98_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct98')) + self.ratio_pct99: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct99')) + self.ratio_pct99_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct99')) + self.ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) + self.ratio_sd_1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) + self.ratio_sd_2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) + self.ratio_sd_4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) + self.ratio_sma_1m: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'sma_1m')) + self.ratio_sma_1w: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'sma_1w')) class InvestedNegNetNuplSupplyUnrealizedPattern2: """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_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) - 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_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) - 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.invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_loss_rel_to_realized_cap')) + self.invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_profit_rel_to_realized_cap')) + self.neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) + self.neg_unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'neg_unrealized_loss_rel_to_own_gross_pnl')) + self.neg_unrealized_loss_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'neg_unrealized_loss_rel_to_own_market_cap')) + self.net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) + self.net_unrealized_pnl_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_own_gross_pnl')) + self.net_unrealized_pnl_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_own_market_cap')) self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl')) - self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) - 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_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) - self.supply_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_rel_to_circulating_supply')) - self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) - 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_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) - 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 PriceRatioPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, acc) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) - self.ratio_1m_sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio_1m_sma')) - self.ratio_1w_sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio_1w_sma')) - self.ratio_1y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio_1y')) - self.ratio_2y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio_2y')) - self.ratio_4y_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio_4y')) - self.ratio_pct1: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio_pct1')) - self.ratio_pct1_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct1')) - self.ratio_pct2: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio_pct2')) - self.ratio_pct2_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct2')) - self.ratio_pct5: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio_pct5')) - self.ratio_pct5_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct5')) - self.ratio_pct95: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio_pct95')) - self.ratio_pct95_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct95')) - self.ratio_pct98: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio_pct98')) - self.ratio_pct98_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct98')) - self.ratio_pct99: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio_pct99')) - self.ratio_pct99_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'ratio_pct99')) - self.ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, _m(acc, 'ratio')) + self.supply_in_loss_rel_to_circulating_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) + self.supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_circulating_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) + self.supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.supply_rel_to_circulating_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_rel_to_circulating_supply')) + self.unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) + self.unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_own_gross_pnl')) + self.unrealized_loss_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_own_market_cap')) + self.unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) + self.unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_own_gross_pnl')) + self.unrealized_profit_rel_to_own_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap')) class Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern: """Pattern struct for repeated tree structure.""" @@ -2540,56 +2443,32 @@ class RatioPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, acc) - 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: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct1')) self.ratio_pct1_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct1')) - self.ratio_pct2: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct2')) + self.ratio_pct2: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct2')) self.ratio_pct2_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct2')) - self.ratio_pct5: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct5')) + self.ratio_pct5: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct5')) self.ratio_pct5_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct5')) - self.ratio_pct95: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct95')) + self.ratio_pct95: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct95')) self.ratio_pct95_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct95')) - self.ratio_pct98: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct98')) + self.ratio_pct98: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct98')) self.ratio_pct98_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct98')) - self.ratio_pct99: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct99')) + self.ratio_pct99: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'pct99')) self.ratio_pct99_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct99')) self.ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) + self.ratio_sd_1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) + self.ratio_sd_2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) + self.ratio_sd_4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) + self.ratio_sma_1m: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'sma_1m')) + self.ratio_sma_1w: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'sma_1w')) -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_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct1')) - self.ratio_pct2: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct2')) - self.ratio_pct2_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct2')) - self.ratio_pct5: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct5')) - self.ratio_pct5_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct5')) - self.ratio_pct95: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct95')) - self.ratio_pct95_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct95')) - self.ratio_pct98: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct98')) - self.ratio_pct98_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct98')) - self.ratio_pct99: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'pct99')) - self.ratio_pct99_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct99')) - self.ratio_sd: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdSmaZscorePattern(client, acc) - -class GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern: +class GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.greed_index: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'greed_index')) + self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_gross_pnl')) self.invested_capital_in_loss: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'invested_capital_in_loss')) self.invested_capital_in_loss_raw: MetricPattern18[CentsSats] = MetricPattern18(client, _m(acc, 'invested_capital_in_loss_raw')) self.invested_capital_in_profit: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'invested_capital_in_profit')) @@ -2602,84 +2481,62 @@ class GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern: self.pain_index: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'pain_index')) self.supply_in_loss: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'supply_in_loss')) self.supply_in_profit: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'supply_in_profit')) - self.total_unrealized_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'total_unrealized_pnl')) self.unrealized_loss: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_loss')) self.unrealized_profit: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_profit')) -class BlocksCoinbaseDaysDominanceFeeSubsidyPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.blocks_mined: CumulativeHeightSumPattern[StoredU32] = CumulativeHeightSumPattern(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')) - self.blocks_mined_24h_sum: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, 'blocks_mined_24h_sum')) - self.blocks_since_block: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, 'blocks_since_block')) - self.coinbase: BaseCumulativeSumPattern = BaseCumulativeSumPattern(client, _m(acc, 'coinbase')) - self.days_since_block: MetricPattern1[StoredU16] = MetricPattern1(client, _m(acc, 'days_since_block')) - self.dominance: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'dominance')) - self.dominance_1m: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'dominance_1m')) - 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: BaseCumulativeSumPattern = BaseCumulativeSumPattern(client, _m(acc, 'fee')) - self.subsidy: BaseCumulativeSumPattern = BaseCumulativeSumPattern(client, _m(acc, 'subsidy')) - -class _10y1m1w1y2y3m3y4y5y6m6y8yPattern3: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('10y', acc)) - self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('1m', acc)) - self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('1w', acc)) - self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('1y', acc)) - self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('2y', acc)) - self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('3m', acc)) - self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('3y', acc)) - self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('4y', acc)) - self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('5y', acc)) - self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('6m', acc)) - self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('6y', acc)) - self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _p('8y', acc)) - class _10y1m1w1y2y3m3y4y5y6m6y8yPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._10y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('10y', acc)) - self._1m: MetricPattern1[StoredF32] = MetricPattern1(client, _p('1m', acc)) - self._1w: MetricPattern1[StoredF32] = MetricPattern1(client, _p('1w', acc)) - self._1y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('1y', acc)) - self._2y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('2y', acc)) - self._3m: MetricPattern1[StoredF32] = MetricPattern1(client, _p('3m', acc)) - self._3y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('3y', acc)) - self._4y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('4y', acc)) - self._5y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('5y', acc)) - self._6m: MetricPattern1[StoredF32] = MetricPattern1(client, _p('6m', acc)) - self._6y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('6y', acc)) - self._8y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('8y', acc)) + self._10y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '10y')) + self._1m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1m')) + self._1w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1w')) + self._1y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1y')) + self._2y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '2y')) + self._3m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '3m')) + self._3y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '3y')) + self._4y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '4y')) + self._5y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '5y')) + self._6m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '6m')) + self._6y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '6y')) + self._8y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '8y')) + +class _10y1m1w1y2y3m3y4y5y6m6y8yPattern3: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10y')) + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1m')) + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1w')) + self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1y')) + self._2y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '2y')) + self._3m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '3m')) + self._3y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '3y')) + self._4y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '4y')) + self._5y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '5y')) + self._6m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '6m')) + self._6y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '6y')) + self._8y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '8y')) class InvestedNegNetNuplSupplyUnrealizedPattern: """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_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) - self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) + self.invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_loss_rel_to_realized_cap')) + self.invested_capital_in_profit_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'invested_capital_in_profit_rel_to_realized_cap')) + self.neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap')) + self.net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap')) self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl')) - self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) - 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_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) - self.supply_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_rel_to_circulating_supply')) - 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')) + self.supply_in_loss_rel_to_circulating_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply')) + self.supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_loss_rel_to_own_supply')) + self.supply_in_profit_rel_to_circulating_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply')) + self.supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_in_profit_rel_to_own_supply')) + self.supply_rel_to_circulating_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_rel_to_circulating_supply')) + self.unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_market_cap')) + self.unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_profit_rel_to_market_cap')) class AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern: """Pattern struct for repeated tree structure.""" @@ -2703,33 +2560,33 @@ class AverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'average')) + self.average: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'average')) self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'cumulative')) self.height: MetricPattern18[StoredU64] = MetricPattern18(client, acc) - 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.pct10: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p10')) - self.pct25: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p25')) - self.pct75: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p75')) - self.pct90: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p90')) - self.sum: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'sum')) + self.max: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'max')) + self.median: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'median')) + self.min: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'min')) + self.pct10: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p10')) + self.pct25: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p25')) + self.pct75: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p75')) + self.pct90: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p90')) + self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'sum')) class AverageGainsLossesRsiStochPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average_gain: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'avg_gain_1y')) - 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: 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')) + self.average_gain: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'average_gain_24h')) + self.average_loss: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'average_loss_24h')) + self.gains: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'gains_24h')) + self.losses: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'losses_24h')) + self.rsi: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '24h')) + self.rsi_max: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'max_24h')) + self.rsi_min: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'min_24h')) + self.stoch_rsi: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'stoch_24h')) + self.stoch_rsi_d: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'stoch_d_24h')) + self.stoch_rsi_k: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'stoch_k_24h')) class ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern: """Pattern struct for repeated tree structure.""" @@ -2738,28 +2595,28 @@ class ActivityAddrCostOutputsRealizedRelativeSupplyUnrealizedPattern: """Create pattern node with accumulated metric name.""" self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc) self.addr_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'addr_count')) - self.addr_count_30d_change: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'addr_count_30d_change')) - self.cost_basis: MaxMinPattern = MaxMinPattern(client, acc) + self.addr_count_change_1m: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'addr_count_change_1m')) + self.cost_basis: MaxMinPattern = MaxMinPattern(client, _m(acc, 'cost_basis')) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc) + self.realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern = CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc) self.relative: InvestedNegNetNuplSupplyUnrealizedPattern = InvestedNegNetNuplSupplyUnrealizedPattern(client, acc) - self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) - self.unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc) + self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) + self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc) class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.all: _30dCountPattern = _30dCountPattern(client, acc) - self.p2a: _30dCountPattern = _30dCountPattern(client, _p('p2a', acc)) - self.p2pk33: _30dCountPattern = _30dCountPattern(client, _p('p2pk33', acc)) - self.p2pk65: _30dCountPattern = _30dCountPattern(client, _p('p2pk65', acc)) - self.p2pkh: _30dCountPattern = _30dCountPattern(client, _p('p2pkh', acc)) - self.p2sh: _30dCountPattern = _30dCountPattern(client, _p('p2sh', acc)) - self.p2tr: _30dCountPattern = _30dCountPattern(client, _p('p2tr', acc)) - self.p2wpkh: _30dCountPattern = _30dCountPattern(client, _p('p2wpkh', acc)) - self.p2wsh: _30dCountPattern = _30dCountPattern(client, _p('p2wsh', acc)) + self.all: ChangeCountPattern = ChangeCountPattern(client, acc) + self.p2a: ChangeCountPattern = ChangeCountPattern(client, _p('p2a', acc)) + self.p2pk33: ChangeCountPattern = ChangeCountPattern(client, _p('p2pk33', acc)) + self.p2pk65: ChangeCountPattern = ChangeCountPattern(client, _p('p2pk65', acc)) + self.p2pkh: ChangeCountPattern = ChangeCountPattern(client, _p('p2pkh', acc)) + self.p2sh: ChangeCountPattern = ChangeCountPattern(client, _p('p2sh', acc)) + self.p2tr: ChangeCountPattern = ChangeCountPattern(client, _p('p2tr', acc)) + self.p2wpkh: ChangeCountPattern = ChangeCountPattern(client, _p('p2wpkh', acc)) + self.p2wsh: ChangeCountPattern = ChangeCountPattern(client, _p('p2wsh', acc)) class AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2: """Pattern struct for repeated tree structure.""" @@ -2781,45 +2638,59 @@ class AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - 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.pct10: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p10')) - self.pct25: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p25')) - self.pct75: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p75')) - self.pct90: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'p90')) - self.sum: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, _m(acc, 'sum')) + self.average: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'average')) + self.max: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'max')) + self.median: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'median')) + self.min: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'min')) + self.pct10: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p10')) + self.pct25: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p25')) + self.pct75: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p75')) + self.pct90: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'p90')) + self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'sum')) class AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.average: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'average')) + self.average: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'average')) self.height: MetricPattern18[T] = MetricPattern18(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.pct10: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'p10')) - self.pct25: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'p25')) - self.pct75: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'p75')) - self.pct90: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, _m(acc, 'p90')) + self.max: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'max')) + self.median: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'median')) + self.min: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'min')) + self.pct10: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'p10')) + self.pct25: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'p25')) + self.pct75: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'p75')) + self.pct90: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'p90')) -class _1y24h30d7dBtcCentsSatsUsdPattern: +class _1m1w1y24hBtcCentsSatsUsdPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1m')) + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1w')) self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1y')) self._24h: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '24h')) - self._30d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '30d')) - self._7d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '7d')) self.btc: MetricPattern18[Bitcoin] = MetricPattern18(client, _m(acc, 'btc')) self.cents: MetricPattern18[Cents] = MetricPattern18(client, _m(acc, 'cents')) self.sats: MetricPattern18[Sats] = MetricPattern18(client, acc) self.usd: MetricPattern18[Dollars] = MetricPattern18(client, _m(acc, 'usd')) +class BlocksCoinbaseDominanceFeeSubsidyPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.blocks_mined: CumulativeHeightSumPattern[StoredU32] = CumulativeHeightSumPattern(client, _m(acc, 'blocks_mined')) + self.blocks_mined_sum: _1m1w1y24hPattern[StoredU32] = _1m1w1y24hPattern(client, _m(acc, 'blocks_mined_sum')) + self.blocks_since_last_mined: MetricPattern1[StoredU32] = MetricPattern1(client, _m(acc, 'blocks_since_last_mined')) + self.coinbase: BaseCumulativeSumPattern = BaseCumulativeSumPattern(client, _m(acc, 'coinbase')) + self.dominance: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'dominance')) + self.dominance_rolling: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, _m(acc, 'dominance')) + self.fee: BaseCumulativeSumPattern = BaseCumulativeSumPattern(client, _m(acc, 'fee')) + self.subsidy: BaseCumulativeSumPattern = BaseCumulativeSumPattern(client, _m(acc, 'subsidy')) + class AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2839,13 +2710,13 @@ class _10y2y3y4y5y6y8yPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._10y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('10y', acc)) - self._2y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('2y', acc)) - self._3y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('3y', acc)) - self._4y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('4y', acc)) - self._5y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('5y', acc)) - self._6y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('6y', acc)) - self._8y: MetricPattern1[StoredF32] = MetricPattern1(client, _p('8y', acc)) + self._10y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '10y')) + self._2y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '2y')) + self._3y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '3y')) + self._4y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '4y')) + self._5y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '5y')) + self._6y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '6y')) + self._8y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '8y')) class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern: """Pattern struct for repeated tree structure.""" @@ -2855,10 +2726,10 @@ class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern: self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, acc) self.cost_basis: InvestedMaxMinPercentilesSpotPattern = InvestedMaxMinPercentilesSpotPattern(client, acc) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 = CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc) + self.realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 = CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc) self.relative: InvestedNegNetNuplSupplyUnrealizedPattern2 = InvestedNegNetNuplSupplyUnrealizedPattern2(client, acc) - self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) - self.unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc) + self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) + self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc) class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4: """Pattern struct for repeated tree structure.""" @@ -2866,12 +2737,12 @@ class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern4: 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.cost_basis: MaxMinPattern = MaxMinPattern(client, _m(acc, 'cost_basis')) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2 = AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern2(client, acc) + self.realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2 = AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern2(client, acc) self.relative: InvestedNegNetNuplSupplyUnrealizedPattern = InvestedNegNetNuplSupplyUnrealizedPattern(client, acc) - self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) - self.unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc) + self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) + self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc) class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3: """Pattern struct for repeated tree structure.""" @@ -2879,22 +2750,22 @@ class ActivityCostOutputsRealizedRelativeSupplyUnrealizedPattern3: 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.cost_basis: MaxMinPattern = MaxMinPattern(client, _m(acc, 'cost_basis')) self.outputs: UtxoPattern = UtxoPattern(client, _m(acc, 'utxo_count')) - self.realized: CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = CapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, acc) + self.realized: CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern = CapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, acc) self.relative: InvestedNegNetNuplSupplyUnrealizedPattern = InvestedNegNetNuplSupplyUnrealizedPattern(client, acc) - self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, acc) - self.unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, acc) + self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, _m(acc, 'supply')) + self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, acc) -class _1y24h30d7dBaseCumulativePattern: +class _1m1w1y24hBaseCumulativePattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" + self._1m: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 = AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '1m')) + self._1w: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 = AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '1w')) self._1y: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 = AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '1y')) self._24h: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 = AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '24h')) - self._30d: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 = AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '30d')) - self._7d: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2 = AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern2(client, _m(acc, '7d')) self.base: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')) @@ -2920,7 +2791,7 @@ class CoinblocksCoindaysSatblocksSatdaysSentPattern: self.satblocks_destroyed: MetricPattern18[Sats] = MetricPattern18(client, _m(acc, 'satblocks_destroyed')) self.satdays_destroyed: MetricPattern18[Sats] = MetricPattern18(client, _m(acc, 'satdays_destroyed')) self.sent: BaseCumulativePattern = BaseCumulativePattern(client, _m(acc, 'sent')) - self.sent_14d_ema: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sent_14d_ema')) + self.sent_ema: _2wPattern = _2wPattern(client, _m(acc, 'sent_ema_2w')) class InvestedMaxMinPercentilesSpotPattern: """Pattern struct for repeated tree structure.""" @@ -2928,32 +2799,42 @@ class InvestedMaxMinPercentilesSpotPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.invested_capital: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'invested_capital')) - self.max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'max_cost_basis')) - self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'min_cost_basis')) + self.max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'cost_basis_max')) + self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'cost_basis_min')) self.percentiles: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis')) - 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')) + self.spot_cost_basis_percentile: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'spot_cost_basis_percentile')) + self.spot_invested_capital_percentile: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'spot_invested_capital_percentile')) class EmaHistogramLineSignalPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.ema_fast: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ema_fast_1y')) - self.ema_slow: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ema_slow_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')) + self.ema_fast: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ema_fast_24h')) + self.ema_slow: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ema_slow_24h')) + self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'histogram_24h')) + self.line: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'line_24h')) + self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'signal_24h')) -class _1y24h30d7dPattern2: +class _1m1w1y24hPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" + self._1m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1m')) + self._1w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1w')) + self._1y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1y')) + self._24h: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '24h')) + +class _1m1w1y24hPattern5: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1m')) + self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1w')) self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1y')) self._24h: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '24h')) - self._30d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '30d')) - self._7d: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '7d')) class BtcCentsSatsUsdPattern: """Pattern struct for repeated tree structure.""" @@ -2965,24 +2846,15 @@ class BtcCentsSatsUsdPattern: self.sats: MetricPattern1[Sats] = MetricPattern1(client, acc) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) -class _1y24h30d7dPattern(Generic[T]): +class _1m1w1y24hPattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" + self._1m: MetricPattern1[T] = MetricPattern1(client, _m(acc, '1m')) + self._1w: MetricPattern1[T] = MetricPattern1(client, _m(acc, '1w')) 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.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._30d_change: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '_30d_change')) - self.halved: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'supply_halved')) - self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'supply')) class BaseCumulativeSumPattern: """Pattern struct for repeated tree structure.""" @@ -2991,7 +2863,25 @@ class BaseCumulativeSumPattern: """Create pattern node with accumulated metric name.""" self.base: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')) - self.sum: _1y24h30d7dPattern2 = _1y24h30d7dPattern2(client, _m(acc, 'sum')) + self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'sum')) + +class BpsPercentRatioPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bps: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[BasisPoints16] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, _m(acc, 'bps')) + self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) + +class BpsPercentRatioPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bps: MetricPattern1[BasisPoints16] = MetricPattern1(client, _m(acc, 'bps')) + self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) class CentsSatsUsdPattern2: """Pattern struct for repeated tree structure.""" @@ -3011,6 +2901,15 @@ class CentsSatsUsdPattern: self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, _m(acc, 'sats')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) +class ChangeHalvedTotalPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.change_1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'change_1m')) + self.halved: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'halved')) + self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) + class _6bBlockTxindexPattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -3027,15 +2926,23 @@ class CumulativeHeightSumPattern(Generic[T]): """Create pattern node with accumulated metric name.""" self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) self.height: MetricPattern18[T] = MetricPattern18(client, acc) - self.sum: _1y24h30d7dPattern[T] = _1y24h30d7dPattern(client, acc) + self.sum: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, acc) -class _30dCountPattern: +class _1m1wPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._30d_change: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, '30d_change')) - self.count: MetricPattern1[StoredU64] = MetricPattern1(client, acc) + self._1m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1m')) + self._1w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1w')) + +class _1m1wPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._1m: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, '1m')) + self._1w: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, '1w')) class BaseCumulativePattern: """Pattern struct for repeated tree structure.""" @@ -3045,6 +2952,14 @@ class BaseCumulativePattern: self.base: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')) +class BpsRatioPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, _m(acc, 'bps')) + self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + class CentsUsdPattern: """Pattern struct for repeated tree structure.""" @@ -3053,21 +2968,29 @@ class CentsUsdPattern: self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) +class ChangeCountPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.change_1m: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'change_1m')) + self.count: MetricPattern1[StoredU64] = MetricPattern1(client, acc) + class MaxMinPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'max_cost_basis')) - self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'min_cost_basis')) + self.max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'max')) + self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'min')) class SdSmaPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sd')) - self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sma')) + self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sd_1y')) + self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'sma_1y')) class UtxoPattern: """Pattern struct for repeated tree structure.""" @@ -3075,7 +2998,7 @@ class UtxoPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, acc) - self.utxo_count_30d_change: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, '30d_change')) + self.utxo_count_change_1m: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'change_1m')) class CumulativeHeightPattern(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -3085,12 +3008,12 @@ class CumulativeHeightPattern(Generic[T]): self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) self.height: MetricPattern18[T] = MetricPattern18(client, acc) -class RatioPattern2: +class _2wPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + self._2w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) # Metrics tree classes @@ -3100,7 +3023,7 @@ class MetricsTree_Blocks_Difficulty: def __init__(self, client: BrkClientBase, base_path: str = ''): self.raw: MetricPattern1[StoredF64] = MetricPattern1(client, 'difficulty') self.as_hash: MetricPattern1[StoredF64] = MetricPattern1(client, 'difficulty_as_hash') - self.adjustment: MetricPattern1[StoredF32] = MetricPattern1(client, 'difficulty_adjustment') + self.adjustment: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'difficulty_adjustment') self.epoch: MetricPattern1[DifficultyEpoch] = MetricPattern1(client, 'difficulty_epoch') 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') @@ -3119,15 +3042,15 @@ class MetricsTree_Blocks_Weight: def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: MetricPattern18[Weight] = MetricPattern18(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.pct10: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_p10') - self.pct25: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_p25') - self.median: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_median') - self.pct75: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_p75') - self.pct90: _1y24h30d7dPattern[Weight] = _1y24h30d7dPattern(client, 'block_weight_p90') + self.sum: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_sum') + self.average: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_average') + self.min: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_min') + self.max: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_max') + self.pct10: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_p10') + self.pct25: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_p25') + self.median: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_median') + self.pct75: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_p75') + self.pct90: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_p90') class MetricsTree_Blocks_Count: """Metrics tree node.""" @@ -3135,7 +3058,7 @@ class MetricsTree_Blocks_Count: def __init__(self, client: BrkClientBase, base_path: str = ''): self.block_count_target: MetricPattern1[StoredU64] = MetricPattern1(client, 'block_count_target') self.block_count: CumulativeHeightSumPattern[StoredU32] = CumulativeHeightSumPattern(client, 'block_count') - self.block_count_sum: _1y24h30d7dPattern[StoredU32] = _1y24h30d7dPattern(client, 'block_count_sum') + self.block_count_sum: _1m1w1y24hPattern[StoredU32] = _1m1w1y24hPattern(client, 'block_count_sum') self.height_1h_ago: MetricPattern18[Height] = MetricPattern18(client, 'height_1h_ago') self.height_24h_ago: MetricPattern18[Height] = MetricPattern18(client, 'height_24h_ago') self.height_3d_ago: MetricPattern18[Height] = MetricPattern18(client, 'height_3d_ago') @@ -3193,15 +3116,15 @@ class MetricsTree_Blocks_Size: def __init__(self, client: BrkClientBase, base_path: str = ''): self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, 'block_size_cumulative') - self.sum: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, 'block_size_sum') - self.average: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, 'block_size_average') - self.min: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, 'block_size_min') - self.max: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, 'block_size_max') - self.pct10: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, 'block_size_p10') - self.pct25: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, 'block_size_p25') - self.median: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, 'block_size_median') - self.pct75: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, 'block_size_p75') - self.pct90: _1y24h30d7dPattern[StoredU64] = _1y24h30d7dPattern(client, 'block_size_p90') + self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_sum') + self.average: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_average') + self.min: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_min') + self.max: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_max') + self.pct10: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_p10') + self.pct25: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_p25') + self.median: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_median') + self.pct75: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_p75') + self.pct90: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_p90') class MetricsTree_Blocks: """Metrics tree node.""" @@ -3217,7 +3140,7 @@ class MetricsTree_Blocks: self.halving: MetricsTree_Blocks_Halving = MetricsTree_Blocks_Halving(client) self.vbytes: AverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern = AverageCumulativeHeightMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'block_vbytes') self.size: MetricsTree_Blocks_Size = MetricsTree_Blocks_Size(client) - self.fullness: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'block_fullness') + self.fullness: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'block_fullness') class MetricsTree_Transactions_Count: """Metrics tree node.""" @@ -3254,8 +3177,8 @@ class MetricsTree_Transactions_Volume: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sent_sum: _1y24h30d7dBtcCentsSatsUsdPattern = _1y24h30d7dBtcCentsSatsUsdPattern(client, 'sent_sum') - self.received_sum: _1y24h30d7dBtcCentsSatsUsdPattern = _1y24h30d7dBtcCentsSatsUsdPattern(client, 'received_sum') + self.sent_sum: _1m1w1y24hBtcCentsSatsUsdPattern = _1m1w1y24hBtcCentsSatsUsdPattern(client, 'sent_sum') + self.received_sum: _1m1w1y24hBtcCentsSatsUsdPattern = _1m1w1y24hBtcCentsSatsUsdPattern(client, 'received_sum') self.annualized_volume: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(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') @@ -3368,14 +3291,14 @@ class MetricsTree_Scripts_Value: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.opreturn: _1y24h30d7dBaseCumulativePattern = _1y24h30d7dBaseCumulativePattern(client, 'opreturn_value') + self.opreturn: _1m1w1y24hBaseCumulativePattern = _1m1w1y24hBaseCumulativePattern(client, 'opreturn_value') class MetricsTree_Scripts_Adoption: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.taproot: MetricPattern1[StoredF32] = MetricPattern1(client, 'taproot_adoption') - self.segwit: MetricPattern1[StoredF32] = MetricPattern1(client, 'segwit_adoption') + self.taproot: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'taproot_adoption') + self.segwit: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'segwit_adoption') class MetricsTree_Scripts: """Metrics tree node.""" @@ -3397,43 +3320,37 @@ class MetricsTree_Mining_Rewards: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.coinbase: _1y24h30d7dBaseCumulativePattern = _1y24h30d7dBaseCumulativePattern(client, 'coinbase') - self.subsidy: _1y24h30d7dBaseCumulativePattern = _1y24h30d7dBaseCumulativePattern(client, 'subsidy') - self.fees: _1y24h30d7dBaseCumulativePattern = _1y24h30d7dBaseCumulativePattern(client, 'fees') + self.coinbase: _1m1w1y24hBaseCumulativePattern = _1m1w1y24hBaseCumulativePattern(client, 'coinbase') + self.subsidy: _1m1w1y24hBaseCumulativePattern = _1m1w1y24hBaseCumulativePattern(client, 'subsidy') + self.fees: _1m1w1y24hBaseCumulativePattern = _1m1w1y24hBaseCumulativePattern(client, 'fees') self.unclaimed_rewards: BaseCumulativeSumPattern = BaseCumulativeSumPattern(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') - self.fee_dominance_30d: MetricPattern1[StoredF32] = MetricPattern1(client, 'fee_dominance_30d') - self.fee_dominance_1y: MetricPattern1[StoredF32] = MetricPattern1(client, 'fee_dominance_1y') - self.subsidy_dominance: MetricPattern1[StoredF32] = MetricPattern1(client, 'subsidy_dominance') - self.subsidy_dominance_24h: MetricPattern1[StoredF32] = MetricPattern1(client, 'subsidy_dominance_24h') - self.subsidy_dominance_7d: MetricPattern1[StoredF32] = MetricPattern1(client, 'subsidy_dominance_7d') - self.subsidy_dominance_30d: MetricPattern1[StoredF32] = MetricPattern1(client, 'subsidy_dominance_30d') - self.subsidy_dominance_1y: MetricPattern1[StoredF32] = MetricPattern1(client, 'subsidy_dominance_1y') - self.subsidy_usd_1y_sma: CentsUsdPattern = CentsUsdPattern(client, 'subsidy_usd_1y_sma') + self.fee_dominance: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'fee_dominance') + self.fee_dominance_rolling: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, 'fee_dominance') + self.subsidy_dominance: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'subsidy_dominance') + self.subsidy_dominance_rolling: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, 'subsidy_dominance') + self.subsidy_sma_1y: CentsUsdPattern = CentsUsdPattern(client, 'subsidy_sma_1y') class MetricsTree_Mining_Hashrate: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.hash_rate: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate') - self.hash_rate_1w_sma: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_1w_sma') - self.hash_rate_1m_sma: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_1m_sma') - self.hash_rate_2m_sma: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_2m_sma') - self.hash_rate_1y_sma: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_1y_sma') + self.hash_rate_sma_1w: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_sma_1w') + self.hash_rate_sma_1m: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_sma_1m') + self.hash_rate_sma_2m: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_sma_2m') + self.hash_rate_sma_1y: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_sma_1y') self.hash_rate_ath: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_ath') - self.hash_rate_drawdown: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_rate_drawdown') + self.hash_rate_drawdown: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'hash_rate_drawdown') self.hash_price_ths: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_ths') self.hash_price_ths_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_ths_min') self.hash_price_phs: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_phs') self.hash_price_phs_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_phs_min') - self.hash_price_rebound: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_price_rebound') + self.hash_price_rebound: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'hash_price_rebound') self.hash_value_ths: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_ths') self.hash_value_ths_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_ths_min') self.hash_value_phs: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_phs') self.hash_value_phs_min: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_phs_min') - self.hash_value_rebound: MetricPattern1[StoredF32] = MetricPattern1(client, 'hash_value_rebound') + self.hash_value_rebound: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'hash_value_rebound') class MetricsTree_Mining: """Metrics tree node.""" @@ -3490,27 +3407,27 @@ class MetricsTree_Cointime_Pricing: def __init__(self, client: BrkClientBase, base_path: str = ''): self.vaulted_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'vaulted_price') - self.vaulted_price_ratio: RatioPattern = RatioPattern(client, 'vaulted_price_ratio') + self.vaulted_price_ratio: BpsRatioPattern2 = BpsRatioPattern2(client, 'vaulted_price_ratio') self.active_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'active_price') - self.active_price_ratio: RatioPattern = RatioPattern(client, 'active_price_ratio') + self.active_price_ratio: BpsRatioPattern2 = BpsRatioPattern2(client, 'active_price_ratio') self.true_market_mean: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'true_market_mean') - self.true_market_mean_ratio: RatioPattern = RatioPattern(client, 'true_market_mean_ratio') + self.true_market_mean_ratio: BpsRatioPattern2 = BpsRatioPattern2(client, 'true_market_mean_ratio') self.cointime_price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'cointime_price') - self.cointime_price_ratio: RatioPattern = RatioPattern(client, 'cointime_price_ratio') + self.cointime_price_ratio: BpsRatioPattern2 = BpsRatioPattern2(client, 'cointime_price_ratio') class MetricsTree_Cointime_Adjusted: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.cointime_adj_inflation_rate: MetricPattern1[StoredF32] = MetricPattern1(client, 'cointime_adj_inflation_rate') - self.cointime_adj_tx_btc_velocity: MetricPattern1[StoredF64] = MetricPattern1(client, 'cointime_adj_tx_btc_velocity') - self.cointime_adj_tx_usd_velocity: MetricPattern1[StoredF64] = MetricPattern1(client, 'cointime_adj_tx_usd_velocity') + self.cointime_adj_inflation_rate: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'cointime_adj_inflation_rate') + self.cointime_adj_tx_velocity_btc: MetricPattern1[StoredF64] = MetricPattern1(client, 'cointime_adj_tx_velocity_btc') + self.cointime_adj_tx_velocity_usd: MetricPattern1[StoredF64] = MetricPattern1(client, 'cointime_adj_tx_velocity_usd') class MetricsTree_Cointime_ReserveRisk: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.vocdd_365d_median: MetricPattern18[StoredF64] = MetricPattern18(client, 'vocdd_365d_median') + self.vocdd_median_1y: MetricPattern18[StoredF64] = MetricPattern18(client, 'vocdd_median_1y') self.hodl_bank: MetricPattern18[StoredF64] = MetricPattern18(client, 'hodl_bank') self.reserve_risk: MetricPattern1[StoredF64] = MetricPattern1(client, 'reserve_risk') @@ -3824,199 +3741,227 @@ class MetricsTree_Market_Ath: def __init__(self, client: BrkClientBase, base_path: str = ''): self.price_ath: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_ath') - self.price_drawdown: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_drawdown') + self.price_drawdown: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_drawdown') self.days_since_price_ath: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_since_price_ath') self.years_since_price_ath: MetricPattern2[StoredF32] = MetricPattern2(client, 'years_since_price_ath') - self.max_days_between_price_aths: MetricPattern1[StoredF32] = MetricPattern1(client, 'max_days_between_price_aths') - self.max_years_between_price_aths: MetricPattern2[StoredF32] = MetricPattern2(client, 'max_years_between_price_aths') + self.max_days_between_price_ath: MetricPattern1[StoredF32] = MetricPattern1(client, 'max_days_between_price_ath') + self.max_years_between_price_ath: MetricPattern2[StoredF32] = MetricPattern2(client, 'max_years_between_price_ath') class MetricsTree_Market_Lookback: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._24h: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_24h_ago') - self._1w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_1w_ago') - self._1m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_1m_ago') - self._3m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_3m_ago') - self._6m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_6m_ago') - self._1y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_1y_ago') - self._2y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_2y_ago') - self._3y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_3y_ago') - self._4y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_4y_ago') - self._5y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_5y_ago') - self._6y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_6y_ago') - self._8y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_8y_ago') - self._10y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_10y_ago') + self._24h: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_24h') + self._1w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_1w') + self._1m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_1m') + self._3m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_3m') + self._6m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_6m') + self._1y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_1y') + self._2y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_2y') + self._3y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_3y') + self._4y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_4y') + self._5y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_5y') + self._6y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_6y') + self._8y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_8y') + self._10y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_10y') -class MetricsTree_Market_Returns_PriceReturns: +class MetricsTree_Market_Returns_PriceReturn: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._24h: MetricPattern1[StoredF32] = MetricPattern1(client, '24h_price_returns') - self._1w: MetricPattern1[StoredF32] = MetricPattern1(client, '1w_price_returns') - self._1m: MetricPattern1[StoredF32] = MetricPattern1(client, '1m_price_returns') - self._3m: MetricPattern1[StoredF32] = MetricPattern1(client, '3m_price_returns') - self._6m: MetricPattern1[StoredF32] = MetricPattern1(client, '6m_price_returns') - self._1y: MetricPattern1[StoredF32] = MetricPattern1(client, '1y_price_returns') - self._2y: MetricPattern1[StoredF32] = MetricPattern1(client, '2y_price_returns') - self._3y: MetricPattern1[StoredF32] = MetricPattern1(client, '3y_price_returns') - self._4y: MetricPattern1[StoredF32] = MetricPattern1(client, '4y_price_returns') - self._5y: MetricPattern1[StoredF32] = MetricPattern1(client, '5y_price_returns') - self._6y: MetricPattern1[StoredF32] = MetricPattern1(client, '6y_price_returns') - self._8y: MetricPattern1[StoredF32] = MetricPattern1(client, '8y_price_returns') - self._10y: MetricPattern1[StoredF32] = MetricPattern1(client, '10y_price_returns') + self._24h: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_24h') + self._1w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_1w') + self._1m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_1m') + self._3m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_3m') + self._6m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_6m') + self._1y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_1y') + self._2y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_2y') + self._3y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_3y') + self._4y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_4y') + self._5y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_5y') + self._6y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_6y') + self._8y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_8y') + self._10y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_10y') + +class MetricsTree_Market_Returns_PriceReturn24hSd1w: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sma_1w') + self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sd_1w') + +class MetricsTree_Market_Returns_PriceReturn24hSd1m: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sma_1m') + self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sd_1m') + +class MetricsTree_Market_Returns_PriceDownside24hSd1w: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_downside_24h_sma_1w') + self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_downside_24h_sd_1w') + +class MetricsTree_Market_Returns_PriceDownside24hSd1m: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_downside_24h_sma_1m') + self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_downside_24h_sd_1m') class MetricsTree_Market_Returns: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.price_returns: MetricsTree_Market_Returns_PriceReturns = MetricsTree_Market_Returns_PriceReturns(client) - self.cagr: _10y2y3y4y5y6y8yPattern = _10y2y3y4y5y6y8yPattern(client, 'cagr') - self._1d_returns_1w_sd: SdSmaPattern = SdSmaPattern(client, '1d_returns_1w_sd') - self._1d_returns_1m_sd: SdSmaPattern = SdSmaPattern(client, '1d_returns_1m_sd') - self._1d_returns_1y_sd: SdSmaPattern = SdSmaPattern(client, '1d_returns_1y_sd') - self.downside_returns: MetricPattern18[StoredF32] = MetricPattern18(client, 'downside_returns') - self.downside_1w_sd: SdSmaPattern = SdSmaPattern(client, 'downside_1w_sd') - self.downside_1m_sd: SdSmaPattern = SdSmaPattern(client, 'downside_1m_sd') - self.downside_1y_sd: SdSmaPattern = SdSmaPattern(client, 'downside_1y_sd') + self.price_return: MetricsTree_Market_Returns_PriceReturn = MetricsTree_Market_Returns_PriceReturn(client) + self.price_cagr: _10y2y3y4y5y6y8yPattern = _10y2y3y4y5y6y8yPattern(client, 'price_cagr') + self.price_return_24h_sd_1w: MetricsTree_Market_Returns_PriceReturn24hSd1w = MetricsTree_Market_Returns_PriceReturn24hSd1w(client) + self.price_return_24h_sd_1m: MetricsTree_Market_Returns_PriceReturn24hSd1m = MetricsTree_Market_Returns_PriceReturn24hSd1m(client) + self.price_return_24h_sd_1y: SdSmaPattern = SdSmaPattern(client, 'price_return_24h') + self.price_downside_24h: MetricPattern18[StoredF32] = MetricPattern18(client, 'price_downside_24h') + self.price_downside_24h_sd_1w: MetricsTree_Market_Returns_PriceDownside24hSd1w = MetricsTree_Market_Returns_PriceDownside24hSd1w(client) + self.price_downside_24h_sd_1m: MetricsTree_Market_Returns_PriceDownside24hSd1m = MetricsTree_Market_Returns_PriceDownside24hSd1m(client) + self.price_downside_24h_sd_1y: SdSmaPattern = SdSmaPattern(client, 'price_downside_24h') class MetricsTree_Market_Volatility: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - 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: 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') + self.price_volatility_1w: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_volatility_1w') + self.price_volatility_1m: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_volatility_1m') + self.price_volatility_1y: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_volatility_1y') + self.price_sharpe_1w: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_sharpe_1w') + self.price_sharpe_1m: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_sharpe_1m') + self.price_sharpe_1y: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_sharpe_1y') + self.price_sortino_1w: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_sortino_1w') + self.price_sortino_1m: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_sortino_1m') + self.price_sortino_1y: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_sortino_1y') class MetricsTree_Market_Range: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.price_1w_min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_1w_min') - self.price_1w_max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_1w_max') - self.price_2w_min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_2w_min') - self.price_2w_max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_2w_max') - self.price_1m_min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_1m_min') - self.price_1m_max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_1m_max') - self.price_1y_min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_1y_min') - self.price_1y_max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_1y_max') + self.price_min_1w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_min_1w') + self.price_max_1w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_max_1w') + self.price_min_2w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_min_2w') + self.price_max_2w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_max_2w') + self.price_min_1m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_min_1m') + self.price_max_1m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_max_1m') + self.price_min_1y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_min_1y') + self.price_max_1y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_max_1y') self.price_true_range: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_true_range') - self.price_true_range_2w_sum: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_true_range_2w_sum') - self.price_2w_choppiness_index: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_2w_choppiness_index') + self.price_true_range_sum_2w: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_true_range_sum_2w') + self.price_choppiness_index_2w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_choppiness_index_2w') class MetricsTree_Market_MovingAverage: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.price_1w_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_1w_sma') - self.price_8d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_8d_sma') - self.price_13d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_13d_sma') - self.price_21d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_21d_sma') - self.price_1m_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_1m_sma') - self.price_34d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_34d_sma') - self.price_55d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_55d_sma') - self.price_89d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_89d_sma') - self.price_111d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_111d_sma') - self.price_144d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_144d_sma') - self.price_200d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_200d_sma') - self.price_350d_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_350d_sma') - self.price_1y_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_1y_sma') - self.price_2y_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_2y_sma') - self.price_200w_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_200w_sma') - self.price_4y_sma: PriceRatioPattern = PriceRatioPattern(client, 'price_4y_sma') - self.price_1w_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_1w_ema') - self.price_8d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_8d_ema') - self.price_12d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_12d_ema') - self.price_13d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_13d_ema') - self.price_21d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_21d_ema') - self.price_26d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_26d_ema') - self.price_1m_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_1m_ema') - self.price_34d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_34d_ema') - self.price_55d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_55d_ema') - self.price_89d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_89d_ema') - self.price_144d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_144d_ema') - self.price_200d_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_200d_ema') - self.price_1y_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_1y_ema') - self.price_2y_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_2y_ema') - self.price_200w_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_200w_ema') - self.price_4y_ema: PriceRatioPattern = PriceRatioPattern(client, 'price_4y_ema') - self.price_200d_sma_x2_4: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_200d_sma_x2_4') - self.price_200d_sma_x0_8: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_200d_sma_x0_8') - self.price_350d_sma_x2: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_350d_sma_x2') + self.price_sma_1w: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_1w') + self.price_sma_8d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_8d') + self.price_sma_13d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_13d') + self.price_sma_21d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_21d') + self.price_sma_1m: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_1m') + self.price_sma_34d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_34d') + self.price_sma_55d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_55d') + self.price_sma_89d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_89d') + self.price_sma_111d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_111d') + self.price_sma_144d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_144d') + self.price_sma_200d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_200d') + self.price_sma_350d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_350d') + self.price_sma_1y: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_1y') + self.price_sma_2y: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_2y') + self.price_sma_200w: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_200w') + self.price_sma_4y: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_sma_4y') + self.price_ema_1w: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_1w') + self.price_ema_8d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_8d') + self.price_ema_12d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_12d') + self.price_ema_13d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_13d') + self.price_ema_21d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_21d') + self.price_ema_26d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_26d') + self.price_ema_1m: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_1m') + self.price_ema_34d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_34d') + self.price_ema_55d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_55d') + self.price_ema_89d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_89d') + self.price_ema_144d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_144d') + self.price_ema_200d: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_200d') + self.price_ema_1y: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_1y') + self.price_ema_2y: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_2y') + self.price_ema_200w: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_200w') + self.price_ema_4y: BpsPriceRatioPattern = BpsPriceRatioPattern(client, 'price_ema_4y') + self.price_sma_200d_x2_4: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_sma_200d_x2_4') + self.price_sma_200d_x0_8: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_sma_200d_x0_8') + self.price_sma_350d_x2: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_sma_350d_x2') -class MetricsTree_Market_Dca_PeriodAveragePrice: +class MetricsTree_Market_Dca_PeriodCostBasis: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '1w_dca_average_price') - self._1m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '1m_dca_average_price') - self._3m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '3m_dca_average_price') - self._6m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '6m_dca_average_price') - self._1y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '1y_dca_average_price') - self._2y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '2y_dca_average_price') - self._3y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '3y_dca_average_price') - self._4y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '4y_dca_average_price') - self._5y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '5y_dca_average_price') - self._6y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '6y_dca_average_price') - self._8y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '8y_dca_average_price') - self._10y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, '10y_dca_average_price') + self._1w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_1w') + self._1m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_1m') + self._3m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_3m') + self._6m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_6m') + self._1y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_1y') + self._2y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_2y') + self._3y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_3y') + self._4y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_4y') + self._5y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_5y') + self._6y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_6y') + self._8y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_8y') + self._10y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_10y') class MetricsTree_Market_Dca_ClassStack: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._2015: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2015_stack') - self._2016: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2016_stack') - self._2017: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2017_stack') - self._2018: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2018_stack') - self._2019: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2019_stack') - self._2020: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2020_stack') - self._2021: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2021_stack') - self._2022: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2022_stack') - self._2023: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2023_stack') - self._2024: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2024_stack') - self._2025: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2025_stack') - self._2026: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_class_2026_stack') + self.from_2015: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2015') + self.from_2016: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2016') + self.from_2017: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2017') + self.from_2018: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2018') + self.from_2019: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2019') + self.from_2020: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2020') + self.from_2021: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2021') + self.from_2022: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2022') + self.from_2023: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2023') + self.from_2024: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2024') + self.from_2025: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2025') + self.from_2026: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2026') -class MetricsTree_Market_Dca_ClassAveragePrice: +class MetricsTree_Market_Dca_ClassCostBasis: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._2015: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2015_average_price') - self._2016: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2016_average_price') - self._2017: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2017_average_price') - self._2018: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2018_average_price') - self._2019: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2019_average_price') - self._2020: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2020_average_price') - self._2021: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2021_average_price') - self._2022: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2022_average_price') - self._2023: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2023_average_price') - self._2024: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2024_average_price') - self._2025: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2025_average_price') - self._2026: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_class_2026_average_price') + self.from_2015: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2015') + self.from_2016: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2016') + self.from_2017: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2017') + self.from_2018: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2018') + self.from_2019: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2019') + self.from_2020: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2020') + self.from_2021: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2021') + self.from_2022: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2022') + self.from_2023: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2023') + self.from_2024: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2024') + self.from_2025: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2025') + self.from_2026: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2026') -class MetricsTree_Market_Dca_ClassReturns: +class MetricsTree_Market_Dca_ClassReturn: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._2015: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2015_returns') - self._2016: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2016_returns') - self._2017: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2017_returns') - self._2018: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2018_returns') - self._2019: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2019_returns') - self._2020: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2020_returns') - self._2021: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2021_returns') - self._2022: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2022_returns') - self._2023: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2023_returns') - self._2024: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2024_returns') - self._2025: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2025_returns') - self._2026: MetricPattern1[StoredF32] = MetricPattern1(client, 'dca_class_2026_returns') + self.from_2015: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2015') + self.from_2016: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2016') + self.from_2017: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2017') + self.from_2018: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2018') + self.from_2019: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2019') + self.from_2020: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2020') + self.from_2021: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2021') + self.from_2022: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2022') + self.from_2023: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2023') + self.from_2024: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2024') + self.from_2025: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2025') + self.from_2026: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2026') class MetricsTree_Market_Dca: """Metrics tree node.""" @@ -4024,29 +3969,14 @@ class MetricsTree_Market_Dca: def __init__(self, client: BrkClientBase, base_path: str = ''): self.dca_sats_per_day: MetricPattern18[Sats] = MetricPattern18(client, 'dca_sats_per_day') self.period_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, 'dca_stack') - self.period_average_price: MetricsTree_Market_Dca_PeriodAveragePrice = MetricsTree_Market_Dca_PeriodAveragePrice(client) - self.period_returns: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, 'dca_returns') + self.period_cost_basis: MetricsTree_Market_Dca_PeriodCostBasis = MetricsTree_Market_Dca_PeriodCostBasis(client) + self.period_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, 'dca_return') self.period_cagr: _10y2y3y4y5y6y8yPattern = _10y2y3y4y5y6y8yPattern(client, 'dca_cagr') self.period_lump_sum_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, 'lump_sum_stack') - self.period_lump_sum_returns: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, 'lump_sum_returns') + self.period_lump_sum_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, 'lump_sum_return') self.class_stack: MetricsTree_Market_Dca_ClassStack = MetricsTree_Market_Dca_ClassStack(client) - self.class_average_price: MetricsTree_Market_Dca_ClassAveragePrice = MetricsTree_Market_Dca_ClassAveragePrice(client) - self.class_returns: MetricsTree_Market_Dca_ClassReturns = MetricsTree_Market_Dca_ClassReturns(client) - -class MetricsTree_Market_Indicators_Rsi_1d: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.gains: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_gains_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: 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') - self.stoch_rsi_k: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_stoch_rsi_k_1d') - self.stoch_rsi_d: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_stoch_rsi_d_1d') + self.class_cost_basis: MetricsTree_Market_Dca_ClassCostBasis = MetricsTree_Market_Dca_ClassCostBasis(client) + self.class_return: MetricsTree_Market_Dca_ClassReturn = MetricsTree_Market_Dca_ClassReturn(client) class MetricsTree_Market_Indicators_Rsi_1w: """Metrics tree node.""" @@ -4054,14 +3984,14 @@ class MetricsTree_Market_Indicators_Rsi_1w: def __init__(self, client: BrkClientBase, base_path: str = ''): self.gains: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_gains_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: 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') - self.stoch_rsi_k: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_stoch_rsi_k_1w') - self.stoch_rsi_d: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_stoch_rsi_d_1w') + self.average_gain: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_average_gain_1w') + self.average_loss: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_average_loss_1w') + self.rsi: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_1w') + self.rsi_min: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_min_1w') + self.rsi_max: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_max_1w') + self.stoch_rsi: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_stoch_1w') + self.stoch_rsi_k: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_stoch_k_1w') + self.stoch_rsi_d: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_stoch_d_1w') class MetricsTree_Market_Indicators_Rsi_1m: """Metrics tree node.""" @@ -4069,33 +3999,38 @@ class MetricsTree_Market_Indicators_Rsi_1m: def __init__(self, client: BrkClientBase, base_path: str = ''): self.gains: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_gains_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: 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') - self.stoch_rsi_k: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_stoch_rsi_k_1m') - self.stoch_rsi_d: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_stoch_rsi_d_1m') + self.average_gain: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_average_gain_1m') + self.average_loss: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_average_loss_1m') + self.rsi: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_1m') + self.rsi_min: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_min_1m') + self.rsi_max: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_max_1m') + self.stoch_rsi: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_stoch_1m') + self.stoch_rsi_k: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_stoch_k_1m') + self.stoch_rsi_d: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_stoch_d_1m') + +class MetricsTree_Market_Indicators_Rsi_1y: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.gains: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_gains_1y') + self.losses: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_losses_1y') + self.average_gain: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_average_gain_1y') + self.average_loss: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_average_loss_1y') + self.rsi: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_1y') + self.rsi_min: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_min_1y') + self.rsi_max: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_max_1y') + self.stoch_rsi: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_stoch_1y') + self.stoch_rsi_k: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_stoch_k_1y') + self.stoch_rsi_d: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'rsi_stoch_d_1y') class MetricsTree_Market_Indicators_Rsi: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1d: MetricsTree_Market_Indicators_Rsi_1d = MetricsTree_Market_Indicators_Rsi_1d(client) + self._24h: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi') self._1w: MetricsTree_Market_Indicators_Rsi_1w = MetricsTree_Market_Indicators_Rsi_1w(client) self._1m: MetricsTree_Market_Indicators_Rsi_1m = MetricsTree_Market_Indicators_Rsi_1m(client) - self._1y: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi') - -class MetricsTree_Market_Indicators_Macd_1d: - """Metrics tree node.""" - - def __init__(self, client: BrkClientBase, base_path: str = ''): - self.ema_fast: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_fast_1d') - self.ema_slow: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_slow_1d') - self.line: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_line_1d') - self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_1d') - self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_1d') + self._1y: MetricsTree_Market_Indicators_Rsi_1y = MetricsTree_Market_Indicators_Rsi_1y(client) class MetricsTree_Market_Indicators_Macd_1w: """Metrics tree node.""" @@ -4117,27 +4052,37 @@ class MetricsTree_Market_Indicators_Macd_1m: self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_1m') self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_1m') +class MetricsTree_Market_Indicators_Macd_1y: + """Metrics tree node.""" + + def __init__(self, client: BrkClientBase, base_path: str = ''): + self.ema_fast: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_fast_1y') + self.ema_slow: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_slow_1y') + self.line: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_line_1y') + self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_1y') + self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_1y') + class MetricsTree_Market_Indicators_Macd: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1d: MetricsTree_Market_Indicators_Macd_1d = MetricsTree_Market_Indicators_Macd_1d(client) + self._24h: EmaHistogramLineSignalPattern = EmaHistogramLineSignalPattern(client, 'macd') self._1w: MetricsTree_Market_Indicators_Macd_1w = MetricsTree_Market_Indicators_Macd_1w(client) self._1m: MetricsTree_Market_Indicators_Macd_1m = MetricsTree_Market_Indicators_Macd_1m(client) - self._1y: EmaHistogramLineSignalPattern = EmaHistogramLineSignalPattern(client, 'macd') + self._1y: MetricsTree_Market_Indicators_Macd_1y = MetricsTree_Market_Indicators_Macd_1y(client) class MetricsTree_Market_Indicators: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.puell_multiple: MetricPattern1[StoredF32] = MetricPattern1(client, 'puell_multiple') - self.nvt: MetricPattern1[StoredF32] = MetricPattern1(client, 'nvt') + self.puell_multiple: BpsRatioPattern = BpsRatioPattern(client, 'puell_multiple') + self.nvt: BpsRatioPattern = BpsRatioPattern(client, 'nvt') self.rsi: MetricsTree_Market_Indicators_Rsi = MetricsTree_Market_Indicators_Rsi(client) - self.stoch_k: MetricPattern1[StoredF32] = MetricPattern1(client, 'stoch_k') - self.stoch_d: MetricPattern1[StoredF32] = MetricPattern1(client, 'stoch_d') - self.pi_cycle: MetricPattern1[StoredF32] = MetricPattern1(client, 'pi_cycle') + self.stoch_k: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'stoch_k') + self.stoch_d: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'stoch_d') + self.pi_cycle: BpsRatioPattern = BpsRatioPattern(client, 'pi_cycle') self.macd: MetricsTree_Market_Indicators_Macd = MetricsTree_Market_Indicators_Macd(client) - self.gini: MetricPattern1[StoredF32] = MetricPattern1(client, 'gini') + self.gini: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'gini') class MetricsTree_Market: """Metrics tree node.""" @@ -4156,168 +4101,168 @@ class MetricsTree_Pools_Vecs: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.unknown: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'unknown') - self.blockfills: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'blockfills') - self.ultimuspool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'ultimuspool') - self.terrapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'terrapool') - self.luxor: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'luxor') - self.onethash: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'onethash') - self.btccom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btccom') - self.bitfarms: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitfarms') - self.huobipool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'huobipool') - self.wayicn: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'wayicn') - self.canoepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'canoepool') - self.btctop: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btctop') - self.bitcoincom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitcoincom') - self.pool175btc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'pool175btc') - self.gbminers: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'gbminers') - self.axbt: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'axbt') - self.asicminer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'asicminer') - self.bitminter: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitminter') - self.bitcoinrussia: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitcoinrussia') - self.btcserv: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btcserv') - self.simplecoinus: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'simplecoinus') - self.btcguild: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btcguild') - self.eligius: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'eligius') - self.ozcoin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'ozcoin') - self.eclipsemc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'eclipsemc') - self.maxbtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'maxbtc') - self.triplemining: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'triplemining') - self.coinlab: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'coinlab') - self.pool50btc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'pool50btc') - self.ghashio: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'ghashio') - self.stminingcorp: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'stminingcorp') - self.bitparking: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitparking') - self.mmpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'mmpool') - self.polmine: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'polmine') - self.kncminer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'kncminer') - self.bitalo: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitalo') - self.f2pool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'f2pool') - self.hhtt: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'hhtt') - self.megabigpower: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'megabigpower') - self.mtred: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'mtred') - self.nmcbit: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'nmcbit') - self.yourbtcnet: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'yourbtcnet') - self.givemecoins: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'givemecoins') - self.braiinspool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'braiinspool') - self.antpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'antpool') - self.multicoinco: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'multicoinco') - self.bcpoolio: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bcpoolio') - self.cointerra: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'cointerra') - self.kanopool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'kanopool') - self.solock: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'solock') - self.ckpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'ckpool') - self.nicehash: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'nicehash') - self.bitclub: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitclub') - self.bitcoinaffiliatenetwork: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitcoinaffiliatenetwork') - self.btcc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btcc') - self.bwpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bwpool') - self.exxbw: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'exxbw') - self.bitsolo: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitsolo') - self.bitfury: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitfury') - self.twentyoneinc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'twentyoneinc') - self.digitalbtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'digitalbtc') - self.eightbaochi: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'eightbaochi') - self.mybtccoinpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'mybtccoinpool') - self.tbdice: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'tbdice') - self.hashpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'hashpool') - self.nexious: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'nexious') - self.bravomining: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bravomining') - self.hotpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'hotpool') - self.okexpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'okexpool') - self.bcmonster: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bcmonster') - self.onehash: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'onehash') - self.bixin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bixin') - self.tatmaspool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'tatmaspool') - self.viabtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'viabtc') - self.connectbtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'connectbtc') - self.batpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'batpool') - self.waterhole: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'waterhole') - self.dcexploration: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'dcexploration') - self.dcex: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'dcex') - self.btpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btpool') - self.fiftyeightcoin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'fiftyeightcoin') - self.bitcoinindia: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitcoinindia') - self.shawnp0wers: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'shawnp0wers') - self.phashio: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'phashio') - self.rigpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'rigpool') - self.haozhuzhu: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'haozhuzhu') - self.sevenpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'sevenpool') - self.miningkings: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'miningkings') - self.hashbx: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'hashbx') - self.dpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'dpool') - self.rawpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'rawpool') - self.haominer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'haominer') - self.helix: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'helix') - self.bitcoinukraine: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitcoinukraine') - self.poolin: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'poolin') - self.secretsuperstar: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'secretsuperstar') - self.tigerpoolnet: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'tigerpoolnet') - self.sigmapoolcom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'sigmapoolcom') - self.okpooltop: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'okpooltop') - self.hummerpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'hummerpool') - self.tangpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'tangpool') - self.bytepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bytepool') - self.spiderpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'spiderpool') - self.novablock: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'novablock') - self.miningcity: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'miningcity') - self.binancepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'binancepool') - self.minerium: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'minerium') - self.lubiancom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'lubiancom') - self.okkong: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'okkong') - self.aaopool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'aaopool') - self.emcdpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'emcdpool') - self.foundryusa: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'foundryusa') - self.sbicrypto: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'sbicrypto') - self.arkpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'arkpool') - self.purebtccom: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'purebtccom') - self.marapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'marapool') - self.kucoinpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'kucoinpool') - self.entrustcharitypool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'entrustcharitypool') - self.okminer: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'okminer') - self.titan: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'titan') - self.pegapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'pegapool') - self.btcnuggets: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btcnuggets') - self.cloudhashing: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'cloudhashing') - self.digitalxmintsy: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'digitalxmintsy') - self.telco214: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'telco214') - self.btcpoolparty: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btcpoolparty') - self.multipool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'multipool') - self.transactioncoinmining: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'transactioncoinmining') - self.btcdig: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btcdig') - self.trickysbtcpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'trickysbtcpool') - self.btcmp: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btcmp') - self.eobot: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'eobot') - self.unomp: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'unomp') - self.patels: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'patels') - self.gogreenlight: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'gogreenlight') - self.bitcoinindiapool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitcoinindiapool') - self.ekanembtc: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'ekanembtc') - self.canoe: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'canoe') - self.tiger: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'tiger') - self.onem1x: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'onem1x') - self.zulupool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'zulupool') - self.secpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'secpool') - self.ocean: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'ocean') - self.whitepool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'whitepool') - self.wiz: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'wiz') - self.wk057: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'wk057') - self.futurebitapollosolo: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'futurebitapollosolo') - self.carbonnegative: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'carbonnegative') - self.portlandhodl: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'portlandhodl') - self.phoenix: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'phoenix') - self.neopool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'neopool') - self.maxipool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'maxipool') - self.bitfufupool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'bitfufupool') - self.gdpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'gdpool') - self.miningdutch: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'miningdutch') - self.publicpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'publicpool') - self.miningsquared: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'miningsquared') - self.innopolistech: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'innopolistech') - self.btclab: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'btclab') - self.parasite: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'parasite') - self.redrockpool: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'redrockpool') - self.est3lar: BlocksCoinbaseDaysDominanceFeeSubsidyPattern = BlocksCoinbaseDaysDominanceFeeSubsidyPattern(client, 'est3lar') + self.unknown: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'unknown') + self.blockfills: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'blockfills') + self.ultimuspool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'ultimuspool') + self.terrapool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'terrapool') + self.luxor: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'luxor') + self.onethash: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'onethash') + self.btccom: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btccom') + self.bitfarms: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitfarms') + self.huobipool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'huobipool') + self.wayicn: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'wayicn') + self.canoepool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'canoepool') + self.btctop: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btctop') + self.bitcoincom: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitcoincom') + self.pool175btc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'pool175btc') + self.gbminers: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'gbminers') + self.axbt: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'axbt') + self.asicminer: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'asicminer') + self.bitminter: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitminter') + self.bitcoinrussia: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitcoinrussia') + self.btcserv: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btcserv') + self.simplecoinus: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'simplecoinus') + self.btcguild: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btcguild') + self.eligius: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'eligius') + self.ozcoin: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'ozcoin') + self.eclipsemc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'eclipsemc') + self.maxbtc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'maxbtc') + self.triplemining: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'triplemining') + self.coinlab: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'coinlab') + self.pool50btc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'pool50btc') + self.ghashio: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'ghashio') + self.stminingcorp: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'stminingcorp') + self.bitparking: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitparking') + self.mmpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'mmpool') + self.polmine: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'polmine') + self.kncminer: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'kncminer') + self.bitalo: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitalo') + self.f2pool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'f2pool') + self.hhtt: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'hhtt') + self.megabigpower: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'megabigpower') + self.mtred: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'mtred') + self.nmcbit: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'nmcbit') + self.yourbtcnet: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'yourbtcnet') + self.givemecoins: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'givemecoins') + self.braiinspool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'braiinspool') + self.antpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'antpool') + self.multicoinco: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'multicoinco') + self.bcpoolio: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bcpoolio') + self.cointerra: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'cointerra') + self.kanopool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'kanopool') + self.solock: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'solock') + self.ckpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'ckpool') + self.nicehash: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'nicehash') + self.bitclub: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitclub') + self.bitcoinaffiliatenetwork: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitcoinaffiliatenetwork') + self.btcc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btcc') + self.bwpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bwpool') + self.exxbw: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'exxbw') + self.bitsolo: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitsolo') + self.bitfury: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitfury') + self.twentyoneinc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'twentyoneinc') + self.digitalbtc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'digitalbtc') + self.eightbaochi: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'eightbaochi') + self.mybtccoinpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'mybtccoinpool') + self.tbdice: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'tbdice') + self.hashpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'hashpool') + self.nexious: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'nexious') + self.bravomining: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bravomining') + self.hotpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'hotpool') + self.okexpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'okexpool') + self.bcmonster: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bcmonster') + self.onehash: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'onehash') + self.bixin: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bixin') + self.tatmaspool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'tatmaspool') + self.viabtc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'viabtc') + self.connectbtc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'connectbtc') + self.batpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'batpool') + self.waterhole: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'waterhole') + self.dcexploration: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'dcexploration') + self.dcex: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'dcex') + self.btpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btpool') + self.fiftyeightcoin: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'fiftyeightcoin') + self.bitcoinindia: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitcoinindia') + self.shawnp0wers: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'shawnp0wers') + self.phashio: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'phashio') + self.rigpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'rigpool') + self.haozhuzhu: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'haozhuzhu') + self.sevenpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'sevenpool') + self.miningkings: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'miningkings') + self.hashbx: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'hashbx') + self.dpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'dpool') + self.rawpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'rawpool') + self.haominer: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'haominer') + self.helix: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'helix') + self.bitcoinukraine: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitcoinukraine') + self.poolin: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'poolin') + self.secretsuperstar: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'secretsuperstar') + self.tigerpoolnet: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'tigerpoolnet') + self.sigmapoolcom: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'sigmapoolcom') + self.okpooltop: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'okpooltop') + self.hummerpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'hummerpool') + self.tangpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'tangpool') + self.bytepool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bytepool') + self.spiderpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'spiderpool') + self.novablock: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'novablock') + self.miningcity: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'miningcity') + self.binancepool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'binancepool') + self.minerium: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'minerium') + self.lubiancom: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'lubiancom') + self.okkong: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'okkong') + self.aaopool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'aaopool') + self.emcdpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'emcdpool') + self.foundryusa: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'foundryusa') + self.sbicrypto: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'sbicrypto') + self.arkpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'arkpool') + self.purebtccom: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'purebtccom') + self.marapool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'marapool') + self.kucoinpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'kucoinpool') + self.entrustcharitypool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'entrustcharitypool') + self.okminer: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'okminer') + self.titan: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'titan') + self.pegapool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'pegapool') + self.btcnuggets: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btcnuggets') + self.cloudhashing: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'cloudhashing') + self.digitalxmintsy: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'digitalxmintsy') + self.telco214: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'telco214') + self.btcpoolparty: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btcpoolparty') + self.multipool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'multipool') + self.transactioncoinmining: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'transactioncoinmining') + self.btcdig: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btcdig') + self.trickysbtcpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'trickysbtcpool') + self.btcmp: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btcmp') + self.eobot: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'eobot') + self.unomp: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'unomp') + self.patels: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'patels') + self.gogreenlight: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'gogreenlight') + self.bitcoinindiapool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitcoinindiapool') + self.ekanembtc: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'ekanembtc') + self.canoe: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'canoe') + self.tiger: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'tiger') + self.onem1x: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'onem1x') + self.zulupool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'zulupool') + self.secpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'secpool') + self.ocean: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'ocean') + self.whitepool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'whitepool') + self.wiz: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'wiz') + self.wk057: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'wk057') + self.futurebitapollosolo: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'futurebitapollosolo') + self.carbonnegative: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'carbonnegative') + self.portlandhodl: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'portlandhodl') + self.phoenix: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'phoenix') + self.neopool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'neopool') + self.maxipool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'maxipool') + self.bitfufupool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'bitfufupool') + self.gdpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'gdpool') + self.miningdutch: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'miningdutch') + self.publicpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'publicpool') + self.miningsquared: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'miningsquared') + self.innopolistech: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'innopolistech') + self.btclab: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'btclab') + self.parasite: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'parasite') + self.redrockpool: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'redrockpool') + self.est3lar: BlocksCoinbaseDominanceFeeSubsidyPattern = BlocksCoinbaseDominanceFeeSubsidyPattern(client, 'est3lar') class MetricsTree_Pools: """Metrics tree node.""" @@ -4391,42 +4336,42 @@ class MetricsTree_Distribution_UtxoCohorts_All_Relative: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, 'supply_in_profit_rel_to_own_supply') - self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, 'supply_in_loss_rel_to_own_supply') - self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, 'unrealized_profit_rel_to_market_cap') - self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, 'unrealized_loss_rel_to_market_cap') - 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.supply_in_profit_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'supply_in_profit_rel_to_own_supply') + self.supply_in_loss_rel_to_own_supply: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'supply_in_loss_rel_to_own_supply') + self.unrealized_profit_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_profit_rel_to_market_cap') + self.unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_loss_rel_to_market_cap') + self.neg_unrealized_loss_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'neg_unrealized_loss_rel_to_market_cap') + self.net_unrealized_pnl_rel_to_market_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'net_unrealized_pnl_rel_to_market_cap') self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, 'nupl') - self.invested_capital_in_profit_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_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'invested_capital_in_profit_rel_to_realized_cap') + self.invested_capital_in_loss_rel_to_realized_cap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'invested_capital_in_loss_rel_to_realized_cap') + self.unrealized_profit_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_profit_rel_to_own_gross_pnl') + self.unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_loss_rel_to_own_gross_pnl') + self.neg_unrealized_loss_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'neg_unrealized_loss_rel_to_own_gross_pnl') + self.net_unrealized_pnl_rel_to_own_gross_pnl: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'net_unrealized_pnl_rel_to_own_gross_pnl') class MetricsTree_Distribution_UtxoCohorts_All: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.supply: _30dHalvedTotalPattern = _30dHalvedTotalPattern(client, '') + self.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, 'supply') self.outputs: UtxoPattern = UtxoPattern(client, 'utxo_count') self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, '') - self.realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, '') + self.realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern = AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, '') self.cost_basis: InvestedMaxMinPercentilesSpotPattern = InvestedMaxMinPercentilesSpotPattern(client, '') - self.unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, '') + self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(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.supply: ChangeHalvedTotalPattern = ChangeHalvedTotalPattern(client, 'sth_supply') self.outputs: UtxoPattern = UtxoPattern(client, 'sth_utxo_count') self.activity: CoinblocksCoindaysSatblocksSatdaysSentPattern = CoinblocksCoindaysSatblocksSatdaysSentPattern(client, 'sth') - self.realized: AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern = AdjustedCapCapitulationInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprTotalUpperValuePattern(client, 'sth') + self.realized: AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern = AdjustedCapCapitulationGrossInvestorLossLowerMvrvNegNetPeakProfitRealizedSellSentSoprUpperValuePattern(client, 'sth') self.cost_basis: InvestedMaxMinPercentilesSpotPattern = InvestedMaxMinPercentilesSpotPattern(client, 'sth') - self.unrealized: GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern = GreedInvestedInvestorNegNetPainSupplyTotalUnrealizedPattern(client, 'sth') + self.unrealized: GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern = GreedGrossInvestedInvestorNegNetPainSupplyUnrealizedPattern(client, 'sth') self.relative: InvestedNegNetNuplSupplyUnrealizedPattern2 = InvestedNegNetNuplSupplyUnrealizedPattern2(client, 'sth') class MetricsTree_Distribution_UtxoCohorts_AgeRange: @@ -4733,15 +4678,15 @@ class MetricsTree_Distribution_GrowthRate: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.all: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'growth_rate') - self.p2pk65: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2pk65_growth_rate') - self.p2pk33: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2pk33_growth_rate') - self.p2pkh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2pkh_growth_rate') - self.p2sh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2sh_growth_rate') - self.p2wpkh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2wpkh_growth_rate') - self.p2wsh: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2wsh_growth_rate') - self.p2tr: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2tr_growth_rate') - self.p2a: AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern[StoredF32] = AverageHeightMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'p2a_growth_rate') + self.all: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'growth_rate') + self.p2pk65: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'p2pk65_growth_rate') + self.p2pk33: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'p2pk33_growth_rate') + self.p2pkh: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'p2pkh_growth_rate') + self.p2sh: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'p2sh_growth_rate') + self.p2wpkh: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'p2wpkh_growth_rate') + self.p2wsh: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'p2wsh_growth_rate') + self.p2tr: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'p2tr_growth_rate') + self.p2a: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'p2a_growth_rate') class MetricsTree_Distribution: """Metrics tree node.""" @@ -4772,8 +4717,8 @@ class MetricsTree_Supply_Velocity: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.btc: MetricPattern1[StoredF64] = MetricPattern1(client, 'btc_velocity') - self.usd: MetricPattern1[StoredF64] = MetricPattern1(client, 'usd_velocity') + self.btc: MetricPattern1[StoredF64] = MetricPattern1(client, 'velocity_btc') + self.usd: MetricPattern1[StoredF64] = MetricPattern1(client, 'velocity_usd') class MetricsTree_Supply: """Metrics tree node.""" @@ -4781,12 +4726,12 @@ class MetricsTree_Supply: def __init__(self, client: BrkClientBase, base_path: str = ''): self.circulating: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'circulating_supply') self.burned: MetricsTree_Supply_Burned = MetricsTree_Supply_Burned(client) - self.inflation: MetricPattern1[StoredF32] = MetricPattern1(client, 'inflation_rate') + self.inflation_rate: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'inflation_rate') self.velocity: MetricsTree_Supply_Velocity = MetricsTree_Supply_Velocity(client) self.market_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'market_cap') - self.market_cap_growth_rate: MetricPattern1[StoredF32] = MetricPattern1(client, 'market_cap_growth_rate') - self.realized_cap_growth_rate: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_cap_growth_rate') - self.cap_growth_rate_diff: MetricPattern1[StoredF32] = MetricPattern1(client, 'cap_growth_rate_diff') + self.market_cap_growth_rate: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'market_cap_growth_rate') + self.realized_cap_growth_rate: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'realized_cap_growth_rate') + self.market_minus_realized_cap_growth_rate: MetricPattern1[BasisPointsSigned32] = MetricPattern1(client, 'market_minus_realized_cap_growth_rate') class MetricsTree: """Metrics tree node."""