From 46d85d397da7c945e83762b47d488df59d7db59a Mon Sep 17 00:00:00 2001 From: nym21 Date: Mon, 16 Mar 2026 09:04:10 +0100 Subject: [PATCH] bindgen: snap --- crates/brk_bindgen/src/analysis/positions.rs | 13 - crates/brk_bindgen/src/backends/rust.rs | 27 +- .../src/generators/python/client.rs | 25 +- .../brk_bindgen/src/generators/python/tree.rs | 27 +- crates/brk_bindgen/src/types/structs.rs | 7 +- packages/brk_client/brk_client/__init__.py | 454 +++++++----------- website/scripts/options/shared.js | 24 - 7 files changed, 220 insertions(+), 357 deletions(-) diff --git a/crates/brk_bindgen/src/analysis/positions.rs b/crates/brk_bindgen/src/analysis/positions.rs index cf833ef29..626eaec56 100644 --- a/crates/brk_bindgen/src/analysis/positions.rs +++ b/crates/brk_bindgen/src/analysis/positions.rs @@ -439,19 +439,6 @@ fn analyze_instance(child_bases: &BTreeMap) -> InstanceAnalysis field_parts.insert(field_name.clone(), relative); } - // If all field_parts are empty (all children returned the same base), - // use the field keys as suffix discriminators. This handles patterns like - // period windows (all/_4y/_2y/_1y) where children differ by a suffix - // that corresponds to the tree key. - if field_parts.len() > 1 && field_parts.values().all(|v| v.is_empty()) { - return InstanceAnalysis { - base, - field_parts, - is_suffix_mode: true, - has_outlier: false, - }; - } - return InstanceAnalysis { base, field_parts, diff --git a/crates/brk_bindgen/src/backends/rust.rs b/crates/brk_bindgen/src/backends/rust.rs index a58e2af13..f4668c526 100644 --- a/crates/brk_bindgen/src/backends/rust.rs +++ b/crates/brk_bindgen/src/backends/rust.rs @@ -5,6 +5,14 @@ use crate::{GenericSyntax, LanguageSyntax, to_snake_case}; /// Rust-specific code generation syntax. pub struct RustSyntax; +/// Escape braces in a template string for use in `format!()`, preserving `{disc}`. +fn escape_rust_format(template: &str) -> String { + template + .replace('{', "{{") + .replace('}', "}}") + .replace("{{disc}}", "{disc}") +} + impl LanguageSyntax for RustSyntax { fn field_name(&self, name: &str) -> String { to_snake_case(name) @@ -67,35 +75,22 @@ impl LanguageSyntax for RustSyntax { let static_part = template.trim_end_matches("{disc}").trim_end_matches('_'); format!("_m(\"{}\", &disc)", static_part) } else { - let rust_template = template - .replace("{disc}", "{disc}") - .replace('{', "{{") - .replace('}', "}}") - .replace("{{disc}}", "{disc}"); - format!("format!(\"{}\")", rust_template) + format!("format!(\"{}\")", escape_rust_format(template)) } } fn template_expr(&self, acc_var: &str, template: &str) -> String { if template == "{disc}" { - // _m(acc, disc) in Rust format!("_m(&{}, &disc)", acc_var) } else if template.is_empty() { - // Identity acc_var.to_string() } else if !template.contains("{disc}") { - // Static suffix format!("_m(&{}, \"{}\")", acc_var, template) } else { - // Template with disc: _m(&acc, &format!("ratio_{disc}_bps", disc=disc)) - let rust_template = template - .replace("{disc}", "{disc}") - .replace('{', "{{") - .replace('}', "}}") - .replace("{{disc}}", "{disc}"); format!( "_m(&{}, &format!(\"{}\", disc=disc))", - acc_var, rust_template + acc_var, + escape_rust_format(template) ) } } diff --git a/crates/brk_bindgen/src/generators/python/client.rs b/crates/brk_bindgen/src/generators/python/client.rs index 04becdcff..f509e8f28 100644 --- a/crates/brk_bindgen/src/generators/python/client.rs +++ b/crates/brk_bindgen/src/generators/python/client.rs @@ -695,12 +695,27 @@ pub fn generate_structural_patterns( " \"\"\"Pattern struct for repeated tree structure.\"\"\"" ) .unwrap(); + + // Skip constructor for non-parameterizable patterns (inlined at tree level) + if !metadata.is_parameterizable(&pattern.name) { + writeln!(output, " pass\n").unwrap(); + continue; + } + writeln!(output, " ").unwrap(); - writeln!( - output, - " def __init__(self, client: BrkClientBase, acc: str):" - ) - .unwrap(); + if pattern.is_templated() { + writeln!( + output, + " def __init__(self, client: BrkClientBase, acc: str, disc: str):" + ) + .unwrap(); + } else { + writeln!( + output, + " def __init__(self, client: BrkClientBase, acc: str):" + ) + .unwrap(); + } writeln!( output, " \"\"\"Create pattern node with accumulated metric name.\"\"\"" diff --git a/crates/brk_bindgen/src/generators/python/tree.rs b/crates/brk_bindgen/src/generators/python/tree.rs index 0249e5b94..019089073 100644 --- a/crates/brk_bindgen/src/generators/python/tree.rs +++ b/crates/brk_bindgen/src/generators/python/tree.rs @@ -95,12 +95,27 @@ fn generate_tree_class( child.name, GenericSyntax::PYTHON, ); - writeln!( - output, - " self.{}: {} = {}(client, '{}')", - field_name_py, py_type, child.field.rust_type, child.base_result.base - ) - .unwrap(); + let pattern = metadata.find_pattern(&child.field.rust_type); + if let Some(pat) = pattern + && pat.is_templated() + { + let disc = pat + .extract_disc_from_instance(&child.base_result.field_parts) + .unwrap_or_default(); + writeln!( + output, + " self.{}: {} = {}(client, '{}', '{}')", + field_name_py, py_type, child.field.rust_type, child.base_result.base, disc + ) + .unwrap(); + } else { + writeln!( + output, + " self.{}: {} = {}(client, '{}')", + field_name_py, py_type, child.field.rust_type, child.base_result.base + ) + .unwrap(); + } } } diff --git a/crates/brk_bindgen/src/types/structs.rs b/crates/brk_bindgen/src/types/structs.rs index ef44233ce..5ca160e9c 100644 --- a/crates/brk_bindgen/src/types/structs.rs +++ b/crates/brk_bindgen/src/types/structs.rs @@ -130,12 +130,7 @@ impl StructuralPattern { /// Extract the discriminator value by matching a template against a concrete string. /// E.g., template `"ratio_{disc}_bps"` matched against `"ratio_pct99_bps"` yields `"pct99"`. fn extract_disc(template: &str, value: &str) -> Option { - let parts: Vec<&str> = template.split("{disc}").collect(); - if parts.len() != 2 { - return None; - } - let prefix = parts[0]; - let suffix = parts[1]; + let (prefix, suffix) = template.split_once("{disc}")?; if value.starts_with(prefix) && value.ends_with(suffix) { let disc = &value[prefix.len()..value.len() - suffix.len()]; if !disc.is_empty() { diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index fe85b97de..fe06e9e98 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -2146,24 +2146,7 @@ class Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct7 class _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, f'{acc}_0sd') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'm0_5sd') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'm1_5sd') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'm1sd') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'm2_5sd') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'm2sd') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'm3sd') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'p0_5sd') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'p1_5sd') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'p1sd') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'p2_5sd') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'p2sd') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, acc, 'p3sd') - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_sd') - self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_zscore') + pass class _10y1m1w1y2y3m3y4y5y6m6y8yPattern2: """Pattern struct for repeated tree structure.""" @@ -2203,21 +2186,7 @@ class _10y1m1w1y2y3m3y4y5y6m6y8yPattern3: class CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cap: CentsDeltaRelUsdPattern = CentsDeltaRelUsdPattern(client, f'{acc}_cap') - self.gross_pnl: BaseCumulativeSumPattern3 = BaseCumulativeSumPattern3(client, f'{acc}_gross_pnl') - self.investor: LowerPriceUpperPattern = LowerPriceUpperPattern(client, f'{acc}_investor') - self.loss: BaseCapitulationCumulativeNegativeRelSumValuePattern = BaseCapitulationCumulativeNegativeRelSumValuePattern(client, f'{acc}_loss') - self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_mvrv') - self.net_pnl: BaseChangeCumulativeDeltaRelSumPattern = BaseChangeCumulativeDeltaRelSumPattern(client, f'{acc}_net_pnl') - self.peak_regret: BaseCumulativeRelPattern = BaseCumulativeRelPattern(client, f'{acc}_peak_regret') - self.price: BpsCentsPercentilesRatioSatsSmaStdUsdPattern = BpsCentsPercentilesRatioSatsSmaStdUsdPattern(client, f'{acc}_price') - self.profit: BaseCumulativeDistributionRelSumValuePattern = BaseCumulativeDistributionRelSumValuePattern(client, f'{acc}_profit') - self.profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, f'{acc}_profit_to_loss_ratio') - self.sell_side_risk_ratio: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, f'{acc}_sell_side_risk_ratio') - self.sopr: AdjustedRatioValuePattern = AdjustedRatioValuePattern(client, f'{acc}_sopr') + pass class AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern: """Pattern struct for repeated tree structure.""" @@ -2256,7 +2225,7 @@ class AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern: class AverageGainsLossesRsiStochPattern: """Pattern struct for repeated tree structure.""" - def __init__(self, client: BrkClientBase, acc: str): + def __init__(self, client: BrkClientBase, acc: str, disc: str): """Create pattern node with accumulated metric name.""" self.average_gain: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, f'average_gain_{disc}')) self.average_loss: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, f'average_loss_{disc}')) @@ -2315,31 +2284,11 @@ class AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern: class BaseCapitulationCumulativeNegativeRelSumValuePattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.base: CentsUsdPattern2 = CentsUsdPattern2(client, f'{acc}_base') - self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, f'{acc}_capitulation_flow') - self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, f'{acc}_cumulative') - self.negative: MetricPattern1[Dollars] = MetricPattern1(client, f'{acc}_negative') - self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, f'{acc}_rel_to_rcap') - self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, f'{acc}_sum') - self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, f'{acc}_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, f'{acc}_value_destroyed') + pass class BpsCentsPercentilesRatioSatsSmaStdUsdPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, _m(acc, 'ratio_bps')) - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) - self.percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern = Pct1Pct2Pct5Pct95Pct98Pct99Pattern(client, acc) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) - self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, _m(acc, 'sats')) - self.sma: _1m1w1y2y4yAllPattern = _1m1w1y2y4yAllPattern(client, _m(acc, 'ratio_sma')) - self.std_dev: _1y2y4yAllPattern = _1y2y4yAllPattern(client, _m(acc, '0sd')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) + pass class AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(Generic[T]): """Pattern struct for repeated tree structure.""" @@ -2383,16 +2332,7 @@ class _1m1w1y24hBpsPercentRatioPattern: class BaseCumulativeDistributionRelSumValuePattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.base: CentsUsdPattern2 = CentsUsdPattern2(client, f'{acc}_base') - self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, f'{acc}_cumulative') - self.distribution_flow: MetricPattern1[Dollars] = MetricPattern1(client, f'{acc}_distribution_flow') - self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, f'{acc}_rel_to_rcap') - self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, f'{acc}_sum') - self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, f'{acc}_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, f'{acc}_value_destroyed') + pass class BaseCumulativeNegativeRelSumPattern2: """Pattern struct for repeated tree structure.""" @@ -2422,16 +2362,7 @@ class CapLossMvrvNetPriceProfitSoprPattern: 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: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'unrealized_gross_pnl')) - self.invested_capital: InPattern = InPattern(client, _m(acc, 'invested_capital_in')) - self.loss: BaseCumulativeNegativeRelSumPattern2 = BaseCumulativeNegativeRelSumPattern2(client, acc) - self.net_pnl: CentsRelUsdPattern2 = CentsRelUsdPattern2(client, _m(acc, 'net_unrealized_pnl')) - self.nupl: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'nupl')) - self.profit: BaseCumulativeRelSumPattern2 = BaseCumulativeRelSumPattern2(client, _m(acc, 'unrealized_profit')) - self.sentiment: GreedNetPainPattern = GreedNetPainPattern(client, acc) + pass class _1m1w1y2y4yAllPattern: """Pattern struct for repeated tree structure.""" @@ -2631,25 +2562,11 @@ class DeltaHalfInTotalPattern2: class EmaHistogramLineSignalPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.ema_fast: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_ema_fast') - self.ema_slow: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_ema_slow') - self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_histogram') - self.line: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_line') - self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_signal') + pass class InvestedMaxMinPercentilesSupplyPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.invested_capital: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, f'{acc}_invested_capital') - self.max: CentsSatsUsdPattern = CentsSatsUsdPattern(client, f'{acc}_max') - self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, f'{acc}_min') - self.percentiles: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, f'{acc}_percentiles') - self.supply_density: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, f'{acc}_supply_density') + pass class MvrvNuplRealizedSupplyPattern: """Pattern struct for repeated tree structure.""" @@ -2746,23 +2663,11 @@ class _1m1w1y24hPattern4: class _1y2y4yAllPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._1y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern(client, f'{acc}_1y') - self._2y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern(client, f'{acc}_2y') - self._4y: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern(client, f'{acc}_4y') - self.all: _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern = _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern(client, f'{acc}_all') + pass class AdjustedRatioValuePattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.adjusted: RatioValuePattern2 = RatioValuePattern2(client, f'{acc}_adjusted') - self.ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, f'{acc}_ratio') - self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, f'{acc}_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, f'{acc}_value_destroyed') + pass class BaseCumulativeDeltaSumPattern: """Pattern struct for repeated tree structure.""" @@ -2777,7 +2682,7 @@ class BaseCumulativeDeltaSumPattern: class BaseCumulativeNegativeSumPattern: """Pattern struct for repeated tree structure.""" - def __init__(self, client: BrkClientBase, acc: str): + def __init__(self, client: BrkClientBase, acc: str, disc: str): """Create pattern node with accumulated metric name.""" self.base: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, disc)) self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, f'{disc}_cumulative')) @@ -2826,13 +2731,7 @@ class CentsRelUsdPattern2: class CoindaysCoinyearsDormancySentPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.coindays_destroyed: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, f'{acc}_coindays_destroyed') - self.coinyears_destroyed: MetricPattern1[StoredF64] = MetricPattern1(client, f'{acc}_coinyears_destroyed') - self.dormancy: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_dormancy') - self.sent: BaseCumulativeInSumPattern = BaseCumulativeInSumPattern(client, f'{acc}_sent') + pass class LossNetNuplProfitPattern: """Pattern struct for repeated tree structure.""" @@ -2940,7 +2839,7 @@ class BpsPercentRatioPattern4: class BpsPriceRatioPattern: """Pattern struct for repeated tree structure.""" - def __init__(self, client: BrkClientBase, acc: str): + def __init__(self, client: BrkClientBase, acc: str, disc: str): """Create pattern node with accumulated metric name.""" self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, _m(acc, f'ratio_{disc}_bps')) self.price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, disc)) @@ -3002,12 +2901,7 @@ class DeltaHalfTotalPattern: 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: CentsUsdPattern2 = CentsUsdPattern2(client, f'{acc}_greed_index') - self.net: CentsUsdPattern = CentsUsdPattern(client, f'{acc}_net') - self.pain_index: CentsUsdPattern2 = CentsUsdPattern2(client, f'{acc}_pain_index') + pass class LossNuplProfitPattern: """Pattern struct for repeated tree structure.""" @@ -3020,21 +2914,11 @@ class LossNuplProfitPattern: class LowerPriceUpperPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, f'{acc}_lower_price_band') - self.price: BpsCentsPercentilesRatioSatsUsdPattern = BpsCentsPercentilesRatioSatsUsdPattern(client, f'{acc}_price') - self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, f'{acc}_upper_price_band') + pass class RatioValuePattern2: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, f'{acc}_ratio') - self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, f'{acc}_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, f'{acc}_value_destroyed') + pass class RatioValuePattern: """Pattern struct for repeated tree structure.""" @@ -3162,7 +3046,7 @@ class InPattern: class PriceRatioPattern: """Pattern struct for repeated tree structure.""" - def __init__(self, client: BrkClientBase, acc: str): + def __init__(self, client: BrkClientBase, acc: str, disc: str): """Create pattern node with accumulated metric name.""" self.price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, disc)) self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, f'ratio_{disc}')) @@ -3177,11 +3061,7 @@ class RelPattern: class SdSmaPattern: """Pattern struct for repeated tree structure.""" - - def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_sd') - self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, f'{acc}_sma') + pass class ValuePattern: """Pattern struct for repeated tree structure.""" @@ -4449,10 +4329,10 @@ class MetricsTree_Market_Technical_Rsi: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._24h: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi') - self._1w: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi') - self._1m: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi') - self._1y: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi') + self._24h: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi', '24h') + self._1w: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi', '1w') + self._1m: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi', '1m') + self._1y: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi', '1y') class MetricsTree_Market_Technical_Macd_24h: """Metrics tree node.""" @@ -4816,18 +4696,18 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_sd') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_zscore') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'realized_price_0sd') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p0_5sd') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1sd') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1_5sd') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p2sd') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p2_5sd') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p3sd') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm0_5sd') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm1sd') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm1_5sd') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm2sd') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm2_5sd') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm3sd') class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y: """Metrics tree node.""" @@ -4836,18 +4716,18 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_sd_4y') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_zscore_4y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'realized_price_0sd_4y') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p0_5sd_4y') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1sd_4y') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1_5sd_4y') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p2sd_4y') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p2_5sd_4y') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p3sd_4y') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm0_5sd_4y') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm1sd_4y') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm1_5sd_4y') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm2sd_4y') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm2_5sd_4y') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm3sd_4y') class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y: """Metrics tree node.""" @@ -4856,18 +4736,18 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_sd_2y') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_zscore_2y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'realized_price_0sd_2y') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p0_5sd_2y') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1sd_2y') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1_5sd_2y') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p2sd_2y') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p2_5sd_2y') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p3sd_2y') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm0_5sd_2y') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm1sd_2y') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm1_5sd_2y') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm2sd_2y') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm2_5sd_2y') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm3sd_2y') class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y: """Metrics tree node.""" @@ -4876,18 +4756,18 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_sd_1y') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_zscore_1y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'realized_price_0sd_1y') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p0_5sd_1y') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1sd_1y') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1_5sd_1y') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p2sd_1y') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p2_5sd_1y') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p3sd_1y') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm0_5sd_1y') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm1sd_1y') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm1_5sd_1y') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm2sd_1y') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm2_5sd_1y') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'm3sd_1y') class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev: """Metrics tree node.""" @@ -5064,18 +4944,18 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_sd') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_zscore') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'sth_realized_price_0sd') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p0_5sd') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1sd') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1_5sd') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p2sd') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p2_5sd') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p3sd') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm0_5sd') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm1sd') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm1_5sd') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm2sd') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm2_5sd') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm3sd') class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y: """Metrics tree node.""" @@ -5084,18 +4964,18 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_sd_4y') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_zscore_4y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'sth_realized_price_0sd_4y') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p0_5sd_4y') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1sd_4y') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1_5sd_4y') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p2sd_4y') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p2_5sd_4y') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p3sd_4y') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm0_5sd_4y') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm1sd_4y') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm1_5sd_4y') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm2sd_4y') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm2_5sd_4y') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm3sd_4y') class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y: """Metrics tree node.""" @@ -5104,18 +4984,18 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_sd_2y') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_zscore_2y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'sth_realized_price_0sd_2y') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p0_5sd_2y') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1sd_2y') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1_5sd_2y') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p2sd_2y') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p2_5sd_2y') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p3sd_2y') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm0_5sd_2y') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm1sd_2y') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm1_5sd_2y') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm2sd_2y') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm2_5sd_2y') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm3sd_2y') class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y: """Metrics tree node.""" @@ -5124,18 +5004,18 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_sd_1y') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_zscore_1y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'sth_realized_price_0sd_1y') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p0_5sd_1y') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1sd_1y') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1_5sd_1y') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p2sd_1y') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p2_5sd_1y') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p3sd_1y') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm0_5sd_1y') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm1sd_1y') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm1_5sd_1y') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm2sd_1y') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm2_5sd_1y') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'm3sd_1y') class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev: """Metrics tree node.""" @@ -5283,18 +5163,18 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_sd') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_zscore') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_realized_price_0sd') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p0_5sd') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1sd') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1_5sd') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p2sd') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p2_5sd') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p3sd') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm0_5sd') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm1sd') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm1_5sd') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm2sd') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm2_5sd') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm3sd') class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y: """Metrics tree node.""" @@ -5303,18 +5183,18 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_sd_4y') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_zscore_4y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_realized_price_0sd_4y') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p0_5sd_4y') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1sd_4y') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1_5sd_4y') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p2sd_4y') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p2_5sd_4y') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p3sd_4y') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm0_5sd_4y') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm1sd_4y') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm1_5sd_4y') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm2sd_4y') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm2_5sd_4y') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm3sd_4y') class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y: """Metrics tree node.""" @@ -5323,18 +5203,18 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_sd_2y') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_zscore_2y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_realized_price_0sd_2y') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p0_5sd_2y') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1sd_2y') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1_5sd_2y') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p2sd_2y') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p2_5sd_2y') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p3sd_2y') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm0_5sd_2y') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm1sd_2y') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm1_5sd_2y') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm2sd_2y') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm2_5sd_2y') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm3sd_2y') class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y: """Metrics tree node.""" @@ -5343,18 +5223,18 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y: self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_sd_1y') self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_zscore_1y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_realized_price_0sd_1y') - self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') - self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price') + self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p0_5sd_1y') + self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1sd_1y') + self.p1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1_5sd_1y') + self.p2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p2sd_1y') + self.p2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p2_5sd_1y') + self.p3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p3sd_1y') + self.m0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm0_5sd_1y') + self.m1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm1sd_1y') + self.m1_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm1_5sd_1y') + self.m2sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm2sd_1y') + self.m2_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm2_5sd_1y') + self.m3sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'm3sd_1y') class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev: """Metrics tree node.""" diff --git a/website/scripts/options/shared.js b/website/scripts/options/shared.js index 0940bcfa7..4c63e4100 100644 --- a/website/scripts/options/shared.js +++ b/website/scripts/options/shared.js @@ -170,30 +170,6 @@ export function satsBtcUsdFrom({ source, key, name, color, defaultActive }) { }); } -/** - * Create sats/btc/usd series from a full value pattern using base or cumulative key - * @param {Object} args - * @param {{ base: AnyValuePattern, cumulative: AnyValuePattern }} args.source - * @param {'base' | 'cumulative'} args.key - * @param {string} args.name - * @param {Color} [args.color] - * @param {boolean} [args.defaultActive] - * @returns {FetchedLineSeriesBlueprint[]} - */ -export function satsBtcUsdFromFull({ - source, - key, - name, - color, - defaultActive, -}) { - return satsBtcUsd({ - pattern: source[key], - name, - color, - defaultActive, - }); -} /** * Create coinbase/subsidy/fee series from separate sources