diff --git a/crates/brk_bindgen/src/analysis/patterns.rs b/crates/brk_bindgen/src/analysis/patterns.rs index 8d99cbfb0..0fc2ecbb5 100644 --- a/crates/brk_bindgen/src/analysis/patterns.rs +++ b/crates/brk_bindgen/src/analysis/patterns.rs @@ -329,11 +329,21 @@ fn resolve_branch_patterns( } /// Normalize fields for naming (same structure = same name). +/// Only erases leaf types when all leaves share the same type — this ensures +/// mixed-type signatures (e.g., StoredU32 raw + StoredU64 cumulative) get a +/// different name than same-type signatures that can be genericized. fn normalize_fields_for_naming(fields: &[PatternField]) -> Vec { + let leaf_types: Vec<&str> = fields + .iter() + .filter(|f| !f.is_branch()) + .map(|f| f.rust_type.as_str()) + .collect(); + let all_same = !leaf_types.is_empty() && leaf_types.iter().all(|t| *t == leaf_types[0]); + fields .iter() .map(|f| { - if f.is_branch() { + if f.is_branch() || !all_same { f.clone() } else { PatternField { diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index 689dcc3a5..8f147a326 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -1033,36 +1033,36 @@ impl _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern { /// Pattern struct for repeated tree structure. 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, + pub _10y: BpsPercentRatioPattern2, + pub _1m: BpsPercentRatioPattern2, + pub _1w: BpsPercentRatioPattern2, + pub _1y: BpsPercentRatioPattern2, + pub _2y: BpsPercentRatioPattern2, + pub _3m: BpsPercentRatioPattern2, + pub _3y: BpsPercentRatioPattern2, + pub _4y: BpsPercentRatioPattern2, + pub _5y: BpsPercentRatioPattern2, + pub _6m: BpsPercentRatioPattern2, + pub _6y: BpsPercentRatioPattern2, + pub _8y: BpsPercentRatioPattern2, } impl _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _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")), + _10y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "10y")), + _1m: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "1m")), + _1w: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "1w")), + _1y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "1y")), + _2y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "2y")), + _3m: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "3m")), + _3y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "3y")), + _4y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "4y")), + _5y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "5y")), + _6m: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "6m")), + _6y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "6y")), + _8y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "8y")), } } } @@ -1106,7 +1106,7 @@ impl _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 { /// Pattern struct for repeated tree structure. pub struct CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern { pub cap: CentsDeltaRelUsdPattern, - pub gross_pnl: CumulativeRawSumPattern2, + pub gross_pnl: CumulativeRawSumPattern3, pub investor: LowerPriceUpperPattern, pub loss: CapitulationCumulativeNegativeRawRelSumValuePattern, pub mvrv: MetricPattern1, @@ -1124,7 +1124,7 @@ impl CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern { pub fn new(client: Arc, acc: String) -> Self { Self { cap: CentsDeltaRelUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), - gross_pnl: CumulativeRawSumPattern2::new(client.clone(), _m(&acc, "realized_gross_pnl")), + gross_pnl: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "realized_gross_pnl")), investor: LowerPriceUpperPattern::new(client.clone(), acc.clone()), loss: CapitulationCumulativeNegativeRawRelSumValuePattern::new(client.clone(), acc.clone()), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), @@ -1213,12 +1213,12 @@ pub struct AverageGainsLossesRsiStochPattern { pub average_loss: MetricPattern1, pub gains: MetricPattern1, pub losses: 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, + pub rsi: BpsPercentRatioPattern4, + pub rsi_max: BpsPercentRatioPattern4, + pub rsi_min: BpsPercentRatioPattern4, + pub stoch_rsi: BpsPercentRatioPattern4, + pub stoch_rsi_d: BpsPercentRatioPattern4, + pub stoch_rsi_k: BpsPercentRatioPattern4, } impl AverageGainsLossesRsiStochPattern { @@ -1229,12 +1229,12 @@ impl AverageGainsLossesRsiStochPattern { 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")), + rsi: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "24h")), + rsi_max: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "max_24h")), + rsi_min: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "min_24h")), + stoch_rsi: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "stoch_24h")), + stoch_rsi_d: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "stoch_d_24h")), + stoch_rsi_k: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "stoch_k_24h")), } } } @@ -1358,11 +1358,11 @@ impl BpsCentsPercentilesRatioSatsSmaStdUsdPattern { /// Pattern struct for repeated tree structure. pub struct CapitulationCumulativeNegativeRawRelSumValuePattern { pub capitulation_flow: MetricPattern1, - pub cumulative: MetricPattern1, + pub cumulative: CentsUsdPattern2, pub negative: MetricPattern1, - pub raw: CentsUsdPattern, + pub raw: CentsUsdPattern2, pub rel_to_rcap: BpsPercentRatioPattern, - pub sum: _1m1w1y24hPattern3, + pub sum: _1m1w1y24hPattern5, pub value_created: CumulativeRawSumPattern, pub value_destroyed: CumulativeRawSumPattern, } @@ -1372,11 +1372,11 @@ impl CapitulationCumulativeNegativeRawRelSumValuePattern { pub fn new(client: Arc, acc: String) -> Self { Self { capitulation_flow: MetricPattern1::new(client.clone(), _m(&acc, "capitulation_flow")), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "realized_loss_cumulative")), + cumulative: CentsUsdPattern2::new(client.clone(), _m(&acc, "realized_loss_cumulative")), negative: MetricPattern1::new(client.clone(), _m(&acc, "neg_realized_loss")), - raw: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_loss")), + raw: CentsUsdPattern2::new(client.clone(), _m(&acc, "realized_loss")), rel_to_rcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_loss_rel_to_rcap")), - sum: _1m1w1y24hPattern3::new(client.clone(), _m(&acc, "realized_loss_sum")), + sum: _1m1w1y24hPattern5::new(client.clone(), _m(&acc, "realized_loss_sum")), value_created: CumulativeRawSumPattern::new(client.clone(), _m(&acc, "loss_value_created")), value_destroyed: CumulativeRawSumPattern::new(client.clone(), _m(&acc, "loss_value_destroyed")), } @@ -1413,36 +1413,36 @@ impl AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2 { /// Pattern struct for repeated tree structure. pub struct _10y2y3y4y5y6y8yPattern { - pub _10y: BpsPercentRatioPattern, - pub _2y: BpsPercentRatioPattern, - pub _3y: BpsPercentRatioPattern, - pub _4y: BpsPercentRatioPattern, - pub _5y: BpsPercentRatioPattern, - pub _6y: BpsPercentRatioPattern, - pub _8y: BpsPercentRatioPattern, + pub _10y: BpsPercentRatioPattern2, + pub _2y: BpsPercentRatioPattern2, + pub _3y: BpsPercentRatioPattern2, + pub _4y: BpsPercentRatioPattern2, + pub _5y: BpsPercentRatioPattern2, + pub _6y: BpsPercentRatioPattern2, + pub _8y: BpsPercentRatioPattern2, } impl _10y2y3y4y5y6y8yPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _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")), + _10y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "10y")), + _2y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "2y")), + _3y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "3y")), + _4y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "4y")), + _5y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "5y")), + _6y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "6y")), + _8y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "8y")), } } } /// Pattern struct for repeated tree structure. pub struct _1m1w1y24hBpsPercentRatioPattern { - pub _1m: BpsPercentRatioPattern, - pub _1w: BpsPercentRatioPattern, - pub _1y: BpsPercentRatioPattern, - pub _24h: BpsPercentRatioPattern, + pub _1m: BpsPercentRatioPattern4, + pub _1w: BpsPercentRatioPattern4, + pub _1y: BpsPercentRatioPattern4, + pub _24h: BpsPercentRatioPattern4, pub bps: MetricPattern1, pub percent: MetricPattern1, pub ratio: MetricPattern1, @@ -1452,10 +1452,10 @@ impl _1m1w1y24hBpsPercentRatioPattern { /// 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")), + _1m: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "1m")), + _1w: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "1w")), + _1y: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "1y")), + _24h: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "24h")), bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), percent: MetricPattern1::new(client.clone(), acc.clone()), ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), @@ -1468,9 +1468,9 @@ pub struct CapLossMvrvNetPriceProfitSoprPattern { pub cap: CentsDeltaUsdPattern, pub loss: CumulativeNegativeRawSumPattern, pub mvrv: MetricPattern1, - pub net_pnl: CumulativeRawSumPattern, + pub net_pnl: CumulativeDeltaRawSumPattern, pub price: BpsCentsRatioSatsUsdPattern, - pub profit: CumulativeRawSumPattern2, + pub profit: CumulativeRawSumPattern3, pub sopr: RatioValuePattern, } @@ -1481,9 +1481,9 @@ impl CapLossMvrvNetPriceProfitSoprPattern { cap: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), loss: CumulativeNegativeRawSumPattern::new(client.clone(), acc.clone()), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), - net_pnl: CumulativeRawSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), + net_pnl: CumulativeDeltaRawSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), price: BpsCentsRatioSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - profit: CumulativeRawSumPattern2::new(client.clone(), _m(&acc, "realized_profit")), + profit: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "realized_profit")), sopr: RatioValuePattern::new(client.clone(), acc.clone()), } } @@ -1491,11 +1491,11 @@ impl CapLossMvrvNetPriceProfitSoprPattern { /// Pattern struct for repeated tree structure. pub struct CumulativeDistributionRawRelSumValuePattern { - pub cumulative: MetricPattern1, + pub cumulative: CentsUsdPattern2, pub distribution_flow: MetricPattern1, - pub raw: CentsUsdPattern, + pub raw: CentsUsdPattern2, pub rel_to_rcap: BpsPercentRatioPattern, - pub sum: _1m1w1y24hPattern3, + pub sum: _1m1w1y24hPattern5, pub value_created: CumulativeRawSumPattern, pub value_destroyed: CumulativeRawSumPattern, } @@ -1504,11 +1504,11 @@ impl CumulativeDistributionRawRelSumValuePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "realized_profit_cumulative")), + cumulative: CentsUsdPattern2::new(client.clone(), _m(&acc, "realized_profit_cumulative")), distribution_flow: MetricPattern1::new(client.clone(), _m(&acc, "distribution_flow")), - raw: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_profit")), + raw: CentsUsdPattern2::new(client.clone(), _m(&acc, "realized_profit")), rel_to_rcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_profit_rel_to_rcap")), - sum: _1m1w1y24hPattern3::new(client.clone(), _m(&acc, "realized_profit_sum")), + sum: _1m1w1y24hPattern5::new(client.clone(), _m(&acc, "realized_profit_sum")), value_created: CumulativeRawSumPattern::new(client.clone(), _m(&acc, "profit_value_created")), value_destroyed: CumulativeRawSumPattern::new(client.clone(), _m(&acc, "profit_value_destroyed")), } @@ -1517,33 +1517,33 @@ impl CumulativeDistributionRawRelSumValuePattern { /// Pattern struct for repeated tree structure. pub struct CumulativeNegativeRawRelSumPattern2 { - pub cumulative: MetricPattern1, + pub cumulative: CentsUsdPattern2, pub negative: MetricPattern1, - pub raw: CentsUsdPattern, - pub rel_to_mcap: BpsPercentRatioPattern, - pub rel_to_own_gross: BpsPercentRatioPattern, + pub raw: CentsUsdPattern2, + pub rel_to_mcap: BpsPercentRatioPattern4, + pub rel_to_own_gross: BpsPercentRatioPattern4, pub rel_to_own_mcap: BpsPercentRatioPattern, - pub sum: _1m1w1y24hPattern3, + pub sum: _1m1w1y24hPattern5, } impl CumulativeNegativeRawRelSumPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_cumulative")), + cumulative: CentsUsdPattern2::new(client.clone(), _m(&acc, "unrealized_loss_cumulative")), negative: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")), - raw: CentsUsdPattern::new(client.clone(), _m(&acc, "unrealized_loss")), - rel_to_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_mcap")), - rel_to_own_gross: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_gross_pnl")), + raw: CentsUsdPattern2::new(client.clone(), _m(&acc, "unrealized_loss")), + rel_to_mcap: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_mcap")), + rel_to_own_gross: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_gross_pnl")), rel_to_own_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_mcap")), - sum: _1m1w1y24hPattern3::new(client.clone(), _m(&acc, "unrealized_loss_sum")), + sum: _1m1w1y24hPattern5::new(client.clone(), _m(&acc, "unrealized_loss_sum")), } } } /// Pattern struct for repeated tree structure. pub struct GrossInvestedLossNetNuplProfitSentimentPattern2 { - pub gross_pnl: CentsUsdPattern, + pub gross_pnl: CentsUsdPattern2, pub invested_capital: InPattern, pub loss: CumulativeNegativeRawRelSumPattern2, pub net_pnl: CentsRelUsdPattern2, @@ -1556,7 +1556,7 @@ impl GrossInvestedLossNetNuplProfitSentimentPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - gross_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "unrealized_gross_pnl")), + gross_pnl: CentsUsdPattern2::new(client.clone(), _m(&acc, "unrealized_gross_pnl")), invested_capital: InPattern::new(client.clone(), _m(&acc, "invested_capital_in")), loss: CumulativeNegativeRawRelSumPattern2::new(client.clone(), acc.clone()), net_pnl: CentsRelUsdPattern2::new(client.clone(), _m(&acc, "net_unrealized_pnl")), @@ -1569,24 +1569,24 @@ impl GrossInvestedLossNetNuplProfitSentimentPattern2 { /// Pattern struct for repeated tree structure. pub struct _1m1w1y2y4yAllPattern { - pub _1m: BpsRatioPattern, - pub _1w: BpsRatioPattern, - pub _1y: BpsRatioPattern, - pub _2y: BpsRatioPattern, - pub _4y: BpsRatioPattern, - pub all: BpsRatioPattern, + pub _1m: BpsRatioPattern2, + pub _1w: BpsRatioPattern2, + pub _1y: BpsRatioPattern2, + pub _2y: BpsRatioPattern2, + pub _4y: BpsRatioPattern2, + pub all: BpsRatioPattern2, } impl _1m1w1y2y4yAllPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _1m: BpsRatioPattern::new(client.clone(), _m(&acc, "1m")), - _1w: BpsRatioPattern::new(client.clone(), _m(&acc, "1w")), - _1y: BpsRatioPattern::new(client.clone(), _m(&acc, "1y")), - _2y: BpsRatioPattern::new(client.clone(), _m(&acc, "2y")), - _4y: BpsRatioPattern::new(client.clone(), _m(&acc, "4y")), - all: BpsRatioPattern::new(client.clone(), _m(&acc, "all")), + _1m: BpsRatioPattern2::new(client.clone(), _m(&acc, "1m")), + _1w: BpsRatioPattern2::new(client.clone(), _m(&acc, "1w")), + _1y: BpsRatioPattern2::new(client.clone(), _m(&acc, "1y")), + _2y: BpsRatioPattern2::new(client.clone(), _m(&acc, "2y")), + _4y: BpsRatioPattern2::new(client.clone(), _m(&acc, "4y")), + all: BpsRatioPattern2::new(client.clone(), _m(&acc, "all")), } } } @@ -1619,8 +1619,8 @@ impl BpsCentsPercentilesRatioSatsUsdPattern { pub struct BtcCentsRelSatsUsdPattern3 { pub btc: MetricPattern1, pub cents: MetricPattern1, - pub rel_to_circulating: BpsPercentRatioPattern, - pub rel_to_own: BpsPercentRatioPattern, + pub rel_to_circulating: BpsPercentRatioPattern4, + pub rel_to_own: BpsPercentRatioPattern4, pub sats: MetricPattern1, pub usd: MetricPattern1, } @@ -1631,8 +1631,8 @@ impl BtcCentsRelSatsUsdPattern3 { Self { btc: MetricPattern1::new(client.clone(), acc.clone()), cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - rel_to_circulating: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_circulating")), - rel_to_own: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_own")), + rel_to_circulating: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_circulating")), + rel_to_own: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_own")), sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), } @@ -1641,11 +1641,11 @@ impl BtcCentsRelSatsUsdPattern3 { /// Pattern struct for repeated tree structure. pub struct CapLossMvrvPriceProfitSoprPattern { - pub cap: CentsUsdPattern, - pub loss: CumulativeRawSumPattern2, + pub cap: CentsDeltaUsdPattern, + pub loss: CumulativeRawSumPattern3, pub mvrv: MetricPattern1, pub price: BpsCentsRatioSatsUsdPattern, - pub profit: CumulativeRawSumPattern2, + pub profit: CumulativeRawSumPattern3, pub sopr: ValuePattern, } @@ -1653,11 +1653,11 @@ impl CapLossMvrvPriceProfitSoprPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - cap: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), - loss: CumulativeRawSumPattern2::new(client.clone(), _m(&acc, "realized_loss")), + cap: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), + loss: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "realized_loss")), mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), price: BpsCentsRatioSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), - profit: CumulativeRawSumPattern2::new(client.clone(), _m(&acc, "realized_profit")), + profit: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "realized_profit")), sopr: ValuePattern::new(client.clone(), _m(&acc, "value")), } } @@ -1666,11 +1666,11 @@ impl CapLossMvrvPriceProfitSoprPattern { /// Pattern struct for repeated tree structure. pub struct ChangeCumulativeDeltaRawRelSumPattern { pub change_1m: RelPattern, - pub cumulative: MetricPattern1, - pub delta: ChangeRatePattern2, - pub raw: MetricPattern1, - pub rel_to_rcap: BpsPercentRatioPattern, - pub sum: _1m1w1y24hPattern, + pub cumulative: CentsUsdPattern, + pub delta: ChangeRatePattern3, + pub raw: CentsUsdPattern, + pub rel_to_rcap: BpsPercentRatioPattern2, + pub sum: _1m1w1y24hPattern4, } impl ChangeCumulativeDeltaRawRelSumPattern { @@ -1678,46 +1678,46 @@ impl ChangeCumulativeDeltaRawRelSumPattern { pub fn new(client: Arc, acc: String) -> Self { Self { change_1m: RelPattern::new(client.clone(), _m(&acc, "pnl_change_1m_rel_to")), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "realized_pnl_cumulative")), - delta: ChangeRatePattern2::new(client.clone(), _m(&acc, "pnl_delta")), - raw: MetricPattern1::new(client.clone(), _m(&acc, "realized_pnl")), - rel_to_rcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "realized_pnl_rel_to_rcap")), - sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "realized_pnl_sum")), + cumulative: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_pnl_cumulative")), + delta: ChangeRatePattern3::new(client.clone(), _m(&acc, "realized_pnl_delta")), + raw: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_pnl")), + rel_to_rcap: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "realized_pnl_rel_to_rcap")), + sum: _1m1w1y24hPattern4::new(client.clone(), _m(&acc, "realized_pnl_sum")), } } } /// Pattern struct for repeated tree structure. pub struct CumulativeRawRelSumPattern2 { - pub cumulative: MetricPattern1, - pub raw: CentsUsdPattern, - pub rel_to_mcap: BpsPercentRatioPattern, - pub rel_to_own_gross: BpsPercentRatioPattern, - pub rel_to_own_mcap: BpsPercentRatioPattern, - pub sum: _1m1w1y24hPattern3, + pub cumulative: CentsUsdPattern2, + pub raw: CentsUsdPattern2, + pub rel_to_mcap: BpsPercentRatioPattern4, + pub rel_to_own_gross: BpsPercentRatioPattern4, + pub rel_to_own_mcap: BpsPercentRatioPattern4, + pub sum: _1m1w1y24hPattern5, } impl CumulativeRawRelSumPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), - raw: CentsUsdPattern::new(client.clone(), acc.clone()), - rel_to_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_mcap")), - rel_to_own_gross: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_own_gross_pnl")), - rel_to_own_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_own_mcap")), - sum: _1m1w1y24hPattern3::new(client.clone(), _m(&acc, "sum")), + cumulative: CentsUsdPattern2::new(client.clone(), _m(&acc, "cumulative")), + raw: CentsUsdPattern2::new(client.clone(), acc.clone()), + rel_to_mcap: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_mcap")), + rel_to_own_gross: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_own_gross_pnl")), + rel_to_own_mcap: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_own_mcap")), + sum: _1m1w1y24hPattern5::new(client.clone(), _m(&acc, "sum")), } } } /// Pattern struct for repeated tree structure. pub struct DeltaHalfInRelTotalPattern { - pub delta: ChangeRatePattern, + pub delta: ChangeRatePattern2, pub half: BtcCentsSatsUsdPattern, pub in_loss: BtcCentsRelSatsUsdPattern, pub in_profit: BtcCentsRelSatsUsdPattern, - pub rel_to_circulating: BpsPercentRatioPattern, + pub rel_to_circulating: BpsPercentRatioPattern4, pub total: BtcCentsSatsUsdPattern, } @@ -1725,11 +1725,11 @@ impl DeltaHalfInRelTotalPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - delta: ChangeRatePattern::new(client.clone(), _m(&acc, "delta")), + delta: ChangeRatePattern2::new(client.clone(), _m(&acc, "delta")), half: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "half")), in_loss: BtcCentsRelSatsUsdPattern::new(client.clone(), _m(&acc, "in_loss")), in_profit: BtcCentsRelSatsUsdPattern::new(client.clone(), _m(&acc, "in_profit")), - rel_to_circulating: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_circulating")), + rel_to_circulating: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_circulating")), total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), } } @@ -1737,11 +1737,11 @@ impl DeltaHalfInRelTotalPattern { /// Pattern struct for repeated tree structure. pub struct DeltaHalfInRelTotalPattern2 { - pub delta: ChangeRatePattern, + pub delta: ChangeRatePattern2, pub half: BtcCentsSatsUsdPattern, pub in_loss: BtcCentsRelSatsUsdPattern3, pub in_profit: BtcCentsRelSatsUsdPattern3, - pub rel_to_circulating: BpsPercentRatioPattern, + pub rel_to_circulating: BpsPercentRatioPattern4, pub total: BtcCentsSatsUsdPattern, } @@ -1749,11 +1749,11 @@ impl DeltaHalfInRelTotalPattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - delta: ChangeRatePattern::new(client.clone(), _m(&acc, "delta")), + delta: ChangeRatePattern2::new(client.clone(), _m(&acc, "delta")), half: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "half")), in_loss: BtcCentsRelSatsUsdPattern3::new(client.clone(), _m(&acc, "in_loss")), in_profit: BtcCentsRelSatsUsdPattern3::new(client.clone(), _m(&acc, "in_profit")), - rel_to_circulating: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_circulating")), + rel_to_circulating: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_circulating")), total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), } } @@ -1786,7 +1786,7 @@ impl Pct1Pct2Pct5Pct95Pct98Pct99Pattern { /// Pattern struct for repeated tree structure. pub struct ActivityOutputsRealizedSupplyUnrealizedPattern { pub activity: CoindaysSentPattern, - pub outputs: UnspentPattern2, + pub outputs: UnspentPattern, pub realized: CapLossMvrvNetPriceProfitSoprPattern, pub supply: DeltaHalfInRelTotalPattern, pub unrealized: LossNetNuplProfitPattern, @@ -1797,7 +1797,7 @@ impl ActivityOutputsRealizedSupplyUnrealizedPattern { pub fn new(client: Arc, acc: String) -> Self { Self { activity: CoindaysSentPattern::new(client.clone(), acc.clone()), - outputs: UnspentPattern2::new(client.clone(), _m(&acc, "utxo_count")), + outputs: UnspentPattern::new(client.clone(), _m(&acc, "utxo_count")), realized: CapLossMvrvNetPriceProfitSoprPattern::new(client.clone(), acc.clone()), supply: DeltaHalfInRelTotalPattern::new(client.clone(), _m(&acc, "supply")), unrealized: LossNetNuplProfitPattern::new(client.clone(), acc.clone()), @@ -1810,7 +1810,7 @@ pub struct AddressOutputsRealizedSupplyUnrealizedPattern { pub address_count: DeltaInnerPattern, pub outputs: UnspentPattern, pub realized: CapLossMvrvPriceProfitSoprPattern, - pub supply: HalfTotalPattern, + pub supply: DeltaHalfTotalPattern, pub unrealized: NuplPattern, } @@ -1821,7 +1821,7 @@ impl AddressOutputsRealizedSupplyUnrealizedPattern { address_count: DeltaInnerPattern::new(client.clone(), _m(&acc, "address_count")), outputs: UnspentPattern::new(client.clone(), _m(&acc, "utxo_count")), realized: CapLossMvrvPriceProfitSoprPattern::new(client.clone(), acc.clone()), - supply: HalfTotalPattern::new(client.clone(), _m(&acc, "supply")), + supply: DeltaHalfTotalPattern::new(client.clone(), _m(&acc, "supply")), unrealized: NuplPattern::new(client.clone(), _m(&acc, "nupl")), } } @@ -1853,7 +1853,7 @@ impl BpsCentsRatioSatsUsdPattern { pub struct BtcCentsRelSatsUsdPattern { pub btc: MetricPattern1, pub cents: MetricPattern1, - pub rel_to_circulating: BpsPercentRatioPattern, + pub rel_to_circulating: BpsPercentRatioPattern4, pub sats: MetricPattern1, pub usd: MetricPattern1, } @@ -1864,7 +1864,7 @@ impl BtcCentsRelSatsUsdPattern { Self { btc: MetricPattern1::new(client.clone(), acc.clone()), cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - rel_to_circulating: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_circulating")), + rel_to_circulating: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_circulating")), sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), } @@ -1875,7 +1875,7 @@ impl BtcCentsRelSatsUsdPattern { pub struct BtcCentsRelSatsUsdPattern2 { pub btc: MetricPattern1, pub cents: MetricPattern1, - pub rel_to_own: BpsPercentRatioPattern, + pub rel_to_own: BpsPercentRatioPattern4, pub sats: MetricPattern1, pub usd: MetricPattern1, } @@ -1886,7 +1886,7 @@ impl BtcCentsRelSatsUsdPattern2 { Self { btc: MetricPattern1::new(client.clone(), acc.clone()), cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - rel_to_own: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_own")), + rel_to_own: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_own")), sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), } @@ -1918,8 +1918,8 @@ impl CoindaysCoinyearsDormancySentVelocityPattern { /// Pattern struct for repeated tree structure. pub struct CumulativeInRawSumPattern { pub cumulative: MetricPattern1, - pub in_loss: CumulativeRawSumPattern3, - pub in_profit: CumulativeRawSumPattern3, + pub in_loss: CumulativeRawSumPattern4, + pub in_profit: CumulativeRawSumPattern4, pub raw: MetricPattern1, pub sum: _1m1w1y24hPattern, } @@ -1929,14 +1929,36 @@ impl CumulativeInRawSumPattern { pub fn new(client: Arc, acc: String) -> Self { Self { cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), - in_loss: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "in_loss")), - in_profit: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "in_profit")), + in_loss: CumulativeRawSumPattern4::new(client.clone(), _m(&acc, "in_loss")), + in_profit: CumulativeRawSumPattern4::new(client.clone(), _m(&acc, "in_profit")), raw: MetricPattern1::new(client.clone(), acc.clone()), sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sum")), } } } +/// Pattern struct for repeated tree structure. +pub struct DeltaHalfInTotalPattern2 { + pub delta: ChangeRatePattern2, + pub half: BtcCentsSatsUsdPattern, + pub in_loss: BtcCentsSatsUsdPattern, + pub in_profit: BtcCentsSatsUsdPattern, + pub total: BtcCentsSatsUsdPattern, +} + +impl DeltaHalfInTotalPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + delta: ChangeRatePattern2::new(client.clone(), _m(&acc, "delta")), + half: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "half")), + in_loss: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "in_loss")), + in_profit: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "in_profit")), + total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), + } + } +} + /// Pattern struct for repeated tree structure. pub struct EmaHistogramLineSignalPattern { pub ema_fast: MetricPattern1, @@ -1965,7 +1987,7 @@ pub struct InvestedMaxMinPercentilesSupplyPattern { pub max: CentsSatsUsdPattern, pub min: CentsSatsUsdPattern, pub percentiles: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, - pub supply_density: BpsPercentRatioPattern, + pub supply_density: BpsPercentRatioPattern4, } impl InvestedMaxMinPercentilesSupplyPattern { @@ -1976,7 +1998,7 @@ impl InvestedMaxMinPercentilesSupplyPattern { 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")), - supply_density: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "supply_density")), + supply_density: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "supply_density")), } } } @@ -1985,7 +2007,7 @@ impl InvestedMaxMinPercentilesSupplyPattern { pub struct PhsReboundThsPattern { pub phs: MetricPattern1, pub phs_min: MetricPattern1, - pub rebound: BpsPercentRatioPattern, + pub rebound: BpsPercentRatioPattern2, pub ths: MetricPattern1, pub ths_min: MetricPattern1, } @@ -1996,7 +2018,7 @@ impl PhsReboundThsPattern { Self { phs: MetricPattern1::new(client.clone(), _m(&acc, "phs")), phs_min: MetricPattern1::new(client.clone(), _m(&acc, "phs_min")), - rebound: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rebound")), + rebound: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "rebound")), ths: MetricPattern1::new(client.clone(), _m(&acc, "ths")), ths_min: MetricPattern1::new(client.clone(), _m(&acc, "ths_min")), } @@ -2046,14 +2068,34 @@ impl _1m1w1y24hPattern2 { } /// Pattern struct for repeated tree structure. -pub struct _1m1w1y24hPattern4 { +pub struct _1m1w1y24hPattern3 { + pub _1m: BpsPercentRatioPattern2, + pub _1w: BpsPercentRatioPattern2, + pub _1y: BpsPercentRatioPattern2, + pub _24h: BpsPercentRatioPattern2, +} + +impl _1m1w1y24hPattern3 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _1m: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "1m_rate")), + _1w: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "1w_rate")), + _1y: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "1y_rate")), + _24h: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "24h_rate")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _1m1w1y24hPattern6 { pub _1m: BtcCentsSatsUsdPattern, pub _1w: BtcCentsSatsUsdPattern, pub _1y: BtcCentsSatsUsdPattern, pub _24h: BtcCentsSatsUsdPattern, } -impl _1m1w1y24hPattern4 { +impl _1m1w1y24hPattern6 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2086,21 +2128,41 @@ impl _1m1w1y2wPattern { } /// Pattern struct for repeated tree structure. -pub struct _1m1w1y24hPattern3 { +pub struct _1m1w1y24hPattern4 { pub _1m: CentsUsdPattern, pub _1w: CentsUsdPattern, pub _1y: CentsUsdPattern, pub _24h: CentsUsdPattern, } -impl _1m1w1y24hPattern3 { +impl _1m1w1y24hPattern4 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - _1m: CentsUsdPattern::new(client.clone(), _m(&acc, "1m")), - _1w: CentsUsdPattern::new(client.clone(), _m(&acc, "1w")), - _1y: CentsUsdPattern::new(client.clone(), _m(&acc, "1y")), - _24h: CentsUsdPattern::new(client.clone(), _m(&acc, "24h")), + _1m: CentsUsdPattern::new(client.clone(), _m(&acc, "1m_change")), + _1w: CentsUsdPattern::new(client.clone(), _m(&acc, "1w_change")), + _1y: CentsUsdPattern::new(client.clone(), _m(&acc, "1y_change")), + _24h: CentsUsdPattern::new(client.clone(), _m(&acc, "24h_change")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct _1m1w1y24hPattern5 { + pub _1m: CentsUsdPattern2, + pub _1w: CentsUsdPattern2, + pub _1y: CentsUsdPattern2, + pub _24h: CentsUsdPattern2, +} + +impl _1m1w1y24hPattern5 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + _1m: CentsUsdPattern2::new(client.clone(), _m(&acc, "1m")), + _1w: CentsUsdPattern2::new(client.clone(), _m(&acc, "1w")), + _1y: CentsUsdPattern2::new(client.clone(), _m(&acc, "1y")), + _24h: CentsUsdPattern2::new(client.clone(), _m(&acc, "24h")), } } } @@ -2188,7 +2250,7 @@ impl BtcCentsSatsUsdPattern { /// Pattern struct for repeated tree structure. pub struct CentsDeltaRelUsdPattern { pub cents: MetricPattern1, - pub delta: ChangeRatePattern2, + pub delta: ChangeRatePattern3, pub rel_to_own_mcap: BpsPercentRatioPattern, pub usd: MetricPattern1, } @@ -2198,7 +2260,7 @@ impl CentsDeltaRelUsdPattern { pub fn new(client: Arc, acc: String) -> Self { Self { cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - delta: ChangeRatePattern2::new(client.clone(), _m(&acc, "delta")), + delta: ChangeRatePattern3::new(client.clone(), _m(&acc, "delta")), rel_to_own_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_own_mcap")), usd: MetricPattern1::new(client.clone(), acc.clone()), } @@ -2208,8 +2270,8 @@ impl CentsDeltaRelUsdPattern { /// Pattern struct for repeated tree structure. pub struct CentsRelUsdPattern2 { pub cents: MetricPattern1, - pub rel_to_own_gross: BpsPercentRatioPattern, - pub rel_to_own_mcap: BpsPercentRatioPattern, + pub rel_to_own_gross: BpsPercentRatioPattern2, + pub rel_to_own_mcap: BpsPercentRatioPattern2, pub usd: MetricPattern1, } @@ -2218,49 +2280,49 @@ impl CentsRelUsdPattern2 { pub fn new(client: Arc, acc: String) -> Self { Self { cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - rel_to_own_gross: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_own_gross_pnl")), - rel_to_own_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_own_mcap")), + rel_to_own_gross: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "rel_to_own_gross_pnl")), + rel_to_own_mcap: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "rel_to_own_mcap")), usd: MetricPattern1::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. -pub struct CumulativeNegativeRawSumPattern { - pub cumulative: MetricPattern1, - pub negative: MetricPattern1, +pub struct CumulativeDeltaRawSumPattern { + pub cumulative: CentsUsdPattern, + pub delta: ChangeRatePattern3, pub raw: CentsUsdPattern, - pub sum: _1m1w1y24hPattern3, + pub sum: _1m1w1y24hPattern4, +} + +impl CumulativeDeltaRawSumPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + cumulative: CentsUsdPattern::new(client.clone(), _m(&acc, "cumulative")), + delta: ChangeRatePattern3::new(client.clone(), _m(&acc, "delta")), + raw: CentsUsdPattern::new(client.clone(), acc.clone()), + sum: _1m1w1y24hPattern4::new(client.clone(), _m(&acc, "sum")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct CumulativeNegativeRawSumPattern { + pub cumulative: CentsUsdPattern2, + pub negative: MetricPattern1, + pub raw: CentsUsdPattern2, + pub sum: _1m1w1y24hPattern5, } impl CumulativeNegativeRawSumPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_cumulative")), + cumulative: CentsUsdPattern2::new(client.clone(), _m(&acc, "unrealized_loss_cumulative")), negative: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")), - raw: CentsUsdPattern::new(client.clone(), _m(&acc, "unrealized_loss")), - sum: _1m1w1y24hPattern3::new(client.clone(), _m(&acc, "unrealized_loss_sum")), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct HalfInTotalPattern { - pub half: BtcCentsSatsUsdPattern, - pub in_loss: BtcCentsSatsUsdPattern, - pub in_profit: BtcCentsSatsUsdPattern, - pub total: BtcCentsSatsUsdPattern, -} - -impl HalfInTotalPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - half: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "half")), - in_loss: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "in_loss")), - in_profit: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "in_profit")), - total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), + raw: CentsUsdPattern2::new(client.clone(), _m(&acc, "unrealized_loss")), + sum: _1m1w1y24hPattern5::new(client.clone(), _m(&acc, "unrealized_loss_sum")), } } } @@ -2270,7 +2332,7 @@ pub struct LossNetNuplProfitPattern { pub loss: CumulativeNegativeRawSumPattern, pub net_pnl: CentsUsdPattern, pub nupl: BpsRatioPattern, - pub profit: CumulativeRawSumPattern2, + pub profit: CumulativeRawSumPattern3, } impl LossNetNuplProfitPattern { @@ -2280,7 +2342,7 @@ impl LossNetNuplProfitPattern { loss: CumulativeNegativeRawSumPattern::new(client.clone(), acc.clone()), net_pnl: CentsUsdPattern::new(client.clone(), _m(&acc, "net_unrealized_pnl")), nupl: BpsRatioPattern::new(client.clone(), _m(&acc, "nupl")), - profit: CumulativeRawSumPattern2::new(client.clone(), _m(&acc, "unrealized_profit")), + profit: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "unrealized_profit")), } } } @@ -2289,7 +2351,7 @@ impl LossNetNuplProfitPattern { pub struct OutputsRealizedSupplyUnrealizedPattern2 { pub outputs: UnspentPattern, pub realized: CapLossMvrvPriceProfitSoprPattern, - pub supply: HalfInTotalPattern, + pub supply: DeltaHalfInTotalPattern2, pub unrealized: LossNuplProfitPattern, } @@ -2299,7 +2361,7 @@ impl OutputsRealizedSupplyUnrealizedPattern2 { Self { outputs: UnspentPattern::new(client.clone(), _m(&acc, "utxo_count")), realized: CapLossMvrvPriceProfitSoprPattern::new(client.clone(), acc.clone()), - supply: HalfInTotalPattern::new(client.clone(), _m(&acc, "supply")), + supply: DeltaHalfInTotalPattern2::new(client.clone(), _m(&acc, "supply")), unrealized: LossNuplProfitPattern::new(client.clone(), acc.clone()), } } @@ -2309,7 +2371,7 @@ impl OutputsRealizedSupplyUnrealizedPattern2 { pub struct OutputsRealizedSupplyUnrealizedPattern { pub outputs: UnspentPattern, pub realized: CapLossMvrvPriceProfitSoprPattern, - pub supply: HalfTotalPattern, + pub supply: DeltaHalfTotalPattern, pub unrealized: NuplPattern, } @@ -2319,7 +2381,7 @@ impl OutputsRealizedSupplyUnrealizedPattern { Self { outputs: UnspentPattern::new(client.clone(), _m(&acc, "utxo_count")), realized: CapLossMvrvPriceProfitSoprPattern::new(client.clone(), acc.clone()), - supply: HalfTotalPattern::new(client.clone(), _m(&acc, "supply")), + supply: DeltaHalfTotalPattern::new(client.clone(), _m(&acc, "supply")), unrealized: NuplPattern::new(client.clone(), _m(&acc, "nupl")), } } @@ -2347,25 +2409,43 @@ impl _1m1w1y24hPattern { /// Pattern struct for repeated tree structure. pub struct BlocksDominanceRewardsPattern { - pub blocks_mined: CumulativeRawSumPattern, + pub blocks_mined: CumulativeRawSumPattern2, pub dominance: _1m1w1y24hBpsPercentRatioPattern, - pub rewards: CumulativeRawSumPattern3, + pub rewards: CumulativeRawSumPattern4, } impl BlocksDominanceRewardsPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - blocks_mined: CumulativeRawSumPattern::new(client.clone(), _m(&acc, "blocks_mined")), + blocks_mined: CumulativeRawSumPattern2::new(client.clone(), _m(&acc, "blocks_mined")), dominance: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), _m(&acc, "dominance")), - rewards: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "rewards")), + rewards: CumulativeRawSumPattern4::new(client.clone(), _m(&acc, "rewards")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct BpsPercentRatioPattern4 { + pub bps: MetricPattern1, + pub percent: MetricPattern1, + pub ratio: MetricPattern1, +} + +impl BpsPercentRatioPattern4 { + /// 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")), } } } /// Pattern struct for repeated tree structure. pub struct BpsPercentRatioPattern { - pub bps: MetricPattern1, + pub bps: MetricPattern1, pub percent: MetricPattern1, pub ratio: MetricPattern1, } @@ -2400,13 +2480,49 @@ impl BpsPriceRatioPattern { } /// Pattern struct for repeated tree structure. -pub struct CentsSatsUsdPattern2 { +pub struct BpsPercentRatioPattern5 { + pub bps: MetricPattern1, + pub percent: MetricPattern1, + pub ratio: MetricPattern1, +} + +impl BpsPercentRatioPattern5 { + /// 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")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct BpsPercentRatioPattern2 { + pub bps: MetricPattern1, + 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: MetricPattern1::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 CentsSatsUsdPattern3 { pub cents: MetricPattern2, pub sats: MetricPattern2, pub usd: MetricPattern2, } -impl CentsSatsUsdPattern2 { +impl CentsSatsUsdPattern3 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { @@ -2420,7 +2536,7 @@ impl CentsSatsUsdPattern2 { /// Pattern struct for repeated tree structure. pub struct CentsDeltaUsdPattern { pub cents: MetricPattern1, - pub delta: ChangeRatePattern2, + pub delta: ChangeRatePattern3, pub usd: MetricPattern1, } @@ -2429,7 +2545,7 @@ impl CentsDeltaUsdPattern { pub fn new(client: Arc, acc: String) -> Self { Self { cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - delta: ChangeRatePattern2::new(client.clone(), _m(&acc, "delta")), + delta: ChangeRatePattern3::new(client.clone(), _m(&acc, "delta")), usd: MetricPattern1::new(client.clone(), acc.clone()), } } @@ -2454,19 +2570,19 @@ impl CentsSatsUsdPattern { } /// Pattern struct for repeated tree structure. -pub struct CumulativeRawSumPattern3 { +pub struct CumulativeRawSumPattern4 { pub cumulative: BtcCentsSatsUsdPattern, pub raw: BtcCentsSatsUsdPattern, - pub sum: _1m1w1y24hPattern4, + pub sum: _1m1w1y24hPattern6, } -impl CumulativeRawSumPattern3 { +impl CumulativeRawSumPattern4 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { cumulative: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "cumulative")), raw: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), - sum: _1m1w1y24hPattern4::new(client.clone(), _m(&acc, "sum")), + sum: _1m1w1y24hPattern6::new(client.clone(), _m(&acc, "sum")), } } } @@ -2489,11 +2605,29 @@ impl CumulativeRawRelPattern { } } +/// Pattern struct for repeated tree structure. +pub struct CumulativeRawSumPattern3 { + pub cumulative: CentsUsdPattern2, + pub raw: CentsUsdPattern2, + pub sum: _1m1w1y24hPattern5, +} + +impl CumulativeRawSumPattern3 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + cumulative: CentsUsdPattern2::new(client.clone(), _m(&acc, "cumulative")), + raw: CentsUsdPattern2::new(client.clone(), acc.clone()), + sum: _1m1w1y24hPattern5::new(client.clone(), _m(&acc, "sum")), + } + } +} + /// Pattern struct for repeated tree structure. pub struct CumulativeRawSumPattern2 { - pub cumulative: MetricPattern1, - pub raw: CentsUsdPattern, - pub sum: _1m1w1y24hPattern3, + pub cumulative: MetricPattern1, + pub raw: MetricPattern1, + pub sum: _1m1w1y24hPattern, } impl CumulativeRawSumPattern2 { @@ -2501,44 +2635,62 @@ impl CumulativeRawSumPattern2 { pub fn new(client: Arc, acc: String) -> Self { Self { cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), - raw: CentsUsdPattern::new(client.clone(), acc.clone()), - sum: _1m1w1y24hPattern3::new(client.clone(), _m(&acc, "sum")), + raw: MetricPattern1::new(client.clone(), acc.clone()), + sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sum")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct DeltaHalfTotalPattern { + pub delta: ChangeRatePattern2, + pub half: BtcCentsSatsUsdPattern, + pub total: BtcCentsSatsUsdPattern, +} + +impl DeltaHalfTotalPattern { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + delta: ChangeRatePattern2::new(client.clone(), _m(&acc, "delta")), + half: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "half")), + total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct GreedNetPainPattern { - pub greed_index: CentsUsdPattern, + pub greed_index: CentsUsdPattern2, pub net: CentsUsdPattern, - pub pain_index: CentsUsdPattern, + pub pain_index: CentsUsdPattern2, } impl GreedNetPainPattern { /// 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")), + greed_index: CentsUsdPattern2::new(client.clone(), _m(&acc, "greed_index")), net: CentsUsdPattern::new(client.clone(), _m(&acc, "net_sentiment")), - pain_index: CentsUsdPattern::new(client.clone(), _m(&acc, "pain_index")), + pain_index: CentsUsdPattern2::new(client.clone(), _m(&acc, "pain_index")), } } } /// Pattern struct for repeated tree structure. pub struct LossNuplProfitPattern { - pub loss: CumulativeRawSumPattern2, + pub loss: CumulativeRawSumPattern3, pub nupl: BpsRatioPattern, - pub profit: CumulativeRawSumPattern2, + pub profit: CumulativeRawSumPattern3, } impl LossNuplProfitPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - loss: CumulativeRawSumPattern2::new(client.clone(), _m(&acc, "unrealized_loss")), + loss: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "unrealized_loss")), nupl: BpsRatioPattern::new(client.clone(), _m(&acc, "nupl")), - profit: CumulativeRawSumPattern2::new(client.clone(), _m(&acc, "unrealized_profit")), + profit: CumulativeRawSumPattern3::new(client.clone(), _m(&acc, "unrealized_profit")), } } } @@ -2635,23 +2787,39 @@ impl CumulativeRawSumPattern { /// Pattern struct for repeated tree structure. pub struct BlocksDominancePattern { - pub blocks_mined: CumulativeRawSumPattern, - pub dominance: BpsPercentRatioPattern, + pub blocks_mined: CumulativeRawSumPattern2, + pub dominance: BpsPercentRatioPattern4, } impl BlocksDominancePattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - blocks_mined: CumulativeRawSumPattern::new(client.clone(), _m(&acc, "blocks_mined")), - dominance: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "dominance")), + blocks_mined: CumulativeRawSumPattern2::new(client.clone(), _m(&acc, "blocks_mined")), + dominance: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "dominance")), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct BpsRatioPattern2 { + pub bps: MetricPattern1, + pub ratio: MetricPattern1, +} + +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()), } } } /// Pattern struct for repeated tree structure. pub struct BpsRatioPattern { - pub bps: MetricPattern1, + pub bps: MetricPattern1, pub ratio: MetricPattern1, } @@ -2666,17 +2834,33 @@ impl BpsRatioPattern { } /// Pattern struct for repeated tree structure. -pub struct CentsUsdPattern { +pub struct CentsUsdPattern2 { pub cents: MetricPattern1, pub usd: MetricPattern1, } +impl CentsUsdPattern2 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), + usd: MetricPattern1::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct CentsUsdPattern { + pub cents: MetricPattern1, + pub usd: MetricPattern1, +} + impl CentsUsdPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - usd: MetricPattern1::new(client.clone(), acc.clone()), + cents: MetricPattern1::new(client.clone(), acc.clone()), + usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), } } } @@ -2699,16 +2883,32 @@ impl ChangeRatePattern { /// Pattern struct for repeated tree structure. pub struct ChangeRatePattern2 { - pub change: _1m1w1y24hPattern3, - pub rate: _1m1w1y24hPattern2, + pub change: _1m1w1y24hPattern, + pub rate: _1m1w1y24hPattern3, } impl ChangeRatePattern2 { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - change: _1m1w1y24hPattern3::new(client.clone(), acc.clone()), - rate: _1m1w1y24hPattern2::new(client.clone(), acc.clone()), + change: _1m1w1y24hPattern::new(client.clone(), acc.clone()), + rate: _1m1w1y24hPattern3::new(client.clone(), acc.clone()), + } + } +} + +/// Pattern struct for repeated tree structure. +pub struct ChangeRatePattern3 { + pub change: _1m1w1y24hPattern4, + pub rate: _1m1w1y24hPattern3, +} + +impl ChangeRatePattern3 { + /// Create a new pattern node with accumulated metric name. + pub fn new(client: Arc, acc: String) -> Self { + Self { + change: _1m1w1y24hPattern4::new(client.clone(), acc.clone()), + rate: _1m1w1y24hPattern3::new(client.clone(), acc.clone()), } } } @@ -2731,7 +2931,7 @@ impl CoindaysSentPattern { /// Pattern struct for repeated tree structure. pub struct DeltaInnerPattern { - pub delta: ChangeRatePattern, + pub delta: ChangeRatePattern2, pub inner: MetricPattern1, } @@ -2739,56 +2939,24 @@ impl DeltaInnerPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - delta: ChangeRatePattern::new(client.clone(), _m(&acc, "delta")), + delta: ChangeRatePattern2::new(client.clone(), _m(&acc, "delta")), inner: MetricPattern1::new(client.clone(), acc.clone()), } } } -/// Pattern struct for repeated tree structure. -pub struct DeltaRawPattern { - pub delta: ChangeRatePattern, - pub raw: MetricPattern1, -} - -impl DeltaRawPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - delta: ChangeRatePattern::new(client.clone(), _m(&acc, "delta")), - raw: MetricPattern1::new(client.clone(), acc.clone()), - } - } -} - -/// Pattern struct for repeated tree structure. -pub struct HalfTotalPattern { - pub half: BtcCentsSatsUsdPattern, - pub total: BtcCentsSatsUsdPattern, -} - -impl HalfTotalPattern { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - half: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "half")), - total: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct InPattern { - pub in_loss: CentsUsdPattern, - pub in_profit: CentsUsdPattern, + pub in_loss: CentsUsdPattern2, + pub in_profit: CentsUsdPattern2, } impl InPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - in_loss: CentsUsdPattern::new(client.clone(), _m(&acc, "loss")), - in_profit: CentsUsdPattern::new(client.clone(), _m(&acc, "profit")), + in_loss: CentsUsdPattern2::new(client.clone(), _m(&acc, "loss")), + in_profit: CentsUsdPattern2::new(client.clone(), _m(&acc, "profit")), } } } @@ -2827,16 +2995,16 @@ impl RealizedSupplyPattern { /// Pattern struct for repeated tree structure. pub struct RelPattern { - pub rel_to_mcap: BpsPercentRatioPattern, - pub rel_to_rcap: BpsPercentRatioPattern, + pub rel_to_mcap: BpsPercentRatioPattern2, + pub rel_to_rcap: BpsPercentRatioPattern2, } impl RelPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - rel_to_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "mcap")), - rel_to_rcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rcap")), + rel_to_mcap: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "mcap")), + rel_to_rcap: BpsPercentRatioPattern2::new(client.clone(), _m(&acc, "rcap")), } } } @@ -2901,30 +3069,16 @@ impl NuplPattern { } } -/// Pattern struct for repeated tree structure. -pub struct UnspentPattern2 { - pub unspent_count: DeltaRawPattern, -} - -impl UnspentPattern2 { - /// Create a new pattern node with accumulated metric name. - pub fn new(client: Arc, acc: String) -> Self { - Self { - unspent_count: DeltaRawPattern::new(client.clone(), acc.clone()), - } - } -} - /// Pattern struct for repeated tree structure. pub struct UnspentPattern { - pub unspent_count: MetricPattern1, + pub unspent_count: DeltaInnerPattern, } impl UnspentPattern { /// Create a new pattern node with accumulated metric name. pub fn new(client: Arc, acc: String) -> Self { Self { - unspent_count: MetricPattern1::new(client.clone(), acc.clone()), + unspent_count: DeltaInnerPattern::new(client.clone(), acc.clone()), } } } @@ -3011,7 +3165,7 @@ impl MetricsTree_Blocks { pub struct MetricsTree_Blocks_Difficulty { pub raw: MetricPattern1, pub as_hash: MetricPattern1, - pub adjustment: BpsPercentRatioPattern, + pub adjustment: BpsPercentRatioPattern2, pub epoch: MetricPattern1, pub blocks_before_next: MetricPattern1, pub days_before_next: MetricPattern1, @@ -3022,7 +3176,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: BpsPercentRatioPattern::new(client.clone(), "difficulty_adjustment".to_string()), + adjustment: BpsPercentRatioPattern2::new(client.clone(), "difficulty_adjustment".to_string()), epoch: MetricPattern1::new(client.clone(), "difficulty_epoch".to_string()), blocks_before_next: MetricPattern1::new(client.clone(), "blocks_before_next_difficulty_adjustment".to_string()), days_before_next: MetricPattern1::new(client.clone(), "days_before_next_difficulty_adjustment".to_string()), @@ -3116,14 +3270,14 @@ impl MetricsTree_Blocks_Weight { /// Metrics tree node. pub struct MetricsTree_Blocks_Count { pub target: MetricPattern1, - pub total: CumulativeRawSumPattern, + pub total: CumulativeRawSumPattern2, } impl MetricsTree_Blocks_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { target: MetricPattern1::new(client.clone(), "block_count_target".to_string()), - total: CumulativeRawSumPattern::new(client.clone(), "block_count".to_string()), + total: CumulativeRawSumPattern2::new(client.clone(), "block_count".to_string()), } } } @@ -3381,8 +3535,8 @@ impl MetricsTree_Transactions_Versions { /// Metrics tree node. pub struct MetricsTree_Transactions_Volume { - pub sent_sum: CumulativeRawSumPattern3, - pub received_sum: CumulativeRawSumPattern3, + pub sent_sum: CumulativeRawSumPattern4, + pub received_sum: CumulativeRawSumPattern4, pub tx_per_sec: MetricPattern1, pub outputs_per_sec: MetricPattern1, pub inputs_per_sec: MetricPattern1, @@ -3391,8 +3545,8 @@ pub struct MetricsTree_Transactions_Volume { impl MetricsTree_Transactions_Volume { pub fn new(client: Arc, base_path: String) -> Self { Self { - sent_sum: CumulativeRawSumPattern3::new(client.clone(), "sent_sum".to_string()), - received_sum: CumulativeRawSumPattern3::new(client.clone(), "received_sum".to_string()), + sent_sum: CumulativeRawSumPattern4::new(client.clone(), "sent_sum".to_string()), + received_sum: CumulativeRawSumPattern4::new(client.clone(), "received_sum".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()), inputs_per_sec: MetricPattern1::new(client.clone(), "inputs_per_sec".to_string()), @@ -3993,15 +4147,15 @@ impl MetricsTree_Scripts_Value_Opreturn { /// Metrics tree node. pub struct MetricsTree_Scripts_Adoption { - pub taproot: BpsPercentRatioPattern, - pub segwit: BpsPercentRatioPattern, + pub taproot: BpsPercentRatioPattern4, + pub segwit: BpsPercentRatioPattern4, } impl MetricsTree_Scripts_Adoption { pub fn new(client: Arc, base_path: String) -> Self { Self { - taproot: BpsPercentRatioPattern::new(client.clone(), "taproot_adoption".to_string()), - segwit: BpsPercentRatioPattern::new(client.clone(), "segwit_adoption".to_string()), + taproot: BpsPercentRatioPattern4::new(client.clone(), "taproot_adoption".to_string()), + segwit: BpsPercentRatioPattern4::new(client.clone(), "segwit_adoption".to_string()), } } } @@ -4023,19 +4177,19 @@ impl MetricsTree_Mining { /// Metrics tree node. pub struct MetricsTree_Mining_Rewards { - pub coinbase: CumulativeRawSumPattern3, + pub coinbase: CumulativeRawSumPattern4, pub subsidy: MetricsTree_Mining_Rewards_Subsidy, pub fees: MetricsTree_Mining_Rewards_Fees, - pub unclaimed: CumulativeRawSumPattern3, + pub unclaimed: CumulativeRawSumPattern4, } impl MetricsTree_Mining_Rewards { pub fn new(client: Arc, base_path: String) -> Self { Self { - coinbase: CumulativeRawSumPattern3::new(client.clone(), "coinbase".to_string()), + coinbase: CumulativeRawSumPattern4::new(client.clone(), "coinbase".to_string()), subsidy: MetricsTree_Mining_Rewards_Subsidy::new(client.clone(), format!("{base_path}_subsidy")), fees: MetricsTree_Mining_Rewards_Fees::new(client.clone(), format!("{base_path}_fees")), - unclaimed: CumulativeRawSumPattern3::new(client.clone(), "unclaimed_rewards".to_string()), + unclaimed: CumulativeRawSumPattern4::new(client.clone(), "unclaimed_rewards".to_string()), } } } @@ -4045,7 +4199,7 @@ pub struct MetricsTree_Mining_Rewards_Subsidy { pub base: BtcCentsSatsUsdPattern, pub cumulative: BtcCentsSatsUsdPattern, pub dominance: _1m1w1y24hBpsPercentRatioPattern, - pub sma_1y: CentsUsdPattern, + pub sma_1y: CentsUsdPattern2, } impl MetricsTree_Mining_Rewards_Subsidy { @@ -4054,7 +4208,7 @@ impl MetricsTree_Mining_Rewards_Subsidy { base: BtcCentsSatsUsdPattern::new(client.clone(), "subsidy".to_string()), cumulative: BtcCentsSatsUsdPattern::new(client.clone(), "subsidy_cumulative".to_string()), dominance: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "subsidy_dominance".to_string()), - sma_1y: CentsUsdPattern::new(client.clone(), "subsidy_sma_1y".to_string()), + sma_1y: CentsUsdPattern2::new(client.clone(), "subsidy_sma_1y".to_string()), } } } @@ -4063,7 +4217,7 @@ impl MetricsTree_Mining_Rewards_Subsidy { pub struct MetricsTree_Mining_Rewards_Fees { pub base: BtcCentsSatsUsdPattern, pub cumulative: BtcCentsSatsUsdPattern, - pub sum: _1m1w1y24hPattern4, + pub sum: _1m1w1y24hPattern6, pub _24h: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern, pub _1w: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern, pub _1m: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern, @@ -4077,7 +4231,7 @@ impl MetricsTree_Mining_Rewards_Fees { Self { base: BtcCentsSatsUsdPattern::new(client.clone(), "fees".to_string()), cumulative: BtcCentsSatsUsdPattern::new(client.clone(), "fees_cumulative".to_string()), - sum: _1m1w1y24hPattern4::new(client.clone(), "fees_sum".to_string()), + sum: _1m1w1y24hPattern6::new(client.clone(), "fees_sum".to_string()), _24h: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "fees_24h".to_string()), _1w: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "fees_1w".to_string()), _1m: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "fees_1m".to_string()), @@ -4090,19 +4244,19 @@ impl MetricsTree_Mining_Rewards_Fees { /// Metrics tree node. pub struct MetricsTree_Mining_Rewards_Fees_RatioMultiple { - pub _24h: BpsRatioPattern, - pub _1w: BpsRatioPattern, - pub _1m: BpsRatioPattern, - pub _1y: BpsRatioPattern, + pub _24h: BpsRatioPattern2, + pub _1w: BpsRatioPattern2, + pub _1m: BpsRatioPattern2, + pub _1y: BpsRatioPattern2, } impl MetricsTree_Mining_Rewards_Fees_RatioMultiple { pub fn new(client: Arc, base_path: String) -> Self { Self { - _24h: BpsRatioPattern::new(client.clone(), "fee_ratio_multiple_24h".to_string()), - _1w: BpsRatioPattern::new(client.clone(), "fee_ratio_multiple_1w".to_string()), - _1m: BpsRatioPattern::new(client.clone(), "fee_ratio_multiple_1m".to_string()), - _1y: BpsRatioPattern::new(client.clone(), "fee_ratio_multiple_1y".to_string()), + _24h: BpsRatioPattern2::new(client.clone(), "fee_ratio_multiple_24h".to_string()), + _1w: BpsRatioPattern2::new(client.clone(), "fee_ratio_multiple_1w".to_string()), + _1m: BpsRatioPattern2::new(client.clone(), "fee_ratio_multiple_1m".to_string()), + _1y: BpsRatioPattern2::new(client.clone(), "fee_ratio_multiple_1y".to_string()), } } } @@ -4129,7 +4283,7 @@ pub struct MetricsTree_Mining_Hashrate_Rate { pub raw: MetricPattern1, pub sma: MetricsTree_Mining_Hashrate_Rate_Sma, pub ath: MetricPattern1, - pub drawdown: BpsPercentRatioPattern, + pub drawdown: BpsPercentRatioPattern5, } impl MetricsTree_Mining_Hashrate_Rate { @@ -4138,7 +4292,7 @@ impl MetricsTree_Mining_Hashrate_Rate { raw: MetricPattern1::new(client.clone(), "hash_rate".to_string()), sma: MetricsTree_Mining_Hashrate_Rate_Sma::new(client.clone(), format!("{base_path}_sma")), ath: MetricPattern1::new(client.clone(), "hash_rate_ath".to_string()), - drawdown: BpsPercentRatioPattern::new(client.clone(), "hash_rate_drawdown".to_string()), + drawdown: BpsPercentRatioPattern5::new(client.clone(), "hash_rate_drawdown".to_string()), } } } @@ -4246,23 +4400,23 @@ impl MetricsTree_Cointime_Value { /// Metrics tree node. pub struct MetricsTree_Cointime_Cap { - pub thermo: CentsUsdPattern, - pub investor: CentsUsdPattern, - pub vaulted: CentsUsdPattern, - pub active: CentsUsdPattern, - pub cointime: CentsUsdPattern, - pub aviv: BpsRatioPattern, + pub thermo: CentsUsdPattern2, + pub investor: CentsUsdPattern2, + pub vaulted: CentsUsdPattern2, + pub active: CentsUsdPattern2, + pub cointime: CentsUsdPattern2, + pub aviv: BpsRatioPattern2, } impl MetricsTree_Cointime_Cap { pub fn new(client: Arc, base_path: String) -> Self { Self { - thermo: CentsUsdPattern::new(client.clone(), "thermo_cap".to_string()), - investor: CentsUsdPattern::new(client.clone(), "investor_cap".to_string()), - vaulted: CentsUsdPattern::new(client.clone(), "vaulted_cap".to_string()), - active: CentsUsdPattern::new(client.clone(), "active_cap".to_string()), - cointime: CentsUsdPattern::new(client.clone(), "cointime_cap".to_string()), - aviv: BpsRatioPattern::new(client.clone(), "aviv_ratio".to_string()), + thermo: CentsUsdPattern2::new(client.clone(), "thermo_cap".to_string()), + investor: CentsUsdPattern2::new(client.clone(), "investor_cap".to_string()), + vaulted: CentsUsdPattern2::new(client.clone(), "vaulted_cap".to_string()), + active: CentsUsdPattern2::new(client.clone(), "active_cap".to_string()), + cointime: CentsUsdPattern2::new(client.clone(), "cointime_cap".to_string()), + aviv: BpsRatioPattern2::new(client.clone(), "aviv_ratio".to_string()), } } } @@ -4298,7 +4452,7 @@ impl MetricsTree_Cointime_Prices { /// Metrics tree node. pub struct MetricsTree_Cointime_Adjusted { - pub inflation_rate: BpsPercentRatioPattern, + pub inflation_rate: BpsPercentRatioPattern2, pub tx_velocity_btc: MetricPattern1, pub tx_velocity_usd: MetricPattern1, } @@ -4306,7 +4460,7 @@ pub struct MetricsTree_Cointime_Adjusted { impl MetricsTree_Cointime_Adjusted { pub fn new(client: Arc, base_path: String) -> Self { Self { - inflation_rate: BpsPercentRatioPattern::new(client.clone(), "cointime_adj_inflation_rate".to_string()), + inflation_rate: BpsPercentRatioPattern2::new(client.clone(), "cointime_adj_inflation_rate".to_string()), tx_velocity_btc: MetricPattern1::new(client.clone(), "cointime_adj_tx_velocity_btc".to_string()), tx_velocity_usd: MetricPattern1::new(client.clone(), "cointime_adj_tx_velocity_usd".to_string()), } @@ -4967,11 +5121,11 @@ impl MetricsTree_Indexes_Txoutindex { /// Metrics tree node. pub struct MetricsTree_Indicators { - pub puell_multiple: BpsRatioPattern, - pub nvt: BpsRatioPattern, - pub gini: BpsPercentRatioPattern, - pub rhodl_ratio: BpsRatioPattern, - pub thermocap_multiple: BpsRatioPattern, + pub puell_multiple: BpsRatioPattern2, + pub nvt: BpsRatioPattern2, + pub gini: BpsPercentRatioPattern4, + pub rhodl_ratio: BpsRatioPattern2, + pub thermocap_multiple: BpsRatioPattern2, pub coindays_destroyed_supply_adjusted: MetricPattern1, pub coinyears_destroyed_supply_adjusted: MetricPattern1, pub dormancy: MetricsTree_Indicators_Dormancy, @@ -4982,11 +5136,11 @@ pub struct MetricsTree_Indicators { impl MetricsTree_Indicators { pub fn new(client: Arc, base_path: String) -> Self { Self { - puell_multiple: BpsRatioPattern::new(client.clone(), "puell_multiple".to_string()), - nvt: BpsRatioPattern::new(client.clone(), "nvt".to_string()), - gini: BpsPercentRatioPattern::new(client.clone(), "gini".to_string()), - rhodl_ratio: BpsRatioPattern::new(client.clone(), "rhodl_ratio".to_string()), - thermocap_multiple: BpsRatioPattern::new(client.clone(), "thermocap_multiple".to_string()), + puell_multiple: BpsRatioPattern2::new(client.clone(), "puell_multiple".to_string()), + nvt: BpsRatioPattern2::new(client.clone(), "nvt".to_string()), + gini: BpsPercentRatioPattern4::new(client.clone(), "gini".to_string()), + rhodl_ratio: BpsRatioPattern2::new(client.clone(), "rhodl_ratio".to_string()), + thermocap_multiple: BpsRatioPattern2::new(client.clone(), "thermocap_multiple".to_string()), coindays_destroyed_supply_adjusted: MetricPattern1::new(client.clone(), "coindays_destroyed_supply_adjusted".to_string()), coinyears_destroyed_supply_adjusted: MetricPattern1::new(client.clone(), "coinyears_destroyed_supply_adjusted".to_string()), dormancy: MetricsTree_Indicators_Dormancy::new(client.clone(), format!("{base_path}_dormancy")), @@ -5041,7 +5195,7 @@ impl MetricsTree_Market { /// Metrics tree node. pub struct MetricsTree_Market_Ath { pub high: CentsSatsUsdPattern, - pub drawdown: BpsPercentRatioPattern, + pub drawdown: BpsPercentRatioPattern5, pub days_since: MetricPattern1, pub years_since: MetricPattern2, pub max_days_between: MetricPattern1, @@ -5052,7 +5206,7 @@ impl MetricsTree_Market_Ath { pub fn new(client: Arc, base_path: String) -> Self { Self { high: CentsSatsUsdPattern::new(client.clone(), "price_ath".to_string()), - drawdown: BpsPercentRatioPattern::new(client.clone(), "price_drawdown".to_string()), + drawdown: BpsPercentRatioPattern5::new(client.clone(), "price_drawdown".to_string()), days_since: MetricPattern1::new(client.clone(), "days_since_price_ath".to_string()), years_since: MetricPattern2::new(client.clone(), "years_since_price_ath".to_string()), max_days_between: MetricPattern1::new(client.clone(), "max_days_between_price_ath".to_string()), @@ -5117,37 +5271,37 @@ impl MetricsTree_Market_Returns { /// Metrics tree node. pub struct MetricsTree_Market_Returns_Periods { - 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, + pub _24h: BpsPercentRatioPattern2, + pub _1w: BpsPercentRatioPattern2, + pub _1m: BpsPercentRatioPattern2, + pub _3m: BpsPercentRatioPattern2, + pub _6m: BpsPercentRatioPattern2, + pub _1y: BpsPercentRatioPattern2, + pub _2y: BpsPercentRatioPattern2, + pub _3y: BpsPercentRatioPattern2, + pub _4y: BpsPercentRatioPattern2, + pub _5y: BpsPercentRatioPattern2, + pub _6y: BpsPercentRatioPattern2, + pub _8y: BpsPercentRatioPattern2, + pub _10y: BpsPercentRatioPattern2, } impl MetricsTree_Market_Returns_Periods { pub fn new(client: Arc, base_path: String) -> Self { Self { - _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()), + _24h: BpsPercentRatioPattern2::new(client.clone(), "price_return_24h".to_string()), + _1w: BpsPercentRatioPattern2::new(client.clone(), "price_return_1w".to_string()), + _1m: BpsPercentRatioPattern2::new(client.clone(), "price_return_1m".to_string()), + _3m: BpsPercentRatioPattern2::new(client.clone(), "price_return_3m".to_string()), + _6m: BpsPercentRatioPattern2::new(client.clone(), "price_return_6m".to_string()), + _1y: BpsPercentRatioPattern2::new(client.clone(), "price_return_1y".to_string()), + _2y: BpsPercentRatioPattern2::new(client.clone(), "price_return_2y".to_string()), + _3y: BpsPercentRatioPattern2::new(client.clone(), "price_return_3y".to_string()), + _4y: BpsPercentRatioPattern2::new(client.clone(), "price_return_4y".to_string()), + _5y: BpsPercentRatioPattern2::new(client.clone(), "price_return_5y".to_string()), + _6y: BpsPercentRatioPattern2::new(client.clone(), "price_return_6y".to_string()), + _8y: BpsPercentRatioPattern2::new(client.clone(), "price_return_8y".to_string()), + _10y: BpsPercentRatioPattern2::new(client.clone(), "price_return_10y".to_string()), } } } @@ -5222,7 +5376,7 @@ pub struct MetricsTree_Market_Range { pub max: _1m1w1y2wPattern, pub true_range: MetricPattern1, pub true_range_sum_2w: MetricPattern1, - pub choppiness_index_2w: BpsPercentRatioPattern, + pub choppiness_index_2w: BpsPercentRatioPattern4, } impl MetricsTree_Market_Range { @@ -5232,7 +5386,7 @@ impl MetricsTree_Market_Range { max: _1m1w1y2wPattern::new(client.clone(), "price_max".to_string()), true_range: MetricPattern1::new(client.clone(), "price_true_range".to_string()), true_range_sum_2w: MetricPattern1::new(client.clone(), "price_true_range_sum_2w".to_string()), - choppiness_index_2w: BpsPercentRatioPattern::new(client.clone(), "price_choppiness_index_2w".to_string()), + choppiness_index_2w: BpsPercentRatioPattern4::new(client.clone(), "price_choppiness_index_2w".to_string()), } } } @@ -5601,35 +5755,35 @@ impl MetricsTree_Market_Dca_Class_CostBasis { /// Metrics tree node. pub struct MetricsTree_Market_Dca_Class_Return { - 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, + pub from_2015: BpsPercentRatioPattern2, + pub from_2016: BpsPercentRatioPattern2, + pub from_2017: BpsPercentRatioPattern2, + pub from_2018: BpsPercentRatioPattern2, + pub from_2019: BpsPercentRatioPattern2, + pub from_2020: BpsPercentRatioPattern2, + pub from_2021: BpsPercentRatioPattern2, + pub from_2022: BpsPercentRatioPattern2, + pub from_2023: BpsPercentRatioPattern2, + pub from_2024: BpsPercentRatioPattern2, + pub from_2025: BpsPercentRatioPattern2, + pub from_2026: BpsPercentRatioPattern2, } impl MetricsTree_Market_Dca_Class_Return { pub fn new(client: Arc, base_path: String) -> Self { Self { - 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()), + from_2015: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2015".to_string()), + from_2016: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2016".to_string()), + from_2017: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2017".to_string()), + from_2018: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2018".to_string()), + from_2019: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2019".to_string()), + from_2020: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2020".to_string()), + from_2021: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2021".to_string()), + from_2022: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2022".to_string()), + from_2023: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2023".to_string()), + from_2024: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2024".to_string()), + from_2025: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2025".to_string()), + from_2026: BpsPercentRatioPattern2::new(client.clone(), "dca_return_from_2026".to_string()), } } } @@ -5637,9 +5791,9 @@ impl MetricsTree_Market_Dca_Class_Return { /// Metrics tree node. pub struct MetricsTree_Market_Technical { pub rsi: MetricsTree_Market_Technical_Rsi, - pub stoch_k: BpsPercentRatioPattern, - pub stoch_d: BpsPercentRatioPattern, - pub pi_cycle: BpsRatioPattern, + pub stoch_k: BpsPercentRatioPattern4, + pub stoch_d: BpsPercentRatioPattern4, + pub pi_cycle: BpsRatioPattern2, pub macd: MetricsTree_Market_Technical_Macd, } @@ -5647,9 +5801,9 @@ impl MetricsTree_Market_Technical { pub fn new(client: Arc, base_path: String) -> Self { Self { rsi: MetricsTree_Market_Technical_Rsi::new(client.clone(), format!("{base_path}_rsi")), - 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()), + stoch_k: BpsPercentRatioPattern4::new(client.clone(), "stoch_k".to_string()), + stoch_d: BpsPercentRatioPattern4::new(client.clone(), "stoch_d".to_string()), + pi_cycle: BpsRatioPattern2::new(client.clone(), "pi_cycle".to_string()), macd: MetricsTree_Market_Technical_Macd::new(client.clone(), format!("{base_path}_macd")), } } @@ -5680,12 +5834,12 @@ pub struct MetricsTree_Market_Technical_Rsi_1w { 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, + pub rsi: BpsPercentRatioPattern4, + pub rsi_min: BpsPercentRatioPattern4, + pub rsi_max: BpsPercentRatioPattern4, + pub stoch_rsi: BpsPercentRatioPattern4, + pub stoch_rsi_k: BpsPercentRatioPattern4, + pub stoch_rsi_d: BpsPercentRatioPattern4, } impl MetricsTree_Market_Technical_Rsi_1w { @@ -5695,12 +5849,12 @@ impl MetricsTree_Market_Technical_Rsi_1w { losses: MetricPattern1::new(client.clone(), "rsi_losses_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()), + rsi: BpsPercentRatioPattern4::new(client.clone(), "rsi_1w".to_string()), + rsi_min: BpsPercentRatioPattern4::new(client.clone(), "rsi_min_1w".to_string()), + rsi_max: BpsPercentRatioPattern4::new(client.clone(), "rsi_max_1w".to_string()), + stoch_rsi: BpsPercentRatioPattern4::new(client.clone(), "rsi_stoch_1w".to_string()), + stoch_rsi_k: BpsPercentRatioPattern4::new(client.clone(), "rsi_stoch_k_1w".to_string()), + stoch_rsi_d: BpsPercentRatioPattern4::new(client.clone(), "rsi_stoch_d_1w".to_string()), } } } @@ -5711,12 +5865,12 @@ pub struct MetricsTree_Market_Technical_Rsi_1m { 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, + pub rsi: BpsPercentRatioPattern4, + pub rsi_min: BpsPercentRatioPattern4, + pub rsi_max: BpsPercentRatioPattern4, + pub stoch_rsi: BpsPercentRatioPattern4, + pub stoch_rsi_k: BpsPercentRatioPattern4, + pub stoch_rsi_d: BpsPercentRatioPattern4, } impl MetricsTree_Market_Technical_Rsi_1m { @@ -5726,12 +5880,12 @@ impl MetricsTree_Market_Technical_Rsi_1m { losses: MetricPattern1::new(client.clone(), "rsi_losses_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()), + rsi: BpsPercentRatioPattern4::new(client.clone(), "rsi_1m".to_string()), + rsi_min: BpsPercentRatioPattern4::new(client.clone(), "rsi_min_1m".to_string()), + rsi_max: BpsPercentRatioPattern4::new(client.clone(), "rsi_max_1m".to_string()), + stoch_rsi: BpsPercentRatioPattern4::new(client.clone(), "rsi_stoch_1m".to_string()), + stoch_rsi_k: BpsPercentRatioPattern4::new(client.clone(), "rsi_stoch_k_1m".to_string()), + stoch_rsi_d: BpsPercentRatioPattern4::new(client.clone(), "rsi_stoch_d_1m".to_string()), } } } @@ -5742,12 +5896,12 @@ pub struct MetricsTree_Market_Technical_Rsi_1y { 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, + pub rsi: BpsPercentRatioPattern4, + pub rsi_min: BpsPercentRatioPattern4, + pub rsi_max: BpsPercentRatioPattern4, + pub stoch_rsi: BpsPercentRatioPattern4, + pub stoch_rsi_k: BpsPercentRatioPattern4, + pub stoch_rsi_d: BpsPercentRatioPattern4, } impl MetricsTree_Market_Technical_Rsi_1y { @@ -5757,12 +5911,12 @@ impl MetricsTree_Market_Technical_Rsi_1y { 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()), + rsi: BpsPercentRatioPattern4::new(client.clone(), "rsi_1y".to_string()), + rsi_min: BpsPercentRatioPattern4::new(client.clone(), "rsi_min_1y".to_string()), + rsi_max: BpsPercentRatioPattern4::new(client.clone(), "rsi_max_1y".to_string()), + stoch_rsi: BpsPercentRatioPattern4::new(client.clone(), "rsi_stoch_1y".to_string()), + stoch_rsi_k: BpsPercentRatioPattern4::new(client.clone(), "rsi_stoch_k_1y".to_string()), + stoch_rsi_d: BpsPercentRatioPattern4::new(client.clone(), "rsi_stoch_d_1y".to_string()), } } } @@ -6231,19 +6385,19 @@ impl MetricsTree_Prices { /// Metrics tree node. pub struct MetricsTree_Prices_Split { - pub open: CentsSatsUsdPattern2, - pub high: CentsSatsUsdPattern2, - pub low: CentsSatsUsdPattern2, - pub close: CentsSatsUsdPattern2, + pub open: CentsSatsUsdPattern3, + pub high: CentsSatsUsdPattern3, + pub low: CentsSatsUsdPattern3, + pub close: CentsSatsUsdPattern3, } impl MetricsTree_Prices_Split { pub fn new(client: Arc, base_path: String) -> Self { Self { - open: CentsSatsUsdPattern2::new(client.clone(), "price_open".to_string()), - high: CentsSatsUsdPattern2::new(client.clone(), "price_high".to_string()), - low: CentsSatsUsdPattern2::new(client.clone(), "price_low".to_string()), - close: CentsSatsUsdPattern2::new(client.clone(), "price_close".to_string()), + open: CentsSatsUsdPattern3::new(client.clone(), "price_open".to_string()), + high: CentsSatsUsdPattern3::new(client.clone(), "price_high".to_string()), + low: CentsSatsUsdPattern3::new(client.clone(), "price_low".to_string()), + close: CentsSatsUsdPattern3::new(client.clone(), "price_close".to_string()), } } } @@ -6286,7 +6440,7 @@ impl MetricsTree_Prices_Spot { pub struct MetricsTree_Supply { pub circulating: BtcCentsSatsUsdPattern, pub burned: MetricsTree_Supply_Burned, - pub inflation_rate: BpsPercentRatioPattern, + pub inflation_rate: BpsPercentRatioPattern2, pub velocity: MetricsTree_Supply_Velocity, pub market_cap: CentsDeltaUsdPattern, pub market_minus_realized_cap_growth_rate: _1m1w1y24hPattern, @@ -6299,7 +6453,7 @@ 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_rate: BpsPercentRatioPattern::new(client.clone(), "inflation_rate".to_string()), + inflation_rate: BpsPercentRatioPattern2::new(client.clone(), "inflation_rate".to_string()), velocity: MetricsTree_Supply_Velocity::new(client.clone(), format!("{base_path}_velocity")), market_cap: CentsDeltaUsdPattern::new(client.clone(), "market_cap".to_string()), market_minus_realized_cap_growth_rate: _1m1w1y24hPattern::new(client.clone(), "market_minus_realized_cap_growth_rate".to_string()), @@ -6311,15 +6465,15 @@ impl MetricsTree_Supply { /// Metrics tree node. pub struct MetricsTree_Supply_Burned { - pub opreturn: CumulativeRawSumPattern3, - pub unspendable: CumulativeRawSumPattern3, + pub opreturn: CumulativeRawSumPattern4, + pub unspendable: CumulativeRawSumPattern4, } impl MetricsTree_Supply_Burned { pub fn new(client: Arc, base_path: String) -> Self { Self { - opreturn: CumulativeRawSumPattern3::new(client.clone(), "opreturn_supply".to_string()), - unspendable: CumulativeRawSumPattern3::new(client.clone(), "unspendable_supply".to_string()), + opreturn: CumulativeRawSumPattern4::new(client.clone(), "opreturn_supply".to_string()), + unspendable: CumulativeRawSumPattern4::new(client.clone(), "unspendable_supply".to_string()), } } } @@ -6396,7 +6550,7 @@ impl MetricsTree_Cohorts_Utxo { /// Metrics tree node. pub struct MetricsTree_Cohorts_Utxo_All { pub supply: MetricsTree_Cohorts_Utxo_All_Supply, - pub outputs: UnspentPattern2, + pub outputs: UnspentPattern, pub activity: CoindaysCoinyearsDormancySentVelocityPattern, pub realized: CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern, pub cost_basis: InvestedMaxMinPercentilesSupplyPattern, @@ -6407,7 +6561,7 @@ impl MetricsTree_Cohorts_Utxo_All { pub fn new(client: Arc, base_path: String) -> Self { Self { supply: MetricsTree_Cohorts_Utxo_All_Supply::new(client.clone(), format!("{base_path}_supply")), - outputs: UnspentPattern2::new(client.clone(), "utxo_count".to_string()), + outputs: UnspentPattern::new(client.clone(), "utxo_count".to_string()), activity: CoindaysCoinyearsDormancySentVelocityPattern::new(client.clone(), "".to_string()), realized: CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern::new(client.clone(), "".to_string()), cost_basis: InvestedMaxMinPercentilesSupplyPattern::new(client.clone(), "".to_string()), @@ -6418,28 +6572,28 @@ impl MetricsTree_Cohorts_Utxo_All { /// Metrics tree node. pub struct MetricsTree_Cohorts_Utxo_All_Supply { - pub delta: ChangeRatePattern, pub in_profit: BtcCentsRelSatsUsdPattern2, pub in_loss: BtcCentsRelSatsUsdPattern2, pub total: BtcCentsSatsUsdPattern, pub half: BtcCentsSatsUsdPattern, + pub delta: ChangeRatePattern2, } impl MetricsTree_Cohorts_Utxo_All_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { - delta: ChangeRatePattern::new(client.clone(), "supply_delta".to_string()), in_profit: BtcCentsRelSatsUsdPattern2::new(client.clone(), "supply_in_profit".to_string()), in_loss: BtcCentsRelSatsUsdPattern2::new(client.clone(), "supply_in_loss".to_string()), total: BtcCentsSatsUsdPattern::new(client.clone(), "supply".to_string()), half: BtcCentsSatsUsdPattern::new(client.clone(), "supply_half".to_string()), + delta: ChangeRatePattern2::new(client.clone(), "supply_delta".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Cohorts_Utxo_All_Unrealized { - pub gross_pnl: CentsUsdPattern, + pub gross_pnl: CentsUsdPattern2, pub invested_capital: InPattern, pub sentiment: GreedNetPainPattern, pub loss: MetricsTree_Cohorts_Utxo_All_Unrealized_Loss, @@ -6451,7 +6605,7 @@ pub struct MetricsTree_Cohorts_Utxo_All_Unrealized { impl MetricsTree_Cohorts_Utxo_All_Unrealized { pub fn new(client: Arc, base_path: String) -> Self { Self { - gross_pnl: CentsUsdPattern::new(client.clone(), "unrealized_gross_pnl".to_string()), + gross_pnl: CentsUsdPattern2::new(client.clone(), "unrealized_gross_pnl".to_string()), invested_capital: InPattern::new(client.clone(), "invested_capital_in".to_string()), sentiment: GreedNetPainPattern::new(client.clone(), "".to_string()), loss: MetricsTree_Cohorts_Utxo_All_Unrealized_Loss::new(client.clone(), format!("{base_path}_loss")), @@ -6465,22 +6619,22 @@ impl MetricsTree_Cohorts_Utxo_All_Unrealized { /// Metrics tree node. pub struct MetricsTree_Cohorts_Utxo_All_Unrealized_Loss { pub negative: MetricPattern1, - pub raw: CentsUsdPattern, - pub cumulative: MetricPattern1, - pub sum: _1m1w1y24hPattern3, - pub rel_to_mcap: BpsPercentRatioPattern, - pub rel_to_own_gross: BpsPercentRatioPattern, + pub raw: CentsUsdPattern2, + pub cumulative: CentsUsdPattern2, + pub sum: _1m1w1y24hPattern5, + pub rel_to_mcap: BpsPercentRatioPattern4, + pub rel_to_own_gross: BpsPercentRatioPattern4, } impl MetricsTree_Cohorts_Utxo_All_Unrealized_Loss { pub fn new(client: Arc, base_path: String) -> Self { Self { negative: MetricPattern1::new(client.clone(), "neg_unrealized_loss".to_string()), - raw: CentsUsdPattern::new(client.clone(), "unrealized_loss".to_string()), - cumulative: MetricPattern1::new(client.clone(), "unrealized_loss_cumulative".to_string()), - sum: _1m1w1y24hPattern3::new(client.clone(), "unrealized_loss_sum".to_string()), - rel_to_mcap: BpsPercentRatioPattern::new(client.clone(), "unrealized_loss_rel_to_mcap".to_string()), - rel_to_own_gross: BpsPercentRatioPattern::new(client.clone(), "unrealized_loss_rel_to_own_gross_pnl".to_string()), + raw: CentsUsdPattern2::new(client.clone(), "unrealized_loss".to_string()), + cumulative: CentsUsdPattern2::new(client.clone(), "unrealized_loss_cumulative".to_string()), + sum: _1m1w1y24hPattern5::new(client.clone(), "unrealized_loss_sum".to_string()), + rel_to_mcap: BpsPercentRatioPattern4::new(client.clone(), "unrealized_loss_rel_to_mcap".to_string()), + rel_to_own_gross: BpsPercentRatioPattern4::new(client.clone(), "unrealized_loss_rel_to_own_gross_pnl".to_string()), } } } @@ -6489,7 +6643,7 @@ impl MetricsTree_Cohorts_Utxo_All_Unrealized_Loss { pub struct MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl { pub cents: MetricPattern1, pub usd: MetricPattern1, - pub rel_to_own_gross: BpsPercentRatioPattern, + pub rel_to_own_gross: BpsPercentRatioPattern2, } impl MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl { @@ -6497,28 +6651,28 @@ impl MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl { Self { cents: MetricPattern1::new(client.clone(), "net_unrealized_pnl_cents".to_string()), usd: MetricPattern1::new(client.clone(), "net_unrealized_pnl".to_string()), - rel_to_own_gross: BpsPercentRatioPattern::new(client.clone(), "net_unrealized_pnl_rel_to_own_gross_pnl".to_string()), + rel_to_own_gross: BpsPercentRatioPattern2::new(client.clone(), "net_unrealized_pnl_rel_to_own_gross_pnl".to_string()), } } } /// Metrics tree node. pub struct MetricsTree_Cohorts_Utxo_All_Unrealized_Profit { - pub raw: CentsUsdPattern, - pub cumulative: MetricPattern1, - pub sum: _1m1w1y24hPattern3, - pub rel_to_mcap: BpsPercentRatioPattern, - pub rel_to_own_gross: BpsPercentRatioPattern, + pub raw: CentsUsdPattern2, + pub cumulative: CentsUsdPattern2, + pub sum: _1m1w1y24hPattern5, + pub rel_to_mcap: BpsPercentRatioPattern4, + pub rel_to_own_gross: BpsPercentRatioPattern4, } impl MetricsTree_Cohorts_Utxo_All_Unrealized_Profit { pub fn new(client: Arc, base_path: String) -> Self { Self { - raw: CentsUsdPattern::new(client.clone(), "unrealized_profit".to_string()), - cumulative: MetricPattern1::new(client.clone(), "unrealized_profit_cumulative".to_string()), - sum: _1m1w1y24hPattern3::new(client.clone(), "unrealized_profit_sum".to_string()), - rel_to_mcap: BpsPercentRatioPattern::new(client.clone(), "unrealized_profit_rel_to_mcap".to_string()), - rel_to_own_gross: BpsPercentRatioPattern::new(client.clone(), "unrealized_profit_rel_to_own_gross_pnl".to_string()), + raw: CentsUsdPattern2::new(client.clone(), "unrealized_profit".to_string()), + cumulative: CentsUsdPattern2::new(client.clone(), "unrealized_profit_cumulative".to_string()), + sum: _1m1w1y24hPattern5::new(client.clone(), "unrealized_profit_sum".to_string()), + rel_to_mcap: BpsPercentRatioPattern4::new(client.clone(), "unrealized_profit_rel_to_mcap".to_string()), + rel_to_own_gross: BpsPercentRatioPattern4::new(client.clone(), "unrealized_profit_rel_to_own_gross_pnl".to_string()), } } } @@ -6527,7 +6681,7 @@ impl MetricsTree_Cohorts_Utxo_All_Unrealized_Profit { pub struct MetricsTree_Cohorts_Utxo_Sth { pub realized: CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern, pub supply: DeltaHalfInRelTotalPattern2, - pub outputs: UnspentPattern2, + pub outputs: UnspentPattern, pub activity: CoindaysCoinyearsDormancySentVelocityPattern, pub cost_basis: InvestedMaxMinPercentilesSupplyPattern, pub unrealized: GrossInvestedLossNetNuplProfitSentimentPattern2, @@ -6538,7 +6692,7 @@ impl MetricsTree_Cohorts_Utxo_Sth { Self { realized: CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern::new(client.clone(), "sth".to_string()), supply: DeltaHalfInRelTotalPattern2::new(client.clone(), "sth_supply".to_string()), - outputs: UnspentPattern2::new(client.clone(), "sth_utxo_count".to_string()), + outputs: UnspentPattern::new(client.clone(), "sth_utxo_count".to_string()), activity: CoindaysCoinyearsDormancySentVelocityPattern::new(client.clone(), "sth".to_string()), cost_basis: InvestedMaxMinPercentilesSupplyPattern::new(client.clone(), "sth".to_string()), unrealized: GrossInvestedLossNetNuplProfitSentimentPattern2::new(client.clone(), "sth".to_string()), @@ -6549,7 +6703,7 @@ impl MetricsTree_Cohorts_Utxo_Sth { /// Metrics tree node. pub struct MetricsTree_Cohorts_Utxo_Lth { pub supply: DeltaHalfInRelTotalPattern2, - pub outputs: UnspentPattern2, + pub outputs: UnspentPattern, pub activity: CoindaysCoinyearsDormancySentVelocityPattern, pub realized: MetricsTree_Cohorts_Utxo_Lth_Realized, pub cost_basis: InvestedMaxMinPercentilesSupplyPattern, @@ -6560,7 +6714,7 @@ impl MetricsTree_Cohorts_Utxo_Lth { pub fn new(client: Arc, base_path: String) -> Self { Self { supply: DeltaHalfInRelTotalPattern2::new(client.clone(), "lth_supply".to_string()), - outputs: UnspentPattern2::new(client.clone(), "lth_utxo_count".to_string()), + outputs: UnspentPattern::new(client.clone(), "lth_utxo_count".to_string()), activity: CoindaysCoinyearsDormancySentVelocityPattern::new(client.clone(), "lth".to_string()), realized: MetricsTree_Cohorts_Utxo_Lth_Realized::new(client.clone(), format!("{base_path}_realized")), cost_basis: InvestedMaxMinPercentilesSupplyPattern::new(client.clone(), "lth".to_string()), @@ -6573,7 +6727,7 @@ impl MetricsTree_Cohorts_Utxo_Lth { pub struct MetricsTree_Cohorts_Utxo_Lth_Realized { pub profit: CumulativeDistributionRawRelSumValuePattern, pub loss: CapitulationCumulativeNegativeRawRelSumValuePattern, - pub gross_pnl: CumulativeRawSumPattern2, + pub gross_pnl: CumulativeRawSumPattern3, pub sell_side_risk_ratio: MetricsTree_Cohorts_Utxo_Lth_Realized_SellSideRiskRatio, pub net_pnl: ChangeCumulativeDeltaRawRelSumPattern, pub sopr: MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr, @@ -6590,7 +6744,7 @@ impl MetricsTree_Cohorts_Utxo_Lth_Realized { Self { profit: CumulativeDistributionRawRelSumValuePattern::new(client.clone(), "lth".to_string()), loss: CapitulationCumulativeNegativeRawRelSumValuePattern::new(client.clone(), "lth".to_string()), - gross_pnl: CumulativeRawSumPattern2::new(client.clone(), "lth_realized_gross_pnl".to_string()), + gross_pnl: CumulativeRawSumPattern3::new(client.clone(), "lth_realized_gross_pnl".to_string()), sell_side_risk_ratio: MetricsTree_Cohorts_Utxo_Lth_Realized_SellSideRiskRatio::new(client.clone(), format!("{base_path}_sell_side_risk_ratio")), net_pnl: ChangeCumulativeDeltaRawRelSumPattern::new(client.clone(), "lth_net".to_string()), sopr: MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), diff --git a/crates/brk_computer/src/blocks/compute.rs b/crates/brk_computer/src/blocks/compute.rs index 65a4bc474..20545d49e 100644 --- a/crates/brk_computer/src/blocks/compute.rs +++ b/crates/brk_computer/src/blocks/compute.rs @@ -27,7 +27,7 @@ impl Vecs { self.size .compute(indexer, &self.lookback, starting_indexes, exit)?; self.weight - .compute(indexer, &self.lookback, starting_indexes, exit)?; + .compute(indexer, starting_indexes, exit)?; self.difficulty .compute(indexer, indexes, starting_indexes, exit)?; self.halving.compute(indexes, starting_indexes, exit)?; diff --git a/crates/brk_computer/src/blocks/count/import.rs b/crates/brk_computer/src/blocks/count/import.rs index 6ce2c4a4a..565238520 100644 --- a/crates/brk_computer/src/blocks/count/import.rs +++ b/crates/brk_computer/src/blocks/count/import.rs @@ -24,7 +24,7 @@ impl Vecs { total: ComputedPerBlockCumulativeWithSums::forced_import( db, "block_count", - version, + version + Version::ONE, indexes, cached_starts, )?, diff --git a/crates/brk_computer/src/blocks/import.rs b/crates/brk_computer/src/blocks/import.rs index 103767fa1..4b5894635 100644 --- a/crates/brk_computer/src/blocks/import.rs +++ b/crates/brk_computer/src/blocks/import.rs @@ -29,7 +29,7 @@ impl Vecs { let count = CountVecs::forced_import(&db, version, indexes, cached_starts)?; let interval = IntervalVecs::forced_import(&db, version, indexes, cached_starts)?; let size = SizeVecs::forced_import(&db, version, indexes, cached_starts)?; - let weight = WeightVecs::forced_import(&db, version, indexes, cached_starts)?; + let weight = WeightVecs::forced_import(&db, version, indexes, cached_starts, &size)?; let time = TimeVecs::forced_import(&db, version, indexes)?; let difficulty = DifficultyVecs::forced_import(&db, version, indexer, indexes)?; let halving = HalvingVecs::forced_import(&db, version, indexes)?; diff --git a/crates/brk_computer/src/blocks/weight/compute.rs b/crates/brk_computer/src/blocks/weight/compute.rs index 87b288521..125a2293c 100644 --- a/crates/brk_computer/src/blocks/weight/compute.rs +++ b/crates/brk_computer/src/blocks/weight/compute.rs @@ -4,25 +4,14 @@ use brk_types::{BasisPoints16, Indexes}; use vecdb::Exit; use super::Vecs; -use crate::blocks; impl Vecs { pub(crate) fn compute( &mut self, indexer: &Indexer, - lookback: &blocks::LookbackVecs, starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { - let window_starts = lookback.window_starts(); - - self.weight.compute( - starting_indexes.height, - &window_starts, - &indexer.vecs.blocks.weight, - exit, - )?; - self.fullness .compute(starting_indexes.height, exit, |vec| { vec.compute_transform( diff --git a/crates/brk_computer/src/blocks/weight/import.rs b/crates/brk_computer/src/blocks/weight/import.rs index b60d532b0..9a2423030 100644 --- a/crates/brk_computer/src/blocks/weight/import.rs +++ b/crates/brk_computer/src/blocks/weight/import.rs @@ -4,8 +4,9 @@ use vecdb::Database; use super::Vecs; use crate::{ + blocks::SizeVecs, indexes, - internal::{CachedWindowStarts, ResolutionsFull, PercentPerBlockRollingAverage}, + internal::{CachedWindowStarts, LazyResolutionsFull, PercentPerBlockRollingAverage, VBytesToWeight}, }; impl Vecs { @@ -14,9 +15,15 @@ impl Vecs { version: Version, indexes: &indexes::Vecs, cached_starts: &CachedWindowStarts, + size: &SizeVecs, ) -> Result { - let weight = - ResolutionsFull::forced_import(db, "block_weight", version, indexes, cached_starts)?; + let weight = LazyResolutionsFull::from_computed_per_block_full::( + "block_weight", + version, + &size.vbytes, + cached_starts, + indexes, + ); let fullness = PercentPerBlockRollingAverage::forced_import( db, diff --git a/crates/brk_computer/src/blocks/weight/vecs.rs b/crates/brk_computer/src/blocks/weight/vecs.rs index 23745d052..7ed999ef7 100644 --- a/crates/brk_computer/src/blocks/weight/vecs.rs +++ b/crates/brk_computer/src/blocks/weight/vecs.rs @@ -1,11 +1,11 @@ use brk_traversable::Traversable; -use brk_types::{BasisPoints16, Weight}; +use brk_types::{BasisPoints16, StoredU64, Weight}; use vecdb::{Rw, StorageMode}; -use crate::internal::{ResolutionsFull, PercentPerBlockRollingAverage}; +use crate::internal::{LazyResolutionsFull, PercentPerBlockRollingAverage}; #[derive(Traversable)] pub struct Vecs { - pub weight: ResolutionsFull, + pub weight: LazyResolutionsFull, pub fullness: PercentPerBlockRollingAverage, } diff --git a/crates/brk_computer/src/internal/aggregate/lazy_distribution.rs b/crates/brk_computer/src/internal/aggregate/lazy_distribution.rs new file mode 100644 index 000000000..0b40174a0 --- /dev/null +++ b/crates/brk_computer/src/internal/aggregate/lazy_distribution.rs @@ -0,0 +1,81 @@ +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use schemars::JsonSchema; +use vecdb::{LazyVecFrom1, ReadableCloneableVec, UnaryTransform, VecIndex}; + +use crate::internal::{ComputedVecValue, Distribution, DistributionStats}; + +/// Lazy analog of `Distribution`: 8 `LazyVecFrom1` fields, +/// each derived by transforming the corresponding field of a source `Distribution`. +#[derive(Clone, Traversable)] +pub struct LazyDistribution +where + I: VecIndex, + T: ComputedVecValue + JsonSchema, + S1T: ComputedVecValue, +{ + pub average: LazyVecFrom1, + pub min: LazyVecFrom1, + pub max: LazyVecFrom1, + pub pct10: LazyVecFrom1, + pub pct25: LazyVecFrom1, + pub median: LazyVecFrom1, + pub pct75: LazyVecFrom1, + pub pct90: LazyVecFrom1, +} + +impl LazyDistribution +where + T: ComputedVecValue + JsonSchema + 'static, + S1T: ComputedVecValue + JsonSchema, +{ + pub(crate) fn from_distribution>( + name: &str, + version: Version, + source: &Distribution, + ) -> Self { + let s = DistributionStats::<()>::SUFFIXES; + Self { + average: LazyVecFrom1::transformed::( + &format!("{name}_{}", s[0]), + version, + source.average.read_only_boxed_clone(), + ), + min: LazyVecFrom1::transformed::( + &format!("{name}_{}", s[1]), + version, + source.min.read_only_boxed_clone(), + ), + max: LazyVecFrom1::transformed::( + &format!("{name}_{}", s[2]), + version, + source.max.read_only_boxed_clone(), + ), + pct10: LazyVecFrom1::transformed::( + &format!("{name}_{}", s[3]), + version, + source.pct10.read_only_boxed_clone(), + ), + pct25: LazyVecFrom1::transformed::( + &format!("{name}_{}", s[4]), + version, + source.pct25.read_only_boxed_clone(), + ), + median: LazyVecFrom1::transformed::( + &format!("{name}_{}", s[5]), + version, + source.median.read_only_boxed_clone(), + ), + pct75: LazyVecFrom1::transformed::( + &format!("{name}_{}", s[6]), + version, + source.pct75.read_only_boxed_clone(), + ), + pct90: LazyVecFrom1::transformed::( + &format!("{name}_{}", s[7]), + version, + source.pct90.read_only_boxed_clone(), + ), + } + } +} diff --git a/crates/brk_computer/src/internal/aggregate/mod.rs b/crates/brk_computer/src/internal/aggregate/mod.rs index b0d01da0e..5d89f7050 100644 --- a/crates/brk_computer/src/internal/aggregate/mod.rs +++ b/crates/brk_computer/src/internal/aggregate/mod.rs @@ -1,5 +1,7 @@ mod distribution; mod full; +mod lazy_distribution; pub use distribution::*; pub use full::*; +pub use lazy_distribution::*; diff --git a/crates/brk_computer/src/internal/per_block/computed/lazy_resolutions_full.rs b/crates/brk_computer/src/internal/per_block/computed/lazy_resolutions_full.rs new file mode 100644 index 000000000..c258fe773 --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/computed/lazy_resolutions_full.rs @@ -0,0 +1,60 @@ +use brk_traversable::Traversable; +use brk_types::Version; +use schemars::JsonSchema; +use vecdb::{ReadableCloneableVec, UnaryTransform}; + +use crate::{ + indexes, + internal::{ + CachedWindowStarts, ComputedPerBlockFull, ComputedVecValue, LazyPerBlock, LazyRollingFull, + NumericValue, + }, +}; + +/// Lazy analog of `ResolutionsFull`: lazy cumulative + lazy rolling full. +/// Derived by transforming a `ComputedPerBlockFull`. Zero stored vecs. +#[derive(Clone, Traversable)] +pub struct LazyResolutionsFull +where + T: NumericValue + JsonSchema, + S1T: ComputedVecValue + JsonSchema, +{ + pub cumulative: LazyPerBlock, + #[traversable(flatten)] + pub rolling: LazyRollingFull, +} + +impl LazyResolutionsFull +where + T: NumericValue + JsonSchema + 'static, + S1T: NumericValue + JsonSchema, +{ + pub(crate) fn from_computed_per_block_full>( + name: &str, + version: Version, + source: &ComputedPerBlockFull, + cached_starts: &CachedWindowStarts, + indexes: &indexes::Vecs, + ) -> Self { + let cumulative = LazyPerBlock::from_computed::( + &format!("{name}_cumulative"), + version, + source.cumulative.height.read_only_boxed_clone(), + &source.cumulative, + ); + + let rolling = LazyRollingFull::from_rolling_full::( + name, + version, + &cumulative.height, + &source.rolling, + cached_starts, + indexes, + ); + + Self { + cumulative, + rolling, + } + } +} diff --git a/crates/brk_computer/src/internal/per_block/computed/mod.rs b/crates/brk_computer/src/internal/per_block/computed/mod.rs index 10d47cf5e..9c6a53066 100644 --- a/crates/brk_computer/src/internal/per_block/computed/mod.rs +++ b/crates/brk_computer/src/internal/per_block/computed/mod.rs @@ -5,6 +5,7 @@ mod cumulative; mod cumulative_sum; mod resolutions; mod resolutions_full; +mod lazy_resolutions_full; mod full; mod rolling_average; mod with_deltas; @@ -16,6 +17,7 @@ pub use cumulative::*; pub use cumulative_sum::*; pub use resolutions::*; pub use resolutions_full::*; +pub use lazy_resolutions_full::*; pub use full::*; pub use rolling_average::*; pub use with_deltas::*; diff --git a/crates/brk_computer/src/internal/per_block/rolling/lazy_distribution.rs b/crates/brk_computer/src/internal/per_block/rolling/lazy_distribution.rs new file mode 100644 index 000000000..b1a32d7ca --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/rolling/lazy_distribution.rs @@ -0,0 +1,75 @@ +use brk_traversable::Traversable; +use brk_types::Version; +use derive_more::{Deref, DerefMut}; +use schemars::JsonSchema; +use vecdb::{ReadableCloneableVec, UnaryTransform}; + +use crate::internal::{ + ComputedVecValue, DistributionStats, LazyPerBlock, NumericValue, RollingDistribution, Windows, +}; + +/// Lazy analog of `RollingDistribution`: `DistributionStats>>`. +/// 8 stats × 4 windows = 32 lazy vecs, zero stored. +#[derive(Clone, Deref, DerefMut, Traversable)] +#[traversable(transparent)] +pub struct LazyRollingDistribution(pub DistributionStats>>) +where + T: ComputedVecValue + PartialOrd + JsonSchema, + S1T: ComputedVecValue + JsonSchema; + +impl LazyRollingDistribution +where + T: ComputedVecValue + JsonSchema + 'static, + S1T: NumericValue + JsonSchema, +{ + pub(crate) fn from_rolling_distribution>( + name: &str, + version: Version, + source: &RollingDistribution, + ) -> Self { + let s = &source.0; + + macro_rules! map_stat { + ($field:ident, $suffix:expr) => {{ + let src = &s.$field; + Windows { + _24h: LazyPerBlock::from_computed::( + &format!("{name}_{}_24h", $suffix), + version, + src._24h.height.read_only_boxed_clone(), + &src._24h, + ), + _1w: LazyPerBlock::from_computed::( + &format!("{name}_{}_1w", $suffix), + version, + src._1w.height.read_only_boxed_clone(), + &src._1w, + ), + _1m: LazyPerBlock::from_computed::( + &format!("{name}_{}_1m", $suffix), + version, + src._1m.height.read_only_boxed_clone(), + &src._1m, + ), + _1y: LazyPerBlock::from_computed::( + &format!("{name}_{}_1y", $suffix), + version, + src._1y.height.read_only_boxed_clone(), + &src._1y, + ), + } + }}; + } + + Self(DistributionStats { + average: map_stat!(average, "average"), + min: map_stat!(min, "min"), + max: map_stat!(max, "max"), + pct10: map_stat!(pct10, "pct10"), + pct25: map_stat!(pct25, "pct25"), + median: map_stat!(median, "median"), + pct75: map_stat!(pct75, "pct75"), + pct90: map_stat!(pct90, "pct90"), + }) + } +} diff --git a/crates/brk_computer/src/internal/per_block/rolling/lazy_full.rs b/crates/brk_computer/src/internal/per_block/rolling/lazy_full.rs new file mode 100644 index 000000000..11f38b36b --- /dev/null +++ b/crates/brk_computer/src/internal/per_block/rolling/lazy_full.rs @@ -0,0 +1,56 @@ +use brk_traversable::Traversable; +use brk_types::Version; +use schemars::JsonSchema; +use vecdb::{ReadableCloneableVec, UnaryTransform}; + +use brk_types::Height; + +use crate::{ + indexes, + internal::{ + CachedWindowStarts, ComputedVecValue, LazyRollingDistribution, LazyRollingSumsFromHeight, + NumericValue, RollingFull, + }, +}; + +/// Lazy analog of `RollingFull`: lazy rolling sums + lazy rolling distribution. +/// Zero stored vecs. +#[derive(Clone, Traversable)] +pub struct LazyRollingFull +where + T: NumericValue + JsonSchema, + S1T: ComputedVecValue + JsonSchema, +{ + pub sum: LazyRollingSumsFromHeight, + #[traversable(flatten)] + pub distribution: LazyRollingDistribution, +} + +impl LazyRollingFull +where + T: NumericValue + JsonSchema + 'static, + S1T: NumericValue + JsonSchema, +{ + pub(crate) fn from_rolling_full>( + name: &str, + version: Version, + cumulative: &(impl ReadableCloneableVec + 'static), + source: &RollingFull, + cached_starts: &CachedWindowStarts, + indexes: &indexes::Vecs, + ) -> Self { + let sum = LazyRollingSumsFromHeight::new( + &format!("{name}_sum"), + version, + cumulative, + cached_starts, + indexes, + ); + let distribution = LazyRollingDistribution::from_rolling_distribution::( + name, + version, + &source.distribution, + ); + Self { sum, distribution } + } +} diff --git a/crates/brk_computer/src/internal/per_block/rolling/mod.rs b/crates/brk_computer/src/internal/per_block/rolling/mod.rs index 7d6a08e48..2d9c9a8fc 100644 --- a/crates/brk_computer/src/internal/per_block/rolling/mod.rs +++ b/crates/brk_computer/src/internal/per_block/rolling/mod.rs @@ -3,6 +3,8 @@ mod avgs; mod delta; mod distribution; mod full; +mod lazy_distribution; +mod lazy_full; mod sum; mod sums; mod windows; @@ -12,6 +14,8 @@ pub use avgs::*; pub use delta::*; pub use distribution::*; pub use full::*; +pub use lazy_distribution::*; +pub use lazy_full::*; pub use sum::*; pub use sums::*; pub use windows::*; diff --git a/crates/brk_computer/src/internal/per_tx/lazy_derived.rs b/crates/brk_computer/src/internal/per_tx/lazy_derived.rs new file mode 100644 index 000000000..ea4196411 --- /dev/null +++ b/crates/brk_computer/src/internal/per_tx/lazy_derived.rs @@ -0,0 +1,50 @@ +use brk_traversable::Traversable; +use brk_types::{Height, Version}; +use schemars::JsonSchema; +use vecdb::UnaryTransform; + +use crate::internal::{ComputedVecValue, LazyDistribution, TxDerivedDistribution}; + +#[derive(Clone, Traversable)] +pub struct LazyBlockRollingDistribution +where + T: ComputedVecValue + JsonSchema, + S1T: ComputedVecValue, +{ + pub _6b: LazyDistribution, +} + +/// Lazy analog of `TxDerivedDistribution`: per-block + 6-block rolling, +/// each derived by transforming the corresponding source distribution. +#[derive(Clone, Traversable)] +pub struct LazyTxDerivedDistribution +where + T: ComputedVecValue + JsonSchema, + S1T: ComputedVecValue, +{ + pub block: LazyDistribution, + #[traversable(flatten)] + pub rolling: LazyBlockRollingDistribution, +} + +impl LazyTxDerivedDistribution +where + T: ComputedVecValue + JsonSchema + 'static, + S1T: ComputedVecValue + JsonSchema, +{ + pub(crate) fn from_tx_derived>( + name: &str, + version: Version, + source: &TxDerivedDistribution, + ) -> Self { + let block = LazyDistribution::from_distribution::(name, version, &source.block); + let rolling = LazyBlockRollingDistribution { + _6b: LazyDistribution::from_distribution::( + &format!("{name}_6b"), + version, + &source.rolling._6b, + ), + }; + Self { block, rolling } + } +} diff --git a/crates/brk_computer/src/internal/per_tx/lazy_distribution_derived.rs b/crates/brk_computer/src/internal/per_tx/lazy_distribution_derived.rs new file mode 100644 index 000000000..131e1c966 --- /dev/null +++ b/crates/brk_computer/src/internal/per_tx/lazy_distribution_derived.rs @@ -0,0 +1,43 @@ +use brk_traversable::Traversable; +use brk_types::{TxIndex, Version}; +use schemars::JsonSchema; +use vecdb::{LazyVecFrom2, UnaryTransform}; + +use crate::internal::{ComputedVecValue, LazyTxDerivedDistribution, TxDerivedDistribution}; + +/// Like `LazyPerTxDistribution` but with a lazy-derived distribution +/// (transformed from another type's distribution rather than eagerly computed). +#[derive(Clone, Traversable)] +pub struct LazyPerTxDistributionDerived +where + T: ComputedVecValue + JsonSchema, + S1: ComputedVecValue, + S2: ComputedVecValue, + DSource: ComputedVecValue, +{ + pub txindex: LazyVecFrom2, + #[traversable(flatten)] + pub distribution: LazyTxDerivedDistribution, +} + +impl LazyPerTxDistributionDerived +where + T: ComputedVecValue + JsonSchema + 'static, + S1: ComputedVecValue + JsonSchema, + S2: ComputedVecValue + JsonSchema, + DSource: ComputedVecValue + JsonSchema, +{ + pub(crate) fn new>( + name: &str, + version: Version, + txindex: LazyVecFrom2, + source_distribution: &TxDerivedDistribution, + ) -> Self { + let distribution = + LazyTxDerivedDistribution::from_tx_derived::(name, version, source_distribution); + Self { + txindex, + distribution, + } + } +} diff --git a/crates/brk_computer/src/internal/per_tx/mod.rs b/crates/brk_computer/src/internal/per_tx/mod.rs index 1938e78eb..59156d9c6 100644 --- a/crates/brk_computer/src/internal/per_tx/mod.rs +++ b/crates/brk_computer/src/internal/per_tx/mod.rs @@ -1,7 +1,11 @@ mod derived; mod distribution; +mod lazy_derived; mod lazy_distribution; +mod lazy_distribution_derived; pub use derived::*; pub use distribution::*; +pub use lazy_derived::*; pub use lazy_distribution::*; +pub use lazy_distribution_derived::*; diff --git a/crates/brk_computer/src/internal/transform/arithmetic.rs b/crates/brk_computer/src/internal/transform/arithmetic.rs index abb43e392..6697d24ba 100644 --- a/crates/brk_computer/src/internal/transform/arithmetic.rs +++ b/crates/brk_computer/src/internal/transform/arithmetic.rs @@ -1,6 +1,6 @@ use std::marker::PhantomData; -use brk_types::{Bitcoin, Cents, Dollars, Sats, StoredF32, StoredI8, StoredU16, StoredU32}; +use brk_types::{Bitcoin, Cents, Dollars, Sats, StoredF32, StoredI8, StoredU16, StoredU32, StoredU64, VSize, Weight}; use vecdb::{BinaryTransform, UnaryTransform, VecValue}; pub struct Identity(PhantomData); @@ -87,3 +87,21 @@ impl UnaryTransform for ReturnI8 { StoredI8::new(V) } } + +pub struct VBytesToWeight; + +impl UnaryTransform for VBytesToWeight { + #[inline(always)] + fn apply(vbytes: StoredU64) -> Weight { + Weight::from(VSize::new(*vbytes)) + } +} + +pub struct VSizeToWeight; + +impl UnaryTransform for VSizeToWeight { + #[inline(always)] + fn apply(vsize: VSize) -> Weight { + Weight::from(vsize) + } +} diff --git a/crates/brk_computer/src/internal/transform/mod.rs b/crates/brk_computer/src/internal/transform/mod.rs index d76f447e8..3077d6663 100644 --- a/crates/brk_computer/src/internal/transform/mod.rs +++ b/crates/brk_computer/src/internal/transform/mod.rs @@ -7,7 +7,7 @@ mod specialized; pub use arithmetic::{ HalveCents, HalveDollars, HalveSats, HalveSatsToBitcoin, Identity, MaskSats, ReturnF32Tenths, - ReturnI8, ReturnU16, + ReturnI8, ReturnU16, VBytesToWeight, VSizeToWeight, }; pub use bps::{ Bp16ToFloat, Bp16ToPercent, Bp32ToFloat, Bp32ToPercent, Bps16ToFloat, Bps16ToPercent, Bps32ToFloat, diff --git a/crates/brk_computer/src/pools/minor.rs b/crates/brk_computer/src/pools/minor.rs index bf99a13ee..5ef41f36e 100644 --- a/crates/brk_computer/src/pools/minor.rs +++ b/crates/brk_computer/src/pools/minor.rs @@ -34,7 +34,7 @@ impl Vecs { let blocks_mined = ComputedPerBlockCumulativeWithSums::forced_import( db, &suffix("blocks_mined"), - version, + version + Version::ONE, indexes, cached_starts, )?; diff --git a/crates/brk_computer/src/transactions/size/compute.rs b/crates/brk_computer/src/transactions/size/compute.rs index b840fda0e..1e06930ba 100644 --- a/crates/brk_computer/src/transactions/size/compute.rs +++ b/crates/brk_computer/src/transactions/size/compute.rs @@ -14,9 +14,6 @@ impl Vecs { starting_indexes: &Indexes, exit: &Exit, ) -> Result<()> { - self.weight - .derive_from(indexer, indexes, starting_indexes, exit)?; - self.vsize .derive_from(indexer, indexes, starting_indexes, exit)?; diff --git a/crates/brk_computer/src/transactions/size/import.rs b/crates/brk_computer/src/transactions/size/import.rs index e3b3015ad..0446c7c5a 100644 --- a/crates/brk_computer/src/transactions/size/import.rs +++ b/crates/brk_computer/src/transactions/size/import.rs @@ -4,7 +4,7 @@ use brk_types::{TxIndex, VSize, Version, Weight}; use vecdb::{Database, LazyVecFrom2, ReadableCloneableVec}; use super::Vecs; -use crate::internal::LazyPerTxDistribution; +use crate::internal::{LazyPerTxDistribution, LazyPerTxDistributionDerived, VSizeToWeight}; impl Vecs { pub(crate) fn forced_import( @@ -12,14 +12,6 @@ impl Vecs { version: Version, indexer: &Indexer, ) -> Result { - let txindex_to_weight = LazyVecFrom2::init( - "tx_weight", - version, - indexer.vecs.transactions.base_size.read_only_boxed_clone(), - indexer.vecs.transactions.total_size.read_only_boxed_clone(), - |_index: TxIndex, base_size, total_size| Weight::from_sizes(*base_size, *total_size), - ); - let txindex_to_vsize = LazyVecFrom2::init( "tx_vsize", version, @@ -30,19 +22,24 @@ impl Vecs { }, ); - Ok(Self { - vsize: LazyPerTxDistribution::forced_import( - db, - "tx_vsize", - version, - txindex_to_vsize, - )?, - weight: LazyPerTxDistribution::forced_import( - db, - "tx_weight", - version, - txindex_to_weight, - )?, - }) + let vsize = + LazyPerTxDistribution::forced_import(db, "tx_vsize", version, txindex_to_vsize)?; + + let txindex_to_weight = LazyVecFrom2::init( + "tx_weight", + version, + indexer.vecs.transactions.base_size.read_only_boxed_clone(), + indexer.vecs.transactions.total_size.read_only_boxed_clone(), + |_index: TxIndex, base_size, total_size| Weight::from_sizes(*base_size, *total_size), + ); + + let weight = LazyPerTxDistributionDerived::new::( + "tx_weight", + version, + txindex_to_weight, + &vsize.distribution, + ); + + Ok(Self { vsize, weight }) } } diff --git a/crates/brk_computer/src/transactions/size/vecs.rs b/crates/brk_computer/src/transactions/size/vecs.rs index a63782c66..33f51567d 100644 --- a/crates/brk_computer/src/transactions/size/vecs.rs +++ b/crates/brk_computer/src/transactions/size/vecs.rs @@ -2,10 +2,10 @@ use brk_traversable::Traversable; use brk_types::{StoredU32, VSize, Weight}; use vecdb::{Rw, StorageMode}; -use crate::internal::LazyPerTxDistribution; +use crate::internal::{LazyPerTxDistribution, LazyPerTxDistributionDerived}; #[derive(Traversable)] pub struct Vecs { pub vsize: LazyPerTxDistribution, - pub weight: LazyPerTxDistribution, + pub weight: LazyPerTxDistributionDerived, } diff --git a/crates/brk_types/src/weight.rs b/crates/brk_types/src/weight.rs index d8d807fc9..1500db06a 100644 --- a/crates/brk_types/src/weight.rs +++ b/crates/brk_types/src/weight.rs @@ -5,6 +5,8 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use vecdb::{CheckedSub, Formattable, Pco}; +use crate::VSize; + /// Transaction or block weight in weight units (WU) #[derive( Debug, @@ -66,6 +68,14 @@ impl From for bitcoin::Weight { } } +impl From for Weight { + /// Convert virtual bytes to weight units: `weight = vbytes * WITNESS_SCALE_FACTOR`. + #[inline] + fn from(vsize: VSize) -> Self { + Self(bitcoin::Weight::from_vb_unchecked(*vsize).to_wu()) + } +} + impl From for Weight { #[inline] fn from(value: usize) -> Self { diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index b80d02354..441b373f5 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -1704,18 +1704,18 @@ function create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern(client, a /** * @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 + * @property {BpsPercentRatioPattern2} _10y + * @property {BpsPercentRatioPattern2} _1m + * @property {BpsPercentRatioPattern2} _1w + * @property {BpsPercentRatioPattern2} _1y + * @property {BpsPercentRatioPattern2} _2y + * @property {BpsPercentRatioPattern2} _3m + * @property {BpsPercentRatioPattern2} _3y + * @property {BpsPercentRatioPattern2} _4y + * @property {BpsPercentRatioPattern2} _5y + * @property {BpsPercentRatioPattern2} _6m + * @property {BpsPercentRatioPattern2} _6y + * @property {BpsPercentRatioPattern2} _8y */ /** @@ -1726,18 +1726,18 @@ function create_0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern(client, a */ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, acc) { return { - _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')), + _10y: createBpsPercentRatioPattern2(client, _m(acc, '10y')), + _1m: createBpsPercentRatioPattern2(client, _m(acc, '1m')), + _1w: createBpsPercentRatioPattern2(client, _m(acc, '1w')), + _1y: createBpsPercentRatioPattern2(client, _m(acc, '1y')), + _2y: createBpsPercentRatioPattern2(client, _m(acc, '2y')), + _3m: createBpsPercentRatioPattern2(client, _m(acc, '3m')), + _3y: createBpsPercentRatioPattern2(client, _m(acc, '3y')), + _4y: createBpsPercentRatioPattern2(client, _m(acc, '4y')), + _5y: createBpsPercentRatioPattern2(client, _m(acc, '5y')), + _6m: createBpsPercentRatioPattern2(client, _m(acc, '6m')), + _6y: createBpsPercentRatioPattern2(client, _m(acc, '6y')), + _8y: createBpsPercentRatioPattern2(client, _m(acc, '8y')), }; } @@ -1783,7 +1783,7 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) { /** * @typedef {Object} CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern * @property {CentsDeltaRelUsdPattern} cap - * @property {CumulativeRawSumPattern2} grossPnl + * @property {CumulativeRawSumPattern3} grossPnl * @property {LowerPriceUpperPattern} investor * @property {CapitulationCumulativeNegativeRawRelSumValuePattern} loss * @property {MetricPattern1} mvrv @@ -1805,7 +1805,7 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) { function createCapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern(client, acc) { return { cap: createCentsDeltaRelUsdPattern(client, _m(acc, 'realized_cap')), - grossPnl: createCumulativeRawSumPattern2(client, _m(acc, 'realized_gross_pnl')), + grossPnl: createCumulativeRawSumPattern3(client, _m(acc, 'realized_gross_pnl')), investor: createLowerPriceUpperPattern(client, acc), loss: createCapitulationCumulativeNegativeRawRelSumValuePattern(client, acc), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), @@ -1899,12 +1899,12 @@ function createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RawSumPattern(cl * @property {MetricPattern1} averageLoss * @property {MetricPattern1} gains * @property {MetricPattern1} losses - * @property {BpsPercentRatioPattern} rsi - * @property {BpsPercentRatioPattern} rsiMax - * @property {BpsPercentRatioPattern} rsiMin - * @property {BpsPercentRatioPattern} stochRsi - * @property {BpsPercentRatioPattern} stochRsiD - * @property {BpsPercentRatioPattern} stochRsiK + * @property {BpsPercentRatioPattern4} rsi + * @property {BpsPercentRatioPattern4} rsiMax + * @property {BpsPercentRatioPattern4} rsiMin + * @property {BpsPercentRatioPattern4} stochRsi + * @property {BpsPercentRatioPattern4} stochRsiD + * @property {BpsPercentRatioPattern4} stochRsiK */ /** @@ -1919,12 +1919,12 @@ function createAverageGainsLossesRsiStochPattern(client, acc) { 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')), + rsi: createBpsPercentRatioPattern4(client, _m(acc, '24h')), + rsiMax: createBpsPercentRatioPattern4(client, _m(acc, 'max_24h')), + rsiMin: createBpsPercentRatioPattern4(client, _m(acc, 'min_24h')), + stochRsi: createBpsPercentRatioPattern4(client, _m(acc, 'stoch_24h')), + stochRsiD: createBpsPercentRatioPattern4(client, _m(acc, 'stoch_d_24h')), + stochRsiK: createBpsPercentRatioPattern4(client, _m(acc, 'stoch_k_24h')), }; } @@ -2059,11 +2059,11 @@ function createBpsCentsPercentilesRatioSatsSmaStdUsdPattern(client, acc) { /** * @typedef {Object} CapitulationCumulativeNegativeRawRelSumValuePattern * @property {MetricPattern1} capitulationFlow - * @property {MetricPattern1} cumulative + * @property {CentsUsdPattern2} cumulative * @property {MetricPattern1} negative - * @property {CentsUsdPattern} raw + * @property {CentsUsdPattern2} raw * @property {BpsPercentRatioPattern} relToRcap - * @property {_1m1w1y24hPattern3} sum + * @property {_1m1w1y24hPattern5} sum * @property {CumulativeRawSumPattern} valueCreated * @property {CumulativeRawSumPattern} valueDestroyed */ @@ -2077,11 +2077,11 @@ function createBpsCentsPercentilesRatioSatsSmaStdUsdPattern(client, acc) { function createCapitulationCumulativeNegativeRawRelSumValuePattern(client, acc) { return { capitulationFlow: createMetricPattern1(client, _m(acc, 'capitulation_flow')), - cumulative: createMetricPattern1(client, _m(acc, 'realized_loss_cumulative')), + cumulative: createCentsUsdPattern2(client, _m(acc, 'realized_loss_cumulative')), negative: createMetricPattern1(client, _m(acc, 'neg_realized_loss')), - raw: createCentsUsdPattern(client, _m(acc, 'realized_loss')), + raw: createCentsUsdPattern2(client, _m(acc, 'realized_loss')), relToRcap: createBpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_rcap')), - sum: create_1m1w1y24hPattern3(client, _m(acc, 'realized_loss_sum')), + sum: create_1m1w1y24hPattern5(client, _m(acc, 'realized_loss_sum')), valueCreated: createCumulativeRawSumPattern(client, _m(acc, 'loss_value_created')), valueDestroyed: createCumulativeRawSumPattern(client, _m(acc, 'loss_value_destroyed')), }; @@ -2122,13 +2122,13 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(client, acc) { /** * @typedef {Object} _10y2y3y4y5y6y8yPattern - * @property {BpsPercentRatioPattern} _10y - * @property {BpsPercentRatioPattern} _2y - * @property {BpsPercentRatioPattern} _3y - * @property {BpsPercentRatioPattern} _4y - * @property {BpsPercentRatioPattern} _5y - * @property {BpsPercentRatioPattern} _6y - * @property {BpsPercentRatioPattern} _8y + * @property {BpsPercentRatioPattern2} _10y + * @property {BpsPercentRatioPattern2} _2y + * @property {BpsPercentRatioPattern2} _3y + * @property {BpsPercentRatioPattern2} _4y + * @property {BpsPercentRatioPattern2} _5y + * @property {BpsPercentRatioPattern2} _6y + * @property {BpsPercentRatioPattern2} _8y */ /** @@ -2139,22 +2139,22 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(client, acc) { */ function create_10y2y3y4y5y6y8yPattern(client, acc) { return { - _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')), + _10y: createBpsPercentRatioPattern2(client, _m(acc, '10y')), + _2y: createBpsPercentRatioPattern2(client, _m(acc, '2y')), + _3y: createBpsPercentRatioPattern2(client, _m(acc, '3y')), + _4y: createBpsPercentRatioPattern2(client, _m(acc, '4y')), + _5y: createBpsPercentRatioPattern2(client, _m(acc, '5y')), + _6y: createBpsPercentRatioPattern2(client, _m(acc, '6y')), + _8y: createBpsPercentRatioPattern2(client, _m(acc, '8y')), }; } /** * @typedef {Object} _1m1w1y24hBpsPercentRatioPattern - * @property {BpsPercentRatioPattern} _1m - * @property {BpsPercentRatioPattern} _1w - * @property {BpsPercentRatioPattern} _1y - * @property {BpsPercentRatioPattern} _24h + * @property {BpsPercentRatioPattern4} _1m + * @property {BpsPercentRatioPattern4} _1w + * @property {BpsPercentRatioPattern4} _1y + * @property {BpsPercentRatioPattern4} _24h * @property {MetricPattern1} bps * @property {MetricPattern1} percent * @property {MetricPattern1} ratio @@ -2168,10 +2168,10 @@ function create_10y2y3y4y5y6y8yPattern(client, acc) { */ function create_1m1w1y24hBpsPercentRatioPattern(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')), + _1m: createBpsPercentRatioPattern4(client, _m(acc, '1m')), + _1w: createBpsPercentRatioPattern4(client, _m(acc, '1w')), + _1y: createBpsPercentRatioPattern4(client, _m(acc, '1y')), + _24h: createBpsPercentRatioPattern4(client, _m(acc, '24h')), bps: createMetricPattern1(client, _m(acc, 'bps')), percent: createMetricPattern1(client, acc), ratio: createMetricPattern1(client, _m(acc, 'ratio')), @@ -2183,9 +2183,9 @@ function create_1m1w1y24hBpsPercentRatioPattern(client, acc) { * @property {CentsDeltaUsdPattern} cap * @property {CumulativeNegativeRawSumPattern} loss * @property {MetricPattern1} mvrv - * @property {CumulativeRawSumPattern} netPnl + * @property {CumulativeDeltaRawSumPattern} netPnl * @property {BpsCentsRatioSatsUsdPattern} price - * @property {CumulativeRawSumPattern2} profit + * @property {CumulativeRawSumPattern3} profit * @property {RatioValuePattern} sopr */ @@ -2200,20 +2200,20 @@ function createCapLossMvrvNetPriceProfitSoprPattern(client, acc) { cap: createCentsDeltaUsdPattern(client, _m(acc, 'realized_cap')), loss: createCumulativeNegativeRawSumPattern(client, acc), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), - netPnl: createCumulativeRawSumPattern(client, _m(acc, 'net_realized_pnl')), + netPnl: createCumulativeDeltaRawSumPattern(client, _m(acc, 'net_realized_pnl')), price: createBpsCentsRatioSatsUsdPattern(client, _m(acc, 'realized_price')), - profit: createCumulativeRawSumPattern2(client, _m(acc, 'realized_profit')), + profit: createCumulativeRawSumPattern3(client, _m(acc, 'realized_profit')), sopr: createRatioValuePattern(client, acc), }; } /** * @typedef {Object} CumulativeDistributionRawRelSumValuePattern - * @property {MetricPattern1} cumulative + * @property {CentsUsdPattern2} cumulative * @property {MetricPattern1} distributionFlow - * @property {CentsUsdPattern} raw + * @property {CentsUsdPattern2} raw * @property {BpsPercentRatioPattern} relToRcap - * @property {_1m1w1y24hPattern3} sum + * @property {_1m1w1y24hPattern5} sum * @property {CumulativeRawSumPattern} valueCreated * @property {CumulativeRawSumPattern} valueDestroyed */ @@ -2226,11 +2226,11 @@ function createCapLossMvrvNetPriceProfitSoprPattern(client, acc) { */ function createCumulativeDistributionRawRelSumValuePattern(client, acc) { return { - cumulative: createMetricPattern1(client, _m(acc, 'realized_profit_cumulative')), + cumulative: createCentsUsdPattern2(client, _m(acc, 'realized_profit_cumulative')), distributionFlow: createMetricPattern1(client, _m(acc, 'distribution_flow')), - raw: createCentsUsdPattern(client, _m(acc, 'realized_profit')), + raw: createCentsUsdPattern2(client, _m(acc, 'realized_profit')), relToRcap: createBpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_rcap')), - sum: create_1m1w1y24hPattern3(client, _m(acc, 'realized_profit_sum')), + sum: create_1m1w1y24hPattern5(client, _m(acc, 'realized_profit_sum')), valueCreated: createCumulativeRawSumPattern(client, _m(acc, 'profit_value_created')), valueDestroyed: createCumulativeRawSumPattern(client, _m(acc, 'profit_value_destroyed')), }; @@ -2238,13 +2238,13 @@ function createCumulativeDistributionRawRelSumValuePattern(client, acc) { /** * @typedef {Object} CumulativeNegativeRawRelSumPattern2 - * @property {MetricPattern1} cumulative + * @property {CentsUsdPattern2} cumulative * @property {MetricPattern1} negative - * @property {CentsUsdPattern} raw - * @property {BpsPercentRatioPattern} relToMcap - * @property {BpsPercentRatioPattern} relToOwnGross + * @property {CentsUsdPattern2} raw + * @property {BpsPercentRatioPattern4} relToMcap + * @property {BpsPercentRatioPattern4} relToOwnGross * @property {BpsPercentRatioPattern} relToOwnMcap - * @property {_1m1w1y24hPattern3} sum + * @property {_1m1w1y24hPattern5} sum */ /** @@ -2255,19 +2255,19 @@ function createCumulativeDistributionRawRelSumValuePattern(client, acc) { */ function createCumulativeNegativeRawRelSumPattern2(client, acc) { return { - cumulative: createMetricPattern1(client, _m(acc, 'unrealized_loss_cumulative')), + cumulative: createCentsUsdPattern2(client, _m(acc, 'unrealized_loss_cumulative')), negative: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss')), - raw: createCentsUsdPattern(client, _m(acc, 'unrealized_loss')), - relToMcap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_mcap')), - relToOwnGross: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_own_gross_pnl')), + raw: createCentsUsdPattern2(client, _m(acc, 'unrealized_loss')), + relToMcap: createBpsPercentRatioPattern4(client, _m(acc, 'unrealized_loss_rel_to_mcap')), + relToOwnGross: createBpsPercentRatioPattern4(client, _m(acc, 'unrealized_loss_rel_to_own_gross_pnl')), relToOwnMcap: createBpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_own_mcap')), - sum: create_1m1w1y24hPattern3(client, _m(acc, 'unrealized_loss_sum')), + sum: create_1m1w1y24hPattern5(client, _m(acc, 'unrealized_loss_sum')), }; } /** * @typedef {Object} GrossInvestedLossNetNuplProfitSentimentPattern2 - * @property {CentsUsdPattern} grossPnl + * @property {CentsUsdPattern2} grossPnl * @property {InPattern} investedCapital * @property {CumulativeNegativeRawRelSumPattern2} loss * @property {CentsRelUsdPattern2} netPnl @@ -2284,7 +2284,7 @@ function createCumulativeNegativeRawRelSumPattern2(client, acc) { */ function createGrossInvestedLossNetNuplProfitSentimentPattern2(client, acc) { return { - grossPnl: createCentsUsdPattern(client, _m(acc, 'unrealized_gross_pnl')), + grossPnl: createCentsUsdPattern2(client, _m(acc, 'unrealized_gross_pnl')), investedCapital: createInPattern(client, _m(acc, 'invested_capital_in')), loss: createCumulativeNegativeRawRelSumPattern2(client, acc), netPnl: createCentsRelUsdPattern2(client, _m(acc, 'net_unrealized_pnl')), @@ -2296,12 +2296,12 @@ function createGrossInvestedLossNetNuplProfitSentimentPattern2(client, acc) { /** * @typedef {Object} _1m1w1y2y4yAllPattern - * @property {BpsRatioPattern} _1m - * @property {BpsRatioPattern} _1w - * @property {BpsRatioPattern} _1y - * @property {BpsRatioPattern} _2y - * @property {BpsRatioPattern} _4y - * @property {BpsRatioPattern} all + * @property {BpsRatioPattern2} _1m + * @property {BpsRatioPattern2} _1w + * @property {BpsRatioPattern2} _1y + * @property {BpsRatioPattern2} _2y + * @property {BpsRatioPattern2} _4y + * @property {BpsRatioPattern2} all */ /** @@ -2312,12 +2312,12 @@ function createGrossInvestedLossNetNuplProfitSentimentPattern2(client, acc) { */ function create_1m1w1y2y4yAllPattern(client, acc) { return { - _1m: createBpsRatioPattern(client, _m(acc, '1m')), - _1w: createBpsRatioPattern(client, _m(acc, '1w')), - _1y: createBpsRatioPattern(client, _m(acc, '1y')), - _2y: createBpsRatioPattern(client, _m(acc, '2y')), - _4y: createBpsRatioPattern(client, _m(acc, '4y')), - all: createBpsRatioPattern(client, _m(acc, 'all')), + _1m: createBpsRatioPattern2(client, _m(acc, '1m')), + _1w: createBpsRatioPattern2(client, _m(acc, '1w')), + _1y: createBpsRatioPattern2(client, _m(acc, '1y')), + _2y: createBpsRatioPattern2(client, _m(acc, '2y')), + _4y: createBpsRatioPattern2(client, _m(acc, '4y')), + all: createBpsRatioPattern2(client, _m(acc, 'all')), }; } @@ -2352,8 +2352,8 @@ function createBpsCentsPercentilesRatioSatsUsdPattern(client, acc) { * @typedef {Object} BtcCentsRelSatsUsdPattern3 * @property {MetricPattern1} btc * @property {MetricPattern1} cents - * @property {BpsPercentRatioPattern} relToCirculating - * @property {BpsPercentRatioPattern} relToOwn + * @property {BpsPercentRatioPattern4} relToCirculating + * @property {BpsPercentRatioPattern4} relToOwn * @property {MetricPattern1} sats * @property {MetricPattern1} usd */ @@ -2368,8 +2368,8 @@ function createBtcCentsRelSatsUsdPattern3(client, acc) { return { btc: createMetricPattern1(client, acc), cents: createMetricPattern1(client, _m(acc, 'cents')), - relToCirculating: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_circulating')), - relToOwn: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_own')), + relToCirculating: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_circulating')), + relToOwn: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_own')), sats: createMetricPattern1(client, _m(acc, 'sats')), usd: createMetricPattern1(client, _m(acc, 'usd')), }; @@ -2377,11 +2377,11 @@ function createBtcCentsRelSatsUsdPattern3(client, acc) { /** * @typedef {Object} CapLossMvrvPriceProfitSoprPattern - * @property {CentsUsdPattern} cap - * @property {CumulativeRawSumPattern2} loss + * @property {CentsDeltaUsdPattern} cap + * @property {CumulativeRawSumPattern3} loss * @property {MetricPattern1} mvrv * @property {BpsCentsRatioSatsUsdPattern} price - * @property {CumulativeRawSumPattern2} profit + * @property {CumulativeRawSumPattern3} profit * @property {ValuePattern} sopr */ @@ -2393,11 +2393,11 @@ function createBtcCentsRelSatsUsdPattern3(client, acc) { */ function createCapLossMvrvPriceProfitSoprPattern(client, acc) { return { - cap: createCentsUsdPattern(client, _m(acc, 'realized_cap')), - loss: createCumulativeRawSumPattern2(client, _m(acc, 'realized_loss')), + cap: createCentsDeltaUsdPattern(client, _m(acc, 'realized_cap')), + loss: createCumulativeRawSumPattern3(client, _m(acc, 'realized_loss')), mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), price: createBpsCentsRatioSatsUsdPattern(client, _m(acc, 'realized_price')), - profit: createCumulativeRawSumPattern2(client, _m(acc, 'realized_profit')), + profit: createCumulativeRawSumPattern3(client, _m(acc, 'realized_profit')), sopr: createValuePattern(client, _m(acc, 'value')), }; } @@ -2405,11 +2405,11 @@ function createCapLossMvrvPriceProfitSoprPattern(client, acc) { /** * @typedef {Object} ChangeCumulativeDeltaRawRelSumPattern * @property {RelPattern} change1m - * @property {MetricPattern1} cumulative - * @property {ChangeRatePattern2} delta - * @property {MetricPattern1} raw - * @property {BpsPercentRatioPattern} relToRcap - * @property {_1m1w1y24hPattern} sum + * @property {CentsUsdPattern} cumulative + * @property {ChangeRatePattern3} delta + * @property {CentsUsdPattern} raw + * @property {BpsPercentRatioPattern2} relToRcap + * @property {_1m1w1y24hPattern4} sum */ /** @@ -2421,22 +2421,22 @@ function createCapLossMvrvPriceProfitSoprPattern(client, acc) { function createChangeCumulativeDeltaRawRelSumPattern(client, acc) { return { change1m: createRelPattern(client, _m(acc, 'pnl_change_1m_rel_to')), - cumulative: createMetricPattern1(client, _m(acc, 'realized_pnl_cumulative')), - delta: createChangeRatePattern2(client, _m(acc, 'pnl_delta')), - raw: createMetricPattern1(client, _m(acc, 'realized_pnl')), - relToRcap: createBpsPercentRatioPattern(client, _m(acc, 'realized_pnl_rel_to_rcap')), - sum: create_1m1w1y24hPattern(client, _m(acc, 'realized_pnl_sum')), + cumulative: createCentsUsdPattern(client, _m(acc, 'realized_pnl_cumulative')), + delta: createChangeRatePattern3(client, _m(acc, 'realized_pnl_delta')), + raw: createCentsUsdPattern(client, _m(acc, 'realized_pnl')), + relToRcap: createBpsPercentRatioPattern2(client, _m(acc, 'realized_pnl_rel_to_rcap')), + sum: create_1m1w1y24hPattern4(client, _m(acc, 'realized_pnl_sum')), }; } /** * @typedef {Object} CumulativeRawRelSumPattern2 - * @property {MetricPattern1} cumulative - * @property {CentsUsdPattern} raw - * @property {BpsPercentRatioPattern} relToMcap - * @property {BpsPercentRatioPattern} relToOwnGross - * @property {BpsPercentRatioPattern} relToOwnMcap - * @property {_1m1w1y24hPattern3} sum + * @property {CentsUsdPattern2} cumulative + * @property {CentsUsdPattern2} raw + * @property {BpsPercentRatioPattern4} relToMcap + * @property {BpsPercentRatioPattern4} relToOwnGross + * @property {BpsPercentRatioPattern4} relToOwnMcap + * @property {_1m1w1y24hPattern5} sum */ /** @@ -2447,22 +2447,22 @@ function createChangeCumulativeDeltaRawRelSumPattern(client, acc) { */ function createCumulativeRawRelSumPattern2(client, acc) { return { - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - raw: createCentsUsdPattern(client, acc), - relToMcap: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_mcap')), - relToOwnGross: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_own_gross_pnl')), - relToOwnMcap: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_own_mcap')), - sum: create_1m1w1y24hPattern3(client, _m(acc, 'sum')), + cumulative: createCentsUsdPattern2(client, _m(acc, 'cumulative')), + raw: createCentsUsdPattern2(client, acc), + relToMcap: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_mcap')), + relToOwnGross: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_own_gross_pnl')), + relToOwnMcap: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_own_mcap')), + sum: create_1m1w1y24hPattern5(client, _m(acc, 'sum')), }; } /** * @typedef {Object} DeltaHalfInRelTotalPattern - * @property {ChangeRatePattern} delta + * @property {ChangeRatePattern2} delta * @property {BtcCentsSatsUsdPattern} half * @property {BtcCentsRelSatsUsdPattern} inLoss * @property {BtcCentsRelSatsUsdPattern} inProfit - * @property {BpsPercentRatioPattern} relToCirculating + * @property {BpsPercentRatioPattern4} relToCirculating * @property {BtcCentsSatsUsdPattern} total */ @@ -2474,22 +2474,22 @@ function createCumulativeRawRelSumPattern2(client, acc) { */ function createDeltaHalfInRelTotalPattern(client, acc) { return { - delta: createChangeRatePattern(client, _m(acc, 'delta')), + delta: createChangeRatePattern2(client, _m(acc, 'delta')), half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')), inLoss: createBtcCentsRelSatsUsdPattern(client, _m(acc, 'in_loss')), inProfit: createBtcCentsRelSatsUsdPattern(client, _m(acc, 'in_profit')), - relToCirculating: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_circulating')), + relToCirculating: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_circulating')), total: createBtcCentsSatsUsdPattern(client, acc), }; } /** * @typedef {Object} DeltaHalfInRelTotalPattern2 - * @property {ChangeRatePattern} delta + * @property {ChangeRatePattern2} delta * @property {BtcCentsSatsUsdPattern} half * @property {BtcCentsRelSatsUsdPattern3} inLoss * @property {BtcCentsRelSatsUsdPattern3} inProfit - * @property {BpsPercentRatioPattern} relToCirculating + * @property {BpsPercentRatioPattern4} relToCirculating * @property {BtcCentsSatsUsdPattern} total */ @@ -2501,11 +2501,11 @@ function createDeltaHalfInRelTotalPattern(client, acc) { */ function createDeltaHalfInRelTotalPattern2(client, acc) { return { - delta: createChangeRatePattern(client, _m(acc, 'delta')), + delta: createChangeRatePattern2(client, _m(acc, 'delta')), half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')), inLoss: createBtcCentsRelSatsUsdPattern3(client, _m(acc, 'in_loss')), inProfit: createBtcCentsRelSatsUsdPattern3(client, _m(acc, 'in_profit')), - relToCirculating: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_circulating')), + relToCirculating: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_circulating')), total: createBtcCentsSatsUsdPattern(client, acc), }; } @@ -2540,7 +2540,7 @@ function createPct1Pct2Pct5Pct95Pct98Pct99Pattern(client, acc) { /** * @typedef {Object} ActivityOutputsRealizedSupplyUnrealizedPattern * @property {CoindaysSentPattern} activity - * @property {UnspentPattern2} outputs + * @property {UnspentPattern} outputs * @property {CapLossMvrvNetPriceProfitSoprPattern} realized * @property {DeltaHalfInRelTotalPattern} supply * @property {LossNetNuplProfitPattern} unrealized @@ -2555,7 +2555,7 @@ function createPct1Pct2Pct5Pct95Pct98Pct99Pattern(client, acc) { function createActivityOutputsRealizedSupplyUnrealizedPattern(client, acc) { return { activity: createCoindaysSentPattern(client, acc), - outputs: createUnspentPattern2(client, _m(acc, 'utxo_count')), + outputs: createUnspentPattern(client, _m(acc, 'utxo_count')), realized: createCapLossMvrvNetPriceProfitSoprPattern(client, acc), supply: createDeltaHalfInRelTotalPattern(client, _m(acc, 'supply')), unrealized: createLossNetNuplProfitPattern(client, acc), @@ -2567,7 +2567,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern(client, acc) { * @property {DeltaInnerPattern} addressCount * @property {UnspentPattern} outputs * @property {CapLossMvrvPriceProfitSoprPattern} realized - * @property {HalfTotalPattern} supply + * @property {DeltaHalfTotalPattern} supply * @property {NuplPattern} unrealized */ @@ -2582,7 +2582,7 @@ function createAddressOutputsRealizedSupplyUnrealizedPattern(client, acc) { addressCount: createDeltaInnerPattern(client, _m(acc, 'address_count')), outputs: createUnspentPattern(client, _m(acc, 'utxo_count')), realized: createCapLossMvrvPriceProfitSoprPattern(client, acc), - supply: createHalfTotalPattern(client, _m(acc, 'supply')), + supply: createDeltaHalfTotalPattern(client, _m(acc, 'supply')), unrealized: createNuplPattern(client, _m(acc, 'nupl')), }; } @@ -2616,7 +2616,7 @@ function createBpsCentsRatioSatsUsdPattern(client, acc) { * @typedef {Object} BtcCentsRelSatsUsdPattern * @property {MetricPattern1} btc * @property {MetricPattern1} cents - * @property {BpsPercentRatioPattern} relToCirculating + * @property {BpsPercentRatioPattern4} relToCirculating * @property {MetricPattern1} sats * @property {MetricPattern1} usd */ @@ -2631,7 +2631,7 @@ function createBtcCentsRelSatsUsdPattern(client, acc) { return { btc: createMetricPattern1(client, acc), cents: createMetricPattern1(client, _m(acc, 'cents')), - relToCirculating: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_circulating')), + relToCirculating: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_circulating')), sats: createMetricPattern1(client, _m(acc, 'sats')), usd: createMetricPattern1(client, _m(acc, 'usd')), }; @@ -2641,7 +2641,7 @@ function createBtcCentsRelSatsUsdPattern(client, acc) { * @typedef {Object} BtcCentsRelSatsUsdPattern2 * @property {MetricPattern1} btc * @property {MetricPattern1} cents - * @property {BpsPercentRatioPattern} relToOwn + * @property {BpsPercentRatioPattern4} relToOwn * @property {MetricPattern1} sats * @property {MetricPattern1} usd */ @@ -2656,7 +2656,7 @@ function createBtcCentsRelSatsUsdPattern2(client, acc) { return { btc: createMetricPattern1(client, acc), cents: createMetricPattern1(client, _m(acc, 'cents')), - relToOwn: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_own')), + relToOwn: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_own')), sats: createMetricPattern1(client, _m(acc, 'sats')), usd: createMetricPattern1(client, _m(acc, 'usd')), }; @@ -2690,8 +2690,8 @@ function createCoindaysCoinyearsDormancySentVelocityPattern(client, acc) { /** * @typedef {Object} CumulativeInRawSumPattern * @property {MetricPattern1} cumulative - * @property {CumulativeRawSumPattern3} inLoss - * @property {CumulativeRawSumPattern3} inProfit + * @property {CumulativeRawSumPattern4} inLoss + * @property {CumulativeRawSumPattern4} inProfit * @property {MetricPattern1} raw * @property {_1m1w1y24hPattern} sum */ @@ -2705,13 +2705,38 @@ function createCoindaysCoinyearsDormancySentVelocityPattern(client, acc) { function createCumulativeInRawSumPattern(client, acc) { return { cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - inLoss: createCumulativeRawSumPattern3(client, _m(acc, 'in_loss')), - inProfit: createCumulativeRawSumPattern3(client, _m(acc, 'in_profit')), + inLoss: createCumulativeRawSumPattern4(client, _m(acc, 'in_loss')), + inProfit: createCumulativeRawSumPattern4(client, _m(acc, 'in_profit')), raw: createMetricPattern1(client, acc), sum: create_1m1w1y24hPattern(client, _m(acc, 'sum')), }; } +/** + * @typedef {Object} DeltaHalfInTotalPattern2 + * @property {ChangeRatePattern2} delta + * @property {BtcCentsSatsUsdPattern} half + * @property {BtcCentsSatsUsdPattern} inLoss + * @property {BtcCentsSatsUsdPattern} inProfit + * @property {BtcCentsSatsUsdPattern} total + */ + +/** + * Create a DeltaHalfInTotalPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {DeltaHalfInTotalPattern2} + */ +function createDeltaHalfInTotalPattern2(client, acc) { + return { + delta: createChangeRatePattern2(client, _m(acc, 'delta')), + half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')), + inLoss: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_loss')), + inProfit: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_profit')), + total: createBtcCentsSatsUsdPattern(client, acc), + }; +} + /** * @typedef {Object} EmaHistogramLineSignalPattern * @property {MetricPattern1} emaFast @@ -2743,7 +2768,7 @@ function createEmaHistogramLineSignalPattern(client, acc) { * @property {CentsSatsUsdPattern} max * @property {CentsSatsUsdPattern} min * @property {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} percentiles - * @property {BpsPercentRatioPattern} supplyDensity + * @property {BpsPercentRatioPattern4} supplyDensity */ /** @@ -2758,7 +2783,7 @@ function createInvestedMaxMinPercentilesSupplyPattern(client, acc) { max: createCentsSatsUsdPattern(client, _m(acc, 'cost_basis_max')), min: createCentsSatsUsdPattern(client, _m(acc, 'cost_basis_min')), percentiles: createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, _m(acc, 'cost_basis')), - supplyDensity: createBpsPercentRatioPattern(client, _m(acc, 'supply_density')), + supplyDensity: createBpsPercentRatioPattern4(client, _m(acc, 'supply_density')), }; } @@ -2766,7 +2791,7 @@ function createInvestedMaxMinPercentilesSupplyPattern(client, acc) { * @typedef {Object} PhsReboundThsPattern * @property {MetricPattern1} phs * @property {MetricPattern1} phsMin - * @property {BpsPercentRatioPattern} rebound + * @property {BpsPercentRatioPattern2} rebound * @property {MetricPattern1} ths * @property {MetricPattern1} thsMin */ @@ -2781,7 +2806,7 @@ function createPhsReboundThsPattern(client, acc) { return { phs: createMetricPattern1(client, _m(acc, 'phs')), phsMin: createMetricPattern1(client, _m(acc, 'phs_min')), - rebound: createBpsPercentRatioPattern(client, _m(acc, 'rebound')), + rebound: createBpsPercentRatioPattern2(client, _m(acc, 'rebound')), ths: createMetricPattern1(client, _m(acc, 'ths')), thsMin: createMetricPattern1(client, _m(acc, 'ths_min')), }; @@ -2838,7 +2863,30 @@ function create_1m1w1y24hPattern2(client, acc) { } /** - * @typedef {Object} _1m1w1y24hPattern4 + * @typedef {Object} _1m1w1y24hPattern3 + * @property {BpsPercentRatioPattern2} _1m + * @property {BpsPercentRatioPattern2} _1w + * @property {BpsPercentRatioPattern2} _1y + * @property {BpsPercentRatioPattern2} _24h + */ + +/** + * Create a _1m1w1y24hPattern3 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_1m1w1y24hPattern3} + */ +function create_1m1w1y24hPattern3(client, acc) { + return { + _1m: createBpsPercentRatioPattern2(client, _m(acc, '1m_rate')), + _1w: createBpsPercentRatioPattern2(client, _m(acc, '1w_rate')), + _1y: createBpsPercentRatioPattern2(client, _m(acc, '1y_rate')), + _24h: createBpsPercentRatioPattern2(client, _m(acc, '24h_rate')), + }; +} + +/** + * @typedef {Object} _1m1w1y24hPattern6 * @property {BtcCentsSatsUsdPattern} _1m * @property {BtcCentsSatsUsdPattern} _1w * @property {BtcCentsSatsUsdPattern} _1y @@ -2846,12 +2894,12 @@ function create_1m1w1y24hPattern2(client, acc) { */ /** - * Create a _1m1w1y24hPattern4 pattern node + * Create a _1m1w1y24hPattern6 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {_1m1w1y24hPattern4} + * @returns {_1m1w1y24hPattern6} */ -function create_1m1w1y24hPattern4(client, acc) { +function create_1m1w1y24hPattern6(client, acc) { return { _1m: createBtcCentsSatsUsdPattern(client, _m(acc, '1m')), _1w: createBtcCentsSatsUsdPattern(client, _m(acc, '1w')), @@ -2884,7 +2932,7 @@ function create_1m1w1y2wPattern(client, acc) { } /** - * @typedef {Object} _1m1w1y24hPattern3 + * @typedef {Object} _1m1w1y24hPattern4 * @property {CentsUsdPattern} _1m * @property {CentsUsdPattern} _1w * @property {CentsUsdPattern} _1y @@ -2892,17 +2940,40 @@ function create_1m1w1y2wPattern(client, acc) { */ /** - * Create a _1m1w1y24hPattern3 pattern node + * Create a _1m1w1y24hPattern4 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {_1m1w1y24hPattern3} + * @returns {_1m1w1y24hPattern4} */ -function create_1m1w1y24hPattern3(client, acc) { +function create_1m1w1y24hPattern4(client, acc) { return { - _1m: createCentsUsdPattern(client, _m(acc, '1m')), - _1w: createCentsUsdPattern(client, _m(acc, '1w')), - _1y: createCentsUsdPattern(client, _m(acc, '1y')), - _24h: createCentsUsdPattern(client, _m(acc, '24h')), + _1m: createCentsUsdPattern(client, _m(acc, '1m_change')), + _1w: createCentsUsdPattern(client, _m(acc, '1w_change')), + _1y: createCentsUsdPattern(client, _m(acc, '1y_change')), + _24h: createCentsUsdPattern(client, _m(acc, '24h_change')), + }; +} + +/** + * @typedef {Object} _1m1w1y24hPattern5 + * @property {CentsUsdPattern2} _1m + * @property {CentsUsdPattern2} _1w + * @property {CentsUsdPattern2} _1y + * @property {CentsUsdPattern2} _24h + */ + +/** + * Create a _1m1w1y24hPattern5 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {_1m1w1y24hPattern5} + */ +function create_1m1w1y24hPattern5(client, acc) { + return { + _1m: createCentsUsdPattern2(client, _m(acc, '1m')), + _1w: createCentsUsdPattern2(client, _m(acc, '1w')), + _1y: createCentsUsdPattern2(client, _m(acc, '1y')), + _24h: createCentsUsdPattern2(client, _m(acc, '24h')), }; } @@ -3001,7 +3072,7 @@ function createBtcCentsSatsUsdPattern(client, acc) { /** * @typedef {Object} CentsDeltaRelUsdPattern * @property {MetricPattern1} cents - * @property {ChangeRatePattern2} delta + * @property {ChangeRatePattern3} delta * @property {BpsPercentRatioPattern} relToOwnMcap * @property {MetricPattern1} usd */ @@ -3015,7 +3086,7 @@ function createBtcCentsSatsUsdPattern(client, acc) { function createCentsDeltaRelUsdPattern(client, acc) { return { cents: createMetricPattern1(client, _m(acc, 'cents')), - delta: createChangeRatePattern2(client, _m(acc, 'delta')), + delta: createChangeRatePattern3(client, _m(acc, 'delta')), relToOwnMcap: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_own_mcap')), usd: createMetricPattern1(client, acc), }; @@ -3024,8 +3095,8 @@ function createCentsDeltaRelUsdPattern(client, acc) { /** * @typedef {Object} CentsRelUsdPattern2 * @property {MetricPattern1} cents - * @property {BpsPercentRatioPattern} relToOwnGross - * @property {BpsPercentRatioPattern} relToOwnMcap + * @property {BpsPercentRatioPattern2} relToOwnGross + * @property {BpsPercentRatioPattern2} relToOwnMcap * @property {MetricPattern1} usd */ @@ -3038,18 +3109,41 @@ function createCentsDeltaRelUsdPattern(client, acc) { function createCentsRelUsdPattern2(client, acc) { return { cents: createMetricPattern1(client, _m(acc, 'cents')), - relToOwnGross: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_own_gross_pnl')), - relToOwnMcap: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_own_mcap')), + relToOwnGross: createBpsPercentRatioPattern2(client, _m(acc, 'rel_to_own_gross_pnl')), + relToOwnMcap: createBpsPercentRatioPattern2(client, _m(acc, 'rel_to_own_mcap')), usd: createMetricPattern1(client, acc), }; } /** - * @typedef {Object} CumulativeNegativeRawSumPattern - * @property {MetricPattern1} cumulative - * @property {MetricPattern1} negative + * @typedef {Object} CumulativeDeltaRawSumPattern + * @property {CentsUsdPattern} cumulative + * @property {ChangeRatePattern3} delta * @property {CentsUsdPattern} raw - * @property {_1m1w1y24hPattern3} sum + * @property {_1m1w1y24hPattern4} sum + */ + +/** + * Create a CumulativeDeltaRawSumPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CumulativeDeltaRawSumPattern} + */ +function createCumulativeDeltaRawSumPattern(client, acc) { + return { + cumulative: createCentsUsdPattern(client, _m(acc, 'cumulative')), + delta: createChangeRatePattern3(client, _m(acc, 'delta')), + raw: createCentsUsdPattern(client, acc), + sum: create_1m1w1y24hPattern4(client, _m(acc, 'sum')), + }; +} + +/** + * @typedef {Object} CumulativeNegativeRawSumPattern + * @property {CentsUsdPattern2} cumulative + * @property {MetricPattern1} negative + * @property {CentsUsdPattern2} raw + * @property {_1m1w1y24hPattern5} sum */ /** @@ -3060,33 +3154,10 @@ function createCentsRelUsdPattern2(client, acc) { */ function createCumulativeNegativeRawSumPattern(client, acc) { return { - cumulative: createMetricPattern1(client, _m(acc, 'unrealized_loss_cumulative')), + cumulative: createCentsUsdPattern2(client, _m(acc, 'unrealized_loss_cumulative')), negative: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss')), - raw: createCentsUsdPattern(client, _m(acc, 'unrealized_loss')), - sum: create_1m1w1y24hPattern3(client, _m(acc, 'unrealized_loss_sum')), - }; -} - -/** - * @typedef {Object} HalfInTotalPattern - * @property {BtcCentsSatsUsdPattern} half - * @property {BtcCentsSatsUsdPattern} inLoss - * @property {BtcCentsSatsUsdPattern} inProfit - * @property {BtcCentsSatsUsdPattern} total - */ - -/** - * Create a HalfInTotalPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {HalfInTotalPattern} - */ -function createHalfInTotalPattern(client, acc) { - return { - half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')), - inLoss: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_loss')), - inProfit: createBtcCentsSatsUsdPattern(client, _m(acc, 'in_profit')), - total: createBtcCentsSatsUsdPattern(client, acc), + raw: createCentsUsdPattern2(client, _m(acc, 'unrealized_loss')), + sum: create_1m1w1y24hPattern5(client, _m(acc, 'unrealized_loss_sum')), }; } @@ -3095,7 +3166,7 @@ function createHalfInTotalPattern(client, acc) { * @property {CumulativeNegativeRawSumPattern} loss * @property {CentsUsdPattern} netPnl * @property {BpsRatioPattern} nupl - * @property {CumulativeRawSumPattern2} profit + * @property {CumulativeRawSumPattern3} profit */ /** @@ -3109,7 +3180,7 @@ function createLossNetNuplProfitPattern(client, acc) { loss: createCumulativeNegativeRawSumPattern(client, acc), netPnl: createCentsUsdPattern(client, _m(acc, 'net_unrealized_pnl')), nupl: createBpsRatioPattern(client, _m(acc, 'nupl')), - profit: createCumulativeRawSumPattern2(client, _m(acc, 'unrealized_profit')), + profit: createCumulativeRawSumPattern3(client, _m(acc, 'unrealized_profit')), }; } @@ -3117,7 +3188,7 @@ function createLossNetNuplProfitPattern(client, acc) { * @typedef {Object} OutputsRealizedSupplyUnrealizedPattern2 * @property {UnspentPattern} outputs * @property {CapLossMvrvPriceProfitSoprPattern} realized - * @property {HalfInTotalPattern} supply + * @property {DeltaHalfInTotalPattern2} supply * @property {LossNuplProfitPattern} unrealized */ @@ -3131,7 +3202,7 @@ function createOutputsRealizedSupplyUnrealizedPattern2(client, acc) { return { outputs: createUnspentPattern(client, _m(acc, 'utxo_count')), realized: createCapLossMvrvPriceProfitSoprPattern(client, acc), - supply: createHalfInTotalPattern(client, _m(acc, 'supply')), + supply: createDeltaHalfInTotalPattern2(client, _m(acc, 'supply')), unrealized: createLossNuplProfitPattern(client, acc), }; } @@ -3140,7 +3211,7 @@ function createOutputsRealizedSupplyUnrealizedPattern2(client, acc) { * @typedef {Object} OutputsRealizedSupplyUnrealizedPattern * @property {UnspentPattern} outputs * @property {CapLossMvrvPriceProfitSoprPattern} realized - * @property {HalfTotalPattern} supply + * @property {DeltaHalfTotalPattern} supply * @property {NuplPattern} unrealized */ @@ -3154,7 +3225,7 @@ function createOutputsRealizedSupplyUnrealizedPattern(client, acc) { return { outputs: createUnspentPattern(client, _m(acc, 'utxo_count')), realized: createCapLossMvrvPriceProfitSoprPattern(client, acc), - supply: createHalfTotalPattern(client, _m(acc, 'supply')), + supply: createDeltaHalfTotalPattern(client, _m(acc, 'supply')), unrealized: createNuplPattern(client, _m(acc, 'nupl')), }; } @@ -3186,9 +3257,9 @@ function create_1m1w1y24hPattern(client, acc) { /** * @typedef {Object} BlocksDominanceRewardsPattern - * @property {CumulativeRawSumPattern} blocksMined + * @property {CumulativeRawSumPattern2} blocksMined * @property {_1m1w1y24hBpsPercentRatioPattern} dominance - * @property {CumulativeRawSumPattern3} rewards + * @property {CumulativeRawSumPattern4} rewards */ /** @@ -3199,15 +3270,36 @@ function create_1m1w1y24hPattern(client, acc) { */ function createBlocksDominanceRewardsPattern(client, acc) { return { - blocksMined: createCumulativeRawSumPattern(client, _m(acc, 'blocks_mined')), + blocksMined: createCumulativeRawSumPattern2(client, _m(acc, 'blocks_mined')), dominance: create_1m1w1y24hBpsPercentRatioPattern(client, _m(acc, 'dominance')), - rewards: createCumulativeRawSumPattern3(client, _m(acc, 'rewards')), + rewards: createCumulativeRawSumPattern4(client, _m(acc, 'rewards')), + }; +} + +/** + * @typedef {Object} BpsPercentRatioPattern4 + * @property {MetricPattern1} bps + * @property {MetricPattern1} percent + * @property {MetricPattern1} ratio + */ + +/** + * Create a BpsPercentRatioPattern4 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BpsPercentRatioPattern4} + */ +function createBpsPercentRatioPattern4(client, acc) { + return { + bps: createMetricPattern1(client, _m(acc, 'bps')), + percent: createMetricPattern1(client, acc), + ratio: createMetricPattern1(client, _m(acc, 'ratio')), }; } /** * @typedef {Object} BpsPercentRatioPattern - * @property {MetricPattern1} bps + * @property {MetricPattern1} bps * @property {MetricPattern1} percent * @property {MetricPattern1} ratio */ @@ -3248,19 +3340,61 @@ function createBpsPriceRatioPattern(client, acc) { } /** - * @typedef {Object} CentsSatsUsdPattern2 + * @typedef {Object} BpsPercentRatioPattern5 + * @property {MetricPattern1} bps + * @property {MetricPattern1} percent + * @property {MetricPattern1} ratio + */ + +/** + * Create a BpsPercentRatioPattern5 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {BpsPercentRatioPattern5} + */ +function createBpsPercentRatioPattern5(client, acc) { + return { + bps: createMetricPattern1(client, _m(acc, 'bps')), + percent: createMetricPattern1(client, acc), + ratio: createMetricPattern1(client, _m(acc, 'ratio')), + }; +} + +/** + * @typedef {Object} BpsPercentRatioPattern2 + * @property {MetricPattern1} 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: createMetricPattern1(client, _m(acc, 'bps')), + percent: createMetricPattern1(client, acc), + ratio: createMetricPattern1(client, _m(acc, 'ratio')), + }; +} + +/** + * @typedef {Object} CentsSatsUsdPattern3 * @property {MetricPattern2} cents * @property {MetricPattern2} sats * @property {MetricPattern2} usd */ /** - * Create a CentsSatsUsdPattern2 pattern node + * Create a CentsSatsUsdPattern3 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {CentsSatsUsdPattern2} + * @returns {CentsSatsUsdPattern3} */ -function createCentsSatsUsdPattern2(client, acc) { +function createCentsSatsUsdPattern3(client, acc) { return { cents: createMetricPattern2(client, _m(acc, 'cents')), sats: createMetricPattern2(client, _m(acc, 'sats')), @@ -3271,7 +3405,7 @@ function createCentsSatsUsdPattern2(client, acc) { /** * @typedef {Object} CentsDeltaUsdPattern * @property {MetricPattern1} cents - * @property {ChangeRatePattern2} delta + * @property {ChangeRatePattern3} delta * @property {MetricPattern1} usd */ @@ -3284,7 +3418,7 @@ function createCentsSatsUsdPattern2(client, acc) { function createCentsDeltaUsdPattern(client, acc) { return { cents: createMetricPattern1(client, _m(acc, 'cents')), - delta: createChangeRatePattern2(client, _m(acc, 'delta')), + delta: createChangeRatePattern3(client, _m(acc, 'delta')), usd: createMetricPattern1(client, acc), }; } @@ -3311,23 +3445,23 @@ function createCentsSatsUsdPattern(client, acc) { } /** - * @typedef {Object} CumulativeRawSumPattern3 + * @typedef {Object} CumulativeRawSumPattern4 * @property {BtcCentsSatsUsdPattern} cumulative * @property {BtcCentsSatsUsdPattern} raw - * @property {_1m1w1y24hPattern4} sum + * @property {_1m1w1y24hPattern6} sum */ /** - * Create a CumulativeRawSumPattern3 pattern node + * Create a CumulativeRawSumPattern4 pattern node * @param {BrkClientBase} client * @param {string} acc - Accumulated metric name - * @returns {CumulativeRawSumPattern3} + * @returns {CumulativeRawSumPattern4} */ -function createCumulativeRawSumPattern3(client, acc) { +function createCumulativeRawSumPattern4(client, acc) { return { cumulative: createBtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')), raw: createBtcCentsSatsUsdPattern(client, acc), - sum: create_1m1w1y24hPattern4(client, _m(acc, 'sum')), + sum: create_1m1w1y24hPattern6(client, _m(acc, 'sum')), }; } @@ -3352,11 +3486,32 @@ function createCumulativeRawRelPattern(client, acc) { }; } +/** + * @typedef {Object} CumulativeRawSumPattern3 + * @property {CentsUsdPattern2} cumulative + * @property {CentsUsdPattern2} raw + * @property {_1m1w1y24hPattern5} sum + */ + +/** + * Create a CumulativeRawSumPattern3 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CumulativeRawSumPattern3} + */ +function createCumulativeRawSumPattern3(client, acc) { + return { + cumulative: createCentsUsdPattern2(client, _m(acc, 'cumulative')), + raw: createCentsUsdPattern2(client, acc), + sum: create_1m1w1y24hPattern5(client, _m(acc, 'sum')), + }; +} + /** * @typedef {Object} CumulativeRawSumPattern2 - * @property {MetricPattern1} cumulative - * @property {CentsUsdPattern} raw - * @property {_1m1w1y24hPattern3} sum + * @property {MetricPattern1} cumulative + * @property {MetricPattern1} raw + * @property {_1m1w1y24hPattern} sum */ /** @@ -3368,16 +3523,37 @@ function createCumulativeRawRelPattern(client, acc) { function createCumulativeRawSumPattern2(client, acc) { return { cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), - raw: createCentsUsdPattern(client, acc), - sum: create_1m1w1y24hPattern3(client, _m(acc, 'sum')), + raw: createMetricPattern1(client, acc), + sum: create_1m1w1y24hPattern(client, _m(acc, 'sum')), + }; +} + +/** + * @typedef {Object} DeltaHalfTotalPattern + * @property {ChangeRatePattern2} delta + * @property {BtcCentsSatsUsdPattern} half + * @property {BtcCentsSatsUsdPattern} total + */ + +/** + * Create a DeltaHalfTotalPattern pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {DeltaHalfTotalPattern} + */ +function createDeltaHalfTotalPattern(client, acc) { + return { + delta: createChangeRatePattern2(client, _m(acc, 'delta')), + half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')), + total: createBtcCentsSatsUsdPattern(client, acc), }; } /** * @typedef {Object} GreedNetPainPattern - * @property {CentsUsdPattern} greedIndex + * @property {CentsUsdPattern2} greedIndex * @property {CentsUsdPattern} net - * @property {CentsUsdPattern} painIndex + * @property {CentsUsdPattern2} painIndex */ /** @@ -3388,17 +3564,17 @@ function createCumulativeRawSumPattern2(client, acc) { */ function createGreedNetPainPattern(client, acc) { return { - greedIndex: createCentsUsdPattern(client, _m(acc, 'greed_index')), + greedIndex: createCentsUsdPattern2(client, _m(acc, 'greed_index')), net: createCentsUsdPattern(client, _m(acc, 'net_sentiment')), - painIndex: createCentsUsdPattern(client, _m(acc, 'pain_index')), + painIndex: createCentsUsdPattern2(client, _m(acc, 'pain_index')), }; } /** * @typedef {Object} LossNuplProfitPattern - * @property {CumulativeRawSumPattern2} loss + * @property {CumulativeRawSumPattern3} loss * @property {BpsRatioPattern} nupl - * @property {CumulativeRawSumPattern2} profit + * @property {CumulativeRawSumPattern3} profit */ /** @@ -3409,9 +3585,9 @@ function createGreedNetPainPattern(client, acc) { */ function createLossNuplProfitPattern(client, acc) { return { - loss: createCumulativeRawSumPattern2(client, _m(acc, 'unrealized_loss')), + loss: createCumulativeRawSumPattern3(client, _m(acc, 'unrealized_loss')), nupl: createBpsRatioPattern(client, _m(acc, 'nupl')), - profit: createCumulativeRawSumPattern2(client, _m(acc, 'unrealized_profit')), + profit: createCumulativeRawSumPattern3(client, _m(acc, 'unrealized_profit')), }; } @@ -3526,8 +3702,8 @@ function createCumulativeRawSumPattern(client, acc) { /** * @typedef {Object} BlocksDominancePattern - * @property {CumulativeRawSumPattern} blocksMined - * @property {BpsPercentRatioPattern} dominance + * @property {CumulativeRawSumPattern2} blocksMined + * @property {BpsPercentRatioPattern4} dominance */ /** @@ -3538,14 +3714,33 @@ function createCumulativeRawSumPattern(client, acc) { */ function createBlocksDominancePattern(client, acc) { return { - blocksMined: createCumulativeRawSumPattern(client, _m(acc, 'blocks_mined')), - dominance: createBpsPercentRatioPattern(client, _m(acc, 'dominance')), + blocksMined: createCumulativeRawSumPattern2(client, _m(acc, 'blocks_mined')), + dominance: createBpsPercentRatioPattern4(client, _m(acc, 'dominance')), + }; +} + +/** + * @typedef {Object} BpsRatioPattern2 + * @property {MetricPattern1} bps + * @property {MetricPattern1} ratio + */ + +/** + * 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), }; } /** * @typedef {Object} BpsRatioPattern - * @property {MetricPattern1} bps + * @property {MetricPattern1} bps * @property {MetricPattern1} ratio */ @@ -3563,11 +3758,30 @@ function createBpsRatioPattern(client, acc) { } /** - * @typedef {Object} CentsUsdPattern + * @typedef {Object} CentsUsdPattern2 * @property {MetricPattern1} cents * @property {MetricPattern1} usd */ +/** + * Create a CentsUsdPattern2 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {CentsUsdPattern2} + */ +function createCentsUsdPattern2(client, acc) { + return { + cents: createMetricPattern1(client, _m(acc, 'cents')), + usd: createMetricPattern1(client, acc), + }; +} + +/** + * @typedef {Object} CentsUsdPattern + * @property {MetricPattern1} cents + * @property {MetricPattern1} usd + */ + /** * Create a CentsUsdPattern pattern node * @param {BrkClientBase} client @@ -3576,8 +3790,8 @@ function createBpsRatioPattern(client, acc) { */ function createCentsUsdPattern(client, acc) { return { - cents: createMetricPattern1(client, _m(acc, 'cents')), - usd: createMetricPattern1(client, acc), + cents: createMetricPattern1(client, acc), + usd: createMetricPattern1(client, _m(acc, 'usd')), }; } @@ -3602,8 +3816,8 @@ function createChangeRatePattern(client, acc) { /** * @typedef {Object} ChangeRatePattern2 - * @property {_1m1w1y24hPattern3} change - * @property {_1m1w1y24hPattern2} rate + * @property {_1m1w1y24hPattern} change + * @property {_1m1w1y24hPattern3} rate */ /** @@ -3614,8 +3828,27 @@ function createChangeRatePattern(client, acc) { */ function createChangeRatePattern2(client, acc) { return { - change: create_1m1w1y24hPattern3(client, acc), - rate: create_1m1w1y24hPattern2(client, acc), + change: create_1m1w1y24hPattern(client, acc), + rate: create_1m1w1y24hPattern3(client, acc), + }; +} + +/** + * @typedef {Object} ChangeRatePattern3 + * @property {_1m1w1y24hPattern4} change + * @property {_1m1w1y24hPattern3} rate + */ + +/** + * Create a ChangeRatePattern3 pattern node + * @param {BrkClientBase} client + * @param {string} acc - Accumulated metric name + * @returns {ChangeRatePattern3} + */ +function createChangeRatePattern3(client, acc) { + return { + change: create_1m1w1y24hPattern4(client, acc), + rate: create_1m1w1y24hPattern3(client, acc), }; } @@ -3640,7 +3873,7 @@ function createCoindaysSentPattern(client, acc) { /** * @typedef {Object} DeltaInnerPattern - * @property {ChangeRatePattern} delta + * @property {ChangeRatePattern2} delta * @property {MetricPattern1} inner */ @@ -3652,53 +3885,15 @@ function createCoindaysSentPattern(client, acc) { */ function createDeltaInnerPattern(client, acc) { return { - delta: createChangeRatePattern(client, _m(acc, 'delta')), + delta: createChangeRatePattern2(client, _m(acc, 'delta')), inner: createMetricPattern1(client, acc), }; } -/** - * @typedef {Object} DeltaRawPattern - * @property {ChangeRatePattern} delta - * @property {MetricPattern1} raw - */ - -/** - * Create a DeltaRawPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {DeltaRawPattern} - */ -function createDeltaRawPattern(client, acc) { - return { - delta: createChangeRatePattern(client, _m(acc, 'delta')), - raw: createMetricPattern1(client, acc), - }; -} - -/** - * @typedef {Object} HalfTotalPattern - * @property {BtcCentsSatsUsdPattern} half - * @property {BtcCentsSatsUsdPattern} total - */ - -/** - * Create a HalfTotalPattern pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {HalfTotalPattern} - */ -function createHalfTotalPattern(client, acc) { - return { - half: createBtcCentsSatsUsdPattern(client, _m(acc, 'half')), - total: createBtcCentsSatsUsdPattern(client, acc), - }; -} - /** * @typedef {Object} InPattern - * @property {CentsUsdPattern} inLoss - * @property {CentsUsdPattern} inProfit + * @property {CentsUsdPattern2} inLoss + * @property {CentsUsdPattern2} inProfit */ /** @@ -3709,8 +3904,8 @@ function createHalfTotalPattern(client, acc) { */ function createInPattern(client, acc) { return { - inLoss: createCentsUsdPattern(client, _m(acc, 'loss')), - inProfit: createCentsUsdPattern(client, _m(acc, 'profit')), + inLoss: createCentsUsdPattern2(client, _m(acc, 'loss')), + inProfit: createCentsUsdPattern2(client, _m(acc, 'profit')), }; } @@ -3754,8 +3949,8 @@ function createRealizedSupplyPattern(client, acc) { /** * @typedef {Object} RelPattern - * @property {BpsPercentRatioPattern} relToMcap - * @property {BpsPercentRatioPattern} relToRcap + * @property {BpsPercentRatioPattern2} relToMcap + * @property {BpsPercentRatioPattern2} relToRcap */ /** @@ -3766,8 +3961,8 @@ function createRealizedSupplyPattern(client, acc) { */ function createRelPattern(client, acc) { return { - relToMcap: createBpsPercentRatioPattern(client, _m(acc, 'mcap')), - relToRcap: createBpsPercentRatioPattern(client, _m(acc, 'rcap')), + relToMcap: createBpsPercentRatioPattern2(client, _m(acc, 'mcap')), + relToRcap: createBpsPercentRatioPattern2(client, _m(acc, 'rcap')), }; } @@ -3843,26 +4038,9 @@ function createNuplPattern(client, acc) { }; } -/** - * @typedef {Object} UnspentPattern2 - * @property {DeltaRawPattern} unspentCount - */ - -/** - * Create a UnspentPattern2 pattern node - * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name - * @returns {UnspentPattern2} - */ -function createUnspentPattern2(client, acc) { - return { - unspentCount: createDeltaRawPattern(client, acc), - }; -} - /** * @typedef {Object} UnspentPattern - * @property {MetricPattern1} unspentCount + * @property {DeltaInnerPattern} unspentCount */ /** @@ -3873,7 +4051,7 @@ function createUnspentPattern2(client, acc) { */ function createUnspentPattern(client, acc) { return { - unspentCount: createMetricPattern1(client, acc), + unspentCount: createDeltaInnerPattern(client, acc), }; } @@ -3918,7 +4096,7 @@ function createUnspentPattern(client, acc) { * @typedef {Object} MetricsTree_Blocks_Difficulty * @property {MetricPattern1} raw * @property {MetricPattern1} asHash - * @property {BpsPercentRatioPattern} adjustment + * @property {BpsPercentRatioPattern2} adjustment * @property {MetricPattern1} epoch * @property {MetricPattern1} blocksBeforeNext * @property {MetricPattern1} daysBeforeNext @@ -3964,7 +4142,7 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Blocks_Count * @property {MetricPattern1} target - * @property {CumulativeRawSumPattern} total + * @property {CumulativeRawSumPattern2} total */ /** @@ -4081,8 +4259,8 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Transactions_Volume - * @property {CumulativeRawSumPattern3} sentSum - * @property {CumulativeRawSumPattern3} receivedSum + * @property {CumulativeRawSumPattern4} sentSum + * @property {CumulativeRawSumPattern4} receivedSum * @property {MetricPattern1} txPerSec * @property {MetricPattern1} outputsPerSec * @property {MetricPattern1} inputsPerSec @@ -4339,8 +4517,8 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Scripts_Adoption - * @property {BpsPercentRatioPattern} taproot - * @property {BpsPercentRatioPattern} segwit + * @property {BpsPercentRatioPattern4} taproot + * @property {BpsPercentRatioPattern4} segwit */ /** @@ -4351,10 +4529,10 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Mining_Rewards - * @property {CumulativeRawSumPattern3} coinbase + * @property {CumulativeRawSumPattern4} coinbase * @property {MetricsTree_Mining_Rewards_Subsidy} subsidy * @property {MetricsTree_Mining_Rewards_Fees} fees - * @property {CumulativeRawSumPattern3} unclaimed + * @property {CumulativeRawSumPattern4} unclaimed */ /** @@ -4362,14 +4540,14 @@ function createUnspentPattern(client, acc) { * @property {BtcCentsSatsUsdPattern} base * @property {BtcCentsSatsUsdPattern} cumulative * @property {_1m1w1y24hBpsPercentRatioPattern} dominance - * @property {CentsUsdPattern} sma1y + * @property {CentsUsdPattern2} sma1y */ /** * @typedef {Object} MetricsTree_Mining_Rewards_Fees * @property {BtcCentsSatsUsdPattern} base * @property {BtcCentsSatsUsdPattern} cumulative - * @property {_1m1w1y24hPattern4} sum + * @property {_1m1w1y24hPattern6} sum * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} _24h * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} _1w * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} _1m @@ -4380,10 +4558,10 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Mining_Rewards_Fees_RatioMultiple - * @property {BpsRatioPattern} _24h - * @property {BpsRatioPattern} _1w - * @property {BpsRatioPattern} _1m - * @property {BpsRatioPattern} _1y + * @property {BpsRatioPattern2} _24h + * @property {BpsRatioPattern2} _1w + * @property {BpsRatioPattern2} _1m + * @property {BpsRatioPattern2} _1y */ /** @@ -4398,7 +4576,7 @@ function createUnspentPattern(client, acc) { * @property {MetricPattern1} raw * @property {MetricsTree_Mining_Hashrate_Rate_Sma} sma * @property {MetricPattern1} ath - * @property {BpsPercentRatioPattern} drawdown + * @property {BpsPercentRatioPattern5} drawdown */ /** @@ -4446,12 +4624,12 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Cointime_Cap - * @property {CentsUsdPattern} thermo - * @property {CentsUsdPattern} investor - * @property {CentsUsdPattern} vaulted - * @property {CentsUsdPattern} active - * @property {CentsUsdPattern} cointime - * @property {BpsRatioPattern} aviv + * @property {CentsUsdPattern2} thermo + * @property {CentsUsdPattern2} investor + * @property {CentsUsdPattern2} vaulted + * @property {CentsUsdPattern2} active + * @property {CentsUsdPattern2} cointime + * @property {BpsRatioPattern2} aviv */ /** @@ -4469,7 +4647,7 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Cointime_Adjusted - * @property {BpsPercentRatioPattern} inflationRate + * @property {BpsPercentRatioPattern2} inflationRate * @property {MetricPattern1} txVelocityBtc * @property {MetricPattern1} txVelocityUsd */ @@ -4748,11 +4926,11 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Indicators - * @property {BpsRatioPattern} puellMultiple - * @property {BpsRatioPattern} nvt - * @property {BpsPercentRatioPattern} gini - * @property {BpsRatioPattern} rhodlRatio - * @property {BpsRatioPattern} thermocapMultiple + * @property {BpsRatioPattern2} puellMultiple + * @property {BpsRatioPattern2} nvt + * @property {BpsPercentRatioPattern4} gini + * @property {BpsRatioPattern2} rhodlRatio + * @property {BpsRatioPattern2} thermocapMultiple * @property {MetricPattern1} coindaysDestroyedSupplyAdjusted * @property {MetricPattern1} coinyearsDestroyedSupplyAdjusted * @property {MetricsTree_Indicators_Dormancy} dormancy @@ -4781,7 +4959,7 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Market_Ath * @property {CentsSatsUsdPattern} high - * @property {BpsPercentRatioPattern} drawdown + * @property {BpsPercentRatioPattern5} drawdown * @property {MetricPattern1} daysSince * @property {MetricPattern2} yearsSince * @property {MetricPattern1} maxDaysBetween @@ -4814,19 +4992,19 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Market_Returns_Periods - * @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 + * @property {BpsPercentRatioPattern2} _24h + * @property {BpsPercentRatioPattern2} _1w + * @property {BpsPercentRatioPattern2} _1m + * @property {BpsPercentRatioPattern2} _3m + * @property {BpsPercentRatioPattern2} _6m + * @property {BpsPercentRatioPattern2} _1y + * @property {BpsPercentRatioPattern2} _2y + * @property {BpsPercentRatioPattern2} _3y + * @property {BpsPercentRatioPattern2} _4y + * @property {BpsPercentRatioPattern2} _5y + * @property {BpsPercentRatioPattern2} _6y + * @property {BpsPercentRatioPattern2} _8y + * @property {BpsPercentRatioPattern2} _10y */ /** @@ -4861,7 +5039,7 @@ function createUnspentPattern(client, acc) { * @property {_1m1w1y2wPattern} max * @property {MetricPattern1} trueRange * @property {MetricPattern1} trueRangeSum2w - * @property {BpsPercentRatioPattern} choppinessIndex2w + * @property {BpsPercentRatioPattern4} choppinessIndex2w */ /** @@ -5026,26 +5204,26 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Market_Dca_Class_Return - * @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 + * @property {BpsPercentRatioPattern2} from2015 + * @property {BpsPercentRatioPattern2} from2016 + * @property {BpsPercentRatioPattern2} from2017 + * @property {BpsPercentRatioPattern2} from2018 + * @property {BpsPercentRatioPattern2} from2019 + * @property {BpsPercentRatioPattern2} from2020 + * @property {BpsPercentRatioPattern2} from2021 + * @property {BpsPercentRatioPattern2} from2022 + * @property {BpsPercentRatioPattern2} from2023 + * @property {BpsPercentRatioPattern2} from2024 + * @property {BpsPercentRatioPattern2} from2025 + * @property {BpsPercentRatioPattern2} from2026 */ /** * @typedef {Object} MetricsTree_Market_Technical * @property {MetricsTree_Market_Technical_Rsi} rsi - * @property {BpsPercentRatioPattern} stochK - * @property {BpsPercentRatioPattern} stochD - * @property {BpsRatioPattern} piCycle + * @property {BpsPercentRatioPattern4} stochK + * @property {BpsPercentRatioPattern4} stochD + * @property {BpsRatioPattern2} piCycle * @property {MetricsTree_Market_Technical_Macd} macd */ @@ -5063,12 +5241,12 @@ function createUnspentPattern(client, acc) { * @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 + * @property {BpsPercentRatioPattern4} rsi + * @property {BpsPercentRatioPattern4} rsiMin + * @property {BpsPercentRatioPattern4} rsiMax + * @property {BpsPercentRatioPattern4} stochRsi + * @property {BpsPercentRatioPattern4} stochRsiK + * @property {BpsPercentRatioPattern4} stochRsiD */ /** @@ -5077,12 +5255,12 @@ function createUnspentPattern(client, acc) { * @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 + * @property {BpsPercentRatioPattern4} rsi + * @property {BpsPercentRatioPattern4} rsiMin + * @property {BpsPercentRatioPattern4} rsiMax + * @property {BpsPercentRatioPattern4} stochRsi + * @property {BpsPercentRatioPattern4} stochRsiK + * @property {BpsPercentRatioPattern4} stochRsiD */ /** @@ -5091,12 +5269,12 @@ function createUnspentPattern(client, acc) { * @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 + * @property {BpsPercentRatioPattern4} rsi + * @property {BpsPercentRatioPattern4} rsiMin + * @property {BpsPercentRatioPattern4} rsiMax + * @property {BpsPercentRatioPattern4} stochRsi + * @property {BpsPercentRatioPattern4} stochRsiK + * @property {BpsPercentRatioPattern4} stochRsiD */ /** @@ -5320,10 +5498,10 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Prices_Split - * @property {CentsSatsUsdPattern2} open - * @property {CentsSatsUsdPattern2} high - * @property {CentsSatsUsdPattern2} low - * @property {CentsSatsUsdPattern2} close + * @property {CentsSatsUsdPattern3} open + * @property {CentsSatsUsdPattern3} high + * @property {CentsSatsUsdPattern3} low + * @property {CentsSatsUsdPattern3} close */ /** @@ -5344,7 +5522,7 @@ function createUnspentPattern(client, acc) { * @typedef {Object} MetricsTree_Supply * @property {BtcCentsSatsUsdPattern} circulating * @property {MetricsTree_Supply_Burned} burned - * @property {BpsPercentRatioPattern} inflationRate + * @property {BpsPercentRatioPattern2} inflationRate * @property {MetricsTree_Supply_Velocity} velocity * @property {CentsDeltaUsdPattern} marketCap * @property {_1m1w1y24hPattern} marketMinusRealizedCapGrowthRate @@ -5354,8 +5532,8 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Supply_Burned - * @property {CumulativeRawSumPattern3} opreturn - * @property {CumulativeRawSumPattern3} unspendable + * @property {CumulativeRawSumPattern4} opreturn + * @property {CumulativeRawSumPattern4} unspendable */ /** @@ -5391,7 +5569,7 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Cohorts_Utxo_All * @property {MetricsTree_Cohorts_Utxo_All_Supply} supply - * @property {UnspentPattern2} outputs + * @property {UnspentPattern} outputs * @property {CoindaysCoinyearsDormancySentVelocityPattern} activity * @property {CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern} realized * @property {InvestedMaxMinPercentilesSupplyPattern} costBasis @@ -5400,16 +5578,16 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Supply - * @property {ChangeRatePattern} delta * @property {BtcCentsRelSatsUsdPattern2} inProfit * @property {BtcCentsRelSatsUsdPattern2} inLoss * @property {BtcCentsSatsUsdPattern} total * @property {BtcCentsSatsUsdPattern} half + * @property {ChangeRatePattern2} delta */ /** * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Unrealized - * @property {CentsUsdPattern} grossPnl + * @property {CentsUsdPattern2} grossPnl * @property {InPattern} investedCapital * @property {GreedNetPainPattern} sentiment * @property {MetricsTree_Cohorts_Utxo_All_Unrealized_Loss} loss @@ -5421,34 +5599,34 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Unrealized_Loss * @property {MetricPattern1} negative - * @property {CentsUsdPattern} raw - * @property {MetricPattern1} cumulative - * @property {_1m1w1y24hPattern3} sum - * @property {BpsPercentRatioPattern} relToMcap - * @property {BpsPercentRatioPattern} relToOwnGross + * @property {CentsUsdPattern2} raw + * @property {CentsUsdPattern2} cumulative + * @property {_1m1w1y24hPattern5} sum + * @property {BpsPercentRatioPattern4} relToMcap + * @property {BpsPercentRatioPattern4} relToOwnGross */ /** * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl * @property {MetricPattern1} cents * @property {MetricPattern1} usd - * @property {BpsPercentRatioPattern} relToOwnGross + * @property {BpsPercentRatioPattern2} relToOwnGross */ /** * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Unrealized_Profit - * @property {CentsUsdPattern} raw - * @property {MetricPattern1} cumulative - * @property {_1m1w1y24hPattern3} sum - * @property {BpsPercentRatioPattern} relToMcap - * @property {BpsPercentRatioPattern} relToOwnGross + * @property {CentsUsdPattern2} raw + * @property {CentsUsdPattern2} cumulative + * @property {_1m1w1y24hPattern5} sum + * @property {BpsPercentRatioPattern4} relToMcap + * @property {BpsPercentRatioPattern4} relToOwnGross */ /** * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth * @property {CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern} realized * @property {DeltaHalfInRelTotalPattern2} supply - * @property {UnspentPattern2} outputs + * @property {UnspentPattern} outputs * @property {CoindaysCoinyearsDormancySentVelocityPattern} activity * @property {InvestedMaxMinPercentilesSupplyPattern} costBasis * @property {GrossInvestedLossNetNuplProfitSentimentPattern2} unrealized @@ -5457,7 +5635,7 @@ function createUnspentPattern(client, acc) { /** * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth * @property {DeltaHalfInRelTotalPattern2} supply - * @property {UnspentPattern2} outputs + * @property {UnspentPattern} outputs * @property {CoindaysCoinyearsDormancySentVelocityPattern} activity * @property {MetricsTree_Cohorts_Utxo_Lth_Realized} realized * @property {InvestedMaxMinPercentilesSupplyPattern} costBasis @@ -5468,7 +5646,7 @@ function createUnspentPattern(client, acc) { * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized * @property {CumulativeDistributionRawRelSumValuePattern} profit * @property {CapitulationCumulativeNegativeRawRelSumValuePattern} loss - * @property {CumulativeRawSumPattern2} grossPnl + * @property {CumulativeRawSumPattern3} grossPnl * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_SellSideRiskRatio} sellSideRiskRatio * @property {ChangeCumulativeDeltaRawRelSumPattern} netPnl * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr} sopr @@ -6766,7 +6944,7 @@ class BrkClient extends BrkClientBase { difficulty: { raw: createMetricPattern1(this, 'difficulty'), asHash: createMetricPattern1(this, 'difficulty_as_hash'), - adjustment: createBpsPercentRatioPattern(this, 'difficulty_adjustment'), + adjustment: createBpsPercentRatioPattern2(this, 'difficulty_adjustment'), epoch: createMetricPattern1(this, 'difficulty_epoch'), blocksBeforeNext: createMetricPattern1(this, 'blocks_before_next_difficulty_adjustment'), daysBeforeNext: createMetricPattern1(this, 'days_before_next_difficulty_adjustment'), @@ -6804,7 +6982,7 @@ class BrkClient extends BrkClientBase { }, count: { target: createMetricPattern1(this, 'block_count_target'), - total: createCumulativeRawSumPattern(this, 'block_count'), + total: createCumulativeRawSumPattern2(this, 'block_count'), }, lookback: { _1h: createMetricPattern18(this, 'height_1h_ago'), @@ -6897,8 +7075,8 @@ class BrkClient extends BrkClientBase { v3: createCumulativeRawSumPattern(this, 'tx_v3'), }, volume: { - sentSum: createCumulativeRawSumPattern3(this, 'sent_sum'), - receivedSum: createCumulativeRawSumPattern3(this, 'received_sum'), + sentSum: createCumulativeRawSumPattern4(this, 'sent_sum'), + receivedSum: createCumulativeRawSumPattern4(this, 'received_sum'), txPerSec: createMetricPattern1(this, 'tx_per_sec'), outputsPerSec: createMetricPattern1(this, 'outputs_per_sec'), inputsPerSec: createMetricPattern1(this, 'inputs_per_sec'), @@ -7063,36 +7241,36 @@ class BrkClient extends BrkClientBase { }, }, adoption: { - taproot: createBpsPercentRatioPattern(this, 'taproot_adoption'), - segwit: createBpsPercentRatioPattern(this, 'segwit_adoption'), + taproot: createBpsPercentRatioPattern4(this, 'taproot_adoption'), + segwit: createBpsPercentRatioPattern4(this, 'segwit_adoption'), }, }, mining: { rewards: { - coinbase: createCumulativeRawSumPattern3(this, 'coinbase'), + coinbase: createCumulativeRawSumPattern4(this, 'coinbase'), subsidy: { base: createBtcCentsSatsUsdPattern(this, 'subsidy'), cumulative: createBtcCentsSatsUsdPattern(this, 'subsidy_cumulative'), dominance: create_1m1w1y24hBpsPercentRatioPattern(this, 'subsidy_dominance'), - sma1y: createCentsUsdPattern(this, 'subsidy_sma_1y'), + sma1y: createCentsUsdPattern2(this, 'subsidy_sma_1y'), }, fees: { base: createBtcCentsSatsUsdPattern(this, 'fees'), cumulative: createBtcCentsSatsUsdPattern(this, 'fees_cumulative'), - sum: create_1m1w1y24hPattern4(this, 'fees_sum'), + sum: create_1m1w1y24hPattern6(this, 'fees_sum'), _24h: createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'fees_24h'), _1w: createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'fees_1w'), _1m: createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'fees_1m'), _1y: createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(this, 'fees_1y'), dominance: create_1m1w1y24hBpsPercentRatioPattern(this, 'fee_dominance'), ratioMultiple: { - _24h: createBpsRatioPattern(this, 'fee_ratio_multiple_24h'), - _1w: createBpsRatioPattern(this, 'fee_ratio_multiple_1w'), - _1m: createBpsRatioPattern(this, 'fee_ratio_multiple_1m'), - _1y: createBpsRatioPattern(this, 'fee_ratio_multiple_1y'), + _24h: createBpsRatioPattern2(this, 'fee_ratio_multiple_24h'), + _1w: createBpsRatioPattern2(this, 'fee_ratio_multiple_1w'), + _1m: createBpsRatioPattern2(this, 'fee_ratio_multiple_1m'), + _1y: createBpsRatioPattern2(this, 'fee_ratio_multiple_1y'), }, }, - unclaimed: createCumulativeRawSumPattern3(this, 'unclaimed_rewards'), + unclaimed: createCumulativeRawSumPattern4(this, 'unclaimed_rewards'), }, hashrate: { rate: { @@ -7104,7 +7282,7 @@ class BrkClient extends BrkClientBase { _1y: createMetricPattern1(this, 'hash_rate_sma_1y'), }, ath: createMetricPattern1(this, 'hash_rate_ath'), - drawdown: createBpsPercentRatioPattern(this, 'hash_rate_drawdown'), + drawdown: createBpsPercentRatioPattern5(this, 'hash_rate_drawdown'), }, price: createPhsReboundThsPattern(this, 'hash_price'), value: createPhsReboundThsPattern(this, 'hash_value'), @@ -7129,12 +7307,12 @@ class BrkClient extends BrkClientBase { vocdd: createCumulativeRawSumPattern(this, 'vocdd'), }, cap: { - thermo: createCentsUsdPattern(this, 'thermo_cap'), - investor: createCentsUsdPattern(this, 'investor_cap'), - vaulted: createCentsUsdPattern(this, 'vaulted_cap'), - active: createCentsUsdPattern(this, 'active_cap'), - cointime: createCentsUsdPattern(this, 'cointime_cap'), - aviv: createBpsRatioPattern(this, 'aviv_ratio'), + thermo: createCentsUsdPattern2(this, 'thermo_cap'), + investor: createCentsUsdPattern2(this, 'investor_cap'), + vaulted: createCentsUsdPattern2(this, 'vaulted_cap'), + active: createCentsUsdPattern2(this, 'active_cap'), + cointime: createCentsUsdPattern2(this, 'cointime_cap'), + aviv: createBpsRatioPattern2(this, 'aviv_ratio'), }, prices: { vaulted: createBpsCentsPercentilesRatioSatsUsdPattern(this, 'vaulted_price'), @@ -7148,7 +7326,7 @@ class BrkClient extends BrkClientBase { cumulativeMarketCap: createMetricPattern1(this, 'cumulative_market_cap'), }, adjusted: { - inflationRate: createBpsPercentRatioPattern(this, 'cointime_adj_inflation_rate'), + inflationRate: createBpsPercentRatioPattern2(this, 'cointime_adj_inflation_rate'), txVelocityBtc: createMetricPattern1(this, 'cointime_adj_tx_velocity_btc'), txVelocityUsd: createMetricPattern1(this, 'cointime_adj_tx_velocity_usd'), }, @@ -7322,11 +7500,11 @@ class BrkClient extends BrkClientBase { }, }, indicators: { - puellMultiple: createBpsRatioPattern(this, 'puell_multiple'), - nvt: createBpsRatioPattern(this, 'nvt'), - gini: createBpsPercentRatioPattern(this, 'gini'), - rhodlRatio: createBpsRatioPattern(this, 'rhodl_ratio'), - thermocapMultiple: createBpsRatioPattern(this, 'thermocap_multiple'), + puellMultiple: createBpsRatioPattern2(this, 'puell_multiple'), + nvt: createBpsRatioPattern2(this, 'nvt'), + gini: createBpsPercentRatioPattern4(this, 'gini'), + rhodlRatio: createBpsRatioPattern2(this, 'rhodl_ratio'), + thermocapMultiple: createBpsRatioPattern2(this, 'thermocap_multiple'), coindaysDestroyedSupplyAdjusted: createMetricPattern1(this, 'coindays_destroyed_supply_adjusted'), coinyearsDestroyedSupplyAdjusted: createMetricPattern1(this, 'coinyears_destroyed_supply_adjusted'), dormancy: { @@ -7339,7 +7517,7 @@ class BrkClient extends BrkClientBase { market: { ath: { high: createCentsSatsUsdPattern(this, 'price_ath'), - drawdown: createBpsPercentRatioPattern(this, 'price_drawdown'), + drawdown: createBpsPercentRatioPattern5(this, 'price_drawdown'), daysSince: createMetricPattern1(this, 'days_since_price_ath'), yearsSince: createMetricPattern2(this, 'years_since_price_ath'), maxDaysBetween: createMetricPattern1(this, 'max_days_between_price_ath'), @@ -7362,19 +7540,19 @@ class BrkClient extends BrkClientBase { }, returns: { periods: { - _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'), + _24h: createBpsPercentRatioPattern2(this, 'price_return_24h'), + _1w: createBpsPercentRatioPattern2(this, 'price_return_1w'), + _1m: createBpsPercentRatioPattern2(this, 'price_return_1m'), + _3m: createBpsPercentRatioPattern2(this, 'price_return_3m'), + _6m: createBpsPercentRatioPattern2(this, 'price_return_6m'), + _1y: createBpsPercentRatioPattern2(this, 'price_return_1y'), + _2y: createBpsPercentRatioPattern2(this, 'price_return_2y'), + _3y: createBpsPercentRatioPattern2(this, 'price_return_3y'), + _4y: createBpsPercentRatioPattern2(this, 'price_return_4y'), + _5y: createBpsPercentRatioPattern2(this, 'price_return_5y'), + _6y: createBpsPercentRatioPattern2(this, 'price_return_6y'), + _8y: createBpsPercentRatioPattern2(this, 'price_return_8y'), + _10y: createBpsPercentRatioPattern2(this, 'price_return_10y'), }, cagr: create_10y2y3y4y5y6y8yPattern(this, 'price_cagr'), sd24h: { @@ -7399,7 +7577,7 @@ class BrkClient extends BrkClientBase { max: create_1m1w1y2wPattern(this, 'price_max'), trueRange: createMetricPattern1(this, 'price_true_range'), trueRangeSum2w: createMetricPattern1(this, 'price_true_range_sum_2w'), - choppinessIndex2w: createBpsPercentRatioPattern(this, 'price_choppiness_index_2w'), + choppinessIndex2w: createBpsPercentRatioPattern4(this, 'price_choppiness_index_2w'), }, movingAverage: { sma: { @@ -7519,18 +7697,18 @@ class BrkClient extends BrkClientBase { from2026: createCentsSatsUsdPattern(this, 'dca_cost_basis_from_2026'), }, return: { - 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'), + from2015: createBpsPercentRatioPattern2(this, 'dca_return_from_2015'), + from2016: createBpsPercentRatioPattern2(this, 'dca_return_from_2016'), + from2017: createBpsPercentRatioPattern2(this, 'dca_return_from_2017'), + from2018: createBpsPercentRatioPattern2(this, 'dca_return_from_2018'), + from2019: createBpsPercentRatioPattern2(this, 'dca_return_from_2019'), + from2020: createBpsPercentRatioPattern2(this, 'dca_return_from_2020'), + from2021: createBpsPercentRatioPattern2(this, 'dca_return_from_2021'), + from2022: createBpsPercentRatioPattern2(this, 'dca_return_from_2022'), + from2023: createBpsPercentRatioPattern2(this, 'dca_return_from_2023'), + from2024: createBpsPercentRatioPattern2(this, 'dca_return_from_2024'), + from2025: createBpsPercentRatioPattern2(this, 'dca_return_from_2025'), + from2026: createBpsPercentRatioPattern2(this, 'dca_return_from_2026'), }, }, }, @@ -7542,41 +7720,41 @@ class BrkClient extends BrkClientBase { losses: createMetricPattern1(this, 'rsi_losses_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'), + rsi: createBpsPercentRatioPattern4(this, 'rsi_1w'), + rsiMin: createBpsPercentRatioPattern4(this, 'rsi_min_1w'), + rsiMax: createBpsPercentRatioPattern4(this, 'rsi_max_1w'), + stochRsi: createBpsPercentRatioPattern4(this, 'rsi_stoch_1w'), + stochRsiK: createBpsPercentRatioPattern4(this, 'rsi_stoch_k_1w'), + stochRsiD: createBpsPercentRatioPattern4(this, 'rsi_stoch_d_1w'), }, _1m: { gains: createMetricPattern1(this, 'rsi_gains_1m'), losses: createMetricPattern1(this, 'rsi_losses_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'), + rsi: createBpsPercentRatioPattern4(this, 'rsi_1m'), + rsiMin: createBpsPercentRatioPattern4(this, 'rsi_min_1m'), + rsiMax: createBpsPercentRatioPattern4(this, 'rsi_max_1m'), + stochRsi: createBpsPercentRatioPattern4(this, 'rsi_stoch_1m'), + stochRsiK: createBpsPercentRatioPattern4(this, 'rsi_stoch_k_1m'), + stochRsiD: createBpsPercentRatioPattern4(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'), + rsi: createBpsPercentRatioPattern4(this, 'rsi_1y'), + rsiMin: createBpsPercentRatioPattern4(this, 'rsi_min_1y'), + rsiMax: createBpsPercentRatioPattern4(this, 'rsi_max_1y'), + stochRsi: createBpsPercentRatioPattern4(this, 'rsi_stoch_1y'), + stochRsiK: createBpsPercentRatioPattern4(this, 'rsi_stoch_k_1y'), + stochRsiD: createBpsPercentRatioPattern4(this, 'rsi_stoch_d_1y'), }, }, - stochK: createBpsPercentRatioPattern(this, 'stoch_k'), - stochD: createBpsPercentRatioPattern(this, 'stoch_d'), - piCycle: createBpsRatioPattern(this, 'pi_cycle'), + stochK: createBpsPercentRatioPattern4(this, 'stoch_k'), + stochD: createBpsPercentRatioPattern4(this, 'stoch_d'), + piCycle: createBpsRatioPattern2(this, 'pi_cycle'), macd: { _24h: createEmaHistogramLineSignalPattern(this, 'macd'), _1w: { @@ -7774,10 +7952,10 @@ class BrkClient extends BrkClientBase { }, prices: { split: { - open: createCentsSatsUsdPattern2(this, 'price_open'), - high: createCentsSatsUsdPattern2(this, 'price_high'), - low: createCentsSatsUsdPattern2(this, 'price_low'), - close: createCentsSatsUsdPattern2(this, 'price_close'), + open: createCentsSatsUsdPattern3(this, 'price_open'), + high: createCentsSatsUsdPattern3(this, 'price_high'), + low: createCentsSatsUsdPattern3(this, 'price_low'), + close: createCentsSatsUsdPattern3(this, 'price_close'), }, ohlc: { cents: createMetricPattern2(this, 'price_ohlc_cents'), @@ -7793,10 +7971,10 @@ class BrkClient extends BrkClientBase { supply: { circulating: createBtcCentsSatsUsdPattern(this, 'circulating_supply'), burned: { - opreturn: createCumulativeRawSumPattern3(this, 'opreturn_supply'), - unspendable: createCumulativeRawSumPattern3(this, 'unspendable_supply'), + opreturn: createCumulativeRawSumPattern4(this, 'opreturn_supply'), + unspendable: createCumulativeRawSumPattern4(this, 'unspendable_supply'), }, - inflationRate: createBpsPercentRatioPattern(this, 'inflation_rate'), + inflationRate: createBpsPercentRatioPattern2(this, 'inflation_rate'), velocity: { btc: createMetricPattern1(this, 'velocity_btc'), usd: createMetricPattern1(this, 'velocity_usd'), @@ -7810,39 +7988,39 @@ class BrkClient extends BrkClientBase { utxo: { all: { supply: { - delta: createChangeRatePattern(this, 'supply_delta'), inProfit: createBtcCentsRelSatsUsdPattern2(this, 'supply_in_profit'), inLoss: createBtcCentsRelSatsUsdPattern2(this, 'supply_in_loss'), total: createBtcCentsSatsUsdPattern(this, 'supply'), half: createBtcCentsSatsUsdPattern(this, 'supply_half'), + delta: createChangeRatePattern2(this, 'supply_delta'), }, - outputs: createUnspentPattern2(this, 'utxo_count'), + outputs: createUnspentPattern(this, 'utxo_count'), activity: createCoindaysCoinyearsDormancySentVelocityPattern(this, ''), realized: createCapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern(this, ''), costBasis: createInvestedMaxMinPercentilesSupplyPattern(this, ''), unrealized: { - grossPnl: createCentsUsdPattern(this, 'unrealized_gross_pnl'), + grossPnl: createCentsUsdPattern2(this, 'unrealized_gross_pnl'), investedCapital: createInPattern(this, 'invested_capital_in'), sentiment: createGreedNetPainPattern(this, ''), loss: { negative: createMetricPattern1(this, 'neg_unrealized_loss'), - raw: createCentsUsdPattern(this, 'unrealized_loss'), - cumulative: createMetricPattern1(this, 'unrealized_loss_cumulative'), - sum: create_1m1w1y24hPattern3(this, 'unrealized_loss_sum'), - relToMcap: createBpsPercentRatioPattern(this, 'unrealized_loss_rel_to_mcap'), - relToOwnGross: createBpsPercentRatioPattern(this, 'unrealized_loss_rel_to_own_gross_pnl'), + raw: createCentsUsdPattern2(this, 'unrealized_loss'), + cumulative: createCentsUsdPattern2(this, 'unrealized_loss_cumulative'), + sum: create_1m1w1y24hPattern5(this, 'unrealized_loss_sum'), + relToMcap: createBpsPercentRatioPattern4(this, 'unrealized_loss_rel_to_mcap'), + relToOwnGross: createBpsPercentRatioPattern4(this, 'unrealized_loss_rel_to_own_gross_pnl'), }, netPnl: { cents: createMetricPattern1(this, 'net_unrealized_pnl_cents'), usd: createMetricPattern1(this, 'net_unrealized_pnl'), - relToOwnGross: createBpsPercentRatioPattern(this, 'net_unrealized_pnl_rel_to_own_gross_pnl'), + relToOwnGross: createBpsPercentRatioPattern2(this, 'net_unrealized_pnl_rel_to_own_gross_pnl'), }, profit: { - raw: createCentsUsdPattern(this, 'unrealized_profit'), - cumulative: createMetricPattern1(this, 'unrealized_profit_cumulative'), - sum: create_1m1w1y24hPattern3(this, 'unrealized_profit_sum'), - relToMcap: createBpsPercentRatioPattern(this, 'unrealized_profit_rel_to_mcap'), - relToOwnGross: createBpsPercentRatioPattern(this, 'unrealized_profit_rel_to_own_gross_pnl'), + raw: createCentsUsdPattern2(this, 'unrealized_profit'), + cumulative: createCentsUsdPattern2(this, 'unrealized_profit_cumulative'), + sum: create_1m1w1y24hPattern5(this, 'unrealized_profit_sum'), + relToMcap: createBpsPercentRatioPattern4(this, 'unrealized_profit_rel_to_mcap'), + relToOwnGross: createBpsPercentRatioPattern4(this, 'unrealized_profit_rel_to_own_gross_pnl'), }, nupl: createBpsRatioPattern(this, 'nupl'), }, @@ -7850,19 +8028,19 @@ class BrkClient extends BrkClientBase { sth: { realized: createCapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern(this, 'sth'), supply: createDeltaHalfInRelTotalPattern2(this, 'sth_supply'), - outputs: createUnspentPattern2(this, 'sth_utxo_count'), + outputs: createUnspentPattern(this, 'sth_utxo_count'), activity: createCoindaysCoinyearsDormancySentVelocityPattern(this, 'sth'), costBasis: createInvestedMaxMinPercentilesSupplyPattern(this, 'sth'), unrealized: createGrossInvestedLossNetNuplProfitSentimentPattern2(this, 'sth'), }, lth: { supply: createDeltaHalfInRelTotalPattern2(this, 'lth_supply'), - outputs: createUnspentPattern2(this, 'lth_utxo_count'), + outputs: createUnspentPattern(this, 'lth_utxo_count'), activity: createCoindaysCoinyearsDormancySentVelocityPattern(this, 'lth'), realized: { profit: createCumulativeDistributionRawRelSumValuePattern(this, 'lth'), loss: createCapitulationCumulativeNegativeRawRelSumValuePattern(this, 'lth'), - grossPnl: createCumulativeRawSumPattern2(this, 'lth_realized_gross_pnl'), + grossPnl: createCumulativeRawSumPattern3(this, 'lth_realized_gross_pnl'), sellSideRiskRatio: { _24h: createBpsPercentRatioPattern(this, 'lth_sell_side_risk_ratio_24h'), _1w: createBpsPercentRatioPattern(this, 'lth_sell_side_risk_ratio_1w'), diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index b26c9a354..25b705223 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -2171,18 +2171,18 @@ class _10y1m1w1y2y3m3y4y5y6m6y8yPattern2: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - 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')) + self._10y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '10y')) + self._1m: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '1m')) + self._1w: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '1w')) + self._1y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '1y')) + self._2y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '2y')) + self._3m: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '3m')) + self._3y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '3y')) + self._4y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '4y')) + self._5y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '5y')) + self._6m: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '6m')) + self._6y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '6y')) + self._8y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '8y')) class _10y1m1w1y2y3m3y4y5y6m6y8yPattern3: """Pattern struct for repeated tree structure.""" @@ -2208,7 +2208,7 @@ class CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cap: CentsDeltaRelUsdPattern = CentsDeltaRelUsdPattern(client, _m(acc, 'realized_cap')) - self.gross_pnl: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, _m(acc, 'realized_gross_pnl')) + self.gross_pnl: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'realized_gross_pnl')) self.investor: LowerPriceUpperPattern = LowerPriceUpperPattern(client, acc) self.loss: CapitulationCumulativeNegativeRawRelSumValuePattern = CapitulationCumulativeNegativeRawRelSumValuePattern(client, acc) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) @@ -2263,12 +2263,12 @@ class AverageGainsLossesRsiStochPattern: 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')) + self.rsi: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, '24h')) + self.rsi_max: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'max_24h')) + self.rsi_min: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'min_24h')) + self.stoch_rsi: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'stoch_24h')) + self.stoch_rsi_d: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'stoch_d_24h')) + self.stoch_rsi_k: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'stoch_k_24h')) class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3: """Pattern struct for repeated tree structure.""" @@ -2334,11 +2334,11 @@ class CapitulationCumulativeNegativeRawRelSumValuePattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'capitulation_flow')) - self.cumulative: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_loss_cumulative')) + self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'realized_loss_cumulative')) self.negative: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_realized_loss')) - self.raw: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_loss')) + self.raw: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'realized_loss')) self.rel_to_rcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_loss_rel_to_rcap')) - self.sum: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, _m(acc, 'realized_loss_sum')) + self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'realized_loss_sum')) self.value_created: CumulativeRawSumPattern[Cents] = CumulativeRawSumPattern(client, _m(acc, 'loss_value_created')) self.value_destroyed: CumulativeRawSumPattern[Cents] = CumulativeRawSumPattern(client, _m(acc, 'loss_value_destroyed')) @@ -2361,23 +2361,23 @@ class _10y2y3y4y5y6y8yPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - 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')) + self._10y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '10y')) + self._2y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '2y')) + self._3y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '3y')) + self._4y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '4y')) + self._5y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '5y')) + self._6y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '6y')) + self._8y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '8y')) class _1m1w1y24hBpsPercentRatioPattern: """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')) + self._1m: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, '1m')) + self._1w: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, '1w')) + self._1y: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, '1y')) + self._24h: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, '24h')) 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')) @@ -2390,9 +2390,9 @@ class CapLossMvrvNetPriceProfitSoprPattern: self.cap: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, 'realized_cap')) self.loss: CumulativeNegativeRawSumPattern = CumulativeNegativeRawSumPattern(client, acc) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) - self.net_pnl: CumulativeRawSumPattern[CentsSigned] = CumulativeRawSumPattern(client, _m(acc, 'net_realized_pnl')) + self.net_pnl: CumulativeDeltaRawSumPattern = CumulativeDeltaRawSumPattern(client, _m(acc, 'net_realized_pnl')) self.price: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, _m(acc, 'realized_price')) - self.profit: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, _m(acc, 'realized_profit')) + self.profit: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'realized_profit')) self.sopr: RatioValuePattern = RatioValuePattern(client, acc) class CumulativeDistributionRawRelSumValuePattern: @@ -2400,11 +2400,11 @@ class CumulativeDistributionRawRelSumValuePattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'realized_profit_cumulative')) + self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'realized_profit_cumulative')) self.distribution_flow: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'distribution_flow')) - self.raw: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_profit')) + self.raw: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'realized_profit')) self.rel_to_rcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_profit_rel_to_rcap')) - self.sum: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, _m(acc, 'realized_profit_sum')) + self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'realized_profit_sum')) self.value_created: CumulativeRawSumPattern[Cents] = CumulativeRawSumPattern(client, _m(acc, 'profit_value_created')) self.value_destroyed: CumulativeRawSumPattern[Cents] = CumulativeRawSumPattern(client, _m(acc, 'profit_value_destroyed')) @@ -2413,20 +2413,20 @@ class CumulativeNegativeRawRelSumPattern2: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'unrealized_loss_cumulative')) + self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'unrealized_loss_cumulative')) self.negative: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss')) - self.raw: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_loss')) - self.rel_to_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_mcap')) - self.rel_to_own_gross: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_own_gross_pnl')) + self.raw: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'unrealized_loss')) + self.rel_to_mcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'unrealized_loss_rel_to_mcap')) + self.rel_to_own_gross: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'unrealized_loss_rel_to_own_gross_pnl')) self.rel_to_own_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'unrealized_loss_rel_to_own_mcap')) - self.sum: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, _m(acc, 'unrealized_loss_sum')) + self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'unrealized_loss_sum')) class GrossInvestedLossNetNuplProfitSentimentPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_gross_pnl')) + self.gross_pnl: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'unrealized_gross_pnl')) self.invested_capital: InPattern = InPattern(client, _m(acc, 'invested_capital_in')) self.loss: CumulativeNegativeRawRelSumPattern2 = CumulativeNegativeRawRelSumPattern2(client, acc) self.net_pnl: CentsRelUsdPattern2 = CentsRelUsdPattern2(client, _m(acc, 'net_unrealized_pnl')) @@ -2439,12 +2439,12 @@ class _1m1w1y2y4yAllPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._1m: BpsRatioPattern = BpsRatioPattern(client, _m(acc, '1m')) - self._1w: BpsRatioPattern = BpsRatioPattern(client, _m(acc, '1w')) - self._1y: BpsRatioPattern = BpsRatioPattern(client, _m(acc, '1y')) - self._2y: BpsRatioPattern = BpsRatioPattern(client, _m(acc, '2y')) - self._4y: BpsRatioPattern = BpsRatioPattern(client, _m(acc, '4y')) - self.all: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'all')) + self._1m: BpsRatioPattern2 = BpsRatioPattern2(client, _m(acc, '1m')) + self._1w: BpsRatioPattern2 = BpsRatioPattern2(client, _m(acc, '1w')) + self._1y: BpsRatioPattern2 = BpsRatioPattern2(client, _m(acc, '1y')) + self._2y: BpsRatioPattern2 = BpsRatioPattern2(client, _m(acc, '2y')) + self._4y: BpsRatioPattern2 = BpsRatioPattern2(client, _m(acc, '4y')) + self.all: BpsRatioPattern2 = BpsRatioPattern2(client, _m(acc, 'all')) class BpsCentsPercentilesRatioSatsUsdPattern: """Pattern struct for repeated tree structure.""" @@ -2465,8 +2465,8 @@ class BtcCentsRelSatsUsdPattern3: """Create pattern node with accumulated metric name.""" self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, acc) self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) - self.rel_to_circulating: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_circulating')) - self.rel_to_own: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_own')) + self.rel_to_circulating: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_circulating')) + self.rel_to_own: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_own')) self.sats: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sats')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) @@ -2475,11 +2475,11 @@ class CapLossMvrvPriceProfitSoprPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cap: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_cap')) - self.loss: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, _m(acc, 'realized_loss')) + self.cap: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, 'realized_cap')) + self.loss: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'realized_loss')) self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) self.price: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, _m(acc, 'realized_price')) - self.profit: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, _m(acc, 'realized_profit')) + self.profit: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'realized_profit')) self.sopr: ValuePattern = ValuePattern(client, _m(acc, 'value')) class ChangeCumulativeDeltaRawRelSumPattern: @@ -2488,34 +2488,34 @@ class ChangeCumulativeDeltaRawRelSumPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.change_1m: RelPattern = RelPattern(client, _m(acc, 'pnl_change_1m_rel_to')) - self.cumulative: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_pnl_cumulative')) - self.delta: ChangeRatePattern2 = ChangeRatePattern2(client, _m(acc, 'pnl_delta')) - self.raw: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'realized_pnl')) - self.rel_to_rcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'realized_pnl_rel_to_rcap')) - self.sum: _1m1w1y24hPattern[CentsSigned] = _1m1w1y24hPattern(client, _m(acc, 'realized_pnl_sum')) + self.cumulative: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_pnl_cumulative')) + self.delta: ChangeRatePattern3 = ChangeRatePattern3(client, _m(acc, 'realized_pnl_delta')) + self.raw: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_pnl')) + self.rel_to_rcap: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, 'realized_pnl_rel_to_rcap')) + self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, _m(acc, 'realized_pnl_sum')) class CumulativeRawRelSumPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cumulative')) - self.raw: CentsUsdPattern = CentsUsdPattern(client, acc) - self.rel_to_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_mcap')) - self.rel_to_own_gross: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_own_gross_pnl')) - self.rel_to_own_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_own_mcap')) - self.sum: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, _m(acc, 'sum')) + self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'cumulative')) + self.raw: CentsUsdPattern2 = CentsUsdPattern2(client, acc) + self.rel_to_mcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_mcap')) + self.rel_to_own_gross: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_own_gross_pnl')) + self.rel_to_own_mcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_own_mcap')) + self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'sum')) class DeltaHalfInRelTotalPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.delta: ChangeRatePattern = ChangeRatePattern(client, _m(acc, 'delta')) + self.delta: ChangeRatePattern2 = ChangeRatePattern2(client, _m(acc, 'delta')) self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) self.in_loss: BtcCentsRelSatsUsdPattern = BtcCentsRelSatsUsdPattern(client, _m(acc, 'in_loss')) self.in_profit: BtcCentsRelSatsUsdPattern = BtcCentsRelSatsUsdPattern(client, _m(acc, 'in_profit')) - self.rel_to_circulating: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_circulating')) + self.rel_to_circulating: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_circulating')) self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) class DeltaHalfInRelTotalPattern2: @@ -2523,11 +2523,11 @@ class DeltaHalfInRelTotalPattern2: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.delta: ChangeRatePattern = ChangeRatePattern(client, _m(acc, 'delta')) + self.delta: ChangeRatePattern2 = ChangeRatePattern2(client, _m(acc, 'delta')) self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) self.in_loss: BtcCentsRelSatsUsdPattern3 = BtcCentsRelSatsUsdPattern3(client, _m(acc, 'in_loss')) self.in_profit: BtcCentsRelSatsUsdPattern3 = BtcCentsRelSatsUsdPattern3(client, _m(acc, 'in_profit')) - self.rel_to_circulating: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_circulating')) + self.rel_to_circulating: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_circulating')) self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) class Pct1Pct2Pct5Pct95Pct98Pct99Pattern: @@ -2548,7 +2548,7 @@ class ActivityOutputsRealizedSupplyUnrealizedPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.activity: CoindaysSentPattern = CoindaysSentPattern(client, acc) - self.outputs: UnspentPattern2 = UnspentPattern2(client, _m(acc, 'utxo_count')) + self.outputs: UnspentPattern = UnspentPattern(client, _m(acc, 'utxo_count')) self.realized: CapLossMvrvNetPriceProfitSoprPattern = CapLossMvrvNetPriceProfitSoprPattern(client, acc) self.supply: DeltaHalfInRelTotalPattern = DeltaHalfInRelTotalPattern(client, _m(acc, 'supply')) self.unrealized: LossNetNuplProfitPattern = LossNetNuplProfitPattern(client, acc) @@ -2561,7 +2561,7 @@ class AddressOutputsRealizedSupplyUnrealizedPattern: self.address_count: DeltaInnerPattern = DeltaInnerPattern(client, _m(acc, 'address_count')) self.outputs: UnspentPattern = UnspentPattern(client, _m(acc, 'utxo_count')) self.realized: CapLossMvrvPriceProfitSoprPattern = CapLossMvrvPriceProfitSoprPattern(client, acc) - self.supply: HalfTotalPattern = HalfTotalPattern(client, _m(acc, 'supply')) + self.supply: DeltaHalfTotalPattern = DeltaHalfTotalPattern(client, _m(acc, 'supply')) self.unrealized: NuplPattern = NuplPattern(client, _m(acc, 'nupl')) class BpsCentsRatioSatsUsdPattern: @@ -2582,7 +2582,7 @@ class BtcCentsRelSatsUsdPattern: """Create pattern node with accumulated metric name.""" self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, acc) self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) - self.rel_to_circulating: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_circulating')) + self.rel_to_circulating: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_circulating')) self.sats: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sats')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) @@ -2593,7 +2593,7 @@ class BtcCentsRelSatsUsdPattern2: """Create pattern node with accumulated metric name.""" self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, acc) self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) - self.rel_to_own: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_own')) + self.rel_to_own: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_own')) self.sats: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sats')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) @@ -2614,11 +2614,22 @@ class CumulativeInRawSumPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cumulative: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'cumulative')) - self.in_loss: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'in_loss')) - self.in_profit: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'in_profit')) + self.in_loss: CumulativeRawSumPattern4 = CumulativeRawSumPattern4(client, _m(acc, 'in_loss')) + self.in_profit: CumulativeRawSumPattern4 = CumulativeRawSumPattern4(client, _m(acc, 'in_profit')) self.raw: MetricPattern1[Sats] = MetricPattern1(client, acc) self.sum: _1m1w1y24hPattern[Sats] = _1m1w1y24hPattern(client, _m(acc, 'sum')) +class DeltaHalfInTotalPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.delta: ChangeRatePattern2 = ChangeRatePattern2(client, _m(acc, 'delta')) + self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) + self.in_loss: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'in_loss')) + self.in_profit: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'in_profit')) + self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) + class EmaHistogramLineSignalPattern: """Pattern struct for repeated tree structure.""" @@ -2639,7 +2650,7 @@ class InvestedMaxMinPercentilesSupplyPattern: 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.supply_density: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'supply_density')) + self.supply_density: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'supply_density')) class PhsReboundThsPattern: """Pattern struct for repeated tree structure.""" @@ -2648,7 +2659,7 @@ class PhsReboundThsPattern: """Create pattern node with accumulated metric name.""" self.phs: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'phs')) self.phs_min: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'phs_min')) - self.rebound: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rebound')) + self.rebound: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, 'rebound')) self.ths: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ths')) self.ths_min: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ths_min')) @@ -2673,7 +2684,17 @@ class _1m1w1y24hPattern2: self._1y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1y_rate')) self._24h: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '24h_rate')) -class _1m1w1y24hPattern4: +class _1m1w1y24hPattern3: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._1m: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '1m_rate')) + self._1w: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '1w_rate')) + self._1y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '1y_rate')) + self._24h: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, '24h_rate')) + +class _1m1w1y24hPattern6: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2693,15 +2714,25 @@ class _1m1w1y2wPattern: self._1y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, '1y')) self._2w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, '2w')) -class _1m1w1y24hPattern3: +class _1m1w1y24hPattern4: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self._1m: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1m')) - self._1w: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1w')) - self._1y: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1y')) - self._24h: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '24h')) + self._1m: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1m_change')) + self._1w: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1w_change')) + self._1y: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1y_change')) + self._24h: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '24h_change')) + +class _1m1w1y24hPattern5: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self._1m: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, '1m')) + self._1w: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, '1w')) + self._1y: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, '1y')) + self._24h: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, '24h')) class _1y2y4yAllPattern: """Pattern struct for repeated tree structure.""" @@ -2749,7 +2780,7 @@ class CentsDeltaRelUsdPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) - self.delta: ChangeRatePattern2 = ChangeRatePattern2(client, _m(acc, 'delta')) + self.delta: ChangeRatePattern3 = ChangeRatePattern3(client, _m(acc, 'delta')) self.rel_to_own_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_own_mcap')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) @@ -2759,29 +2790,29 @@ class CentsRelUsdPattern2: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cents: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'cents')) - self.rel_to_own_gross: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_own_gross_pnl')) - self.rel_to_own_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_own_mcap')) + self.rel_to_own_gross: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, 'rel_to_own_gross_pnl')) + self.rel_to_own_mcap: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, 'rel_to_own_mcap')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) +class CumulativeDeltaRawSumPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.cumulative: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'cumulative')) + self.delta: ChangeRatePattern3 = ChangeRatePattern3(client, _m(acc, 'delta')) + self.raw: CentsUsdPattern = CentsUsdPattern(client, acc) + self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, _m(acc, 'sum')) + class CumulativeNegativeRawSumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'unrealized_loss_cumulative')) + self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'unrealized_loss_cumulative')) self.negative: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss')) - self.raw: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'unrealized_loss')) - self.sum: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, _m(acc, 'unrealized_loss_sum')) - -class HalfInTotalPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) - self.in_loss: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'in_loss')) - self.in_profit: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'in_profit')) - self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) + self.raw: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'unrealized_loss')) + self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'unrealized_loss_sum')) class LossNetNuplProfitPattern: """Pattern struct for repeated tree structure.""" @@ -2791,7 +2822,7 @@ class LossNetNuplProfitPattern: self.loss: CumulativeNegativeRawSumPattern = CumulativeNegativeRawSumPattern(client, acc) self.net_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'net_unrealized_pnl')) self.nupl: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'nupl')) - self.profit: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, _m(acc, 'unrealized_profit')) + self.profit: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'unrealized_profit')) class OutputsRealizedSupplyUnrealizedPattern2: """Pattern struct for repeated tree structure.""" @@ -2800,7 +2831,7 @@ class OutputsRealizedSupplyUnrealizedPattern2: """Create pattern node with accumulated metric name.""" self.outputs: UnspentPattern = UnspentPattern(client, _m(acc, 'utxo_count')) self.realized: CapLossMvrvPriceProfitSoprPattern = CapLossMvrvPriceProfitSoprPattern(client, acc) - self.supply: HalfInTotalPattern = HalfInTotalPattern(client, _m(acc, 'supply')) + self.supply: DeltaHalfInTotalPattern2 = DeltaHalfInTotalPattern2(client, _m(acc, 'supply')) self.unrealized: LossNuplProfitPattern = LossNuplProfitPattern(client, acc) class OutputsRealizedSupplyUnrealizedPattern: @@ -2810,7 +2841,7 @@ class OutputsRealizedSupplyUnrealizedPattern: """Create pattern node with accumulated metric name.""" self.outputs: UnspentPattern = UnspentPattern(client, _m(acc, 'utxo_count')) self.realized: CapLossMvrvPriceProfitSoprPattern = CapLossMvrvPriceProfitSoprPattern(client, acc) - self.supply: HalfTotalPattern = HalfTotalPattern(client, _m(acc, 'supply')) + self.supply: DeltaHalfTotalPattern = DeltaHalfTotalPattern(client, _m(acc, 'supply')) self.unrealized: NuplPattern = NuplPattern(client, _m(acc, 'nupl')) class _1m1w1y24hPattern(Generic[T]): @@ -2828,16 +2859,25 @@ class BlocksDominanceRewardsPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.blocks_mined: CumulativeRawSumPattern[StoredU32] = CumulativeRawSumPattern(client, _m(acc, 'blocks_mined')) + self.blocks_mined: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, _m(acc, 'blocks_mined')) self.dominance: _1m1w1y24hBpsPercentRatioPattern = _1m1w1y24hBpsPercentRatioPattern(client, _m(acc, 'dominance')) - self.rewards: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'rewards')) + self.rewards: CumulativeRawSumPattern4 = CumulativeRawSumPattern4(client, _m(acc, 'rewards')) + +class BpsPercentRatioPattern4: + """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 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.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, _m(acc, 'bps')) self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) @@ -2850,7 +2890,25 @@ class BpsPriceRatioPattern: self.price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct99')) self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio_pct99')) -class CentsSatsUsdPattern2: +class BpsPercentRatioPattern5: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bps: MetricPattern1[BasisPointsSigned16] = MetricPattern1(client, _m(acc, 'bps')) + self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) + +class BpsPercentRatioPattern2: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.bps: MetricPattern1[BasisPointsSigned32] = MetricPattern1(client, _m(acc, 'bps')) + self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) + +class CentsSatsUsdPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2865,7 +2923,7 @@ class CentsDeltaUsdPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) - self.delta: ChangeRatePattern2 = ChangeRatePattern2(client, _m(acc, 'delta')) + self.delta: ChangeRatePattern3 = ChangeRatePattern3(client, _m(acc, 'delta')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) class CentsSatsUsdPattern: @@ -2877,14 +2935,14 @@ class CentsSatsUsdPattern: self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, _m(acc, 'sats')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) -class CumulativeRawSumPattern3: +class CumulativeRawSumPattern4: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')) self.raw: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) - self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, _m(acc, 'sum')) + self.sum: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, _m(acc, 'sum')) class CumulativeRawRelPattern: """Pattern struct for repeated tree structure.""" @@ -2895,32 +2953,50 @@ class CumulativeRawRelPattern: self.raw: MetricPattern1[Cents] = MetricPattern1(client, acc) self.rel_to_rcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_rcap')) +class CumulativeRawSumPattern3: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'cumulative')) + self.raw: CentsUsdPattern2 = CentsUsdPattern2(client, acc) + self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'sum')) + class CumulativeRawSumPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.cumulative: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cumulative')) - self.raw: CentsUsdPattern = CentsUsdPattern(client, acc) - self.sum: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, _m(acc, 'sum')) + self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'cumulative')) + self.raw: MetricPattern1[StoredU32] = MetricPattern1(client, acc) + self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'sum')) + +class DeltaHalfTotalPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.delta: ChangeRatePattern2 = ChangeRatePattern2(client, _m(acc, 'delta')) + self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) + self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) class GreedNetPainPattern: """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.greed_index: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'greed_index')) self.net: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'net_sentiment')) - self.pain_index: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'pain_index')) + self.pain_index: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'pain_index')) class LossNuplProfitPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.loss: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, _m(acc, 'unrealized_loss')) + self.loss: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'unrealized_loss')) self.nupl: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'nupl')) - self.profit: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, _m(acc, 'unrealized_profit')) + self.profit: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, _m(acc, 'unrealized_profit')) class LowerPriceUpperPattern: """Pattern struct for repeated tree structure.""" @@ -2972,10 +3048,10 @@ class BlocksDominancePattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.blocks_mined: CumulativeRawSumPattern[StoredU32] = CumulativeRawSumPattern(client, _m(acc, 'blocks_mined')) - self.dominance: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'dominance')) + self.blocks_mined: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, _m(acc, 'blocks_mined')) + self.dominance: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'dominance')) -class BpsRatioPattern: +class BpsRatioPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2983,7 +3059,15 @@ class BpsRatioPattern: self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, _m(acc, 'bps')) self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, acc) -class CentsUsdPattern: +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[BasisPointsSigned32] = MetricPattern1(client, _m(acc, 'bps')) + self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + +class CentsUsdPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): @@ -2991,6 +3075,14 @@ class CentsUsdPattern: self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) +class CentsUsdPattern: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.cents: MetricPattern1[CentsSigned] = MetricPattern1(client, acc) + self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) + class ChangeRatePattern: """Pattern struct for repeated tree structure.""" @@ -3004,8 +3096,16 @@ class ChangeRatePattern2: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.change: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, acc) - self.rate: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, acc) + self.change: _1m1w1y24hPattern[StoredI64] = _1m1w1y24hPattern(client, acc) + self.rate: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, acc) + +class ChangeRatePattern3: + """Pattern struct for repeated tree structure.""" + + def __init__(self, client: BrkClientBase, acc: str): + """Create pattern node with accumulated metric name.""" + self.change: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, acc) + self.rate: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, acc) class CoindaysSentPattern: """Pattern struct for repeated tree structure.""" @@ -3020,32 +3120,16 @@ class DeltaInnerPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.delta: ChangeRatePattern = ChangeRatePattern(client, _m(acc, 'delta')) + self.delta: ChangeRatePattern2 = ChangeRatePattern2(client, _m(acc, 'delta')) self.inner: MetricPattern1[StoredU64] = MetricPattern1(client, acc) -class DeltaRawPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.delta: ChangeRatePattern = ChangeRatePattern(client, _m(acc, 'delta')) - self.raw: MetricPattern1[StoredU64] = MetricPattern1(client, acc) - -class HalfTotalPattern: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) - self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) - class InPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.in_loss: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'loss')) - self.in_profit: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'profit')) + self.in_loss: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'loss')) + self.in_profit: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'profit')) class PriceValuePattern: """Pattern struct for repeated tree structure.""" @@ -3068,8 +3152,8 @@ class RelPattern: def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.rel_to_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'mcap')) - self.rel_to_rcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rcap')) + self.rel_to_mcap: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, 'mcap')) + self.rel_to_rcap: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, _m(acc, 'rcap')) class SdSmaPattern: """Pattern struct for repeated tree structure.""" @@ -3101,19 +3185,12 @@ class NuplPattern: """Create pattern node with accumulated metric name.""" self.nupl: BpsRatioPattern = BpsRatioPattern(client, acc) -class UnspentPattern2: - """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.unspent_count: DeltaRawPattern = DeltaRawPattern(client, acc) - class UnspentPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): """Create pattern node with accumulated metric name.""" - self.unspent_count: MetricPattern1[StoredU64] = MetricPattern1(client, acc) + self.unspent_count: DeltaInnerPattern = DeltaInnerPattern(client, acc) # Metrics tree classes @@ -3123,7 +3200,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: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'difficulty_adjustment') + self.adjustment: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'difficulty_adjustment') self.epoch: MetricPattern1[Epoch] = MetricPattern1(client, 'difficulty_epoch') self.blocks_before_next: MetricPattern1[StoredU32] = MetricPattern1(client, 'blocks_before_next_difficulty_adjustment') self.days_before_next: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_before_next_difficulty_adjustment') @@ -3173,7 +3250,7 @@ class MetricsTree_Blocks_Count: def __init__(self, client: BrkClientBase, base_path: str = ''): self.target: MetricPattern1[StoredU64] = MetricPattern1(client, 'block_count_target') - self.total: CumulativeRawSumPattern[StoredU32] = CumulativeRawSumPattern(client, 'block_count') + self.total: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, 'block_count') class MetricsTree_Blocks_Lookback: """Metrics tree node.""" @@ -3305,8 +3382,8 @@ class MetricsTree_Transactions_Volume: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sent_sum: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, 'sent_sum') - self.received_sum: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, 'received_sum') + self.sent_sum: CumulativeRawSumPattern4 = CumulativeRawSumPattern4(client, 'sent_sum') + self.received_sum: CumulativeRawSumPattern4 = CumulativeRawSumPattern4(client, 'received_sum') self.tx_per_sec: MetricPattern1[StoredF32] = MetricPattern1(client, 'tx_per_sec') self.outputs_per_sec: MetricPattern1[StoredF32] = MetricPattern1(client, 'outputs_per_sec') self.inputs_per_sec: MetricPattern1[StoredF32] = MetricPattern1(client, 'inputs_per_sec') @@ -3597,8 +3674,8 @@ class MetricsTree_Scripts_Adoption: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.taproot: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'taproot_adoption') - self.segwit: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'segwit_adoption') + self.taproot: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'taproot_adoption') + self.segwit: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'segwit_adoption') class MetricsTree_Scripts: """Metrics tree node.""" @@ -3616,16 +3693,16 @@ class MetricsTree_Mining_Rewards_Subsidy: self.base: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'subsidy') self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'subsidy_cumulative') self.dominance: _1m1w1y24hBpsPercentRatioPattern = _1m1w1y24hBpsPercentRatioPattern(client, 'subsidy_dominance') - self.sma_1y: CentsUsdPattern = CentsUsdPattern(client, 'subsidy_sma_1y') + self.sma_1y: CentsUsdPattern2 = CentsUsdPattern2(client, 'subsidy_sma_1y') class MetricsTree_Mining_Rewards_Fees_RatioMultiple: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._24h: BpsRatioPattern = BpsRatioPattern(client, 'fee_ratio_multiple_24h') - self._1w: BpsRatioPattern = BpsRatioPattern(client, 'fee_ratio_multiple_1w') - self._1m: BpsRatioPattern = BpsRatioPattern(client, 'fee_ratio_multiple_1m') - self._1y: BpsRatioPattern = BpsRatioPattern(client, 'fee_ratio_multiple_1y') + self._24h: BpsRatioPattern2 = BpsRatioPattern2(client, 'fee_ratio_multiple_24h') + self._1w: BpsRatioPattern2 = BpsRatioPattern2(client, 'fee_ratio_multiple_1w') + self._1m: BpsRatioPattern2 = BpsRatioPattern2(client, 'fee_ratio_multiple_1m') + self._1y: BpsRatioPattern2 = BpsRatioPattern2(client, 'fee_ratio_multiple_1y') class MetricsTree_Mining_Rewards_Fees: """Metrics tree node.""" @@ -3633,7 +3710,7 @@ class MetricsTree_Mining_Rewards_Fees: def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'fees') self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'fees_cumulative') - self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'fees_sum') + self.sum: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, 'fees_sum') self._24h: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'fees_24h') self._1w: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'fees_1w') self._1m: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'fees_1m') @@ -3645,10 +3722,10 @@ class MetricsTree_Mining_Rewards: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.coinbase: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, 'coinbase') + self.coinbase: CumulativeRawSumPattern4 = CumulativeRawSumPattern4(client, 'coinbase') self.subsidy: MetricsTree_Mining_Rewards_Subsidy = MetricsTree_Mining_Rewards_Subsidy(client) self.fees: MetricsTree_Mining_Rewards_Fees = MetricsTree_Mining_Rewards_Fees(client) - self.unclaimed: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, 'unclaimed_rewards') + self.unclaimed: CumulativeRawSumPattern4 = CumulativeRawSumPattern4(client, 'unclaimed_rewards') class MetricsTree_Mining_Hashrate_Rate_Sma: """Metrics tree node.""" @@ -3666,7 +3743,7 @@ class MetricsTree_Mining_Hashrate_Rate: self.raw: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate') self.sma: MetricsTree_Mining_Hashrate_Rate_Sma = MetricsTree_Mining_Hashrate_Rate_Sma(client) self.ath: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_ath') - self.drawdown: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'hash_rate_drawdown') + self.drawdown: BpsPercentRatioPattern5 = BpsPercentRatioPattern5(client, 'hash_rate_drawdown') class MetricsTree_Mining_Hashrate: """Metrics tree node.""" @@ -3713,12 +3790,12 @@ class MetricsTree_Cointime_Cap: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.thermo: CentsUsdPattern = CentsUsdPattern(client, 'thermo_cap') - self.investor: CentsUsdPattern = CentsUsdPattern(client, 'investor_cap') - self.vaulted: CentsUsdPattern = CentsUsdPattern(client, 'vaulted_cap') - self.active: CentsUsdPattern = CentsUsdPattern(client, 'active_cap') - self.cointime: CentsUsdPattern = CentsUsdPattern(client, 'cointime_cap') - self.aviv: BpsRatioPattern = BpsRatioPattern(client, 'aviv_ratio') + self.thermo: CentsUsdPattern2 = CentsUsdPattern2(client, 'thermo_cap') + self.investor: CentsUsdPattern2 = CentsUsdPattern2(client, 'investor_cap') + self.vaulted: CentsUsdPattern2 = CentsUsdPattern2(client, 'vaulted_cap') + self.active: CentsUsdPattern2 = CentsUsdPattern2(client, 'active_cap') + self.cointime: CentsUsdPattern2 = CentsUsdPattern2(client, 'cointime_cap') + self.aviv: BpsRatioPattern2 = BpsRatioPattern2(client, 'aviv_ratio') class MetricsTree_Cointime_Prices: """Metrics tree node.""" @@ -3738,7 +3815,7 @@ class MetricsTree_Cointime_Adjusted: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.inflation_rate: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'cointime_adj_inflation_rate') + self.inflation_rate: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'cointime_adj_inflation_rate') self.tx_velocity_btc: MetricPattern1[StoredF64] = MetricPattern1(client, 'cointime_adj_tx_velocity_btc') self.tx_velocity_usd: MetricPattern1[StoredF64] = MetricPattern1(client, 'cointime_adj_tx_velocity_usd') @@ -4074,11 +4151,11 @@ class MetricsTree_Indicators: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.puell_multiple: BpsRatioPattern = BpsRatioPattern(client, 'puell_multiple') - self.nvt: BpsRatioPattern = BpsRatioPattern(client, 'nvt') - self.gini: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'gini') - self.rhodl_ratio: BpsRatioPattern = BpsRatioPattern(client, 'rhodl_ratio') - self.thermocap_multiple: BpsRatioPattern = BpsRatioPattern(client, 'thermocap_multiple') + self.puell_multiple: BpsRatioPattern2 = BpsRatioPattern2(client, 'puell_multiple') + self.nvt: BpsRatioPattern2 = BpsRatioPattern2(client, 'nvt') + self.gini: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'gini') + self.rhodl_ratio: BpsRatioPattern2 = BpsRatioPattern2(client, 'rhodl_ratio') + self.thermocap_multiple: BpsRatioPattern2 = BpsRatioPattern2(client, 'thermocap_multiple') self.coindays_destroyed_supply_adjusted: MetricPattern1[StoredF32] = MetricPattern1(client, 'coindays_destroyed_supply_adjusted') self.coinyears_destroyed_supply_adjusted: MetricPattern1[StoredF32] = MetricPattern1(client, 'coinyears_destroyed_supply_adjusted') self.dormancy: MetricsTree_Indicators_Dormancy = MetricsTree_Indicators_Dormancy(client) @@ -4090,7 +4167,7 @@ class MetricsTree_Market_Ath: def __init__(self, client: BrkClientBase, base_path: str = ''): self.high: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_ath') - self.drawdown: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_drawdown') + self.drawdown: BpsPercentRatioPattern5 = BpsPercentRatioPattern5(client, 'price_drawdown') self.days_since: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_since_price_ath') self.years_since: MetricPattern2[StoredF32] = MetricPattern2(client, 'years_since_price_ath') self.max_days_between: MetricPattern1[StoredF32] = MetricPattern1(client, 'max_days_between_price_ath') @@ -4118,19 +4195,19 @@ class MetricsTree_Market_Returns_Periods: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - 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') + self._24h: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_24h') + self._1w: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_1w') + self._1m: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_1m') + self._3m: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_3m') + self._6m: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_6m') + self._1y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_1y') + self._2y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_2y') + self._3y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_3y') + self._4y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_4y') + self._5y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_5y') + self._6y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_6y') + self._8y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_8y') + self._10y: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'price_return_10y') class MetricsTree_Market_Returns_Sd24h_1w: """Metrics tree node.""" @@ -4178,7 +4255,7 @@ class MetricsTree_Market_Range: self.max: _1m1w1y2wPattern = _1m1w1y2wPattern(client, 'price_max') self.true_range: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_true_range') self.true_range_sum_2w: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_true_range_sum_2w') - self.choppiness_index_2w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_choppiness_index_2w') + self.choppiness_index_2w: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'price_choppiness_index_2w') class MetricsTree_Market_MovingAverage_Sma_200d_X24: """Metrics tree node.""" @@ -4342,18 +4419,18 @@ class MetricsTree_Market_Dca_Class_Return: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - 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') + self.from_2015: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2015') + self.from_2016: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2016') + self.from_2017: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2017') + self.from_2018: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2018') + self.from_2019: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2019') + self.from_2020: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2020') + self.from_2021: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2021') + self.from_2022: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2022') + self.from_2023: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2023') + self.from_2024: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2024') + self.from_2025: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2025') + self.from_2026: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'dca_return_from_2026') class MetricsTree_Market_Dca_Class: """Metrics tree node.""" @@ -4379,12 +4456,12 @@ class MetricsTree_Market_Technical_Rsi_1w: self.losses: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_losses_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') + self.rsi: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_1w') + self.rsi_min: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_min_1w') + self.rsi_max: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_max_1w') + self.stoch_rsi: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_stoch_1w') + self.stoch_rsi_k: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_stoch_k_1w') + self.stoch_rsi_d: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_stoch_d_1w') class MetricsTree_Market_Technical_Rsi_1m: """Metrics tree node.""" @@ -4394,12 +4471,12 @@ class MetricsTree_Market_Technical_Rsi_1m: self.losses: MetricPattern1[StoredF32] = MetricPattern1(client, 'rsi_losses_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') + self.rsi: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_1m') + self.rsi_min: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_min_1m') + self.rsi_max: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_max_1m') + self.stoch_rsi: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_stoch_1m') + self.stoch_rsi_k: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_stoch_k_1m') + self.stoch_rsi_d: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_stoch_d_1m') class MetricsTree_Market_Technical_Rsi_1y: """Metrics tree node.""" @@ -4409,12 +4486,12 @@ class MetricsTree_Market_Technical_Rsi_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') + self.rsi: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_1y') + self.rsi_min: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_min_1y') + self.rsi_max: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_max_1y') + self.stoch_rsi: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_stoch_1y') + self.stoch_rsi_k: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_stoch_k_1y') + self.stoch_rsi_d: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'rsi_stoch_d_1y') class MetricsTree_Market_Technical_Rsi: """Metrics tree node.""" @@ -4469,9 +4546,9 @@ class MetricsTree_Market_Technical: def __init__(self, client: BrkClientBase, base_path: str = ''): self.rsi: MetricsTree_Market_Technical_Rsi = MetricsTree_Market_Technical_Rsi(client) - 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.stoch_k: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'stoch_k') + self.stoch_d: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'stoch_d') + self.pi_cycle: BpsRatioPattern2 = BpsRatioPattern2(client, 'pi_cycle') self.macd: MetricsTree_Market_Technical_Macd = MetricsTree_Market_Technical_Macd(client) class MetricsTree_Market: @@ -4671,10 +4748,10 @@ class MetricsTree_Prices_Split: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.open: CentsSatsUsdPattern2 = CentsSatsUsdPattern2(client, 'price_open') - self.high: CentsSatsUsdPattern2 = CentsSatsUsdPattern2(client, 'price_high') - self.low: CentsSatsUsdPattern2 = CentsSatsUsdPattern2(client, 'price_low') - self.close: CentsSatsUsdPattern2 = CentsSatsUsdPattern2(client, 'price_close') + self.open: CentsSatsUsdPattern3 = CentsSatsUsdPattern3(client, 'price_open') + self.high: CentsSatsUsdPattern3 = CentsSatsUsdPattern3(client, 'price_high') + self.low: CentsSatsUsdPattern3 = CentsSatsUsdPattern3(client, 'price_low') + self.close: CentsSatsUsdPattern3 = CentsSatsUsdPattern3(client, 'price_close') class MetricsTree_Prices_Ohlc: """Metrics tree node.""" @@ -4704,8 +4781,8 @@ class MetricsTree_Supply_Burned: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.opreturn: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, 'opreturn_supply') - self.unspendable: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, 'unspendable_supply') + self.opreturn: CumulativeRawSumPattern4 = CumulativeRawSumPattern4(client, 'opreturn_supply') + self.unspendable: CumulativeRawSumPattern4 = CumulativeRawSumPattern4(client, 'unspendable_supply') class MetricsTree_Supply_Velocity: """Metrics tree node.""" @@ -4720,7 +4797,7 @@ 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_rate: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'inflation_rate') + self.inflation_rate: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'inflation_rate') self.velocity: MetricsTree_Supply_Velocity = MetricsTree_Supply_Velocity(client) self.market_cap: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'market_cap') self.market_minus_realized_cap_growth_rate: _1m1w1y24hPattern[BasisPointsSigned32] = _1m1w1y24hPattern(client, 'market_minus_realized_cap_growth_rate') @@ -4731,22 +4808,22 @@ class MetricsTree_Cohorts_Utxo_All_Supply: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.delta: ChangeRatePattern = ChangeRatePattern(client, 'supply_delta') self.in_profit: BtcCentsRelSatsUsdPattern2 = BtcCentsRelSatsUsdPattern2(client, 'supply_in_profit') self.in_loss: BtcCentsRelSatsUsdPattern2 = BtcCentsRelSatsUsdPattern2(client, 'supply_in_loss') self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'supply') self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'supply_half') + self.delta: ChangeRatePattern2 = ChangeRatePattern2(client, 'supply_delta') class MetricsTree_Cohorts_Utxo_All_Unrealized_Loss: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.negative: MetricPattern1[Dollars] = MetricPattern1(client, 'neg_unrealized_loss') - self.raw: CentsUsdPattern = CentsUsdPattern(client, 'unrealized_loss') - self.cumulative: MetricPattern1[Cents] = MetricPattern1(client, 'unrealized_loss_cumulative') - self.sum: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, 'unrealized_loss_sum') - self.rel_to_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_loss_rel_to_mcap') - self.rel_to_own_gross: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_loss_rel_to_own_gross_pnl') + self.raw: CentsUsdPattern2 = CentsUsdPattern2(client, 'unrealized_loss') + self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, 'unrealized_loss_cumulative') + self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, 'unrealized_loss_sum') + self.rel_to_mcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'unrealized_loss_rel_to_mcap') + self.rel_to_own_gross: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'unrealized_loss_rel_to_own_gross_pnl') class MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl: """Metrics tree node.""" @@ -4754,23 +4831,23 @@ class MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl: def __init__(self, client: BrkClientBase, base_path: str = ''): self.cents: MetricPattern1[CentsSigned] = MetricPattern1(client, 'net_unrealized_pnl_cents') self.usd: MetricPattern1[Dollars] = MetricPattern1(client, 'net_unrealized_pnl') - self.rel_to_own_gross: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'net_unrealized_pnl_rel_to_own_gross_pnl') + self.rel_to_own_gross: BpsPercentRatioPattern2 = BpsPercentRatioPattern2(client, 'net_unrealized_pnl_rel_to_own_gross_pnl') class MetricsTree_Cohorts_Utxo_All_Unrealized_Profit: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.raw: CentsUsdPattern = CentsUsdPattern(client, 'unrealized_profit') - self.cumulative: MetricPattern1[Cents] = MetricPattern1(client, 'unrealized_profit_cumulative') - self.sum: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, 'unrealized_profit_sum') - self.rel_to_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_profit_rel_to_mcap') - self.rel_to_own_gross: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'unrealized_profit_rel_to_own_gross_pnl') + self.raw: CentsUsdPattern2 = CentsUsdPattern2(client, 'unrealized_profit') + self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, 'unrealized_profit_cumulative') + self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, 'unrealized_profit_sum') + self.rel_to_mcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'unrealized_profit_rel_to_mcap') + self.rel_to_own_gross: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'unrealized_profit_rel_to_own_gross_pnl') class MetricsTree_Cohorts_Utxo_All_Unrealized: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.gross_pnl: CentsUsdPattern = CentsUsdPattern(client, 'unrealized_gross_pnl') + self.gross_pnl: CentsUsdPattern2 = CentsUsdPattern2(client, 'unrealized_gross_pnl') self.invested_capital: InPattern = InPattern(client, 'invested_capital_in') self.sentiment: GreedNetPainPattern = GreedNetPainPattern(client, '') self.loss: MetricsTree_Cohorts_Utxo_All_Unrealized_Loss = MetricsTree_Cohorts_Utxo_All_Unrealized_Loss(client) @@ -4783,7 +4860,7 @@ class MetricsTree_Cohorts_Utxo_All: def __init__(self, client: BrkClientBase, base_path: str = ''): self.supply: MetricsTree_Cohorts_Utxo_All_Supply = MetricsTree_Cohorts_Utxo_All_Supply(client) - self.outputs: UnspentPattern2 = UnspentPattern2(client, 'utxo_count') + self.outputs: UnspentPattern = UnspentPattern(client, 'utxo_count') self.activity: CoindaysCoinyearsDormancySentVelocityPattern = CoindaysCoinyearsDormancySentVelocityPattern(client, '') self.realized: CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern = CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern(client, '') self.cost_basis: InvestedMaxMinPercentilesSupplyPattern = InvestedMaxMinPercentilesSupplyPattern(client, '') @@ -4795,7 +4872,7 @@ class MetricsTree_Cohorts_Utxo_Sth: def __init__(self, client: BrkClientBase, base_path: str = ''): self.realized: CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern = CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern(client, 'sth') self.supply: DeltaHalfInRelTotalPattern2 = DeltaHalfInRelTotalPattern2(client, 'sth_supply') - self.outputs: UnspentPattern2 = UnspentPattern2(client, 'sth_utxo_count') + self.outputs: UnspentPattern = UnspentPattern(client, 'sth_utxo_count') self.activity: CoindaysCoinyearsDormancySentVelocityPattern = CoindaysCoinyearsDormancySentVelocityPattern(client, 'sth') self.cost_basis: InvestedMaxMinPercentilesSupplyPattern = InvestedMaxMinPercentilesSupplyPattern(client, 'sth') self.unrealized: GrossInvestedLossNetNuplProfitSentimentPattern2 = GrossInvestedLossNetNuplProfitSentimentPattern2(client, 'sth') @@ -4823,7 +4900,7 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized: def __init__(self, client: BrkClientBase, base_path: str = ''): self.profit: CumulativeDistributionRawRelSumValuePattern = CumulativeDistributionRawRelSumValuePattern(client, 'lth') self.loss: CapitulationCumulativeNegativeRawRelSumValuePattern = CapitulationCumulativeNegativeRawRelSumValuePattern(client, 'lth') - self.gross_pnl: CumulativeRawSumPattern2 = CumulativeRawSumPattern2(client, 'lth_realized_gross_pnl') + self.gross_pnl: CumulativeRawSumPattern3 = CumulativeRawSumPattern3(client, 'lth_realized_gross_pnl') self.sell_side_risk_ratio: MetricsTree_Cohorts_Utxo_Lth_Realized_SellSideRiskRatio = MetricsTree_Cohorts_Utxo_Lth_Realized_SellSideRiskRatio(client) self.net_pnl: ChangeCumulativeDeltaRawRelSumPattern = ChangeCumulativeDeltaRawRelSumPattern(client, 'lth_net') self.sopr: MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr = MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr(client) @@ -4839,7 +4916,7 @@ class MetricsTree_Cohorts_Utxo_Lth: def __init__(self, client: BrkClientBase, base_path: str = ''): self.supply: DeltaHalfInRelTotalPattern2 = DeltaHalfInRelTotalPattern2(client, 'lth_supply') - self.outputs: UnspentPattern2 = UnspentPattern2(client, 'lth_utxo_count') + self.outputs: UnspentPattern = UnspentPattern(client, 'lth_utxo_count') self.activity: CoindaysCoinyearsDormancySentVelocityPattern = CoindaysCoinyearsDormancySentVelocityPattern(client, 'lth') self.realized: MetricsTree_Cohorts_Utxo_Lth_Realized = MetricsTree_Cohorts_Utxo_Lth_Realized(client) self.cost_basis: InvestedMaxMinPercentilesSupplyPattern = InvestedMaxMinPercentilesSupplyPattern(client, 'lth')