diff --git a/crates/brk_bindgen/src/generate/fields.rs b/crates/brk_bindgen/src/generate/fields.rs index 695d710bf..f2096bb9e 100644 --- a/crates/brk_bindgen/src/generate/fields.rs +++ b/crates/brk_bindgen/src/generate/fields.rs @@ -51,18 +51,16 @@ fn compute_parameterized_value( None => syntax.path_expr("acc", &path_suffix(&field.name)), }; - // Wrap in constructor - if metadata.is_pattern_type(&field.rust_type) { - syntax.constructor(&field.rust_type, &path_expr) - } else if let Some(accessor) = metadata.find_index_set_pattern(&field.indexes) { + // Wrap in constructor — leaves use their index accessor, everything else uses the type name + if let Some(accessor) = metadata.find_index_set_pattern(&field.indexes) { syntax.constructor(&accessor.name, &path_expr) - } else if field.is_branch() { - syntax.constructor(&field.rust_type, &path_expr) - } else { + } else if field.is_leaf() { panic!( - "Field '{}' has no matching pattern or index accessor. All metrics must be indexed.", + "Field '{}' has no matching index accessor. All metrics must be indexed.", field.name ) + } else { + syntax.constructor(&field.rust_type, &path_expr) } } @@ -108,67 +106,31 @@ pub fn generate_tree_node_field( let field_name = syntax.field_name(&field.name); let type_ann = metadata.field_type_annotation(field, false, None, syntax.generic_syntax()); - let value = if metadata.is_pattern_type(&field.rust_type) { - let pattern = metadata.find_pattern(&field.rust_type); - let use_base = pattern.is_some_and(|p| p.is_parameterizable()) && base_result.is_some(); + let ctor = |type_name: &str, args: &str| { + format!("{}({}, {})", syntax.constructor_name(type_name), client_expr, args) + }; - if use_base { - let br = base_result.unwrap(); - let base_arg = syntax.string_literal(&br.base); - if let Some(pat) = pattern - && pat.is_templated() - { - let disc = pat - .extract_disc_from_instance(&br.field_parts) - .unwrap_or_default(); - let disc_arg = syntax.string_literal(&disc); - format!( - "{}({}, {}, {})", - syntax.constructor_name(&field.rust_type), - client_expr, - base_arg, - disc_arg - ) - } else { - format!( - "{}({}, {})", - syntax.constructor_name(&field.rust_type), - client_expr, - base_arg - ) - } + let value = if let Some(pattern) = metadata.find_pattern(&field.rust_type) + && pattern.is_parameterizable() + && let Some(br) = base_result + { + let base_arg = syntax.string_literal(&br.base); + if pattern.is_templated() { + let disc = pattern + .extract_disc_from_instance(&br.field_parts) + .unwrap_or_default(); + ctor(&field.rust_type, &format!("{}, {}", base_arg, syntax.string_literal(&disc))) } else { - let path_arg = syntax.path_expr("base_path", &path_suffix(child_name)); - format!( - "{}({}, {})", - syntax.constructor_name(&field.rust_type), - client_expr, - path_arg - ) + ctor(&field.rust_type, &base_arg) } } else if let Some(accessor) = metadata.find_index_set_pattern(&field.indexes) { let path_arg = base_result .map(|br| syntax.string_literal(&br.base)) .unwrap_or_else(|| syntax.path_expr("base_path", &path_suffix(child_name))); - format!( - "{}({}, {})", - syntax.constructor_name(&accessor.name), - client_expr, - path_arg - ) - } else if field.is_branch() { - let path_expr = syntax.path_expr("base_path", &path_suffix(child_name)); - format!( - "{}({}, {})", - syntax.constructor_name(&field.rust_type), - client_expr, - path_expr - ) + ctor(&accessor.name, &path_arg) } else { - panic!( - "Field '{}' is a leaf with no index accessor. All metrics must be indexed.", - field.name - ) + let path_arg = syntax.path_expr("base_path", &path_suffix(child_name)); + ctor(&field.rust_type, &path_arg) }; writeln!( diff --git a/crates/brk_bindgen/src/generate/tree.rs b/crates/brk_bindgen/src/generate/tree.rs index 98d063ebb..ad8706293 100644 --- a/crates/brk_bindgen/src/generate/tree.rs +++ b/crates/brk_bindgen/src/generate/tree.rs @@ -25,10 +25,8 @@ pub struct ChildContext<'a> { pub name: &'a str, /// The child node. pub node: &'a TreeNode, - /// The field info for this child. + /// The field info for this child (with type_param set for generic patterns). pub field: PatternField, - /// Child fields if this is a branch (for pattern lookup). - pub child_fields: Option>, /// Pattern analysis result. pub base_result: PatternBaseResult, /// Whether this is a leaf node. @@ -102,9 +100,14 @@ pub fn prepare_tree_node<'a>( let children: Vec> = branch_children .iter() .zip(fields_with_child_info) - .map(|((child_name, child_node), (field, child_fields))| { + .map(|((child_name, child_node), (mut field, child_fields))| { let is_leaf = matches!(child_node, TreeNode::Leaf(_)); + // Set type_param for generic patterns so field_type_annotation works directly + if let Some(cf) = &child_fields { + field.type_param = metadata.get_type_param(cf).cloned(); + } + // Build child path and look up its pre-computed base result let child_path = build_child_path(path, child_name); let base_result = metadata @@ -112,25 +115,17 @@ pub fn prepare_tree_node<'a>( .cloned() .unwrap_or_else(PatternBaseResult::force_inline); - // For type annotations: use pattern type if ANY pattern matches - let matches_any_pattern = child_fields + // Single lookup for the child's matching pattern (avoids repeated scans) + let matching_pattern = child_fields .as_ref() - .is_some_and(|cf| metadata.matches_pattern(cf)); + .and_then(|cf| metadata.find_pattern_by_fields(cf)); - // Check if the pattern mode AND field parts match the instance - // Uses is_none_or so that "no pattern" doesn't trigger inlining - let pattern_compatible = child_fields - .as_ref() - .and_then(|cf| metadata.find_pattern_by_fields(cf)) - .is_none_or(|p| { - p.is_suffix_mode() == base_result.is_suffix_mode - && p.field_parts_match(&base_result.field_parts) - }); - - // Check if the matching pattern is fully parameterizable (including children) - let is_parameterizable = child_fields - .as_ref() - .and_then(|cf| metadata.find_pattern_by_fields(cf)) + let matches_any_pattern = matching_pattern.is_some(); + let pattern_compatible = matching_pattern.is_none_or(|p| { + p.is_suffix_mode() == base_result.is_suffix_mode + && p.field_parts_match(&base_result.field_parts) + }); + let is_parameterizable = matching_pattern .is_none_or(|p| metadata.is_parameterizable(&p.name)); // should_inline determines if we generate an inline struct type @@ -140,7 +135,6 @@ pub fn prepare_tree_node<'a>( || !is_parameterizable || base_result.has_outlier); - // Inline type name (only used when should_inline is true) let inline_type_name = if should_inline { child_type_name(name, child_name) } else { @@ -151,7 +145,6 @@ pub fn prepare_tree_node<'a>( name: child_name, node: child_node, field, - child_fields, base_result, is_leaf, should_inline, diff --git a/crates/brk_bindgen/src/generators/javascript/tree.rs b/crates/brk_bindgen/src/generators/javascript/tree.rs index d657167c9..5172bd46b 100644 --- a/crates/brk_bindgen/src/generators/javascript/tree.rs +++ b/crates/brk_bindgen/src/generators/javascript/tree.rs @@ -50,13 +50,7 @@ fn generate_tree_typedef( let js_type = if child.should_inline { child.inline_type_name.clone() } else { - metadata.resolve_tree_field_type( - &child.field, - child.child_fields.as_deref(), - name, - child.name, - GenericSyntax::JAVASCRIPT, - ) + metadata.field_type_annotation(&child.field, false, None, GenericSyntax::JAVASCRIPT) }; writeln!( diff --git a/crates/brk_bindgen/src/generators/rust/tree.rs b/crates/brk_bindgen/src/generators/rust/tree.rs index 2edc276ac..b30f2b88f 100644 --- a/crates/brk_bindgen/src/generators/rust/tree.rs +++ b/crates/brk_bindgen/src/generators/rust/tree.rs @@ -49,13 +49,7 @@ fn generate_tree_node( let type_annotation = if child.should_inline { child.inline_type_name.clone() } else { - metadata.resolve_tree_field_type( - &child.field, - child.child_fields.as_deref(), - name, - child.name, - GenericSyntax::RUST, - ) + metadata.field_type_annotation(&child.field, false, None, GenericSyntax::RUST) }; writeln!(output, " pub {}: {},", field_name, type_annotation).unwrap(); } diff --git a/crates/brk_bindgen/src/types/metadata.rs b/crates/brk_bindgen/src/types/metadata.rs index 9f78c6461..7284b00ce 100644 --- a/crates/brk_bindgen/src/types/metadata.rs +++ b/crates/brk_bindgen/src/types/metadata.rs @@ -17,8 +17,8 @@ pub struct ClientMetadata { pub structural_patterns: Vec, /// Index set patterns - sets of indexes that appear together on metrics pub index_set_patterns: Vec, - /// Maps concrete field signatures to pattern names - concrete_to_pattern: BTreeMap, String>, + /// Maps field signatures to pattern names (merged from concrete instances + pattern definitions) + pattern_lookup: BTreeMap, String>, /// Maps concrete field signatures to their type parameter (for generic patterns) concrete_to_type_param: BTreeMap, String>, /// Maps tree paths to their computed PatternBaseResult @@ -37,11 +37,17 @@ impl ClientMetadata { analysis::detect_structural_patterns(&catalog); let index_set_patterns = analysis::detect_index_patterns(&catalog); + // Build merged pattern lookup: concrete instances + pattern definitions + let mut pattern_lookup = concrete_to_pattern; + for p in &structural_patterns { + pattern_lookup.insert(p.fields.clone(), p.name.clone()); + } + ClientMetadata { catalog, structural_patterns, index_set_patterns, - concrete_to_pattern, + pattern_lookup, concrete_to_type_param, node_bases, } @@ -54,21 +60,11 @@ impl ClientMetadata { .find(|p| &p.indexes == indexes) } - /// Check if a type is a structural pattern name. - pub fn is_pattern_type(&self, type_name: &str) -> bool { - self.structural_patterns.iter().any(|p| p.name == type_name) - } - /// Find a pattern by name. pub fn find_pattern(&self, name: &str) -> Option<&StructuralPattern> { self.structural_patterns.iter().find(|p| p.name == name) } - /// Check if a pattern is generic. - pub fn is_pattern_generic(&self, name: &str) -> bool { - self.find_pattern(name).is_some_and(|p| p.is_generic) - } - /// Check if a pattern is fully parameterizable (recursively). /// Returns false if the pattern or any nested branch pattern has no mode. pub fn is_parameterizable(&self, name: &str) -> bool { @@ -82,41 +78,11 @@ impl ClientMetadata { }) } - /// Check if child fields match ANY pattern (parameterizable or not). - /// Used for type annotations - we want to reuse pattern types for all patterns. - pub fn matches_pattern(&self, fields: &[PatternField]) -> bool { - self.concrete_to_pattern.contains_key(fields) - || self.structural_patterns.iter().any(|p| p.fields == fields) - } - - /// Find a pattern by its fields. + /// Find a pattern by its concrete fields. pub fn find_pattern_by_fields(&self, fields: &[PatternField]) -> Option<&StructuralPattern> { - self.concrete_to_pattern + self.pattern_lookup .get(fields) .and_then(|name| self.find_pattern(name)) - .or_else(|| self.structural_patterns.iter().find(|p| p.fields == fields)) - } - - /// Resolve the type name for a tree field. - /// If the field matches ANY pattern (parameterizable or not), returns pattern type. - /// Otherwise returns the inline type name (parent_child format). - pub fn resolve_tree_field_type( - &self, - field: &PatternField, - child_fields: Option<&[PatternField]>, - parent_name: &str, - child_name: &str, - syntax: GenericSyntax, - ) -> String { - match child_fields { - // Use pattern type for ANY matching pattern (parameterizable or not) - Some(cf) if self.matches_pattern(cf) => { - let generic_value_type = self.get_type_param(cf).map(String::as_str); - self.field_type_annotation(field, false, generic_value_type, syntax) - } - Some(_) => crate::child_type_name(parent_name, child_name), - None => self.field_type_annotation(field, false, None, syntax), - } } /// Get the type parameter for a generic pattern given its concrete fields. @@ -124,13 +90,9 @@ impl ClientMetadata { self.concrete_to_type_param.get(fields) } - /// Build a lookup map from field signatures to pattern names. - pub fn pattern_lookup(&self) -> BTreeMap, String> { - let mut lookup = self.concrete_to_pattern.clone(); - for p in &self.structural_patterns { - lookup.insert(p.fields.clone(), p.name.clone()); - } - lookup + /// Get the pre-computed pattern lookup map. + pub fn pattern_lookup(&self) -> &BTreeMap, String> { + &self.pattern_lookup } /// Get the pre-computed PatternBaseResult for a tree path. @@ -146,14 +108,9 @@ impl ClientMetadata { generic_value_type: Option<&str>, syntax: GenericSyntax, ) -> String { - let value_type = if is_generic && field.rust_type == "T" { - "T".to_string() - } else { - extract_inner_type(&field.rust_type) - }; - - if self.is_pattern_type(&field.rust_type) { - if self.is_pattern_generic(&field.rust_type) { + // Pattern type — single lookup instead of is_pattern_type + is_pattern_generic + if let Some(pattern) = self.find_pattern(&field.rust_type) { + if pattern.is_generic { let type_param = field .type_param .as_deref() @@ -161,10 +118,21 @@ impl ClientMetadata { .unwrap_or(if is_generic { "T" } else { syntax.default_type }); return syntax.wrap(&field.rust_type, type_param); } - field.rust_type.clone() - } else if field.is_branch() { - field.rust_type.clone() - } else if let Some(accessor) = self.find_index_set_pattern(&field.indexes) { + return field.rust_type.clone(); + } + + // Branch type (non-pattern) + if field.is_branch() { + return field.rust_type.clone(); + } + + // Leaf type + let value_type = if is_generic && field.rust_type == "T" { + "T".to_string() + } else { + extract_inner_type(&field.rust_type) + }; + if let Some(accessor) = self.find_index_set_pattern(&field.indexes) { syntax.wrap(&accessor.name, &value_type) } else { syntax.wrap("MetricNode", &value_type) diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index b3d7c2a97..fe06e9e98 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -3119,15 +3119,15 @@ class MetricsTree_Blocks_Size: def __init__(self, client: BrkClientBase, base_path: str = ''): self.total: MetricPattern18[StoredU64] = MetricPattern18(client, 'total_size') self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, 'block_size_cumulative') - self.sum: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_size_sum') - self.average: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_size_average') - self.min: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_size_min') - self.max: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_size_max') - self.pct10: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_size_pct10') - self.pct25: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_size_pct25') - self.median: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_size_median') - self.pct75: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_size_pct75') - self.pct90: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_size_pct90') + self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_sum') + self.average: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_average') + self.min: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_min') + self.max: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_max') + self.pct10: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_pct10') + self.pct25: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_pct25') + self.median: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_median') + self.pct75: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_pct75') + self.pct90: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, 'block_size_pct90') class MetricsTree_Blocks_Weight: """Metrics tree node.""" @@ -3135,15 +3135,15 @@ class MetricsTree_Blocks_Weight: def __init__(self, client: BrkClientBase, base_path: str = ''): self.raw: MetricPattern18[Weight] = MetricPattern18(client, 'block_weight') self.cumulative: MetricPattern1[Weight] = MetricPattern1(client, 'block_weight_cumulative') - self.sum: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_weight_sum') - self.average: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_weight_average') - self.min: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_weight_min') - self.max: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_weight_max') - self.pct10: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_weight_pct10') - self.pct25: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_weight_pct25') - self.median: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_weight_median') - self.pct75: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_weight_pct75') - self.pct90: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'block_weight_pct90') + self.sum: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_sum') + self.average: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_average') + self.min: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_min') + self.max: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_max') + self.pct10: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_pct10') + self.pct25: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_pct25') + self.median: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_median') + self.pct75: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_pct75') + self.pct90: _1m1w1y24hPattern[Weight] = _1m1w1y24hPattern(client, 'block_weight_pct90') class MetricsTree_Blocks_Count: """Metrics tree node.""" @@ -3204,7 +3204,7 @@ class MetricsTree_Blocks_Fullness: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.bps: _1m1w1y24hHeightPattern[Any] = _1m1w1y24hHeightPattern(client, 'block_fullness_bps') + self.bps: _1m1w1y24hHeightPattern[BasisPoints16] = _1m1w1y24hHeightPattern(client, 'block_fullness_bps') self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, 'block_fullness_ratio') self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, 'block_fullness') @@ -3227,7 +3227,7 @@ class MetricsTree_Blocks: self.weight: MetricsTree_Blocks_Weight = MetricsTree_Blocks_Weight(client) self.count: MetricsTree_Blocks_Count = MetricsTree_Blocks_Count(client) self.lookback: MetricsTree_Blocks_Lookback = MetricsTree_Blocks_Lookback(client) - self.interval: _1m1w1y24hHeightPattern[Any] = _1m1w1y24hHeightPattern(client, 'block_interval') + self.interval: _1m1w1y24hHeightPattern[Timestamp] = _1m1w1y24hHeightPattern(client, 'block_interval') self.vbytes: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'block_vbytes') self.fullness: MetricsTree_Blocks_Fullness = MetricsTree_Blocks_Fullness(client) self.halving: MetricsTree_Blocks_Halving = MetricsTree_Blocks_Halving(client) @@ -3258,8 +3258,8 @@ class MetricsTree_Transactions_Size: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.vsize: _6bBlockTxPattern[Any] = _6bBlockTxPattern(client, 'tx_vsize') - self.weight: _6bBlockTxPattern[Any] = _6bBlockTxPattern(client, 'tx_weight') + self.vsize: _6bBlockTxPattern[VSize] = _6bBlockTxPattern(client, 'tx_vsize') + self.weight: _6bBlockTxPattern[Weight] = _6bBlockTxPattern(client, 'tx_weight') class MetricsTree_Transactions_Fees: """Metrics tree node.""" @@ -3267,16 +3267,16 @@ class MetricsTree_Transactions_Fees: def __init__(self, client: BrkClientBase, base_path: str = ''): self.input_value: MetricPattern19[Sats] = MetricPattern19(client, 'input_value') self.output_value: MetricPattern19[Sats] = MetricPattern19(client, 'output_value') - self.fee: _6bBlockTxPattern[Any] = _6bBlockTxPattern(client, 'fee') - self.fee_rate: _6bBlockTxPattern[Any] = _6bBlockTxPattern(client, 'fee_rate') + self.fee: _6bBlockTxPattern[Sats] = _6bBlockTxPattern(client, 'fee') + self.fee_rate: _6bBlockTxPattern[FeeRate] = _6bBlockTxPattern(client, 'fee_rate') class MetricsTree_Transactions_Versions: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.v1: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'tx_v1') - self.v2: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'tx_v2') - self.v3: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'tx_v3') + self.v1: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'tx_v1') + self.v2: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'tx_v2') + self.v3: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'tx_v3') class MetricsTree_Transactions_Volume: """Metrics tree node.""" @@ -3464,15 +3464,15 @@ class MetricsTree_Addresses_New: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.all: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'new_address_count') - self.p2pk65: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2pk65_new_address_count') - self.p2pk33: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2pk33_new_address_count') - self.p2pkh: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2pkh_new_address_count') - self.p2sh: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2sh_new_address_count') - self.p2wpkh: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2wpkh_new_address_count') - self.p2wsh: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2wsh_new_address_count') - self.p2tr: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2tr_new_address_count') - self.p2a: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2a_new_address_count') + self.all: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'new_address_count') + self.p2pk65: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2pk65_new_address_count') + self.p2pk33: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2pk33_new_address_count') + self.p2pkh: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2pkh_new_address_count') + self.p2sh: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2sh_new_address_count') + self.p2wpkh: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2wpkh_new_address_count') + self.p2wsh: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2wsh_new_address_count') + self.p2tr: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2tr_new_address_count') + self.p2a: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2a_new_address_count') class MetricsTree_Addresses_Delta: """Metrics tree node.""" @@ -3543,19 +3543,19 @@ class MetricsTree_Scripts_Count: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.p2a: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2a_count') - self.p2ms: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2ms_count') - self.p2pk33: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2pk33_count') - self.p2pk65: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2pk65_count') - self.p2pkh: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2pkh_count') - self.p2sh: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2sh_count') - self.p2tr: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2tr_count') - self.p2wpkh: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2wpkh_count') - self.p2wsh: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'p2wsh_count') - self.op_return: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'op_return_count') - self.empty_output: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'empty_output_count') - self.unknown_output: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'unknown_output_count') - self.segwit: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'segwit_count') + self.p2a: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2a_count') + self.p2ms: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2ms_count') + self.p2pk33: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2pk33_count') + self.p2pk65: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2pk65_count') + self.p2pkh: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2pkh_count') + self.p2sh: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2sh_count') + self.p2tr: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2tr_count') + self.p2wpkh: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2wpkh_count') + self.p2wsh: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2wsh_count') + self.op_return: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'op_return_count') + self.empty_output: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'empty_output_count') + self.unknown_output: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'unknown_output_count') + self.segwit: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'segwit_count') class MetricsTree_Scripts_Value: """Metrics tree node.""" @@ -3657,8 +3657,8 @@ class MetricsTree_Cointime_Activity: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.coinblocks_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'coinblocks_created') - self.coinblocks_stored: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'coinblocks_stored') + self.coinblocks_created: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'coinblocks_created') + self.coinblocks_stored: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'coinblocks_stored') self.liveliness: MetricPattern1[StoredF64] = MetricPattern1(client, 'liveliness') self.vaultedness: MetricPattern1[StoredF64] = MetricPattern1(client, 'vaultedness') self.ratio: MetricPattern1[StoredF64] = MetricPattern1(client, 'activity_to_vaultedness_ratio') @@ -3674,10 +3674,10 @@ class MetricsTree_Cointime_Value: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'cointime_value_destroyed') - self.created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'cointime_value_created') - self.stored: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'cointime_value_stored') - self.vocdd: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'vocdd') + self.destroyed: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'cointime_value_destroyed') + self.created: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'cointime_value_created') + self.stored: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'cointime_value_stored') + self.vocdd: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'vocdd') class MetricsTree_Cointime_Cap: """Metrics tree node.""" @@ -3731,7 +3731,7 @@ class MetricsTree_Cointime: self.prices: MetricsTree_Cointime_Prices = MetricsTree_Cointime_Prices(client) self.adjusted: MetricsTree_Cointime_Adjusted = MetricsTree_Cointime_Adjusted(client) self.reserve_risk: MetricsTree_Cointime_ReserveRisk = MetricsTree_Cointime_ReserveRisk(client) - self.coinblocks_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'coinblocks_destroyed') + self.coinblocks_destroyed: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'coinblocks_destroyed') class MetricsTree_Constants: """Metrics tree node.""" @@ -4642,7 +4642,7 @@ class MetricsTree_Supply: self.inflation_rate: BpsPercentRatioPattern = BpsPercentRatioPattern(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[Any] = _1m1w1y24hPattern(client, 'market_minus_realized_cap_growth_rate') + self.market_minus_realized_cap_growth_rate: _1m1w1y24hPattern[BasisPointsSigned32] = _1m1w1y24hPattern(client, 'market_minus_realized_cap_growth_rate') self.hodled_or_lost: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'hodled_or_lost_coins') class MetricsTree_Cohorts_Utxo_All_Supply: @@ -4660,7 +4660,7 @@ class MetricsTree_Cohorts_Utxo_All_Activity: def __init__(self, client: BrkClientBase, base_path: str = ''): self.sent: BaseCumulativeInSumPattern = BaseCumulativeInSumPattern(client, 'sent') - self.coindays_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'coindays_destroyed') + self.coindays_destroyed: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'coindays_destroyed') self.coinyears_destroyed: MetricPattern1[StoredF64] = MetricPattern1(client, 'coinyears_destroyed') self.dormancy: MetricPattern1[StoredF32] = MetricPattern1(client, 'dormancy') @@ -4672,8 +4672,8 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Profit: self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, 'realized_profit_cumulative') self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'realized_profit_sum') self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'realized_profit_rel_to_rcap') - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'profit_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'profit_value_destroyed') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'profit_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'profit_value_destroyed') self.distribution_flow: MetricPattern1[Dollars] = MetricPattern1(client, 'distribution_flow') class MetricsTree_Cohorts_Utxo_All_Realized_Loss: @@ -4685,8 +4685,8 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Loss: self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'realized_loss_sum') self.negative: MetricPattern1[Dollars] = MetricPattern1(client, 'neg_realized_loss') self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'realized_loss_rel_to_rcap') - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'loss_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'loss_value_destroyed') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'loss_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'loss_value_destroyed') self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, 'capitulation_flow') class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All: @@ -4795,17 +4795,17 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.ratio: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'asopr') - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'adj_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'adj_value_destroyed') + self.ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'asopr') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'adj_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'adj_value_destroyed') class MetricsTree_Cohorts_Utxo_All_Realized_Sopr: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'value_destroyed') - self.ratio: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'sopr') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'value_destroyed') + self.ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'sopr') self.adjusted: MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted = MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted(client) class MetricsTree_Cohorts_Utxo_All_Realized_Investor: @@ -4831,7 +4831,7 @@ class MetricsTree_Cohorts_Utxo_All_Realized: self.sell_side_risk_ratio: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, 'sell_side_risk_ratio') self.peak_regret: BaseCumulativeRelPattern = BaseCumulativeRelPattern(client, 'realized_peak_regret') self.investor: MetricsTree_Cohorts_Utxo_All_Realized_Investor = MetricsTree_Cohorts_Utxo_All_Realized_Investor(client) - self.profit_to_loss_ratio: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'realized_profit_to_loss_ratio') + self.profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'realized_profit_to_loss_ratio') class MetricsTree_Cohorts_Utxo_All_CostBasis: """Metrics tree node.""" @@ -4908,7 +4908,7 @@ class MetricsTree_Cohorts_Utxo_Sth_Activity: def __init__(self, client: BrkClientBase, base_path: str = ''): self.sent: BaseCumulativeInSumPattern = BaseCumulativeInSumPattern(client, 'sth_sent') - self.coindays_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'sth_coindays_destroyed') + self.coindays_destroyed: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'sth_coindays_destroyed') self.coinyears_destroyed: MetricPattern1[StoredF64] = MetricPattern1(client, 'sth_coinyears_destroyed') self.dormancy: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_dormancy') @@ -4920,8 +4920,8 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Profit: self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, 'sth_realized_profit_cumulative') self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'sth_realized_profit_sum') self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'sth_realized_profit_rel_to_rcap') - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'sth_profit_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'sth_profit_value_destroyed') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'sth_profit_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'sth_profit_value_destroyed') self.distribution_flow: MetricPattern1[Dollars] = MetricPattern1(client, 'sth_distribution_flow') class MetricsTree_Cohorts_Utxo_Sth_Realized_Loss: @@ -4933,8 +4933,8 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Loss: self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'sth_realized_loss_sum') self.negative: MetricPattern1[Dollars] = MetricPattern1(client, 'sth_neg_realized_loss') self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'sth_realized_loss_rel_to_rcap') - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'sth_loss_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'sth_loss_value_destroyed') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'sth_loss_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'sth_loss_value_destroyed') self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, 'sth_capitulation_flow') class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All: @@ -5043,17 +5043,17 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.ratio: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'sth_asopr') - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'sth_adj_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'sth_adj_value_destroyed') + self.ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'sth_asopr') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'sth_adj_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'sth_adj_value_destroyed') class MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'sth_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'sth_value_destroyed') - self.ratio: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'sth_sopr') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'sth_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'sth_value_destroyed') + self.ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'sth_sopr') self.adjusted: MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted = MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted(client) class MetricsTree_Cohorts_Utxo_Sth_Realized_Investor: @@ -5079,7 +5079,7 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized: self.sell_side_risk_ratio: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, 'sth_sell_side_risk_ratio') self.peak_regret: BaseCumulativeRelPattern = BaseCumulativeRelPattern(client, 'sth_realized_peak_regret') self.investor: MetricsTree_Cohorts_Utxo_Sth_Realized_Investor = MetricsTree_Cohorts_Utxo_Sth_Realized_Investor(client) - self.profit_to_loss_ratio: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'sth_realized_profit_to_loss_ratio') + self.profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'sth_realized_profit_to_loss_ratio') class MetricsTree_Cohorts_Utxo_Sth_CostBasis: """Metrics tree node.""" @@ -5127,7 +5127,7 @@ class MetricsTree_Cohorts_Utxo_Lth_Activity: def __init__(self, client: BrkClientBase, base_path: str = ''): self.sent: BaseCumulativeInSumPattern = BaseCumulativeInSumPattern(client, 'lth_sent') - self.coindays_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'lth_coindays_destroyed') + self.coindays_destroyed: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'lth_coindays_destroyed') self.coinyears_destroyed: MetricPattern1[StoredF64] = MetricPattern1(client, 'lth_coinyears_destroyed') self.dormancy: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_dormancy') @@ -5139,8 +5139,8 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Profit: self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, 'lth_realized_profit_cumulative') self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'lth_realized_profit_sum') self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'lth_realized_profit_rel_to_rcap') - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'lth_profit_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'lth_profit_value_destroyed') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'lth_profit_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'lth_profit_value_destroyed') self.distribution_flow: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_distribution_flow') class MetricsTree_Cohorts_Utxo_Lth_Realized_Loss: @@ -5152,8 +5152,8 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Loss: self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'lth_realized_loss_sum') self.negative: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_neg_realized_loss') self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'lth_realized_loss_rel_to_rcap') - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'lth_loss_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'lth_loss_value_destroyed') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'lth_loss_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'lth_loss_value_destroyed') self.capitulation_flow: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_capitulation_flow') class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All: @@ -5262,9 +5262,9 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr: """Metrics tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.value_created: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'lth_value_created') - self.value_destroyed: BaseCumulativeSumPattern[Any] = BaseCumulativeSumPattern(client, 'lth_value_destroyed') - self.ratio: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'lth_sopr') + self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'lth_value_created') + self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, 'lth_value_destroyed') + self.ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'lth_sopr') class MetricsTree_Cohorts_Utxo_Lth_Realized_Investor: """Metrics tree node.""" @@ -5289,7 +5289,7 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized: self.sell_side_risk_ratio: _1m1w1y24hPattern6 = _1m1w1y24hPattern6(client, 'lth_sell_side_risk_ratio') self.peak_regret: BaseCumulativeRelPattern = BaseCumulativeRelPattern(client, 'lth_realized_peak_regret') self.investor: MetricsTree_Cohorts_Utxo_Lth_Realized_Investor = MetricsTree_Cohorts_Utxo_Lth_Realized_Investor(client) - self.profit_to_loss_ratio: _1m1w1y24hPattern[Any] = _1m1w1y24hPattern(client, 'lth_realized_profit_to_loss_ratio') + self.profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'lth_realized_profit_to_loss_ratio') class MetricsTree_Cohorts_Utxo_Lth_CostBasis: """Metrics tree node."""