diff --git a/crates/brk_bindgen/src/analysis/names.rs b/crates/brk_bindgen/src/analysis/names.rs index ab02f5a87..e032e4e0f 100644 --- a/crates/brk_bindgen/src/analysis/names.rs +++ b/crates/brk_bindgen/src/analysis/names.rs @@ -1,7 +1,7 @@ -//! Common prefix/suffix detection for metric names. +//! Common prefix/suffix detection for series names. //! //! This module provides utilities to find common prefixes and suffixes -//! among metric names, which is used to detect pattern mode (suffix vs prefix). +//! among series names, which is used to detect pattern mode (suffix vs prefix). /// Find the longest common prefix among all strings. /// Returns the prefix WITH trailing underscore if found at word boundary. diff --git a/crates/brk_bindgen/src/analysis/positions.rs b/crates/brk_bindgen/src/analysis/positions.rs index 5368be6a1..7939bff1b 100644 --- a/crates/brk_bindgen/src/analysis/positions.rs +++ b/crates/brk_bindgen/src/analysis/positions.rs @@ -179,7 +179,7 @@ fn collect_instance_analyses( ) -> Option { match node { TreeNode::Leaf(leaf) => { - // Leaves return their metric name as the base + // Leaves return their series name as the base Some(leaf.name().to_string()) } TreeNode::Branch(children) => { @@ -213,7 +213,7 @@ fn collect_instance_analyses( if all_empty { // All-empty case: all children returned the same base. // Use shortest leaf to derive field_parts for fields whose key - // matches the metric suffix (e.g., pct1 → suffix "pct1"). + // matches the series suffix (e.g., pct1 → suffix "pct1"). let prefix = format!("{}_", analysis.base); let mut any_filled = false; for (field_name, child_node) in children { @@ -234,7 +234,7 @@ fn collect_instance_analyses( // If no fields could be filled and all children are the same type, // mark as outlier so the tree inlines instead of using identity // (handles patterns like period windows where field keys differ - // from metric suffixes: all/_4y don't match 0sd/0sd_4y). + // from series suffixes: all/_4y don't match 0sd/0sd_4y). // When children are different types (like absolute/rate), identity // is correct — each child handles its own suffixes internally. if !any_filled { @@ -462,7 +462,7 @@ fn analyze_instance(child_bases: &BTreeMap) -> InstanceAnalysis // No common prefix or suffix - use empty base so _m(base, relative) returns just the relative. // No common prefix or suffix — outlier naming (e.g., sopr/asopr/adj_). - // Children have unrelated metric names that can't be parameterized. + // Children have unrelated series names that can't be parameterized. let field_parts = child_bases .iter() .map(|(k, v)| (k.clone(), v.clone())) @@ -561,7 +561,7 @@ mod tests { #[test] fn test_analyze_instance_prefix_mode() { - // Period-prefixed metrics like "1y_lump_sum_stack", "1m_lump_sum_stack" + // Period-prefixed series like "1y_lump_sum_stack", "1m_lump_sum_stack" // share a common suffix "_lump_sum_stack" with different period prefixes let mut child_bases = BTreeMap::new(); child_bases.insert("_1y".to_string(), "1y_lump_sum_stack".to_string()); @@ -721,7 +721,7 @@ mod tests { ]; let instance1 = InstanceAnalysis { - base: "metric_a".to_string(), + base: "series_a".to_string(), field_parts: [ ("max".to_string(), "max".to_string()), ("min".to_string(), "min".to_string()), @@ -732,7 +732,7 @@ mod tests { has_outlier: false, }; let instance2 = InstanceAnalysis { - base: "metric_b".to_string(), + base: "series_b".to_string(), field_parts: [ ("max".to_string(), "max".to_string()), ("min".to_string(), "min".to_string()), @@ -882,7 +882,7 @@ mod tests { ]; // SOPR case: one instance has outlier naming (no common prefix) let normal = InstanceAnalysis { - base: "metric".into(), + base: "series".into(), field_parts: [("ratio".into(), "ratio".into()), ("value".into(), "value".into())].into_iter().collect(), is_suffix_mode: true, has_outlier: false, }; @@ -1067,11 +1067,11 @@ mod tests { // Integration test: "loss" child returns same base as parent (because // its children like neg_realized_loss break the prefix). The mixed-empty // fix should fill it from shortest leaf "utxos_realized_loss". - use brk_types::{MetricLeaf, MetricLeafWithSchema, TreeNode}; + use brk_types::{SeriesLeaf, SeriesLeafWithSchema, TreeNode}; fn leaf(name: &str) -> TreeNode { - TreeNode::Leaf(MetricLeafWithSchema::new( - MetricLeaf::new(name.into(), "f32".into(), std::collections::BTreeSet::new()), + TreeNode::Leaf(SeriesLeafWithSchema::new( + SeriesLeaf::new(name.into(), "f32".into(), std::collections::BTreeSet::new()), serde_json::Value::Null, )) } diff --git a/crates/brk_bindgen/src/analysis/tree.rs b/crates/brk_bindgen/src/analysis/tree.rs index 845e909f6..e8f84e6c2 100644 --- a/crates/brk_bindgen/src/analysis/tree.rs +++ b/crates/brk_bindgen/src/analysis/tree.rs @@ -64,7 +64,7 @@ pub fn get_node_fields( fields } -/// Detect index patterns (sets of indexes that appear together on metrics). +/// Detect index patterns (sets of indexes that appear together on series). pub fn detect_index_patterns(tree: &TreeNode) -> Vec { let mut unique_index_sets: BTreeSet> = BTreeSet::new(); collect_index_sets_from_tree(tree, &mut unique_index_sets); @@ -85,7 +85,7 @@ pub fn detect_index_patterns(tree: &TreeNode) -> Vec { .into_iter() .enumerate() .map(|(i, indexes)| IndexSetPattern { - name: format!("MetricPattern{}", i + 1), + name: format!("SeriesPattern{}", i + 1), indexes, }) .collect() @@ -147,7 +147,7 @@ impl PatternBaseResult { } } -/// Get the metric base for a pattern instance by analyzing direct children. +/// Get the series base for a pattern instance by analyzing direct children. /// /// Uses the shortest leaf names from direct children to find common prefix/suffix. /// @@ -194,7 +194,7 @@ pub fn get_pattern_instance_base(node: &TreeNode) -> PatternBaseResult { } // Fallback: no common prefix/suffix found - this is a root-level pattern - // Return empty base so metric names are used directly + // Return empty base so series names are used directly PatternBaseResult::empty() } @@ -346,15 +346,15 @@ pub fn get_fields_with_child_info( #[cfg(test)] mod tests { use super::*; - use brk_types::{MetricLeaf, MetricLeafWithSchema, TreeNode}; + use brk_types::{SeriesLeaf, SeriesLeafWithSchema, TreeNode}; fn make_leaf(name: &str) -> TreeNode { - let leaf = MetricLeaf { + let leaf = SeriesLeaf { name: name.to_string(), kind: "TestType".to_string(), indexes: BTreeSet::new(), }; - TreeNode::Leaf(MetricLeafWithSchema::new(leaf, serde_json::json!({}))) + TreeNode::Leaf(SeriesLeafWithSchema::new(leaf, serde_json::json!({}))) } fn make_branch(children: Vec<(&str, TreeNode)>) -> TreeNode { @@ -390,7 +390,7 @@ mod tests { #[test] fn test_get_pattern_instance_base_without_base_field() { - // Simulates weight tree: NO base field, only suffixed metrics + // Simulates weight tree: NO base field, only suffixed series let tree = make_branch(vec![ ( "average", @@ -447,7 +447,7 @@ mod tests { #[test] fn test_get_pattern_instance_base_with_mismatched_base_name() { // Simulates the actual bug: indexed tree's "base" field has name "weight" - // but computed tree's derived metrics use "block_weight_*" prefix. + // but computed tree's derived series use "block_weight_*" prefix. // After tree merge, we get a base field with mismatched naming. let tree = make_branch(vec![ ("base", make_leaf("weight")), // Outlier - doesn't match pattern @@ -466,11 +466,11 @@ mod tests { #[test] fn test_get_pattern_instance_base_root_level_no_common_pattern() { - // Simulates root-level pattern with metrics that have no common prefix/suffix. + // Simulates root-level pattern with series that have no common prefix/suffix. // These names have no shared prefix or suffix, even when excluding any one. - // In this case, we should return empty base so metric names are used directly. + // In this case, we should return empty base so series names are used directly. let tree = make_branch(vec![ - ("alpha", make_leaf("foo_metric")), + ("alpha", make_leaf("foo_series")), ("beta", make_leaf("bar_value")), ("gamma", make_leaf("baz_count")), ]); diff --git a/crates/brk_bindgen/src/generate/fields.rs b/crates/brk_bindgen/src/generate/fields.rs index 3ab0ca78e..7a9509d3a 100644 --- a/crates/brk_bindgen/src/generate/fields.rs +++ b/crates/brk_bindgen/src/generate/fields.rs @@ -6,7 +6,7 @@ use std::fmt::Write; -use brk_types::MetricLeafWithSchema; +use brk_types::SeriesLeafWithSchema; use crate::{ClientMetadata, LanguageSyntax, PatternBaseResult, PatternField, PatternMode, StructuralPattern}; @@ -56,7 +56,7 @@ fn compute_parameterized_value( syntax.constructor(&accessor.name, &path_expr) } else if field.is_leaf() { panic!( - "Field '{}' has no matching index accessor. All metrics must be indexed.", + "Field '{}' has no matching index accessor. All series must be indexed.", field.name ) } else { @@ -66,7 +66,7 @@ fn compute_parameterized_value( /// Generate a parameterized field for a pattern factory. /// -/// Used for pattern instances where fields build metric names from an accumulated base. +/// Used for pattern instances where fields build series names from an accumulated base. pub fn generate_parameterized_field( output: &mut String, syntax: &S, @@ -135,10 +135,10 @@ pub fn generate_tree_node_field( .unwrap(); } -/// Generate a leaf field using the actual metric name from the TreeNode::Leaf. +/// Generate a leaf field using the actual series name from the TreeNode::Leaf. /// /// This is the shared implementation for all language backends. It uses -/// `leaf.name()` directly to get the correct metric name, avoiding any +/// `leaf.name()` directly to get the correct series name, avoiding any /// path concatenation that could produce incorrect names. /// /// # Arguments @@ -146,7 +146,7 @@ pub fn generate_tree_node_field( /// * `syntax` - The language syntax implementation /// * `client_expr` - The client expression (e.g., "client.clone()", "this", "client") /// * `tree_field_name` - The field name from the tree structure -/// * `leaf` - The Leaf node containing the actual metric name and indexes +/// * `leaf` - The Leaf node containing the actual series name and indexes /// * `metadata` - Client metadata for looking up index patterns /// * `indent` - Indentation string pub fn generate_leaf_field( @@ -154,7 +154,7 @@ pub fn generate_leaf_field( syntax: &S, client_expr: &str, tree_field_name: &str, - leaf: &MetricLeafWithSchema, + leaf: &SeriesLeafWithSchema, metadata: &ClientMetadata, indent: &str, ) { @@ -163,18 +163,18 @@ pub fn generate_leaf_field( .find_index_set_pattern(leaf.indexes()) .unwrap_or_else(|| { panic!( - "Metric '{}' has no matching index pattern. All metrics must be indexed.", + "Series '{}' has no matching index pattern. All series must be indexed.", leaf.name() ) }); let type_ann = metadata.field_type_annotation_from_leaf(leaf, syntax.generic_syntax()); - let metric_name = syntax.string_literal(leaf.name()); + let series_name = syntax.string_literal(leaf.name()); let value = format!( "{}({}, {})", syntax.constructor_name(&accessor.name), client_expr, - metric_name + series_name ); writeln!( diff --git a/crates/brk_bindgen/src/generators/javascript/client.rs b/crates/brk_bindgen/src/generators/javascript/client.rs index 60f248b87..b91e61695 100644 --- a/crates/brk_bindgen/src/generators/javascript/client.rs +++ b/crates/brk_bindgen/src/generators/javascript/client.rs @@ -121,15 +121,15 @@ function dateToIndex(index, d) {{ }} /** - * Wrap raw metric data with helper methods. + * Wrap raw series data with helper methods. * @template T - * @param {{MetricData}} raw - Raw JSON response - * @returns {{DateMetricData}} + * @param {{SeriesData}} raw - Raw JSON response + * @returns {{DateSeriesData}} */ -function _wrapMetricData(raw) {{ +function _wrapSeriesData(raw) {{ const {{ index, start, end, data }} = raw; const _dateBased = _DATE_INDEXES.has(index); - return /** @type {{DateMetricData}} */ ({{ + return /** @type {{DateSeriesData}} */ ({{ ...raw, isDateBased: _dateBased, indexes() {{ @@ -156,7 +156,7 @@ function _wrapMetricData(raw) {{ *[Symbol.iterator]() {{ for (let i = 0; i < data.length; i++) yield /** @type {{[number, T]}} */ ([start + i, data[i]]); }}, - // DateMetricData methods (only meaningful for date-based indexes) + // DateSeriesData methods (only meaningful for date-based indexes) dates() {{ /** @type {{globalThis.Date[]}} */ const result = []; @@ -180,47 +180,47 @@ function _wrapMetricData(raw) {{ /** * @template T - * @typedef {{Object}} MetricDataBase - * @property {{number}} version - Version of the metric data + * @typedef {{Object}} SeriesDataBase + * @property {{number}} version - Version of the series data * @property {{Index}} index - The index type used for this query * @property {{string}} type - Value type (e.g. "f32", "u64", "Sats") * @property {{number}} total - Total number of data points * @property {{number}} start - Start index (inclusive) * @property {{number}} end - End index (exclusive) * @property {{string}} stamp - ISO 8601 timestamp of when the response was generated - * @property {{T[]}} data - The metric data - * @property {{boolean}} isDateBased - Whether this metric uses a date-based index + * @property {{T[]}} data - The series data + * @property {{boolean}} isDateBased - Whether this series uses a date-based index * @property {{() => number[]}} indexes - Get index numbers * @property {{() => number[]}} keys - Get keys as index numbers (alias for indexes) * @property {{() => Array<[number, T]>}} entries - Get [index, value] pairs * @property {{() => Map}} toMap - Convert to Map */ -/** @template T @typedef {{MetricDataBase & Iterable<[number, T]>}} MetricData */ +/** @template T @typedef {{SeriesDataBase & Iterable<[number, T]>}} SeriesData */ /** * @template T - * @typedef {{Object}} DateMetricDataExtras + * @typedef {{Object}} DateSeriesDataExtras * @property {{() => globalThis.Date[]}} dates - Get dates for each data point * @property {{() => Array<[globalThis.Date, T]>}} dateEntries - Get [date, value] pairs * @property {{() => Map}} toDateMap - Convert to Map */ -/** @template T @typedef {{MetricData & DateMetricDataExtras}} DateMetricData */ -/** @typedef {{MetricData}} AnyMetricData */ +/** @template T @typedef {{SeriesData & DateSeriesDataExtras}} DateSeriesData */ +/** @typedef {{SeriesData}} AnySeriesData */ -/** @template T @typedef {{(onfulfilled?: (value: MetricData) => any, onrejected?: (reason: Error) => never) => Promise>}} Thenable */ -/** @template T @typedef {{(onfulfilled?: (value: DateMetricData) => any, onrejected?: (reason: Error) => never) => Promise>}} DateThenable */ +/** @template T @typedef {{(onfulfilled?: (value: SeriesData) => any, onrejected?: (reason: Error) => never) => Promise>}} Thenable */ +/** @template T @typedef {{(onfulfilled?: (value: DateSeriesData) => any, onrejected?: (reason: Error) => never) => Promise>}} DateThenable */ /** * @template T - * @typedef {{Object}} MetricEndpointBuilder + * @typedef {{Object}} SeriesEndpointBuilder * @property {{(index: number) => SingleItemBuilder}} get - Get single item at index * @property {{(start?: number, end?: number) => RangeBuilder}} slice - Slice by index * @property {{(n: number) => RangeBuilder}} first - Get first n items * @property {{(n: number) => RangeBuilder}} last - Get last n items * @property {{(n: number) => SkippedBuilder}} skip - Skip first n items, chain with take() - * @property {{(onUpdate?: (value: MetricData) => void) => Promise>}} fetch - Fetch all data + * @property {{(onUpdate?: (value: SeriesData) => void) => Promise>}} fetch - Fetch all data * @property {{() => Promise}} fetchCsv - Fetch all data as CSV * @property {{Thenable}} then - Thenable (await endpoint) * @property {{string}} path - The endpoint path @@ -228,79 +228,79 @@ function _wrapMetricData(raw) {{ /** * @template T - * @typedef {{Object}} DateMetricEndpointBuilder + * @typedef {{Object}} DateSeriesEndpointBuilder * @property {{(index: number | globalThis.Date) => DateSingleItemBuilder}} get - Get single item at index or Date * @property {{(start?: number | globalThis.Date, end?: number | globalThis.Date) => DateRangeBuilder}} slice - Slice by index or Date * @property {{(n: number) => DateRangeBuilder}} first - Get first n items * @property {{(n: number) => DateRangeBuilder}} last - Get last n items * @property {{(n: number) => DateSkippedBuilder}} skip - Skip first n items, chain with take() - * @property {{(onUpdate?: (value: DateMetricData) => void) => Promise>}} fetch - Fetch all data + * @property {{(onUpdate?: (value: DateSeriesData) => void) => Promise>}} fetch - Fetch all data * @property {{() => Promise}} fetchCsv - Fetch all data as CSV * @property {{DateThenable}} then - Thenable (await endpoint) * @property {{string}} path - The endpoint path */ -/** @typedef {{MetricEndpointBuilder}} AnyMetricEndpointBuilder */ +/** @typedef {{SeriesEndpointBuilder}} AnySeriesEndpointBuilder */ /** @template T @typedef {{Object}} SingleItemBuilder - * @property {{(onUpdate?: (value: MetricData) => void) => Promise>}} fetch - Fetch the item + * @property {{(onUpdate?: (value: SeriesData) => void) => Promise>}} fetch - Fetch the item * @property {{() => Promise}} fetchCsv - Fetch as CSV * @property {{Thenable}} then - Thenable */ /** @template T @typedef {{Object}} DateSingleItemBuilder - * @property {{(onUpdate?: (value: DateMetricData) => void) => Promise>}} fetch - Fetch the item + * @property {{(onUpdate?: (value: DateSeriesData) => void) => Promise>}} fetch - Fetch the item * @property {{() => Promise}} fetchCsv - Fetch as CSV * @property {{DateThenable}} then - Thenable */ /** @template T @typedef {{Object}} SkippedBuilder * @property {{(n: number) => RangeBuilder}} take - Take n items after skipped position - * @property {{(onUpdate?: (value: MetricData) => void) => Promise>}} fetch - Fetch from skipped position to end + * @property {{(onUpdate?: (value: SeriesData) => void) => Promise>}} fetch - Fetch from skipped position to end * @property {{() => Promise}} fetchCsv - Fetch as CSV * @property {{Thenable}} then - Thenable */ /** @template T @typedef {{Object}} DateSkippedBuilder * @property {{(n: number) => DateRangeBuilder}} take - Take n items after skipped position - * @property {{(onUpdate?: (value: DateMetricData) => void) => Promise>}} fetch - Fetch from skipped position to end + * @property {{(onUpdate?: (value: DateSeriesData) => void) => Promise>}} fetch - Fetch from skipped position to end * @property {{() => Promise}} fetchCsv - Fetch as CSV * @property {{DateThenable}} then - Thenable */ /** @template T @typedef {{Object}} RangeBuilder - * @property {{(onUpdate?: (value: MetricData) => void) => Promise>}} fetch - Fetch the range + * @property {{(onUpdate?: (value: SeriesData) => void) => Promise>}} fetch - Fetch the range * @property {{() => Promise}} fetchCsv - Fetch as CSV * @property {{Thenable}} then - Thenable */ /** @template T @typedef {{Object}} DateRangeBuilder - * @property {{(onUpdate?: (value: DateMetricData) => void) => Promise>}} fetch - Fetch the range + * @property {{(onUpdate?: (value: DateSeriesData) => void) => Promise>}} fetch - Fetch the range * @property {{() => Promise}} fetchCsv - Fetch as CSV * @property {{DateThenable}} then - Thenable */ /** * @template T - * @typedef {{Object}} MetricPattern - * @property {{string}} name - The metric name - * @property {{Readonly>>>}} by - Index endpoints as lazy getters + * @typedef {{Object}} SeriesPattern + * @property {{string}} name - The series name + * @property {{Readonly>>>}} by - Index endpoints as lazy getters * @property {{() => readonly Index[]}} indexes - Get the list of available indexes - * @property {{(index: Index) => MetricEndpointBuilder|undefined}} get - Get an endpoint for a specific index + * @property {{(index: Index) => SeriesEndpointBuilder|undefined}} get - Get an endpoint for a specific index */ -/** @typedef {{MetricPattern}} AnyMetricPattern */ +/** @typedef {{SeriesPattern}} AnySeriesPattern */ /** - * Create a metric endpoint builder with typestate pattern. + * Create a series endpoint builder with typestate pattern. * @template T * @param {{BrkClientBase}} client - * @param {{string}} name - The metric vec name + * @param {{string}} name - The series vec name * @param {{Index}} index - The index name - * @returns {{DateMetricEndpointBuilder}} + * @returns {{DateSeriesEndpointBuilder}} */ function _endpoint(client, name, index) {{ - const p = `/api/metric/${{name}}/${{index}}`; + const p = `/api/series/${{name}}/${{index}}`; /** * @param {{number}} [start] @@ -323,7 +323,7 @@ function _endpoint(client, name, index) {{ * @returns {{DateRangeBuilder}} */ const rangeBuilder = (start, end) => ({{ - fetch(onUpdate) {{ return client._fetchMetricData(buildPath(start, end), onUpdate); }}, + fetch(onUpdate) {{ return client._fetchSeriesData(buildPath(start, end), onUpdate); }}, fetchCsv() {{ return client.getText(buildPath(start, end, 'csv')); }}, then(resolve, reject) {{ return this.fetch().then(resolve, reject); }}, }}); @@ -333,7 +333,7 @@ function _endpoint(client, name, index) {{ * @returns {{DateSingleItemBuilder}} */ const singleItemBuilder = (idx) => ({{ - fetch(onUpdate) {{ return client._fetchMetricData(buildPath(idx, idx + 1), onUpdate); }}, + fetch(onUpdate) {{ return client._fetchSeriesData(buildPath(idx, idx + 1), onUpdate); }}, fetchCsv() {{ return client.getText(buildPath(idx, idx + 1, 'csv')); }}, then(resolve, reject) {{ return this.fetch().then(resolve, reject); }}, }}); @@ -344,12 +344,12 @@ function _endpoint(client, name, index) {{ */ const skippedBuilder = (start) => ({{ take(n) {{ return rangeBuilder(start, start + n); }}, - fetch(onUpdate) {{ return client._fetchMetricData(buildPath(start, undefined), onUpdate); }}, + fetch(onUpdate) {{ return client._fetchSeriesData(buildPath(start, undefined), onUpdate); }}, fetchCsv() {{ return client.getText(buildPath(start, undefined, 'csv')); }}, then(resolve, reject) {{ return this.fetch().then(resolve, reject); }}, }}); - /** @type {{DateMetricEndpointBuilder}} */ + /** @type {{DateSeriesEndpointBuilder}} */ const endpoint = {{ get(idx) {{ if (idx instanceof Date) idx = dateToIndex(index, idx); return singleItemBuilder(idx); }}, slice(start, end) {{ @@ -360,7 +360,7 @@ function _endpoint(client, name, index) {{ first(n) {{ return rangeBuilder(undefined, n); }}, last(n) {{ return n === 0 ? rangeBuilder(undefined, 0) : rangeBuilder(-n, undefined); }}, skip(n) {{ return skippedBuilder(n); }}, - fetch(onUpdate) {{ return client._fetchMetricData(buildPath(), onUpdate); }}, + fetch(onUpdate) {{ return client._fetchSeriesData(buildPath(), onUpdate); }}, fetchCsv() {{ return client.getText(buildPath(undefined, undefined, 'csv')); }}, then(resolve, reject) {{ return this.fetch().then(resolve, reject); }}, get path() {{ return p; }}, @@ -466,29 +466,29 @@ class BrkClientBase {{ }} /** - * Fetch metric data and wrap with helper methods (internal) + * Fetch series data and wrap with helper methods (internal) * @template T * @param {{string}} path - * @param {{(value: DateMetricData) => void}} [onUpdate] - * @returns {{Promise>}} + * @param {{(value: DateSeriesData) => void}} [onUpdate] + * @returns {{Promise>}} */ - async _fetchMetricData(path, onUpdate) {{ - const wrappedOnUpdate = onUpdate ? (/** @type {{MetricData}} */ raw) => onUpdate(_wrapMetricData(raw)) : undefined; + async _fetchSeriesData(path, onUpdate) {{ + const wrappedOnUpdate = onUpdate ? (/** @type {{SeriesData}} */ raw) => onUpdate(_wrapSeriesData(raw)) : undefined; const raw = await this.getJson(path, wrappedOnUpdate); - return _wrapMetricData(raw); + return _wrapSeriesData(raw); }} }} /** - * Build metric name with suffix. + * Build series name with suffix. * @param {{string}} acc - Accumulated prefix - * @param {{string}} s - Metric suffix + * @param {{string}} s - Series suffix * @returns {{string}} */ const _m = (acc, s) => s ? (acc ? `${{acc}}_${{s}}` : s) : acc; /** - * Build metric name with prefix. + * Build series name with prefix. * @param {{string}} prefix - Prefix to prepend * @param {{string}} acc - Accumulated name * @returns {{string}} @@ -591,14 +591,14 @@ pub fn generate_index_accessors(output: &mut String, patterns: &[IndexSetPattern } writeln!(output).unwrap(); - // Generate ONE generic metric pattern factory + // Generate ONE generic series pattern factory writeln!( output, r#"/** - * Generic metric pattern factory. + * Generic series pattern factory. * @template T * @param {{BrkClientBase}} client - * @param {{string}} name - The metric vec name + * @param {{string}} name - The series vec name * @param {{readonly Index[]}} indexes - The supported indexes */ function _mp(client, name, indexes) {{ @@ -615,7 +615,7 @@ function _mp(client, name, indexes) {{ by, /** @returns {{readonly Index[]}} */ indexes() {{ return indexes; }}, - /** @param {{Index}} index @returns {{MetricEndpointBuilder|undefined}} */ + /** @param {{Index}} index @returns {{SeriesEndpointBuilder|undefined}} */ get(index) {{ return indexes.includes(index) ? _endpoint(client, name, index) : undefined; }} }}; }} @@ -631,9 +631,9 @@ function _mp(client, name, indexes) {{ .iter() .map(|idx| { let builder = if idx.is_date_based() { - "DateMetricEndpointBuilder" + "DateSeriesEndpointBuilder" } else { - "MetricEndpointBuilder" + "SeriesEndpointBuilder" }; format!("readonly {}: {}", idx.name(), builder) }) @@ -642,7 +642,7 @@ function _mp(client, name, indexes) {{ writeln!( output, - "/** @template T @typedef {{{{ name: string, by: {}, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }}}} {} */", + "/** @template T @typedef {{{{ name: string, by: {}, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }}}} {} */", by_type, pattern.name ) .unwrap(); @@ -713,7 +713,7 @@ pub fn generate_structural_patterns( writeln!(output, " * @template T").unwrap(); } writeln!(output, " * @param {{BrkClientBase}} client").unwrap(); - writeln!(output, " * @param {{string}} acc - Accumulated metric name").unwrap(); + writeln!(output, " * @param {{string}} acc - Accumulated series name").unwrap(); if pattern.is_templated() { writeln!(output, " * @param {{string}} disc - Discriminator suffix").unwrap(); } diff --git a/crates/brk_bindgen/src/generators/javascript/tree.rs b/crates/brk_bindgen/src/generators/javascript/tree.rs index 1a3a23c6c..1a50dd582 100644 --- a/crates/brk_bindgen/src/generators/javascript/tree.rs +++ b/crates/brk_bindgen/src/generators/javascript/tree.rs @@ -13,7 +13,7 @@ use crate::{ use super::api::generate_api_methods; use super::client::generate_static_constants; -/// Generate JSDoc typedefs for the metrics tree. +/// Generate JSDoc typedefs for the series tree. pub fn generate_tree_typedefs(output: &mut String, catalog: &TreeNode, metadata: &ClientMetadata) { writeln!(output, "// Catalog tree typedefs\n").unwrap(); @@ -21,7 +21,7 @@ pub fn generate_tree_typedefs(output: &mut String, catalog: &TreeNode, metadata: let mut generated = BTreeSet::new(); generate_tree_typedef( output, - "MetricsTree", + "SeriesTree", "", catalog, pattern_lookup, @@ -93,7 +93,7 @@ pub fn generate_main_client( writeln!(output, "/**").unwrap(); writeln!( output, - " * Main BRK client with metrics tree and API methods" + " * Main BRK client with series tree and API methods" ) .unwrap(); writeln!(output, " * @extends BrkClientBase").unwrap(); @@ -107,14 +107,14 @@ pub fn generate_main_client( writeln!(output, " */").unwrap(); writeln!(output, " constructor(options) {{").unwrap(); writeln!(output, " super(options);").unwrap(); - writeln!(output, " /** @type {{MetricsTree}} */").unwrap(); - writeln!(output, " this.metrics = this._buildTree('');").unwrap(); + writeln!(output, " /** @type {{SeriesTree}} */").unwrap(); + writeln!(output, " this.series = this._buildTree('');").unwrap(); writeln!(output, " }}\n").unwrap(); writeln!(output, " /**").unwrap(); writeln!(output, " * @private").unwrap(); writeln!(output, " * @param {{string}} basePath").unwrap(); - writeln!(output, " * @returns {{MetricsTree}}").unwrap(); + writeln!(output, " * @returns {{SeriesTree}}").unwrap(); writeln!(output, " */").unwrap(); writeln!(output, " _buildTree(basePath) {{").unwrap(); writeln!(output, " return {{").unwrap(); @@ -122,7 +122,7 @@ pub fn generate_main_client( generate_tree_initializer( output, catalog, - "MetricsTree", + "SeriesTree", "", 3, pattern_lookup, @@ -135,27 +135,27 @@ pub fn generate_main_client( writeln!(output, " /**").unwrap(); writeln!( output, - " * Create a dynamic metric endpoint builder for any metric/index combination." + " * Create a dynamic series endpoint builder for any series/index combination." ) .unwrap(); writeln!(output, " *").unwrap(); writeln!( output, - " * Use this for programmatic access when the metric name is determined at runtime." + " * Use this for programmatic access when the series name is determined at runtime." ) .unwrap(); writeln!( output, - " * For type-safe access, use the `metrics` tree instead." + " * For type-safe access, use the `series` tree instead." ) .unwrap(); writeln!(output, " *").unwrap(); - writeln!(output, " * @param {{string}} metric - The metric name").unwrap(); + writeln!(output, " * @param {{string}} series - The series name").unwrap(); writeln!(output, " * @param {{Index}} index - The index name").unwrap(); - writeln!(output, " * @returns {{MetricEndpointBuilder}}").unwrap(); + writeln!(output, " * @returns {{SeriesEndpointBuilder}}").unwrap(); writeln!(output, " */").unwrap(); - writeln!(output, " metric(metric, index) {{").unwrap(); - writeln!(output, " return _endpoint(this, metric, index);").unwrap(); + writeln!(output, " seriesEndpoint(series, index) {{").unwrap(); + writeln!(output, " return _endpoint(this, series, index);").unwrap(); writeln!(output, " }}\n").unwrap(); generate_api_methods(output, endpoints); diff --git a/crates/brk_bindgen/src/generators/mod.rs b/crates/brk_bindgen/src/generators/mod.rs index abed3ccc7..608c25ed1 100644 --- a/crates/brk_bindgen/src/generators/mod.rs +++ b/crates/brk_bindgen/src/generators/mod.rs @@ -18,7 +18,7 @@ pub use python::generate_python_client; pub use rust::generate_rust_client; /// Types that are manually defined as generics in client code, not from schema. -pub const MANUAL_GENERIC_TYPES: &[&str] = &["MetricData", "MetricEndpoint"]; +pub const MANUAL_GENERIC_TYPES: &[&str] = &["SeriesData", "SeriesEndpoint"]; /// Write a multi-line description with the given prefix for each line. /// `empty_prefix` is used for blank lines (e.g., " *" without trailing space). diff --git a/crates/brk_bindgen/src/generators/python/api.rs b/crates/brk_bindgen/src/generators/python/api.rs index e848456f9..7ed8426b7 100644 --- a/crates/brk_bindgen/src/generators/python/api.rs +++ b/crates/brk_bindgen/src/generators/python/api.rs @@ -16,7 +16,7 @@ pub fn generate_main_client(output: &mut String, endpoints: &[Endpoint]) { writeln!(output, "class BrkClient(BrkClientBase):").unwrap(); writeln!( output, - " \"\"\"Main BRK client with metrics tree and API methods.\"\"\"" + " \"\"\"Main BRK client with series tree and API methods.\"\"\"" ) .unwrap(); writeln!(output).unwrap(); @@ -30,35 +30,35 @@ pub fn generate_main_client(output: &mut String, endpoints: &[Endpoint]) { ) .unwrap(); writeln!(output, " super().__init__(base_url, timeout)").unwrap(); - writeln!(output, " self.metrics = MetricsTree(self)").unwrap(); + writeln!(output, " self.series = SeriesTree(self)").unwrap(); writeln!(output).unwrap(); - // Generate metric() method for dynamic metric access + // Generate series_endpoint() method for dynamic series access writeln!( output, - " def metric(self, metric: str, index: Index) -> MetricEndpointBuilder[Any]:" + " def series_endpoint(self, series: str, index: Index) -> SeriesEndpointBuilder[Any]:" ) .unwrap(); writeln!( output, - " \"\"\"Create a dynamic metric endpoint builder for any metric/index combination." + " \"\"\"Create a dynamic series endpoint builder for any series/index combination." ) .unwrap(); writeln!(output).unwrap(); writeln!( output, - " Use this for programmatic access when the metric name is determined at runtime." + " Use this for programmatic access when the series name is determined at runtime." ) .unwrap(); writeln!( output, - " For type-safe access, use the `metrics` tree instead." + " For type-safe access, use the `series` tree instead." ) .unwrap(); writeln!(output, " \"\"\"").unwrap(); writeln!( output, - " return MetricEndpointBuilder(self, metric, index)" + " return SeriesEndpointBuilder(self, series, index)" ) .unwrap(); writeln!(output).unwrap(); diff --git a/crates/brk_bindgen/src/generators/python/client.rs b/crates/brk_bindgen/src/generators/python/client.rs index eb4add8bf..a5da7cebd 100644 --- a/crates/brk_bindgen/src/generators/python/client.rs +++ b/crates/brk_bindgen/src/generators/python/client.rs @@ -113,13 +113,13 @@ class BrkClientBase: def _m(acc: str, s: str) -> str: - """Build metric name with suffix.""" + """Build series name with suffix.""" if not s: return acc return f"{{acc}}_{{s}}" if acc else s def _p(prefix: str, acc: str) -> str: - """Build metric name with prefix.""" + """Build series name with prefix.""" return f"{{prefix}}_{{acc}}" if acc else prefix "# @@ -127,7 +127,7 @@ def _p(prefix: str, acc: str) -> str: .unwrap(); } -/// Generate the MetricData and MetricEndpointBuilder classes +/// Generate the SeriesData and SeriesEndpointBuilder classes pub fn generate_endpoint_class(output: &mut String) { writeln!( output, @@ -216,8 +216,8 @@ def _date_to_index(index: str, d: Union[date, datetime]) -> int: @dataclass -class MetricData(Generic[T]): - """Metric data with range information. Always int-indexed.""" +class SeriesData(Generic[T]): + """Series data with range information. Always int-indexed.""" version: int index: Index type: str @@ -229,7 +229,7 @@ class MetricData(Generic[T]): @property def is_date_based(self) -> bool: - """Whether this metric uses a date-based index.""" + """Whether this series uses a date-based index.""" return self.index in _DATE_INDEXES def indexes(self) -> List[int]: @@ -273,8 +273,8 @@ class MetricData(Generic[T]): @dataclass -class DateMetricData(MetricData[T]): - """Metric data with date-based index. Extends MetricData with date methods.""" +class DateSeriesData(SeriesData[T]): + """Series data with date-based index. Extends SeriesData with date methods.""" def dates(self) -> List[Union[date, datetime]]: """Get dates for the index range. Returns datetime for sub-daily indexes, date for daily+.""" @@ -320,8 +320,8 @@ class DateMetricData(MetricData[T]): # Type aliases for non-generic usage -AnyMetricData = MetricData[Any] -AnyDateMetricData = DateMetricData[Any] +AnySeriesData = SeriesData[Any] +AnyDateSeriesData = DateSeriesData[Any] class _EndpointConfig: @@ -341,7 +341,7 @@ class _EndpointConfig: self.end = end def path(self) -> str: - return f"/api/metric/{{self.name}}/{{self.index}}" + return f"/api/series/{{self.name}}/{{self.index}}" def _build_path(self, format: Optional[str] = None) -> str: params = [] @@ -358,11 +358,11 @@ class _EndpointConfig: def _new(self, start: Optional[int] = None, end: Optional[int] = None) -> _EndpointConfig: return _EndpointConfig(self.client, self.name, self.index, start, end) - def get_metric(self) -> MetricData[Any]: - return MetricData(**self.client.get_json(self._build_path())) + def get_series(self) -> SeriesData[Any]: + return SeriesData(**self.client.get_json(self._build_path())) - def get_date_metric(self) -> DateMetricData[Any]: - return DateMetricData(**self.client.get_json(self._build_path())) + def get_date_series(self) -> DateSeriesData[Any]: + return DateSeriesData(**self.client.get_json(self._build_path())) def get_csv(self) -> str: return self.client.get_text(self._build_path(format='csv')) @@ -374,9 +374,9 @@ class RangeBuilder(Generic[T]): def __init__(self, config: _EndpointConfig): self._config = config - def fetch(self) -> MetricData[T]: + def fetch(self) -> SeriesData[T]: """Fetch the range as parsed JSON.""" - return self._config.get_metric() + return self._config.get_series() def fetch_csv(self) -> str: """Fetch the range as CSV string.""" @@ -389,9 +389,9 @@ class SingleItemBuilder(Generic[T]): def __init__(self, config: _EndpointConfig): self._config = config - def fetch(self) -> MetricData[T]: + def fetch(self) -> SeriesData[T]: """Fetch the single item.""" - return self._config.get_metric() + return self._config.get_series() def fetch_csv(self) -> str: """Fetch as CSV.""" @@ -409,9 +409,9 @@ class SkippedBuilder(Generic[T]): start = self._config.start or 0 return RangeBuilder(self._config._new(start, start + n)) - def fetch(self) -> MetricData[T]: + def fetch(self) -> SeriesData[T]: """Fetch from skipped position to end.""" - return self._config.get_metric() + return self._config.get_series() def fetch_csv(self) -> str: """Fetch as CSV.""" @@ -419,28 +419,28 @@ class SkippedBuilder(Generic[T]): class DateRangeBuilder(RangeBuilder[T]): - """Range builder that returns DateMetricData.""" - def fetch(self) -> DateMetricData[T]: - return self._config.get_date_metric() + """Range builder that returns DateSeriesData.""" + def fetch(self) -> DateSeriesData[T]: + return self._config.get_date_series() class DateSingleItemBuilder(SingleItemBuilder[T]): - """Single item builder that returns DateMetricData.""" - def fetch(self) -> DateMetricData[T]: - return self._config.get_date_metric() + """Single item builder that returns DateSeriesData.""" + def fetch(self) -> DateSeriesData[T]: + return self._config.get_date_series() class DateSkippedBuilder(SkippedBuilder[T]): - """Skipped builder that returns DateMetricData.""" + """Skipped builder that returns DateSeriesData.""" def take(self, n: int) -> DateRangeBuilder[T]: start = self._config.start or 0 return DateRangeBuilder(self._config._new(start, start + n)) - def fetch(self) -> DateMetricData[T]: - return self._config.get_date_metric() + def fetch(self) -> DateSeriesData[T]: + return self._config.get_date_series() -class MetricEndpointBuilder(Generic[T]): - """Builder for metric endpoint queries with int-based indexing. +class SeriesEndpointBuilder(Generic[T]): + """Builder for series endpoint queries with int-based indexing. Examples: data = endpoint.fetch() @@ -476,9 +476,9 @@ class MetricEndpointBuilder(Generic[T]): """Skip the first n items.""" return SkippedBuilder(self._config._new(start=n)) - def fetch(self) -> MetricData[T]: + def fetch(self) -> SeriesData[T]: """Fetch all data.""" - return self._config.get_metric() + return self._config.get_series() def fetch_csv(self) -> str: """Fetch all data as CSV.""" @@ -489,10 +489,10 @@ class MetricEndpointBuilder(Generic[T]): return self._config.path() -class DateMetricEndpointBuilder(Generic[T]): - """Builder for metric endpoint queries with date-based indexing. +class DateSeriesEndpointBuilder(Generic[T]): + """Builder for series endpoint queries with date-based indexing. - Accepts dates in __getitem__ and returns DateMetricData from fetch(). + Accepts dates in __getitem__ and returns DateSeriesData from fetch(). Examples: data = endpoint.fetch() @@ -539,9 +539,9 @@ class DateMetricEndpointBuilder(Generic[T]): """Skip the first n items.""" return DateSkippedBuilder(self._config._new(start=n)) - def fetch(self) -> DateMetricData[T]: + def fetch(self) -> DateSeriesData[T]: """Fetch all data.""" - return self._config.get_date_metric() + return self._config.get_date_series() def fetch_csv(self) -> str: """Fetch all data as CSV.""" @@ -553,23 +553,23 @@ class DateMetricEndpointBuilder(Generic[T]): # Type aliases for non-generic usage -AnyMetricEndpointBuilder = MetricEndpointBuilder[Any] -AnyDateMetricEndpointBuilder = DateMetricEndpointBuilder[Any] +AnySeriesEndpointBuilder = SeriesEndpointBuilder[Any] +AnyDateSeriesEndpointBuilder = DateSeriesEndpointBuilder[Any] -class MetricPattern(Protocol[T]): - """Protocol for metric patterns with different index sets.""" +class SeriesPattern(Protocol[T]): + """Protocol for series patterns with different index sets.""" @property def name(self) -> str: - """Get the metric name.""" + """Get the series name.""" ... def indexes(self) -> List[str]: - """Get the list of available indexes for this metric.""" + """Get the list of available indexes for this series.""" ... - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: """Get an endpoint builder for a specific index, if supported.""" ... @@ -605,11 +605,11 @@ pub fn generate_index_accessors(output: &mut String, patterns: &[IndexSetPattern // Generate helper functions writeln!( output, - r#"def _ep(c: BrkClientBase, n: str, i: Index) -> MetricEndpointBuilder[Any]: - return MetricEndpointBuilder(c, n, i) + r#"def _ep(c: BrkClientBase, n: str, i: Index) -> SeriesEndpointBuilder[Any]: + return SeriesEndpointBuilder(c, n, i) -def _dep(c: BrkClientBase, n: str, i: Index) -> DateMetricEndpointBuilder[Any]: - return DateMetricEndpointBuilder(c, n, i) +def _dep(c: BrkClientBase, n: str, i: Index) -> DateSeriesEndpointBuilder[Any]: + return DateSeriesEndpointBuilder(c, n, i) "# ) .unwrap(); @@ -631,9 +631,9 @@ def _dep(c: BrkClientBase, n: str, i: Index) -> DateMetricEndpointBuilder[Any]: let method_name = index_to_field_name(index); let index_name = index.name(); let (builder_type, helper) = if index.is_date_based() { - ("DateMetricEndpointBuilder", "_dep") + ("DateSeriesEndpointBuilder", "_dep") } else { - ("MetricEndpointBuilder", "_ep") + ("SeriesEndpointBuilder", "_ep") }; writeln!( output, @@ -663,7 +663,7 @@ def _dep(c: BrkClientBase, n: str, i: Index) -> DateMetricEndpointBuilder[Any]: .unwrap(); writeln!( output, - " def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in {} else None", + " def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in {} else None", idx_var ) .unwrap(); @@ -719,7 +719,7 @@ pub fn generate_structural_patterns( } writeln!( output, - " \"\"\"Create pattern node with accumulated metric name.\"\"\"" + " \"\"\"Create pattern node with accumulated series name.\"\"\"" ) .unwrap(); diff --git a/crates/brk_bindgen/src/generators/python/tree.rs b/crates/brk_bindgen/src/generators/python/tree.rs index b10620642..80fd04f0b 100644 --- a/crates/brk_bindgen/src/generators/python/tree.rs +++ b/crates/brk_bindgen/src/generators/python/tree.rs @@ -12,13 +12,13 @@ use crate::{ /// Generate tree classes pub fn generate_tree_classes(output: &mut String, catalog: &TreeNode, metadata: &ClientMetadata) { - writeln!(output, "# Metrics tree classes\n").unwrap(); + writeln!(output, "# Series tree classes\n").unwrap(); let pattern_lookup = metadata.pattern_lookup(); let mut generated = BTreeSet::new(); generate_tree_class( output, - "MetricsTree", + "SeriesTree", "", catalog, pattern_lookup, @@ -60,7 +60,7 @@ fn generate_tree_class( // THEN generate the current class (after all children are defined) writeln!(output, "class {}:", name).unwrap(); - writeln!(output, " \"\"\"Metrics tree node.\"\"\"").unwrap(); + writeln!(output, " \"\"\"Series tree node.\"\"\"").unwrap(); writeln!(output, " ").unwrap(); writeln!( output, diff --git a/crates/brk_bindgen/src/generators/rust/api.rs b/crates/brk_bindgen/src/generators/rust/api.rs index 5d7e7520e..fb8a6b5fb 100644 --- a/crates/brk_bindgen/src/generators/rust/api.rs +++ b/crates/brk_bindgen/src/generators/rust/api.rs @@ -10,10 +10,10 @@ use super::types::js_type_to_rust; pub fn generate_main_client(output: &mut String, endpoints: &[Endpoint]) { writeln!( output, - r#"/// Main BRK client with metrics tree and API methods. + r#"/// Main BRK client with series tree and API methods. pub struct BrkClient {{ base: Arc, - metrics: MetricsTree, + series: SeriesTree, }} impl BrkClient {{ @@ -23,51 +23,51 @@ impl BrkClient {{ /// Create a new client with the given base URL. pub fn new(base_url: impl Into) -> Self {{ let base = Arc::new(BrkClientBase::new(base_url)); - let metrics = MetricsTree::new(base.clone(), String::new()); - Self {{ base, metrics }} + let series = SeriesTree::new(base.clone(), String::new()); + Self {{ base, series }} }} /// Create a new client with options. pub fn with_options(options: BrkClientOptions) -> Self {{ let base = Arc::new(BrkClientBase::with_options(options)); - let metrics = MetricsTree::new(base.clone(), String::new()); - Self {{ base, metrics }} + let series = SeriesTree::new(base.clone(), String::new()); + Self {{ base, series }} }} - /// Get the metrics tree for navigating metrics. - pub fn metrics(&self) -> &MetricsTree {{ - &self.metrics + /// Get the series tree for navigating series. + pub fn series(&self) -> &SeriesTree {{ + &self.series }} - /// Create a dynamic metric endpoint builder for any metric/index combination. + /// Create a dynamic series endpoint builder for any series/index combination. /// - /// Use this for programmatic access when the metric name is determined at runtime. - /// For type-safe access, use the `metrics()` tree instead. + /// Use this for programmatic access when the series name is determined at runtime. + /// For type-safe access, use the `series()` tree instead. /// /// # Example /// ```ignore - /// let data = client.metric("realized_price", Index::Height) + /// let data = client.series("realized_price", Index::Height) /// .last(10) /// .json::()?; /// ``` - pub fn metric(&self, metric: impl Into, index: Index) -> MetricEndpointBuilder {{ - MetricEndpointBuilder::new( + pub fn series_endpoint(&self, series: impl Into, index: Index) -> SeriesEndpointBuilder {{ + SeriesEndpointBuilder::new( self.base.clone(), - Arc::from(metric.into().as_str()), + Arc::from(series.into().as_str()), index, ) }} - /// Create a dynamic date-based metric endpoint builder. + /// Create a dynamic date-based series endpoint builder. /// /// Returns `Err` if the index is not date-based. - pub fn date_metric(&self, metric: impl Into, index: Index) -> Result> {{ + pub fn date_series_endpoint(&self, series: impl Into, index: Index) -> Result> {{ if !index.is_date_based() {{ return Err(BrkError {{ message: format!("{{}} is not a date-based index", index.name()) }}); }} - Ok(DateMetricEndpointBuilder::new( + Ok(DateSeriesEndpointBuilder::new( self.base.clone(), - Arc::from(metric.into().as_str()), + Arc::from(series.into().as_str()), index, )) }} @@ -217,7 +217,7 @@ fn param_type_to_rust(param_type: &str) -> String { "string" | "*" => "&str".to_string(), "integer" | "number" => "i64".to_string(), "boolean" => "bool".to_string(), - other => other.to_string(), // Domain types like Index, Metric, Format + other => other.to_string(), // Domain types like Index, Series, Format } } diff --git a/crates/brk_bindgen/src/generators/rust/client.rs b/crates/brk_bindgen/src/generators/rust/client.rs index b3a7f2396..6c2ab0122 100644 --- a/crates/brk_bindgen/src/generators/rust/client.rs +++ b/crates/brk_bindgen/src/generators/rust/client.rs @@ -105,7 +105,7 @@ impl BrkClientBase {{ }} }} -/// Build metric name with suffix. +/// Build series name with suffix. #[inline] fn _m(acc: &str, s: &str) -> String {{ if s.is_empty() {{ acc.to_string() }} @@ -113,7 +113,7 @@ fn _m(acc: &str, s: &str) -> String {{ else {{ format!("{{acc}}_{{s}}") }} }} -/// Build metric name with prefix. +/// Build series name with prefix. #[inline] fn _p(prefix: &str, acc: &str) -> String {{ if acc.is_empty() {{ prefix.to_string() }} else {{ format!("{{prefix}}_{{acc}}") }} @@ -124,23 +124,23 @@ fn _p(prefix: &str, acc: &str) -> String {{ .unwrap(); } -/// Generate the MetricPattern trait. -pub fn generate_metric_pattern_trait(output: &mut String) { +/// Generate the SeriesPattern trait. +pub fn generate_series_pattern_trait(output: &mut String) { writeln!( output, - r#"/// Non-generic trait for metric patterns (usable in collections). -pub trait AnyMetricPattern {{ - /// Get the metric name. + r#"/// Non-generic trait for series patterns (usable in collections). +pub trait AnySeriesPattern {{ + /// Get the series name. fn name(&self) -> &str; - /// Get the list of available indexes for this metric. + /// Get the list of available indexes for this series. fn indexes(&self) -> &'static [Index]; }} -/// Generic trait for metric patterns with endpoint access. -pub trait MetricPattern: AnyMetricPattern {{ +/// Generic trait for series patterns with endpoint access. +pub trait SeriesPattern: AnySeriesPattern {{ /// Get an endpoint builder for a specific index, if supported. - fn get(&self, index: Index) -> Option>; + fn get(&self, index: Index) -> Option>; }} "# @@ -148,7 +148,7 @@ pub trait MetricPattern: AnyMetricPattern {{ .unwrap(); } -/// Generate the MetricEndpointBuilder structs with typestate pattern. +/// Generate the SeriesEndpointBuilder structs with typestate pattern. pub fn generate_endpoint(output: &mut String) { writeln!( output, @@ -168,7 +168,7 @@ impl EndpointConfig {{ }} fn path(&self) -> String {{ - format!("/api/metric/{{}}/{{}}", self.name, self.index.name()) + format!("/api/series/{{}}/{{}}", self.name, self.index.name()) }} fn build_path(&self, format: Option<&str>) -> String {{ @@ -189,10 +189,10 @@ impl EndpointConfig {{ }} }} -/// Builder for metric endpoint queries. +/// Builder for series endpoint queries. /// -/// Parameterized by element type `T` and response type `D` (defaults to `MetricData`). -/// For date-based indexes, use `DateMetricEndpointBuilder` which sets `D = DateMetricData`. +/// Parameterized by element type `T` and response type `D` (defaults to `SeriesData`). +/// For date-based indexes, use `DateSeriesEndpointBuilder` which sets `D = DateSeriesData`. /// /// # Examples /// ```ignore @@ -204,18 +204,18 @@ impl EndpointConfig {{ /// let data = endpoint.last(10).fetch()?; // last 10 /// let data = endpoint.skip(100).take(10).fetch()?; // iterator-style /// ``` -pub struct MetricEndpointBuilder> {{ +pub struct SeriesEndpointBuilder> {{ config: EndpointConfig, _marker: std::marker::PhantomData (T, D)>, }} -/// Builder for date-based metric endpoint queries. +/// Builder for date-based series endpoint queries. /// -/// Like `MetricEndpointBuilder` but returns `DateMetricData` and provides +/// Like `SeriesEndpointBuilder` but returns `DateSeriesData` and provides /// date-based access methods (`get_date`, `date_range`). -pub type DateMetricEndpointBuilder = MetricEndpointBuilder>; +pub type DateSeriesEndpointBuilder = SeriesEndpointBuilder>; -impl MetricEndpointBuilder {{ +impl SeriesEndpointBuilder {{ pub fn new(client: Arc, name: Arc, index: Index) -> Self {{ Self {{ config: EndpointConfig::new(client, name, index), _marker: std::marker::PhantomData }} }} @@ -286,29 +286,29 @@ impl MetricEndpointBuilder {{ }} }} -/// Date-specific methods available only on `DateMetricEndpointBuilder`. -impl MetricEndpointBuilder> {{ +/// Date-specific methods available only on `DateSeriesEndpointBuilder`. +impl SeriesEndpointBuilder> {{ /// Select a specific date position (for day-precision or coarser indexes). - pub fn get_date(self, date: Date) -> SingleItemBuilder> {{ + pub fn get_date(self, date: Date) -> SingleItemBuilder> {{ let index = self.config.index.date_to_index(date).unwrap_or(0); self.get(index) }} /// Select a date range (for day-precision or coarser indexes). - pub fn date_range(self, start: Date, end: Date) -> RangeBuilder> {{ + pub fn date_range(self, start: Date, end: Date) -> RangeBuilder> {{ let s = self.config.index.date_to_index(start).unwrap_or(0); let e = self.config.index.date_to_index(end).unwrap_or(0); self.range(s..e) }} /// Select a specific timestamp position (works for all date-based indexes including sub-daily). - pub fn get_timestamp(self, ts: Timestamp) -> SingleItemBuilder> {{ + pub fn get_timestamp(self, ts: Timestamp) -> SingleItemBuilder> {{ let index = self.config.index.timestamp_to_index(ts).unwrap_or(0); self.get(index) }} /// Select a timestamp range (works for all date-based indexes including sub-daily). - pub fn timestamp_range(self, start: Timestamp, end: Timestamp) -> RangeBuilder> {{ + pub fn timestamp_range(self, start: Timestamp, end: Timestamp) -> RangeBuilder> {{ let s = self.config.index.timestamp_to_index(start).unwrap_or(0); let e = self.config.index.timestamp_to_index(end).unwrap_or(0); self.range(s..e) @@ -316,13 +316,13 @@ impl MetricEndpointBuilder> {{ }} /// Builder for single item access. -pub struct SingleItemBuilder> {{ +pub struct SingleItemBuilder> {{ config: EndpointConfig, _marker: std::marker::PhantomData (T, D)>, }} /// Date-aware single item builder. -pub type DateSingleItemBuilder = SingleItemBuilder>; +pub type DateSingleItemBuilder = SingleItemBuilder>; impl SingleItemBuilder {{ /// Fetch the single item. @@ -337,13 +337,13 @@ impl SingleItemBuilder {{ }} /// Builder after calling `skip(n)`. Chain with `take(n)` to specify count. -pub struct SkippedBuilder> {{ +pub struct SkippedBuilder> {{ config: EndpointConfig, _marker: std::marker::PhantomData (T, D)>, }} /// Date-aware skipped builder. -pub type DateSkippedBuilder = SkippedBuilder>; +pub type DateSkippedBuilder = SkippedBuilder>; impl SkippedBuilder {{ /// Take n items after the skipped position. @@ -365,13 +365,13 @@ impl SkippedBuilder {{ }} /// Builder with range fully specified. -pub struct RangeBuilder> {{ +pub struct RangeBuilder> {{ config: EndpointConfig, _marker: std::marker::PhantomData (T, D)>, }} /// Date-aware range builder. -pub type DateRangeBuilder = RangeBuilder>; +pub type DateRangeBuilder = RangeBuilder>; impl RangeBuilder {{ /// Fetch the range as parsed JSON. @@ -414,13 +414,13 @@ pub fn generate_index_accessors(output: &mut String, patterns: &[IndexSetPattern writeln!( output, r#"#[inline] -fn _ep(c: &Arc, n: &Arc, i: Index) -> MetricEndpointBuilder {{ - MetricEndpointBuilder::new(c.clone(), n.clone(), i) +fn _ep(c: &Arc, n: &Arc, i: Index) -> SeriesEndpointBuilder {{ + SeriesEndpointBuilder::new(c.clone(), n.clone(), i) }} #[inline] -fn _dep(c: &Arc, n: &Arc, i: Index) -> DateMetricEndpointBuilder {{ - DateMetricEndpointBuilder::new(c.clone(), n.clone(), i) +fn _dep(c: &Arc, n: &Arc, i: Index) -> DateSeriesEndpointBuilder {{ + DateSeriesEndpointBuilder::new(c.clone(), n.clone(), i) }} "# ) @@ -441,14 +441,14 @@ fn _dep(c: &Arc, n: &Arc, i: Index) -> if index.is_date_based() { writeln!( output, - " pub fn {}(&self) -> DateMetricEndpointBuilder {{ _dep(&self.client, &self.name, Index::{}) }}", + " pub fn {}(&self) -> DateSeriesEndpointBuilder {{ _dep(&self.client, &self.name, Index::{}) }}", method_name, index ) .unwrap(); } else { writeln!( output, - " pub fn {}(&self) -> MetricEndpointBuilder {{ _ep(&self.client, &self.name, Index::{}) }}", + " pub fn {}(&self) -> SeriesEndpointBuilder {{ _ep(&self.client, &self.name, Index::{}) }}", method_name, index ) .unwrap(); @@ -473,18 +473,18 @@ fn _dep(c: &Arc, n: &Arc, i: Index) -> writeln!(output, " pub fn name(&self) -> &str {{ &self.name }}").unwrap(); writeln!(output, "}}\n").unwrap(); - // Implement AnyMetricPattern trait + // Implement AnySeriesPattern trait writeln!( output, - "impl AnyMetricPattern for {} {{ fn name(&self) -> &str {{ &self.name }} fn indexes(&self) -> &'static [Index] {{ {} }} }}", + "impl AnySeriesPattern for {} {{ fn name(&self) -> &str {{ &self.name }} fn indexes(&self) -> &'static [Index] {{ {} }} }}", pattern.name, idx_const ) .unwrap(); - // Implement MetricPattern trait + // Implement SeriesPattern trait writeln!( output, - "impl MetricPattern for {} {{ fn get(&self, index: Index) -> Option> {{ {}.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) }} }}\n", + "impl SeriesPattern for {} {{ fn get(&self, index: Index) -> Option> {{ {}.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) }} }}\n", pattern.name, idx_const ) .unwrap(); @@ -542,7 +542,7 @@ pub fn generate_pattern_structs( writeln!( output, - " /// Create a new pattern node with accumulated metric name." + " /// Create a new pattern node with accumulated series name." ) .unwrap(); if pattern.is_templated() { diff --git a/crates/brk_bindgen/src/generators/rust/mod.rs b/crates/brk_bindgen/src/generators/rust/mod.rs index 174108018..d71ca5287 100644 --- a/crates/brk_bindgen/src/generators/rust/mod.rs +++ b/crates/brk_bindgen/src/generators/rust/mod.rs @@ -32,7 +32,7 @@ pub fn generate_rust_client( client::generate_imports(&mut output); client::generate_base_client(&mut output); - client::generate_metric_pattern_trait(&mut output); + client::generate_series_pattern_trait(&mut output); client::generate_endpoint(&mut output); client::generate_index_accessors(&mut output, &metadata.index_set_patterns); client::generate_pattern_structs(&mut output, &metadata.structural_patterns, metadata); diff --git a/crates/brk_bindgen/src/generators/rust/tree.rs b/crates/brk_bindgen/src/generators/rust/tree.rs index 61637f22a..211f03c3a 100644 --- a/crates/brk_bindgen/src/generators/rust/tree.rs +++ b/crates/brk_bindgen/src/generators/rust/tree.rs @@ -13,13 +13,13 @@ use crate::{ /// Generate tree structs. pub fn generate_tree(output: &mut String, catalog: &TreeNode, metadata: &ClientMetadata) { - writeln!(output, "// Metrics tree\n").unwrap(); + writeln!(output, "// Series tree\n").unwrap(); let pattern_lookup = metadata.pattern_lookup(); let mut generated = BTreeSet::new(); generate_tree_node( output, - "MetricsTree", + "SeriesTree", "", catalog, pattern_lookup, @@ -42,7 +42,7 @@ fn generate_tree_node( }; // Generate struct definition - writeln!(output, "/// Metrics tree node.").unwrap(); + writeln!(output, "/// Series tree node.").unwrap(); writeln!(output, "pub struct {} {{", name).unwrap(); for child in &ctx.children { diff --git a/crates/brk_bindgen/src/openapi.rs b/crates/brk_bindgen/src/openapi.rs index 4c81073ec..f3bcb7b22 100644 --- a/crates/brk_bindgen/src/openapi.rs +++ b/crates/brk_bindgen/src/openapi.rs @@ -218,7 +218,7 @@ fn check_csv_support(operation: &Operation) -> bool { /// Extract path parameters in the order they appear in the path URL. fn extract_path_parameters(path: &str, operation: &Operation) -> Vec { - // Extract parameter names from the path in order (e.g., "/api/metric/{metric}/{index}" -> ["metric", "index"]) + // Extract parameter names from the path in order (e.g., "/api/series/{series}/{index}" -> ["series", "index"]) let path_order: Vec<&str> = path .split('/') .filter_map(|segment| segment.strip_prefix('{').and_then(|s| s.strip_suffix('}'))) diff --git a/crates/brk_bindgen/src/types/metadata.rs b/crates/brk_bindgen/src/types/metadata.rs index 7284b00ce..2c62db0d9 100644 --- a/crates/brk_bindgen/src/types/metadata.rs +++ b/crates/brk_bindgen/src/types/metadata.rs @@ -3,7 +3,7 @@ use std::collections::{BTreeMap, BTreeSet}; use brk_query::Vecs; -use brk_types::{Index, MetricLeafWithSchema}; +use brk_types::{Index, SeriesLeafWithSchema}; use super::{GenericSyntax, IndexSetPattern, PatternField, StructuralPattern, extract_inner_type}; use crate::{PatternBaseResult, analysis}; @@ -15,7 +15,7 @@ pub struct ClientMetadata { pub catalog: brk_types::TreeNode, /// Structural patterns - tree node shapes that repeat pub structural_patterns: Vec, - /// Index set patterns - sets of indexes that appear together on metrics + /// Index set patterns - sets of indexes that appear together on series pub index_set_patterns: Vec, /// Maps field signatures to pattern names (merged from concrete instances + pattern definitions) pattern_lookup: BTreeMap, String>, @@ -135,24 +135,24 @@ impl ClientMetadata { if let Some(accessor) = self.find_index_set_pattern(&field.indexes) { syntax.wrap(&accessor.name, &value_type) } else { - syntax.wrap("MetricNode", &value_type) + syntax.wrap("SeriesNode", &value_type) } } /// Generate type annotation for a leaf node with language-specific syntax. /// /// This is a simpler version of `field_type_annotation` that works directly - /// with a `MetricLeafWithSchema` node instead of a `PatternField`. + /// with a `SeriesLeafWithSchema` node instead of a `PatternField`. pub fn field_type_annotation_from_leaf( &self, - leaf: &MetricLeafWithSchema, + leaf: &SeriesLeafWithSchema, syntax: GenericSyntax, ) -> String { let value_type = leaf.kind().to_string(); if let Some(accessor) = self.find_index_set_pattern(leaf.indexes()) { syntax.wrap(&accessor.name, &value_type) } else { - syntax.wrap("MetricNode", &value_type) + syntax.wrap("SeriesNode", &value_type) } } } diff --git a/crates/brk_bindgen/src/types/positions.rs b/crates/brk_bindgen/src/types/positions.rs index 6d3bf2114..a758b1ad8 100644 --- a/crates/brk_bindgen/src/types/positions.rs +++ b/crates/brk_bindgen/src/types/positions.rs @@ -1,4 +1,4 @@ -//! Pattern mode and field parts for metric name reconstruction. +//! Pattern mode and field parts for series name reconstruction. //! //! Patterns are either suffix mode or prefix mode: //! - Suffix mode: `_m(acc, relative)` → `acc_relative` or just `relative` if acc empty @@ -6,14 +6,14 @@ use std::collections::BTreeMap; -/// How a pattern constructs metric names from the accumulator. +/// How a pattern constructs series names from the accumulator. #[derive(Debug, Clone, PartialEq, Eq)] pub enum PatternMode { /// Fields append their relative name to acc. /// Formula: `_m(acc, relative)` → `{acc}_{relative}` or `{relative}` if acc empty /// Example: `_m("lth", "max_cost_basis")` → `"lth_max_cost_basis"` Suffix { - /// Maps field name to its relative name (full metric name when acc = "") + /// Maps field name to its relative name (full series name when acc = "") relatives: BTreeMap, }, /// Fields prepend their prefix to acc. @@ -23,7 +23,7 @@ pub enum PatternMode { /// Maps field name to its prefix (empty string for identity) prefixes: BTreeMap, }, - /// Fields construct metric names using a template with a discriminator placeholder. + /// Fields construct series names using a template with a discriminator placeholder. /// Factory takes two params: `acc` (base) and `disc` (discriminator). /// Formula: `_m(acc, template.replace("{disc}", disc))` /// Example: template `"ratio_{disc}_bps"` with disc `"pct99"` → `_m(acc, "ratio_pct99_bps")` diff --git a/crates/brk_bindgen/src/types/structs.rs b/crates/brk_bindgen/src/types/structs.rs index 0cb7933c8..5bcbade14 100644 --- a/crates/brk_bindgen/src/types/structs.rs +++ b/crates/brk_bindgen/src/types/structs.rs @@ -6,7 +6,7 @@ use brk_types::Index; use super::PatternMode; -/// A pattern of indexes that appear together on multiple metrics. +/// A pattern of indexes that appear together on multiple series. #[derive(Debug, Clone)] pub struct IndexSetPattern { /// Pattern name (e.g., "DateHeightIndexes") @@ -22,7 +22,7 @@ pub struct StructuralPattern { pub name: String, /// Ordered list of child fields pub fields: Vec, - /// How fields construct metric names from acc (None = not parameterizable) + /// How fields construct series names from acc (None = not parameterizable) pub mode: Option, /// If true, all leaf fields use a type parameter T pub is_generic: bool, diff --git a/crates/brk_client/src/lib.rs b/crates/brk_client/src/lib.rs index e972848a4..390f9935e 100644 --- a/crates/brk_client/src/lib.rs +++ b/crates/brk_client/src/lib.rs @@ -93,7 +93,7 @@ impl BrkClientBase { } } -/// Build metric name with suffix. +/// Build series name with suffix. #[inline] fn _m(acc: &str, s: &str) -> String { if s.is_empty() { acc.to_string() } @@ -101,26 +101,26 @@ fn _m(acc: &str, s: &str) -> String { else { format!("{acc}_{s}") } } -/// Build metric name with prefix. +/// Build series name with prefix. #[inline] fn _p(prefix: &str, acc: &str) -> String { if acc.is_empty() { prefix.to_string() } else { format!("{prefix}_{acc}") } } -/// Non-generic trait for metric patterns (usable in collections). -pub trait AnyMetricPattern { - /// Get the metric name. +/// Non-generic trait for series patterns (usable in collections). +pub trait AnySeriesPattern { + /// Get the series name. fn name(&self) -> &str; - /// Get the list of available indexes for this metric. + /// Get the list of available indexes for this series. fn indexes(&self) -> &'static [Index]; } -/// Generic trait for metric patterns with endpoint access. -pub trait MetricPattern: AnyMetricPattern { +/// Generic trait for series patterns with endpoint access. +pub trait SeriesPattern: AnySeriesPattern { /// Get an endpoint builder for a specific index, if supported. - fn get(&self, index: Index) -> Option>; + fn get(&self, index: Index) -> Option>; } @@ -140,7 +140,7 @@ impl EndpointConfig { } fn path(&self) -> String { - format!("/api/metric/{}/{}", self.name, self.index.name()) + format!("/api/series/{}/{}", self.name, self.index.name()) } fn build_path(&self, format: Option<&str>) -> String { @@ -161,10 +161,10 @@ impl EndpointConfig { } } -/// Builder for metric endpoint queries. +/// Builder for series endpoint queries. /// -/// Parameterized by element type `T` and response type `D` (defaults to `MetricData`). -/// For date-based indexes, use `DateMetricEndpointBuilder` which sets `D = DateMetricData`. +/// Parameterized by element type `T` and response type `D` (defaults to `SeriesData`). +/// For date-based indexes, use `DateSeriesEndpointBuilder` which sets `D = DateSeriesData`. /// /// # Examples /// ```ignore @@ -176,18 +176,18 @@ impl EndpointConfig { /// let data = endpoint.last(10).fetch()?; // last 10 /// let data = endpoint.skip(100).take(10).fetch()?; // iterator-style /// ``` -pub struct MetricEndpointBuilder> { +pub struct SeriesEndpointBuilder> { config: EndpointConfig, _marker: std::marker::PhantomData (T, D)>, } -/// Builder for date-based metric endpoint queries. +/// Builder for date-based series endpoint queries. /// -/// Like `MetricEndpointBuilder` but returns `DateMetricData` and provides +/// Like `SeriesEndpointBuilder` but returns `DateSeriesData` and provides /// date-based access methods (`get_date`, `date_range`). -pub type DateMetricEndpointBuilder = MetricEndpointBuilder>; +pub type DateSeriesEndpointBuilder = SeriesEndpointBuilder>; -impl MetricEndpointBuilder { +impl SeriesEndpointBuilder { pub fn new(client: Arc, name: Arc, index: Index) -> Self { Self { config: EndpointConfig::new(client, name, index), _marker: std::marker::PhantomData } } @@ -258,29 +258,29 @@ impl MetricEndpointBuilder { } } -/// Date-specific methods available only on `DateMetricEndpointBuilder`. -impl MetricEndpointBuilder> { +/// Date-specific methods available only on `DateSeriesEndpointBuilder`. +impl SeriesEndpointBuilder> { /// Select a specific date position (for day-precision or coarser indexes). - pub fn get_date(self, date: Date) -> SingleItemBuilder> { + pub fn get_date(self, date: Date) -> SingleItemBuilder> { let index = self.config.index.date_to_index(date).unwrap_or(0); self.get(index) } /// Select a date range (for day-precision or coarser indexes). - pub fn date_range(self, start: Date, end: Date) -> RangeBuilder> { + pub fn date_range(self, start: Date, end: Date) -> RangeBuilder> { let s = self.config.index.date_to_index(start).unwrap_or(0); let e = self.config.index.date_to_index(end).unwrap_or(0); self.range(s..e) } /// Select a specific timestamp position (works for all date-based indexes including sub-daily). - pub fn get_timestamp(self, ts: Timestamp) -> SingleItemBuilder> { + pub fn get_timestamp(self, ts: Timestamp) -> SingleItemBuilder> { let index = self.config.index.timestamp_to_index(ts).unwrap_or(0); self.get(index) } /// Select a timestamp range (works for all date-based indexes including sub-daily). - pub fn timestamp_range(self, start: Timestamp, end: Timestamp) -> RangeBuilder> { + pub fn timestamp_range(self, start: Timestamp, end: Timestamp) -> RangeBuilder> { let s = self.config.index.timestamp_to_index(start).unwrap_or(0); let e = self.config.index.timestamp_to_index(end).unwrap_or(0); self.range(s..e) @@ -288,13 +288,13 @@ impl MetricEndpointBuilder> { } /// Builder for single item access. -pub struct SingleItemBuilder> { +pub struct SingleItemBuilder> { config: EndpointConfig, _marker: std::marker::PhantomData (T, D)>, } /// Date-aware single item builder. -pub type DateSingleItemBuilder = SingleItemBuilder>; +pub type DateSingleItemBuilder = SingleItemBuilder>; impl SingleItemBuilder { /// Fetch the single item. @@ -309,13 +309,13 @@ impl SingleItemBuilder { } /// Builder after calling `skip(n)`. Chain with `take(n)` to specify count. -pub struct SkippedBuilder> { +pub struct SkippedBuilder> { config: EndpointConfig, _marker: std::marker::PhantomData (T, D)>, } /// Date-aware skipped builder. -pub type DateSkippedBuilder = SkippedBuilder>; +pub type DateSkippedBuilder = SkippedBuilder>; impl SkippedBuilder { /// Take n items after the skipped position. @@ -337,13 +337,13 @@ impl SkippedBuilder { } /// Builder with range fully specified. -pub struct RangeBuilder> { +pub struct RangeBuilder> { config: EndpointConfig, _marker: std::marker::PhantomData (T, D)>, } /// Date-aware range builder. -pub type DateRangeBuilder = RangeBuilder>; +pub type DateRangeBuilder = RangeBuilder>; impl RangeBuilder { /// Fetch the range as parsed JSON. @@ -396,535 +396,535 @@ const _I34: &[Index] = &[Index::FundedAddressIndex]; const _I35: &[Index] = &[Index::EmptyAddressIndex]; #[inline] -fn _ep(c: &Arc, n: &Arc, i: Index) -> MetricEndpointBuilder { - MetricEndpointBuilder::new(c.clone(), n.clone(), i) +fn _ep(c: &Arc, n: &Arc, i: Index) -> SeriesEndpointBuilder { + SeriesEndpointBuilder::new(c.clone(), n.clone(), i) } #[inline] -fn _dep(c: &Arc, n: &Arc, i: Index) -> DateMetricEndpointBuilder { - DateMetricEndpointBuilder::new(c.clone(), n.clone(), i) +fn _dep(c: &Arc, n: &Arc, i: Index) -> DateSeriesEndpointBuilder { + DateSeriesEndpointBuilder::new(c.clone(), n.clone(), i) } // Index accessor structs -pub struct MetricPattern1By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern1By { - pub fn minute10(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Minute10) } - pub fn minute30(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Minute30) } - pub fn hour1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Hour1) } - pub fn hour4(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Hour4) } - pub fn hour12(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Hour12) } - pub fn day1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Day1) } - pub fn day3(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Day3) } - pub fn week1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Week1) } - pub fn month1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Month1) } - pub fn month3(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Month3) } - pub fn month6(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Month6) } - pub fn year1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Year1) } - pub fn year10(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Year10) } - pub fn halving(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::Halving) } - pub fn epoch(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::Epoch) } - pub fn height(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::Height) } +pub struct SeriesPattern1By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern1By { + pub fn minute10(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Minute10) } + pub fn minute30(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Minute30) } + pub fn hour1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Hour1) } + pub fn hour4(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Hour4) } + pub fn hour12(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Hour12) } + pub fn day1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Day1) } + pub fn day3(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Day3) } + pub fn week1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Week1) } + pub fn month1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Month1) } + pub fn month3(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Month3) } + pub fn month6(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Month6) } + pub fn year1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Year1) } + pub fn year10(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Year10) } + pub fn halving(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::Halving) } + pub fn epoch(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::Epoch) } + pub fn height(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::Height) } } -pub struct MetricPattern1 { name: Arc, pub by: MetricPattern1By } -impl MetricPattern1 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern1By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern1 { name: Arc, pub by: SeriesPattern1By } +impl SeriesPattern1 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern1By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern1 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I1 } } -impl MetricPattern for MetricPattern1 { fn get(&self, index: Index) -> Option> { _I1.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern1 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I1 } } +impl SeriesPattern for SeriesPattern1 { fn get(&self, index: Index) -> Option> { _I1.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern2By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern2By { - pub fn minute10(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Minute10) } - pub fn minute30(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Minute30) } - pub fn hour1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Hour1) } - pub fn hour4(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Hour4) } - pub fn hour12(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Hour12) } - pub fn day1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Day1) } - pub fn day3(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Day3) } - pub fn week1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Week1) } - pub fn month1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Month1) } - pub fn month3(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Month3) } - pub fn month6(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Month6) } - pub fn year1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Year1) } - pub fn year10(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Year10) } - pub fn halving(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::Halving) } - pub fn epoch(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::Epoch) } +pub struct SeriesPattern2By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern2By { + pub fn minute10(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Minute10) } + pub fn minute30(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Minute30) } + pub fn hour1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Hour1) } + pub fn hour4(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Hour4) } + pub fn hour12(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Hour12) } + pub fn day1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Day1) } + pub fn day3(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Day3) } + pub fn week1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Week1) } + pub fn month1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Month1) } + pub fn month3(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Month3) } + pub fn month6(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Month6) } + pub fn year1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Year1) } + pub fn year10(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Year10) } + pub fn halving(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::Halving) } + pub fn epoch(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::Epoch) } } -pub struct MetricPattern2 { name: Arc, pub by: MetricPattern2By } -impl MetricPattern2 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern2By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern2 { name: Arc, pub by: SeriesPattern2By } +impl SeriesPattern2 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern2By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern2 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I2 } } -impl MetricPattern for MetricPattern2 { fn get(&self, index: Index) -> Option> { _I2.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern2 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I2 } } +impl SeriesPattern for SeriesPattern2 { fn get(&self, index: Index) -> Option> { _I2.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern3By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern3By { - pub fn minute10(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Minute10) } +pub struct SeriesPattern3By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern3By { + pub fn minute10(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Minute10) } } -pub struct MetricPattern3 { name: Arc, pub by: MetricPattern3By } -impl MetricPattern3 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern3By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern3 { name: Arc, pub by: SeriesPattern3By } +impl SeriesPattern3 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern3By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern3 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I3 } } -impl MetricPattern for MetricPattern3 { fn get(&self, index: Index) -> Option> { _I3.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern3 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I3 } } +impl SeriesPattern for SeriesPattern3 { fn get(&self, index: Index) -> Option> { _I3.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern4By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern4By { - pub fn minute30(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Minute30) } +pub struct SeriesPattern4By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern4By { + pub fn minute30(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Minute30) } } -pub struct MetricPattern4 { name: Arc, pub by: MetricPattern4By } -impl MetricPattern4 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern4By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern4 { name: Arc, pub by: SeriesPattern4By } +impl SeriesPattern4 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern4By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern4 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I4 } } -impl MetricPattern for MetricPattern4 { fn get(&self, index: Index) -> Option> { _I4.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern4 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I4 } } +impl SeriesPattern for SeriesPattern4 { fn get(&self, index: Index) -> Option> { _I4.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern5By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern5By { - pub fn hour1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Hour1) } +pub struct SeriesPattern5By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern5By { + pub fn hour1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Hour1) } } -pub struct MetricPattern5 { name: Arc, pub by: MetricPattern5By } -impl MetricPattern5 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern5By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern5 { name: Arc, pub by: SeriesPattern5By } +impl SeriesPattern5 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern5By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern5 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I5 } } -impl MetricPattern for MetricPattern5 { fn get(&self, index: Index) -> Option> { _I5.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern5 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I5 } } +impl SeriesPattern for SeriesPattern5 { fn get(&self, index: Index) -> Option> { _I5.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern6By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern6By { - pub fn hour4(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Hour4) } +pub struct SeriesPattern6By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern6By { + pub fn hour4(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Hour4) } } -pub struct MetricPattern6 { name: Arc, pub by: MetricPattern6By } -impl MetricPattern6 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern6By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern6 { name: Arc, pub by: SeriesPattern6By } +impl SeriesPattern6 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern6By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern6 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I6 } } -impl MetricPattern for MetricPattern6 { fn get(&self, index: Index) -> Option> { _I6.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern6 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I6 } } +impl SeriesPattern for SeriesPattern6 { fn get(&self, index: Index) -> Option> { _I6.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern7By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern7By { - pub fn hour12(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Hour12) } +pub struct SeriesPattern7By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern7By { + pub fn hour12(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Hour12) } } -pub struct MetricPattern7 { name: Arc, pub by: MetricPattern7By } -impl MetricPattern7 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern7By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern7 { name: Arc, pub by: SeriesPattern7By } +impl SeriesPattern7 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern7By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern7 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I7 } } -impl MetricPattern for MetricPattern7 { fn get(&self, index: Index) -> Option> { _I7.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern7 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I7 } } +impl SeriesPattern for SeriesPattern7 { fn get(&self, index: Index) -> Option> { _I7.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern8By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern8By { - pub fn day1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Day1) } +pub struct SeriesPattern8By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern8By { + pub fn day1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Day1) } } -pub struct MetricPattern8 { name: Arc, pub by: MetricPattern8By } -impl MetricPattern8 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern8By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern8 { name: Arc, pub by: SeriesPattern8By } +impl SeriesPattern8 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern8By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern8 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I8 } } -impl MetricPattern for MetricPattern8 { fn get(&self, index: Index) -> Option> { _I8.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern8 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I8 } } +impl SeriesPattern for SeriesPattern8 { fn get(&self, index: Index) -> Option> { _I8.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern9By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern9By { - pub fn day3(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Day3) } +pub struct SeriesPattern9By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern9By { + pub fn day3(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Day3) } } -pub struct MetricPattern9 { name: Arc, pub by: MetricPattern9By } -impl MetricPattern9 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern9By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern9 { name: Arc, pub by: SeriesPattern9By } +impl SeriesPattern9 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern9By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern9 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I9 } } -impl MetricPattern for MetricPattern9 { fn get(&self, index: Index) -> Option> { _I9.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern9 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I9 } } +impl SeriesPattern for SeriesPattern9 { fn get(&self, index: Index) -> Option> { _I9.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern10By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern10By { - pub fn week1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Week1) } +pub struct SeriesPattern10By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern10By { + pub fn week1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Week1) } } -pub struct MetricPattern10 { name: Arc, pub by: MetricPattern10By } -impl MetricPattern10 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern10By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern10 { name: Arc, pub by: SeriesPattern10By } +impl SeriesPattern10 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern10By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern10 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I10 } } -impl MetricPattern for MetricPattern10 { fn get(&self, index: Index) -> Option> { _I10.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern10 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I10 } } +impl SeriesPattern for SeriesPattern10 { fn get(&self, index: Index) -> Option> { _I10.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern11By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern11By { - pub fn month1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Month1) } +pub struct SeriesPattern11By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern11By { + pub fn month1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Month1) } } -pub struct MetricPattern11 { name: Arc, pub by: MetricPattern11By } -impl MetricPattern11 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern11By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern11 { name: Arc, pub by: SeriesPattern11By } +impl SeriesPattern11 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern11By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern11 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I11 } } -impl MetricPattern for MetricPattern11 { fn get(&self, index: Index) -> Option> { _I11.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern11 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I11 } } +impl SeriesPattern for SeriesPattern11 { fn get(&self, index: Index) -> Option> { _I11.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern12By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern12By { - pub fn month3(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Month3) } +pub struct SeriesPattern12By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern12By { + pub fn month3(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Month3) } } -pub struct MetricPattern12 { name: Arc, pub by: MetricPattern12By } -impl MetricPattern12 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern12By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern12 { name: Arc, pub by: SeriesPattern12By } +impl SeriesPattern12 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern12By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern12 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I12 } } -impl MetricPattern for MetricPattern12 { fn get(&self, index: Index) -> Option> { _I12.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern12 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I12 } } +impl SeriesPattern for SeriesPattern12 { fn get(&self, index: Index) -> Option> { _I12.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern13By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern13By { - pub fn month6(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Month6) } +pub struct SeriesPattern13By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern13By { + pub fn month6(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Month6) } } -pub struct MetricPattern13 { name: Arc, pub by: MetricPattern13By } -impl MetricPattern13 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern13By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern13 { name: Arc, pub by: SeriesPattern13By } +impl SeriesPattern13 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern13By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern13 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I13 } } -impl MetricPattern for MetricPattern13 { fn get(&self, index: Index) -> Option> { _I13.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern13 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I13 } } +impl SeriesPattern for SeriesPattern13 { fn get(&self, index: Index) -> Option> { _I13.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern14By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern14By { - pub fn year1(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Year1) } +pub struct SeriesPattern14By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern14By { + pub fn year1(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Year1) } } -pub struct MetricPattern14 { name: Arc, pub by: MetricPattern14By } -impl MetricPattern14 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern14By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern14 { name: Arc, pub by: SeriesPattern14By } +impl SeriesPattern14 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern14By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern14 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I14 } } -impl MetricPattern for MetricPattern14 { fn get(&self, index: Index) -> Option> { _I14.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern14 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I14 } } +impl SeriesPattern for SeriesPattern14 { fn get(&self, index: Index) -> Option> { _I14.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern15By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern15By { - pub fn year10(&self) -> DateMetricEndpointBuilder { _dep(&self.client, &self.name, Index::Year10) } +pub struct SeriesPattern15By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern15By { + pub fn year10(&self) -> DateSeriesEndpointBuilder { _dep(&self.client, &self.name, Index::Year10) } } -pub struct MetricPattern15 { name: Arc, pub by: MetricPattern15By } -impl MetricPattern15 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern15By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern15 { name: Arc, pub by: SeriesPattern15By } +impl SeriesPattern15 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern15By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern15 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I15 } } -impl MetricPattern for MetricPattern15 { fn get(&self, index: Index) -> Option> { _I15.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern15 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I15 } } +impl SeriesPattern for SeriesPattern15 { fn get(&self, index: Index) -> Option> { _I15.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern16By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern16By { - pub fn halving(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::Halving) } +pub struct SeriesPattern16By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern16By { + pub fn halving(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::Halving) } } -pub struct MetricPattern16 { name: Arc, pub by: MetricPattern16By } -impl MetricPattern16 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern16By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern16 { name: Arc, pub by: SeriesPattern16By } +impl SeriesPattern16 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern16By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern16 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I16 } } -impl MetricPattern for MetricPattern16 { fn get(&self, index: Index) -> Option> { _I16.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern16 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I16 } } +impl SeriesPattern for SeriesPattern16 { fn get(&self, index: Index) -> Option> { _I16.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern17By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern17By { - pub fn epoch(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::Epoch) } +pub struct SeriesPattern17By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern17By { + pub fn epoch(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::Epoch) } } -pub struct MetricPattern17 { name: Arc, pub by: MetricPattern17By } -impl MetricPattern17 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern17By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern17 { name: Arc, pub by: SeriesPattern17By } +impl SeriesPattern17 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern17By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern17 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I17 } } -impl MetricPattern for MetricPattern17 { fn get(&self, index: Index) -> Option> { _I17.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern17 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I17 } } +impl SeriesPattern for SeriesPattern17 { fn get(&self, index: Index) -> Option> { _I17.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern18By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern18By { - pub fn height(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::Height) } +pub struct SeriesPattern18By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern18By { + pub fn height(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::Height) } } -pub struct MetricPattern18 { name: Arc, pub by: MetricPattern18By } -impl MetricPattern18 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern18By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern18 { name: Arc, pub by: SeriesPattern18By } +impl SeriesPattern18 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern18By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern18 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I18 } } -impl MetricPattern for MetricPattern18 { fn get(&self, index: Index) -> Option> { _I18.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern18 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I18 } } +impl SeriesPattern for SeriesPattern18 { fn get(&self, index: Index) -> Option> { _I18.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern19By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern19By { - pub fn tx_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::TxIndex) } +pub struct SeriesPattern19By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern19By { + pub fn tx_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::TxIndex) } } -pub struct MetricPattern19 { name: Arc, pub by: MetricPattern19By } -impl MetricPattern19 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern19By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern19 { name: Arc, pub by: SeriesPattern19By } +impl SeriesPattern19 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern19By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern19 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I19 } } -impl MetricPattern for MetricPattern19 { fn get(&self, index: Index) -> Option> { _I19.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern19 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I19 } } +impl SeriesPattern for SeriesPattern19 { fn get(&self, index: Index) -> Option> { _I19.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern20By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern20By { - pub fn txin_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::TxInIndex) } +pub struct SeriesPattern20By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern20By { + pub fn txin_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::TxInIndex) } } -pub struct MetricPattern20 { name: Arc, pub by: MetricPattern20By } -impl MetricPattern20 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern20By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern20 { name: Arc, pub by: SeriesPattern20By } +impl SeriesPattern20 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern20By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern20 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I20 } } -impl MetricPattern for MetricPattern20 { fn get(&self, index: Index) -> Option> { _I20.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern20 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I20 } } +impl SeriesPattern for SeriesPattern20 { fn get(&self, index: Index) -> Option> { _I20.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern21By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern21By { - pub fn txout_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::TxOutIndex) } +pub struct SeriesPattern21By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern21By { + pub fn txout_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::TxOutIndex) } } -pub struct MetricPattern21 { name: Arc, pub by: MetricPattern21By } -impl MetricPattern21 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern21By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern21 { name: Arc, pub by: SeriesPattern21By } +impl SeriesPattern21 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern21By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern21 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I21 } } -impl MetricPattern for MetricPattern21 { fn get(&self, index: Index) -> Option> { _I21.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern21 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I21 } } +impl SeriesPattern for SeriesPattern21 { fn get(&self, index: Index) -> Option> { _I21.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern22By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern22By { - pub fn empty_output_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::EmptyOutputIndex) } +pub struct SeriesPattern22By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern22By { + pub fn empty_output_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::EmptyOutputIndex) } } -pub struct MetricPattern22 { name: Arc, pub by: MetricPattern22By } -impl MetricPattern22 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern22By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern22 { name: Arc, pub by: SeriesPattern22By } +impl SeriesPattern22 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern22By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern22 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I22 } } -impl MetricPattern for MetricPattern22 { fn get(&self, index: Index) -> Option> { _I22.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern22 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I22 } } +impl SeriesPattern for SeriesPattern22 { fn get(&self, index: Index) -> Option> { _I22.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern23By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern23By { - pub fn op_return_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::OpReturnIndex) } +pub struct SeriesPattern23By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern23By { + pub fn op_return_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::OpReturnIndex) } } -pub struct MetricPattern23 { name: Arc, pub by: MetricPattern23By } -impl MetricPattern23 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern23By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern23 { name: Arc, pub by: SeriesPattern23By } +impl SeriesPattern23 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern23By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern23 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I23 } } -impl MetricPattern for MetricPattern23 { fn get(&self, index: Index) -> Option> { _I23.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern23 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I23 } } +impl SeriesPattern for SeriesPattern23 { fn get(&self, index: Index) -> Option> { _I23.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern24By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern24By { - pub fn p2a_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::P2AAddressIndex) } +pub struct SeriesPattern24By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern24By { + pub fn p2a_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::P2AAddressIndex) } } -pub struct MetricPattern24 { name: Arc, pub by: MetricPattern24By } -impl MetricPattern24 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern24By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern24 { name: Arc, pub by: SeriesPattern24By } +impl SeriesPattern24 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern24By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern24 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I24 } } -impl MetricPattern for MetricPattern24 { fn get(&self, index: Index) -> Option> { _I24.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern24 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I24 } } +impl SeriesPattern for SeriesPattern24 { fn get(&self, index: Index) -> Option> { _I24.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern25By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern25By { - pub fn p2ms_output_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::P2MSOutputIndex) } +pub struct SeriesPattern25By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern25By { + pub fn p2ms_output_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::P2MSOutputIndex) } } -pub struct MetricPattern25 { name: Arc, pub by: MetricPattern25By } -impl MetricPattern25 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern25By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern25 { name: Arc, pub by: SeriesPattern25By } +impl SeriesPattern25 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern25By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern25 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I25 } } -impl MetricPattern for MetricPattern25 { fn get(&self, index: Index) -> Option> { _I25.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern25 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I25 } } +impl SeriesPattern for SeriesPattern25 { fn get(&self, index: Index) -> Option> { _I25.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern26By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern26By { - pub fn p2pk33_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::P2PK33AddressIndex) } +pub struct SeriesPattern26By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern26By { + pub fn p2pk33_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::P2PK33AddressIndex) } } -pub struct MetricPattern26 { name: Arc, pub by: MetricPattern26By } -impl MetricPattern26 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern26By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern26 { name: Arc, pub by: SeriesPattern26By } +impl SeriesPattern26 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern26By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern26 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I26 } } -impl MetricPattern for MetricPattern26 { fn get(&self, index: Index) -> Option> { _I26.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern26 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I26 } } +impl SeriesPattern for SeriesPattern26 { fn get(&self, index: Index) -> Option> { _I26.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern27By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern27By { - pub fn p2pk65_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::P2PK65AddressIndex) } +pub struct SeriesPattern27By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern27By { + pub fn p2pk65_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::P2PK65AddressIndex) } } -pub struct MetricPattern27 { name: Arc, pub by: MetricPattern27By } -impl MetricPattern27 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern27By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern27 { name: Arc, pub by: SeriesPattern27By } +impl SeriesPattern27 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern27By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern27 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I27 } } -impl MetricPattern for MetricPattern27 { fn get(&self, index: Index) -> Option> { _I27.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern27 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I27 } } +impl SeriesPattern for SeriesPattern27 { fn get(&self, index: Index) -> Option> { _I27.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern28By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern28By { - pub fn p2pkh_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::P2PKHAddressIndex) } +pub struct SeriesPattern28By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern28By { + pub fn p2pkh_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::P2PKHAddressIndex) } } -pub struct MetricPattern28 { name: Arc, pub by: MetricPattern28By } -impl MetricPattern28 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern28By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern28 { name: Arc, pub by: SeriesPattern28By } +impl SeriesPattern28 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern28By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern28 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I28 } } -impl MetricPattern for MetricPattern28 { fn get(&self, index: Index) -> Option> { _I28.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern28 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I28 } } +impl SeriesPattern for SeriesPattern28 { fn get(&self, index: Index) -> Option> { _I28.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern29By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern29By { - pub fn p2sh_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::P2SHAddressIndex) } +pub struct SeriesPattern29By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern29By { + pub fn p2sh_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::P2SHAddressIndex) } } -pub struct MetricPattern29 { name: Arc, pub by: MetricPattern29By } -impl MetricPattern29 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern29By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern29 { name: Arc, pub by: SeriesPattern29By } +impl SeriesPattern29 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern29By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern29 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I29 } } -impl MetricPattern for MetricPattern29 { fn get(&self, index: Index) -> Option> { _I29.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern29 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I29 } } +impl SeriesPattern for SeriesPattern29 { fn get(&self, index: Index) -> Option> { _I29.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern30By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern30By { - pub fn p2tr_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::P2TRAddressIndex) } +pub struct SeriesPattern30By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern30By { + pub fn p2tr_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::P2TRAddressIndex) } } -pub struct MetricPattern30 { name: Arc, pub by: MetricPattern30By } -impl MetricPattern30 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern30By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern30 { name: Arc, pub by: SeriesPattern30By } +impl SeriesPattern30 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern30By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern30 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I30 } } -impl MetricPattern for MetricPattern30 { fn get(&self, index: Index) -> Option> { _I30.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern30 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I30 } } +impl SeriesPattern for SeriesPattern30 { fn get(&self, index: Index) -> Option> { _I30.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern31By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern31By { - pub fn p2wpkh_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::P2WPKHAddressIndex) } +pub struct SeriesPattern31By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern31By { + pub fn p2wpkh_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::P2WPKHAddressIndex) } } -pub struct MetricPattern31 { name: Arc, pub by: MetricPattern31By } -impl MetricPattern31 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern31By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern31 { name: Arc, pub by: SeriesPattern31By } +impl SeriesPattern31 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern31By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern31 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I31 } } -impl MetricPattern for MetricPattern31 { fn get(&self, index: Index) -> Option> { _I31.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern31 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I31 } } +impl SeriesPattern for SeriesPattern31 { fn get(&self, index: Index) -> Option> { _I31.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern32By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern32By { - pub fn p2wsh_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::P2WSHAddressIndex) } +pub struct SeriesPattern32By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern32By { + pub fn p2wsh_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::P2WSHAddressIndex) } } -pub struct MetricPattern32 { name: Arc, pub by: MetricPattern32By } -impl MetricPattern32 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern32By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern32 { name: Arc, pub by: SeriesPattern32By } +impl SeriesPattern32 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern32By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern32 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I32 } } -impl MetricPattern for MetricPattern32 { fn get(&self, index: Index) -> Option> { _I32.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern32 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I32 } } +impl SeriesPattern for SeriesPattern32 { fn get(&self, index: Index) -> Option> { _I32.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern33By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern33By { - pub fn unknown_output_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::UnknownOutputIndex) } +pub struct SeriesPattern33By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern33By { + pub fn unknown_output_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::UnknownOutputIndex) } } -pub struct MetricPattern33 { name: Arc, pub by: MetricPattern33By } -impl MetricPattern33 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern33By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern33 { name: Arc, pub by: SeriesPattern33By } +impl SeriesPattern33 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern33By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern33 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I33 } } -impl MetricPattern for MetricPattern33 { fn get(&self, index: Index) -> Option> { _I33.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern33 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I33 } } +impl SeriesPattern for SeriesPattern33 { fn get(&self, index: Index) -> Option> { _I33.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern34By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern34By { - pub fn funded_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::FundedAddressIndex) } +pub struct SeriesPattern34By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern34By { + pub fn funded_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::FundedAddressIndex) } } -pub struct MetricPattern34 { name: Arc, pub by: MetricPattern34By } -impl MetricPattern34 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern34By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern34 { name: Arc, pub by: SeriesPattern34By } +impl SeriesPattern34 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern34By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern34 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I34 } } -impl MetricPattern for MetricPattern34 { fn get(&self, index: Index) -> Option> { _I34.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern34 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I34 } } +impl SeriesPattern for SeriesPattern34 { fn get(&self, index: Index) -> Option> { _I34.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } -pub struct MetricPattern35By { client: Arc, name: Arc, _marker: std::marker::PhantomData } -impl MetricPattern35By { - pub fn empty_address_index(&self) -> MetricEndpointBuilder { _ep(&self.client, &self.name, Index::EmptyAddressIndex) } +pub struct SeriesPattern35By { client: Arc, name: Arc, _marker: std::marker::PhantomData } +impl SeriesPattern35By { + pub fn empty_address_index(&self) -> SeriesEndpointBuilder { _ep(&self.client, &self.name, Index::EmptyAddressIndex) } } -pub struct MetricPattern35 { name: Arc, pub by: MetricPattern35By } -impl MetricPattern35 { - pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: MetricPattern35By { client, name, _marker: std::marker::PhantomData } } } +pub struct SeriesPattern35 { name: Arc, pub by: SeriesPattern35By } +impl SeriesPattern35 { + pub fn new(client: Arc, name: String) -> Self { let name: Arc = name.into(); Self { name: name.clone(), by: SeriesPattern35By { client, name, _marker: std::marker::PhantomData } } } pub fn name(&self) -> &str { &self.name } } -impl AnyMetricPattern for MetricPattern35 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I35 } } -impl MetricPattern for MetricPattern35 { fn get(&self, index: Index) -> Option> { _I35.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } +impl AnySeriesPattern for SeriesPattern35 { fn name(&self) -> &str { &self.name } fn indexes(&self) -> &'static [Index] { _I35 } } +impl SeriesPattern for SeriesPattern35 { fn get(&self, index: Index) -> Option> { _I35.contains(&index).then(|| _ep(&self.by.client, &self.by.name, index)) } } // Reusable pattern structs @@ -952,7 +952,7 @@ pub struct Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct7 } impl Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { pct05: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "pct05")), @@ -993,8 +993,8 @@ pub struct _0sdM0M1M1sdM2M2sdM3sdP0P1P1sdP2P2sdP3sdSdZscorePattern { pub p2_5sd: PriceRatioPattern, pub p2sd: PriceRatioPattern, pub p3sd: PriceRatioPattern, - pub sd: MetricPattern1, - pub zscore: MetricPattern1, + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, } /// Pattern struct for repeated tree structure. @@ -1014,7 +1014,7 @@ pub struct _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 { } impl _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _10y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "10y")), @@ -1050,7 +1050,7 @@ pub struct _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 { } impl _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _10y: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "10y")), @@ -1075,7 +1075,7 @@ pub struct CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern { pub gross_pnl: BaseCumulativeSumPattern3, pub investor: LowerPriceUpperPattern, pub loss: BaseCapitulationCumulativeNegativeRelSumValuePattern, - pub mvrv: MetricPattern1, + pub mvrv: SeriesPattern1, pub net_pnl: BaseChangeCumulativeDeltaRelSumPattern, pub peak_regret: BaseCumulativeRelPattern, pub price: BpsCentsPercentilesRatioSatsSmaStdUsdPattern, @@ -1087,34 +1087,34 @@ pub struct CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern { /// Pattern struct for repeated tree structure. pub struct AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern { - pub average: MetricPattern18, - pub cumulative: MetricPattern18, - pub max: MetricPattern18, - pub median: MetricPattern18, - pub min: MetricPattern18, - pub pct10: MetricPattern18, - pub pct25: MetricPattern18, - pub pct75: MetricPattern18, - pub pct90: MetricPattern18, + pub average: SeriesPattern18, + pub cumulative: SeriesPattern18, + pub max: SeriesPattern18, + pub median: SeriesPattern18, + pub min: SeriesPattern18, + pub pct10: SeriesPattern18, + pub pct25: SeriesPattern18, + pub pct75: SeriesPattern18, + pub pct90: SeriesPattern18, pub rolling: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub sum: MetricPattern18, + pub sum: SeriesPattern18, } impl AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: MetricPattern18::new(client.clone(), _m(&acc, "average")), - cumulative: MetricPattern18::new(client.clone(), _m(&acc, "cumulative")), - max: MetricPattern18::new(client.clone(), _m(&acc, "max")), - median: MetricPattern18::new(client.clone(), _m(&acc, "median")), - min: MetricPattern18::new(client.clone(), _m(&acc, "min")), - pct10: MetricPattern18::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern18::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern18::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern18::new(client.clone(), _m(&acc, "pct90")), + average: SeriesPattern18::new(client.clone(), _m(&acc, "average")), + cumulative: SeriesPattern18::new(client.clone(), _m(&acc, "cumulative")), + max: SeriesPattern18::new(client.clone(), _m(&acc, "max")), + median: SeriesPattern18::new(client.clone(), _m(&acc, "median")), + min: SeriesPattern18::new(client.clone(), _m(&acc, "min")), + pct10: SeriesPattern18::new(client.clone(), _m(&acc, "pct10")), + pct25: SeriesPattern18::new(client.clone(), _m(&acc, "pct25")), + pct75: SeriesPattern18::new(client.clone(), _m(&acc, "pct75")), + pct90: SeriesPattern18::new(client.clone(), _m(&acc, "pct90")), rolling: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), acc.clone()), - sum: MetricPattern18::new(client.clone(), _m(&acc, "sum")), + sum: SeriesPattern18::new(client.clone(), _m(&acc, "sum")), } } } @@ -1122,8 +1122,8 @@ impl AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern { /// Pattern struct for repeated tree structure. pub struct AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern { pub average: _1m1w1y24hPattern, - pub base: MetricPattern1, - pub cumulative: MetricPattern1, + pub base: SeriesPattern1, + pub cumulative: SeriesPattern1, pub max: _1m1w1y24hPattern, pub median: _1m1w1y24hPattern, pub min: _1m1w1y24hPattern, @@ -1135,12 +1135,12 @@ pub struct AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern { } impl AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { average: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "average")), - base: MetricPattern1::new(client.clone(), acc.clone()), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + base: SeriesPattern1::new(client.clone(), acc.clone()), + cumulative: SeriesPattern1::new(client.clone(), _m(&acc, "cumulative")), max: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "max")), median: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "median")), min: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "min")), @@ -1155,10 +1155,10 @@ impl AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern { /// Pattern struct for repeated tree structure. pub struct AverageGainsLossesRsiStochPattern { - pub average_gain: MetricPattern1, - pub average_loss: MetricPattern1, - pub gains: MetricPattern1, - pub losses: MetricPattern1, + pub average_gain: SeriesPattern1, + pub average_loss: SeriesPattern1, + pub gains: SeriesPattern1, + pub losses: SeriesPattern1, pub rsi: BpsPercentRatioPattern3, pub rsi_max: BpsPercentRatioPattern3, pub rsi_min: BpsPercentRatioPattern3, @@ -1168,13 +1168,13 @@ pub struct AverageGainsLossesRsiStochPattern { } impl AverageGainsLossesRsiStochPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { - average_gain: MetricPattern1::new(client.clone(), _m(&acc, &format!("average_gain_{disc}", disc=disc))), - average_loss: MetricPattern1::new(client.clone(), _m(&acc, &format!("average_loss_{disc}", disc=disc))), - gains: MetricPattern1::new(client.clone(), _m(&acc, &format!("gains_{disc}", disc=disc))), - losses: MetricPattern1::new(client.clone(), _m(&acc, &format!("losses_{disc}", disc=disc))), + average_gain: SeriesPattern1::new(client.clone(), _m(&acc, &format!("average_gain_{disc}", disc=disc))), + average_loss: SeriesPattern1::new(client.clone(), _m(&acc, &format!("average_loss_{disc}", disc=disc))), + gains: SeriesPattern1::new(client.clone(), _m(&acc, &format!("gains_{disc}", disc=disc))), + losses: SeriesPattern1::new(client.clone(), _m(&acc, &format!("losses_{disc}", disc=disc))), rsi: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, &disc)), rsi_max: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, &format!("max_{disc}", disc=disc))), rsi_min: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, &format!("min_{disc}", disc=disc))), @@ -1187,30 +1187,30 @@ impl AverageGainsLossesRsiStochPattern { /// Pattern struct for repeated tree structure. pub struct AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3 { - pub all: MetricPattern1, - pub p2a: MetricPattern1, - pub p2pk33: MetricPattern1, - pub p2pk65: MetricPattern1, - pub p2pkh: MetricPattern1, - pub p2sh: MetricPattern1, - pub p2tr: MetricPattern1, - pub p2wpkh: MetricPattern1, - pub p2wsh: MetricPattern1, + pub all: SeriesPattern1, + pub p2a: SeriesPattern1, + pub p2pk33: SeriesPattern1, + pub p2pk65: SeriesPattern1, + pub p2pkh: SeriesPattern1, + pub p2sh: SeriesPattern1, + pub p2tr: SeriesPattern1, + pub p2wpkh: SeriesPattern1, + pub p2wsh: SeriesPattern1, } impl AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - all: MetricPattern1::new(client.clone(), acc.clone()), - p2a: MetricPattern1::new(client.clone(), _p("p2a", &acc)), - p2pk33: MetricPattern1::new(client.clone(), _p("p2pk33", &acc)), - p2pk65: MetricPattern1::new(client.clone(), _p("p2pk65", &acc)), - p2pkh: MetricPattern1::new(client.clone(), _p("p2pkh", &acc)), - p2sh: MetricPattern1::new(client.clone(), _p("p2sh", &acc)), - p2tr: MetricPattern1::new(client.clone(), _p("p2tr", &acc)), - p2wpkh: MetricPattern1::new(client.clone(), _p("p2wpkh", &acc)), - p2wsh: MetricPattern1::new(client.clone(), _p("p2wsh", &acc)), + all: SeriesPattern1::new(client.clone(), acc.clone()), + p2a: SeriesPattern1::new(client.clone(), _p("p2a", &acc)), + p2pk33: SeriesPattern1::new(client.clone(), _p("p2pk33", &acc)), + p2pk65: SeriesPattern1::new(client.clone(), _p("p2pk65", &acc)), + p2pkh: SeriesPattern1::new(client.clone(), _p("p2pkh", &acc)), + p2sh: SeriesPattern1::new(client.clone(), _p("p2sh", &acc)), + p2tr: SeriesPattern1::new(client.clone(), _p("p2tr", &acc)), + p2wpkh: SeriesPattern1::new(client.clone(), _p("p2wpkh", &acc)), + p2wsh: SeriesPattern1::new(client.clone(), _p("p2wsh", &acc)), } } } @@ -1229,7 +1229,7 @@ pub struct AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern { } impl AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { average: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "average")), @@ -1258,7 +1258,7 @@ pub struct AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern { } impl AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { average: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "average")), @@ -1276,9 +1276,9 @@ impl AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern { /// Pattern struct for repeated tree structure. pub struct BaseCapitulationCumulativeNegativeRelSumValuePattern { pub base: CentsUsdPattern2, - pub capitulation_flow: MetricPattern1, + pub capitulation_flow: SeriesPattern1, pub cumulative: CentsUsdPattern2, - pub negative: MetricPattern1, + pub negative: SeriesPattern1, pub rel_to_rcap: BpsPercentRatioPattern4, pub sum: _1m1w1y24hPattern4, pub value_created: BaseCumulativeSumPattern, @@ -1287,40 +1287,40 @@ pub struct BaseCapitulationCumulativeNegativeRelSumValuePattern { /// Pattern struct for repeated tree structure. pub struct BpsCentsPercentilesRatioSatsSmaStdUsdPattern { - pub bps: MetricPattern1, - pub cents: MetricPattern1, + pub bps: SeriesPattern1, + pub cents: SeriesPattern1, pub percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern, - pub ratio: MetricPattern1, - pub sats: MetricPattern1, + pub ratio: SeriesPattern1, + pub sats: SeriesPattern1, pub sma: _1m1w1y2y4yAllPattern, pub std_dev: _1y2y4yAllPattern, - pub usd: MetricPattern1, + pub usd: SeriesPattern1, } /// Pattern struct for repeated tree structure. pub struct AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2 { - pub average: MetricPattern18, - pub max: MetricPattern18, - pub median: MetricPattern18, - pub min: MetricPattern18, - pub pct10: MetricPattern18, - pub pct25: MetricPattern18, - pub pct75: MetricPattern18, - pub pct90: MetricPattern18, + pub average: SeriesPattern18, + pub max: SeriesPattern18, + pub median: SeriesPattern18, + pub min: SeriesPattern18, + pub pct10: SeriesPattern18, + pub pct25: SeriesPattern18, + pub pct75: SeriesPattern18, + pub pct90: SeriesPattern18, } impl AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - average: MetricPattern18::new(client.clone(), _m(&acc, "average")), - max: MetricPattern18::new(client.clone(), _m(&acc, "max")), - median: MetricPattern18::new(client.clone(), _m(&acc, "median")), - min: MetricPattern18::new(client.clone(), _m(&acc, "min")), - pct10: MetricPattern18::new(client.clone(), _m(&acc, "pct10")), - pct25: MetricPattern18::new(client.clone(), _m(&acc, "pct25")), - pct75: MetricPattern18::new(client.clone(), _m(&acc, "pct75")), - pct90: MetricPattern18::new(client.clone(), _m(&acc, "pct90")), + average: SeriesPattern18::new(client.clone(), _m(&acc, "average")), + max: SeriesPattern18::new(client.clone(), _m(&acc, "max")), + median: SeriesPattern18::new(client.clone(), _m(&acc, "median")), + min: SeriesPattern18::new(client.clone(), _m(&acc, "min")), + pct10: SeriesPattern18::new(client.clone(), _m(&acc, "pct10")), + pct25: SeriesPattern18::new(client.clone(), _m(&acc, "pct25")), + pct75: SeriesPattern18::new(client.clone(), _m(&acc, "pct75")), + pct90: SeriesPattern18::new(client.clone(), _m(&acc, "pct90")), } } } @@ -1337,7 +1337,7 @@ pub struct _10y2y3y4y5y6y8yPattern { } impl _10y2y3y4y5y6y8yPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _10y: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "10y")), @@ -1357,22 +1357,22 @@ pub struct _1m1w1y24hBpsPercentRatioPattern { pub _1w: BpsPercentRatioPattern3, pub _1y: BpsPercentRatioPattern3, pub _24h: BpsPercentRatioPattern3, - pub bps: MetricPattern1, - pub percent: MetricPattern1, - pub ratio: MetricPattern1, + pub bps: SeriesPattern1, + pub percent: SeriesPattern1, + pub ratio: SeriesPattern1, } impl _1m1w1y24hBpsPercentRatioPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _1m: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "1m")), _1w: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "1w")), _1y: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "1y")), _24h: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "24h")), - bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), - percent: MetricPattern1::new(client.clone(), acc.clone()), - ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), + bps: SeriesPattern1::new(client.clone(), _m(&acc, "bps")), + percent: SeriesPattern1::new(client.clone(), acc.clone()), + ratio: SeriesPattern1::new(client.clone(), _m(&acc, "ratio")), } } } @@ -1381,7 +1381,7 @@ impl _1m1w1y24hBpsPercentRatioPattern { pub struct BaseCumulativeDistributionRelSumValuePattern { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, - pub distribution_flow: MetricPattern1, + pub distribution_flow: SeriesPattern1, pub rel_to_rcap: BpsPercentRatioPattern4, pub sum: _1m1w1y24hPattern4, pub value_created: BaseCumulativeSumPattern, @@ -1392,7 +1392,7 @@ pub struct BaseCumulativeDistributionRelSumValuePattern { pub struct BaseCumulativeNegativeRelSumPattern2 { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, - pub negative: MetricPattern1, + pub negative: SeriesPattern1, pub rel_to_mcap: BpsPercentRatioPattern3, pub rel_to_own_gross: BpsPercentRatioPattern3, pub rel_to_own_mcap: BpsPercentRatioPattern4, @@ -1400,12 +1400,12 @@ pub struct BaseCumulativeNegativeRelSumPattern2 { } impl BaseCumulativeNegativeRelSumPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), _m(&acc, "unrealized_loss")), cumulative: CentsUsdPattern2::new(client.clone(), _m(&acc, "unrealized_loss_cumulative")), - negative: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")), + negative: SeriesPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss")), rel_to_mcap: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_mcap")), rel_to_own_gross: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_gross_pnl")), rel_to_own_mcap: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_own_mcap")), @@ -1418,7 +1418,7 @@ impl BaseCumulativeNegativeRelSumPattern2 { pub struct CapLossMvrvNetPriceProfitSoprPattern { pub cap: CentsDeltaUsdPattern, pub loss: BaseCumulativeNegativeSumPattern, - pub mvrv: MetricPattern1, + pub mvrv: SeriesPattern1, pub net_pnl: BaseCumulativeDeltaSumPattern, pub price: BpsCentsRatioSatsUsdPattern, pub profit: BaseCumulativeSumPattern3, @@ -1426,12 +1426,12 @@ pub struct CapLossMvrvNetPriceProfitSoprPattern { } impl CapLossMvrvNetPriceProfitSoprPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { cap: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), loss: BaseCumulativeNegativeSumPattern::new(client.clone(), acc.clone(), "realized_loss".to_string()), - mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), + mvrv: SeriesPattern1::new(client.clone(), _m(&acc, "mvrv")), net_pnl: BaseCumulativeDeltaSumPattern::new(client.clone(), _m(&acc, "net_realized_pnl")), price: BpsCentsRatioSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), profit: BaseCumulativeSumPattern3::new(client.clone(), _m(&acc, "realized_profit")), @@ -1462,7 +1462,7 @@ pub struct _1m1w1y2y4yAllPattern { } impl _1m1w1y2y4yAllPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _1m: BpsRatioPattern2::new(client.clone(), _m(&acc, "1m")), @@ -1486,7 +1486,7 @@ pub struct BaseChangeCumulativeDeltaRelSumPattern { } impl BaseChangeCumulativeDeltaRelSumPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { base: CentsUsdPattern::new(client.clone(), _m(&acc, "realized_pnl")), @@ -1510,7 +1510,7 @@ pub struct BaseCumulativeRelSumPattern2 { } impl BaseCumulativeRelSumPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), acc.clone()), @@ -1525,48 +1525,48 @@ impl BaseCumulativeRelSumPattern2 { /// Pattern struct for repeated tree structure. pub struct BpsCentsPercentilesRatioSatsUsdPattern { - pub bps: MetricPattern1, - pub cents: MetricPattern1, + pub bps: SeriesPattern1, + pub cents: SeriesPattern1, pub percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern, - pub ratio: MetricPattern1, - pub sats: MetricPattern1, - pub usd: MetricPattern1, + pub ratio: SeriesPattern1, + pub sats: SeriesPattern1, + pub usd: SeriesPattern1, } impl BpsCentsPercentilesRatioSatsUsdPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - bps: MetricPattern1::new(client.clone(), _m(&acc, "ratio_bps")), - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), + bps: SeriesPattern1::new(client.clone(), _m(&acc, "ratio_bps")), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new(client.clone(), acc.clone()), - ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), - sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), - usd: MetricPattern1::new(client.clone(), acc.clone()), + ratio: SeriesPattern1::new(client.clone(), _m(&acc, "ratio")), + sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), + usd: SeriesPattern1::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct BtcCentsRelSatsUsdPattern3 { - pub btc: MetricPattern1, - pub cents: MetricPattern1, + pub btc: SeriesPattern1, + pub cents: SeriesPattern1, pub rel_to_circulating: BpsPercentRatioPattern3, pub rel_to_own: BpsPercentRatioPattern3, - pub sats: MetricPattern1, - pub usd: MetricPattern1, + pub sats: SeriesPattern1, + pub usd: SeriesPattern1, } impl BtcCentsRelSatsUsdPattern3 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - btc: MetricPattern1::new(client.clone(), acc.clone()), - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), + btc: SeriesPattern1::new(client.clone(), acc.clone()), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), rel_to_circulating: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "rel_to_circulating")), rel_to_own: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "rel_to_own")), - sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), - usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), + sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), + usd: SeriesPattern1::new(client.clone(), _m(&acc, "usd")), } } } @@ -1575,19 +1575,19 @@ impl BtcCentsRelSatsUsdPattern3 { pub struct CapLossMvrvPriceProfitSoprPattern { pub cap: CentsDeltaUsdPattern, pub loss: BaseCumulativeSumPattern3, - pub mvrv: MetricPattern1, + pub mvrv: SeriesPattern1, pub price: BpsCentsRatioSatsUsdPattern, pub profit: BaseCumulativeSumPattern3, pub sopr: ValuePattern, } impl CapLossMvrvPriceProfitSoprPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { cap: CentsDeltaUsdPattern::new(client.clone(), _m(&acc, "realized_cap")), loss: BaseCumulativeSumPattern3::new(client.clone(), _m(&acc, "realized_loss")), - mvrv: MetricPattern1::new(client.clone(), _m(&acc, "mvrv")), + mvrv: SeriesPattern1::new(client.clone(), _m(&acc, "mvrv")), price: BpsCentsRatioSatsUsdPattern::new(client.clone(), _m(&acc, "realized_price")), profit: BaseCumulativeSumPattern3::new(client.clone(), _m(&acc, "realized_profit")), sopr: ValuePattern::new(client.clone(), _m(&acc, "value")), @@ -1606,7 +1606,7 @@ pub struct DeltaHalfInRelTotalPattern { } impl DeltaHalfInRelTotalPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { delta: AbsoluteRatePattern::new(client.clone(), _m(&acc, "delta")), @@ -1630,7 +1630,7 @@ pub struct DeltaHalfInRelTotalPattern2 { } impl DeltaHalfInRelTotalPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { delta: AbsoluteRatePattern::new(client.clone(), _m(&acc, "delta")), @@ -1654,7 +1654,7 @@ pub struct Pct1Pct2Pct5Pct95Pct98Pct99Pattern { } impl Pct1Pct2Pct5Pct95Pct98Pct99Pattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { pct1: BpsPriceRatioPattern::new(client.clone(), acc.clone(), "pct1".to_string()), @@ -1677,7 +1677,7 @@ pub struct ActivityOutputsRealizedSupplyUnrealizedPattern { } impl ActivityOutputsRealizedSupplyUnrealizedPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { activity: CoindaysSentPattern::new(client.clone(), acc.clone()), @@ -1699,7 +1699,7 @@ pub struct AddressOutputsRealizedSupplyUnrealizedPattern { } impl AddressOutputsRealizedSupplyUnrealizedPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { address_count: DeltaInnerPattern::new(client.clone(), _m(&acc, "address_count")), @@ -1713,19 +1713,19 @@ impl AddressOutputsRealizedSupplyUnrealizedPattern { /// Pattern struct for repeated tree structure. pub struct BaseCumulativeInSumPattern { - pub base: MetricPattern1, - pub cumulative: MetricPattern1, + pub base: SeriesPattern1, + pub cumulative: SeriesPattern1, pub in_loss: BaseCumulativeSumPattern4, pub in_profit: BaseCumulativeSumPattern4, pub sum: _1m1w1y24hPattern, } impl BaseCumulativeInSumPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - base: MetricPattern1::new(client.clone(), acc.clone()), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + base: SeriesPattern1::new(client.clone(), acc.clone()), + cumulative: SeriesPattern1::new(client.clone(), _m(&acc, "cumulative")), in_loss: BaseCumulativeSumPattern4::new(client.clone(), _m(&acc, "in_loss")), in_profit: BaseCumulativeSumPattern4::new(client.clone(), _m(&acc, "in_profit")), sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sum")), @@ -1735,88 +1735,88 @@ impl BaseCumulativeInSumPattern { /// Pattern struct for repeated tree structure. pub struct BpsCentsRatioSatsUsdPattern { - pub bps: MetricPattern1, - pub cents: MetricPattern1, - pub ratio: MetricPattern1, - pub sats: MetricPattern1, - pub usd: MetricPattern1, + pub bps: SeriesPattern1, + pub cents: SeriesPattern1, + pub ratio: SeriesPattern1, + pub sats: SeriesPattern1, + pub usd: SeriesPattern1, } impl BpsCentsRatioSatsUsdPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - bps: MetricPattern1::new(client.clone(), _m(&acc, "ratio_bps")), - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), - sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), - usd: MetricPattern1::new(client.clone(), acc.clone()), + bps: SeriesPattern1::new(client.clone(), _m(&acc, "ratio_bps")), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), + ratio: SeriesPattern1::new(client.clone(), _m(&acc, "ratio")), + sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), + usd: SeriesPattern1::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct BtcCentsDeltaSatsUsdPattern { - pub btc: MetricPattern1, - pub cents: MetricPattern1, + pub btc: SeriesPattern1, + pub cents: SeriesPattern1, pub delta: AbsoluteRatePattern, - pub sats: MetricPattern1, - pub usd: MetricPattern1, + pub sats: SeriesPattern1, + pub usd: SeriesPattern1, } impl BtcCentsDeltaSatsUsdPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - btc: MetricPattern1::new(client.clone(), acc.clone()), - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), + btc: SeriesPattern1::new(client.clone(), acc.clone()), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), delta: AbsoluteRatePattern::new(client.clone(), _m(&acc, "delta")), - sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), - usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), + sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), + usd: SeriesPattern1::new(client.clone(), _m(&acc, "usd")), } } } /// Pattern struct for repeated tree structure. pub struct BtcCentsRelSatsUsdPattern { - pub btc: MetricPattern1, - pub cents: MetricPattern1, + pub btc: SeriesPattern1, + pub cents: SeriesPattern1, pub rel_to_circulating: BpsPercentRatioPattern3, - pub sats: MetricPattern1, - pub usd: MetricPattern1, + pub sats: SeriesPattern1, + pub usd: SeriesPattern1, } impl BtcCentsRelSatsUsdPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - btc: MetricPattern1::new(client.clone(), acc.clone()), - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), + btc: SeriesPattern1::new(client.clone(), acc.clone()), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), rel_to_circulating: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "rel_to_circulating")), - sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), - usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), + sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), + usd: SeriesPattern1::new(client.clone(), _m(&acc, "usd")), } } } /// Pattern struct for repeated tree structure. pub struct BtcCentsRelSatsUsdPattern2 { - pub btc: MetricPattern1, - pub cents: MetricPattern1, + pub btc: SeriesPattern1, + pub cents: SeriesPattern1, pub rel_to_own: BpsPercentRatioPattern3, - pub sats: MetricPattern1, - pub usd: MetricPattern1, + pub sats: SeriesPattern1, + pub usd: SeriesPattern1, } impl BtcCentsRelSatsUsdPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - btc: MetricPattern1::new(client.clone(), acc.clone()), - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), + btc: SeriesPattern1::new(client.clone(), acc.clone()), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), rel_to_own: BpsPercentRatioPattern3::new(client.clone(), _m(&acc, "rel_to_own")), - sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), - usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), + sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), + usd: SeriesPattern1::new(client.clone(), _m(&acc, "usd")), } } } @@ -1831,7 +1831,7 @@ pub struct DeltaHalfInTotalPattern2 { } impl DeltaHalfInTotalPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { delta: AbsoluteRatePattern::new(client.clone(), _m(&acc, "delta")), @@ -1845,11 +1845,11 @@ impl DeltaHalfInTotalPattern2 { /// Pattern struct for repeated tree structure. pub struct EmaHistogramLineSignalPattern { - pub ema_fast: MetricPattern1, - pub ema_slow: MetricPattern1, - pub histogram: MetricPattern1, - pub line: MetricPattern1, - pub signal: MetricPattern1, + pub ema_fast: SeriesPattern1, + pub ema_slow: SeriesPattern1, + pub histogram: SeriesPattern1, + pub line: SeriesPattern1, + pub signal: SeriesPattern1, } /// Pattern struct for repeated tree structure. @@ -1863,44 +1863,44 @@ pub struct InvestedMaxMinPercentilesSupplyPattern { /// Pattern struct for repeated tree structure. pub struct PhsReboundThsPattern { - pub phs: MetricPattern1, - pub phs_min: MetricPattern1, + pub phs: SeriesPattern1, + pub phs_min: SeriesPattern1, pub rebound: BpsPercentRatioPattern, - pub ths: MetricPattern1, - pub ths_min: MetricPattern1, + pub ths: SeriesPattern1, + pub ths_min: SeriesPattern1, } impl PhsReboundThsPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - phs: MetricPattern1::new(client.clone(), _m(&acc, "phs")), - phs_min: MetricPattern1::new(client.clone(), _m(&acc, "phs_min")), + phs: SeriesPattern1::new(client.clone(), _m(&acc, "phs")), + phs_min: SeriesPattern1::new(client.clone(), _m(&acc, "phs_min")), rebound: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rebound")), - ths: MetricPattern1::new(client.clone(), _m(&acc, "ths")), - ths_min: MetricPattern1::new(client.clone(), _m(&acc, "ths_min")), + ths: SeriesPattern1::new(client.clone(), _m(&acc, "ths")), + ths_min: SeriesPattern1::new(client.clone(), _m(&acc, "ths_min")), } } } /// Pattern struct for repeated tree structure. pub struct _1m1w1y24hHeightPattern { - pub _1m: MetricPattern1, - pub _1w: MetricPattern1, - pub _1y: MetricPattern1, - pub _24h: MetricPattern1, - pub height: MetricPattern18, + pub _1m: SeriesPattern1, + pub _1w: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _24h: SeriesPattern1, + pub height: SeriesPattern18, } impl _1m1w1y24hHeightPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - _1m: MetricPattern1::new(client.clone(), _m(&acc, "average_1m")), - _1w: MetricPattern1::new(client.clone(), _m(&acc, "average_1w")), - _1y: MetricPattern1::new(client.clone(), _m(&acc, "average_1y")), - _24h: MetricPattern1::new(client.clone(), _m(&acc, "average_24h")), - height: MetricPattern18::new(client.clone(), acc.clone()), + _1m: SeriesPattern1::new(client.clone(), _m(&acc, "average_1m")), + _1w: SeriesPattern1::new(client.clone(), _m(&acc, "average_1w")), + _1y: SeriesPattern1::new(client.clone(), _m(&acc, "average_1y")), + _24h: SeriesPattern1::new(client.clone(), _m(&acc, "average_24h")), + height: SeriesPattern18::new(client.clone(), acc.clone()), } } } @@ -1914,7 +1914,7 @@ pub struct _1m1w1y24hPattern2 { } impl _1m1w1y24hPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _1m: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "1m_rate")), @@ -1934,7 +1934,7 @@ pub struct _1m1w1y24hPattern6 { } impl _1m1w1y24hPattern6 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _1m: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "1m")), @@ -1954,7 +1954,7 @@ pub struct _1m1w1y24hPattern5 { } impl _1m1w1y24hPattern5 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _1m: BtcCentsSatsUsdPattern::new(client.clone(), _m(&acc, "1m")), @@ -1974,7 +1974,7 @@ pub struct _1m1w1y2wPattern { } impl _1m1w1y2wPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _1m: CentsSatsUsdPattern::new(client.clone(), _m(&acc, "1m")), @@ -1994,7 +1994,7 @@ pub struct _1m1w1y24hPattern3 { } impl _1m1w1y24hPattern3 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _1m: CentsUsdPattern::new(client.clone(), _m(&acc, "1m")), @@ -2014,7 +2014,7 @@ pub struct _1m1w1y24hPattern4 { } impl _1m1w1y24hPattern4 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _1m: CentsUsdPattern2::new(client.clone(), _m(&acc, "1m")), @@ -2050,7 +2050,7 @@ pub struct BaseCumulativeDeltaSumPattern { } impl BaseCumulativeDeltaSumPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { base: CentsUsdPattern::new(client.clone(), acc.clone()), @@ -2065,17 +2065,17 @@ impl BaseCumulativeDeltaSumPattern { pub struct BaseCumulativeNegativeSumPattern { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, - pub negative: MetricPattern1, + pub negative: SeriesPattern1, pub sum: _1m1w1y24hPattern4, } impl BaseCumulativeNegativeSumPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), _m(&acc, &disc)), cumulative: CentsUsdPattern2::new(client.clone(), _m(&acc, &format!("{disc}_cumulative", disc=disc))), - negative: MetricPattern1::new(client.clone(), _m(&acc, &format!("neg_{disc}", disc=disc))), + negative: SeriesPattern1::new(client.clone(), _m(&acc, &format!("neg_{disc}", disc=disc))), sum: _1m1w1y24hPattern4::new(client.clone(), _m(&acc, &format!("{disc}_sum", disc=disc))), } } @@ -2090,7 +2090,7 @@ pub struct BothReactivatedReceivingSendingPattern { } impl BothReactivatedReceivingSendingPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { both: _1m1w1y24hHeightPattern::new(client.clone(), _m(&acc, "both")), @@ -2103,60 +2103,60 @@ impl BothReactivatedReceivingSendingPattern { /// Pattern struct for repeated tree structure. pub struct BtcCentsSatsUsdPattern { - pub btc: MetricPattern1, - pub cents: MetricPattern1, - pub sats: MetricPattern1, - pub usd: MetricPattern1, + pub btc: SeriesPattern1, + pub cents: SeriesPattern1, + pub sats: SeriesPattern1, + pub usd: SeriesPattern1, } impl BtcCentsSatsUsdPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - btc: MetricPattern1::new(client.clone(), acc.clone()), - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), - usd: MetricPattern1::new(client.clone(), _m(&acc, "usd")), + btc: SeriesPattern1::new(client.clone(), acc.clone()), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), + sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), + usd: SeriesPattern1::new(client.clone(), _m(&acc, "usd")), } } } /// Pattern struct for repeated tree structure. pub struct CentsDeltaRelUsdPattern { - pub cents: MetricPattern1, + pub cents: SeriesPattern1, pub delta: AbsoluteRatePattern2, pub rel_to_own_mcap: BpsPercentRatioPattern4, - pub usd: MetricPattern1, + pub usd: SeriesPattern1, } impl CentsDeltaRelUsdPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), delta: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "delta")), rel_to_own_mcap: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_own_mcap")), - usd: MetricPattern1::new(client.clone(), acc.clone()), + usd: SeriesPattern1::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct CentsRelUsdPattern2 { - pub cents: MetricPattern1, + pub cents: SeriesPattern1, pub rel_to_own_gross: BpsPercentRatioPattern, pub rel_to_own_mcap: BpsPercentRatioPattern, - pub usd: MetricPattern1, + pub usd: SeriesPattern1, } impl CentsRelUsdPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), rel_to_own_gross: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_own_gross_pnl")), rel_to_own_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "rel_to_own_mcap")), - usd: MetricPattern1::new(client.clone(), acc.clone()), + usd: SeriesPattern1::new(client.clone(), acc.clone()), } } } @@ -2164,8 +2164,8 @@ impl CentsRelUsdPattern2 { /// Pattern struct for repeated tree structure. pub struct CoindaysCoinyearsDormancySentPattern { pub coindays_destroyed: BaseCumulativeSumPattern, - pub coinyears_destroyed: MetricPattern1, - pub dormancy: MetricPattern1, + pub coinyears_destroyed: SeriesPattern1, + pub dormancy: SeriesPattern1, pub sent: BaseCumulativeInSumPattern, } @@ -2178,7 +2178,7 @@ pub struct LossNetNuplProfitPattern { } impl LossNetNuplProfitPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { loss: BaseCumulativeNegativeSumPattern::new(client.clone(), acc.clone(), "unrealized_loss".to_string()), @@ -2198,7 +2198,7 @@ pub struct OutputsRealizedSupplyUnrealizedPattern2 { } impl OutputsRealizedSupplyUnrealizedPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { outputs: UnspentPattern::new(client.clone(), _m(&acc, "utxo_count")), @@ -2218,7 +2218,7 @@ pub struct OutputsRealizedSupplyUnrealizedPattern { } impl OutputsRealizedSupplyUnrealizedPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { outputs: UnspentPattern::new(client.clone(), _m(&acc, "utxo_count")), @@ -2231,20 +2231,20 @@ impl OutputsRealizedSupplyUnrealizedPattern { /// Pattern struct for repeated tree structure. pub struct _1m1w1y24hPattern { - pub _1m: MetricPattern1, - pub _1w: MetricPattern1, - pub _1y: MetricPattern1, - pub _24h: MetricPattern1, + pub _1m: SeriesPattern1, + pub _1w: SeriesPattern1, + pub _1y: SeriesPattern1, + pub _24h: SeriesPattern1, } impl _1m1w1y24hPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - _1m: MetricPattern1::new(client.clone(), _m(&acc, "1m")), - _1w: MetricPattern1::new(client.clone(), _m(&acc, "1w")), - _1y: MetricPattern1::new(client.clone(), _m(&acc, "1y")), - _24h: MetricPattern1::new(client.clone(), _m(&acc, "24h")), + _1m: SeriesPattern1::new(client.clone(), _m(&acc, "1m")), + _1w: SeriesPattern1::new(client.clone(), _m(&acc, "1w")), + _1y: SeriesPattern1::new(client.clone(), _m(&acc, "1y")), + _24h: SeriesPattern1::new(client.clone(), _m(&acc, "24h")), } } } @@ -2257,7 +2257,7 @@ pub struct BaseCumulativeSumPattern4 { } impl BaseCumulativeSumPattern4 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { base: BtcCentsSatsUsdPattern::new(client.clone(), acc.clone()), @@ -2269,17 +2269,17 @@ impl BaseCumulativeSumPattern4 { /// Pattern struct for repeated tree structure. pub struct BaseCumulativeRelPattern { - pub base: MetricPattern1, - pub cumulative: MetricPattern1, + pub base: SeriesPattern1, + pub cumulative: SeriesPattern1, pub rel_to_rcap: BpsPercentRatioPattern4, } impl BaseCumulativeRelPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - base: MetricPattern1::new(client.clone(), acc.clone()), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + base: SeriesPattern1::new(client.clone(), acc.clone()), + cumulative: SeriesPattern1::new(client.clone(), _m(&acc, "cumulative")), rel_to_rcap: BpsPercentRatioPattern4::new(client.clone(), _m(&acc, "rel_to_rcap")), } } @@ -2293,7 +2293,7 @@ pub struct BaseCumulativeSumPattern3 { } impl BaseCumulativeSumPattern3 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), acc.clone()), @@ -2305,17 +2305,17 @@ impl BaseCumulativeSumPattern3 { /// Pattern struct for repeated tree structure. pub struct BaseCumulativeSumPattern2 { - pub base: MetricPattern1, - pub cumulative: MetricPattern1, + pub base: SeriesPattern1, + pub cumulative: SeriesPattern1, pub sum: _1m1w1y24hPattern, } impl BaseCumulativeSumPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - base: MetricPattern1::new(client.clone(), acc.clone()), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + base: SeriesPattern1::new(client.clone(), acc.clone()), + cumulative: SeriesPattern1::new(client.clone(), _m(&acc, "cumulative")), sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sum")), } } @@ -2329,7 +2329,7 @@ pub struct BlocksDominanceRewardsPattern { } impl BlocksDominanceRewardsPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { blocks_mined: BaseCumulativeSumPattern2::new(client.clone(), _m(&acc, "blocks_mined")), @@ -2341,144 +2341,144 @@ impl BlocksDominanceRewardsPattern { /// Pattern struct for repeated tree structure. pub struct BpsPercentRatioPattern3 { - pub bps: MetricPattern1, - pub percent: MetricPattern1, - pub ratio: MetricPattern1, + pub bps: SeriesPattern1, + pub percent: SeriesPattern1, + pub ratio: SeriesPattern1, } impl BpsPercentRatioPattern3 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), - percent: MetricPattern1::new(client.clone(), acc.clone()), - ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), + bps: SeriesPattern1::new(client.clone(), _m(&acc, "bps")), + percent: SeriesPattern1::new(client.clone(), acc.clone()), + ratio: SeriesPattern1::new(client.clone(), _m(&acc, "ratio")), } } } /// Pattern struct for repeated tree structure. pub struct BpsPercentRatioPattern4 { - pub bps: MetricPattern1, - pub percent: MetricPattern1, - pub ratio: MetricPattern1, + pub bps: SeriesPattern1, + pub percent: SeriesPattern1, + pub ratio: SeriesPattern1, } impl BpsPercentRatioPattern4 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), - percent: MetricPattern1::new(client.clone(), acc.clone()), - ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), + bps: SeriesPattern1::new(client.clone(), _m(&acc, "bps")), + percent: SeriesPattern1::new(client.clone(), acc.clone()), + ratio: SeriesPattern1::new(client.clone(), _m(&acc, "ratio")), } } } /// Pattern struct for repeated tree structure. pub struct BpsPriceRatioPattern { - pub bps: MetricPattern1, + pub bps: SeriesPattern1, pub price: CentsSatsUsdPattern, - pub ratio: MetricPattern1, + pub ratio: SeriesPattern1, } impl BpsPriceRatioPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { - bps: MetricPattern1::new(client.clone(), _m(&acc, &format!("ratio_{disc}_bps", disc=disc))), + bps: SeriesPattern1::new(client.clone(), _m(&acc, &format!("ratio_{disc}_bps", disc=disc))), price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, &disc)), - ratio: MetricPattern1::new(client.clone(), _m(&acc, &format!("ratio_{disc}", disc=disc))), + ratio: SeriesPattern1::new(client.clone(), _m(&acc, &format!("ratio_{disc}", disc=disc))), } } } /// Pattern struct for repeated tree structure. pub struct BpsPercentRatioPattern5 { - pub bps: MetricPattern1, - pub percent: MetricPattern1, - pub ratio: MetricPattern1, + pub bps: SeriesPattern1, + pub percent: SeriesPattern1, + pub ratio: SeriesPattern1, } impl BpsPercentRatioPattern5 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), - percent: MetricPattern1::new(client.clone(), acc.clone()), - ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), + bps: SeriesPattern1::new(client.clone(), _m(&acc, "bps")), + percent: SeriesPattern1::new(client.clone(), acc.clone()), + ratio: SeriesPattern1::new(client.clone(), _m(&acc, "ratio")), } } } /// Pattern struct for repeated tree structure. pub struct BpsPercentRatioPattern { - pub bps: MetricPattern1, - pub percent: MetricPattern1, - pub ratio: MetricPattern1, + pub bps: SeriesPattern1, + pub percent: SeriesPattern1, + pub ratio: SeriesPattern1, } impl BpsPercentRatioPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), - percent: MetricPattern1::new(client.clone(), acc.clone()), - ratio: MetricPattern1::new(client.clone(), _m(&acc, "ratio")), + bps: SeriesPattern1::new(client.clone(), _m(&acc, "bps")), + percent: SeriesPattern1::new(client.clone(), acc.clone()), + ratio: SeriesPattern1::new(client.clone(), _m(&acc, "ratio")), } } } /// Pattern struct for repeated tree structure. pub struct CentsSatsUsdPattern3 { - pub cents: MetricPattern2, - pub sats: MetricPattern2, - pub usd: MetricPattern2, + pub cents: SeriesPattern2, + pub sats: SeriesPattern2, + pub usd: SeriesPattern2, } impl CentsSatsUsdPattern3 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - cents: MetricPattern2::new(client.clone(), _m(&acc, "cents")), - sats: MetricPattern2::new(client.clone(), _m(&acc, "sats")), - usd: MetricPattern2::new(client.clone(), acc.clone()), + cents: SeriesPattern2::new(client.clone(), _m(&acc, "cents")), + sats: SeriesPattern2::new(client.clone(), _m(&acc, "sats")), + usd: SeriesPattern2::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct CentsDeltaUsdPattern { - pub cents: MetricPattern1, + pub cents: SeriesPattern1, pub delta: AbsoluteRatePattern2, - pub usd: MetricPattern1, + pub usd: SeriesPattern1, } impl CentsDeltaUsdPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), delta: AbsoluteRatePattern2::new(client.clone(), _m(&acc, "delta")), - usd: MetricPattern1::new(client.clone(), acc.clone()), + usd: SeriesPattern1::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct CentsSatsUsdPattern { - pub cents: MetricPattern1, - pub sats: MetricPattern1, - pub usd: MetricPattern1, + pub cents: SeriesPattern1, + pub sats: SeriesPattern1, + pub usd: SeriesPattern1, } impl CentsSatsUsdPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - sats: MetricPattern1::new(client.clone(), _m(&acc, "sats")), - usd: MetricPattern1::new(client.clone(), acc.clone()), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), + sats: SeriesPattern1::new(client.clone(), _m(&acc, "sats")), + usd: SeriesPattern1::new(client.clone(), acc.clone()), } } } @@ -2491,7 +2491,7 @@ pub struct DeltaHalfTotalPattern { } impl DeltaHalfTotalPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { delta: AbsoluteRatePattern::new(client.clone(), _m(&acc, "delta")), @@ -2516,7 +2516,7 @@ pub struct LossNuplProfitPattern { } impl LossNuplProfitPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { loss: BaseCumulativeNegativeSumPattern::new(client.clone(), acc.clone(), "unrealized_loss".to_string()), @@ -2541,7 +2541,7 @@ pub struct NuplRealizedSupplyPattern { } impl NuplRealizedSupplyPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { nupl: BpsRatioPattern::new(client.clone(), _m(&acc, "nupl")), @@ -2566,7 +2566,7 @@ pub struct RatioValuePattern { } impl RatioValuePattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { ratio: _24hPattern::new(client.clone(), _m(&acc, "sopr_24h")), @@ -2580,33 +2580,33 @@ impl RatioValuePattern { pub struct _6bBlockTxPattern { pub _6b: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2, pub block: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2, - pub tx_index: MetricPattern19, + pub tx_index: SeriesPattern19, } impl _6bBlockTxPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { _6b: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2::new(client.clone(), _m(&acc, "6b")), block: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2::new(client.clone(), acc.clone()), - tx_index: MetricPattern19::new(client.clone(), acc.clone()), + tx_index: SeriesPattern19::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct BaseCumulativeSumPattern { - pub base: MetricPattern1, - pub cumulative: MetricPattern1, + pub base: SeriesPattern1, + pub cumulative: SeriesPattern1, pub sum: _1m1w1y24hPattern, } impl BaseCumulativeSumPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - base: MetricPattern1::new(client.clone(), acc.clone()), - cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")), + base: SeriesPattern1::new(client.clone(), acc.clone()), + cumulative: SeriesPattern1::new(client.clone(), _m(&acc, "cumulative")), sum: _1m1w1y24hPattern::new(client.clone(), _m(&acc, "sum")), } } @@ -2619,7 +2619,7 @@ pub struct AbsoluteRatePattern { } impl AbsoluteRatePattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { absolute: _1m1w1y24hPattern::new(client.clone(), acc.clone()), @@ -2635,7 +2635,7 @@ pub struct AbsoluteRatePattern2 { } impl AbsoluteRatePattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { absolute: _1m1w1y24hPattern3::new(client.clone(), acc.clone()), @@ -2651,7 +2651,7 @@ pub struct AllSthPattern2 { } impl AllSthPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { all: BtcCentsDeltaSatsUsdPattern::new(client.clone(), _m(&acc, "supply")), @@ -2662,16 +2662,16 @@ impl AllSthPattern2 { /// Pattern struct for repeated tree structure. pub struct AllSthPattern { - pub all: MetricPattern1, - pub sth: MetricPattern1, + pub all: SeriesPattern1, + pub sth: SeriesPattern1, } impl AllSthPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - all: MetricPattern1::new(client.clone(), _m(&acc, "realized_cap")), - sth: MetricPattern1::new(client.clone(), _m(&acc, "sth_realized_cap")), + all: SeriesPattern1::new(client.clone(), _m(&acc, "realized_cap")), + sth: SeriesPattern1::new(client.clone(), _m(&acc, "sth_realized_cap")), } } } @@ -2683,7 +2683,7 @@ pub struct BlocksDominancePattern { } impl BlocksDominancePattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { blocks_mined: BaseCumulativeSumPattern2::new(client.clone(), _m(&acc, "blocks_mined")), @@ -2694,64 +2694,64 @@ impl BlocksDominancePattern { /// Pattern struct for repeated tree structure. pub struct BpsRatioPattern2 { - pub bps: MetricPattern1, - pub ratio: MetricPattern1, + pub bps: SeriesPattern1, + pub ratio: SeriesPattern1, } impl BpsRatioPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), - ratio: MetricPattern1::new(client.clone(), acc.clone()), + bps: SeriesPattern1::new(client.clone(), _m(&acc, "bps")), + ratio: SeriesPattern1::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct BpsRatioPattern { - pub bps: MetricPattern1, - pub ratio: MetricPattern1, + pub bps: SeriesPattern1, + pub ratio: SeriesPattern1, } impl BpsRatioPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - bps: MetricPattern1::new(client.clone(), _m(&acc, "bps")), - ratio: MetricPattern1::new(client.clone(), acc.clone()), + bps: SeriesPattern1::new(client.clone(), _m(&acc, "bps")), + ratio: SeriesPattern1::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct CentsUsdPattern2 { - pub cents: MetricPattern1, - pub usd: MetricPattern1, + pub cents: SeriesPattern1, + pub usd: SeriesPattern1, } impl CentsUsdPattern2 { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - usd: MetricPattern1::new(client.clone(), acc.clone()), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), + usd: SeriesPattern1::new(client.clone(), acc.clone()), } } } /// Pattern struct for repeated tree structure. pub struct CentsUsdPattern { - pub cents: MetricPattern1, - pub usd: MetricPattern1, + pub cents: SeriesPattern1, + pub usd: SeriesPattern1, } impl CentsUsdPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - cents: MetricPattern1::new(client.clone(), _m(&acc, "cents")), - usd: MetricPattern1::new(client.clone(), acc.clone()), + cents: SeriesPattern1::new(client.clone(), _m(&acc, "cents")), + usd: SeriesPattern1::new(client.clone(), acc.clone()), } } } @@ -2763,7 +2763,7 @@ pub struct CoindaysSentPattern { } impl CoindaysSentPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { coindays_destroyed: BaseCumulativeSumPattern::new(client.clone(), _m(&acc, "coindays_destroyed")), @@ -2775,15 +2775,15 @@ impl CoindaysSentPattern { /// Pattern struct for repeated tree structure. pub struct DeltaInnerPattern { pub delta: AbsoluteRatePattern, - pub inner: MetricPattern1, + pub inner: SeriesPattern1, } impl DeltaInnerPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { delta: AbsoluteRatePattern::new(client.clone(), _m(&acc, "delta")), - inner: MetricPattern1::new(client.clone(), acc.clone()), + inner: SeriesPattern1::new(client.clone(), acc.clone()), } } } @@ -2795,7 +2795,7 @@ pub struct InPattern { } impl InPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { in_loss: CentsUsdPattern2::new(client.clone(), _m(&acc, "loss")), @@ -2807,15 +2807,15 @@ impl InPattern { /// Pattern struct for repeated tree structure. pub struct PriceRatioPattern { pub price: CentsSatsUsdPattern, - pub ratio: MetricPattern1, + pub ratio: SeriesPattern1, } impl PriceRatioPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String, disc: String) -> Self { Self { price: CentsSatsUsdPattern::new(client.clone(), _m(&acc, &disc)), - ratio: MetricPattern1::new(client.clone(), _m(&acc, &format!("ratio_{disc}", disc=disc))), + ratio: SeriesPattern1::new(client.clone(), _m(&acc, &format!("ratio_{disc}", disc=disc))), } } } @@ -2827,7 +2827,7 @@ pub struct RelPattern { } impl RelPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { rel_to_mcap: BpsPercentRatioPattern::new(client.clone(), _m(&acc, "mcap")), @@ -2838,8 +2838,8 @@ impl RelPattern { /// Pattern struct for repeated tree structure. pub struct SdSmaPattern { - pub sd: MetricPattern1, - pub sma: MetricPattern1, + pub sd: SeriesPattern1, + pub sma: SeriesPattern1, } /// Pattern struct for repeated tree structure. @@ -2849,7 +2849,7 @@ pub struct ValuePattern { } impl ValuePattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { value_created: BaseCumulativeSumPattern::new(client.clone(), _m(&acc, "created")), @@ -2860,14 +2860,14 @@ impl ValuePattern { /// Pattern struct for repeated tree structure. pub struct _24hPattern { - pub _24h: MetricPattern1, + pub _24h: SeriesPattern1, } impl _24hPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { - _24h: MetricPattern1::new(client.clone(), acc.clone()), + _24h: SeriesPattern1::new(client.clone(), acc.clone()), } } } @@ -2878,7 +2878,7 @@ pub struct NuplPattern { } impl NuplPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { nupl: BpsRatioPattern::new(client.clone(), acc.clone()), @@ -2892,7 +2892,7 @@ pub struct UnspentPattern { } impl UnspentPattern { - /// Create a new pattern node with accumulated metric name. + /// Create a new pattern node with accumulated series name. pub fn new(client: Arc, acc: String) -> Self { Self { unspent_count: DeltaInnerPattern::new(client.clone(), acc.clone()), @@ -2900,128 +2900,128 @@ impl UnspentPattern { } } -// Metrics tree +// Series tree -/// Metrics tree node. -pub struct MetricsTree { - pub blocks: MetricsTree_Blocks, - pub transactions: MetricsTree_Transactions, - pub inputs: MetricsTree_Inputs, - pub outputs: MetricsTree_Outputs, - pub addresses: MetricsTree_Addresses, - pub scripts: MetricsTree_Scripts, - pub mining: MetricsTree_Mining, - pub cointime: MetricsTree_Cointime, - pub constants: MetricsTree_Constants, - pub indexes: MetricsTree_Indexes, - pub indicators: MetricsTree_Indicators, - pub market: MetricsTree_Market, - pub pools: MetricsTree_Pools, - pub prices: MetricsTree_Prices, - pub supply: MetricsTree_Supply, - pub cohorts: MetricsTree_Cohorts, +/// Series tree node. +pub struct SeriesTree { + pub blocks: SeriesTree_Blocks, + pub transactions: SeriesTree_Transactions, + pub inputs: SeriesTree_Inputs, + pub outputs: SeriesTree_Outputs, + pub addresses: SeriesTree_Addresses, + pub scripts: SeriesTree_Scripts, + pub mining: SeriesTree_Mining, + pub cointime: SeriesTree_Cointime, + pub constants: SeriesTree_Constants, + pub indexes: SeriesTree_Indexes, + pub indicators: SeriesTree_Indicators, + pub market: SeriesTree_Market, + pub pools: SeriesTree_Pools, + pub prices: SeriesTree_Prices, + pub supply: SeriesTree_Supply, + pub cohorts: SeriesTree_Cohorts, } -impl MetricsTree { +impl SeriesTree { pub fn new(client: Arc, base_path: String) -> Self { Self { - blocks: MetricsTree_Blocks::new(client.clone(), format!("{base_path}_blocks")), - transactions: MetricsTree_Transactions::new(client.clone(), format!("{base_path}_transactions")), - inputs: MetricsTree_Inputs::new(client.clone(), format!("{base_path}_inputs")), - outputs: MetricsTree_Outputs::new(client.clone(), format!("{base_path}_outputs")), - addresses: MetricsTree_Addresses::new(client.clone(), format!("{base_path}_addresses")), - scripts: MetricsTree_Scripts::new(client.clone(), format!("{base_path}_scripts")), - mining: MetricsTree_Mining::new(client.clone(), format!("{base_path}_mining")), - cointime: MetricsTree_Cointime::new(client.clone(), format!("{base_path}_cointime")), - constants: MetricsTree_Constants::new(client.clone(), format!("{base_path}_constants")), - indexes: MetricsTree_Indexes::new(client.clone(), format!("{base_path}_indexes")), - indicators: MetricsTree_Indicators::new(client.clone(), format!("{base_path}_indicators")), - market: MetricsTree_Market::new(client.clone(), format!("{base_path}_market")), - pools: MetricsTree_Pools::new(client.clone(), format!("{base_path}_pools")), - prices: MetricsTree_Prices::new(client.clone(), format!("{base_path}_prices")), - supply: MetricsTree_Supply::new(client.clone(), format!("{base_path}_supply")), - cohorts: MetricsTree_Cohorts::new(client.clone(), format!("{base_path}_cohorts")), + blocks: SeriesTree_Blocks::new(client.clone(), format!("{base_path}_blocks")), + transactions: SeriesTree_Transactions::new(client.clone(), format!("{base_path}_transactions")), + inputs: SeriesTree_Inputs::new(client.clone(), format!("{base_path}_inputs")), + outputs: SeriesTree_Outputs::new(client.clone(), format!("{base_path}_outputs")), + addresses: SeriesTree_Addresses::new(client.clone(), format!("{base_path}_addresses")), + scripts: SeriesTree_Scripts::new(client.clone(), format!("{base_path}_scripts")), + mining: SeriesTree_Mining::new(client.clone(), format!("{base_path}_mining")), + cointime: SeriesTree_Cointime::new(client.clone(), format!("{base_path}_cointime")), + constants: SeriesTree_Constants::new(client.clone(), format!("{base_path}_constants")), + indexes: SeriesTree_Indexes::new(client.clone(), format!("{base_path}_indexes")), + indicators: SeriesTree_Indicators::new(client.clone(), format!("{base_path}_indicators")), + market: SeriesTree_Market::new(client.clone(), format!("{base_path}_market")), + pools: SeriesTree_Pools::new(client.clone(), format!("{base_path}_pools")), + prices: SeriesTree_Prices::new(client.clone(), format!("{base_path}_prices")), + supply: SeriesTree_Supply::new(client.clone(), format!("{base_path}_supply")), + cohorts: SeriesTree_Cohorts::new(client.clone(), format!("{base_path}_cohorts")), } } } -/// Metrics tree node. -pub struct MetricsTree_Blocks { - pub blockhash: MetricPattern18, - pub difficulty: MetricsTree_Blocks_Difficulty, - pub time: MetricsTree_Blocks_Time, - pub size: MetricsTree_Blocks_Size, - pub weight: MetricsTree_Blocks_Weight, - pub count: MetricsTree_Blocks_Count, - pub lookback: MetricsTree_Blocks_Lookback, +/// Series tree node. +pub struct SeriesTree_Blocks { + pub blockhash: SeriesPattern18, + pub difficulty: SeriesTree_Blocks_Difficulty, + pub time: SeriesTree_Blocks_Time, + pub size: SeriesTree_Blocks_Size, + pub weight: SeriesTree_Blocks_Weight, + pub count: SeriesTree_Blocks_Count, + pub lookback: SeriesTree_Blocks_Lookback, pub interval: _1m1w1y24hHeightPattern, pub vbytes: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub fullness: MetricsTree_Blocks_Fullness, - pub halving: MetricsTree_Blocks_Halving, + pub fullness: SeriesTree_Blocks_Fullness, + pub halving: SeriesTree_Blocks_Halving, } -impl MetricsTree_Blocks { +impl SeriesTree_Blocks { pub fn new(client: Arc, base_path: String) -> Self { Self { - blockhash: MetricPattern18::new(client.clone(), "blockhash".to_string()), - difficulty: MetricsTree_Blocks_Difficulty::new(client.clone(), format!("{base_path}_difficulty")), - time: MetricsTree_Blocks_Time::new(client.clone(), format!("{base_path}_time")), - size: MetricsTree_Blocks_Size::new(client.clone(), format!("{base_path}_size")), - weight: MetricsTree_Blocks_Weight::new(client.clone(), format!("{base_path}_weight")), - count: MetricsTree_Blocks_Count::new(client.clone(), format!("{base_path}_count")), - lookback: MetricsTree_Blocks_Lookback::new(client.clone(), format!("{base_path}_lookback")), + blockhash: SeriesPattern18::new(client.clone(), "blockhash".to_string()), + difficulty: SeriesTree_Blocks_Difficulty::new(client.clone(), format!("{base_path}_difficulty")), + time: SeriesTree_Blocks_Time::new(client.clone(), format!("{base_path}_time")), + size: SeriesTree_Blocks_Size::new(client.clone(), format!("{base_path}_size")), + weight: SeriesTree_Blocks_Weight::new(client.clone(), format!("{base_path}_weight")), + count: SeriesTree_Blocks_Count::new(client.clone(), format!("{base_path}_count")), + lookback: SeriesTree_Blocks_Lookback::new(client.clone(), format!("{base_path}_lookback")), interval: _1m1w1y24hHeightPattern::new(client.clone(), "block_interval".to_string()), vbytes: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "block_vbytes".to_string()), - fullness: MetricsTree_Blocks_Fullness::new(client.clone(), format!("{base_path}_fullness")), - halving: MetricsTree_Blocks_Halving::new(client.clone(), format!("{base_path}_halving")), + fullness: SeriesTree_Blocks_Fullness::new(client.clone(), format!("{base_path}_fullness")), + halving: SeriesTree_Blocks_Halving::new(client.clone(), format!("{base_path}_halving")), } } } -/// Metrics tree node. -pub struct MetricsTree_Blocks_Difficulty { - pub value: MetricPattern1, - pub as_hash: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Blocks_Difficulty { + pub value: SeriesPattern1, + pub as_hash: SeriesPattern1, pub adjustment: BpsPercentRatioPattern, - pub epoch: MetricPattern1, - pub blocks_before_next: MetricPattern1, - pub days_before_next: MetricPattern1, + pub epoch: SeriesPattern1, + pub blocks_before_next: SeriesPattern1, + pub days_before_next: SeriesPattern1, } -impl MetricsTree_Blocks_Difficulty { +impl SeriesTree_Blocks_Difficulty { pub fn new(client: Arc, base_path: String) -> Self { Self { - value: MetricPattern1::new(client.clone(), "difficulty".to_string()), - as_hash: MetricPattern1::new(client.clone(), "difficulty_as_hash".to_string()), + value: SeriesPattern1::new(client.clone(), "difficulty".to_string()), + as_hash: SeriesPattern1::new(client.clone(), "difficulty_as_hash".to_string()), adjustment: BpsPercentRatioPattern::new(client.clone(), "difficulty_adjustment".to_string()), - epoch: MetricPattern1::new(client.clone(), "difficulty_epoch".to_string()), - blocks_before_next: MetricPattern1::new(client.clone(), "blocks_before_next_difficulty_adjustment".to_string()), - days_before_next: MetricPattern1::new(client.clone(), "days_before_next_difficulty_adjustment".to_string()), + epoch: SeriesPattern1::new(client.clone(), "difficulty_epoch".to_string()), + blocks_before_next: SeriesPattern1::new(client.clone(), "blocks_before_next_difficulty_adjustment".to_string()), + days_before_next: SeriesPattern1::new(client.clone(), "days_before_next_difficulty_adjustment".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Blocks_Time { - pub timestamp: MetricPattern1, - pub date: MetricPattern18, - pub timestamp_monotonic: MetricPattern18, +/// Series tree node. +pub struct SeriesTree_Blocks_Time { + pub timestamp: SeriesPattern1, + pub date: SeriesPattern18, + pub timestamp_monotonic: SeriesPattern18, } -impl MetricsTree_Blocks_Time { +impl SeriesTree_Blocks_Time { pub fn new(client: Arc, base_path: String) -> Self { Self { - timestamp: MetricPattern1::new(client.clone(), "timestamp".to_string()), - date: MetricPattern18::new(client.clone(), "date".to_string()), - timestamp_monotonic: MetricPattern18::new(client.clone(), "timestamp_monotonic".to_string()), + timestamp: SeriesPattern1::new(client.clone(), "timestamp".to_string()), + date: SeriesPattern18::new(client.clone(), "date".to_string()), + timestamp_monotonic: SeriesPattern18::new(client.clone(), "timestamp_monotonic".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Blocks_Size { - pub total: MetricPattern18, - pub cumulative: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Blocks_Size { + pub total: SeriesPattern18, + pub cumulative: SeriesPattern1, pub sum: _1m1w1y24hPattern, pub average: _1m1w1y24hPattern, pub min: _1m1w1y24hPattern, @@ -3033,11 +3033,11 @@ pub struct MetricsTree_Blocks_Size { pub pct90: _1m1w1y24hPattern, } -impl MetricsTree_Blocks_Size { +impl SeriesTree_Blocks_Size { pub fn new(client: Arc, base_path: String) -> Self { Self { - total: MetricPattern18::new(client.clone(), "total_size".to_string()), - cumulative: MetricPattern1::new(client.clone(), "block_size_cumulative".to_string()), + total: SeriesPattern18::new(client.clone(), "total_size".to_string()), + cumulative: SeriesPattern1::new(client.clone(), "block_size_cumulative".to_string()), sum: _1m1w1y24hPattern::new(client.clone(), "block_size_sum".to_string()), average: _1m1w1y24hPattern::new(client.clone(), "block_size_average".to_string()), min: _1m1w1y24hPattern::new(client.clone(), "block_size_min".to_string()), @@ -3051,10 +3051,10 @@ impl MetricsTree_Blocks_Size { } } -/// Metrics tree node. -pub struct MetricsTree_Blocks_Weight { - pub raw: MetricPattern18, - pub cumulative: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Blocks_Weight { + pub raw: SeriesPattern18, + pub cumulative: SeriesPattern1, pub sum: _1m1w1y24hPattern, pub average: _1m1w1y24hPattern, pub min: _1m1w1y24hPattern, @@ -3066,11 +3066,11 @@ pub struct MetricsTree_Blocks_Weight { pub pct90: _1m1w1y24hPattern, } -impl MetricsTree_Blocks_Weight { +impl SeriesTree_Blocks_Weight { pub fn new(client: Arc, base_path: String) -> Self { Self { - raw: MetricPattern18::new(client.clone(), "block_weight".to_string()), - cumulative: MetricPattern1::new(client.clone(), "block_weight_cumulative".to_string()), + raw: SeriesPattern18::new(client.clone(), "block_weight".to_string()), + cumulative: SeriesPattern1::new(client.clone(), "block_weight_cumulative".to_string()), sum: _1m1w1y24hPattern::new(client.clone(), "block_weight_sum".to_string()), average: _1m1w1y24hPattern::new(client.clone(), "block_weight_average".to_string()), min: _1m1w1y24hPattern::new(client.clone(), "block_weight_min".to_string()), @@ -3084,228 +3084,228 @@ impl MetricsTree_Blocks_Weight { } } -/// Metrics tree node. -pub struct MetricsTree_Blocks_Count { - pub target: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Blocks_Count { + pub target: SeriesPattern1, pub total: BaseCumulativeSumPattern2, } -impl MetricsTree_Blocks_Count { +impl SeriesTree_Blocks_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { - target: MetricPattern1::new(client.clone(), "block_count_target".to_string()), + target: SeriesPattern1::new(client.clone(), "block_count_target".to_string()), total: BaseCumulativeSumPattern2::new(client.clone(), "block_count".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Blocks_Lookback { - pub _1h: MetricPattern18, - pub _24h: MetricPattern18, - pub _3d: MetricPattern18, - pub _1w: MetricPattern18, - pub _8d: MetricPattern18, - pub _9d: MetricPattern18, - pub _12d: MetricPattern18, - pub _13d: MetricPattern18, - pub _2w: MetricPattern18, - pub _21d: MetricPattern18, - pub _26d: MetricPattern18, - pub _1m: MetricPattern18, - pub _34d: MetricPattern18, - pub _55d: MetricPattern18, - pub _2m: MetricPattern18, - pub _9w: MetricPattern18, - pub _12w: MetricPattern18, - pub _89d: MetricPattern18, - pub _3m: MetricPattern18, - pub _14w: MetricPattern18, - pub _111d: MetricPattern18, - pub _144d: MetricPattern18, - pub _6m: MetricPattern18, - pub _26w: MetricPattern18, - pub _200d: MetricPattern18, - pub _9m: MetricPattern18, - pub _350d: MetricPattern18, - pub _12m: MetricPattern18, - pub _1y: MetricPattern18, - pub _14m: MetricPattern18, - pub _2y: MetricPattern18, - pub _26m: MetricPattern18, - pub _3y: MetricPattern18, - pub _200w: MetricPattern18, - pub _4y: MetricPattern18, - pub _5y: MetricPattern18, - pub _6y: MetricPattern18, - pub _8y: MetricPattern18, - pub _9y: MetricPattern18, - pub _10y: MetricPattern18, - pub _12y: MetricPattern18, - pub _14y: MetricPattern18, - pub _26y: MetricPattern18, +/// Series tree node. +pub struct SeriesTree_Blocks_Lookback { + pub _1h: SeriesPattern18, + pub _24h: SeriesPattern18, + pub _3d: SeriesPattern18, + pub _1w: SeriesPattern18, + pub _8d: SeriesPattern18, + pub _9d: SeriesPattern18, + pub _12d: SeriesPattern18, + pub _13d: SeriesPattern18, + pub _2w: SeriesPattern18, + pub _21d: SeriesPattern18, + pub _26d: SeriesPattern18, + pub _1m: SeriesPattern18, + pub _34d: SeriesPattern18, + pub _55d: SeriesPattern18, + pub _2m: SeriesPattern18, + pub _9w: SeriesPattern18, + pub _12w: SeriesPattern18, + pub _89d: SeriesPattern18, + pub _3m: SeriesPattern18, + pub _14w: SeriesPattern18, + pub _111d: SeriesPattern18, + pub _144d: SeriesPattern18, + pub _6m: SeriesPattern18, + pub _26w: SeriesPattern18, + pub _200d: SeriesPattern18, + pub _9m: SeriesPattern18, + pub _350d: SeriesPattern18, + pub _12m: SeriesPattern18, + pub _1y: SeriesPattern18, + pub _14m: SeriesPattern18, + pub _2y: SeriesPattern18, + pub _26m: SeriesPattern18, + pub _3y: SeriesPattern18, + pub _200w: SeriesPattern18, + pub _4y: SeriesPattern18, + pub _5y: SeriesPattern18, + pub _6y: SeriesPattern18, + pub _8y: SeriesPattern18, + pub _9y: SeriesPattern18, + pub _10y: SeriesPattern18, + pub _12y: SeriesPattern18, + pub _14y: SeriesPattern18, + pub _26y: SeriesPattern18, } -impl MetricsTree_Blocks_Lookback { +impl SeriesTree_Blocks_Lookback { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1h: MetricPattern18::new(client.clone(), "height_1h_ago".to_string()), - _24h: MetricPattern18::new(client.clone(), "height_24h_ago".to_string()), - _3d: MetricPattern18::new(client.clone(), "height_3d_ago".to_string()), - _1w: MetricPattern18::new(client.clone(), "height_1w_ago".to_string()), - _8d: MetricPattern18::new(client.clone(), "height_8d_ago".to_string()), - _9d: MetricPattern18::new(client.clone(), "height_9d_ago".to_string()), - _12d: MetricPattern18::new(client.clone(), "height_12d_ago".to_string()), - _13d: MetricPattern18::new(client.clone(), "height_13d_ago".to_string()), - _2w: MetricPattern18::new(client.clone(), "height_2w_ago".to_string()), - _21d: MetricPattern18::new(client.clone(), "height_21d_ago".to_string()), - _26d: MetricPattern18::new(client.clone(), "height_26d_ago".to_string()), - _1m: MetricPattern18::new(client.clone(), "height_1m_ago".to_string()), - _34d: MetricPattern18::new(client.clone(), "height_34d_ago".to_string()), - _55d: MetricPattern18::new(client.clone(), "height_55d_ago".to_string()), - _2m: MetricPattern18::new(client.clone(), "height_2m_ago".to_string()), - _9w: MetricPattern18::new(client.clone(), "height_9w_ago".to_string()), - _12w: MetricPattern18::new(client.clone(), "height_12w_ago".to_string()), - _89d: MetricPattern18::new(client.clone(), "height_89d_ago".to_string()), - _3m: MetricPattern18::new(client.clone(), "height_3m_ago".to_string()), - _14w: MetricPattern18::new(client.clone(), "height_14w_ago".to_string()), - _111d: MetricPattern18::new(client.clone(), "height_111d_ago".to_string()), - _144d: MetricPattern18::new(client.clone(), "height_144d_ago".to_string()), - _6m: MetricPattern18::new(client.clone(), "height_6m_ago".to_string()), - _26w: MetricPattern18::new(client.clone(), "height_26w_ago".to_string()), - _200d: MetricPattern18::new(client.clone(), "height_200d_ago".to_string()), - _9m: MetricPattern18::new(client.clone(), "height_9m_ago".to_string()), - _350d: MetricPattern18::new(client.clone(), "height_350d_ago".to_string()), - _12m: MetricPattern18::new(client.clone(), "height_12m_ago".to_string()), - _1y: MetricPattern18::new(client.clone(), "height_1y_ago".to_string()), - _14m: MetricPattern18::new(client.clone(), "height_14m_ago".to_string()), - _2y: MetricPattern18::new(client.clone(), "height_2y_ago".to_string()), - _26m: MetricPattern18::new(client.clone(), "height_26m_ago".to_string()), - _3y: MetricPattern18::new(client.clone(), "height_3y_ago".to_string()), - _200w: MetricPattern18::new(client.clone(), "height_200w_ago".to_string()), - _4y: MetricPattern18::new(client.clone(), "height_4y_ago".to_string()), - _5y: MetricPattern18::new(client.clone(), "height_5y_ago".to_string()), - _6y: MetricPattern18::new(client.clone(), "height_6y_ago".to_string()), - _8y: MetricPattern18::new(client.clone(), "height_8y_ago".to_string()), - _9y: MetricPattern18::new(client.clone(), "height_9y_ago".to_string()), - _10y: MetricPattern18::new(client.clone(), "height_10y_ago".to_string()), - _12y: MetricPattern18::new(client.clone(), "height_12y_ago".to_string()), - _14y: MetricPattern18::new(client.clone(), "height_14y_ago".to_string()), - _26y: MetricPattern18::new(client.clone(), "height_26y_ago".to_string()), + _1h: SeriesPattern18::new(client.clone(), "height_1h_ago".to_string()), + _24h: SeriesPattern18::new(client.clone(), "height_24h_ago".to_string()), + _3d: SeriesPattern18::new(client.clone(), "height_3d_ago".to_string()), + _1w: SeriesPattern18::new(client.clone(), "height_1w_ago".to_string()), + _8d: SeriesPattern18::new(client.clone(), "height_8d_ago".to_string()), + _9d: SeriesPattern18::new(client.clone(), "height_9d_ago".to_string()), + _12d: SeriesPattern18::new(client.clone(), "height_12d_ago".to_string()), + _13d: SeriesPattern18::new(client.clone(), "height_13d_ago".to_string()), + _2w: SeriesPattern18::new(client.clone(), "height_2w_ago".to_string()), + _21d: SeriesPattern18::new(client.clone(), "height_21d_ago".to_string()), + _26d: SeriesPattern18::new(client.clone(), "height_26d_ago".to_string()), + _1m: SeriesPattern18::new(client.clone(), "height_1m_ago".to_string()), + _34d: SeriesPattern18::new(client.clone(), "height_34d_ago".to_string()), + _55d: SeriesPattern18::new(client.clone(), "height_55d_ago".to_string()), + _2m: SeriesPattern18::new(client.clone(), "height_2m_ago".to_string()), + _9w: SeriesPattern18::new(client.clone(), "height_9w_ago".to_string()), + _12w: SeriesPattern18::new(client.clone(), "height_12w_ago".to_string()), + _89d: SeriesPattern18::new(client.clone(), "height_89d_ago".to_string()), + _3m: SeriesPattern18::new(client.clone(), "height_3m_ago".to_string()), + _14w: SeriesPattern18::new(client.clone(), "height_14w_ago".to_string()), + _111d: SeriesPattern18::new(client.clone(), "height_111d_ago".to_string()), + _144d: SeriesPattern18::new(client.clone(), "height_144d_ago".to_string()), + _6m: SeriesPattern18::new(client.clone(), "height_6m_ago".to_string()), + _26w: SeriesPattern18::new(client.clone(), "height_26w_ago".to_string()), + _200d: SeriesPattern18::new(client.clone(), "height_200d_ago".to_string()), + _9m: SeriesPattern18::new(client.clone(), "height_9m_ago".to_string()), + _350d: SeriesPattern18::new(client.clone(), "height_350d_ago".to_string()), + _12m: SeriesPattern18::new(client.clone(), "height_12m_ago".to_string()), + _1y: SeriesPattern18::new(client.clone(), "height_1y_ago".to_string()), + _14m: SeriesPattern18::new(client.clone(), "height_14m_ago".to_string()), + _2y: SeriesPattern18::new(client.clone(), "height_2y_ago".to_string()), + _26m: SeriesPattern18::new(client.clone(), "height_26m_ago".to_string()), + _3y: SeriesPattern18::new(client.clone(), "height_3y_ago".to_string()), + _200w: SeriesPattern18::new(client.clone(), "height_200w_ago".to_string()), + _4y: SeriesPattern18::new(client.clone(), "height_4y_ago".to_string()), + _5y: SeriesPattern18::new(client.clone(), "height_5y_ago".to_string()), + _6y: SeriesPattern18::new(client.clone(), "height_6y_ago".to_string()), + _8y: SeriesPattern18::new(client.clone(), "height_8y_ago".to_string()), + _9y: SeriesPattern18::new(client.clone(), "height_9y_ago".to_string()), + _10y: SeriesPattern18::new(client.clone(), "height_10y_ago".to_string()), + _12y: SeriesPattern18::new(client.clone(), "height_12y_ago".to_string()), + _14y: SeriesPattern18::new(client.clone(), "height_14y_ago".to_string()), + _26y: SeriesPattern18::new(client.clone(), "height_26y_ago".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Blocks_Fullness { +/// Series tree node. +pub struct SeriesTree_Blocks_Fullness { pub bps: _1m1w1y24hHeightPattern, - pub ratio: MetricPattern1, - pub percent: MetricPattern1, + pub ratio: SeriesPattern1, + pub percent: SeriesPattern1, } -impl MetricsTree_Blocks_Fullness { +impl SeriesTree_Blocks_Fullness { pub fn new(client: Arc, base_path: String) -> Self { Self { bps: _1m1w1y24hHeightPattern::new(client.clone(), "block_fullness_bps".to_string()), - ratio: MetricPattern1::new(client.clone(), "block_fullness_ratio".to_string()), - percent: MetricPattern1::new(client.clone(), "block_fullness".to_string()), + ratio: SeriesPattern1::new(client.clone(), "block_fullness_ratio".to_string()), + percent: SeriesPattern1::new(client.clone(), "block_fullness".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Blocks_Halving { - pub epoch: MetricPattern1, - pub blocks_before_next: MetricPattern1, - pub days_before_next: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Blocks_Halving { + pub epoch: SeriesPattern1, + pub blocks_before_next: SeriesPattern1, + pub days_before_next: SeriesPattern1, } -impl MetricsTree_Blocks_Halving { +impl SeriesTree_Blocks_Halving { pub fn new(client: Arc, base_path: String) -> Self { Self { - epoch: MetricPattern1::new(client.clone(), "halving_epoch".to_string()), - blocks_before_next: MetricPattern1::new(client.clone(), "blocks_before_next_halving".to_string()), - days_before_next: MetricPattern1::new(client.clone(), "days_before_next_halving".to_string()), + epoch: SeriesPattern1::new(client.clone(), "halving_epoch".to_string()), + blocks_before_next: SeriesPattern1::new(client.clone(), "blocks_before_next_halving".to_string()), + days_before_next: SeriesPattern1::new(client.clone(), "days_before_next_halving".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Transactions { - pub raw: MetricsTree_Transactions_Raw, - pub count: MetricsTree_Transactions_Count, - pub size: MetricsTree_Transactions_Size, - pub fees: MetricsTree_Transactions_Fees, - pub versions: MetricsTree_Transactions_Versions, - pub volume: MetricsTree_Transactions_Volume, +/// Series tree node. +pub struct SeriesTree_Transactions { + pub raw: SeriesTree_Transactions_Raw, + pub count: SeriesTree_Transactions_Count, + pub size: SeriesTree_Transactions_Size, + pub fees: SeriesTree_Transactions_Fees, + pub versions: SeriesTree_Transactions_Versions, + pub volume: SeriesTree_Transactions_Volume, } -impl MetricsTree_Transactions { +impl SeriesTree_Transactions { pub fn new(client: Arc, base_path: String) -> Self { Self { - raw: MetricsTree_Transactions_Raw::new(client.clone(), format!("{base_path}_raw")), - count: MetricsTree_Transactions_Count::new(client.clone(), format!("{base_path}_count")), - size: MetricsTree_Transactions_Size::new(client.clone(), format!("{base_path}_size")), - fees: MetricsTree_Transactions_Fees::new(client.clone(), format!("{base_path}_fees")), - versions: MetricsTree_Transactions_Versions::new(client.clone(), format!("{base_path}_versions")), - volume: MetricsTree_Transactions_Volume::new(client.clone(), format!("{base_path}_volume")), + raw: SeriesTree_Transactions_Raw::new(client.clone(), format!("{base_path}_raw")), + count: SeriesTree_Transactions_Count::new(client.clone(), format!("{base_path}_count")), + size: SeriesTree_Transactions_Size::new(client.clone(), format!("{base_path}_size")), + fees: SeriesTree_Transactions_Fees::new(client.clone(), format!("{base_path}_fees")), + versions: SeriesTree_Transactions_Versions::new(client.clone(), format!("{base_path}_versions")), + volume: SeriesTree_Transactions_Volume::new(client.clone(), format!("{base_path}_volume")), } } } -/// Metrics tree node. -pub struct MetricsTree_Transactions_Raw { - pub first_tx_index: MetricPattern18, - pub height: MetricPattern19, - pub txid: MetricPattern19, - pub tx_version: MetricPattern19, - pub raw_locktime: MetricPattern19, - pub base_size: MetricPattern19, - pub total_size: MetricPattern19, - pub is_explicitly_rbf: MetricPattern19, - pub first_txin_index: MetricPattern19, - pub first_txout_index: MetricPattern19, +/// Series tree node. +pub struct SeriesTree_Transactions_Raw { + pub first_tx_index: SeriesPattern18, + pub height: SeriesPattern19, + pub txid: SeriesPattern19, + pub tx_version: SeriesPattern19, + pub raw_locktime: SeriesPattern19, + pub base_size: SeriesPattern19, + pub total_size: SeriesPattern19, + pub is_explicitly_rbf: SeriesPattern19, + pub first_txin_index: SeriesPattern19, + pub first_txout_index: SeriesPattern19, } -impl MetricsTree_Transactions_Raw { +impl SeriesTree_Transactions_Raw { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_tx_index: MetricPattern18::new(client.clone(), "first_tx_index".to_string()), - height: MetricPattern19::new(client.clone(), "height".to_string()), - txid: MetricPattern19::new(client.clone(), "txid".to_string()), - tx_version: MetricPattern19::new(client.clone(), "tx_version".to_string()), - raw_locktime: MetricPattern19::new(client.clone(), "raw_locktime".to_string()), - base_size: MetricPattern19::new(client.clone(), "base_size".to_string()), - total_size: MetricPattern19::new(client.clone(), "total_size".to_string()), - is_explicitly_rbf: MetricPattern19::new(client.clone(), "is_explicitly_rbf".to_string()), - first_txin_index: MetricPattern19::new(client.clone(), "first_txin_index".to_string()), - first_txout_index: MetricPattern19::new(client.clone(), "first_txout_index".to_string()), + first_tx_index: SeriesPattern18::new(client.clone(), "first_tx_index".to_string()), + height: SeriesPattern19::new(client.clone(), "height".to_string()), + txid: SeriesPattern19::new(client.clone(), "txid".to_string()), + tx_version: SeriesPattern19::new(client.clone(), "tx_version".to_string()), + raw_locktime: SeriesPattern19::new(client.clone(), "raw_locktime".to_string()), + base_size: SeriesPattern19::new(client.clone(), "base_size".to_string()), + total_size: SeriesPattern19::new(client.clone(), "total_size".to_string()), + is_explicitly_rbf: SeriesPattern19::new(client.clone(), "is_explicitly_rbf".to_string()), + first_txin_index: SeriesPattern19::new(client.clone(), "first_txin_index".to_string()), + first_txout_index: SeriesPattern19::new(client.clone(), "first_txout_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Transactions_Count { +/// Series tree node. +pub struct SeriesTree_Transactions_Count { pub total: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern, - pub is_coinbase: MetricPattern19, + pub is_coinbase: SeriesPattern19, } -impl MetricsTree_Transactions_Count { +impl SeriesTree_Transactions_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { total: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern::new(client.clone(), "tx_count".to_string()), - is_coinbase: MetricPattern19::new(client.clone(), "is_coinbase".to_string()), + is_coinbase: SeriesPattern19::new(client.clone(), "is_coinbase".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Transactions_Size { +/// Series tree node. +pub struct SeriesTree_Transactions_Size { pub vsize: _6bBlockTxPattern, pub weight: _6bBlockTxPattern, } -impl MetricsTree_Transactions_Size { +impl SeriesTree_Transactions_Size { pub fn new(client: Arc, base_path: String) -> Self { Self { vsize: _6bBlockTxPattern::new(client.clone(), "tx_vsize".to_string()), @@ -3314,33 +3314,33 @@ impl MetricsTree_Transactions_Size { } } -/// Metrics tree node. -pub struct MetricsTree_Transactions_Fees { - pub input_value: MetricPattern19, - pub output_value: MetricPattern19, +/// Series tree node. +pub struct SeriesTree_Transactions_Fees { + pub input_value: SeriesPattern19, + pub output_value: SeriesPattern19, pub fee: _6bBlockTxPattern, pub fee_rate: _6bBlockTxPattern, } -impl MetricsTree_Transactions_Fees { +impl SeriesTree_Transactions_Fees { pub fn new(client: Arc, base_path: String) -> Self { Self { - input_value: MetricPattern19::new(client.clone(), "input_value".to_string()), - output_value: MetricPattern19::new(client.clone(), "output_value".to_string()), + input_value: SeriesPattern19::new(client.clone(), "input_value".to_string()), + output_value: SeriesPattern19::new(client.clone(), "output_value".to_string()), fee: _6bBlockTxPattern::new(client.clone(), "fee".to_string()), fee_rate: _6bBlockTxPattern::new(client.clone(), "fee_rate".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Transactions_Versions { +/// Series tree node. +pub struct SeriesTree_Transactions_Versions { pub v1: BaseCumulativeSumPattern, pub v2: BaseCumulativeSumPattern, pub v3: BaseCumulativeSumPattern, } -impl MetricsTree_Transactions_Versions { +impl SeriesTree_Transactions_Versions { pub fn new(client: Arc, base_path: String) -> Self { Self { v1: BaseCumulativeSumPattern::new(client.clone(), "tx_v1".to_string()), @@ -3350,370 +3350,370 @@ impl MetricsTree_Transactions_Versions { } } -/// Metrics tree node. -pub struct MetricsTree_Transactions_Volume { +/// Series tree node. +pub struct SeriesTree_Transactions_Volume { pub sent_sum: BaseCumulativeSumPattern4, pub received_sum: BaseCumulativeSumPattern4, - pub tx_per_sec: MetricPattern1, - pub outputs_per_sec: MetricPattern1, - pub inputs_per_sec: MetricPattern1, + pub tx_per_sec: SeriesPattern1, + pub outputs_per_sec: SeriesPattern1, + pub inputs_per_sec: SeriesPattern1, } -impl MetricsTree_Transactions_Volume { +impl SeriesTree_Transactions_Volume { pub fn new(client: Arc, base_path: String) -> Self { Self { sent_sum: BaseCumulativeSumPattern4::new(client.clone(), "sent_sum".to_string()), received_sum: BaseCumulativeSumPattern4::new(client.clone(), "received_sum".to_string()), - tx_per_sec: MetricPattern1::new(client.clone(), "tx_per_sec".to_string()), - outputs_per_sec: MetricPattern1::new(client.clone(), "outputs_per_sec".to_string()), - inputs_per_sec: MetricPattern1::new(client.clone(), "inputs_per_sec".to_string()), + tx_per_sec: SeriesPattern1::new(client.clone(), "tx_per_sec".to_string()), + outputs_per_sec: SeriesPattern1::new(client.clone(), "outputs_per_sec".to_string()), + inputs_per_sec: SeriesPattern1::new(client.clone(), "inputs_per_sec".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Inputs { - pub raw: MetricsTree_Inputs_Raw, - pub spent: MetricsTree_Inputs_Spent, +/// Series tree node. +pub struct SeriesTree_Inputs { + pub raw: SeriesTree_Inputs_Raw, + pub spent: SeriesTree_Inputs_Spent, pub count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern, } -impl MetricsTree_Inputs { +impl SeriesTree_Inputs { pub fn new(client: Arc, base_path: String) -> Self { Self { - raw: MetricsTree_Inputs_Raw::new(client.clone(), format!("{base_path}_raw")), - spent: MetricsTree_Inputs_Spent::new(client.clone(), format!("{base_path}_spent")), + raw: SeriesTree_Inputs_Raw::new(client.clone(), format!("{base_path}_raw")), + spent: SeriesTree_Inputs_Spent::new(client.clone(), format!("{base_path}_spent")), count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern::new(client.clone(), "input_count".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Inputs_Raw { - pub first_txin_index: MetricPattern18, - pub outpoint: MetricPattern20, - pub tx_index: MetricPattern20, - pub output_type: MetricPattern20, - pub type_index: MetricPattern20, +/// Series tree node. +pub struct SeriesTree_Inputs_Raw { + pub first_txin_index: SeriesPattern18, + pub outpoint: SeriesPattern20, + pub tx_index: SeriesPattern20, + pub output_type: SeriesPattern20, + pub type_index: SeriesPattern20, } -impl MetricsTree_Inputs_Raw { +impl SeriesTree_Inputs_Raw { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_txin_index: MetricPattern18::new(client.clone(), "first_txin_index".to_string()), - outpoint: MetricPattern20::new(client.clone(), "outpoint".to_string()), - tx_index: MetricPattern20::new(client.clone(), "tx_index".to_string()), - output_type: MetricPattern20::new(client.clone(), "output_type".to_string()), - type_index: MetricPattern20::new(client.clone(), "type_index".to_string()), + first_txin_index: SeriesPattern18::new(client.clone(), "first_txin_index".to_string()), + outpoint: SeriesPattern20::new(client.clone(), "outpoint".to_string()), + tx_index: SeriesPattern20::new(client.clone(), "tx_index".to_string()), + output_type: SeriesPattern20::new(client.clone(), "output_type".to_string()), + type_index: SeriesPattern20::new(client.clone(), "type_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Inputs_Spent { - pub txout_index: MetricPattern20, - pub value: MetricPattern20, +/// Series tree node. +pub struct SeriesTree_Inputs_Spent { + pub txout_index: SeriesPattern20, + pub value: SeriesPattern20, } -impl MetricsTree_Inputs_Spent { +impl SeriesTree_Inputs_Spent { pub fn new(client: Arc, base_path: String) -> Self { Self { - txout_index: MetricPattern20::new(client.clone(), "txout_index".to_string()), - value: MetricPattern20::new(client.clone(), "value".to_string()), + txout_index: SeriesPattern20::new(client.clone(), "txout_index".to_string()), + value: SeriesPattern20::new(client.clone(), "value".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Outputs { - pub raw: MetricsTree_Outputs_Raw, - pub spent: MetricsTree_Outputs_Spent, - pub count: MetricsTree_Outputs_Count, +/// Series tree node. +pub struct SeriesTree_Outputs { + pub raw: SeriesTree_Outputs_Raw, + pub spent: SeriesTree_Outputs_Spent, + pub count: SeriesTree_Outputs_Count, } -impl MetricsTree_Outputs { +impl SeriesTree_Outputs { pub fn new(client: Arc, base_path: String) -> Self { Self { - raw: MetricsTree_Outputs_Raw::new(client.clone(), format!("{base_path}_raw")), - spent: MetricsTree_Outputs_Spent::new(client.clone(), format!("{base_path}_spent")), - count: MetricsTree_Outputs_Count::new(client.clone(), format!("{base_path}_count")), + raw: SeriesTree_Outputs_Raw::new(client.clone(), format!("{base_path}_raw")), + spent: SeriesTree_Outputs_Spent::new(client.clone(), format!("{base_path}_spent")), + count: SeriesTree_Outputs_Count::new(client.clone(), format!("{base_path}_count")), } } } -/// Metrics tree node. -pub struct MetricsTree_Outputs_Raw { - pub first_txout_index: MetricPattern18, - pub value: MetricPattern21, - pub output_type: MetricPattern21, - pub type_index: MetricPattern21, - pub tx_index: MetricPattern21, +/// Series tree node. +pub struct SeriesTree_Outputs_Raw { + pub first_txout_index: SeriesPattern18, + pub value: SeriesPattern21, + pub output_type: SeriesPattern21, + pub type_index: SeriesPattern21, + pub tx_index: SeriesPattern21, } -impl MetricsTree_Outputs_Raw { +impl SeriesTree_Outputs_Raw { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_txout_index: MetricPattern18::new(client.clone(), "first_txout_index".to_string()), - value: MetricPattern21::new(client.clone(), "value".to_string()), - output_type: MetricPattern21::new(client.clone(), "output_type".to_string()), - type_index: MetricPattern21::new(client.clone(), "type_index".to_string()), - tx_index: MetricPattern21::new(client.clone(), "tx_index".to_string()), + first_txout_index: SeriesPattern18::new(client.clone(), "first_txout_index".to_string()), + value: SeriesPattern21::new(client.clone(), "value".to_string()), + output_type: SeriesPattern21::new(client.clone(), "output_type".to_string()), + type_index: SeriesPattern21::new(client.clone(), "type_index".to_string()), + tx_index: SeriesPattern21::new(client.clone(), "tx_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Outputs_Spent { - pub txin_index: MetricPattern21, +/// Series tree node. +pub struct SeriesTree_Outputs_Spent { + pub txin_index: SeriesPattern21, } -impl MetricsTree_Outputs_Spent { +impl SeriesTree_Outputs_Spent { pub fn new(client: Arc, base_path: String) -> Self { Self { - txin_index: MetricPattern21::new(client.clone(), "txin_index".to_string()), + txin_index: SeriesPattern21::new(client.clone(), "txin_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Outputs_Count { +/// Series tree node. +pub struct SeriesTree_Outputs_Count { pub total: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern, - pub unspent: MetricPattern1, + pub unspent: SeriesPattern1, } -impl MetricsTree_Outputs_Count { +impl SeriesTree_Outputs_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { total: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern::new(client.clone(), "output_count".to_string()), - unspent: MetricPattern1::new(client.clone(), "exact_utxo_count".to_string()), + unspent: SeriesPattern1::new(client.clone(), "exact_utxo_count".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses { - pub raw: MetricsTree_Addresses_Raw, - pub indexes: MetricsTree_Addresses_Indexes, - pub data: MetricsTree_Addresses_Data, +/// Series tree node. +pub struct SeriesTree_Addresses { + pub raw: SeriesTree_Addresses_Raw, + pub indexes: SeriesTree_Addresses_Indexes, + pub data: SeriesTree_Addresses_Data, pub funded: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3, pub empty: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3, - pub activity: MetricsTree_Addresses_Activity, + pub activity: SeriesTree_Addresses_Activity, pub total: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3, - pub new: MetricsTree_Addresses_New, - pub delta: MetricsTree_Addresses_Delta, + pub new: SeriesTree_Addresses_New, + pub delta: SeriesTree_Addresses_Delta, } -impl MetricsTree_Addresses { +impl SeriesTree_Addresses { pub fn new(client: Arc, base_path: String) -> Self { Self { - raw: MetricsTree_Addresses_Raw::new(client.clone(), format!("{base_path}_raw")), - indexes: MetricsTree_Addresses_Indexes::new(client.clone(), format!("{base_path}_indexes")), - data: MetricsTree_Addresses_Data::new(client.clone(), format!("{base_path}_data")), + raw: SeriesTree_Addresses_Raw::new(client.clone(), format!("{base_path}_raw")), + indexes: SeriesTree_Addresses_Indexes::new(client.clone(), format!("{base_path}_indexes")), + data: SeriesTree_Addresses_Data::new(client.clone(), format!("{base_path}_data")), funded: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3::new(client.clone(), "address_count".to_string()), empty: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3::new(client.clone(), "empty_address_count".to_string()), - activity: MetricsTree_Addresses_Activity::new(client.clone(), format!("{base_path}_activity")), + activity: SeriesTree_Addresses_Activity::new(client.clone(), format!("{base_path}_activity")), total: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3::new(client.clone(), "total_address_count".to_string()), - new: MetricsTree_Addresses_New::new(client.clone(), format!("{base_path}_new")), - delta: MetricsTree_Addresses_Delta::new(client.clone(), format!("{base_path}_delta")), + new: SeriesTree_Addresses_New::new(client.clone(), format!("{base_path}_new")), + delta: SeriesTree_Addresses_Delta::new(client.clone(), format!("{base_path}_delta")), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Raw { - pub p2pk65: MetricsTree_Addresses_Raw_P2pk65, - pub p2pk33: MetricsTree_Addresses_Raw_P2pk33, - pub p2pkh: MetricsTree_Addresses_Raw_P2pkh, - pub p2sh: MetricsTree_Addresses_Raw_P2sh, - pub p2wpkh: MetricsTree_Addresses_Raw_P2wpkh, - pub p2wsh: MetricsTree_Addresses_Raw_P2wsh, - pub p2tr: MetricsTree_Addresses_Raw_P2tr, - pub p2a: MetricsTree_Addresses_Raw_P2a, +/// Series tree node. +pub struct SeriesTree_Addresses_Raw { + pub p2pk65: SeriesTree_Addresses_Raw_P2pk65, + pub p2pk33: SeriesTree_Addresses_Raw_P2pk33, + pub p2pkh: SeriesTree_Addresses_Raw_P2pkh, + pub p2sh: SeriesTree_Addresses_Raw_P2sh, + pub p2wpkh: SeriesTree_Addresses_Raw_P2wpkh, + pub p2wsh: SeriesTree_Addresses_Raw_P2wsh, + pub p2tr: SeriesTree_Addresses_Raw_P2tr, + pub p2a: SeriesTree_Addresses_Raw_P2a, } -impl MetricsTree_Addresses_Raw { +impl SeriesTree_Addresses_Raw { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2pk65: MetricsTree_Addresses_Raw_P2pk65::new(client.clone(), format!("{base_path}_p2pk65")), - p2pk33: MetricsTree_Addresses_Raw_P2pk33::new(client.clone(), format!("{base_path}_p2pk33")), - p2pkh: MetricsTree_Addresses_Raw_P2pkh::new(client.clone(), format!("{base_path}_p2pkh")), - p2sh: MetricsTree_Addresses_Raw_P2sh::new(client.clone(), format!("{base_path}_p2sh")), - p2wpkh: MetricsTree_Addresses_Raw_P2wpkh::new(client.clone(), format!("{base_path}_p2wpkh")), - p2wsh: MetricsTree_Addresses_Raw_P2wsh::new(client.clone(), format!("{base_path}_p2wsh")), - p2tr: MetricsTree_Addresses_Raw_P2tr::new(client.clone(), format!("{base_path}_p2tr")), - p2a: MetricsTree_Addresses_Raw_P2a::new(client.clone(), format!("{base_path}_p2a")), + p2pk65: SeriesTree_Addresses_Raw_P2pk65::new(client.clone(), format!("{base_path}_p2pk65")), + p2pk33: SeriesTree_Addresses_Raw_P2pk33::new(client.clone(), format!("{base_path}_p2pk33")), + p2pkh: SeriesTree_Addresses_Raw_P2pkh::new(client.clone(), format!("{base_path}_p2pkh")), + p2sh: SeriesTree_Addresses_Raw_P2sh::new(client.clone(), format!("{base_path}_p2sh")), + p2wpkh: SeriesTree_Addresses_Raw_P2wpkh::new(client.clone(), format!("{base_path}_p2wpkh")), + p2wsh: SeriesTree_Addresses_Raw_P2wsh::new(client.clone(), format!("{base_path}_p2wsh")), + p2tr: SeriesTree_Addresses_Raw_P2tr::new(client.clone(), format!("{base_path}_p2tr")), + p2a: SeriesTree_Addresses_Raw_P2a::new(client.clone(), format!("{base_path}_p2a")), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Raw_P2pk65 { - pub first_index: MetricPattern18, - pub bytes: MetricPattern27, +/// Series tree node. +pub struct SeriesTree_Addresses_Raw_P2pk65 { + pub first_index: SeriesPattern18, + pub bytes: SeriesPattern27, } -impl MetricsTree_Addresses_Raw_P2pk65 { +impl SeriesTree_Addresses_Raw_P2pk65 { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_p2pk65_address_index".to_string()), - bytes: MetricPattern27::new(client.clone(), "p2pk65_bytes".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_p2pk65_address_index".to_string()), + bytes: SeriesPattern27::new(client.clone(), "p2pk65_bytes".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Raw_P2pk33 { - pub first_index: MetricPattern18, - pub bytes: MetricPattern26, +/// Series tree node. +pub struct SeriesTree_Addresses_Raw_P2pk33 { + pub first_index: SeriesPattern18, + pub bytes: SeriesPattern26, } -impl MetricsTree_Addresses_Raw_P2pk33 { +impl SeriesTree_Addresses_Raw_P2pk33 { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_p2pk33_address_index".to_string()), - bytes: MetricPattern26::new(client.clone(), "p2pk33_bytes".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_p2pk33_address_index".to_string()), + bytes: SeriesPattern26::new(client.clone(), "p2pk33_bytes".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Raw_P2pkh { - pub first_index: MetricPattern18, - pub bytes: MetricPattern28, +/// Series tree node. +pub struct SeriesTree_Addresses_Raw_P2pkh { + pub first_index: SeriesPattern18, + pub bytes: SeriesPattern28, } -impl MetricsTree_Addresses_Raw_P2pkh { +impl SeriesTree_Addresses_Raw_P2pkh { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_p2pkh_address_index".to_string()), - bytes: MetricPattern28::new(client.clone(), "p2pkh_bytes".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_p2pkh_address_index".to_string()), + bytes: SeriesPattern28::new(client.clone(), "p2pkh_bytes".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Raw_P2sh { - pub first_index: MetricPattern18, - pub bytes: MetricPattern29, +/// Series tree node. +pub struct SeriesTree_Addresses_Raw_P2sh { + pub first_index: SeriesPattern18, + pub bytes: SeriesPattern29, } -impl MetricsTree_Addresses_Raw_P2sh { +impl SeriesTree_Addresses_Raw_P2sh { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_p2sh_address_index".to_string()), - bytes: MetricPattern29::new(client.clone(), "p2sh_bytes".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_p2sh_address_index".to_string()), + bytes: SeriesPattern29::new(client.clone(), "p2sh_bytes".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Raw_P2wpkh { - pub first_index: MetricPattern18, - pub bytes: MetricPattern31, +/// Series tree node. +pub struct SeriesTree_Addresses_Raw_P2wpkh { + pub first_index: SeriesPattern18, + pub bytes: SeriesPattern31, } -impl MetricsTree_Addresses_Raw_P2wpkh { +impl SeriesTree_Addresses_Raw_P2wpkh { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_p2wpkh_address_index".to_string()), - bytes: MetricPattern31::new(client.clone(), "p2wpkh_bytes".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_p2wpkh_address_index".to_string()), + bytes: SeriesPattern31::new(client.clone(), "p2wpkh_bytes".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Raw_P2wsh { - pub first_index: MetricPattern18, - pub bytes: MetricPattern32, +/// Series tree node. +pub struct SeriesTree_Addresses_Raw_P2wsh { + pub first_index: SeriesPattern18, + pub bytes: SeriesPattern32, } -impl MetricsTree_Addresses_Raw_P2wsh { +impl SeriesTree_Addresses_Raw_P2wsh { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_p2wsh_address_index".to_string()), - bytes: MetricPattern32::new(client.clone(), "p2wsh_bytes".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_p2wsh_address_index".to_string()), + bytes: SeriesPattern32::new(client.clone(), "p2wsh_bytes".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Raw_P2tr { - pub first_index: MetricPattern18, - pub bytes: MetricPattern30, +/// Series tree node. +pub struct SeriesTree_Addresses_Raw_P2tr { + pub first_index: SeriesPattern18, + pub bytes: SeriesPattern30, } -impl MetricsTree_Addresses_Raw_P2tr { +impl SeriesTree_Addresses_Raw_P2tr { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_p2tr_address_index".to_string()), - bytes: MetricPattern30::new(client.clone(), "p2tr_bytes".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_p2tr_address_index".to_string()), + bytes: SeriesPattern30::new(client.clone(), "p2tr_bytes".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Raw_P2a { - pub first_index: MetricPattern18, - pub bytes: MetricPattern24, +/// Series tree node. +pub struct SeriesTree_Addresses_Raw_P2a { + pub first_index: SeriesPattern18, + pub bytes: SeriesPattern24, } -impl MetricsTree_Addresses_Raw_P2a { +impl SeriesTree_Addresses_Raw_P2a { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_p2a_address_index".to_string()), - bytes: MetricPattern24::new(client.clone(), "p2a_bytes".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_p2a_address_index".to_string()), + bytes: SeriesPattern24::new(client.clone(), "p2a_bytes".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Indexes { - pub p2a: MetricPattern24, - pub p2pk33: MetricPattern26, - pub p2pk65: MetricPattern27, - pub p2pkh: MetricPattern28, - pub p2sh: MetricPattern29, - pub p2tr: MetricPattern30, - pub p2wpkh: MetricPattern31, - pub p2wsh: MetricPattern32, - pub funded: MetricPattern34, - pub empty: MetricPattern35, +/// Series tree node. +pub struct SeriesTree_Addresses_Indexes { + pub p2a: SeriesPattern24, + pub p2pk33: SeriesPattern26, + pub p2pk65: SeriesPattern27, + pub p2pkh: SeriesPattern28, + pub p2sh: SeriesPattern29, + pub p2tr: SeriesPattern30, + pub p2wpkh: SeriesPattern31, + pub p2wsh: SeriesPattern32, + pub funded: SeriesPattern34, + pub empty: SeriesPattern35, } -impl MetricsTree_Addresses_Indexes { +impl SeriesTree_Addresses_Indexes { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2a: MetricPattern24::new(client.clone(), "any_address_index".to_string()), - p2pk33: MetricPattern26::new(client.clone(), "any_address_index".to_string()), - p2pk65: MetricPattern27::new(client.clone(), "any_address_index".to_string()), - p2pkh: MetricPattern28::new(client.clone(), "any_address_index".to_string()), - p2sh: MetricPattern29::new(client.clone(), "any_address_index".to_string()), - p2tr: MetricPattern30::new(client.clone(), "any_address_index".to_string()), - p2wpkh: MetricPattern31::new(client.clone(), "any_address_index".to_string()), - p2wsh: MetricPattern32::new(client.clone(), "any_address_index".to_string()), - funded: MetricPattern34::new(client.clone(), "funded_address_index".to_string()), - empty: MetricPattern35::new(client.clone(), "empty_address_index".to_string()), + p2a: SeriesPattern24::new(client.clone(), "any_address_index".to_string()), + p2pk33: SeriesPattern26::new(client.clone(), "any_address_index".to_string()), + p2pk65: SeriesPattern27::new(client.clone(), "any_address_index".to_string()), + p2pkh: SeriesPattern28::new(client.clone(), "any_address_index".to_string()), + p2sh: SeriesPattern29::new(client.clone(), "any_address_index".to_string()), + p2tr: SeriesPattern30::new(client.clone(), "any_address_index".to_string()), + p2wpkh: SeriesPattern31::new(client.clone(), "any_address_index".to_string()), + p2wsh: SeriesPattern32::new(client.clone(), "any_address_index".to_string()), + funded: SeriesPattern34::new(client.clone(), "funded_address_index".to_string()), + empty: SeriesPattern35::new(client.clone(), "empty_address_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Data { - pub funded: MetricPattern34, - pub empty: MetricPattern35, +/// Series tree node. +pub struct SeriesTree_Addresses_Data { + pub funded: SeriesPattern34, + pub empty: SeriesPattern35, } -impl MetricsTree_Addresses_Data { +impl SeriesTree_Addresses_Data { pub fn new(client: Arc, base_path: String) -> Self { Self { - funded: MetricPattern34::new(client.clone(), "funded_address_data".to_string()), - empty: MetricPattern35::new(client.clone(), "empty_address_data".to_string()), + funded: SeriesPattern34::new(client.clone(), "funded_address_data".to_string()), + empty: SeriesPattern35::new(client.clone(), "empty_address_data".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Activity { +/// Series tree node. +pub struct SeriesTree_Addresses_Activity { pub all: BothReactivatedReceivingSendingPattern, pub p2pk65: BothReactivatedReceivingSendingPattern, pub p2pk33: BothReactivatedReceivingSendingPattern, @@ -3725,7 +3725,7 @@ pub struct MetricsTree_Addresses_Activity { pub p2a: BothReactivatedReceivingSendingPattern, } -impl MetricsTree_Addresses_Activity { +impl SeriesTree_Addresses_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { all: BothReactivatedReceivingSendingPattern::new(client.clone(), "address_activity".to_string()), @@ -3741,8 +3741,8 @@ impl MetricsTree_Addresses_Activity { } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_New { +/// Series tree node. +pub struct SeriesTree_Addresses_New { pub all: BaseCumulativeSumPattern, pub p2pk65: BaseCumulativeSumPattern, pub p2pk33: BaseCumulativeSumPattern, @@ -3754,7 +3754,7 @@ pub struct MetricsTree_Addresses_New { pub p2a: BaseCumulativeSumPattern, } -impl MetricsTree_Addresses_New { +impl SeriesTree_Addresses_New { pub fn new(client: Arc, base_path: String) -> Self { Self { all: BaseCumulativeSumPattern::new(client.clone(), "new_address_count".to_string()), @@ -3770,8 +3770,8 @@ impl MetricsTree_Addresses_New { } } -/// Metrics tree node. -pub struct MetricsTree_Addresses_Delta { +/// Series tree node. +pub struct SeriesTree_Addresses_Delta { pub all: AbsoluteRatePattern, pub p2pk65: AbsoluteRatePattern, pub p2pk33: AbsoluteRatePattern, @@ -3783,7 +3783,7 @@ pub struct MetricsTree_Addresses_Delta { pub p2a: AbsoluteRatePattern, } -impl MetricsTree_Addresses_Delta { +impl SeriesTree_Addresses_Delta { pub fn new(client: Arc, base_path: String) -> Self { Self { all: AbsoluteRatePattern::new(client.clone(), "address_count".to_string()), @@ -3799,106 +3799,106 @@ impl MetricsTree_Addresses_Delta { } } -/// Metrics tree node. -pub struct MetricsTree_Scripts { - pub raw: MetricsTree_Scripts_Raw, - pub count: MetricsTree_Scripts_Count, - pub value: MetricsTree_Scripts_Value, - pub adoption: MetricsTree_Scripts_Adoption, +/// Series tree node. +pub struct SeriesTree_Scripts { + pub raw: SeriesTree_Scripts_Raw, + pub count: SeriesTree_Scripts_Count, + pub value: SeriesTree_Scripts_Value, + pub adoption: SeriesTree_Scripts_Adoption, } -impl MetricsTree_Scripts { +impl SeriesTree_Scripts { pub fn new(client: Arc, base_path: String) -> Self { Self { - raw: MetricsTree_Scripts_Raw::new(client.clone(), format!("{base_path}_raw")), - count: MetricsTree_Scripts_Count::new(client.clone(), format!("{base_path}_count")), - value: MetricsTree_Scripts_Value::new(client.clone(), format!("{base_path}_value")), - adoption: MetricsTree_Scripts_Adoption::new(client.clone(), format!("{base_path}_adoption")), + raw: SeriesTree_Scripts_Raw::new(client.clone(), format!("{base_path}_raw")), + count: SeriesTree_Scripts_Count::new(client.clone(), format!("{base_path}_count")), + value: SeriesTree_Scripts_Value::new(client.clone(), format!("{base_path}_value")), + adoption: SeriesTree_Scripts_Adoption::new(client.clone(), format!("{base_path}_adoption")), } } } -/// Metrics tree node. -pub struct MetricsTree_Scripts_Raw { - pub empty: MetricsTree_Scripts_Raw_Empty, - pub op_return: MetricsTree_Scripts_Raw_OpReturn, - pub p2ms: MetricsTree_Scripts_Raw_P2ms, - pub unknown: MetricsTree_Scripts_Raw_Unknown, +/// Series tree node. +pub struct SeriesTree_Scripts_Raw { + pub empty: SeriesTree_Scripts_Raw_Empty, + pub op_return: SeriesTree_Scripts_Raw_OpReturn, + pub p2ms: SeriesTree_Scripts_Raw_P2ms, + pub unknown: SeriesTree_Scripts_Raw_Unknown, } -impl MetricsTree_Scripts_Raw { +impl SeriesTree_Scripts_Raw { pub fn new(client: Arc, base_path: String) -> Self { Self { - empty: MetricsTree_Scripts_Raw_Empty::new(client.clone(), format!("{base_path}_empty")), - op_return: MetricsTree_Scripts_Raw_OpReturn::new(client.clone(), format!("{base_path}_op_return")), - p2ms: MetricsTree_Scripts_Raw_P2ms::new(client.clone(), format!("{base_path}_p2ms")), - unknown: MetricsTree_Scripts_Raw_Unknown::new(client.clone(), format!("{base_path}_unknown")), + empty: SeriesTree_Scripts_Raw_Empty::new(client.clone(), format!("{base_path}_empty")), + op_return: SeriesTree_Scripts_Raw_OpReturn::new(client.clone(), format!("{base_path}_op_return")), + p2ms: SeriesTree_Scripts_Raw_P2ms::new(client.clone(), format!("{base_path}_p2ms")), + unknown: SeriesTree_Scripts_Raw_Unknown::new(client.clone(), format!("{base_path}_unknown")), } } } -/// Metrics tree node. -pub struct MetricsTree_Scripts_Raw_Empty { - pub first_index: MetricPattern18, - pub to_tx_index: MetricPattern22, +/// Series tree node. +pub struct SeriesTree_Scripts_Raw_Empty { + pub first_index: SeriesPattern18, + pub to_tx_index: SeriesPattern22, } -impl MetricsTree_Scripts_Raw_Empty { +impl SeriesTree_Scripts_Raw_Empty { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_empty_output_index".to_string()), - to_tx_index: MetricPattern22::new(client.clone(), "tx_index".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_empty_output_index".to_string()), + to_tx_index: SeriesPattern22::new(client.clone(), "tx_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Scripts_Raw_OpReturn { - pub first_index: MetricPattern18, - pub to_tx_index: MetricPattern23, +/// Series tree node. +pub struct SeriesTree_Scripts_Raw_OpReturn { + pub first_index: SeriesPattern18, + pub to_tx_index: SeriesPattern23, } -impl MetricsTree_Scripts_Raw_OpReturn { +impl SeriesTree_Scripts_Raw_OpReturn { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_op_return_index".to_string()), - to_tx_index: MetricPattern23::new(client.clone(), "tx_index".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_op_return_index".to_string()), + to_tx_index: SeriesPattern23::new(client.clone(), "tx_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Scripts_Raw_P2ms { - pub first_index: MetricPattern18, - pub to_tx_index: MetricPattern25, +/// Series tree node. +pub struct SeriesTree_Scripts_Raw_P2ms { + pub first_index: SeriesPattern18, + pub to_tx_index: SeriesPattern25, } -impl MetricsTree_Scripts_Raw_P2ms { +impl SeriesTree_Scripts_Raw_P2ms { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_p2ms_output_index".to_string()), - to_tx_index: MetricPattern25::new(client.clone(), "tx_index".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_p2ms_output_index".to_string()), + to_tx_index: SeriesPattern25::new(client.clone(), "tx_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Scripts_Raw_Unknown { - pub first_index: MetricPattern18, - pub to_tx_index: MetricPattern33, +/// Series tree node. +pub struct SeriesTree_Scripts_Raw_Unknown { + pub first_index: SeriesPattern18, + pub to_tx_index: SeriesPattern33, } -impl MetricsTree_Scripts_Raw_Unknown { +impl SeriesTree_Scripts_Raw_Unknown { pub fn new(client: Arc, base_path: String) -> Self { Self { - first_index: MetricPattern18::new(client.clone(), "first_unknown_output_index".to_string()), - to_tx_index: MetricPattern33::new(client.clone(), "tx_index".to_string()), + first_index: SeriesPattern18::new(client.clone(), "first_unknown_output_index".to_string()), + to_tx_index: SeriesPattern33::new(client.clone(), "tx_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Scripts_Count { +/// Series tree node. +pub struct SeriesTree_Scripts_Count { pub p2a: BaseCumulativeSumPattern, pub p2ms: BaseCumulativeSumPattern, pub p2pk33: BaseCumulativeSumPattern, @@ -3914,7 +3914,7 @@ pub struct MetricsTree_Scripts_Count { pub segwit: BaseCumulativeSumPattern, } -impl MetricsTree_Scripts_Count { +impl SeriesTree_Scripts_Count { pub fn new(client: Arc, base_path: String) -> Self { Self { p2a: BaseCumulativeSumPattern::new(client.clone(), "p2a_count".to_string()), @@ -3934,12 +3934,12 @@ impl MetricsTree_Scripts_Count { } } -/// Metrics tree node. -pub struct MetricsTree_Scripts_Value { +/// Series tree node. +pub struct SeriesTree_Scripts_Value { pub op_return: BaseCumulativeSumPattern4, } -impl MetricsTree_Scripts_Value { +impl SeriesTree_Scripts_Value { pub fn new(client: Arc, base_path: String) -> Self { Self { op_return: BaseCumulativeSumPattern4::new(client.clone(), "op_return_value".to_string()), @@ -3947,13 +3947,13 @@ impl MetricsTree_Scripts_Value { } } -/// Metrics tree node. -pub struct MetricsTree_Scripts_Adoption { +/// Series tree node. +pub struct SeriesTree_Scripts_Adoption { pub taproot: BpsPercentRatioPattern3, pub segwit: BpsPercentRatioPattern3, } -impl MetricsTree_Scripts_Adoption { +impl SeriesTree_Scripts_Adoption { pub fn new(client: Arc, base_path: String) -> Self { Self { taproot: BpsPercentRatioPattern3::new(client.clone(), "taproot_adoption".to_string()), @@ -3962,49 +3962,49 @@ impl MetricsTree_Scripts_Adoption { } } -/// Metrics tree node. -pub struct MetricsTree_Mining { - pub rewards: MetricsTree_Mining_Rewards, - pub hashrate: MetricsTree_Mining_Hashrate, +/// Series tree node. +pub struct SeriesTree_Mining { + pub rewards: SeriesTree_Mining_Rewards, + pub hashrate: SeriesTree_Mining_Hashrate, } -impl MetricsTree_Mining { +impl SeriesTree_Mining { pub fn new(client: Arc, base_path: String) -> Self { Self { - rewards: MetricsTree_Mining_Rewards::new(client.clone(), format!("{base_path}_rewards")), - hashrate: MetricsTree_Mining_Hashrate::new(client.clone(), format!("{base_path}_hashrate")), + rewards: SeriesTree_Mining_Rewards::new(client.clone(), format!("{base_path}_rewards")), + hashrate: SeriesTree_Mining_Hashrate::new(client.clone(), format!("{base_path}_hashrate")), } } } -/// Metrics tree node. -pub struct MetricsTree_Mining_Rewards { +/// Series tree node. +pub struct SeriesTree_Mining_Rewards { pub coinbase: BaseCumulativeSumPattern4, - pub subsidy: MetricsTree_Mining_Rewards_Subsidy, - pub fees: MetricsTree_Mining_Rewards_Fees, + pub subsidy: SeriesTree_Mining_Rewards_Subsidy, + pub fees: SeriesTree_Mining_Rewards_Fees, pub unclaimed: BaseCumulativeSumPattern4, } -impl MetricsTree_Mining_Rewards { +impl SeriesTree_Mining_Rewards { pub fn new(client: Arc, base_path: String) -> Self { Self { coinbase: BaseCumulativeSumPattern4::new(client.clone(), "coinbase".to_string()), - subsidy: MetricsTree_Mining_Rewards_Subsidy::new(client.clone(), format!("{base_path}_subsidy")), - fees: MetricsTree_Mining_Rewards_Fees::new(client.clone(), format!("{base_path}_fees")), + subsidy: SeriesTree_Mining_Rewards_Subsidy::new(client.clone(), format!("{base_path}_subsidy")), + fees: SeriesTree_Mining_Rewards_Fees::new(client.clone(), format!("{base_path}_fees")), unclaimed: BaseCumulativeSumPattern4::new(client.clone(), "unclaimed_rewards".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Mining_Rewards_Subsidy { +/// Series tree node. +pub struct SeriesTree_Mining_Rewards_Subsidy { pub base: BtcCentsSatsUsdPattern, pub cumulative: BtcCentsSatsUsdPattern, pub dominance: _1m1w1y24hBpsPercentRatioPattern, pub sma_1y: CentsUsdPattern2, } -impl MetricsTree_Mining_Rewards_Subsidy { +impl SeriesTree_Mining_Rewards_Subsidy { pub fn new(client: Arc, base_path: String) -> Self { Self { base: BtcCentsSatsUsdPattern::new(client.clone(), "subsidy".to_string()), @@ -4015,8 +4015,8 @@ impl MetricsTree_Mining_Rewards_Subsidy { } } -/// Metrics tree node. -pub struct MetricsTree_Mining_Rewards_Fees { +/// Series tree node. +pub struct SeriesTree_Mining_Rewards_Fees { pub base: BtcCentsSatsUsdPattern, pub cumulative: BtcCentsSatsUsdPattern, pub sum: _1m1w1y24hPattern5, @@ -4025,10 +4025,10 @@ pub struct MetricsTree_Mining_Rewards_Fees { pub _1m: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern, pub _1y: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern, pub dominance: _1m1w1y24hBpsPercentRatioPattern, - pub ratio_multiple: MetricsTree_Mining_Rewards_Fees_RatioMultiple, + pub ratio_multiple: SeriesTree_Mining_Rewards_Fees_RatioMultiple, } -impl MetricsTree_Mining_Rewards_Fees { +impl SeriesTree_Mining_Rewards_Fees { pub fn new(client: Arc, base_path: String) -> Self { Self { base: BtcCentsSatsUsdPattern::new(client.clone(), "fees".to_string()), @@ -4039,20 +4039,20 @@ impl MetricsTree_Mining_Rewards_Fees { _1m: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "fees_1m".to_string()), _1y: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern::new(client.clone(), "fees_1y".to_string()), dominance: _1m1w1y24hBpsPercentRatioPattern::new(client.clone(), "fee_dominance".to_string()), - ratio_multiple: MetricsTree_Mining_Rewards_Fees_RatioMultiple::new(client.clone(), format!("{base_path}_ratio_multiple")), + ratio_multiple: SeriesTree_Mining_Rewards_Fees_RatioMultiple::new(client.clone(), format!("{base_path}_ratio_multiple")), } } } -/// Metrics tree node. -pub struct MetricsTree_Mining_Rewards_Fees_RatioMultiple { +/// Series tree node. +pub struct SeriesTree_Mining_Rewards_Fees_RatioMultiple { pub _24h: BpsRatioPattern2, pub _1w: BpsRatioPattern2, pub _1m: BpsRatioPattern2, pub _1y: BpsRatioPattern2, } -impl MetricsTree_Mining_Rewards_Fees_RatioMultiple { +impl SeriesTree_Mining_Rewards_Fees_RatioMultiple { pub fn new(client: Arc, base_path: String) -> Self { Self { _24h: BpsRatioPattern2::new(client.clone(), "fee_ratio_multiple_24h".to_string()), @@ -4063,116 +4063,116 @@ impl MetricsTree_Mining_Rewards_Fees_RatioMultiple { } } -/// Metrics tree node. -pub struct MetricsTree_Mining_Hashrate { - pub rate: MetricsTree_Mining_Hashrate_Rate, +/// Series tree node. +pub struct SeriesTree_Mining_Hashrate { + pub rate: SeriesTree_Mining_Hashrate_Rate, pub price: PhsReboundThsPattern, pub value: PhsReboundThsPattern, } -impl MetricsTree_Mining_Hashrate { +impl SeriesTree_Mining_Hashrate { pub fn new(client: Arc, base_path: String) -> Self { Self { - rate: MetricsTree_Mining_Hashrate_Rate::new(client.clone(), format!("{base_path}_rate")), + rate: SeriesTree_Mining_Hashrate_Rate::new(client.clone(), format!("{base_path}_rate")), price: PhsReboundThsPattern::new(client.clone(), "hash_price".to_string()), value: PhsReboundThsPattern::new(client.clone(), "hash_value".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Mining_Hashrate_Rate { - pub base: MetricPattern1, - pub sma: MetricsTree_Mining_Hashrate_Rate_Sma, - pub ath: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Mining_Hashrate_Rate { + pub base: SeriesPattern1, + pub sma: SeriesTree_Mining_Hashrate_Rate_Sma, + pub ath: SeriesPattern1, pub drawdown: BpsPercentRatioPattern5, } -impl MetricsTree_Mining_Hashrate_Rate { +impl SeriesTree_Mining_Hashrate_Rate { pub fn new(client: Arc, base_path: String) -> Self { Self { - base: MetricPattern1::new(client.clone(), "hash_rate".to_string()), - sma: MetricsTree_Mining_Hashrate_Rate_Sma::new(client.clone(), format!("{base_path}_sma")), - ath: MetricPattern1::new(client.clone(), "hash_rate_ath".to_string()), + base: SeriesPattern1::new(client.clone(), "hash_rate".to_string()), + sma: SeriesTree_Mining_Hashrate_Rate_Sma::new(client.clone(), format!("{base_path}_sma")), + ath: SeriesPattern1::new(client.clone(), "hash_rate_ath".to_string()), drawdown: BpsPercentRatioPattern5::new(client.clone(), "hash_rate_drawdown".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Mining_Hashrate_Rate_Sma { - pub _1w: MetricPattern1, - pub _1m: MetricPattern1, - pub _2m: MetricPattern1, - pub _1y: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Mining_Hashrate_Rate_Sma { + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _2m: SeriesPattern1, + pub _1y: SeriesPattern1, } -impl MetricsTree_Mining_Hashrate_Rate_Sma { +impl SeriesTree_Mining_Hashrate_Rate_Sma { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1w: MetricPattern1::new(client.clone(), "hash_rate_sma_1w".to_string()), - _1m: MetricPattern1::new(client.clone(), "hash_rate_sma_1m".to_string()), - _2m: MetricPattern1::new(client.clone(), "hash_rate_sma_2m".to_string()), - _1y: MetricPattern1::new(client.clone(), "hash_rate_sma_1y".to_string()), + _1w: SeriesPattern1::new(client.clone(), "hash_rate_sma_1w".to_string()), + _1m: SeriesPattern1::new(client.clone(), "hash_rate_sma_1m".to_string()), + _2m: SeriesPattern1::new(client.clone(), "hash_rate_sma_2m".to_string()), + _1y: SeriesPattern1::new(client.clone(), "hash_rate_sma_1y".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cointime { - pub activity: MetricsTree_Cointime_Activity, - pub supply: MetricsTree_Cointime_Supply, - pub value: MetricsTree_Cointime_Value, - pub cap: MetricsTree_Cointime_Cap, - pub prices: MetricsTree_Cointime_Prices, - pub adjusted: MetricsTree_Cointime_Adjusted, - pub reserve_risk: MetricsTree_Cointime_ReserveRisk, +/// Series tree node. +pub struct SeriesTree_Cointime { + pub activity: SeriesTree_Cointime_Activity, + pub supply: SeriesTree_Cointime_Supply, + pub value: SeriesTree_Cointime_Value, + pub cap: SeriesTree_Cointime_Cap, + pub prices: SeriesTree_Cointime_Prices, + pub adjusted: SeriesTree_Cointime_Adjusted, + pub reserve_risk: SeriesTree_Cointime_ReserveRisk, pub coinblocks_destroyed: BaseCumulativeSumPattern, } -impl MetricsTree_Cointime { +impl SeriesTree_Cointime { pub fn new(client: Arc, base_path: String) -> Self { Self { - activity: MetricsTree_Cointime_Activity::new(client.clone(), format!("{base_path}_activity")), - supply: MetricsTree_Cointime_Supply::new(client.clone(), format!("{base_path}_supply")), - value: MetricsTree_Cointime_Value::new(client.clone(), format!("{base_path}_value")), - cap: MetricsTree_Cointime_Cap::new(client.clone(), format!("{base_path}_cap")), - prices: MetricsTree_Cointime_Prices::new(client.clone(), format!("{base_path}_prices")), - adjusted: MetricsTree_Cointime_Adjusted::new(client.clone(), format!("{base_path}_adjusted")), - reserve_risk: MetricsTree_Cointime_ReserveRisk::new(client.clone(), format!("{base_path}_reserve_risk")), + activity: SeriesTree_Cointime_Activity::new(client.clone(), format!("{base_path}_activity")), + supply: SeriesTree_Cointime_Supply::new(client.clone(), format!("{base_path}_supply")), + value: SeriesTree_Cointime_Value::new(client.clone(), format!("{base_path}_value")), + cap: SeriesTree_Cointime_Cap::new(client.clone(), format!("{base_path}_cap")), + prices: SeriesTree_Cointime_Prices::new(client.clone(), format!("{base_path}_prices")), + adjusted: SeriesTree_Cointime_Adjusted::new(client.clone(), format!("{base_path}_adjusted")), + reserve_risk: SeriesTree_Cointime_ReserveRisk::new(client.clone(), format!("{base_path}_reserve_risk")), coinblocks_destroyed: BaseCumulativeSumPattern::new(client.clone(), "coinblocks_destroyed".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cointime_Activity { +/// Series tree node. +pub struct SeriesTree_Cointime_Activity { pub coinblocks_created: BaseCumulativeSumPattern, pub coinblocks_stored: BaseCumulativeSumPattern, - pub liveliness: MetricPattern1, - pub vaultedness: MetricPattern1, - pub ratio: MetricPattern1, + pub liveliness: SeriesPattern1, + pub vaultedness: SeriesPattern1, + pub ratio: SeriesPattern1, } -impl MetricsTree_Cointime_Activity { +impl SeriesTree_Cointime_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { coinblocks_created: BaseCumulativeSumPattern::new(client.clone(), "coinblocks_created".to_string()), coinblocks_stored: BaseCumulativeSumPattern::new(client.clone(), "coinblocks_stored".to_string()), - liveliness: MetricPattern1::new(client.clone(), "liveliness".to_string()), - vaultedness: MetricPattern1::new(client.clone(), "vaultedness".to_string()), - ratio: MetricPattern1::new(client.clone(), "activity_to_vaultedness_ratio".to_string()), + liveliness: SeriesPattern1::new(client.clone(), "liveliness".to_string()), + vaultedness: SeriesPattern1::new(client.clone(), "vaultedness".to_string()), + ratio: SeriesPattern1::new(client.clone(), "activity_to_vaultedness_ratio".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cointime_Supply { +/// Series tree node. +pub struct SeriesTree_Cointime_Supply { pub vaulted: BtcCentsSatsUsdPattern, pub active: BtcCentsSatsUsdPattern, } -impl MetricsTree_Cointime_Supply { +impl SeriesTree_Cointime_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { vaulted: BtcCentsSatsUsdPattern::new(client.clone(), "vaulted_supply".to_string()), @@ -4181,15 +4181,15 @@ impl MetricsTree_Cointime_Supply { } } -/// Metrics tree node. -pub struct MetricsTree_Cointime_Value { +/// Series tree node. +pub struct SeriesTree_Cointime_Value { pub destroyed: BaseCumulativeSumPattern, pub created: BaseCumulativeSumPattern, pub stored: BaseCumulativeSumPattern, pub vocdd: BaseCumulativeSumPattern, } -impl MetricsTree_Cointime_Value { +impl SeriesTree_Cointime_Value { pub fn new(client: Arc, base_path: String) -> Self { Self { destroyed: BaseCumulativeSumPattern::new(client.clone(), "cointime_value_destroyed".to_string()), @@ -4200,8 +4200,8 @@ impl MetricsTree_Cointime_Value { } } -/// Metrics tree node. -pub struct MetricsTree_Cointime_Cap { +/// Series tree node. +pub struct SeriesTree_Cointime_Cap { pub thermo: CentsUsdPattern2, pub investor: CentsUsdPattern2, pub vaulted: CentsUsdPattern2, @@ -4210,7 +4210,7 @@ pub struct MetricsTree_Cointime_Cap { pub aviv: BpsRatioPattern2, } -impl MetricsTree_Cointime_Cap { +impl SeriesTree_Cointime_Cap { pub fn new(client: Arc, base_path: String) -> Self { Self { thermo: CentsUsdPattern2::new(client.clone(), "thermo_cap".to_string()), @@ -4223,8 +4223,8 @@ impl MetricsTree_Cointime_Cap { } } -/// Metrics tree node. -pub struct MetricsTree_Cointime_Prices { +/// Series tree node. +pub struct SeriesTree_Cointime_Prices { pub vaulted: BpsCentsPercentilesRatioSatsUsdPattern, pub active: BpsCentsPercentilesRatioSatsUsdPattern, pub true_market_mean: BpsCentsPercentilesRatioSatsUsdPattern, @@ -4233,10 +4233,10 @@ pub struct MetricsTree_Cointime_Prices { pub balanced: BpsCentsPercentilesRatioSatsUsdPattern, pub terminal: BpsCentsPercentilesRatioSatsUsdPattern, pub delta: BpsCentsPercentilesRatioSatsUsdPattern, - pub cumulative_market_cap: MetricPattern1, + pub cumulative_market_cap: SeriesPattern1, } -impl MetricsTree_Cointime_Prices { +impl SeriesTree_Cointime_Prices { pub fn new(client: Arc, base_path: String) -> Self { Self { vaulted: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "vaulted_price".to_string()), @@ -4247,696 +4247,696 @@ impl MetricsTree_Cointime_Prices { balanced: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "balanced_price".to_string()), terminal: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "terminal_price".to_string()), delta: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "delta_price".to_string()), - cumulative_market_cap: MetricPattern1::new(client.clone(), "cumulative_market_cap".to_string()), + cumulative_market_cap: SeriesPattern1::new(client.clone(), "cumulative_market_cap".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cointime_Adjusted { +/// Series tree node. +pub struct SeriesTree_Cointime_Adjusted { pub inflation_rate: BpsPercentRatioPattern, - pub tx_velocity_native: MetricPattern1, - pub tx_velocity_fiat: MetricPattern1, + pub tx_velocity_native: SeriesPattern1, + pub tx_velocity_fiat: SeriesPattern1, } -impl MetricsTree_Cointime_Adjusted { +impl SeriesTree_Cointime_Adjusted { pub fn new(client: Arc, base_path: String) -> Self { Self { inflation_rate: BpsPercentRatioPattern::new(client.clone(), "cointime_adj_inflation_rate".to_string()), - tx_velocity_native: MetricPattern1::new(client.clone(), "cointime_adj_tx_velocity".to_string()), - tx_velocity_fiat: MetricPattern1::new(client.clone(), "cointime_adj_tx_velocity_fiat".to_string()), + tx_velocity_native: SeriesPattern1::new(client.clone(), "cointime_adj_tx_velocity".to_string()), + tx_velocity_fiat: SeriesPattern1::new(client.clone(), "cointime_adj_tx_velocity_fiat".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cointime_ReserveRisk { - pub value: MetricPattern1, - pub vocdd_median_1y: MetricPattern18, - pub hodl_bank: MetricPattern18, +/// Series tree node. +pub struct SeriesTree_Cointime_ReserveRisk { + pub value: SeriesPattern1, + pub vocdd_median_1y: SeriesPattern18, + pub hodl_bank: SeriesPattern18, } -impl MetricsTree_Cointime_ReserveRisk { +impl SeriesTree_Cointime_ReserveRisk { pub fn new(client: Arc, base_path: String) -> Self { Self { - value: MetricPattern1::new(client.clone(), "reserve_risk".to_string()), - vocdd_median_1y: MetricPattern18::new(client.clone(), "vocdd_median_1y".to_string()), - hodl_bank: MetricPattern18::new(client.clone(), "hodl_bank".to_string()), + value: SeriesPattern1::new(client.clone(), "reserve_risk".to_string()), + vocdd_median_1y: SeriesPattern18::new(client.clone(), "vocdd_median_1y".to_string()), + hodl_bank: SeriesPattern18::new(client.clone(), "hodl_bank".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Constants { - pub _0: MetricPattern1, - pub _1: MetricPattern1, - pub _2: MetricPattern1, - pub _3: MetricPattern1, - pub _4: MetricPattern1, - pub _20: MetricPattern1, - pub _30: MetricPattern1, - pub _38_2: MetricPattern1, - pub _50: MetricPattern1, - pub _61_8: MetricPattern1, - pub _70: MetricPattern1, - pub _80: MetricPattern1, - pub _100: MetricPattern1, - pub _600: MetricPattern1, - pub minus_1: MetricPattern1, - pub minus_2: MetricPattern1, - pub minus_3: MetricPattern1, - pub minus_4: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Constants { + pub _0: SeriesPattern1, + pub _1: SeriesPattern1, + pub _2: SeriesPattern1, + pub _3: SeriesPattern1, + pub _4: SeriesPattern1, + pub _20: SeriesPattern1, + pub _30: SeriesPattern1, + pub _38_2: SeriesPattern1, + pub _50: SeriesPattern1, + pub _61_8: SeriesPattern1, + pub _70: SeriesPattern1, + pub _80: SeriesPattern1, + pub _100: SeriesPattern1, + pub _600: SeriesPattern1, + pub minus_1: SeriesPattern1, + pub minus_2: SeriesPattern1, + pub minus_3: SeriesPattern1, + pub minus_4: SeriesPattern1, } -impl MetricsTree_Constants { +impl SeriesTree_Constants { pub fn new(client: Arc, base_path: String) -> Self { Self { - _0: MetricPattern1::new(client.clone(), "constant_0".to_string()), - _1: MetricPattern1::new(client.clone(), "constant_1".to_string()), - _2: MetricPattern1::new(client.clone(), "constant_2".to_string()), - _3: MetricPattern1::new(client.clone(), "constant_3".to_string()), - _4: MetricPattern1::new(client.clone(), "constant_4".to_string()), - _20: MetricPattern1::new(client.clone(), "constant_20".to_string()), - _30: MetricPattern1::new(client.clone(), "constant_30".to_string()), - _38_2: MetricPattern1::new(client.clone(), "constant_38_2".to_string()), - _50: MetricPattern1::new(client.clone(), "constant_50".to_string()), - _61_8: MetricPattern1::new(client.clone(), "constant_61_8".to_string()), - _70: MetricPattern1::new(client.clone(), "constant_70".to_string()), - _80: MetricPattern1::new(client.clone(), "constant_80".to_string()), - _100: MetricPattern1::new(client.clone(), "constant_100".to_string()), - _600: MetricPattern1::new(client.clone(), "constant_600".to_string()), - minus_1: MetricPattern1::new(client.clone(), "constant_minus_1".to_string()), - minus_2: MetricPattern1::new(client.clone(), "constant_minus_2".to_string()), - minus_3: MetricPattern1::new(client.clone(), "constant_minus_3".to_string()), - minus_4: MetricPattern1::new(client.clone(), "constant_minus_4".to_string()), + _0: SeriesPattern1::new(client.clone(), "constant_0".to_string()), + _1: SeriesPattern1::new(client.clone(), "constant_1".to_string()), + _2: SeriesPattern1::new(client.clone(), "constant_2".to_string()), + _3: SeriesPattern1::new(client.clone(), "constant_3".to_string()), + _4: SeriesPattern1::new(client.clone(), "constant_4".to_string()), + _20: SeriesPattern1::new(client.clone(), "constant_20".to_string()), + _30: SeriesPattern1::new(client.clone(), "constant_30".to_string()), + _38_2: SeriesPattern1::new(client.clone(), "constant_38_2".to_string()), + _50: SeriesPattern1::new(client.clone(), "constant_50".to_string()), + _61_8: SeriesPattern1::new(client.clone(), "constant_61_8".to_string()), + _70: SeriesPattern1::new(client.clone(), "constant_70".to_string()), + _80: SeriesPattern1::new(client.clone(), "constant_80".to_string()), + _100: SeriesPattern1::new(client.clone(), "constant_100".to_string()), + _600: SeriesPattern1::new(client.clone(), "constant_600".to_string()), + minus_1: SeriesPattern1::new(client.clone(), "constant_minus_1".to_string()), + minus_2: SeriesPattern1::new(client.clone(), "constant_minus_2".to_string()), + minus_3: SeriesPattern1::new(client.clone(), "constant_minus_3".to_string()), + minus_4: SeriesPattern1::new(client.clone(), "constant_minus_4".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes { - pub address: MetricsTree_Indexes_Address, - pub height: MetricsTree_Indexes_Height, - pub epoch: MetricsTree_Indexes_Epoch, - pub halving: MetricsTree_Indexes_Halving, - pub minute10: MetricsTree_Indexes_Minute10, - pub minute30: MetricsTree_Indexes_Minute30, - pub hour1: MetricsTree_Indexes_Hour1, - pub hour4: MetricsTree_Indexes_Hour4, - pub hour12: MetricsTree_Indexes_Hour12, - pub day1: MetricsTree_Indexes_Day1, - pub day3: MetricsTree_Indexes_Day3, - pub week1: MetricsTree_Indexes_Week1, - pub month1: MetricsTree_Indexes_Month1, - pub month3: MetricsTree_Indexes_Month3, - pub month6: MetricsTree_Indexes_Month6, - pub year1: MetricsTree_Indexes_Year1, - pub year10: MetricsTree_Indexes_Year10, - pub tx_index: MetricsTree_Indexes_TxIndex, - pub txin_index: MetricsTree_Indexes_TxinIndex, - pub txout_index: MetricsTree_Indexes_TxoutIndex, +/// Series tree node. +pub struct SeriesTree_Indexes { + pub address: SeriesTree_Indexes_Address, + pub height: SeriesTree_Indexes_Height, + pub epoch: SeriesTree_Indexes_Epoch, + pub halving: SeriesTree_Indexes_Halving, + pub minute10: SeriesTree_Indexes_Minute10, + pub minute30: SeriesTree_Indexes_Minute30, + pub hour1: SeriesTree_Indexes_Hour1, + pub hour4: SeriesTree_Indexes_Hour4, + pub hour12: SeriesTree_Indexes_Hour12, + pub day1: SeriesTree_Indexes_Day1, + pub day3: SeriesTree_Indexes_Day3, + pub week1: SeriesTree_Indexes_Week1, + pub month1: SeriesTree_Indexes_Month1, + pub month3: SeriesTree_Indexes_Month3, + pub month6: SeriesTree_Indexes_Month6, + pub year1: SeriesTree_Indexes_Year1, + pub year10: SeriesTree_Indexes_Year10, + pub tx_index: SeriesTree_Indexes_TxIndex, + pub txin_index: SeriesTree_Indexes_TxinIndex, + pub txout_index: SeriesTree_Indexes_TxoutIndex, } -impl MetricsTree_Indexes { +impl SeriesTree_Indexes { pub fn new(client: Arc, base_path: String) -> Self { Self { - address: MetricsTree_Indexes_Address::new(client.clone(), format!("{base_path}_address")), - height: MetricsTree_Indexes_Height::new(client.clone(), format!("{base_path}_height")), - epoch: MetricsTree_Indexes_Epoch::new(client.clone(), format!("{base_path}_epoch")), - halving: MetricsTree_Indexes_Halving::new(client.clone(), format!("{base_path}_halving")), - minute10: MetricsTree_Indexes_Minute10::new(client.clone(), format!("{base_path}_minute10")), - minute30: MetricsTree_Indexes_Minute30::new(client.clone(), format!("{base_path}_minute30")), - hour1: MetricsTree_Indexes_Hour1::new(client.clone(), format!("{base_path}_hour1")), - hour4: MetricsTree_Indexes_Hour4::new(client.clone(), format!("{base_path}_hour4")), - hour12: MetricsTree_Indexes_Hour12::new(client.clone(), format!("{base_path}_hour12")), - day1: MetricsTree_Indexes_Day1::new(client.clone(), format!("{base_path}_day1")), - day3: MetricsTree_Indexes_Day3::new(client.clone(), format!("{base_path}_day3")), - week1: MetricsTree_Indexes_Week1::new(client.clone(), format!("{base_path}_week1")), - month1: MetricsTree_Indexes_Month1::new(client.clone(), format!("{base_path}_month1")), - month3: MetricsTree_Indexes_Month3::new(client.clone(), format!("{base_path}_month3")), - month6: MetricsTree_Indexes_Month6::new(client.clone(), format!("{base_path}_month6")), - year1: MetricsTree_Indexes_Year1::new(client.clone(), format!("{base_path}_year1")), - year10: MetricsTree_Indexes_Year10::new(client.clone(), format!("{base_path}_year10")), - tx_index: MetricsTree_Indexes_TxIndex::new(client.clone(), format!("{base_path}_tx_index")), - txin_index: MetricsTree_Indexes_TxinIndex::new(client.clone(), format!("{base_path}_txin_index")), - txout_index: MetricsTree_Indexes_TxoutIndex::new(client.clone(), format!("{base_path}_txout_index")), + address: SeriesTree_Indexes_Address::new(client.clone(), format!("{base_path}_address")), + height: SeriesTree_Indexes_Height::new(client.clone(), format!("{base_path}_height")), + epoch: SeriesTree_Indexes_Epoch::new(client.clone(), format!("{base_path}_epoch")), + halving: SeriesTree_Indexes_Halving::new(client.clone(), format!("{base_path}_halving")), + minute10: SeriesTree_Indexes_Minute10::new(client.clone(), format!("{base_path}_minute10")), + minute30: SeriesTree_Indexes_Minute30::new(client.clone(), format!("{base_path}_minute30")), + hour1: SeriesTree_Indexes_Hour1::new(client.clone(), format!("{base_path}_hour1")), + hour4: SeriesTree_Indexes_Hour4::new(client.clone(), format!("{base_path}_hour4")), + hour12: SeriesTree_Indexes_Hour12::new(client.clone(), format!("{base_path}_hour12")), + day1: SeriesTree_Indexes_Day1::new(client.clone(), format!("{base_path}_day1")), + day3: SeriesTree_Indexes_Day3::new(client.clone(), format!("{base_path}_day3")), + week1: SeriesTree_Indexes_Week1::new(client.clone(), format!("{base_path}_week1")), + month1: SeriesTree_Indexes_Month1::new(client.clone(), format!("{base_path}_month1")), + month3: SeriesTree_Indexes_Month3::new(client.clone(), format!("{base_path}_month3")), + month6: SeriesTree_Indexes_Month6::new(client.clone(), format!("{base_path}_month6")), + year1: SeriesTree_Indexes_Year1::new(client.clone(), format!("{base_path}_year1")), + year10: SeriesTree_Indexes_Year10::new(client.clone(), format!("{base_path}_year10")), + tx_index: SeriesTree_Indexes_TxIndex::new(client.clone(), format!("{base_path}_tx_index")), + txin_index: SeriesTree_Indexes_TxinIndex::new(client.clone(), format!("{base_path}_txin_index")), + txout_index: SeriesTree_Indexes_TxoutIndex::new(client.clone(), format!("{base_path}_txout_index")), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address { - pub p2pk33: MetricsTree_Indexes_Address_P2pk33, - pub p2pk65: MetricsTree_Indexes_Address_P2pk65, - pub p2pkh: MetricsTree_Indexes_Address_P2pkh, - pub p2sh: MetricsTree_Indexes_Address_P2sh, - pub p2tr: MetricsTree_Indexes_Address_P2tr, - pub p2wpkh: MetricsTree_Indexes_Address_P2wpkh, - pub p2wsh: MetricsTree_Indexes_Address_P2wsh, - pub p2a: MetricsTree_Indexes_Address_P2a, - pub p2ms: MetricsTree_Indexes_Address_P2ms, - pub empty: MetricsTree_Indexes_Address_Empty, - pub unknown: MetricsTree_Indexes_Address_Unknown, - pub op_return: MetricsTree_Indexes_Address_OpReturn, +/// Series tree node. +pub struct SeriesTree_Indexes_Address { + pub p2pk33: SeriesTree_Indexes_Address_P2pk33, + pub p2pk65: SeriesTree_Indexes_Address_P2pk65, + pub p2pkh: SeriesTree_Indexes_Address_P2pkh, + pub p2sh: SeriesTree_Indexes_Address_P2sh, + pub p2tr: SeriesTree_Indexes_Address_P2tr, + pub p2wpkh: SeriesTree_Indexes_Address_P2wpkh, + pub p2wsh: SeriesTree_Indexes_Address_P2wsh, + pub p2a: SeriesTree_Indexes_Address_P2a, + pub p2ms: SeriesTree_Indexes_Address_P2ms, + pub empty: SeriesTree_Indexes_Address_Empty, + pub unknown: SeriesTree_Indexes_Address_Unknown, + pub op_return: SeriesTree_Indexes_Address_OpReturn, } -impl MetricsTree_Indexes_Address { +impl SeriesTree_Indexes_Address { pub fn new(client: Arc, base_path: String) -> Self { Self { - p2pk33: MetricsTree_Indexes_Address_P2pk33::new(client.clone(), format!("{base_path}_p2pk33")), - p2pk65: MetricsTree_Indexes_Address_P2pk65::new(client.clone(), format!("{base_path}_p2pk65")), - p2pkh: MetricsTree_Indexes_Address_P2pkh::new(client.clone(), format!("{base_path}_p2pkh")), - p2sh: MetricsTree_Indexes_Address_P2sh::new(client.clone(), format!("{base_path}_p2sh")), - p2tr: MetricsTree_Indexes_Address_P2tr::new(client.clone(), format!("{base_path}_p2tr")), - p2wpkh: MetricsTree_Indexes_Address_P2wpkh::new(client.clone(), format!("{base_path}_p2wpkh")), - p2wsh: MetricsTree_Indexes_Address_P2wsh::new(client.clone(), format!("{base_path}_p2wsh")), - p2a: MetricsTree_Indexes_Address_P2a::new(client.clone(), format!("{base_path}_p2a")), - p2ms: MetricsTree_Indexes_Address_P2ms::new(client.clone(), format!("{base_path}_p2ms")), - empty: MetricsTree_Indexes_Address_Empty::new(client.clone(), format!("{base_path}_empty")), - unknown: MetricsTree_Indexes_Address_Unknown::new(client.clone(), format!("{base_path}_unknown")), - op_return: MetricsTree_Indexes_Address_OpReturn::new(client.clone(), format!("{base_path}_op_return")), + p2pk33: SeriesTree_Indexes_Address_P2pk33::new(client.clone(), format!("{base_path}_p2pk33")), + p2pk65: SeriesTree_Indexes_Address_P2pk65::new(client.clone(), format!("{base_path}_p2pk65")), + p2pkh: SeriesTree_Indexes_Address_P2pkh::new(client.clone(), format!("{base_path}_p2pkh")), + p2sh: SeriesTree_Indexes_Address_P2sh::new(client.clone(), format!("{base_path}_p2sh")), + p2tr: SeriesTree_Indexes_Address_P2tr::new(client.clone(), format!("{base_path}_p2tr")), + p2wpkh: SeriesTree_Indexes_Address_P2wpkh::new(client.clone(), format!("{base_path}_p2wpkh")), + p2wsh: SeriesTree_Indexes_Address_P2wsh::new(client.clone(), format!("{base_path}_p2wsh")), + p2a: SeriesTree_Indexes_Address_P2a::new(client.clone(), format!("{base_path}_p2a")), + p2ms: SeriesTree_Indexes_Address_P2ms::new(client.clone(), format!("{base_path}_p2ms")), + empty: SeriesTree_Indexes_Address_Empty::new(client.clone(), format!("{base_path}_empty")), + unknown: SeriesTree_Indexes_Address_Unknown::new(client.clone(), format!("{base_path}_unknown")), + op_return: SeriesTree_Indexes_Address_OpReturn::new(client.clone(), format!("{base_path}_op_return")), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_P2pk33 { - pub identity: MetricPattern26, - pub address: MetricPattern26
, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_P2pk33 { + pub identity: SeriesPattern26, + pub address: SeriesPattern26
, } -impl MetricsTree_Indexes_Address_P2pk33 { +impl SeriesTree_Indexes_Address_P2pk33 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern26::new(client.clone(), "p2pk33_address_index".to_string()), - address: MetricPattern26::new(client.clone(), "p2pk33_address".to_string()), + identity: SeriesPattern26::new(client.clone(), "p2pk33_address_index".to_string()), + address: SeriesPattern26::new(client.clone(), "p2pk33_address".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_P2pk65 { - pub identity: MetricPattern27, - pub address: MetricPattern27
, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_P2pk65 { + pub identity: SeriesPattern27, + pub address: SeriesPattern27
, } -impl MetricsTree_Indexes_Address_P2pk65 { +impl SeriesTree_Indexes_Address_P2pk65 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern27::new(client.clone(), "p2pk65_address_index".to_string()), - address: MetricPattern27::new(client.clone(), "p2pk65_address".to_string()), + identity: SeriesPattern27::new(client.clone(), "p2pk65_address_index".to_string()), + address: SeriesPattern27::new(client.clone(), "p2pk65_address".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_P2pkh { - pub identity: MetricPattern28, - pub address: MetricPattern28
, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_P2pkh { + pub identity: SeriesPattern28, + pub address: SeriesPattern28
, } -impl MetricsTree_Indexes_Address_P2pkh { +impl SeriesTree_Indexes_Address_P2pkh { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern28::new(client.clone(), "p2pkh_address_index".to_string()), - address: MetricPattern28::new(client.clone(), "p2pkh_address".to_string()), + identity: SeriesPattern28::new(client.clone(), "p2pkh_address_index".to_string()), + address: SeriesPattern28::new(client.clone(), "p2pkh_address".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_P2sh { - pub identity: MetricPattern29, - pub address: MetricPattern29
, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_P2sh { + pub identity: SeriesPattern29, + pub address: SeriesPattern29
, } -impl MetricsTree_Indexes_Address_P2sh { +impl SeriesTree_Indexes_Address_P2sh { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern29::new(client.clone(), "p2sh_address_index".to_string()), - address: MetricPattern29::new(client.clone(), "p2sh_address".to_string()), + identity: SeriesPattern29::new(client.clone(), "p2sh_address_index".to_string()), + address: SeriesPattern29::new(client.clone(), "p2sh_address".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_P2tr { - pub identity: MetricPattern30, - pub address: MetricPattern30
, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_P2tr { + pub identity: SeriesPattern30, + pub address: SeriesPattern30
, } -impl MetricsTree_Indexes_Address_P2tr { +impl SeriesTree_Indexes_Address_P2tr { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern30::new(client.clone(), "p2tr_address_index".to_string()), - address: MetricPattern30::new(client.clone(), "p2tr_address".to_string()), + identity: SeriesPattern30::new(client.clone(), "p2tr_address_index".to_string()), + address: SeriesPattern30::new(client.clone(), "p2tr_address".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_P2wpkh { - pub identity: MetricPattern31, - pub address: MetricPattern31
, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_P2wpkh { + pub identity: SeriesPattern31, + pub address: SeriesPattern31
, } -impl MetricsTree_Indexes_Address_P2wpkh { +impl SeriesTree_Indexes_Address_P2wpkh { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern31::new(client.clone(), "p2wpkh_address_index".to_string()), - address: MetricPattern31::new(client.clone(), "p2wpkh_address".to_string()), + identity: SeriesPattern31::new(client.clone(), "p2wpkh_address_index".to_string()), + address: SeriesPattern31::new(client.clone(), "p2wpkh_address".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_P2wsh { - pub identity: MetricPattern32, - pub address: MetricPattern32
, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_P2wsh { + pub identity: SeriesPattern32, + pub address: SeriesPattern32
, } -impl MetricsTree_Indexes_Address_P2wsh { +impl SeriesTree_Indexes_Address_P2wsh { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern32::new(client.clone(), "p2wsh_address_index".to_string()), - address: MetricPattern32::new(client.clone(), "p2wsh_address".to_string()), + identity: SeriesPattern32::new(client.clone(), "p2wsh_address_index".to_string()), + address: SeriesPattern32::new(client.clone(), "p2wsh_address".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_P2a { - pub identity: MetricPattern24, - pub address: MetricPattern24
, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_P2a { + pub identity: SeriesPattern24, + pub address: SeriesPattern24
, } -impl MetricsTree_Indexes_Address_P2a { +impl SeriesTree_Indexes_Address_P2a { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern24::new(client.clone(), "p2a_address_index".to_string()), - address: MetricPattern24::new(client.clone(), "p2a_address".to_string()), + identity: SeriesPattern24::new(client.clone(), "p2a_address_index".to_string()), + address: SeriesPattern24::new(client.clone(), "p2a_address".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_P2ms { - pub identity: MetricPattern25, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_P2ms { + pub identity: SeriesPattern25, } -impl MetricsTree_Indexes_Address_P2ms { +impl SeriesTree_Indexes_Address_P2ms { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern25::new(client.clone(), "p2ms_output_index".to_string()), + identity: SeriesPattern25::new(client.clone(), "p2ms_output_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_Empty { - pub identity: MetricPattern22, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_Empty { + pub identity: SeriesPattern22, } -impl MetricsTree_Indexes_Address_Empty { +impl SeriesTree_Indexes_Address_Empty { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern22::new(client.clone(), "empty_output_index".to_string()), + identity: SeriesPattern22::new(client.clone(), "empty_output_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_Unknown { - pub identity: MetricPattern33, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_Unknown { + pub identity: SeriesPattern33, } -impl MetricsTree_Indexes_Address_Unknown { +impl SeriesTree_Indexes_Address_Unknown { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern33::new(client.clone(), "unknown_output_index".to_string()), + identity: SeriesPattern33::new(client.clone(), "unknown_output_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Address_OpReturn { - pub identity: MetricPattern23, +/// Series tree node. +pub struct SeriesTree_Indexes_Address_OpReturn { + pub identity: SeriesPattern23, } -impl MetricsTree_Indexes_Address_OpReturn { +impl SeriesTree_Indexes_Address_OpReturn { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern23::new(client.clone(), "op_return_index".to_string()), + identity: SeriesPattern23::new(client.clone(), "op_return_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Height { - pub identity: MetricPattern18, - pub minute10: MetricPattern18, - pub minute30: MetricPattern18, - pub hour1: MetricPattern18, - pub hour4: MetricPattern18, - pub hour12: MetricPattern18, - pub day1: MetricPattern18, - pub day3: MetricPattern18, - pub epoch: MetricPattern18, - pub halving: MetricPattern18, - pub week1: MetricPattern18, - pub month1: MetricPattern18, - pub month3: MetricPattern18, - pub month6: MetricPattern18, - pub year1: MetricPattern18, - pub year10: MetricPattern18, - pub tx_index_count: MetricPattern18, +/// Series tree node. +pub struct SeriesTree_Indexes_Height { + pub identity: SeriesPattern18, + pub minute10: SeriesPattern18, + pub minute30: SeriesPattern18, + pub hour1: SeriesPattern18, + pub hour4: SeriesPattern18, + pub hour12: SeriesPattern18, + pub day1: SeriesPattern18, + pub day3: SeriesPattern18, + pub epoch: SeriesPattern18, + pub halving: SeriesPattern18, + pub week1: SeriesPattern18, + pub month1: SeriesPattern18, + pub month3: SeriesPattern18, + pub month6: SeriesPattern18, + pub year1: SeriesPattern18, + pub year10: SeriesPattern18, + pub tx_index_count: SeriesPattern18, } -impl MetricsTree_Indexes_Height { +impl SeriesTree_Indexes_Height { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern18::new(client.clone(), "height".to_string()), - minute10: MetricPattern18::new(client.clone(), "minute10".to_string()), - minute30: MetricPattern18::new(client.clone(), "minute30".to_string()), - hour1: MetricPattern18::new(client.clone(), "hour1".to_string()), - hour4: MetricPattern18::new(client.clone(), "hour4".to_string()), - hour12: MetricPattern18::new(client.clone(), "hour12".to_string()), - day1: MetricPattern18::new(client.clone(), "day1".to_string()), - day3: MetricPattern18::new(client.clone(), "day3".to_string()), - epoch: MetricPattern18::new(client.clone(), "epoch".to_string()), - halving: MetricPattern18::new(client.clone(), "halving".to_string()), - week1: MetricPattern18::new(client.clone(), "week1".to_string()), - month1: MetricPattern18::new(client.clone(), "month1".to_string()), - month3: MetricPattern18::new(client.clone(), "month3".to_string()), - month6: MetricPattern18::new(client.clone(), "month6".to_string()), - year1: MetricPattern18::new(client.clone(), "year1".to_string()), - year10: MetricPattern18::new(client.clone(), "year10".to_string()), - tx_index_count: MetricPattern18::new(client.clone(), "tx_index_count".to_string()), + identity: SeriesPattern18::new(client.clone(), "height".to_string()), + minute10: SeriesPattern18::new(client.clone(), "minute10".to_string()), + minute30: SeriesPattern18::new(client.clone(), "minute30".to_string()), + hour1: SeriesPattern18::new(client.clone(), "hour1".to_string()), + hour4: SeriesPattern18::new(client.clone(), "hour4".to_string()), + hour12: SeriesPattern18::new(client.clone(), "hour12".to_string()), + day1: SeriesPattern18::new(client.clone(), "day1".to_string()), + day3: SeriesPattern18::new(client.clone(), "day3".to_string()), + epoch: SeriesPattern18::new(client.clone(), "epoch".to_string()), + halving: SeriesPattern18::new(client.clone(), "halving".to_string()), + week1: SeriesPattern18::new(client.clone(), "week1".to_string()), + month1: SeriesPattern18::new(client.clone(), "month1".to_string()), + month3: SeriesPattern18::new(client.clone(), "month3".to_string()), + month6: SeriesPattern18::new(client.clone(), "month6".to_string()), + year1: SeriesPattern18::new(client.clone(), "year1".to_string()), + year10: SeriesPattern18::new(client.clone(), "year10".to_string()), + tx_index_count: SeriesPattern18::new(client.clone(), "tx_index_count".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Epoch { - pub identity: MetricPattern17, - pub first_height: MetricPattern17, - pub height_count: MetricPattern17, +/// Series tree node. +pub struct SeriesTree_Indexes_Epoch { + pub identity: SeriesPattern17, + pub first_height: SeriesPattern17, + pub height_count: SeriesPattern17, } -impl MetricsTree_Indexes_Epoch { +impl SeriesTree_Indexes_Epoch { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern17::new(client.clone(), "epoch".to_string()), - first_height: MetricPattern17::new(client.clone(), "first_height".to_string()), - height_count: MetricPattern17::new(client.clone(), "height_count".to_string()), + identity: SeriesPattern17::new(client.clone(), "epoch".to_string()), + first_height: SeriesPattern17::new(client.clone(), "first_height".to_string()), + height_count: SeriesPattern17::new(client.clone(), "height_count".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Halving { - pub identity: MetricPattern16, - pub first_height: MetricPattern16, +/// Series tree node. +pub struct SeriesTree_Indexes_Halving { + pub identity: SeriesPattern16, + pub first_height: SeriesPattern16, } -impl MetricsTree_Indexes_Halving { +impl SeriesTree_Indexes_Halving { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern16::new(client.clone(), "halving".to_string()), - first_height: MetricPattern16::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern16::new(client.clone(), "halving".to_string()), + first_height: SeriesPattern16::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Minute10 { - pub identity: MetricPattern3, - pub first_height: MetricPattern3, +/// Series tree node. +pub struct SeriesTree_Indexes_Minute10 { + pub identity: SeriesPattern3, + pub first_height: SeriesPattern3, } -impl MetricsTree_Indexes_Minute10 { +impl SeriesTree_Indexes_Minute10 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern3::new(client.clone(), "minute10_index".to_string()), - first_height: MetricPattern3::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern3::new(client.clone(), "minute10_index".to_string()), + first_height: SeriesPattern3::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Minute30 { - pub identity: MetricPattern4, - pub first_height: MetricPattern4, +/// Series tree node. +pub struct SeriesTree_Indexes_Minute30 { + pub identity: SeriesPattern4, + pub first_height: SeriesPattern4, } -impl MetricsTree_Indexes_Minute30 { +impl SeriesTree_Indexes_Minute30 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern4::new(client.clone(), "minute30_index".to_string()), - first_height: MetricPattern4::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern4::new(client.clone(), "minute30_index".to_string()), + first_height: SeriesPattern4::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Hour1 { - pub identity: MetricPattern5, - pub first_height: MetricPattern5, +/// Series tree node. +pub struct SeriesTree_Indexes_Hour1 { + pub identity: SeriesPattern5, + pub first_height: SeriesPattern5, } -impl MetricsTree_Indexes_Hour1 { +impl SeriesTree_Indexes_Hour1 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern5::new(client.clone(), "hour1_index".to_string()), - first_height: MetricPattern5::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern5::new(client.clone(), "hour1_index".to_string()), + first_height: SeriesPattern5::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Hour4 { - pub identity: MetricPattern6, - pub first_height: MetricPattern6, +/// Series tree node. +pub struct SeriesTree_Indexes_Hour4 { + pub identity: SeriesPattern6, + pub first_height: SeriesPattern6, } -impl MetricsTree_Indexes_Hour4 { +impl SeriesTree_Indexes_Hour4 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern6::new(client.clone(), "hour4_index".to_string()), - first_height: MetricPattern6::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern6::new(client.clone(), "hour4_index".to_string()), + first_height: SeriesPattern6::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Hour12 { - pub identity: MetricPattern7, - pub first_height: MetricPattern7, +/// Series tree node. +pub struct SeriesTree_Indexes_Hour12 { + pub identity: SeriesPattern7, + pub first_height: SeriesPattern7, } -impl MetricsTree_Indexes_Hour12 { +impl SeriesTree_Indexes_Hour12 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern7::new(client.clone(), "hour12_index".to_string()), - first_height: MetricPattern7::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern7::new(client.clone(), "hour12_index".to_string()), + first_height: SeriesPattern7::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Day1 { - pub identity: MetricPattern8, - pub date: MetricPattern8, - pub first_height: MetricPattern8, - pub height_count: MetricPattern8, +/// Series tree node. +pub struct SeriesTree_Indexes_Day1 { + pub identity: SeriesPattern8, + pub date: SeriesPattern8, + pub first_height: SeriesPattern8, + pub height_count: SeriesPattern8, } -impl MetricsTree_Indexes_Day1 { +impl SeriesTree_Indexes_Day1 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern8::new(client.clone(), "day1_index".to_string()), - date: MetricPattern8::new(client.clone(), "date".to_string()), - first_height: MetricPattern8::new(client.clone(), "first_height".to_string()), - height_count: MetricPattern8::new(client.clone(), "height_count".to_string()), + identity: SeriesPattern8::new(client.clone(), "day1_index".to_string()), + date: SeriesPattern8::new(client.clone(), "date".to_string()), + first_height: SeriesPattern8::new(client.clone(), "first_height".to_string()), + height_count: SeriesPattern8::new(client.clone(), "height_count".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Day3 { - pub identity: MetricPattern9, - pub first_height: MetricPattern9, +/// Series tree node. +pub struct SeriesTree_Indexes_Day3 { + pub identity: SeriesPattern9, + pub first_height: SeriesPattern9, } -impl MetricsTree_Indexes_Day3 { +impl SeriesTree_Indexes_Day3 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern9::new(client.clone(), "day3_index".to_string()), - first_height: MetricPattern9::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern9::new(client.clone(), "day3_index".to_string()), + first_height: SeriesPattern9::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Week1 { - pub identity: MetricPattern10, - pub date: MetricPattern10, - pub first_height: MetricPattern10, +/// Series tree node. +pub struct SeriesTree_Indexes_Week1 { + pub identity: SeriesPattern10, + pub date: SeriesPattern10, + pub first_height: SeriesPattern10, } -impl MetricsTree_Indexes_Week1 { +impl SeriesTree_Indexes_Week1 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern10::new(client.clone(), "week1_index".to_string()), - date: MetricPattern10::new(client.clone(), "date".to_string()), - first_height: MetricPattern10::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern10::new(client.clone(), "week1_index".to_string()), + date: SeriesPattern10::new(client.clone(), "date".to_string()), + first_height: SeriesPattern10::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Month1 { - pub identity: MetricPattern11, - pub date: MetricPattern11, - pub first_height: MetricPattern11, +/// Series tree node. +pub struct SeriesTree_Indexes_Month1 { + pub identity: SeriesPattern11, + pub date: SeriesPattern11, + pub first_height: SeriesPattern11, } -impl MetricsTree_Indexes_Month1 { +impl SeriesTree_Indexes_Month1 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern11::new(client.clone(), "month1_index".to_string()), - date: MetricPattern11::new(client.clone(), "date".to_string()), - first_height: MetricPattern11::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern11::new(client.clone(), "month1_index".to_string()), + date: SeriesPattern11::new(client.clone(), "date".to_string()), + first_height: SeriesPattern11::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Month3 { - pub identity: MetricPattern12, - pub date: MetricPattern12, - pub first_height: MetricPattern12, +/// Series tree node. +pub struct SeriesTree_Indexes_Month3 { + pub identity: SeriesPattern12, + pub date: SeriesPattern12, + pub first_height: SeriesPattern12, } -impl MetricsTree_Indexes_Month3 { +impl SeriesTree_Indexes_Month3 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern12::new(client.clone(), "month3_index".to_string()), - date: MetricPattern12::new(client.clone(), "date".to_string()), - first_height: MetricPattern12::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern12::new(client.clone(), "month3_index".to_string()), + date: SeriesPattern12::new(client.clone(), "date".to_string()), + first_height: SeriesPattern12::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Month6 { - pub identity: MetricPattern13, - pub date: MetricPattern13, - pub first_height: MetricPattern13, +/// Series tree node. +pub struct SeriesTree_Indexes_Month6 { + pub identity: SeriesPattern13, + pub date: SeriesPattern13, + pub first_height: SeriesPattern13, } -impl MetricsTree_Indexes_Month6 { +impl SeriesTree_Indexes_Month6 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern13::new(client.clone(), "month6_index".to_string()), - date: MetricPattern13::new(client.clone(), "date".to_string()), - first_height: MetricPattern13::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern13::new(client.clone(), "month6_index".to_string()), + date: SeriesPattern13::new(client.clone(), "date".to_string()), + first_height: SeriesPattern13::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Year1 { - pub identity: MetricPattern14, - pub date: MetricPattern14, - pub first_height: MetricPattern14, +/// Series tree node. +pub struct SeriesTree_Indexes_Year1 { + pub identity: SeriesPattern14, + pub date: SeriesPattern14, + pub first_height: SeriesPattern14, } -impl MetricsTree_Indexes_Year1 { +impl SeriesTree_Indexes_Year1 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern14::new(client.clone(), "year1_index".to_string()), - date: MetricPattern14::new(client.clone(), "date".to_string()), - first_height: MetricPattern14::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern14::new(client.clone(), "year1_index".to_string()), + date: SeriesPattern14::new(client.clone(), "date".to_string()), + first_height: SeriesPattern14::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_Year10 { - pub identity: MetricPattern15, - pub date: MetricPattern15, - pub first_height: MetricPattern15, +/// Series tree node. +pub struct SeriesTree_Indexes_Year10 { + pub identity: SeriesPattern15, + pub date: SeriesPattern15, + pub first_height: SeriesPattern15, } -impl MetricsTree_Indexes_Year10 { +impl SeriesTree_Indexes_Year10 { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern15::new(client.clone(), "year10_index".to_string()), - date: MetricPattern15::new(client.clone(), "date".to_string()), - first_height: MetricPattern15::new(client.clone(), "first_height".to_string()), + identity: SeriesPattern15::new(client.clone(), "year10_index".to_string()), + date: SeriesPattern15::new(client.clone(), "date".to_string()), + first_height: SeriesPattern15::new(client.clone(), "first_height".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_TxIndex { - pub identity: MetricPattern19, - pub input_count: MetricPattern19, - pub output_count: MetricPattern19, +/// Series tree node. +pub struct SeriesTree_Indexes_TxIndex { + pub identity: SeriesPattern19, + pub input_count: SeriesPattern19, + pub output_count: SeriesPattern19, } -impl MetricsTree_Indexes_TxIndex { +impl SeriesTree_Indexes_TxIndex { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern19::new(client.clone(), "tx_index".to_string()), - input_count: MetricPattern19::new(client.clone(), "input_count".to_string()), - output_count: MetricPattern19::new(client.clone(), "output_count".to_string()), + identity: SeriesPattern19::new(client.clone(), "tx_index".to_string()), + input_count: SeriesPattern19::new(client.clone(), "input_count".to_string()), + output_count: SeriesPattern19::new(client.clone(), "output_count".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_TxinIndex { - pub identity: MetricPattern20, +/// Series tree node. +pub struct SeriesTree_Indexes_TxinIndex { + pub identity: SeriesPattern20, } -impl MetricsTree_Indexes_TxinIndex { +impl SeriesTree_Indexes_TxinIndex { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern20::new(client.clone(), "txin_index".to_string()), + identity: SeriesPattern20::new(client.clone(), "txin_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indexes_TxoutIndex { - pub identity: MetricPattern21, +/// Series tree node. +pub struct SeriesTree_Indexes_TxoutIndex { + pub identity: SeriesPattern21, } -impl MetricsTree_Indexes_TxoutIndex { +impl SeriesTree_Indexes_TxoutIndex { pub fn new(client: Arc, base_path: String) -> Self { Self { - identity: MetricPattern21::new(client.clone(), "txout_index".to_string()), + identity: SeriesPattern21::new(client.clone(), "txout_index".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indicators { +/// Series tree node. +pub struct SeriesTree_Indicators { pub puell_multiple: BpsRatioPattern2, pub nvt: BpsRatioPattern2, pub gini: BpsPercentRatioPattern3, pub rhodl_ratio: BpsRatioPattern2, pub thermocap_multiple: BpsRatioPattern2, - pub coindays_destroyed_supply_adjusted: MetricPattern1, - pub coinyears_destroyed_supply_adjusted: MetricPattern1, - pub dormancy: MetricsTree_Indicators_Dormancy, - pub stock_to_flow: MetricPattern1, - pub seller_exhaustion_constant: MetricPattern1, + pub coindays_destroyed_supply_adjusted: SeriesPattern1, + pub coinyears_destroyed_supply_adjusted: SeriesPattern1, + pub dormancy: SeriesTree_Indicators_Dormancy, + pub stock_to_flow: SeriesPattern1, + pub seller_exhaustion_constant: SeriesPattern1, } -impl MetricsTree_Indicators { +impl SeriesTree_Indicators { pub fn new(client: Arc, base_path: String) -> Self { Self { puell_multiple: BpsRatioPattern2::new(client.clone(), "puell_multiple".to_string()), @@ -4944,82 +4944,82 @@ impl MetricsTree_Indicators { gini: BpsPercentRatioPattern3::new(client.clone(), "gini".to_string()), rhodl_ratio: BpsRatioPattern2::new(client.clone(), "rhodl_ratio".to_string()), thermocap_multiple: BpsRatioPattern2::new(client.clone(), "thermocap_multiple".to_string()), - coindays_destroyed_supply_adjusted: MetricPattern1::new(client.clone(), "coindays_destroyed_supply_adjusted".to_string()), - coinyears_destroyed_supply_adjusted: MetricPattern1::new(client.clone(), "coinyears_destroyed_supply_adjusted".to_string()), - dormancy: MetricsTree_Indicators_Dormancy::new(client.clone(), format!("{base_path}_dormancy")), - stock_to_flow: MetricPattern1::new(client.clone(), "stock_to_flow".to_string()), - seller_exhaustion_constant: MetricPattern1::new(client.clone(), "seller_exhaustion_constant".to_string()), + coindays_destroyed_supply_adjusted: SeriesPattern1::new(client.clone(), "coindays_destroyed_supply_adjusted".to_string()), + coinyears_destroyed_supply_adjusted: SeriesPattern1::new(client.clone(), "coinyears_destroyed_supply_adjusted".to_string()), + dormancy: SeriesTree_Indicators_Dormancy::new(client.clone(), format!("{base_path}_dormancy")), + stock_to_flow: SeriesPattern1::new(client.clone(), "stock_to_flow".to_string()), + seller_exhaustion_constant: SeriesPattern1::new(client.clone(), "seller_exhaustion_constant".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Indicators_Dormancy { - pub supply_adjusted: MetricPattern1, - pub flow: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Indicators_Dormancy { + pub supply_adjusted: SeriesPattern1, + pub flow: SeriesPattern1, } -impl MetricsTree_Indicators_Dormancy { +impl SeriesTree_Indicators_Dormancy { pub fn new(client: Arc, base_path: String) -> Self { Self { - supply_adjusted: MetricPattern1::new(client.clone(), "dormancy_supply_adjusted".to_string()), - flow: MetricPattern1::new(client.clone(), "dormancy_flow".to_string()), + supply_adjusted: SeriesPattern1::new(client.clone(), "dormancy_supply_adjusted".to_string()), + flow: SeriesPattern1::new(client.clone(), "dormancy_flow".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market { - pub ath: MetricsTree_Market_Ath, - pub lookback: MetricsTree_Market_Lookback, - pub returns: MetricsTree_Market_Returns, - pub volatility: MetricsTree_Market_Volatility, - pub range: MetricsTree_Market_Range, - pub moving_average: MetricsTree_Market_MovingAverage, - pub dca: MetricsTree_Market_Dca, - pub technical: MetricsTree_Market_Technical, +/// Series tree node. +pub struct SeriesTree_Market { + pub ath: SeriesTree_Market_Ath, + pub lookback: SeriesTree_Market_Lookback, + pub returns: SeriesTree_Market_Returns, + pub volatility: SeriesTree_Market_Volatility, + pub range: SeriesTree_Market_Range, + pub moving_average: SeriesTree_Market_MovingAverage, + pub dca: SeriesTree_Market_Dca, + pub technical: SeriesTree_Market_Technical, } -impl MetricsTree_Market { +impl SeriesTree_Market { pub fn new(client: Arc, base_path: String) -> Self { Self { - ath: MetricsTree_Market_Ath::new(client.clone(), format!("{base_path}_ath")), - lookback: MetricsTree_Market_Lookback::new(client.clone(), format!("{base_path}_lookback")), - returns: MetricsTree_Market_Returns::new(client.clone(), format!("{base_path}_returns")), - volatility: MetricsTree_Market_Volatility::new(client.clone(), format!("{base_path}_volatility")), - range: MetricsTree_Market_Range::new(client.clone(), format!("{base_path}_range")), - moving_average: MetricsTree_Market_MovingAverage::new(client.clone(), format!("{base_path}_moving_average")), - dca: MetricsTree_Market_Dca::new(client.clone(), format!("{base_path}_dca")), - technical: MetricsTree_Market_Technical::new(client.clone(), format!("{base_path}_technical")), + ath: SeriesTree_Market_Ath::new(client.clone(), format!("{base_path}_ath")), + lookback: SeriesTree_Market_Lookback::new(client.clone(), format!("{base_path}_lookback")), + returns: SeriesTree_Market_Returns::new(client.clone(), format!("{base_path}_returns")), + volatility: SeriesTree_Market_Volatility::new(client.clone(), format!("{base_path}_volatility")), + range: SeriesTree_Market_Range::new(client.clone(), format!("{base_path}_range")), + moving_average: SeriesTree_Market_MovingAverage::new(client.clone(), format!("{base_path}_moving_average")), + dca: SeriesTree_Market_Dca::new(client.clone(), format!("{base_path}_dca")), + technical: SeriesTree_Market_Technical::new(client.clone(), format!("{base_path}_technical")), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Ath { +/// Series tree node. +pub struct SeriesTree_Market_Ath { pub high: CentsSatsUsdPattern, pub drawdown: BpsPercentRatioPattern5, - pub days_since: MetricPattern1, - pub years_since: MetricPattern1, - pub max_days_between: MetricPattern1, - pub max_years_between: MetricPattern1, + pub days_since: SeriesPattern1, + pub years_since: SeriesPattern1, + pub max_days_between: SeriesPattern1, + pub max_years_between: SeriesPattern1, } -impl MetricsTree_Market_Ath { +impl SeriesTree_Market_Ath { pub fn new(client: Arc, base_path: String) -> Self { Self { high: CentsSatsUsdPattern::new(client.clone(), "price_ath".to_string()), drawdown: BpsPercentRatioPattern5::new(client.clone(), "price_drawdown".to_string()), - days_since: MetricPattern1::new(client.clone(), "days_since_price_ath".to_string()), - years_since: MetricPattern1::new(client.clone(), "years_since_price_ath".to_string()), - max_days_between: MetricPattern1::new(client.clone(), "max_days_between_price_ath".to_string()), - max_years_between: MetricPattern1::new(client.clone(), "max_years_between_price_ath".to_string()), + days_since: SeriesPattern1::new(client.clone(), "days_since_price_ath".to_string()), + years_since: SeriesPattern1::new(client.clone(), "years_since_price_ath".to_string()), + max_days_between: SeriesPattern1::new(client.clone(), "max_days_between_price_ath".to_string()), + max_years_between: SeriesPattern1::new(client.clone(), "max_years_between_price_ath".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Lookback { +/// Series tree node. +pub struct SeriesTree_Market_Lookback { pub _24h: CentsSatsUsdPattern, pub _1w: CentsSatsUsdPattern, pub _1m: CentsSatsUsdPattern, @@ -5035,7 +5035,7 @@ pub struct MetricsTree_Market_Lookback { pub _10y: CentsSatsUsdPattern, } -impl MetricsTree_Market_Lookback { +impl SeriesTree_Market_Lookback { pub fn new(client: Arc, base_path: String) -> Self { Self { _24h: CentsSatsUsdPattern::new(client.clone(), "price_lookback_24h".to_string()), @@ -5055,25 +5055,25 @@ impl MetricsTree_Market_Lookback { } } -/// Metrics tree node. -pub struct MetricsTree_Market_Returns { - pub periods: MetricsTree_Market_Returns_Periods, +/// Series tree node. +pub struct SeriesTree_Market_Returns { + pub periods: SeriesTree_Market_Returns_Periods, pub cagr: _10y2y3y4y5y6y8yPattern, - pub sd_24h: MetricsTree_Market_Returns_Sd24h, + pub sd_24h: SeriesTree_Market_Returns_Sd24h, } -impl MetricsTree_Market_Returns { +impl SeriesTree_Market_Returns { pub fn new(client: Arc, base_path: String) -> Self { Self { - periods: MetricsTree_Market_Returns_Periods::new(client.clone(), format!("{base_path}_periods")), + periods: SeriesTree_Market_Returns_Periods::new(client.clone(), format!("{base_path}_periods")), cagr: _10y2y3y4y5y6y8yPattern::new(client.clone(), "price_cagr".to_string()), - sd_24h: MetricsTree_Market_Returns_Sd24h::new(client.clone(), format!("{base_path}_sd_24h")), + sd_24h: SeriesTree_Market_Returns_Sd24h::new(client.clone(), format!("{base_path}_sd_24h")), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Returns_Periods { +/// Series tree node. +pub struct SeriesTree_Market_Returns_Periods { pub _24h: BpsPercentRatioPattern, pub _1w: BpsPercentRatioPattern, pub _1m: BpsPercentRatioPattern, @@ -5089,7 +5089,7 @@ pub struct MetricsTree_Market_Returns_Periods { pub _10y: BpsPercentRatioPattern, } -impl MetricsTree_Market_Returns_Periods { +impl SeriesTree_Market_Returns_Periods { pub fn new(client: Arc, base_path: String) -> Self { Self { _24h: BpsPercentRatioPattern::new(client.clone(), "price_return_24h".to_string()), @@ -5109,123 +5109,123 @@ impl MetricsTree_Market_Returns_Periods { } } -/// Metrics tree node. -pub struct MetricsTree_Market_Returns_Sd24h { - pub _1w: MetricsTree_Market_Returns_Sd24h_1w, - pub _1m: MetricsTree_Market_Returns_Sd24h_1m, - pub _1y: MetricsTree_Market_Returns_Sd24h_1y, +/// Series tree node. +pub struct SeriesTree_Market_Returns_Sd24h { + pub _1w: SeriesTree_Market_Returns_Sd24h_1w, + pub _1m: SeriesTree_Market_Returns_Sd24h_1m, + pub _1y: SeriesTree_Market_Returns_Sd24h_1y, } -impl MetricsTree_Market_Returns_Sd24h { +impl SeriesTree_Market_Returns_Sd24h { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1w: MetricsTree_Market_Returns_Sd24h_1w::new(client.clone(), format!("{base_path}_1w")), - _1m: MetricsTree_Market_Returns_Sd24h_1m::new(client.clone(), format!("{base_path}_1m")), - _1y: MetricsTree_Market_Returns_Sd24h_1y::new(client.clone(), format!("{base_path}_1y")), + _1w: SeriesTree_Market_Returns_Sd24h_1w::new(client.clone(), format!("{base_path}_1w")), + _1m: SeriesTree_Market_Returns_Sd24h_1m::new(client.clone(), format!("{base_path}_1m")), + _1y: SeriesTree_Market_Returns_Sd24h_1y::new(client.clone(), format!("{base_path}_1y")), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Returns_Sd24h_1w { - pub sma: MetricPattern1, - pub sd: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_Returns_Sd24h_1w { + pub sma: SeriesPattern1, + pub sd: SeriesPattern1, } -impl MetricsTree_Market_Returns_Sd24h_1w { +impl SeriesTree_Market_Returns_Sd24h_1w { pub fn new(client: Arc, base_path: String) -> Self { Self { - sma: MetricPattern1::new(client.clone(), "price_return_24h_sma_1w".to_string()), - sd: MetricPattern1::new(client.clone(), "price_return_24h_sd_1w".to_string()), + sma: SeriesPattern1::new(client.clone(), "price_return_24h_sma_1w".to_string()), + sd: SeriesPattern1::new(client.clone(), "price_return_24h_sd_1w".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Returns_Sd24h_1m { - pub sma: MetricPattern1, - pub sd: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_Returns_Sd24h_1m { + pub sma: SeriesPattern1, + pub sd: SeriesPattern1, } -impl MetricsTree_Market_Returns_Sd24h_1m { +impl SeriesTree_Market_Returns_Sd24h_1m { pub fn new(client: Arc, base_path: String) -> Self { Self { - sma: MetricPattern1::new(client.clone(), "price_return_24h_sma_1m".to_string()), - sd: MetricPattern1::new(client.clone(), "price_return_24h_sd_1m".to_string()), + sma: SeriesPattern1::new(client.clone(), "price_return_24h_sma_1m".to_string()), + sd: SeriesPattern1::new(client.clone(), "price_return_24h_sd_1m".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Returns_Sd24h_1y { - pub sma: MetricPattern1, - pub sd: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_Returns_Sd24h_1y { + pub sma: SeriesPattern1, + pub sd: SeriesPattern1, } -impl MetricsTree_Market_Returns_Sd24h_1y { +impl SeriesTree_Market_Returns_Sd24h_1y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sma: MetricPattern1::new(client.clone(), "price_return_24h_sma_1y".to_string()), - sd: MetricPattern1::new(client.clone(), "price_return_24h_sd_1y".to_string()), + sma: SeriesPattern1::new(client.clone(), "price_return_24h_sma_1y".to_string()), + sd: SeriesPattern1::new(client.clone(), "price_return_24h_sd_1y".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Volatility { - pub _1w: MetricPattern1, - pub _1m: MetricPattern1, - pub _1y: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_Volatility { + pub _1w: SeriesPattern1, + pub _1m: SeriesPattern1, + pub _1y: SeriesPattern1, } -impl MetricsTree_Market_Volatility { +impl SeriesTree_Market_Volatility { pub fn new(client: Arc, base_path: String) -> Self { Self { - _1w: MetricPattern1::new(client.clone(), "price_volatility_1w".to_string()), - _1m: MetricPattern1::new(client.clone(), "price_volatility_1m".to_string()), - _1y: MetricPattern1::new(client.clone(), "price_volatility_1y".to_string()), + _1w: SeriesPattern1::new(client.clone(), "price_volatility_1w".to_string()), + _1m: SeriesPattern1::new(client.clone(), "price_volatility_1m".to_string()), + _1y: SeriesPattern1::new(client.clone(), "price_volatility_1y".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Range { +/// Series tree node. +pub struct SeriesTree_Market_Range { pub min: _1m1w1y2wPattern, pub max: _1m1w1y2wPattern, - pub true_range: MetricPattern1, - pub true_range_sum_2w: MetricPattern1, + pub true_range: SeriesPattern1, + pub true_range_sum_2w: SeriesPattern1, pub choppiness_index_2w: BpsPercentRatioPattern3, } -impl MetricsTree_Market_Range { +impl SeriesTree_Market_Range { pub fn new(client: Arc, base_path: String) -> Self { Self { min: _1m1w1y2wPattern::new(client.clone(), "price_min".to_string()), max: _1m1w1y2wPattern::new(client.clone(), "price_max".to_string()), - true_range: MetricPattern1::new(client.clone(), "price_true_range".to_string()), - true_range_sum_2w: MetricPattern1::new(client.clone(), "price_true_range_sum_2w".to_string()), + true_range: SeriesPattern1::new(client.clone(), "price_true_range".to_string()), + true_range_sum_2w: SeriesPattern1::new(client.clone(), "price_true_range_sum_2w".to_string()), choppiness_index_2w: BpsPercentRatioPattern3::new(client.clone(), "price_choppiness_index_2w".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_MovingAverage { - pub sma: MetricsTree_Market_MovingAverage_Sma, - pub ema: MetricsTree_Market_MovingAverage_Ema, +/// Series tree node. +pub struct SeriesTree_Market_MovingAverage { + pub sma: SeriesTree_Market_MovingAverage_Sma, + pub ema: SeriesTree_Market_MovingAverage_Ema, } -impl MetricsTree_Market_MovingAverage { +impl SeriesTree_Market_MovingAverage { pub fn new(client: Arc, base_path: String) -> Self { Self { - sma: MetricsTree_Market_MovingAverage_Sma::new(client.clone(), format!("{base_path}_sma")), - ema: MetricsTree_Market_MovingAverage_Ema::new(client.clone(), format!("{base_path}_ema")), + sma: SeriesTree_Market_MovingAverage_Sma::new(client.clone(), format!("{base_path}_sma")), + ema: SeriesTree_Market_MovingAverage_Ema::new(client.clone(), format!("{base_path}_ema")), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_MovingAverage_Sma { +/// Series tree node. +pub struct SeriesTree_Market_MovingAverage_Sma { pub _1w: BpsCentsRatioSatsUsdPattern, pub _8d: BpsCentsRatioSatsUsdPattern, pub _13d: BpsCentsRatioSatsUsdPattern, @@ -5236,15 +5236,15 @@ pub struct MetricsTree_Market_MovingAverage_Sma { pub _89d: BpsCentsRatioSatsUsdPattern, pub _111d: BpsCentsRatioSatsUsdPattern, pub _144d: BpsCentsRatioSatsUsdPattern, - pub _200d: MetricsTree_Market_MovingAverage_Sma_200d, - pub _350d: MetricsTree_Market_MovingAverage_Sma_350d, + pub _200d: SeriesTree_Market_MovingAverage_Sma_200d, + pub _350d: SeriesTree_Market_MovingAverage_Sma_350d, pub _1y: BpsCentsRatioSatsUsdPattern, pub _2y: BpsCentsRatioSatsUsdPattern, pub _200w: BpsCentsRatioSatsUsdPattern, pub _4y: BpsCentsRatioSatsUsdPattern, } -impl MetricsTree_Market_MovingAverage_Sma { +impl SeriesTree_Market_MovingAverage_Sma { pub fn new(client: Arc, base_path: String) -> Self { Self { _1w: BpsCentsRatioSatsUsdPattern::new(client.clone(), "price_sma_1w".to_string()), @@ -5257,8 +5257,8 @@ impl MetricsTree_Market_MovingAverage_Sma { _89d: BpsCentsRatioSatsUsdPattern::new(client.clone(), "price_sma_89d".to_string()), _111d: BpsCentsRatioSatsUsdPattern::new(client.clone(), "price_sma_111d".to_string()), _144d: BpsCentsRatioSatsUsdPattern::new(client.clone(), "price_sma_144d".to_string()), - _200d: MetricsTree_Market_MovingAverage_Sma_200d::new(client.clone(), format!("{base_path}_200d")), - _350d: MetricsTree_Market_MovingAverage_Sma_350d::new(client.clone(), format!("{base_path}_350d")), + _200d: SeriesTree_Market_MovingAverage_Sma_200d::new(client.clone(), format!("{base_path}_200d")), + _350d: SeriesTree_Market_MovingAverage_Sma_350d::new(client.clone(), format!("{base_path}_350d")), _1y: BpsCentsRatioSatsUsdPattern::new(client.clone(), "price_sma_1y".to_string()), _2y: BpsCentsRatioSatsUsdPattern::new(client.clone(), "price_sma_2y".to_string()), _200w: BpsCentsRatioSatsUsdPattern::new(client.clone(), "price_sma_200w".to_string()), @@ -5267,56 +5267,56 @@ impl MetricsTree_Market_MovingAverage_Sma { } } -/// Metrics tree node. -pub struct MetricsTree_Market_MovingAverage_Sma_200d { - pub usd: MetricPattern1, - pub cents: MetricPattern1, - pub sats: MetricPattern1, - pub bps: MetricPattern1, - pub ratio: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_MovingAverage_Sma_200d { + pub usd: SeriesPattern1, + pub cents: SeriesPattern1, + pub sats: SeriesPattern1, + pub bps: SeriesPattern1, + pub ratio: SeriesPattern1, pub x2_4: CentsSatsUsdPattern, pub x0_8: CentsSatsUsdPattern, } -impl MetricsTree_Market_MovingAverage_Sma_200d { +impl SeriesTree_Market_MovingAverage_Sma_200d { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: MetricPattern1::new(client.clone(), "price_sma_200d".to_string()), - cents: MetricPattern1::new(client.clone(), "price_sma_200d_cents".to_string()), - sats: MetricPattern1::new(client.clone(), "price_sma_200d_sats".to_string()), - bps: MetricPattern1::new(client.clone(), "price_sma_200d_ratio_bps".to_string()), - ratio: MetricPattern1::new(client.clone(), "price_sma_200d_ratio".to_string()), + usd: SeriesPattern1::new(client.clone(), "price_sma_200d".to_string()), + cents: SeriesPattern1::new(client.clone(), "price_sma_200d_cents".to_string()), + sats: SeriesPattern1::new(client.clone(), "price_sma_200d_sats".to_string()), + bps: SeriesPattern1::new(client.clone(), "price_sma_200d_ratio_bps".to_string()), + ratio: SeriesPattern1::new(client.clone(), "price_sma_200d_ratio".to_string()), x2_4: CentsSatsUsdPattern::new(client.clone(), "price_sma_200d_x2_4".to_string()), x0_8: CentsSatsUsdPattern::new(client.clone(), "price_sma_200d_x0_8".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_MovingAverage_Sma_350d { - pub usd: MetricPattern1, - pub cents: MetricPattern1, - pub sats: MetricPattern1, - pub bps: MetricPattern1, - pub ratio: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_MovingAverage_Sma_350d { + pub usd: SeriesPattern1, + pub cents: SeriesPattern1, + pub sats: SeriesPattern1, + pub bps: SeriesPattern1, + pub ratio: SeriesPattern1, pub x2: CentsSatsUsdPattern, } -impl MetricsTree_Market_MovingAverage_Sma_350d { +impl SeriesTree_Market_MovingAverage_Sma_350d { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: MetricPattern1::new(client.clone(), "price_sma_350d".to_string()), - cents: MetricPattern1::new(client.clone(), "price_sma_350d_cents".to_string()), - sats: MetricPattern1::new(client.clone(), "price_sma_350d_sats".to_string()), - bps: MetricPattern1::new(client.clone(), "price_sma_350d_ratio_bps".to_string()), - ratio: MetricPattern1::new(client.clone(), "price_sma_350d_ratio".to_string()), + usd: SeriesPattern1::new(client.clone(), "price_sma_350d".to_string()), + cents: SeriesPattern1::new(client.clone(), "price_sma_350d_cents".to_string()), + sats: SeriesPattern1::new(client.clone(), "price_sma_350d_sats".to_string()), + bps: SeriesPattern1::new(client.clone(), "price_sma_350d_ratio_bps".to_string()), + ratio: SeriesPattern1::new(client.clone(), "price_sma_350d_ratio".to_string()), x2: CentsSatsUsdPattern::new(client.clone(), "price_sma_350d_x2".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_MovingAverage_Ema { +/// Series tree node. +pub struct SeriesTree_Market_MovingAverage_Ema { pub _1w: BpsCentsRatioSatsUsdPattern, pub _8d: BpsCentsRatioSatsUsdPattern, pub _12d: BpsCentsRatioSatsUsdPattern, @@ -5335,7 +5335,7 @@ pub struct MetricsTree_Market_MovingAverage_Ema { pub _4y: BpsCentsRatioSatsUsdPattern, } -impl MetricsTree_Market_MovingAverage_Ema { +impl SeriesTree_Market_MovingAverage_Ema { pub fn new(client: Arc, base_path: String) -> Self { Self { _1w: BpsCentsRatioSatsUsdPattern::new(client.clone(), "price_ema_1w".to_string()), @@ -5358,38 +5358,38 @@ impl MetricsTree_Market_MovingAverage_Ema { } } -/// Metrics tree node. -pub struct MetricsTree_Market_Dca { - pub sats_per_day: MetricPattern18, - pub period: MetricsTree_Market_Dca_Period, - pub class: MetricsTree_Market_Dca_Class, +/// Series tree node. +pub struct SeriesTree_Market_Dca { + pub sats_per_day: SeriesPattern18, + pub period: SeriesTree_Market_Dca_Period, + pub class: SeriesTree_Market_Dca_Class, } -impl MetricsTree_Market_Dca { +impl SeriesTree_Market_Dca { pub fn new(client: Arc, base_path: String) -> Self { Self { - sats_per_day: MetricPattern18::new(client.clone(), "dca_sats_per_day".to_string()), - period: MetricsTree_Market_Dca_Period::new(client.clone(), format!("{base_path}_period")), - class: MetricsTree_Market_Dca_Class::new(client.clone(), format!("{base_path}_class")), + sats_per_day: SeriesPattern18::new(client.clone(), "dca_sats_per_day".to_string()), + period: SeriesTree_Market_Dca_Period::new(client.clone(), format!("{base_path}_period")), + class: SeriesTree_Market_Dca_Class::new(client.clone(), format!("{base_path}_class")), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Dca_Period { +/// Series tree node. +pub struct SeriesTree_Market_Dca_Period { pub stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3, - pub cost_basis: MetricsTree_Market_Dca_Period_CostBasis, + pub cost_basis: SeriesTree_Market_Dca_Period_CostBasis, pub return_: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2, pub cagr: _10y2y3y4y5y6y8yPattern, pub lump_sum_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3, pub lump_sum_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2, } -impl MetricsTree_Market_Dca_Period { +impl SeriesTree_Market_Dca_Period { pub fn new(client: Arc, base_path: String) -> Self { Self { stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3::new(client.clone(), "dca_stack".to_string()), - cost_basis: MetricsTree_Market_Dca_Period_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), + cost_basis: SeriesTree_Market_Dca_Period_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), return_: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2::new(client.clone(), "dca_return".to_string()), cagr: _10y2y3y4y5y6y8yPattern::new(client.clone(), "dca_cagr".to_string()), lump_sum_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3::new(client.clone(), "lump_sum_stack".to_string()), @@ -5398,8 +5398,8 @@ impl MetricsTree_Market_Dca_Period { } } -/// Metrics tree node. -pub struct MetricsTree_Market_Dca_Period_CostBasis { +/// Series tree node. +pub struct SeriesTree_Market_Dca_Period_CostBasis { pub _1w: CentsSatsUsdPattern, pub _1m: CentsSatsUsdPattern, pub _3m: CentsSatsUsdPattern, @@ -5414,7 +5414,7 @@ pub struct MetricsTree_Market_Dca_Period_CostBasis { pub _10y: CentsSatsUsdPattern, } -impl MetricsTree_Market_Dca_Period_CostBasis { +impl SeriesTree_Market_Dca_Period_CostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { _1w: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_1w".to_string()), @@ -5433,25 +5433,25 @@ impl MetricsTree_Market_Dca_Period_CostBasis { } } -/// Metrics tree node. -pub struct MetricsTree_Market_Dca_Class { - pub stack: MetricsTree_Market_Dca_Class_Stack, - pub cost_basis: MetricsTree_Market_Dca_Class_CostBasis, - pub return_: MetricsTree_Market_Dca_Class_Return, +/// Series tree node. +pub struct SeriesTree_Market_Dca_Class { + pub stack: SeriesTree_Market_Dca_Class_Stack, + pub cost_basis: SeriesTree_Market_Dca_Class_CostBasis, + pub return_: SeriesTree_Market_Dca_Class_Return, } -impl MetricsTree_Market_Dca_Class { +impl SeriesTree_Market_Dca_Class { pub fn new(client: Arc, base_path: String) -> Self { Self { - stack: MetricsTree_Market_Dca_Class_Stack::new(client.clone(), format!("{base_path}_stack")), - cost_basis: MetricsTree_Market_Dca_Class_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), - return_: MetricsTree_Market_Dca_Class_Return::new(client.clone(), format!("{base_path}_return")), + stack: SeriesTree_Market_Dca_Class_Stack::new(client.clone(), format!("{base_path}_stack")), + cost_basis: SeriesTree_Market_Dca_Class_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), + return_: SeriesTree_Market_Dca_Class_Return::new(client.clone(), format!("{base_path}_return")), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Dca_Class_Stack { +/// Series tree node. +pub struct SeriesTree_Market_Dca_Class_Stack { pub from_2015: BtcCentsSatsUsdPattern, pub from_2016: BtcCentsSatsUsdPattern, pub from_2017: BtcCentsSatsUsdPattern, @@ -5466,7 +5466,7 @@ pub struct MetricsTree_Market_Dca_Class_Stack { pub from_2026: BtcCentsSatsUsdPattern, } -impl MetricsTree_Market_Dca_Class_Stack { +impl SeriesTree_Market_Dca_Class_Stack { pub fn new(client: Arc, base_path: String) -> Self { Self { from_2015: BtcCentsSatsUsdPattern::new(client.clone(), "dca_stack_from_2015".to_string()), @@ -5485,8 +5485,8 @@ impl MetricsTree_Market_Dca_Class_Stack { } } -/// Metrics tree node. -pub struct MetricsTree_Market_Dca_Class_CostBasis { +/// Series tree node. +pub struct SeriesTree_Market_Dca_Class_CostBasis { pub from_2015: CentsSatsUsdPattern, pub from_2016: CentsSatsUsdPattern, pub from_2017: CentsSatsUsdPattern, @@ -5501,7 +5501,7 @@ pub struct MetricsTree_Market_Dca_Class_CostBasis { pub from_2026: CentsSatsUsdPattern, } -impl MetricsTree_Market_Dca_Class_CostBasis { +impl SeriesTree_Market_Dca_Class_CostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { from_2015: CentsSatsUsdPattern::new(client.clone(), "dca_cost_basis_from_2015".to_string()), @@ -5520,8 +5520,8 @@ impl MetricsTree_Market_Dca_Class_CostBasis { } } -/// Metrics tree node. -pub struct MetricsTree_Market_Dca_Class_Return { +/// Series tree node. +pub struct SeriesTree_Market_Dca_Class_Return { pub from_2015: BpsPercentRatioPattern, pub from_2016: BpsPercentRatioPattern, pub from_2017: BpsPercentRatioPattern, @@ -5536,7 +5536,7 @@ pub struct MetricsTree_Market_Dca_Class_Return { pub from_2026: BpsPercentRatioPattern, } -impl MetricsTree_Market_Dca_Class_Return { +impl SeriesTree_Market_Dca_Class_Return { pub fn new(client: Arc, base_path: String) -> Self { Self { from_2015: BpsPercentRatioPattern::new(client.clone(), "dca_return_from_2015".to_string()), @@ -5555,36 +5555,36 @@ impl MetricsTree_Market_Dca_Class_Return { } } -/// Metrics tree node. -pub struct MetricsTree_Market_Technical { - pub rsi: MetricsTree_Market_Technical_Rsi, +/// Series tree node. +pub struct SeriesTree_Market_Technical { + pub rsi: SeriesTree_Market_Technical_Rsi, pub stoch_k: BpsPercentRatioPattern3, pub stoch_d: BpsPercentRatioPattern3, pub pi_cycle: BpsRatioPattern2, - pub macd: MetricsTree_Market_Technical_Macd, + pub macd: SeriesTree_Market_Technical_Macd, } -impl MetricsTree_Market_Technical { +impl SeriesTree_Market_Technical { pub fn new(client: Arc, base_path: String) -> Self { Self { - rsi: MetricsTree_Market_Technical_Rsi::new(client.clone(), format!("{base_path}_rsi")), + rsi: SeriesTree_Market_Technical_Rsi::new(client.clone(), format!("{base_path}_rsi")), stoch_k: BpsPercentRatioPattern3::new(client.clone(), "stoch_k".to_string()), stoch_d: BpsPercentRatioPattern3::new(client.clone(), "stoch_d".to_string()), pi_cycle: BpsRatioPattern2::new(client.clone(), "pi_cycle".to_string()), - macd: MetricsTree_Market_Technical_Macd::new(client.clone(), format!("{base_path}_macd")), + macd: SeriesTree_Market_Technical_Macd::new(client.clone(), format!("{base_path}_macd")), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Technical_Rsi { +/// Series tree node. +pub struct SeriesTree_Market_Technical_Rsi { pub _24h: AverageGainsLossesRsiStochPattern, pub _1w: AverageGainsLossesRsiStochPattern, pub _1m: AverageGainsLossesRsiStochPattern, pub _1y: AverageGainsLossesRsiStochPattern, } -impl MetricsTree_Market_Technical_Rsi { +impl SeriesTree_Market_Technical_Rsi { pub fn new(client: Arc, base_path: String) -> Self { Self { _24h: AverageGainsLossesRsiStochPattern::new(client.clone(), "rsi".to_string(), "24h".to_string()), @@ -5595,128 +5595,128 @@ impl MetricsTree_Market_Technical_Rsi { } } -/// Metrics tree node. -pub struct MetricsTree_Market_Technical_Macd { - pub _24h: MetricsTree_Market_Technical_Macd_24h, - pub _1w: MetricsTree_Market_Technical_Macd_1w, - pub _1m: MetricsTree_Market_Technical_Macd_1m, - pub _1y: MetricsTree_Market_Technical_Macd_1y, +/// Series tree node. +pub struct SeriesTree_Market_Technical_Macd { + pub _24h: SeriesTree_Market_Technical_Macd_24h, + pub _1w: SeriesTree_Market_Technical_Macd_1w, + pub _1m: SeriesTree_Market_Technical_Macd_1m, + pub _1y: SeriesTree_Market_Technical_Macd_1y, } -impl MetricsTree_Market_Technical_Macd { +impl SeriesTree_Market_Technical_Macd { pub fn new(client: Arc, base_path: String) -> Self { Self { - _24h: MetricsTree_Market_Technical_Macd_24h::new(client.clone(), format!("{base_path}_24h")), - _1w: MetricsTree_Market_Technical_Macd_1w::new(client.clone(), format!("{base_path}_1w")), - _1m: MetricsTree_Market_Technical_Macd_1m::new(client.clone(), format!("{base_path}_1m")), - _1y: MetricsTree_Market_Technical_Macd_1y::new(client.clone(), format!("{base_path}_1y")), + _24h: SeriesTree_Market_Technical_Macd_24h::new(client.clone(), format!("{base_path}_24h")), + _1w: SeriesTree_Market_Technical_Macd_1w::new(client.clone(), format!("{base_path}_1w")), + _1m: SeriesTree_Market_Technical_Macd_1m::new(client.clone(), format!("{base_path}_1m")), + _1y: SeriesTree_Market_Technical_Macd_1y::new(client.clone(), format!("{base_path}_1y")), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Technical_Macd_24h { - pub ema_fast: MetricPattern1, - pub ema_slow: MetricPattern1, - pub line: MetricPattern1, - pub signal: MetricPattern1, - pub histogram: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_Technical_Macd_24h { + pub ema_fast: SeriesPattern1, + pub ema_slow: SeriesPattern1, + pub line: SeriesPattern1, + pub signal: SeriesPattern1, + pub histogram: SeriesPattern1, } -impl MetricsTree_Market_Technical_Macd_24h { +impl SeriesTree_Market_Technical_Macd_24h { pub fn new(client: Arc, base_path: String) -> Self { Self { - ema_fast: MetricPattern1::new(client.clone(), "macd_ema_fast_24h".to_string()), - ema_slow: MetricPattern1::new(client.clone(), "macd_ema_slow_24h".to_string()), - line: MetricPattern1::new(client.clone(), "macd_line_24h".to_string()), - signal: MetricPattern1::new(client.clone(), "macd_signal_24h".to_string()), - histogram: MetricPattern1::new(client.clone(), "macd_histogram_24h".to_string()), + ema_fast: SeriesPattern1::new(client.clone(), "macd_ema_fast_24h".to_string()), + ema_slow: SeriesPattern1::new(client.clone(), "macd_ema_slow_24h".to_string()), + line: SeriesPattern1::new(client.clone(), "macd_line_24h".to_string()), + signal: SeriesPattern1::new(client.clone(), "macd_signal_24h".to_string()), + histogram: SeriesPattern1::new(client.clone(), "macd_histogram_24h".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Technical_Macd_1w { - pub ema_fast: MetricPattern1, - pub ema_slow: MetricPattern1, - pub line: MetricPattern1, - pub signal: MetricPattern1, - pub histogram: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_Technical_Macd_1w { + pub ema_fast: SeriesPattern1, + pub ema_slow: SeriesPattern1, + pub line: SeriesPattern1, + pub signal: SeriesPattern1, + pub histogram: SeriesPattern1, } -impl MetricsTree_Market_Technical_Macd_1w { +impl SeriesTree_Market_Technical_Macd_1w { pub fn new(client: Arc, base_path: String) -> Self { Self { - ema_fast: MetricPattern1::new(client.clone(), "macd_ema_fast_1w".to_string()), - ema_slow: MetricPattern1::new(client.clone(), "macd_ema_slow_1w".to_string()), - line: MetricPattern1::new(client.clone(), "macd_line_1w".to_string()), - signal: MetricPattern1::new(client.clone(), "macd_signal_1w".to_string()), - histogram: MetricPattern1::new(client.clone(), "macd_histogram_1w".to_string()), + ema_fast: SeriesPattern1::new(client.clone(), "macd_ema_fast_1w".to_string()), + ema_slow: SeriesPattern1::new(client.clone(), "macd_ema_slow_1w".to_string()), + line: SeriesPattern1::new(client.clone(), "macd_line_1w".to_string()), + signal: SeriesPattern1::new(client.clone(), "macd_signal_1w".to_string()), + histogram: SeriesPattern1::new(client.clone(), "macd_histogram_1w".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Technical_Macd_1m { - pub ema_fast: MetricPattern1, - pub ema_slow: MetricPattern1, - pub line: MetricPattern1, - pub signal: MetricPattern1, - pub histogram: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_Technical_Macd_1m { + pub ema_fast: SeriesPattern1, + pub ema_slow: SeriesPattern1, + pub line: SeriesPattern1, + pub signal: SeriesPattern1, + pub histogram: SeriesPattern1, } -impl MetricsTree_Market_Technical_Macd_1m { +impl SeriesTree_Market_Technical_Macd_1m { pub fn new(client: Arc, base_path: String) -> Self { Self { - ema_fast: MetricPattern1::new(client.clone(), "macd_ema_fast_1m".to_string()), - ema_slow: MetricPattern1::new(client.clone(), "macd_ema_slow_1m".to_string()), - line: MetricPattern1::new(client.clone(), "macd_line_1m".to_string()), - signal: MetricPattern1::new(client.clone(), "macd_signal_1m".to_string()), - histogram: MetricPattern1::new(client.clone(), "macd_histogram_1m".to_string()), + ema_fast: SeriesPattern1::new(client.clone(), "macd_ema_fast_1m".to_string()), + ema_slow: SeriesPattern1::new(client.clone(), "macd_ema_slow_1m".to_string()), + line: SeriesPattern1::new(client.clone(), "macd_line_1m".to_string()), + signal: SeriesPattern1::new(client.clone(), "macd_signal_1m".to_string()), + histogram: SeriesPattern1::new(client.clone(), "macd_histogram_1m".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Market_Technical_Macd_1y { - pub ema_fast: MetricPattern1, - pub ema_slow: MetricPattern1, - pub line: MetricPattern1, - pub signal: MetricPattern1, - pub histogram: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Market_Technical_Macd_1y { + pub ema_fast: SeriesPattern1, + pub ema_slow: SeriesPattern1, + pub line: SeriesPattern1, + pub signal: SeriesPattern1, + pub histogram: SeriesPattern1, } -impl MetricsTree_Market_Technical_Macd_1y { +impl SeriesTree_Market_Technical_Macd_1y { pub fn new(client: Arc, base_path: String) -> Self { Self { - ema_fast: MetricPattern1::new(client.clone(), "macd_ema_fast_1y".to_string()), - ema_slow: MetricPattern1::new(client.clone(), "macd_ema_slow_1y".to_string()), - line: MetricPattern1::new(client.clone(), "macd_line_1y".to_string()), - signal: MetricPattern1::new(client.clone(), "macd_signal_1y".to_string()), - histogram: MetricPattern1::new(client.clone(), "macd_histogram_1y".to_string()), + ema_fast: SeriesPattern1::new(client.clone(), "macd_ema_fast_1y".to_string()), + ema_slow: SeriesPattern1::new(client.clone(), "macd_ema_slow_1y".to_string()), + line: SeriesPattern1::new(client.clone(), "macd_line_1y".to_string()), + signal: SeriesPattern1::new(client.clone(), "macd_signal_1y".to_string()), + histogram: SeriesPattern1::new(client.clone(), "macd_histogram_1y".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Pools { - pub height_to_pool: MetricPattern18, - pub major: MetricsTree_Pools_Major, - pub minor: MetricsTree_Pools_Minor, +/// Series tree node. +pub struct SeriesTree_Pools { + pub height_to_pool: SeriesPattern18, + pub major: SeriesTree_Pools_Major, + pub minor: SeriesTree_Pools_Minor, } -impl MetricsTree_Pools { +impl SeriesTree_Pools { pub fn new(client: Arc, base_path: String) -> Self { Self { - height_to_pool: MetricPattern18::new(client.clone(), "pool".to_string()), - major: MetricsTree_Pools_Major::new(client.clone(), format!("{base_path}_major")), - minor: MetricsTree_Pools_Minor::new(client.clone(), format!("{base_path}_minor")), + height_to_pool: SeriesPattern18::new(client.clone(), "pool".to_string()), + major: SeriesTree_Pools_Major::new(client.clone(), format!("{base_path}_major")), + minor: SeriesTree_Pools_Minor::new(client.clone(), format!("{base_path}_minor")), } } } -/// Metrics tree node. -pub struct MetricsTree_Pools_Major { +/// Series tree node. +pub struct SeriesTree_Pools_Major { pub unknown: BlocksDominanceRewardsPattern, pub luxor: BlocksDominanceRewardsPattern, pub btccom: BlocksDominanceRewardsPattern, @@ -5741,7 +5741,7 @@ pub struct MetricsTree_Pools_Major { pub whitepool: BlocksDominanceRewardsPattern, } -impl MetricsTree_Pools_Major { +impl SeriesTree_Pools_Major { pub fn new(client: Arc, base_path: String) -> Self { Self { unknown: BlocksDominanceRewardsPattern::new(client.clone(), "unknown".to_string()), @@ -5770,8 +5770,8 @@ impl MetricsTree_Pools_Major { } } -/// Metrics tree node. -pub struct MetricsTree_Pools_Minor { +/// Series tree node. +pub struct SeriesTree_Pools_Minor { pub blockfills: BlocksDominancePattern, pub ultimuspool: BlocksDominancePattern, pub terrapool: BlocksDominancePattern, @@ -5914,7 +5914,7 @@ pub struct MetricsTree_Pools_Minor { pub est3lar: BlocksDominancePattern, } -impl MetricsTree_Pools_Minor { +impl SeriesTree_Pools_Minor { pub fn new(client: Arc, base_path: String) -> Self { Self { blockfills: BlocksDominancePattern::new(client.clone(), "blockfills".to_string()), @@ -6061,32 +6061,32 @@ impl MetricsTree_Pools_Minor { } } -/// Metrics tree node. -pub struct MetricsTree_Prices { - pub split: MetricsTree_Prices_Split, - pub ohlc: MetricsTree_Prices_Ohlc, - pub spot: MetricsTree_Prices_Spot, +/// Series tree node. +pub struct SeriesTree_Prices { + pub split: SeriesTree_Prices_Split, + pub ohlc: SeriesTree_Prices_Ohlc, + pub spot: SeriesTree_Prices_Spot, } -impl MetricsTree_Prices { +impl SeriesTree_Prices { pub fn new(client: Arc, base_path: String) -> Self { Self { - split: MetricsTree_Prices_Split::new(client.clone(), format!("{base_path}_split")), - ohlc: MetricsTree_Prices_Ohlc::new(client.clone(), format!("{base_path}_ohlc")), - spot: MetricsTree_Prices_Spot::new(client.clone(), format!("{base_path}_spot")), + split: SeriesTree_Prices_Split::new(client.clone(), format!("{base_path}_split")), + ohlc: SeriesTree_Prices_Ohlc::new(client.clone(), format!("{base_path}_ohlc")), + spot: SeriesTree_Prices_Spot::new(client.clone(), format!("{base_path}_spot")), } } } -/// Metrics tree node. -pub struct MetricsTree_Prices_Split { +/// Series tree node. +pub struct SeriesTree_Prices_Split { pub open: CentsSatsUsdPattern3, pub high: CentsSatsUsdPattern3, pub low: CentsSatsUsdPattern3, pub close: CentsSatsUsdPattern3, } -impl MetricsTree_Prices_Split { +impl SeriesTree_Prices_Split { pub fn new(client: Arc, base_path: String) -> Self { Self { open: CentsSatsUsdPattern3::new(client.clone(), "price_open".to_string()), @@ -6097,60 +6097,60 @@ impl MetricsTree_Prices_Split { } } -/// Metrics tree node. -pub struct MetricsTree_Prices_Ohlc { - pub usd: MetricPattern2, - pub cents: MetricPattern2, - pub sats: MetricPattern2, +/// Series tree node. +pub struct SeriesTree_Prices_Ohlc { + pub usd: SeriesPattern2, + pub cents: SeriesPattern2, + pub sats: SeriesPattern2, } -impl MetricsTree_Prices_Ohlc { +impl SeriesTree_Prices_Ohlc { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: MetricPattern2::new(client.clone(), "price_ohlc".to_string()), - cents: MetricPattern2::new(client.clone(), "price_ohlc_cents".to_string()), - sats: MetricPattern2::new(client.clone(), "price_ohlc_sats".to_string()), + usd: SeriesPattern2::new(client.clone(), "price_ohlc".to_string()), + cents: SeriesPattern2::new(client.clone(), "price_ohlc_cents".to_string()), + sats: SeriesPattern2::new(client.clone(), "price_ohlc_sats".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Prices_Spot { - pub usd: MetricPattern1, - pub cents: MetricPattern1, - pub sats: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Prices_Spot { + pub usd: SeriesPattern1, + pub cents: SeriesPattern1, + pub sats: SeriesPattern1, } -impl MetricsTree_Prices_Spot { +impl SeriesTree_Prices_Spot { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: MetricPattern1::new(client.clone(), "price".to_string()), - cents: MetricPattern1::new(client.clone(), "price_cents".to_string()), - sats: MetricPattern1::new(client.clone(), "price_sats".to_string()), + usd: SeriesPattern1::new(client.clone(), "price".to_string()), + cents: SeriesPattern1::new(client.clone(), "price_cents".to_string()), + sats: SeriesPattern1::new(client.clone(), "price_sats".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Supply { - pub state: MetricPattern18, +/// Series tree node. +pub struct SeriesTree_Supply { + pub state: SeriesPattern18, pub circulating: BtcCentsSatsUsdPattern, - pub burned: MetricsTree_Supply_Burned, + pub burned: SeriesTree_Supply_Burned, pub inflation_rate: BpsPercentRatioPattern, - pub velocity: MetricsTree_Supply_Velocity, + pub velocity: SeriesTree_Supply_Velocity, pub market_cap: CentsDeltaUsdPattern, pub market_minus_realized_cap_growth_rate: _1m1w1y24hPattern, pub hodled_or_lost: BtcCentsSatsUsdPattern, } -impl MetricsTree_Supply { +impl SeriesTree_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { - state: MetricPattern18::new(client.clone(), "supply_state".to_string()), + state: SeriesPattern18::new(client.clone(), "supply_state".to_string()), circulating: BtcCentsSatsUsdPattern::new(client.clone(), "circulating_supply".to_string()), - burned: MetricsTree_Supply_Burned::new(client.clone(), format!("{base_path}_burned")), + burned: SeriesTree_Supply_Burned::new(client.clone(), format!("{base_path}_burned")), inflation_rate: BpsPercentRatioPattern::new(client.clone(), "inflation_rate".to_string()), - velocity: MetricsTree_Supply_Velocity::new(client.clone(), format!("{base_path}_velocity")), + velocity: SeriesTree_Supply_Velocity::new(client.clone(), format!("{base_path}_velocity")), market_cap: CentsDeltaUsdPattern::new(client.clone(), "market_cap".to_string()), market_minus_realized_cap_growth_rate: _1m1w1y24hPattern::new(client.clone(), "market_minus_realized_cap_growth_rate".to_string()), hodled_or_lost: BtcCentsSatsUsdPattern::new(client.clone(), "hodled_or_lost_coins".to_string()), @@ -6158,12 +6158,12 @@ impl MetricsTree_Supply { } } -/// Metrics tree node. -pub struct MetricsTree_Supply_Burned { +/// Series tree node. +pub struct SeriesTree_Supply_Burned { pub unspendable: BaseCumulativeSumPattern4, } -impl MetricsTree_Supply_Burned { +impl SeriesTree_Supply_Burned { pub fn new(client: Arc, base_path: String) -> Self { Self { unspendable: BaseCumulativeSumPattern4::new(client.clone(), "unspendable_supply".to_string()), @@ -6171,100 +6171,100 @@ impl MetricsTree_Supply_Burned { } } -/// Metrics tree node. -pub struct MetricsTree_Supply_Velocity { - pub native: MetricPattern1, - pub fiat: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Supply_Velocity { + pub native: SeriesPattern1, + pub fiat: SeriesPattern1, } -impl MetricsTree_Supply_Velocity { +impl SeriesTree_Supply_Velocity { pub fn new(client: Arc, base_path: String) -> Self { Self { - native: MetricPattern1::new(client.clone(), "velocity".to_string()), - fiat: MetricPattern1::new(client.clone(), "velocity_fiat".to_string()), + native: SeriesPattern1::new(client.clone(), "velocity".to_string()), + fiat: SeriesPattern1::new(client.clone(), "velocity_fiat".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts { - pub utxo: MetricsTree_Cohorts_Utxo, - pub address: MetricsTree_Cohorts_Address, +/// Series tree node. +pub struct SeriesTree_Cohorts { + pub utxo: SeriesTree_Cohorts_Utxo, + pub address: SeriesTree_Cohorts_Address, } -impl MetricsTree_Cohorts { +impl SeriesTree_Cohorts { pub fn new(client: Arc, base_path: String) -> Self { Self { - utxo: MetricsTree_Cohorts_Utxo::new(client.clone(), format!("{base_path}_utxo")), - address: MetricsTree_Cohorts_Address::new(client.clone(), format!("{base_path}_address")), + utxo: SeriesTree_Cohorts_Utxo::new(client.clone(), format!("{base_path}_utxo")), + address: SeriesTree_Cohorts_Address::new(client.clone(), format!("{base_path}_address")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo { - pub all: MetricsTree_Cohorts_Utxo_All, - pub sth: MetricsTree_Cohorts_Utxo_Sth, - pub lth: MetricsTree_Cohorts_Utxo_Lth, - pub age_range: MetricsTree_Cohorts_Utxo_AgeRange, - pub under_age: MetricsTree_Cohorts_Utxo_UnderAge, - pub over_age: MetricsTree_Cohorts_Utxo_OverAge, - pub epoch: MetricsTree_Cohorts_Utxo_Epoch, - pub class: MetricsTree_Cohorts_Utxo_Class, - pub over_amount: MetricsTree_Cohorts_Utxo_OverAmount, - pub amount_range: MetricsTree_Cohorts_Utxo_AmountRange, - pub under_amount: MetricsTree_Cohorts_Utxo_UnderAmount, - pub type_: MetricsTree_Cohorts_Utxo_Type, - pub profitability: MetricsTree_Cohorts_Utxo_Profitability, - pub matured: MetricsTree_Cohorts_Utxo_Matured, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo { + pub all: SeriesTree_Cohorts_Utxo_All, + pub sth: SeriesTree_Cohorts_Utxo_Sth, + pub lth: SeriesTree_Cohorts_Utxo_Lth, + pub age_range: SeriesTree_Cohorts_Utxo_AgeRange, + pub under_age: SeriesTree_Cohorts_Utxo_UnderAge, + pub over_age: SeriesTree_Cohorts_Utxo_OverAge, + pub epoch: SeriesTree_Cohorts_Utxo_Epoch, + pub class: SeriesTree_Cohorts_Utxo_Class, + pub over_amount: SeriesTree_Cohorts_Utxo_OverAmount, + pub amount_range: SeriesTree_Cohorts_Utxo_AmountRange, + pub under_amount: SeriesTree_Cohorts_Utxo_UnderAmount, + pub type_: SeriesTree_Cohorts_Utxo_Type, + pub profitability: SeriesTree_Cohorts_Utxo_Profitability, + pub matured: SeriesTree_Cohorts_Utxo_Matured, } -impl MetricsTree_Cohorts_Utxo { +impl SeriesTree_Cohorts_Utxo { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: MetricsTree_Cohorts_Utxo_All::new(client.clone(), format!("{base_path}_all")), - sth: MetricsTree_Cohorts_Utxo_Sth::new(client.clone(), format!("{base_path}_sth")), - lth: MetricsTree_Cohorts_Utxo_Lth::new(client.clone(), format!("{base_path}_lth")), - age_range: MetricsTree_Cohorts_Utxo_AgeRange::new(client.clone(), format!("{base_path}_age_range")), - under_age: MetricsTree_Cohorts_Utxo_UnderAge::new(client.clone(), format!("{base_path}_under_age")), - over_age: MetricsTree_Cohorts_Utxo_OverAge::new(client.clone(), format!("{base_path}_over_age")), - epoch: MetricsTree_Cohorts_Utxo_Epoch::new(client.clone(), format!("{base_path}_epoch")), - class: MetricsTree_Cohorts_Utxo_Class::new(client.clone(), format!("{base_path}_class")), - over_amount: MetricsTree_Cohorts_Utxo_OverAmount::new(client.clone(), format!("{base_path}_over_amount")), - amount_range: MetricsTree_Cohorts_Utxo_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), - under_amount: MetricsTree_Cohorts_Utxo_UnderAmount::new(client.clone(), format!("{base_path}_under_amount")), - type_: MetricsTree_Cohorts_Utxo_Type::new(client.clone(), format!("{base_path}_type")), - profitability: MetricsTree_Cohorts_Utxo_Profitability::new(client.clone(), format!("{base_path}_profitability")), - matured: MetricsTree_Cohorts_Utxo_Matured::new(client.clone(), format!("{base_path}_matured")), + all: SeriesTree_Cohorts_Utxo_All::new(client.clone(), format!("{base_path}_all")), + sth: SeriesTree_Cohorts_Utxo_Sth::new(client.clone(), format!("{base_path}_sth")), + lth: SeriesTree_Cohorts_Utxo_Lth::new(client.clone(), format!("{base_path}_lth")), + age_range: SeriesTree_Cohorts_Utxo_AgeRange::new(client.clone(), format!("{base_path}_age_range")), + under_age: SeriesTree_Cohorts_Utxo_UnderAge::new(client.clone(), format!("{base_path}_under_age")), + over_age: SeriesTree_Cohorts_Utxo_OverAge::new(client.clone(), format!("{base_path}_over_age")), + epoch: SeriesTree_Cohorts_Utxo_Epoch::new(client.clone(), format!("{base_path}_epoch")), + class: SeriesTree_Cohorts_Utxo_Class::new(client.clone(), format!("{base_path}_class")), + over_amount: SeriesTree_Cohorts_Utxo_OverAmount::new(client.clone(), format!("{base_path}_over_amount")), + amount_range: SeriesTree_Cohorts_Utxo_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), + under_amount: SeriesTree_Cohorts_Utxo_UnderAmount::new(client.clone(), format!("{base_path}_under_amount")), + type_: SeriesTree_Cohorts_Utxo_Type::new(client.clone(), format!("{base_path}_type")), + profitability: SeriesTree_Cohorts_Utxo_Profitability::new(client.clone(), format!("{base_path}_profitability")), + matured: SeriesTree_Cohorts_Utxo_Matured::new(client.clone(), format!("{base_path}_matured")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All { - pub supply: MetricsTree_Cohorts_Utxo_All_Supply, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All { + pub supply: SeriesTree_Cohorts_Utxo_All_Supply, pub outputs: UnspentPattern, - pub activity: MetricsTree_Cohorts_Utxo_All_Activity, - pub realized: MetricsTree_Cohorts_Utxo_All_Realized, - pub cost_basis: MetricsTree_Cohorts_Utxo_All_CostBasis, - pub unrealized: MetricsTree_Cohorts_Utxo_All_Unrealized, + pub activity: SeriesTree_Cohorts_Utxo_All_Activity, + pub realized: SeriesTree_Cohorts_Utxo_All_Realized, + pub cost_basis: SeriesTree_Cohorts_Utxo_All_CostBasis, + pub unrealized: SeriesTree_Cohorts_Utxo_All_Unrealized, } -impl MetricsTree_Cohorts_Utxo_All { +impl SeriesTree_Cohorts_Utxo_All { pub fn new(client: Arc, base_path: String) -> Self { Self { - supply: MetricsTree_Cohorts_Utxo_All_Supply::new(client.clone(), format!("{base_path}_supply")), + supply: SeriesTree_Cohorts_Utxo_All_Supply::new(client.clone(), format!("{base_path}_supply")), outputs: UnspentPattern::new(client.clone(), "utxo_count".to_string()), - activity: MetricsTree_Cohorts_Utxo_All_Activity::new(client.clone(), format!("{base_path}_activity")), - realized: MetricsTree_Cohorts_Utxo_All_Realized::new(client.clone(), format!("{base_path}_realized")), - cost_basis: MetricsTree_Cohorts_Utxo_All_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), - unrealized: MetricsTree_Cohorts_Utxo_All_Unrealized::new(client.clone(), format!("{base_path}_unrealized")), + activity: SeriesTree_Cohorts_Utxo_All_Activity::new(client.clone(), format!("{base_path}_activity")), + realized: SeriesTree_Cohorts_Utxo_All_Realized::new(client.clone(), format!("{base_path}_realized")), + cost_basis: SeriesTree_Cohorts_Utxo_All_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), + unrealized: SeriesTree_Cohorts_Utxo_All_Unrealized::new(client.clone(), format!("{base_path}_unrealized")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Supply { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Supply { pub total: BtcCentsSatsUsdPattern, pub half: BtcCentsSatsUsdPattern, pub delta: AbsoluteRatePattern, @@ -6272,7 +6272,7 @@ pub struct MetricsTree_Cohorts_Utxo_All_Supply { pub in_loss: BtcCentsRelSatsUsdPattern2, } -impl MetricsTree_Cohorts_Utxo_All_Supply { +impl SeriesTree_Cohorts_Utxo_All_Supply { pub fn new(client: Arc, base_path: String) -> Self { Self { total: BtcCentsSatsUsdPattern::new(client.clone(), "supply".to_string()), @@ -6284,72 +6284,72 @@ impl MetricsTree_Cohorts_Utxo_All_Supply { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Activity { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Activity { pub sent: BaseCumulativeInSumPattern, pub coindays_destroyed: BaseCumulativeSumPattern, - pub coinyears_destroyed: MetricPattern1, - pub dormancy: MetricPattern1, + pub coinyears_destroyed: SeriesPattern1, + pub dormancy: SeriesPattern1, } -impl MetricsTree_Cohorts_Utxo_All_Activity { +impl SeriesTree_Cohorts_Utxo_All_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { sent: BaseCumulativeInSumPattern::new(client.clone(), "sent".to_string()), coindays_destroyed: BaseCumulativeSumPattern::new(client.clone(), "coindays_destroyed".to_string()), - coinyears_destroyed: MetricPattern1::new(client.clone(), "coinyears_destroyed".to_string()), - dormancy: MetricPattern1::new(client.clone(), "dormancy".to_string()), + coinyears_destroyed: SeriesPattern1::new(client.clone(), "coinyears_destroyed".to_string()), + dormancy: SeriesPattern1::new(client.clone(), "dormancy".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized { pub cap: CentsDeltaRelUsdPattern, - pub profit: MetricsTree_Cohorts_Utxo_All_Realized_Profit, - pub loss: MetricsTree_Cohorts_Utxo_All_Realized_Loss, - pub price: MetricsTree_Cohorts_Utxo_All_Realized_Price, - pub mvrv: MetricPattern1, - pub sopr: MetricsTree_Cohorts_Utxo_All_Realized_Sopr, + pub profit: SeriesTree_Cohorts_Utxo_All_Realized_Profit, + pub loss: SeriesTree_Cohorts_Utxo_All_Realized_Loss, + pub price: SeriesTree_Cohorts_Utxo_All_Realized_Price, + pub mvrv: SeriesPattern1, + pub sopr: SeriesTree_Cohorts_Utxo_All_Realized_Sopr, pub net_pnl: BaseChangeCumulativeDeltaRelSumPattern, pub gross_pnl: BaseCumulativeSumPattern3, pub sell_side_risk_ratio: _1m1w1y24hPattern6, pub peak_regret: BaseCumulativeRelPattern, - pub investor: MetricsTree_Cohorts_Utxo_All_Realized_Investor, + pub investor: SeriesTree_Cohorts_Utxo_All_Realized_Investor, pub profit_to_loss_ratio: _1m1w1y24hPattern, } -impl MetricsTree_Cohorts_Utxo_All_Realized { +impl SeriesTree_Cohorts_Utxo_All_Realized { pub fn new(client: Arc, base_path: String) -> Self { Self { cap: CentsDeltaRelUsdPattern::new(client.clone(), "realized_cap".to_string()), - profit: MetricsTree_Cohorts_Utxo_All_Realized_Profit::new(client.clone(), format!("{base_path}_profit")), - loss: MetricsTree_Cohorts_Utxo_All_Realized_Loss::new(client.clone(), format!("{base_path}_loss")), - price: MetricsTree_Cohorts_Utxo_All_Realized_Price::new(client.clone(), format!("{base_path}_price")), - mvrv: MetricPattern1::new(client.clone(), "mvrv".to_string()), - sopr: MetricsTree_Cohorts_Utxo_All_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), + profit: SeriesTree_Cohorts_Utxo_All_Realized_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Utxo_All_Realized_Loss::new(client.clone(), format!("{base_path}_loss")), + price: SeriesTree_Cohorts_Utxo_All_Realized_Price::new(client.clone(), format!("{base_path}_price")), + mvrv: SeriesPattern1::new(client.clone(), "mvrv".to_string()), + sopr: SeriesTree_Cohorts_Utxo_All_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), net_pnl: BaseChangeCumulativeDeltaRelSumPattern::new(client.clone(), "net".to_string()), gross_pnl: BaseCumulativeSumPattern3::new(client.clone(), "realized_gross_pnl".to_string()), sell_side_risk_ratio: _1m1w1y24hPattern6::new(client.clone(), "sell_side_risk_ratio".to_string()), peak_regret: BaseCumulativeRelPattern::new(client.clone(), "realized_peak_regret".to_string()), - investor: MetricsTree_Cohorts_Utxo_All_Realized_Investor::new(client.clone(), format!("{base_path}_investor")), + investor: SeriesTree_Cohorts_Utxo_All_Realized_Investor::new(client.clone(), format!("{base_path}_investor")), profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), "realized_profit_to_loss_ratio".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Profit { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Profit { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, pub sum: _1m1w1y24hPattern4, pub rel_to_rcap: BpsPercentRatioPattern4, pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, - pub distribution_flow: MetricPattern1, + pub distribution_flow: SeriesPattern1, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Profit { +impl SeriesTree_Cohorts_Utxo_All_Realized_Profit { pub fn new(client: Arc, base_path: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), "realized_profit".to_string()), @@ -6358,88 +6358,88 @@ impl MetricsTree_Cohorts_Utxo_All_Realized_Profit { rel_to_rcap: BpsPercentRatioPattern4::new(client.clone(), "realized_profit_rel_to_rcap".to_string()), value_created: BaseCumulativeSumPattern::new(client.clone(), "profit_value_created".to_string()), value_destroyed: BaseCumulativeSumPattern::new(client.clone(), "profit_value_destroyed".to_string()), - distribution_flow: MetricPattern1::new(client.clone(), "distribution_flow".to_string()), + distribution_flow: SeriesPattern1::new(client.clone(), "distribution_flow".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Loss { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Loss { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, pub sum: _1m1w1y24hPattern4, - pub negative: MetricPattern1, + pub negative: SeriesPattern1, pub rel_to_rcap: BpsPercentRatioPattern4, pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, - pub capitulation_flow: MetricPattern1, + pub capitulation_flow: SeriesPattern1, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Loss { +impl SeriesTree_Cohorts_Utxo_All_Realized_Loss { pub fn new(client: Arc, base_path: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), "realized_loss".to_string()), cumulative: CentsUsdPattern2::new(client.clone(), "realized_loss_cumulative".to_string()), sum: _1m1w1y24hPattern4::new(client.clone(), "realized_loss_sum".to_string()), - negative: MetricPattern1::new(client.clone(), "neg_realized_loss".to_string()), + negative: SeriesPattern1::new(client.clone(), "neg_realized_loss".to_string()), rel_to_rcap: BpsPercentRatioPattern4::new(client.clone(), "realized_loss_rel_to_rcap".to_string()), value_created: BaseCumulativeSumPattern::new(client.clone(), "loss_value_created".to_string()), value_destroyed: BaseCumulativeSumPattern::new(client.clone(), "loss_value_destroyed".to_string()), - capitulation_flow: MetricPattern1::new(client.clone(), "capitulation_flow".to_string()), + capitulation_flow: SeriesPattern1::new(client.clone(), "capitulation_flow".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price { - pub usd: MetricPattern1, - pub cents: MetricPattern1, - pub sats: MetricPattern1, - pub bps: MetricPattern1, - pub ratio: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Price { + pub usd: SeriesPattern1, + pub cents: SeriesPattern1, + pub sats: SeriesPattern1, + pub bps: SeriesPattern1, + pub ratio: SeriesPattern1, pub percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern, pub sma: _1m1w1y2y4yAllPattern, - pub std_dev: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev, + pub std_dev: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Price { +impl SeriesTree_Cohorts_Utxo_All_Realized_Price { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: MetricPattern1::new(client.clone(), "realized_price".to_string()), - cents: MetricPattern1::new(client.clone(), "realized_price_cents".to_string()), - sats: MetricPattern1::new(client.clone(), "realized_price_sats".to_string()), - bps: MetricPattern1::new(client.clone(), "realized_price_ratio_bps".to_string()), - ratio: MetricPattern1::new(client.clone(), "realized_price_ratio".to_string()), + usd: SeriesPattern1::new(client.clone(), "realized_price".to_string()), + cents: SeriesPattern1::new(client.clone(), "realized_price_cents".to_string()), + sats: SeriesPattern1::new(client.clone(), "realized_price_sats".to_string()), + bps: SeriesPattern1::new(client.clone(), "realized_price_ratio_bps".to_string()), + ratio: SeriesPattern1::new(client.clone(), "realized_price_ratio".to_string()), percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new(client.clone(), "realized_price".to_string()), sma: _1m1w1y2y4yAllPattern::new(client.clone(), "realized_price_ratio_sma".to_string()), - std_dev: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev::new(client.clone(), format!("{base_path}_std_dev")), + std_dev: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev::new(client.clone(), format!("{base_path}_std_dev")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev { - pub all: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All, - pub _4y: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y, - pub _2y: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y, - pub _1y: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev { + pub all: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All, + pub _4y: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y, + pub _2y: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y, + pub _1y: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev { +impl SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All::new(client.clone(), format!("{base_path}_all")), - _4y: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y::new(client.clone(), format!("{base_path}_4y")), - _2y: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y::new(client.clone(), format!("{base_path}_2y")), - _1y: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y::new(client.clone(), format!("{base_path}_1y")), + all: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All::new(client.clone(), format!("{base_path}_all")), + _4y: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y::new(client.clone(), format!("{base_path}_4y")), + _2y: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y::new(client.clone(), format!("{base_path}_2y")), + _1y: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y::new(client.clone(), format!("{base_path}_1y")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -6455,11 +6455,11 @@ pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All { +impl SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "realized_price_ratio_sd".to_string()), - zscore: MetricPattern1::new(client.clone(), "realized_price_ratio_zscore".to_string()), + sd: SeriesPattern1::new(client.clone(), "realized_price_ratio_sd".to_string()), + zscore: SeriesPattern1::new(client.clone(), "realized_price_ratio_zscore".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "realized_price_0sd".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p0_5sd".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p1sd".to_string()), @@ -6477,10 +6477,10 @@ impl MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -6496,11 +6496,11 @@ pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y { +impl SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "realized_price_ratio_sd_4y".to_string()), - zscore: MetricPattern1::new(client.clone(), "realized_price_ratio_zscore_4y".to_string()), + sd: SeriesPattern1::new(client.clone(), "realized_price_ratio_sd_4y".to_string()), + zscore: SeriesPattern1::new(client.clone(), "realized_price_ratio_zscore_4y".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "realized_price_0sd_4y".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p0_5sd_4y".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p1sd_4y".to_string()), @@ -6518,10 +6518,10 @@ impl MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -6537,11 +6537,11 @@ pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y { +impl SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "realized_price_ratio_sd_2y".to_string()), - zscore: MetricPattern1::new(client.clone(), "realized_price_ratio_zscore_2y".to_string()), + sd: SeriesPattern1::new(client.clone(), "realized_price_ratio_sd_2y".to_string()), + zscore: SeriesPattern1::new(client.clone(), "realized_price_ratio_zscore_2y".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "realized_price_0sd_2y".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p0_5sd_2y".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p1sd_2y".to_string()), @@ -6559,10 +6559,10 @@ impl MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -6578,11 +6578,11 @@ pub struct MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y { +impl SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "realized_price_ratio_sd_1y".to_string()), - zscore: MetricPattern1::new(client.clone(), "realized_price_ratio_zscore_1y".to_string()), + sd: SeriesPattern1::new(client.clone(), "realized_price_ratio_sd_1y".to_string()), + zscore: SeriesPattern1::new(client.clone(), "realized_price_ratio_zscore_1y".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "realized_price_0sd_1y".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p0_5sd_1y".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "realized_price".to_string(), "p1sd_1y".to_string()), @@ -6600,33 +6600,33 @@ impl MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Sopr { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Sopr { pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, pub ratio: _1m1w1y24hPattern, - pub adjusted: MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted, + pub adjusted: SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Sopr { +impl SeriesTree_Cohorts_Utxo_All_Realized_Sopr { pub fn new(client: Arc, base_path: String) -> Self { Self { value_created: BaseCumulativeSumPattern::new(client.clone(), "value_created".to_string()), value_destroyed: BaseCumulativeSumPattern::new(client.clone(), "value_destroyed".to_string()), ratio: _1m1w1y24hPattern::new(client.clone(), "sopr".to_string()), - adjusted: MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted::new(client.clone(), format!("{base_path}_adjusted")), + adjusted: SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted::new(client.clone(), format!("{base_path}_adjusted")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted { pub ratio: _1m1w1y24hPattern, pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted { +impl SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted { pub fn new(client: Arc, base_path: String) -> Self { Self { ratio: _1m1w1y24hPattern::new(client.clone(), "asopr".to_string()), @@ -6636,14 +6636,14 @@ impl MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Realized_Investor { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Realized_Investor { pub price: BpsCentsPercentilesRatioSatsUsdPattern, pub lower_price_band: CentsSatsUsdPattern, pub upper_price_band: CentsSatsUsdPattern, } -impl MetricsTree_Cohorts_Utxo_All_Realized_Investor { +impl SeriesTree_Cohorts_Utxo_All_Realized_Investor { pub fn new(client: Arc, base_path: String) -> Self { Self { price: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "investor_price".to_string()), @@ -6653,8 +6653,8 @@ impl MetricsTree_Cohorts_Utxo_All_Realized_Investor { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_CostBasis { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_CostBasis { pub min: CentsSatsUsdPattern, pub max: CentsSatsUsdPattern, pub percentiles: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, @@ -6662,7 +6662,7 @@ pub struct MetricsTree_Cohorts_Utxo_All_CostBasis { pub supply_density: BpsPercentRatioPattern3, } -impl MetricsTree_Cohorts_Utxo_All_CostBasis { +impl SeriesTree_Cohorts_Utxo_All_CostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { min: CentsSatsUsdPattern::new(client.clone(), "cost_basis_min".to_string()), @@ -6674,33 +6674,33 @@ impl MetricsTree_Cohorts_Utxo_All_CostBasis { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Unrealized { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Unrealized { pub nupl: BpsRatioPattern, - pub profit: MetricsTree_Cohorts_Utxo_All_Unrealized_Profit, - pub loss: MetricsTree_Cohorts_Utxo_All_Unrealized_Loss, - pub net_pnl: MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl, + pub profit: SeriesTree_Cohorts_Utxo_All_Unrealized_Profit, + pub loss: SeriesTree_Cohorts_Utxo_All_Unrealized_Loss, + pub net_pnl: SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl, pub gross_pnl: CentsUsdPattern2, pub invested_capital: InPattern, - pub sentiment: MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment, + pub sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment, } -impl MetricsTree_Cohorts_Utxo_All_Unrealized { +impl SeriesTree_Cohorts_Utxo_All_Unrealized { pub fn new(client: Arc, base_path: String) -> Self { Self { nupl: BpsRatioPattern::new(client.clone(), "nupl".to_string()), - profit: MetricsTree_Cohorts_Utxo_All_Unrealized_Profit::new(client.clone(), format!("{base_path}_profit")), - loss: MetricsTree_Cohorts_Utxo_All_Unrealized_Loss::new(client.clone(), format!("{base_path}_loss")), - net_pnl: MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl::new(client.clone(), format!("{base_path}_net_pnl")), + profit: SeriesTree_Cohorts_Utxo_All_Unrealized_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Utxo_All_Unrealized_Loss::new(client.clone(), format!("{base_path}_loss")), + net_pnl: SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl::new(client.clone(), format!("{base_path}_net_pnl")), gross_pnl: CentsUsdPattern2::new(client.clone(), "unrealized_gross_pnl".to_string()), invested_capital: InPattern::new(client.clone(), "invested_capital_in".to_string()), - sentiment: MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment::new(client.clone(), format!("{base_path}_sentiment")), + sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment::new(client.clone(), format!("{base_path}_sentiment")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Unrealized_Profit { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Unrealized_Profit { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, pub sum: _1m1w1y24hPattern4, @@ -6708,7 +6708,7 @@ pub struct MetricsTree_Cohorts_Utxo_All_Unrealized_Profit { pub rel_to_own_gross: BpsPercentRatioPattern3, } -impl MetricsTree_Cohorts_Utxo_All_Unrealized_Profit { +impl SeriesTree_Cohorts_Utxo_All_Unrealized_Profit { pub fn new(client: Arc, base_path: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), "unrealized_profit".to_string()), @@ -6720,54 +6720,54 @@ impl MetricsTree_Cohorts_Utxo_All_Unrealized_Profit { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Unrealized_Loss { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Unrealized_Loss { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, pub sum: _1m1w1y24hPattern4, - pub negative: MetricPattern1, + pub negative: SeriesPattern1, pub rel_to_mcap: BpsPercentRatioPattern3, pub rel_to_own_gross: BpsPercentRatioPattern3, } -impl MetricsTree_Cohorts_Utxo_All_Unrealized_Loss { +impl SeriesTree_Cohorts_Utxo_All_Unrealized_Loss { pub fn new(client: Arc, base_path: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), "unrealized_loss".to_string()), cumulative: CentsUsdPattern2::new(client.clone(), "unrealized_loss_cumulative".to_string()), sum: _1m1w1y24hPattern4::new(client.clone(), "unrealized_loss_sum".to_string()), - negative: MetricPattern1::new(client.clone(), "neg_unrealized_loss".to_string()), + negative: SeriesPattern1::new(client.clone(), "neg_unrealized_loss".to_string()), rel_to_mcap: BpsPercentRatioPattern3::new(client.clone(), "unrealized_loss_rel_to_mcap".to_string()), rel_to_own_gross: BpsPercentRatioPattern3::new(client.clone(), "unrealized_loss_rel_to_own_gross_pnl".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl { - pub usd: MetricPattern1, - pub cents: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl { + pub usd: SeriesPattern1, + pub cents: SeriesPattern1, pub rel_to_own_gross: BpsPercentRatioPattern, } -impl MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl { +impl SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: MetricPattern1::new(client.clone(), "net_unrealized_pnl".to_string()), - cents: MetricPattern1::new(client.clone(), "net_unrealized_pnl_cents".to_string()), + usd: SeriesPattern1::new(client.clone(), "net_unrealized_pnl".to_string()), + cents: SeriesPattern1::new(client.clone(), "net_unrealized_pnl_cents".to_string()), rel_to_own_gross: BpsPercentRatioPattern::new(client.clone(), "net_unrealized_pnl_rel_to_own_gross_pnl".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment { pub pain_index: CentsUsdPattern2, pub greed_index: CentsUsdPattern2, pub net: CentsUsdPattern, } -impl MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment { +impl SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment { pub fn new(client: Arc, base_path: String) -> Self { Self { pain_index: CentsUsdPattern2::new(client.clone(), "pain_index".to_string()), @@ -6777,95 +6777,95 @@ impl MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth { pub supply: DeltaHalfInRelTotalPattern2, pub outputs: UnspentPattern, - pub activity: MetricsTree_Cohorts_Utxo_Sth_Activity, - pub realized: MetricsTree_Cohorts_Utxo_Sth_Realized, - pub cost_basis: MetricsTree_Cohorts_Utxo_Sth_CostBasis, - pub unrealized: MetricsTree_Cohorts_Utxo_Sth_Unrealized, + pub activity: SeriesTree_Cohorts_Utxo_Sth_Activity, + pub realized: SeriesTree_Cohorts_Utxo_Sth_Realized, + pub cost_basis: SeriesTree_Cohorts_Utxo_Sth_CostBasis, + pub unrealized: SeriesTree_Cohorts_Utxo_Sth_Unrealized, } -impl MetricsTree_Cohorts_Utxo_Sth { +impl SeriesTree_Cohorts_Utxo_Sth { pub fn new(client: Arc, base_path: String) -> Self { Self { supply: DeltaHalfInRelTotalPattern2::new(client.clone(), "sth_supply".to_string()), outputs: UnspentPattern::new(client.clone(), "sth_utxo_count".to_string()), - activity: MetricsTree_Cohorts_Utxo_Sth_Activity::new(client.clone(), format!("{base_path}_activity")), - realized: MetricsTree_Cohorts_Utxo_Sth_Realized::new(client.clone(), format!("{base_path}_realized")), - cost_basis: MetricsTree_Cohorts_Utxo_Sth_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), - unrealized: MetricsTree_Cohorts_Utxo_Sth_Unrealized::new(client.clone(), format!("{base_path}_unrealized")), + activity: SeriesTree_Cohorts_Utxo_Sth_Activity::new(client.clone(), format!("{base_path}_activity")), + realized: SeriesTree_Cohorts_Utxo_Sth_Realized::new(client.clone(), format!("{base_path}_realized")), + cost_basis: SeriesTree_Cohorts_Utxo_Sth_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), + unrealized: SeriesTree_Cohorts_Utxo_Sth_Unrealized::new(client.clone(), format!("{base_path}_unrealized")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Activity { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Activity { pub sent: BaseCumulativeInSumPattern, pub coindays_destroyed: BaseCumulativeSumPattern, - pub coinyears_destroyed: MetricPattern1, - pub dormancy: MetricPattern1, + pub coinyears_destroyed: SeriesPattern1, + pub dormancy: SeriesPattern1, } -impl MetricsTree_Cohorts_Utxo_Sth_Activity { +impl SeriesTree_Cohorts_Utxo_Sth_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { sent: BaseCumulativeInSumPattern::new(client.clone(), "sth_sent".to_string()), coindays_destroyed: BaseCumulativeSumPattern::new(client.clone(), "sth_coindays_destroyed".to_string()), - coinyears_destroyed: MetricPattern1::new(client.clone(), "sth_coinyears_destroyed".to_string()), - dormancy: MetricPattern1::new(client.clone(), "sth_dormancy".to_string()), + coinyears_destroyed: SeriesPattern1::new(client.clone(), "sth_coinyears_destroyed".to_string()), + dormancy: SeriesPattern1::new(client.clone(), "sth_dormancy".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized { pub cap: CentsDeltaRelUsdPattern, - pub profit: MetricsTree_Cohorts_Utxo_Sth_Realized_Profit, - pub loss: MetricsTree_Cohorts_Utxo_Sth_Realized_Loss, - pub price: MetricsTree_Cohorts_Utxo_Sth_Realized_Price, - pub mvrv: MetricPattern1, - pub sopr: MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr, + pub profit: SeriesTree_Cohorts_Utxo_Sth_Realized_Profit, + pub loss: SeriesTree_Cohorts_Utxo_Sth_Realized_Loss, + pub price: SeriesTree_Cohorts_Utxo_Sth_Realized_Price, + pub mvrv: SeriesPattern1, + pub sopr: SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr, pub net_pnl: BaseChangeCumulativeDeltaRelSumPattern, pub gross_pnl: BaseCumulativeSumPattern3, pub sell_side_risk_ratio: _1m1w1y24hPattern6, pub peak_regret: BaseCumulativeRelPattern, - pub investor: MetricsTree_Cohorts_Utxo_Sth_Realized_Investor, + pub investor: SeriesTree_Cohorts_Utxo_Sth_Realized_Investor, pub profit_to_loss_ratio: _1m1w1y24hPattern, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized { +impl SeriesTree_Cohorts_Utxo_Sth_Realized { pub fn new(client: Arc, base_path: String) -> Self { Self { cap: CentsDeltaRelUsdPattern::new(client.clone(), "sth_realized_cap".to_string()), - profit: MetricsTree_Cohorts_Utxo_Sth_Realized_Profit::new(client.clone(), format!("{base_path}_profit")), - loss: MetricsTree_Cohorts_Utxo_Sth_Realized_Loss::new(client.clone(), format!("{base_path}_loss")), - price: MetricsTree_Cohorts_Utxo_Sth_Realized_Price::new(client.clone(), format!("{base_path}_price")), - mvrv: MetricPattern1::new(client.clone(), "sth_mvrv".to_string()), - sopr: MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), + profit: SeriesTree_Cohorts_Utxo_Sth_Realized_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Utxo_Sth_Realized_Loss::new(client.clone(), format!("{base_path}_loss")), + price: SeriesTree_Cohorts_Utxo_Sth_Realized_Price::new(client.clone(), format!("{base_path}_price")), + mvrv: SeriesPattern1::new(client.clone(), "sth_mvrv".to_string()), + sopr: SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), net_pnl: BaseChangeCumulativeDeltaRelSumPattern::new(client.clone(), "sth_net".to_string()), gross_pnl: BaseCumulativeSumPattern3::new(client.clone(), "sth_realized_gross_pnl".to_string()), sell_side_risk_ratio: _1m1w1y24hPattern6::new(client.clone(), "sth_sell_side_risk_ratio".to_string()), peak_regret: BaseCumulativeRelPattern::new(client.clone(), "sth_realized_peak_regret".to_string()), - investor: MetricsTree_Cohorts_Utxo_Sth_Realized_Investor::new(client.clone(), format!("{base_path}_investor")), + investor: SeriesTree_Cohorts_Utxo_Sth_Realized_Investor::new(client.clone(), format!("{base_path}_investor")), profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), "sth_realized_profit_to_loss_ratio".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Profit { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Profit { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, pub sum: _1m1w1y24hPattern4, pub rel_to_rcap: BpsPercentRatioPattern4, pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, - pub distribution_flow: MetricPattern1, + pub distribution_flow: SeriesPattern1, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Profit { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Profit { pub fn new(client: Arc, base_path: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), "sth_realized_profit".to_string()), @@ -6874,88 +6874,88 @@ impl MetricsTree_Cohorts_Utxo_Sth_Realized_Profit { rel_to_rcap: BpsPercentRatioPattern4::new(client.clone(), "sth_realized_profit_rel_to_rcap".to_string()), value_created: BaseCumulativeSumPattern::new(client.clone(), "sth_profit_value_created".to_string()), value_destroyed: BaseCumulativeSumPattern::new(client.clone(), "sth_profit_value_destroyed".to_string()), - distribution_flow: MetricPattern1::new(client.clone(), "sth_distribution_flow".to_string()), + distribution_flow: SeriesPattern1::new(client.clone(), "sth_distribution_flow".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Loss { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Loss { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, pub sum: _1m1w1y24hPattern4, - pub negative: MetricPattern1, + pub negative: SeriesPattern1, pub rel_to_rcap: BpsPercentRatioPattern4, pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, - pub capitulation_flow: MetricPattern1, + pub capitulation_flow: SeriesPattern1, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Loss { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Loss { pub fn new(client: Arc, base_path: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), "sth_realized_loss".to_string()), cumulative: CentsUsdPattern2::new(client.clone(), "sth_realized_loss_cumulative".to_string()), sum: _1m1w1y24hPattern4::new(client.clone(), "sth_realized_loss_sum".to_string()), - negative: MetricPattern1::new(client.clone(), "sth_neg_realized_loss".to_string()), + negative: SeriesPattern1::new(client.clone(), "sth_neg_realized_loss".to_string()), rel_to_rcap: BpsPercentRatioPattern4::new(client.clone(), "sth_realized_loss_rel_to_rcap".to_string()), value_created: BaseCumulativeSumPattern::new(client.clone(), "sth_loss_value_created".to_string()), value_destroyed: BaseCumulativeSumPattern::new(client.clone(), "sth_loss_value_destroyed".to_string()), - capitulation_flow: MetricPattern1::new(client.clone(), "sth_capitulation_flow".to_string()), + capitulation_flow: SeriesPattern1::new(client.clone(), "sth_capitulation_flow".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price { - pub usd: MetricPattern1, - pub cents: MetricPattern1, - pub sats: MetricPattern1, - pub bps: MetricPattern1, - pub ratio: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Price { + pub usd: SeriesPattern1, + pub cents: SeriesPattern1, + pub sats: SeriesPattern1, + pub bps: SeriesPattern1, + pub ratio: SeriesPattern1, pub percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern, pub sma: _1m1w1y2y4yAllPattern, - pub std_dev: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev, + pub std_dev: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: MetricPattern1::new(client.clone(), "sth_realized_price".to_string()), - cents: MetricPattern1::new(client.clone(), "sth_realized_price_cents".to_string()), - sats: MetricPattern1::new(client.clone(), "sth_realized_price_sats".to_string()), - bps: MetricPattern1::new(client.clone(), "sth_realized_price_ratio_bps".to_string()), - ratio: MetricPattern1::new(client.clone(), "sth_realized_price_ratio".to_string()), + usd: SeriesPattern1::new(client.clone(), "sth_realized_price".to_string()), + cents: SeriesPattern1::new(client.clone(), "sth_realized_price_cents".to_string()), + sats: SeriesPattern1::new(client.clone(), "sth_realized_price_sats".to_string()), + bps: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_bps".to_string()), + ratio: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio".to_string()), percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new(client.clone(), "sth_realized_price".to_string()), sma: _1m1w1y2y4yAllPattern::new(client.clone(), "sth_realized_price_ratio_sma".to_string()), - std_dev: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev::new(client.clone(), format!("{base_path}_std_dev")), + std_dev: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev::new(client.clone(), format!("{base_path}_std_dev")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev { - pub all: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All, - pub _4y: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y, - pub _2y: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y, - pub _1y: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev { + pub all: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All, + pub _4y: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y, + pub _2y: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y, + pub _1y: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All::new(client.clone(), format!("{base_path}_all")), - _4y: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y::new(client.clone(), format!("{base_path}_4y")), - _2y: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y::new(client.clone(), format!("{base_path}_2y")), - _1y: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y::new(client.clone(), format!("{base_path}_1y")), + all: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All::new(client.clone(), format!("{base_path}_all")), + _4y: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y::new(client.clone(), format!("{base_path}_4y")), + _2y: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y::new(client.clone(), format!("{base_path}_2y")), + _1y: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y::new(client.clone(), format!("{base_path}_1y")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -6971,11 +6971,11 @@ pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "sth_realized_price_ratio_sd".to_string()), - zscore: MetricPattern1::new(client.clone(), "sth_realized_price_ratio_zscore".to_string()), + sd: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_sd".to_string()), + zscore: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_zscore".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "sth_realized_price_0sd".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p0_5sd".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p1sd".to_string()), @@ -6993,10 +6993,10 @@ impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -7012,11 +7012,11 @@ pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "sth_realized_price_ratio_sd_4y".to_string()), - zscore: MetricPattern1::new(client.clone(), "sth_realized_price_ratio_zscore_4y".to_string()), + sd: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_sd_4y".to_string()), + zscore: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_zscore_4y".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "sth_realized_price_0sd_4y".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p0_5sd_4y".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p1sd_4y".to_string()), @@ -7034,10 +7034,10 @@ impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -7053,11 +7053,11 @@ pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "sth_realized_price_ratio_sd_2y".to_string()), - zscore: MetricPattern1::new(client.clone(), "sth_realized_price_ratio_zscore_2y".to_string()), + sd: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_sd_2y".to_string()), + zscore: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_zscore_2y".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "sth_realized_price_0sd_2y".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p0_5sd_2y".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p1sd_2y".to_string()), @@ -7075,10 +7075,10 @@ impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -7094,11 +7094,11 @@ pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "sth_realized_price_ratio_sd_1y".to_string()), - zscore: MetricPattern1::new(client.clone(), "sth_realized_price_ratio_zscore_1y".to_string()), + sd: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_sd_1y".to_string()), + zscore: SeriesPattern1::new(client.clone(), "sth_realized_price_ratio_zscore_1y".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "sth_realized_price_0sd_1y".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p0_5sd_1y".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "sth_realized_price".to_string(), "p1sd_1y".to_string()), @@ -7116,33 +7116,33 @@ impl MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr { pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, pub ratio: _1m1w1y24hPattern, - pub adjusted: MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted, + pub adjusted: SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr { pub fn new(client: Arc, base_path: String) -> Self { Self { value_created: BaseCumulativeSumPattern::new(client.clone(), "sth_value_created".to_string()), value_destroyed: BaseCumulativeSumPattern::new(client.clone(), "sth_value_destroyed".to_string()), ratio: _1m1w1y24hPattern::new(client.clone(), "sth_sopr".to_string()), - adjusted: MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted::new(client.clone(), format!("{base_path}_adjusted")), + adjusted: SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted::new(client.clone(), format!("{base_path}_adjusted")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted { pub ratio: _1m1w1y24hPattern, pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted { pub fn new(client: Arc, base_path: String) -> Self { Self { ratio: _1m1w1y24hPattern::new(client.clone(), "sth_asopr".to_string()), @@ -7152,14 +7152,14 @@ impl MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Realized_Investor { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Realized_Investor { pub price: BpsCentsPercentilesRatioSatsUsdPattern, pub lower_price_band: CentsSatsUsdPattern, pub upper_price_band: CentsSatsUsdPattern, } -impl MetricsTree_Cohorts_Utxo_Sth_Realized_Investor { +impl SeriesTree_Cohorts_Utxo_Sth_Realized_Investor { pub fn new(client: Arc, base_path: String) -> Self { Self { price: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "sth_investor_price".to_string()), @@ -7169,8 +7169,8 @@ impl MetricsTree_Cohorts_Utxo_Sth_Realized_Investor { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_CostBasis { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_CostBasis { pub min: CentsSatsUsdPattern, pub max: CentsSatsUsdPattern, pub percentiles: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, @@ -7178,7 +7178,7 @@ pub struct MetricsTree_Cohorts_Utxo_Sth_CostBasis { pub supply_density: BpsPercentRatioPattern3, } -impl MetricsTree_Cohorts_Utxo_Sth_CostBasis { +impl SeriesTree_Cohorts_Utxo_Sth_CostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { min: CentsSatsUsdPattern::new(client.clone(), "sth_cost_basis_min".to_string()), @@ -7190,18 +7190,18 @@ impl MetricsTree_Cohorts_Utxo_Sth_CostBasis { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Unrealized { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Unrealized { pub nupl: BpsRatioPattern, pub profit: BaseCumulativeRelSumPattern2, pub loss: BaseCumulativeNegativeRelSumPattern2, pub net_pnl: CentsRelUsdPattern2, pub gross_pnl: CentsUsdPattern2, pub invested_capital: InPattern, - pub sentiment: MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment, + pub sentiment: SeriesTree_Cohorts_Utxo_Sth_Unrealized_Sentiment, } -impl MetricsTree_Cohorts_Utxo_Sth_Unrealized { +impl SeriesTree_Cohorts_Utxo_Sth_Unrealized { pub fn new(client: Arc, base_path: String) -> Self { Self { nupl: BpsRatioPattern::new(client.clone(), "sth_nupl".to_string()), @@ -7210,19 +7210,19 @@ impl MetricsTree_Cohorts_Utxo_Sth_Unrealized { net_pnl: CentsRelUsdPattern2::new(client.clone(), "sth_net_unrealized_pnl".to_string()), gross_pnl: CentsUsdPattern2::new(client.clone(), "sth_unrealized_gross_pnl".to_string()), invested_capital: InPattern::new(client.clone(), "sth_invested_capital_in".to_string()), - sentiment: MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment::new(client.clone(), format!("{base_path}_sentiment")), + sentiment: SeriesTree_Cohorts_Utxo_Sth_Unrealized_Sentiment::new(client.clone(), format!("{base_path}_sentiment")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Sth_Unrealized_Sentiment { pub pain_index: CentsUsdPattern2, pub greed_index: CentsUsdPattern2, pub net: CentsUsdPattern, } -impl MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment { +impl SeriesTree_Cohorts_Utxo_Sth_Unrealized_Sentiment { pub fn new(client: Arc, base_path: String) -> Self { Self { pain_index: CentsUsdPattern2::new(client.clone(), "sth_pain_index".to_string()), @@ -7232,95 +7232,95 @@ impl MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth { pub supply: DeltaHalfInRelTotalPattern2, pub outputs: UnspentPattern, - pub activity: MetricsTree_Cohorts_Utxo_Lth_Activity, - pub realized: MetricsTree_Cohorts_Utxo_Lth_Realized, - pub cost_basis: MetricsTree_Cohorts_Utxo_Lth_CostBasis, - pub unrealized: MetricsTree_Cohorts_Utxo_Lth_Unrealized, + pub activity: SeriesTree_Cohorts_Utxo_Lth_Activity, + pub realized: SeriesTree_Cohorts_Utxo_Lth_Realized, + pub cost_basis: SeriesTree_Cohorts_Utxo_Lth_CostBasis, + pub unrealized: SeriesTree_Cohorts_Utxo_Lth_Unrealized, } -impl MetricsTree_Cohorts_Utxo_Lth { +impl SeriesTree_Cohorts_Utxo_Lth { pub fn new(client: Arc, base_path: String) -> Self { Self { supply: DeltaHalfInRelTotalPattern2::new(client.clone(), "lth_supply".to_string()), outputs: UnspentPattern::new(client.clone(), "lth_utxo_count".to_string()), - activity: MetricsTree_Cohorts_Utxo_Lth_Activity::new(client.clone(), format!("{base_path}_activity")), - realized: MetricsTree_Cohorts_Utxo_Lth_Realized::new(client.clone(), format!("{base_path}_realized")), - cost_basis: MetricsTree_Cohorts_Utxo_Lth_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), - unrealized: MetricsTree_Cohorts_Utxo_Lth_Unrealized::new(client.clone(), format!("{base_path}_unrealized")), + activity: SeriesTree_Cohorts_Utxo_Lth_Activity::new(client.clone(), format!("{base_path}_activity")), + realized: SeriesTree_Cohorts_Utxo_Lth_Realized::new(client.clone(), format!("{base_path}_realized")), + cost_basis: SeriesTree_Cohorts_Utxo_Lth_CostBasis::new(client.clone(), format!("{base_path}_cost_basis")), + unrealized: SeriesTree_Cohorts_Utxo_Lth_Unrealized::new(client.clone(), format!("{base_path}_unrealized")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Activity { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Activity { pub sent: BaseCumulativeInSumPattern, pub coindays_destroyed: BaseCumulativeSumPattern, - pub coinyears_destroyed: MetricPattern1, - pub dormancy: MetricPattern1, + pub coinyears_destroyed: SeriesPattern1, + pub dormancy: SeriesPattern1, } -impl MetricsTree_Cohorts_Utxo_Lth_Activity { +impl SeriesTree_Cohorts_Utxo_Lth_Activity { pub fn new(client: Arc, base_path: String) -> Self { Self { sent: BaseCumulativeInSumPattern::new(client.clone(), "lth_sent".to_string()), coindays_destroyed: BaseCumulativeSumPattern::new(client.clone(), "lth_coindays_destroyed".to_string()), - coinyears_destroyed: MetricPattern1::new(client.clone(), "lth_coinyears_destroyed".to_string()), - dormancy: MetricPattern1::new(client.clone(), "lth_dormancy".to_string()), + coinyears_destroyed: SeriesPattern1::new(client.clone(), "lth_coinyears_destroyed".to_string()), + dormancy: SeriesPattern1::new(client.clone(), "lth_dormancy".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized { pub cap: CentsDeltaRelUsdPattern, - pub profit: MetricsTree_Cohorts_Utxo_Lth_Realized_Profit, - pub loss: MetricsTree_Cohorts_Utxo_Lth_Realized_Loss, - pub price: MetricsTree_Cohorts_Utxo_Lth_Realized_Price, - pub mvrv: MetricPattern1, - pub sopr: MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr, + pub profit: SeriesTree_Cohorts_Utxo_Lth_Realized_Profit, + pub loss: SeriesTree_Cohorts_Utxo_Lth_Realized_Loss, + pub price: SeriesTree_Cohorts_Utxo_Lth_Realized_Price, + pub mvrv: SeriesPattern1, + pub sopr: SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr, pub net_pnl: BaseChangeCumulativeDeltaRelSumPattern, pub gross_pnl: BaseCumulativeSumPattern3, pub sell_side_risk_ratio: _1m1w1y24hPattern6, pub peak_regret: BaseCumulativeRelPattern, - pub investor: MetricsTree_Cohorts_Utxo_Lth_Realized_Investor, + pub investor: SeriesTree_Cohorts_Utxo_Lth_Realized_Investor, pub profit_to_loss_ratio: _1m1w1y24hPattern, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized { +impl SeriesTree_Cohorts_Utxo_Lth_Realized { pub fn new(client: Arc, base_path: String) -> Self { Self { cap: CentsDeltaRelUsdPattern::new(client.clone(), "lth_realized_cap".to_string()), - profit: MetricsTree_Cohorts_Utxo_Lth_Realized_Profit::new(client.clone(), format!("{base_path}_profit")), - loss: MetricsTree_Cohorts_Utxo_Lth_Realized_Loss::new(client.clone(), format!("{base_path}_loss")), - price: MetricsTree_Cohorts_Utxo_Lth_Realized_Price::new(client.clone(), format!("{base_path}_price")), - mvrv: MetricPattern1::new(client.clone(), "lth_mvrv".to_string()), - sopr: MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), + profit: SeriesTree_Cohorts_Utxo_Lth_Realized_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Utxo_Lth_Realized_Loss::new(client.clone(), format!("{base_path}_loss")), + price: SeriesTree_Cohorts_Utxo_Lth_Realized_Price::new(client.clone(), format!("{base_path}_price")), + mvrv: SeriesPattern1::new(client.clone(), "lth_mvrv".to_string()), + sopr: SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr::new(client.clone(), format!("{base_path}_sopr")), net_pnl: BaseChangeCumulativeDeltaRelSumPattern::new(client.clone(), "lth_net".to_string()), gross_pnl: BaseCumulativeSumPattern3::new(client.clone(), "lth_realized_gross_pnl".to_string()), sell_side_risk_ratio: _1m1w1y24hPattern6::new(client.clone(), "lth_sell_side_risk_ratio".to_string()), peak_regret: BaseCumulativeRelPattern::new(client.clone(), "lth_realized_peak_regret".to_string()), - investor: MetricsTree_Cohorts_Utxo_Lth_Realized_Investor::new(client.clone(), format!("{base_path}_investor")), + investor: SeriesTree_Cohorts_Utxo_Lth_Realized_Investor::new(client.clone(), format!("{base_path}_investor")), profit_to_loss_ratio: _1m1w1y24hPattern::new(client.clone(), "lth_realized_profit_to_loss_ratio".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Profit { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Profit { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, pub sum: _1m1w1y24hPattern4, pub rel_to_rcap: BpsPercentRatioPattern4, pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, - pub distribution_flow: MetricPattern1, + pub distribution_flow: SeriesPattern1, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Profit { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Profit { pub fn new(client: Arc, base_path: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), "lth_realized_profit".to_string()), @@ -7329,88 +7329,88 @@ impl MetricsTree_Cohorts_Utxo_Lth_Realized_Profit { rel_to_rcap: BpsPercentRatioPattern4::new(client.clone(), "lth_realized_profit_rel_to_rcap".to_string()), value_created: BaseCumulativeSumPattern::new(client.clone(), "lth_profit_value_created".to_string()), value_destroyed: BaseCumulativeSumPattern::new(client.clone(), "lth_profit_value_destroyed".to_string()), - distribution_flow: MetricPattern1::new(client.clone(), "lth_distribution_flow".to_string()), + distribution_flow: SeriesPattern1::new(client.clone(), "lth_distribution_flow".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Loss { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Loss { pub base: CentsUsdPattern2, pub cumulative: CentsUsdPattern2, pub sum: _1m1w1y24hPattern4, - pub negative: MetricPattern1, + pub negative: SeriesPattern1, pub rel_to_rcap: BpsPercentRatioPattern4, pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, - pub capitulation_flow: MetricPattern1, + pub capitulation_flow: SeriesPattern1, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Loss { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Loss { pub fn new(client: Arc, base_path: String) -> Self { Self { base: CentsUsdPattern2::new(client.clone(), "lth_realized_loss".to_string()), cumulative: CentsUsdPattern2::new(client.clone(), "lth_realized_loss_cumulative".to_string()), sum: _1m1w1y24hPattern4::new(client.clone(), "lth_realized_loss_sum".to_string()), - negative: MetricPattern1::new(client.clone(), "lth_neg_realized_loss".to_string()), + negative: SeriesPattern1::new(client.clone(), "lth_neg_realized_loss".to_string()), rel_to_rcap: BpsPercentRatioPattern4::new(client.clone(), "lth_realized_loss_rel_to_rcap".to_string()), value_created: BaseCumulativeSumPattern::new(client.clone(), "lth_loss_value_created".to_string()), value_destroyed: BaseCumulativeSumPattern::new(client.clone(), "lth_loss_value_destroyed".to_string()), - capitulation_flow: MetricPattern1::new(client.clone(), "lth_capitulation_flow".to_string()), + capitulation_flow: SeriesPattern1::new(client.clone(), "lth_capitulation_flow".to_string()), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price { - pub usd: MetricPattern1, - pub cents: MetricPattern1, - pub sats: MetricPattern1, - pub bps: MetricPattern1, - pub ratio: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Price { + pub usd: SeriesPattern1, + pub cents: SeriesPattern1, + pub sats: SeriesPattern1, + pub bps: SeriesPattern1, + pub ratio: SeriesPattern1, pub percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern, pub sma: _1m1w1y2y4yAllPattern, - pub std_dev: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev, + pub std_dev: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price { pub fn new(client: Arc, base_path: String) -> Self { Self { - usd: MetricPattern1::new(client.clone(), "lth_realized_price".to_string()), - cents: MetricPattern1::new(client.clone(), "lth_realized_price_cents".to_string()), - sats: MetricPattern1::new(client.clone(), "lth_realized_price_sats".to_string()), - bps: MetricPattern1::new(client.clone(), "lth_realized_price_ratio_bps".to_string()), - ratio: MetricPattern1::new(client.clone(), "lth_realized_price_ratio".to_string()), + usd: SeriesPattern1::new(client.clone(), "lth_realized_price".to_string()), + cents: SeriesPattern1::new(client.clone(), "lth_realized_price_cents".to_string()), + sats: SeriesPattern1::new(client.clone(), "lth_realized_price_sats".to_string()), + bps: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_bps".to_string()), + ratio: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio".to_string()), percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern::new(client.clone(), "lth_realized_price".to_string()), sma: _1m1w1y2y4yAllPattern::new(client.clone(), "lth_realized_price_ratio_sma".to_string()), - std_dev: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev::new(client.clone(), format!("{base_path}_std_dev")), + std_dev: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev::new(client.clone(), format!("{base_path}_std_dev")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev { - pub all: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All, - pub _4y: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y, - pub _2y: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y, - pub _1y: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev { + pub all: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All, + pub _4y: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y, + pub _2y: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y, + pub _1y: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev { pub fn new(client: Arc, base_path: String) -> Self { Self { - all: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All::new(client.clone(), format!("{base_path}_all")), - _4y: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y::new(client.clone(), format!("{base_path}_4y")), - _2y: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y::new(client.clone(), format!("{base_path}_2y")), - _1y: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y::new(client.clone(), format!("{base_path}_1y")), + all: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All::new(client.clone(), format!("{base_path}_all")), + _4y: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y::new(client.clone(), format!("{base_path}_4y")), + _2y: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y::new(client.clone(), format!("{base_path}_2y")), + _1y: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y::new(client.clone(), format!("{base_path}_1y")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -7426,11 +7426,11 @@ pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "lth_realized_price_ratio_sd".to_string()), - zscore: MetricPattern1::new(client.clone(), "lth_realized_price_ratio_zscore".to_string()), + sd: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_sd".to_string()), + zscore: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_zscore".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "lth_realized_price_0sd".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p0_5sd".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p1sd".to_string()), @@ -7448,10 +7448,10 @@ impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -7467,11 +7467,11 @@ pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "lth_realized_price_ratio_sd_4y".to_string()), - zscore: MetricPattern1::new(client.clone(), "lth_realized_price_ratio_zscore_4y".to_string()), + sd: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_sd_4y".to_string()), + zscore: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_zscore_4y".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "lth_realized_price_0sd_4y".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p0_5sd_4y".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p1sd_4y".to_string()), @@ -7489,10 +7489,10 @@ impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -7508,11 +7508,11 @@ pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "lth_realized_price_ratio_sd_2y".to_string()), - zscore: MetricPattern1::new(client.clone(), "lth_realized_price_ratio_zscore_2y".to_string()), + sd: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_sd_2y".to_string()), + zscore: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_zscore_2y".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "lth_realized_price_0sd_2y".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p0_5sd_2y".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p1sd_2y".to_string()), @@ -7530,10 +7530,10 @@ impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y { - pub sd: MetricPattern1, - pub zscore: MetricPattern1, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y { + pub sd: SeriesPattern1, + pub zscore: SeriesPattern1, pub _0sd: CentsSatsUsdPattern, pub p0_5sd: PriceRatioPattern, pub p1sd: PriceRatioPattern, @@ -7549,11 +7549,11 @@ pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y { pub m3sd: PriceRatioPattern, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y { pub fn new(client: Arc, base_path: String) -> Self { Self { - sd: MetricPattern1::new(client.clone(), "lth_realized_price_ratio_sd_1y".to_string()), - zscore: MetricPattern1::new(client.clone(), "lth_realized_price_ratio_zscore_1y".to_string()), + sd: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_sd_1y".to_string()), + zscore: SeriesPattern1::new(client.clone(), "lth_realized_price_ratio_zscore_1y".to_string()), _0sd: CentsSatsUsdPattern::new(client.clone(), "lth_realized_price_0sd_1y".to_string()), p0_5sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p0_5sd_1y".to_string()), p1sd: PriceRatioPattern::new(client.clone(), "lth_realized_price".to_string(), "p1sd_1y".to_string()), @@ -7571,14 +7571,14 @@ impl MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr { pub value_created: BaseCumulativeSumPattern, pub value_destroyed: BaseCumulativeSumPattern, pub ratio: _1m1w1y24hPattern, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr { pub fn new(client: Arc, base_path: String) -> Self { Self { value_created: BaseCumulativeSumPattern::new(client.clone(), "lth_value_created".to_string()), @@ -7588,14 +7588,14 @@ impl MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Realized_Investor { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Realized_Investor { pub price: BpsCentsPercentilesRatioSatsUsdPattern, pub lower_price_band: CentsSatsUsdPattern, pub upper_price_band: CentsSatsUsdPattern, } -impl MetricsTree_Cohorts_Utxo_Lth_Realized_Investor { +impl SeriesTree_Cohorts_Utxo_Lth_Realized_Investor { pub fn new(client: Arc, base_path: String) -> Self { Self { price: BpsCentsPercentilesRatioSatsUsdPattern::new(client.clone(), "lth_investor_price".to_string()), @@ -7605,8 +7605,8 @@ impl MetricsTree_Cohorts_Utxo_Lth_Realized_Investor { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_CostBasis { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_CostBasis { pub min: CentsSatsUsdPattern, pub max: CentsSatsUsdPattern, pub percentiles: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern, @@ -7614,7 +7614,7 @@ pub struct MetricsTree_Cohorts_Utxo_Lth_CostBasis { pub supply_density: BpsPercentRatioPattern3, } -impl MetricsTree_Cohorts_Utxo_Lth_CostBasis { +impl SeriesTree_Cohorts_Utxo_Lth_CostBasis { pub fn new(client: Arc, base_path: String) -> Self { Self { min: CentsSatsUsdPattern::new(client.clone(), "lth_cost_basis_min".to_string()), @@ -7626,18 +7626,18 @@ impl MetricsTree_Cohorts_Utxo_Lth_CostBasis { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Unrealized { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Unrealized { pub nupl: BpsRatioPattern, pub profit: BaseCumulativeRelSumPattern2, pub loss: BaseCumulativeNegativeRelSumPattern2, pub net_pnl: CentsRelUsdPattern2, pub gross_pnl: CentsUsdPattern2, pub invested_capital: InPattern, - pub sentiment: MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment, + pub sentiment: SeriesTree_Cohorts_Utxo_Lth_Unrealized_Sentiment, } -impl MetricsTree_Cohorts_Utxo_Lth_Unrealized { +impl SeriesTree_Cohorts_Utxo_Lth_Unrealized { pub fn new(client: Arc, base_path: String) -> Self { Self { nupl: BpsRatioPattern::new(client.clone(), "lth_nupl".to_string()), @@ -7646,19 +7646,19 @@ impl MetricsTree_Cohorts_Utxo_Lth_Unrealized { net_pnl: CentsRelUsdPattern2::new(client.clone(), "lth_net_unrealized_pnl".to_string()), gross_pnl: CentsUsdPattern2::new(client.clone(), "lth_unrealized_gross_pnl".to_string()), invested_capital: InPattern::new(client.clone(), "lth_invested_capital_in".to_string()), - sentiment: MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment::new(client.clone(), format!("{base_path}_sentiment")), + sentiment: SeriesTree_Cohorts_Utxo_Lth_Unrealized_Sentiment::new(client.clone(), format!("{base_path}_sentiment")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Lth_Unrealized_Sentiment { pub pain_index: CentsUsdPattern2, pub greed_index: CentsUsdPattern2, pub net: CentsUsdPattern, } -impl MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment { +impl SeriesTree_Cohorts_Utxo_Lth_Unrealized_Sentiment { pub fn new(client: Arc, base_path: String) -> Self { Self { pain_index: CentsUsdPattern2::new(client.clone(), "lth_pain_index".to_string()), @@ -7668,8 +7668,8 @@ impl MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_AgeRange { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_AgeRange { pub under_1h: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _1h_to_1d: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _1d_to_1w: ActivityOutputsRealizedSupplyUnrealizedPattern, @@ -7693,7 +7693,7 @@ pub struct MetricsTree_Cohorts_Utxo_AgeRange { pub over_15y: ActivityOutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Utxo_AgeRange { +impl SeriesTree_Cohorts_Utxo_AgeRange { pub fn new(client: Arc, base_path: String) -> Self { Self { under_1h: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1h_old".to_string()), @@ -7721,8 +7721,8 @@ impl MetricsTree_Cohorts_Utxo_AgeRange { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_UnderAge { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_UnderAge { pub _1w: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _1m: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _2m: ActivityOutputsRealizedSupplyUnrealizedPattern, @@ -7743,7 +7743,7 @@ pub struct MetricsTree_Cohorts_Utxo_UnderAge { pub _15y: ActivityOutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Utxo_UnderAge { +impl SeriesTree_Cohorts_Utxo_UnderAge { pub fn new(client: Arc, base_path: String) -> Self { Self { _1w: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_1w_old".to_string()), @@ -7768,8 +7768,8 @@ impl MetricsTree_Cohorts_Utxo_UnderAge { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_OverAge { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_OverAge { pub _1d: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _1w: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _1m: ActivityOutputsRealizedSupplyUnrealizedPattern, @@ -7790,7 +7790,7 @@ pub struct MetricsTree_Cohorts_Utxo_OverAge { pub _12y: ActivityOutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Utxo_OverAge { +impl SeriesTree_Cohorts_Utxo_OverAge { pub fn new(client: Arc, base_path: String) -> Self { Self { _1d: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1d_old".to_string()), @@ -7815,8 +7815,8 @@ impl MetricsTree_Cohorts_Utxo_OverAge { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Epoch { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Epoch { pub _0: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _1: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _2: ActivityOutputsRealizedSupplyUnrealizedPattern, @@ -7824,7 +7824,7 @@ pub struct MetricsTree_Cohorts_Utxo_Epoch { pub _4: ActivityOutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Utxo_Epoch { +impl SeriesTree_Cohorts_Utxo_Epoch { pub fn new(client: Arc, base_path: String) -> Self { Self { _0: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "epoch_0".to_string()), @@ -7836,8 +7836,8 @@ impl MetricsTree_Cohorts_Utxo_Epoch { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Class { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Class { pub _2009: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _2010: ActivityOutputsRealizedSupplyUnrealizedPattern, pub _2011: ActivityOutputsRealizedSupplyUnrealizedPattern, @@ -7858,7 +7858,7 @@ pub struct MetricsTree_Cohorts_Utxo_Class { pub _2026: ActivityOutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Utxo_Class { +impl SeriesTree_Cohorts_Utxo_Class { pub fn new(client: Arc, base_path: String) -> Self { Self { _2009: ActivityOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "class_2009".to_string()), @@ -7883,8 +7883,8 @@ impl MetricsTree_Cohorts_Utxo_Class { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_OverAmount { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_OverAmount { pub _1sat: OutputsRealizedSupplyUnrealizedPattern, pub _10sats: OutputsRealizedSupplyUnrealizedPattern, pub _100sats: OutputsRealizedSupplyUnrealizedPattern, @@ -7900,7 +7900,7 @@ pub struct MetricsTree_Cohorts_Utxo_OverAmount { pub _10k_btc: OutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Utxo_OverAmount { +impl SeriesTree_Cohorts_Utxo_OverAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { _1sat: OutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_over_1sat".to_string()), @@ -7920,8 +7920,8 @@ impl MetricsTree_Cohorts_Utxo_OverAmount { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_AmountRange { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_AmountRange { pub _0sats: OutputsRealizedSupplyUnrealizedPattern, pub _1sat_to_10sats: OutputsRealizedSupplyUnrealizedPattern, pub _10sats_to_100sats: OutputsRealizedSupplyUnrealizedPattern, @@ -7939,7 +7939,7 @@ pub struct MetricsTree_Cohorts_Utxo_AmountRange { pub over_100k_btc: OutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Utxo_AmountRange { +impl SeriesTree_Cohorts_Utxo_AmountRange { pub fn new(client: Arc, base_path: String) -> Self { Self { _0sats: OutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_0sats".to_string()), @@ -7961,8 +7961,8 @@ impl MetricsTree_Cohorts_Utxo_AmountRange { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_UnderAmount { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_UnderAmount { pub _10sats: OutputsRealizedSupplyUnrealizedPattern, pub _100sats: OutputsRealizedSupplyUnrealizedPattern, pub _1k_sats: OutputsRealizedSupplyUnrealizedPattern, @@ -7978,7 +7978,7 @@ pub struct MetricsTree_Cohorts_Utxo_UnderAmount { pub _100k_btc: OutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Utxo_UnderAmount { +impl SeriesTree_Cohorts_Utxo_UnderAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { _10sats: OutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "utxos_under_10sats".to_string()), @@ -7998,8 +7998,8 @@ impl MetricsTree_Cohorts_Utxo_UnderAmount { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Type { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Type { pub p2pk65: OutputsRealizedSupplyUnrealizedPattern2, pub p2pk33: OutputsRealizedSupplyUnrealizedPattern2, pub p2pkh: OutputsRealizedSupplyUnrealizedPattern2, @@ -8013,7 +8013,7 @@ pub struct MetricsTree_Cohorts_Utxo_Type { pub empty: OutputsRealizedSupplyUnrealizedPattern2, } -impl MetricsTree_Cohorts_Utxo_Type { +impl SeriesTree_Cohorts_Utxo_Type { pub fn new(client: Arc, base_path: String) -> Self { Self { p2pk65: OutputsRealizedSupplyUnrealizedPattern2::new(client.clone(), "p2pk65".to_string()), @@ -8031,25 +8031,25 @@ impl MetricsTree_Cohorts_Utxo_Type { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Profitability { - pub range: MetricsTree_Cohorts_Utxo_Profitability_Range, - pub profit: MetricsTree_Cohorts_Utxo_Profitability_Profit, - pub loss: MetricsTree_Cohorts_Utxo_Profitability_Loss, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Profitability { + pub range: SeriesTree_Cohorts_Utxo_Profitability_Range, + pub profit: SeriesTree_Cohorts_Utxo_Profitability_Profit, + pub loss: SeriesTree_Cohorts_Utxo_Profitability_Loss, } -impl MetricsTree_Cohorts_Utxo_Profitability { +impl SeriesTree_Cohorts_Utxo_Profitability { pub fn new(client: Arc, base_path: String) -> Self { Self { - range: MetricsTree_Cohorts_Utxo_Profitability_Range::new(client.clone(), format!("{base_path}_range")), - profit: MetricsTree_Cohorts_Utxo_Profitability_Profit::new(client.clone(), format!("{base_path}_profit")), - loss: MetricsTree_Cohorts_Utxo_Profitability_Loss::new(client.clone(), format!("{base_path}_loss")), + range: SeriesTree_Cohorts_Utxo_Profitability_Range::new(client.clone(), format!("{base_path}_range")), + profit: SeriesTree_Cohorts_Utxo_Profitability_Profit::new(client.clone(), format!("{base_path}_profit")), + loss: SeriesTree_Cohorts_Utxo_Profitability_Loss::new(client.clone(), format!("{base_path}_loss")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Profitability_Range { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Profitability_Range { pub over_1000pct_in_profit: NuplRealizedSupplyPattern, pub _500pct_to_1000pct_in_profit: NuplRealizedSupplyPattern, pub _300pct_to_500pct_in_profit: NuplRealizedSupplyPattern, @@ -8077,7 +8077,7 @@ pub struct MetricsTree_Cohorts_Utxo_Profitability_Range { pub _90pct_to_100pct_in_loss: NuplRealizedSupplyPattern, } -impl MetricsTree_Cohorts_Utxo_Profitability_Range { +impl SeriesTree_Cohorts_Utxo_Profitability_Range { pub fn new(client: Arc, base_path: String) -> Self { Self { over_1000pct_in_profit: NuplRealizedSupplyPattern::new(client.clone(), "utxos_over_1000pct_in_profit".to_string()), @@ -8109,9 +8109,9 @@ impl MetricsTree_Cohorts_Utxo_Profitability_Range { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Profitability_Profit { - pub breakeven: NuplRealizedSupplyPattern, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Profitability_Profit { + pub all: NuplRealizedSupplyPattern, pub _10pct: NuplRealizedSupplyPattern, pub _20pct: NuplRealizedSupplyPattern, pub _30pct: NuplRealizedSupplyPattern, @@ -8127,10 +8127,10 @@ pub struct MetricsTree_Cohorts_Utxo_Profitability_Profit { pub _500pct: NuplRealizedSupplyPattern, } -impl MetricsTree_Cohorts_Utxo_Profitability_Profit { +impl SeriesTree_Cohorts_Utxo_Profitability_Profit { pub fn new(client: Arc, base_path: String) -> Self { Self { - breakeven: NuplRealizedSupplyPattern::new(client.clone(), "utxos_in_profit".to_string()), + all: NuplRealizedSupplyPattern::new(client.clone(), "utxos_in_profit".to_string()), _10pct: NuplRealizedSupplyPattern::new(client.clone(), "utxos_over_10pct_in_profit".to_string()), _20pct: NuplRealizedSupplyPattern::new(client.clone(), "utxos_over_20pct_in_profit".to_string()), _30pct: NuplRealizedSupplyPattern::new(client.clone(), "utxos_over_30pct_in_profit".to_string()), @@ -8148,9 +8148,9 @@ impl MetricsTree_Cohorts_Utxo_Profitability_Profit { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Profitability_Loss { - pub breakeven: NuplRealizedSupplyPattern, +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Profitability_Loss { + pub all: NuplRealizedSupplyPattern, pub _10pct: NuplRealizedSupplyPattern, pub _20pct: NuplRealizedSupplyPattern, pub _30pct: NuplRealizedSupplyPattern, @@ -8161,10 +8161,10 @@ pub struct MetricsTree_Cohorts_Utxo_Profitability_Loss { pub _80pct: NuplRealizedSupplyPattern, } -impl MetricsTree_Cohorts_Utxo_Profitability_Loss { +impl SeriesTree_Cohorts_Utxo_Profitability_Loss { pub fn new(client: Arc, base_path: String) -> Self { Self { - breakeven: NuplRealizedSupplyPattern::new(client.clone(), "utxos_in_loss".to_string()), + all: NuplRealizedSupplyPattern::new(client.clone(), "utxos_in_loss".to_string()), _10pct: NuplRealizedSupplyPattern::new(client.clone(), "utxos_over_10pct_in_loss".to_string()), _20pct: NuplRealizedSupplyPattern::new(client.clone(), "utxos_over_20pct_in_loss".to_string()), _30pct: NuplRealizedSupplyPattern::new(client.clone(), "utxos_over_30pct_in_loss".to_string()), @@ -8177,8 +8177,8 @@ impl MetricsTree_Cohorts_Utxo_Profitability_Loss { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Utxo_Matured { +/// Series tree node. +pub struct SeriesTree_Cohorts_Utxo_Matured { pub under_1h: BaseCumulativeSumPattern4, pub _1h_to_1d: BaseCumulativeSumPattern4, pub _1d_to_1w: BaseCumulativeSumPattern4, @@ -8202,7 +8202,7 @@ pub struct MetricsTree_Cohorts_Utxo_Matured { pub over_15y: BaseCumulativeSumPattern4, } -impl MetricsTree_Cohorts_Utxo_Matured { +impl SeriesTree_Cohorts_Utxo_Matured { pub fn new(client: Arc, base_path: String) -> Self { Self { under_1h: BaseCumulativeSumPattern4::new(client.clone(), "utxos_under_1h_old_matured_supply".to_string()), @@ -8230,25 +8230,25 @@ impl MetricsTree_Cohorts_Utxo_Matured { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Address { - pub over_amount: MetricsTree_Cohorts_Address_OverAmount, - pub amount_range: MetricsTree_Cohorts_Address_AmountRange, - pub under_amount: MetricsTree_Cohorts_Address_UnderAmount, +/// Series tree node. +pub struct SeriesTree_Cohorts_Address { + pub over_amount: SeriesTree_Cohorts_Address_OverAmount, + pub amount_range: SeriesTree_Cohorts_Address_AmountRange, + pub under_amount: SeriesTree_Cohorts_Address_UnderAmount, } -impl MetricsTree_Cohorts_Address { +impl SeriesTree_Cohorts_Address { pub fn new(client: Arc, base_path: String) -> Self { Self { - over_amount: MetricsTree_Cohorts_Address_OverAmount::new(client.clone(), format!("{base_path}_over_amount")), - amount_range: MetricsTree_Cohorts_Address_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), - under_amount: MetricsTree_Cohorts_Address_UnderAmount::new(client.clone(), format!("{base_path}_under_amount")), + over_amount: SeriesTree_Cohorts_Address_OverAmount::new(client.clone(), format!("{base_path}_over_amount")), + amount_range: SeriesTree_Cohorts_Address_AmountRange::new(client.clone(), format!("{base_path}_amount_range")), + under_amount: SeriesTree_Cohorts_Address_UnderAmount::new(client.clone(), format!("{base_path}_under_amount")), } } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Address_OverAmount { +/// Series tree node. +pub struct SeriesTree_Cohorts_Address_OverAmount { pub _1sat: AddressOutputsRealizedSupplyUnrealizedPattern, pub _10sats: AddressOutputsRealizedSupplyUnrealizedPattern, pub _100sats: AddressOutputsRealizedSupplyUnrealizedPattern, @@ -8264,7 +8264,7 @@ pub struct MetricsTree_Cohorts_Address_OverAmount { pub _10k_btc: AddressOutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Address_OverAmount { +impl SeriesTree_Cohorts_Address_OverAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { _1sat: AddressOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_over_1sat".to_string()), @@ -8284,8 +8284,8 @@ impl MetricsTree_Cohorts_Address_OverAmount { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Address_AmountRange { +/// Series tree node. +pub struct SeriesTree_Cohorts_Address_AmountRange { pub _0sats: AddressOutputsRealizedSupplyUnrealizedPattern, pub _1sat_to_10sats: AddressOutputsRealizedSupplyUnrealizedPattern, pub _10sats_to_100sats: AddressOutputsRealizedSupplyUnrealizedPattern, @@ -8303,7 +8303,7 @@ pub struct MetricsTree_Cohorts_Address_AmountRange { pub over_100k_btc: AddressOutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Address_AmountRange { +impl SeriesTree_Cohorts_Address_AmountRange { pub fn new(client: Arc, base_path: String) -> Self { Self { _0sats: AddressOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_0sats".to_string()), @@ -8325,8 +8325,8 @@ impl MetricsTree_Cohorts_Address_AmountRange { } } -/// Metrics tree node. -pub struct MetricsTree_Cohorts_Address_UnderAmount { +/// Series tree node. +pub struct SeriesTree_Cohorts_Address_UnderAmount { pub _10sats: AddressOutputsRealizedSupplyUnrealizedPattern, pub _100sats: AddressOutputsRealizedSupplyUnrealizedPattern, pub _1k_sats: AddressOutputsRealizedSupplyUnrealizedPattern, @@ -8342,7 +8342,7 @@ pub struct MetricsTree_Cohorts_Address_UnderAmount { pub _100k_btc: AddressOutputsRealizedSupplyUnrealizedPattern, } -impl MetricsTree_Cohorts_Address_UnderAmount { +impl SeriesTree_Cohorts_Address_UnderAmount { pub fn new(client: Arc, base_path: String) -> Self { Self { _10sats: AddressOutputsRealizedSupplyUnrealizedPattern::new(client.clone(), "addrs_under_10sats".to_string()), @@ -8362,10 +8362,10 @@ impl MetricsTree_Cohorts_Address_UnderAmount { } } -/// Main BRK client with metrics tree and API methods. +/// Main BRK client with series tree and API methods. pub struct BrkClient { base: Arc, - metrics: MetricsTree, + series: SeriesTree, } impl BrkClient { @@ -8375,51 +8375,51 @@ impl BrkClient { /// Create a new client with the given base URL. pub fn new(base_url: impl Into) -> Self { let base = Arc::new(BrkClientBase::new(base_url)); - let metrics = MetricsTree::new(base.clone(), String::new()); - Self { base, metrics } + let series = SeriesTree::new(base.clone(), String::new()); + Self { base, series } } /// Create a new client with options. pub fn with_options(options: BrkClientOptions) -> Self { let base = Arc::new(BrkClientBase::with_options(options)); - let metrics = MetricsTree::new(base.clone(), String::new()); - Self { base, metrics } + let series = SeriesTree::new(base.clone(), String::new()); + Self { base, series } } - /// Get the metrics tree for navigating metrics. - pub fn metrics(&self) -> &MetricsTree { - &self.metrics + /// Get the series tree for navigating series. + pub fn series(&self) -> &SeriesTree { + &self.series } - /// Create a dynamic metric endpoint builder for any metric/index combination. + /// Create a dynamic series endpoint builder for any series/index combination. /// - /// Use this for programmatic access when the metric name is determined at runtime. - /// For type-safe access, use the `metrics()` tree instead. + /// Use this for programmatic access when the series name is determined at runtime. + /// For type-safe access, use the `series()` tree instead. /// /// # Example /// ```ignore - /// let data = client.metric("realized_price", Index::Height) + /// let data = client.series("realized_price", Index::Height) /// .last(10) /// .json::()?; /// ``` - pub fn metric(&self, metric: impl Into, index: Index) -> MetricEndpointBuilder { - MetricEndpointBuilder::new( + pub fn series_endpoint(&self, series: impl Into, index: Index) -> SeriesEndpointBuilder { + SeriesEndpointBuilder::new( self.base.clone(), - Arc::from(metric.into().as_str()), + Arc::from(series.into().as_str()), index, ) } - /// Create a dynamic date-based metric endpoint builder. + /// Create a dynamic date-based series endpoint builder. /// /// Returns `Err` if the index is not date-based. - pub fn date_metric(&self, metric: impl Into, index: Index) -> Result> { + pub fn date_series_endpoint(&self, series: impl Into, index: Index) -> Result> { if !index.is_date_based() { return Err(BrkError { message: format!("{} is not a date-based index", index.name()) }); } - Ok(DateMetricEndpointBuilder::new( + Ok(DateSeriesEndpointBuilder::new( self.base.clone(), - Arc::from(metric.into().as_str()), + Arc::from(series.into().as_str()), index, )) } @@ -8626,106 +8626,30 @@ impl BrkClient { self.base.get_json(&format!("/api/mempool/txids")) } - /// Get metric info + /// Series catalog /// - /// Returns the supported indexes and value type for the specified metric. + /// Returns the complete hierarchical catalog of available series organized as a tree structure. Series are grouped by categories and subcategories. /// - /// Endpoint: `GET /api/metric/{metric}` - pub fn get_metric_info(&self, metric: Metric) -> Result { - self.base.get_json(&format!("/api/metric/{metric}")) + /// Endpoint: `GET /api/series` + pub fn get_series_tree(&self) -> Result { + self.base.get_json(&format!("/api/series")) } - /// Get metric data + /// Bulk series data /// - /// Fetch data for a specific metric at the given index. Use query parameters to filter by date range and format (json/csv). + /// Fetch multiple series in a single request. Supports filtering by index and date range. Returns an array of SeriesData objects. For a single series, use `get_series` instead. /// - /// Endpoint: `GET /api/metric/{metric}/{index}` - pub fn get_metric(&self, metric: Metric, index: Index, start: Option, end: Option, limit: Option, format: Option) -> Result> { + /// Endpoint: `GET /api/series/bulk` + pub fn get_series_bulk(&self, series: SeriesList, index: Index, start: Option, end: Option, limit: Option, format: Option) -> Result>> { let mut query = Vec::new(); - if let Some(v) = start { query.push(format!("start={}", v)); } - if let Some(v) = end { query.push(format!("end={}", v)); } - if let Some(v) = limit { query.push(format!("limit={}", v)); } - if let Some(v) = format { query.push(format!("format={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - let path = format!("/api/metric/{metric}/{}{}", index.name(), query_str); - if format == Some(Format::CSV) { - self.base.get_text(&path).map(FormatResponse::Csv) - } else { - self.base.get_json(&path).map(FormatResponse::Json) - } - } - - /// Get raw metric data - /// - /// Returns just the data array without the MetricData wrapper. Supports the same range and format parameters as the standard endpoint. - /// - /// Endpoint: `GET /api/metric/{metric}/{index}/data` - pub fn get_metric_data(&self, metric: Metric, index: Index, start: Option, end: Option, limit: Option, format: Option) -> Result>> { - let mut query = Vec::new(); - if let Some(v) = start { query.push(format!("start={}", v)); } - if let Some(v) = end { query.push(format!("end={}", v)); } - if let Some(v) = limit { query.push(format!("limit={}", v)); } - if let Some(v) = format { query.push(format!("format={}", v)); } - let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - let path = format!("/api/metric/{metric}/{}/data{}", index.name(), query_str); - if format == Some(Format::CSV) { - self.base.get_text(&path).map(FormatResponse::Csv) - } else { - self.base.get_json(&path).map(FormatResponse::Json) - } - } - - /// Get latest metric value - /// - /// Returns the single most recent value for a metric, unwrapped (not inside a MetricData object). - /// - /// Endpoint: `GET /api/metric/{metric}/{index}/latest` - pub fn get_metric_latest(&self, metric: Metric, index: Index) -> Result { - self.base.get_json(&format!("/api/metric/{metric}/{}/latest", index.name())) - } - - /// Get metric data length - /// - /// Returns the total number of data points for a metric at the given index. - /// - /// Endpoint: `GET /api/metric/{metric}/{index}/len` - pub fn get_metric_len(&self, metric: Metric, index: Index) -> Result { - self.base.get_json(&format!("/api/metric/{metric}/{}/len", index.name())) - } - - /// Get metric version - /// - /// Returns the current version of a metric. Changes when the metric data is updated. - /// - /// Endpoint: `GET /api/metric/{metric}/{index}/version` - pub fn get_metric_version(&self, metric: Metric, index: Index) -> Result { - self.base.get_json(&format!("/api/metric/{metric}/{}/version", index.name())) - } - - /// Metrics catalog - /// - /// Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. - /// - /// Endpoint: `GET /api/metrics` - pub fn get_metrics_tree(&self) -> Result { - self.base.get_json(&format!("/api/metrics")) - } - - /// Bulk metric data - /// - /// Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. For a single metric, use `get_metric` instead. - /// - /// Endpoint: `GET /api/metrics/bulk` - pub fn get_metrics(&self, metrics: Metrics, index: Index, start: Option, end: Option, limit: Option, format: Option) -> Result>> { - let mut query = Vec::new(); - query.push(format!("metrics={}", metrics)); + query.push(format!("series={}", series)); query.push(format!("index={}", index)); if let Some(v) = start { query.push(format!("start={}", v)); } if let Some(v) = end { query.push(format!("end={}", v)); } if let Some(v) = limit { query.push(format!("limit={}", v)); } if let Some(v) = format { query.push(format!("format={}", v)); } let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - let path = format!("/api/metrics/bulk{}", query_str); + let path = format!("/api/series/bulk{}", query_str); if format == Some(Format::CSV) { self.base.get_text(&path).map(FormatResponse::Csv) } else { @@ -8737,18 +8661,18 @@ impl BrkClient { /// /// List available cohorts for cost basis distribution. /// - /// Endpoint: `GET /api/metrics/cost-basis` + /// Endpoint: `GET /api/series/cost-basis` pub fn get_cost_basis_cohorts(&self) -> Result> { - self.base.get_json(&format!("/api/metrics/cost-basis")) + self.base.get_json(&format!("/api/series/cost-basis")) } /// Available cost basis dates /// /// List available dates for a cohort's cost basis distribution. /// - /// Endpoint: `GET /api/metrics/cost-basis/{cohort}/dates` + /// Endpoint: `GET /api/series/cost-basis/{cohort}/dates` pub fn get_cost_basis_dates(&self, cohort: Cohort) -> Result> { - self.base.get_json(&format!("/api/metrics/cost-basis/{cohort}/dates")) + self.base.get_json(&format!("/api/series/cost-basis/{cohort}/dates")) } /// Cost basis distribution @@ -8759,62 +8683,138 @@ impl BrkClient { /// - `bucket`: raw (default), lin200, lin500, lin1000, log10, log50, log100 /// - `value`: supply (default, in BTC), realized (USD), unrealized (USD) /// - /// Endpoint: `GET /api/metrics/cost-basis/{cohort}/{date}` + /// Endpoint: `GET /api/series/cost-basis/{cohort}/{date}` pub fn get_cost_basis(&self, cohort: Cohort, date: &str, bucket: Option, value: Option) -> Result { let mut query = Vec::new(); if let Some(v) = bucket { query.push(format!("bucket={}", v)); } if let Some(v) = value { query.push(format!("value={}", v)); } let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - let path = format!("/api/metrics/cost-basis/{cohort}/{date}{}", query_str); + let path = format!("/api/series/cost-basis/{cohort}/{date}{}", query_str); self.base.get_json(&path) } - /// Metric count + /// Series count /// - /// Returns the number of metrics available per index type. + /// Returns the number of series available per index type. /// - /// Endpoint: `GET /api/metrics/count` - pub fn get_metrics_count(&self) -> Result> { - self.base.get_json(&format!("/api/metrics/count")) + /// Endpoint: `GET /api/series/count` + pub fn get_series_count(&self) -> Result> { + self.base.get_json(&format!("/api/series/count")) } /// List available indexes /// - /// Returns all available indexes with their accepted query aliases. Use any alias when querying metrics. + /// Returns all available indexes with their accepted query aliases. Use any alias when querying series. /// - /// Endpoint: `GET /api/metrics/indexes` + /// Endpoint: `GET /api/series/indexes` pub fn get_indexes(&self) -> Result> { - self.base.get_json(&format!("/api/metrics/indexes")) + self.base.get_json(&format!("/api/series/indexes")) } - /// Metrics list + /// Series list /// - /// Paginated flat list of all available metric names. Use `page` query param for pagination. + /// Paginated flat list of all available series names. Use `page` query param for pagination. /// - /// Endpoint: `GET /api/metrics/list` - pub fn list_metrics(&self, page: Option, per_page: Option) -> Result { + /// Endpoint: `GET /api/series/list` + pub fn list_series(&self, page: Option, per_page: Option) -> Result { let mut query = Vec::new(); if let Some(v) = page { query.push(format!("page={}", v)); } if let Some(v) = per_page { query.push(format!("per_page={}", v)); } let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - let path = format!("/api/metrics/list{}", query_str); + let path = format!("/api/series/list{}", query_str); self.base.get_json(&path) } - /// Search metrics + /// Search series /// - /// Fuzzy search for metrics by name. Supports partial matches and typos. + /// Fuzzy search for series by name. Supports partial matches and typos. /// - /// Endpoint: `GET /api/metrics/search` - pub fn search_metrics(&self, q: Metric, limit: Option) -> Result> { + /// Endpoint: `GET /api/series/search` + pub fn search_series(&self, q: Series, limit: Option) -> Result> { let mut query = Vec::new(); query.push(format!("q={}", q)); if let Some(v) = limit { query.push(format!("limit={}", v)); } let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; - let path = format!("/api/metrics/search{}", query_str); + let path = format!("/api/series/search{}", query_str); self.base.get_json(&path) } + /// Get series info + /// + /// Returns the supported indexes and value type for the specified series. + /// + /// Endpoint: `GET /api/series/{series}` + pub fn get_series_info(&self, series: Series) -> Result { + self.base.get_json(&format!("/api/series/{series}")) + } + + /// Get series data + /// + /// Fetch data for a specific series at the given index. Use query parameters to filter by date range and format (json/csv). + /// + /// Endpoint: `GET /api/series/{series}/{index}` + pub fn get_series(&self, series: Series, index: Index, start: Option, end: Option, limit: Option, format: Option) -> Result> { + let mut query = Vec::new(); + if let Some(v) = start { query.push(format!("start={}", v)); } + if let Some(v) = end { query.push(format!("end={}", v)); } + if let Some(v) = limit { query.push(format!("limit={}", v)); } + if let Some(v) = format { query.push(format!("format={}", v)); } + let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; + let path = format!("/api/series/{series}/{}{}", index.name(), query_str); + if format == Some(Format::CSV) { + self.base.get_text(&path).map(FormatResponse::Csv) + } else { + self.base.get_json(&path).map(FormatResponse::Json) + } + } + + /// Get raw series data + /// + /// Returns just the data array without the SeriesData wrapper. Supports the same range and format parameters as the standard endpoint. + /// + /// Endpoint: `GET /api/series/{series}/{index}/data` + pub fn get_series_data(&self, series: Series, index: Index, start: Option, end: Option, limit: Option, format: Option) -> Result>> { + let mut query = Vec::new(); + if let Some(v) = start { query.push(format!("start={}", v)); } + if let Some(v) = end { query.push(format!("end={}", v)); } + if let Some(v) = limit { query.push(format!("limit={}", v)); } + if let Some(v) = format { query.push(format!("format={}", v)); } + let query_str = if query.is_empty() { String::new() } else { format!("?{}", query.join("&")) }; + let path = format!("/api/series/{series}/{}/data{}", index.name(), query_str); + if format == Some(Format::CSV) { + self.base.get_text(&path).map(FormatResponse::Csv) + } else { + self.base.get_json(&path).map(FormatResponse::Json) + } + } + + /// Get latest series value + /// + /// Returns the single most recent value for a series, unwrapped (not inside a SeriesData object). + /// + /// Endpoint: `GET /api/series/{series}/{index}/latest` + pub fn get_series_latest(&self, series: Series, index: Index) -> Result { + self.base.get_json(&format!("/api/series/{series}/{}/latest", index.name())) + } + + /// Get series data length + /// + /// Returns the total number of data points for a series at the given index. + /// + /// Endpoint: `GET /api/series/{series}/{index}/len` + pub fn get_series_len(&self, series: Series, index: Index) -> Result { + self.base.get_json(&format!("/api/series/{series}/{}/len", index.name())) + } + + /// Get series version + /// + /// Returns the current version of a series. Changes when the series data is updated. + /// + /// Endpoint: `GET /api/series/{series}/{index}/version` + pub fn get_series_version(&self, series: Series, index: Index) -> Result { + self.base.get_json(&format!("/api/series/{series}/{}/version", index.name())) + } + /// Disk usage /// /// Returns the disk space used by BRK and Bitcoin data. diff --git a/crates/brk_cohort/src/loss.rs b/crates/brk_cohort/src/loss.rs index ca14e48e1..cb065cec6 100644 --- a/crates/brk_cohort/src/loss.rs +++ b/crates/brk_cohort/src/loss.rs @@ -6,15 +6,15 @@ use super::CohortName; /// "At least X% loss" threshold names (9 thresholds). pub const LOSS_NAMES: Loss = Loss { - breakeven: CohortName::new("utxos_in_loss", "<0%", "In Loss (Below Breakeven)"), - _10pct: CohortName::new("utxos_over_10pct_in_loss", "≥10%L", "10%+ Loss"), - _20pct: CohortName::new("utxos_over_20pct_in_loss", "≥20%L", "20%+ Loss"), - _30pct: CohortName::new("utxos_over_30pct_in_loss", "≥30%L", "30%+ Loss"), - _40pct: CohortName::new("utxos_over_40pct_in_loss", "≥40%L", "40%+ Loss"), - _50pct: CohortName::new("utxos_over_50pct_in_loss", "≥50%L", "50%+ Loss"), - _60pct: CohortName::new("utxos_over_60pct_in_loss", "≥60%L", "60%+ Loss"), - _70pct: CohortName::new("utxos_over_70pct_in_loss", "≥70%L", "70%+ Loss"), - _80pct: CohortName::new("utxos_over_80pct_in_loss", "≥80%L", "80%+ Loss"), + all: CohortName::new("utxos_in_loss", "All", "In Loss"), + _10pct: CohortName::new("utxos_over_10pct_in_loss", ">=10%", "Over 10% in Loss"), + _20pct: CohortName::new("utxos_over_20pct_in_loss", ">=20%", "Over 20% in Loss"), + _30pct: CohortName::new("utxos_over_30pct_in_loss", ">=30%", "Over 30% in Loss"), + _40pct: CohortName::new("utxos_over_40pct_in_loss", ">=40%", "Over 40% in Loss"), + _50pct: CohortName::new("utxos_over_50pct_in_loss", ">=50%", "Over 50% in Loss"), + _60pct: CohortName::new("utxos_over_60pct_in_loss", ">=60%", "Over 60% in Loss"), + _70pct: CohortName::new("utxos_over_70pct_in_loss", ">=70%", "Over 70% in Loss"), + _80pct: CohortName::new("utxos_over_80pct_in_loss", ">=80%", "Over 80% in Loss"), }; /// Number of loss thresholds. @@ -31,7 +31,7 @@ impl Loss { /// Each is a suffix sum over the profitability ranges, from most loss-making up. #[derive(Default, Clone, Traversable, Serialize)] pub struct Loss { - pub breakeven: T, + pub all: T, pub _10pct: T, pub _20pct: T, pub _30pct: T, @@ -49,7 +49,7 @@ impl Loss { { let n = &LOSS_NAMES; Self { - breakeven: create(n.breakeven.id), + all: create(n.all.id), _10pct: create(n._10pct.id), _20pct: create(n._20pct.id), _30pct: create(n._30pct.id), @@ -67,7 +67,7 @@ impl Loss { { let n = &LOSS_NAMES; Ok(Self { - breakeven: create(n.breakeven.id)?, + all: create(n.all.id)?, _10pct: create(n._10pct.id)?, _20pct: create(n._20pct.id)?, _30pct: create(n._30pct.id)?, @@ -81,7 +81,7 @@ impl Loss { pub fn iter(&self) -> impl Iterator { [ - &self.breakeven, + &self.all, &self._10pct, &self._20pct, &self._30pct, @@ -96,7 +96,7 @@ impl Loss { pub fn iter_mut(&mut self) -> impl Iterator { [ - &mut self.breakeven, + &mut self.all, &mut self._10pct, &mut self._20pct, &mut self._30pct, @@ -114,7 +114,7 @@ impl Loss { T: Send + Sync, { [ - &mut self.breakeven, + &mut self.all, &mut self._10pct, &mut self._20pct, &mut self._30pct, @@ -130,7 +130,7 @@ impl Loss { /// Access as array for indexed accumulation. pub fn as_array_mut(&mut self) -> [&mut T; LOSS_COUNT] { [ - &mut self.breakeven, + &mut self.all, &mut self._10pct, &mut self._20pct, &mut self._30pct, diff --git a/crates/brk_cohort/src/profit.rs b/crates/brk_cohort/src/profit.rs index e8416826f..e0372e869 100644 --- a/crates/brk_cohort/src/profit.rs +++ b/crates/brk_cohort/src/profit.rs @@ -6,20 +6,20 @@ use super::CohortName; /// "At least X% profit" threshold names (14 thresholds). pub const PROFIT_NAMES: Profit = Profit { - breakeven: CohortName::new("utxos_in_profit", "≥0%", "In Profit (Breakeven+)"), - _10pct: CohortName::new("utxos_over_10pct_in_profit", "≥10%", "10%+ Profit"), - _20pct: CohortName::new("utxos_over_20pct_in_profit", "≥20%", "20%+ Profit"), - _30pct: CohortName::new("utxos_over_30pct_in_profit", "≥30%", "30%+ Profit"), - _40pct: CohortName::new("utxos_over_40pct_in_profit", "≥40%", "40%+ Profit"), - _50pct: CohortName::new("utxos_over_50pct_in_profit", "≥50%", "50%+ Profit"), - _60pct: CohortName::new("utxos_over_60pct_in_profit", "≥60%", "60%+ Profit"), - _70pct: CohortName::new("utxos_over_70pct_in_profit", "≥70%", "70%+ Profit"), - _80pct: CohortName::new("utxos_over_80pct_in_profit", "≥80%", "80%+ Profit"), - _90pct: CohortName::new("utxos_over_90pct_in_profit", "≥90%", "90%+ Profit"), - _100pct: CohortName::new("utxos_over_100pct_in_profit", "≥100%", "100%+ Profit"), - _200pct: CohortName::new("utxos_over_200pct_in_profit", "≥200%", "200%+ Profit"), - _300pct: CohortName::new("utxos_over_300pct_in_profit", "≥300%", "300%+ Profit"), - _500pct: CohortName::new("utxos_over_500pct_in_profit", "≥500%", "500%+ Profit"), + all: CohortName::new("utxos_in_profit", "All", "In Profit"), + _10pct: CohortName::new("utxos_over_10pct_in_profit", ">=10%", "Over 10% in Profit"), + _20pct: CohortName::new("utxos_over_20pct_in_profit", ">=20%", "Over 20% in Profit"), + _30pct: CohortName::new("utxos_over_30pct_in_profit", ">=30%", "Over 30% in Profit"), + _40pct: CohortName::new("utxos_over_40pct_in_profit", ">=40%", "Over 40% in Profit"), + _50pct: CohortName::new("utxos_over_50pct_in_profit", ">=50%", "Over 50% in Profit"), + _60pct: CohortName::new("utxos_over_60pct_in_profit", ">=60%", "Over 60% in Profit"), + _70pct: CohortName::new("utxos_over_70pct_in_profit", ">=70%", "Over 70% in Profit"), + _80pct: CohortName::new("utxos_over_80pct_in_profit", ">=80%", "Over 80% in Profit"), + _90pct: CohortName::new("utxos_over_90pct_in_profit", ">=90%", "Over 90% in Profit"), + _100pct: CohortName::new("utxos_over_100pct_in_profit", ">=100%", "Over 100% in Profit"), + _200pct: CohortName::new("utxos_over_200pct_in_profit", ">=200%", "Over 200% in Profit"), + _300pct: CohortName::new("utxos_over_300pct_in_profit", ">=300%", "Over 300% in Profit"), + _500pct: CohortName::new("utxos_over_500pct_in_profit", ">=500%", "Over 500% in Profit"), }; /// Number of profit thresholds. @@ -36,7 +36,7 @@ impl Profit { /// Each is a prefix sum over the profitability ranges, from most profitable down. #[derive(Default, Clone, Traversable, Serialize)] pub struct Profit { - pub breakeven: T, + pub all: T, pub _10pct: T, pub _20pct: T, pub _30pct: T, @@ -59,7 +59,7 @@ impl Profit { { let n = &PROFIT_NAMES; Self { - breakeven: create(n.breakeven.id), + all: create(n.all.id), _10pct: create(n._10pct.id), _20pct: create(n._20pct.id), _30pct: create(n._30pct.id), @@ -82,7 +82,7 @@ impl Profit { { let n = &PROFIT_NAMES; Ok(Self { - breakeven: create(n.breakeven.id)?, + all: create(n.all.id)?, _10pct: create(n._10pct.id)?, _20pct: create(n._20pct.id)?, _30pct: create(n._30pct.id)?, @@ -101,7 +101,7 @@ impl Profit { pub fn iter(&self) -> impl Iterator { [ - &self.breakeven, + &self.all, &self._10pct, &self._20pct, &self._30pct, @@ -121,7 +121,7 @@ impl Profit { pub fn iter_mut(&mut self) -> impl Iterator { [ - &mut self.breakeven, + &mut self.all, &mut self._10pct, &mut self._20pct, &mut self._30pct, @@ -144,7 +144,7 @@ impl Profit { T: Send + Sync, { [ - &mut self.breakeven, + &mut self.all, &mut self._10pct, &mut self._20pct, &mut self._30pct, @@ -165,7 +165,7 @@ impl Profit { /// Access as array for indexed accumulation. pub fn as_array_mut(&mut self) -> [&mut T; PROFIT_COUNT] { [ - &mut self.breakeven, + &mut self.all, &mut self._10pct, &mut self._20pct, &mut self._30pct, diff --git a/crates/brk_cohort/src/profitability_range.rs b/crates/brk_cohort/src/profitability_range.rs index c04e53f56..eec59b50e 100644 --- a/crates/brk_cohort/src/profitability_range.rs +++ b/crates/brk_cohort/src/profitability_range.rs @@ -83,31 +83,31 @@ pub fn compute_profitability_boundaries(spot: Cents) -> [Cents; PROFITABILITY_BO /// Profitability range names (25 ranges, from most profitable to most in loss) pub const PROFITABILITY_RANGE_NAMES: ProfitabilityRange = ProfitabilityRange { - over_1000pct_in_profit: CohortName::new("utxos_over_1000pct_in_profit", ">1000%", "Over 1000% Profit"), - _500pct_to_1000pct_in_profit: CohortName::new("utxos_500pct_to_1000pct_in_profit", "500-1000%", "500-1000% Profit"), - _300pct_to_500pct_in_profit: CohortName::new("utxos_300pct_to_500pct_in_profit", "300-500%", "300-500% Profit"), - _200pct_to_300pct_in_profit: CohortName::new("utxos_200pct_to_300pct_in_profit", "200-300%", "200-300% Profit"), - _100pct_to_200pct_in_profit: CohortName::new("utxos_100pct_to_200pct_in_profit", "100-200%", "100-200% Profit"), - _90pct_to_100pct_in_profit: CohortName::new("utxos_90pct_to_100pct_in_profit", "90-100%", "90-100% Profit"), - _80pct_to_90pct_in_profit: CohortName::new("utxos_80pct_to_90pct_in_profit", "80-90%", "80-90% Profit"), - _70pct_to_80pct_in_profit: CohortName::new("utxos_70pct_to_80pct_in_profit", "70-80%", "70-80% Profit"), - _60pct_to_70pct_in_profit: CohortName::new("utxos_60pct_to_70pct_in_profit", "60-70%", "60-70% Profit"), - _50pct_to_60pct_in_profit: CohortName::new("utxos_50pct_to_60pct_in_profit", "50-60%", "50-60% Profit"), - _40pct_to_50pct_in_profit: CohortName::new("utxos_40pct_to_50pct_in_profit", "40-50%", "40-50% Profit"), - _30pct_to_40pct_in_profit: CohortName::new("utxos_30pct_to_40pct_in_profit", "30-40%", "30-40% Profit"), - _20pct_to_30pct_in_profit: CohortName::new("utxos_20pct_to_30pct_in_profit", "20-30%", "20-30% Profit"), - _10pct_to_20pct_in_profit: CohortName::new("utxos_10pct_to_20pct_in_profit", "10-20%", "10-20% Profit"), - _0pct_to_10pct_in_profit: CohortName::new("utxos_0pct_to_10pct_in_profit", "0-10%", "0-10% Profit"), - _0pct_to_10pct_in_loss: CohortName::new("utxos_0pct_to_10pct_in_loss", "0-10%L", "0-10% Loss"), - _10pct_to_20pct_in_loss: CohortName::new("utxos_10pct_to_20pct_in_loss", "10-20%L", "10-20% Loss"), - _20pct_to_30pct_in_loss: CohortName::new("utxos_20pct_to_30pct_in_loss", "20-30%L", "20-30% Loss"), - _30pct_to_40pct_in_loss: CohortName::new("utxos_30pct_to_40pct_in_loss", "30-40%L", "30-40% Loss"), - _40pct_to_50pct_in_loss: CohortName::new("utxos_40pct_to_50pct_in_loss", "40-50%L", "40-50% Loss"), - _50pct_to_60pct_in_loss: CohortName::new("utxos_50pct_to_60pct_in_loss", "50-60%L", "50-60% Loss"), - _60pct_to_70pct_in_loss: CohortName::new("utxos_60pct_to_70pct_in_loss", "60-70%L", "60-70% Loss"), - _70pct_to_80pct_in_loss: CohortName::new("utxos_70pct_to_80pct_in_loss", "70-80%L", "70-80% Loss"), - _80pct_to_90pct_in_loss: CohortName::new("utxos_80pct_to_90pct_in_loss", "80-90%L", "80-90% Loss"), - _90pct_to_100pct_in_loss: CohortName::new("utxos_90pct_to_100pct_in_loss", "90-100%L", "90-100% Loss"), + over_1000pct_in_profit: CohortName::new("utxos_over_1000pct_in_profit", "+>1000%", "Over 1000% in Profit"), + _500pct_to_1000pct_in_profit: CohortName::new("utxos_500pct_to_1000pct_in_profit", "+500-1000%", "500-1000% in Profit"), + _300pct_to_500pct_in_profit: CohortName::new("utxos_300pct_to_500pct_in_profit", "+300-500%", "300-500% in Profit"), + _200pct_to_300pct_in_profit: CohortName::new("utxos_200pct_to_300pct_in_profit", "+200-300%", "200-300% in Profit"), + _100pct_to_200pct_in_profit: CohortName::new("utxos_100pct_to_200pct_in_profit", "+100-200%", "100-200% in Profit"), + _90pct_to_100pct_in_profit: CohortName::new("utxos_90pct_to_100pct_in_profit", "+90-100%", "90-100% in Profit"), + _80pct_to_90pct_in_profit: CohortName::new("utxos_80pct_to_90pct_in_profit", "+80-90%", "80-90% in Profit"), + _70pct_to_80pct_in_profit: CohortName::new("utxos_70pct_to_80pct_in_profit", "+70-80%", "70-80% in Profit"), + _60pct_to_70pct_in_profit: CohortName::new("utxos_60pct_to_70pct_in_profit", "+60-70%", "60-70% in Profit"), + _50pct_to_60pct_in_profit: CohortName::new("utxos_50pct_to_60pct_in_profit", "+50-60%", "50-60% in Profit"), + _40pct_to_50pct_in_profit: CohortName::new("utxos_40pct_to_50pct_in_profit", "+40-50%", "40-50% in Profit"), + _30pct_to_40pct_in_profit: CohortName::new("utxos_30pct_to_40pct_in_profit", "+30-40%", "30-40% in Profit"), + _20pct_to_30pct_in_profit: CohortName::new("utxos_20pct_to_30pct_in_profit", "+20-30%", "20-30% in Profit"), + _10pct_to_20pct_in_profit: CohortName::new("utxos_10pct_to_20pct_in_profit", "+10-20%", "10-20% in Profit"), + _0pct_to_10pct_in_profit: CohortName::new("utxos_0pct_to_10pct_in_profit", "+0-10%", "0-10% in Profit"), + _0pct_to_10pct_in_loss: CohortName::new("utxos_0pct_to_10pct_in_loss", "-0-10%", "0-10% in Loss"), + _10pct_to_20pct_in_loss: CohortName::new("utxos_10pct_to_20pct_in_loss", "-10-20%", "10-20% in Loss"), + _20pct_to_30pct_in_loss: CohortName::new("utxos_20pct_to_30pct_in_loss", "-20-30%", "20-30% in Loss"), + _30pct_to_40pct_in_loss: CohortName::new("utxos_30pct_to_40pct_in_loss", "-30-40%", "30-40% in Loss"), + _40pct_to_50pct_in_loss: CohortName::new("utxos_40pct_to_50pct_in_loss", "-40-50%", "40-50% in Loss"), + _50pct_to_60pct_in_loss: CohortName::new("utxos_50pct_to_60pct_in_loss", "-50-60%", "50-60% in Loss"), + _60pct_to_70pct_in_loss: CohortName::new("utxos_60pct_to_70pct_in_loss", "-60-70%", "60-70% in Loss"), + _70pct_to_80pct_in_loss: CohortName::new("utxos_70pct_to_80pct_in_loss", "-70-80%", "70-80% in Loss"), + _80pct_to_90pct_in_loss: CohortName::new("utxos_80pct_to_90pct_in_loss", "-80-90%", "80-90% in Loss"), + _90pct_to_100pct_in_loss: CohortName::new("utxos_90pct_to_100pct_in_loss", "-90-100%", "90-100% in Loss"), }; impl ProfitabilityRange { diff --git a/crates/brk_computer/src/internal/per_block/percentiles.rs b/crates/brk_computer/src/internal/per_block/percentiles.rs index 047b3feca..0974466ac 100644 --- a/crates/brk_computer/src/internal/per_block/percentiles.rs +++ b/crates/brk_computer/src/internal/per_block/percentiles.rs @@ -27,8 +27,8 @@ impl PercentilesVecs { let vecs = PERCENTILES .into_iter() .map(|p| { - let metric_name = format!("{prefix}_pct{p:02}"); - Price::forced_import(db, &metric_name, version + VERSION, indexes) + let series_name = format!("{prefix}_pct{p:02}"); + Price::forced_import(db, &series_name, version + VERSION, indexes) }) .collect::>>()? .try_into() diff --git a/crates/brk_computer/src/internal/per_block/ratio/base.rs b/crates/brk_computer/src/internal/per_block/ratio/base.rs index b5e35c492..cf4385275 100644 --- a/crates/brk_computer/src/internal/per_block/ratio/base.rs +++ b/crates/brk_computer/src/internal/per_block/ratio/base.rs @@ -52,13 +52,13 @@ impl RatioPerBlock { &mut self, starting_indexes: &Indexes, close_price: &impl ReadableVec, - metric_price: &impl ReadableVec, + series_price: &impl ReadableVec, exit: &Exit, ) -> Result<()> { self.bps.height.compute_transform2( starting_indexes.height, close_price, - metric_price, + series_price, |(i, close, price, ..)| { if price == Cents::ZERO { (i, BasisPoints32::from(1.0)) diff --git a/crates/brk_computer/src/internal/per_block/ratio/percentiles.rs b/crates/brk_computer/src/internal/per_block/ratio/percentiles.rs index 30dc1a62d..f9992552f 100644 --- a/crates/brk_computer/src/internal/per_block/ratio/percentiles.rs +++ b/crates/brk_computer/src/internal/per_block/ratio/percentiles.rs @@ -81,7 +81,7 @@ impl RatioPerBlockPercentiles { starting_indexes: &Indexes, exit: &Exit, ratio_source: &impl ReadableVec, - metric_price: &impl ReadableVec, + series_price: &impl ReadableVec, ) -> Result<()> { let ratio_version = ratio_source.version(); self.mut_pct_vecs().try_for_each(|v| -> Result<()> { @@ -147,7 +147,7 @@ impl RatioPerBlockPercentiles { .cents .compute_binary::( starting_indexes.height, - metric_price, + series_price, &self.$band.ratio.bps.height, exit, )?; diff --git a/crates/brk_computer/src/internal/per_block/ratio/std_dev_bands.rs b/crates/brk_computer/src/internal/per_block/ratio/std_dev_bands.rs index db626f0f1..dc198ac13 100644 --- a/crates/brk_computer/src/internal/per_block/ratio/std_dev_bands.rs +++ b/crates/brk_computer/src/internal/per_block/ratio/std_dev_bands.rs @@ -53,7 +53,7 @@ impl RatioPerBlockStdDevBands { starting_indexes: &Indexes, exit: &Exit, ratio_source: &impl ReadableVec, - metric_price: &impl ReadableVec, + series_price: &impl ReadableVec, sma: &RatioSma, ) -> Result<()> { for (sd, sma_ratio) in [ @@ -63,7 +63,7 @@ impl RatioPerBlockStdDevBands { (&mut self._1y, &sma._1y.ratio.height), ] { sd.compute_all(blocks, starting_indexes, exit, ratio_source, sma_ratio)?; - sd.compute_cents_bands(starting_indexes, metric_price, sma_ratio, exit)?; + sd.compute_cents_bands(starting_indexes, series_price, sma_ratio, exit)?; } Ok(()) diff --git a/crates/brk_computer/src/internal/per_block/stddev/extended.rs b/crates/brk_computer/src/internal/per_block/stddev/extended.rs index 942c89821..882c1ecc2 100644 --- a/crates/brk_computer/src/internal/per_block/stddev/extended.rs +++ b/crates/brk_computer/src/internal/per_block/stddev/extended.rs @@ -179,7 +179,7 @@ impl StdDevPerBlockExtended { pub(crate) fn compute_cents_bands( &mut self, starting_indexes: &Indexes, - metric_price: &impl ReadableVec, + series_price: &impl ReadableVec, sma: &impl ReadableVec, exit: &Exit, ) -> Result<()> { @@ -189,7 +189,7 @@ impl StdDevPerBlockExtended { .cents .compute_binary::( starting_indexes.height, - metric_price, + series_price, $band_source, exit, )?; diff --git a/crates/brk_error/src/lib.rs b/crates/brk_error/src/lib.rs index 2e28560a3..ff0fbc74b 100644 --- a/crates/brk_error/src/lib.rs +++ b/crates/brk_error/src/lib.rs @@ -126,15 +126,15 @@ pub enum Error { #[error("Authentication failed")] AuthFailed, - // Metric-specific errors + // Series-specific errors #[error("{0}")] - MetricNotFound(MetricNotFound), + SeriesNotFound(SeriesNotFound), - #[error("'{metric}' doesn't support the requested index. Try: {supported}")] - MetricUnsupportedIndex { metric: String, supported: String }, + #[error("'{series}' doesn't support the requested index. Try: {supported}")] + SeriesUnsupportedIndex { series: String, supported: String }, - #[error("No metrics specified")] - NoMetrics, + #[error("No series specified")] + NoSeries, #[error("No data available")] NoData, @@ -221,31 +221,31 @@ fn is_io_error_permanent(e: &std::io::Error) -> bool { } #[derive(Debug)] -pub struct MetricNotFound { - pub metric: String, +pub struct SeriesNotFound { + pub series: String, pub suggestions: Vec, pub total_matches: usize, } -impl MetricNotFound { - pub fn new(mut metric: String, all_matches: Vec) -> Self { +impl SeriesNotFound { + pub fn new(mut series: String, all_matches: Vec) -> Self { let total_matches = all_matches.len(); let suggestions = all_matches.into_iter().take(3).collect(); - if metric.len() > 100 { - metric.truncate(100); - metric.push_str("..."); + if series.len() > 100 { + series.truncate(100); + series.push_str("..."); } Self { - metric, + series, suggestions, total_matches, } } } -impl fmt::Display for MetricNotFound { +impl fmt::Display for SeriesNotFound { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "'{}' not found", self.metric)?; + write!(f, "'{}' not found", self.series)?; if self.suggestions.is_empty() { return Ok(()); @@ -258,8 +258,8 @@ impl fmt::Display for MetricNotFound { if remaining > 0 { write!( f, - " ({remaining} more — /api/metrics/search?q={} for all)", - self.metric + " ({remaining} more — /api/series/search?q={} for all)", + self.series )?; } diff --git a/crates/brk_query/examples/list.rs b/crates/brk_query/examples/list.rs index b5c041998..08da2b661 100644 --- a/crates/brk_query/examples/list.rs +++ b/crates/brk_query/examples/list.rs @@ -17,12 +17,12 @@ pub fn main() -> brk_error::Result<()> { let vecs = Vecs::build(&indexer_ro, &computer_ro); - let out_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("metrics.txt"); - let content = vecs.metrics.join("\n"); + let out_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("series.txt"); + let content = vecs.series.join("\n"); fs::write(&out_path, &content)?; eprintln!( - "Wrote {} metrics to {}", - vecs.metrics.len(), + "Wrote {} series to {}", + vecs.series.len(), out_path.display() ); diff --git a/crates/brk_query/examples/query.rs b/crates/brk_query/examples/query.rs index 108ecff5c..ce72a2274 100644 --- a/crates/brk_query/examples/query.rs +++ b/crates/brk_query/examples/query.rs @@ -67,14 +67,14 @@ pub fn main() -> Result<()> { "bc1qwzrryqr3ja8w7hnja2spmkgfdcgvqwp5swz4af4ngsjecfz0w0pqud7k38".to_string() ))); - // dbg!(query.search_and_format(MetricSelection { + // dbg!(query.search_and_format(SeriesSelection { // index: Index::Height, - // metrics: vec!["date"].into(), + // series: vec!["date"].into(), // range: DataRangeFormat::default().set_from(-1), // })?); - // dbg!(query.search_and_format(MetricSelection { + // dbg!(query.search_and_format(SeriesSelection { // index: Index::Height, - // metrics: vec!["date", "timestamp"].into(), + // series: vec!["date", "timestamp"].into(), // range: DataRangeFormat::default().set_from(-10).set_count(5), // })?); diff --git a/crates/brk_query/src/impl/mod.rs b/crates/brk_query/src/impl/mod.rs index 085e6108c..496620961 100644 --- a/crates/brk_query/src/impl/mod.rs +++ b/crates/brk_query/src/impl/mod.rs @@ -2,10 +2,10 @@ mod address; mod block; mod cost_basis; mod mempool; -mod metrics; +mod series; mod mining; mod price; mod transaction; pub use block::BLOCK_TXS_PAGE_SIZE; -pub use metrics::ResolvedQuery; +pub use series::ResolvedQuery; diff --git a/crates/brk_query/src/impl/metrics.rs b/crates/brk_query/src/impl/series.rs similarity index 76% rename from crates/brk_query/src/impl/metrics.rs rename to crates/brk_query/src/impl/series.rs index a7dedd620..427b5e340 100644 --- a/crates/brk_query/src/impl/metrics.rs +++ b/crates/brk_query/src/impl/series.rs @@ -3,9 +3,9 @@ use std::{collections::BTreeMap, sync::LazyLock}; use brk_error::{Error, Result}; use brk_traversable::TreeNode; use brk_types::{ - Date, DetailedMetricCount, Epoch, Etag, Format, Halving, Height, Index, IndexInfo, LegacyValue, - Limit, Metric, MetricData, MetricInfo, MetricOutput, MetricOutputLegacy, MetricSelection, - Output, OutputLegacy, PaginatedMetrics, Pagination, PaginationIndex, RangeIndex, RangeMap, + Date, DetailedSeriesCount, Epoch, Etag, Format, Halving, Height, Index, IndexInfo, LegacyValue, + Limit, Series, SeriesData, SeriesInfo, SeriesOutput, SeriesOutputLegacy, SeriesSelection, + Output, OutputLegacy, PaginatedSeries, Pagination, PaginationIndex, RangeIndex, RangeMap, SearchQuery, Timestamp, Version, }; use parking_lot::RwLock; @@ -13,7 +13,7 @@ use vecdb::{AnyExportableVec, ReadableVec}; use crate::{ Query, - vecs::{IndexToVec, MetricToVec}, + vecs::{IndexToVec, SeriesToVec}, }; /// Monotonic block timestamps → height. Lazily extended as new blocks are indexed. @@ -26,31 +26,31 @@ const CSV_HEADER_BYTES_PER_COL: usize = 10; const CSV_CELL_BYTES: usize = 15; impl Query { - pub fn search_metrics(&self, query: &SearchQuery) -> Vec<&'static str> { + pub fn search_series(&self, query: &SearchQuery) -> Vec<&'static str> { self.vecs().matches(&query.q, query.limit) } - pub fn metric_not_found_error(&self, metric: &Metric) -> Error { - // Check if metric exists but with different indexes - if let Some(indexes) = self.vecs().metric_to_indexes(metric.clone()) { + pub fn series_not_found_error(&self, series: &Series) -> Error { + // Check if series exists but with different indexes + if let Some(indexes) = self.vecs().series_to_indexes(series.clone()) { let supported = indexes .iter() - .map(|i| format!("/api/metric/{metric}/{}", i.name())) + .map(|i| format!("/api/series/{series}/{}", i.name())) .collect::>() .join(", "); - return Error::MetricUnsupportedIndex { - metric: metric.to_string(), + return Error::SeriesUnsupportedIndex { + series: series.to_string(), supported, }; } - // Metric doesn't exist, suggest alternatives + // Series doesn't exist, suggest alternatives let matches = self - .vecs().matches(metric, Limit::DEFAULT) + .vecs().matches(series, Limit::DEFAULT) .into_iter() .map(|s| s.to_string()) .collect(); - Error::MetricNotFound(brk_error::MetricNotFound::new(metric.to_string(), matches)) + Error::SeriesNotFound(brk_error::SeriesNotFound::new(series.to_string(), matches)) } pub(crate) fn columns_to_csv( @@ -107,44 +107,44 @@ impl Query { Ok(csv) } - /// Returns the latest value for a single metric as a JSON value. - pub fn latest(&self, metric: &Metric, index: Index) -> Result { + /// Returns the latest value for a single series as a JSON value. + pub fn latest(&self, series: &Series, index: Index) -> Result { let vec = self .vecs() - .get(metric, index) - .ok_or_else(|| self.metric_not_found_error(metric))?; + .get(series, index) + .ok_or_else(|| self.series_not_found_error(series))?; vec.last_json_value().ok_or(Error::NoData) } - /// Returns the length (total data points) for a single metric. - pub fn len(&self, metric: &Metric, index: Index) -> Result { + /// Returns the length (total data points) for a single series. + pub fn len(&self, series: &Series, index: Index) -> Result { let vec = self .vecs() - .get(metric, index) - .ok_or_else(|| self.metric_not_found_error(metric))?; + .get(series, index) + .ok_or_else(|| self.series_not_found_error(series))?; Ok(vec.len()) } - /// Returns the version for a single metric. - pub fn version(&self, metric: &Metric, index: Index) -> Result { + /// Returns the version for a single series. + pub fn version(&self, series: &Series, index: Index) -> Result { let vec = self .vecs() - .get(metric, index) - .ok_or_else(|| self.metric_not_found_error(metric))?; + .get(series, index) + .ok_or_else(|| self.series_not_found_error(series))?; Ok(vec.version()) } - /// Search for vecs matching the given metrics and index. - /// Returns error if no metrics requested or any requested metric is not found. - pub fn search(&self, params: &MetricSelection) -> Result> { - if params.metrics.is_empty() { - return Err(Error::NoMetrics); + /// Search for vecs matching the given series and index. + /// Returns error if no series requested or any requested series is not found. + pub fn search(&self, params: &SeriesSelection) -> Result> { + if params.series.is_empty() { + return Err(Error::NoSeries); } - let mut vecs = Vec::with_capacity(params.metrics.len()); - for metric in params.metrics.iter() { - match self.vecs().get(metric, params.index) { + let mut vecs = Vec::with_capacity(params.series.len()); + for series in params.series.iter() { + match self.vecs().get(series, params.index) { Some(vec) => vecs.push(vec), - None => return Err(self.metric_not_found_error(metric)), + None => return Err(self.series_not_found_error(series)), } } Ok(vecs) @@ -157,7 +157,7 @@ impl Query { /// Resolve query metadata without formatting (cheap). /// Use with `format` for lazy formatting after ETag check. - pub fn resolve(&self, params: MetricSelection, max_weight: usize) -> Result { + pub fn resolve(&self, params: SeriesSelection, max_weight: usize) -> Result { let vecs = self.search(¶ms)?; let total = vecs.iter().map(|v| v.len()).min().unwrap_or(0); @@ -209,7 +209,7 @@ impl Query { /// Format a resolved query (expensive). /// Call after ETag/cache checks to avoid unnecessary work. - pub fn format(&self, resolved: ResolvedQuery) -> Result { + pub fn format(&self, resolved: ResolvedQuery) -> Result { let ResolvedQuery { vecs, format, @@ -227,7 +227,7 @@ impl Query { let count = end.saturating_sub(start); if vecs.len() == 1 { let mut buf = Vec::with_capacity(count * 12 + 256); - MetricData::serialize(vecs[0], index, start, end, &mut buf)?; + SeriesData::serialize(vecs[0], index, start, end, &mut buf)?; Output::Json(buf) } else { let mut buf = Vec::with_capacity(count * 12 * vecs.len() + 256); @@ -236,7 +236,7 @@ impl Query { if i > 0 { buf.push(b','); } - MetricData::serialize(*vec, index, start, end, &mut buf)?; + SeriesData::serialize(*vec, index, start, end, &mut buf)?; } buf.push(b']'); Output::Json(buf) @@ -244,7 +244,7 @@ impl Query { } }; - Ok(MetricOutput { + Ok(SeriesOutput { output, version, total, @@ -253,9 +253,9 @@ impl Query { }) } - /// Format a resolved query as raw data (just the JSON array, no MetricData wrapper). + /// Format a resolved query as raw data (just the JSON array, no SeriesData wrapper). /// CSV output is identical to `format` (no wrapper distinction for CSV). - pub fn format_raw(&self, resolved: ResolvedQuery) -> Result { + pub fn format_raw(&self, resolved: ResolvedQuery) -> Result { if resolved.format() == Format::CSV { return self.format(resolved); } @@ -268,7 +268,7 @@ impl Query { let mut buf = Vec::with_capacity(count * 12 + 2); vecs[0].write_json(Some(start), Some(end), &mut buf)?; - Ok(MetricOutput { + Ok(SeriesOutput { output: Output::Json(buf), version, total, @@ -277,16 +277,16 @@ impl Query { }) } - pub fn metric_to_index_to_vec(&self) -> &BTreeMap<&str, IndexToVec<'_>> { - &self.vecs().metric_to_index_to_vec + pub fn series_to_index_to_vec(&self) -> &BTreeMap<&str, IndexToVec<'_>> { + &self.vecs().series_to_index_to_vec } - pub fn index_to_metric_to_vec(&self) -> &BTreeMap> { - &self.vecs().index_to_metric_to_vec + pub fn index_to_series_to_vec(&self) -> &BTreeMap> { + &self.vecs().index_to_series_to_vec } - pub fn metric_count(&self) -> DetailedMetricCount { - DetailedMetricCount { + pub fn series_count(&self) -> DetailedSeriesCount { + DetailedSeriesCount { total: self.vecs().counts.clone(), by_db: self.vecs().counts_by_db.clone(), } @@ -296,11 +296,11 @@ impl Query { &self.vecs().indexes } - pub fn metrics(&self, pagination: Pagination) -> PaginatedMetrics { - self.vecs().metrics(pagination) + pub fn series_list(&self, pagination: Pagination) -> PaginatedSeries { + self.vecs().series(pagination) } - pub fn metrics_catalog(&self) -> &TreeNode { + pub fn series_catalog(&self) -> &TreeNode { self.vecs().catalog() } @@ -308,18 +308,18 @@ impl Query { self.vecs().index_to_ids(paginated_index) } - pub fn metric_info(&self, metric: &Metric) -> Option { - let index_to_vec = self.vecs().metric_to_index_to_vec.get(metric.replace("-", "_").as_str())?; + pub fn series_info(&self, series: &Series) -> Option { + let index_to_vec = self.vecs().series_to_index_to_vec.get(series.replace("-", "_").as_str())?; let value_type = index_to_vec.values().next()?.value_type_to_string(); let indexes = index_to_vec.keys().copied().collect(); - Some(MetricInfo { + Some(SeriesInfo { indexes, value_type: value_type.into(), }) } - pub fn metric_to_indexes(&self, metric: Metric) -> Option<&Vec> { - self.vecs().metric_to_indexes(metric) + pub fn series_to_indexes(&self, series: Series) -> Option<&Vec> { + self.vecs().series_to_indexes(series) } /// Resolve a RangeIndex to an i64 offset for the given index type. @@ -379,7 +379,7 @@ impl Query { } /// Deprecated - format a resolved query as legacy output (expensive). - pub fn format_legacy(&self, resolved: ResolvedQuery) -> Result { + pub fn format_legacy(&self, resolved: ResolvedQuery) -> Result { let ResolvedQuery { vecs, format, @@ -391,7 +391,7 @@ impl Query { } = resolved; if vecs.is_empty() { - return Ok(MetricOutputLegacy { + return Ok(SeriesOutputLegacy { output: OutputLegacy::default(format), version: Version::ZERO, total: 0, @@ -407,14 +407,14 @@ impl Query { Format::CSV => OutputLegacy::CSV(Self::columns_to_csv(&vecs, start, end)?), Format::JSON => { if vecs.len() == 1 { - let metric = vecs[0]; - let count = metric.range_count(from, to); + let col = vecs[0]; + let count = col.range_count(from, to); let mut buf = Vec::new(); if count == 1 { - metric.write_json_value(Some(start), &mut buf)?; + col.write_json_value(Some(start), &mut buf)?; OutputLegacy::Json(LegacyValue::Value(buf)) } else { - metric.write_json(Some(start), Some(end), &mut buf)?; + col.write_json(Some(start), Some(end), &mut buf)?; OutputLegacy::Json(LegacyValue::List(buf)) } } else { @@ -429,7 +429,7 @@ impl Query { } }; - Ok(MetricOutputLegacy { + Ok(SeriesOutputLegacy { output, version, total, @@ -439,7 +439,7 @@ impl Query { } } -/// A resolved metric query ready for formatting. +/// A resolved series query ready for formatting. /// Contains the vecs and metadata needed to build an ETag or format the output. pub struct ResolvedQuery { pub vecs: Vec<&'static dyn AnyExportableVec>, @@ -454,7 +454,7 @@ pub struct ResolvedQuery { impl ResolvedQuery { pub fn etag(&self) -> Etag { - Etag::from_metric(self.version, self.total, self.start, self.end, self.height) + Etag::from_series(self.version, self.total, self.start, self.end, self.height) } pub fn format(&self) -> Format { diff --git a/crates/brk_query/src/lib.rs b/crates/brk_query/src/lib.rs index 718470caa..e7d844d21 100644 --- a/crates/brk_query/src/lib.rs +++ b/crates/brk_query/src/lib.rs @@ -61,7 +61,7 @@ impl Query { Height::from(self.indexer().vecs.blocks.blockhash.stamp()) } - /// Current computed height (metrics) + /// Current computed height (series) pub fn computed_height(&self) -> Height { Height::from(self.computer().distribution.supply_state.len()) } diff --git a/crates/brk_query/src/vecs.rs b/crates/brk_query/src/vecs.rs index c2f8774eb..0f14815d5 100644 --- a/crates/brk_query/src/vecs.rs +++ b/crates/brk_query/src/vecs.rs @@ -4,7 +4,7 @@ use brk_computer::Computer; use brk_indexer::Indexer; use brk_traversable::{Traversable, TreeNode}; use brk_types::{ - Index, IndexInfo, Limit, Metric, MetricCount, PaginatedMetrics, Pagination, PaginationIndex, + Index, IndexInfo, Limit, PaginatedSeries, Pagination, PaginationIndex, Series, SeriesCount, }; use derive_more::{Deref, DerefMut}; use quickmatch::{QuickMatch, QuickMatchConfig}; @@ -12,16 +12,16 @@ use vecdb::AnyExportableVec; #[derive(Default)] pub struct Vecs<'a> { - pub metric_to_index_to_vec: BTreeMap<&'a str, IndexToVec<'a>>, - pub index_to_metric_to_vec: BTreeMap>, - pub metrics: Vec<&'a str>, + pub series_to_index_to_vec: BTreeMap<&'a str, IndexToVec<'a>>, + pub index_to_series_to_vec: BTreeMap>, + pub series: Vec<&'a str>, pub indexes: Vec, - pub counts: MetricCount, - pub counts_by_db: BTreeMap, + pub counts: SeriesCount, + pub counts_by_db: BTreeMap, catalog: Option, matcher: Option>, - metric_to_indexes: BTreeMap<&'a str, Vec>, - index_to_metrics: BTreeMap>, + series_to_indexes: BTreeMap<&'a str, Vec>, + index_to_series: BTreeMap>, } impl<'a> Vecs<'a> { @@ -55,7 +55,7 @@ impl<'a> Vecs<'a> { computed_vecs.for_each(|(db, vec)| this.insert(vec, db)); let mut ids = this - .metric_to_index_to_vec + .series_to_index_to_vec .keys() .cloned() .collect::>(); @@ -73,22 +73,22 @@ impl<'a> Vecs<'a> { sort_ids(&mut ids); - this.metrics = ids; - this.counts.distinct_metrics = this.metric_to_index_to_vec.keys().count(); + this.series = ids; + this.counts.distinct_series = this.series_to_index_to_vec.keys().count(); this.counts.total_endpoints = this - .index_to_metric_to_vec + .index_to_series_to_vec .values() .map(|tree| tree.len()) .sum::(); this.counts.lazy_endpoints = this - .index_to_metric_to_vec + .index_to_series_to_vec .values() .flat_map(|tree| tree.values()) .filter(|vec| vec.region_names().is_empty()) .count(); this.counts.stored_endpoints = this.counts.total_endpoints - this.counts.lazy_endpoints; this.indexes = this - .index_to_metric_to_vec + .index_to_series_to_vec .keys() .map(|i| IndexInfo { index: *i, @@ -100,17 +100,17 @@ impl<'a> Vecs<'a> { }) .collect(); - this.metric_to_indexes = this - .metric_to_index_to_vec + this.series_to_indexes = this + .series_to_index_to_vec .iter() .map(|(id, index_to_vec)| (*id, index_to_vec.keys().copied().collect::>())) .collect(); - this.index_to_metrics = this - .index_to_metric_to_vec + this.index_to_series = this + .index_to_series_to_vec .iter() .map(|(index, id_to_vec)| (*index, id_to_vec.keys().cloned().collect::>())) .collect(); - this.index_to_metrics.values_mut().for_each(sort_ids); + this.index_to_series.values_mut().for_each(sort_ids); this.catalog.replace( TreeNode::Branch( [ @@ -123,7 +123,7 @@ impl<'a> Vecs<'a> { .merge_branches() .unwrap(), ); - this.matcher = Some(QuickMatch::new(&this.metrics)); + this.matcher = Some(QuickMatch::new(&this.series)); this } @@ -135,23 +135,23 @@ impl<'a> Vecs<'a> { .unwrap_or_else(|_| panic!("Unknown index type: {serialized_index}")); let prev = self - .metric_to_index_to_vec + .series_to_index_to_vec .entry(name) .or_default() .insert(index, vec); assert!( prev.is_none(), - "Duplicate metric: {name} for index {index:?}" + "Duplicate series: {name} for index {index:?}" ); let prev = self - .index_to_metric_to_vec + .index_to_series_to_vec .entry(index) .or_default() .insert(name, vec); assert!( prev.is_none(), - "Duplicate metric: {name} for index {index:?}" + "Duplicate series: {name} for index {index:?}" ); // Track per-db counts @@ -162,36 +162,36 @@ impl<'a> Vecs<'a> { .add_endpoint(name, is_lazy); } - pub fn metrics(&'static self, pagination: Pagination) -> PaginatedMetrics { - let len = self.metrics.len(); + pub fn series(&'static self, pagination: Pagination) -> PaginatedSeries { + let len = self.series.len(); let per_page = pagination.per_page(); let start = pagination.start(len); let end = pagination.end(len); let max_page = len.div_ceil(per_page).saturating_sub(1); - PaginatedMetrics { + PaginatedSeries { current_page: pagination.page(), max_page, total_count: len, per_page, has_more: pagination.page() < max_page, - metrics: self.metrics[start..end] + series: self.series[start..end] .iter() .map(|&s| Cow::Borrowed(s)) .collect(), } } - pub fn metric_to_indexes(&self, metric: Metric) -> Option<&Vec> { - self.metric_to_indexes - .get(metric.replace("-", "_").as_str()) + pub fn series_to_indexes(&self, series: Series) -> Option<&Vec> { + self.series_to_indexes + .get(series.replace("-", "_").as_str()) } pub fn index_to_ids( &self, PaginationIndex { index, pagination }: PaginationIndex, ) -> Option<&[&'a str]> { - let vec = self.index_to_metrics.get(&index)?; + let vec = self.index_to_series.get(&index)?; let len = vec.len(); let start = pagination.start(len); @@ -204,21 +204,21 @@ impl<'a> Vecs<'a> { self.catalog.as_ref().expect("catalog not initialized") } - pub fn matches(&self, metric: &Metric, limit: Limit) -> Vec<&'_ str> { + pub fn matches(&self, series: &Series, limit: Limit) -> Vec<&'_ str> { if limit.is_zero() { return Vec::new(); } self.matcher .as_ref() .expect("matcher not initialized") - .matches_with(metric, &QuickMatchConfig::new().with_limit(*limit)) + .matches_with(series, &QuickMatchConfig::new().with_limit(*limit)) } - /// Look up a vec by metric name and index - pub fn get(&self, metric: &Metric, index: Index) -> Option<&'a dyn AnyExportableVec> { - let metric_name = metric.replace("-", "_"); - self.metric_to_index_to_vec - .get(metric_name.as_str()) + /// Look up a vec by series name and index + pub fn get(&self, series: &Series, index: Index) -> Option<&'a dyn AnyExportableVec> { + let series_name = series.replace("-", "_"); + self.series_to_index_to_vec + .get(series_name.as_str()) .and_then(|index_to_vec| index_to_vec.get(&index).copied()) } } @@ -227,4 +227,4 @@ impl<'a> Vecs<'a> { pub struct IndexToVec<'a>(BTreeMap); #[derive(Default, Deref, DerefMut)] -pub struct MetricToVec<'a>(BTreeMap<&'a str, &'a dyn AnyExportableVec>); +pub struct SeriesToVec<'a>(BTreeMap<&'a str, &'a dyn AnyExportableVec>); diff --git a/crates/brk_server/src/api/metrics/mod.rs b/crates/brk_server/src/api/metrics_legacy/mod.rs similarity index 59% rename from crates/brk_server/src/api/metrics/mod.rs rename to crates/brk_server/src/api/metrics_legacy/mod.rs index a34639b33..decdeec4b 100644 --- a/crates/brk_server/src/api/metrics/mod.rs +++ b/crates/brk_server/src/api/metrics_legacy/mod.rs @@ -10,55 +10,52 @@ use axum::{ use brk_traversable::TreeNode; use brk_types::{ CostBasisCohortParam, CostBasisFormatted, CostBasisParams, CostBasisQuery, DataRangeFormat, - Date, Index, IndexInfo, Metric, MetricCount, MetricData, MetricInfo, MetricParam, - MetricSelection, MetricSelectionLegacy, MetricWithIndex, Metrics, PaginatedMetrics, Pagination, - SearchQuery, + Date, DetailedSeriesCount, Index, IndexInfo, PaginatedSeries, Pagination, SearchQuery, Series, + SeriesData, SeriesInfo, SeriesList, SeriesSelection, SeriesSelectionLegacy, }; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; use crate::{CacheStrategy, Error, extended::TransformResponseExtended}; use super::AppState; +use super::series::legacy; -mod bulk; -mod data; -mod legacy; - -/// Maximum allowed request weight in bytes (650KB) -const MAX_WEIGHT: usize = 65 * 10_000; -/// Maximum allowed request weight for localhost (50MB) -const MAX_WEIGHT_LOCALHOST: usize = 50 * 1_000_000; -/// Cache control header for metric data responses -const CACHE_CONTROL: &str = "public, max-age=1, must-revalidate"; - -/// Returns the max weight for a request based on the client address. -/// Localhost requests get a generous limit, external requests get a stricter one. -fn max_weight(addr: &SocketAddr) -> usize { - if addr.ip().is_loopback() { - MAX_WEIGHT_LOCALHOST - } else { - MAX_WEIGHT - } +/// Legacy path parameter for `/api/metric/{metric}` +#[derive(Deserialize, JsonSchema)] +struct LegacySeriesParam { + metric: Series, } -pub trait ApiMetricsRoutes { - fn add_metrics_routes(self) -> Self; +/// Legacy path parameters for `/api/metric/{metric}/{index}` +#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] +struct LegacySeriesWithIndex { + metric: Series, + index: Index, } -impl ApiMetricsRoutes for ApiRouter { - fn add_metrics_routes(self) -> Self { - self.api_route( +pub trait ApiMetricsLegacyRoutes { + fn add_metrics_legacy_routes(self) -> Self; +} + +impl ApiMetricsLegacyRoutes for ApiRouter { + fn add_metrics_legacy_routes(self) -> Self { + self + // --- Deprecated /api/metrics routes --- + .api_route( "/api/metrics", get_with( async |uri: Uri, headers: HeaderMap, State(state): State| { - state.cached_json(&headers, CacheStrategy::Static, &uri, |q| Ok(q.metrics_catalog().clone())).await + state.cached_json(&headers, CacheStrategy::Static, &uri, |q| Ok(q.series_catalog().clone())).await }, |op| op - .id("get_metrics_tree") + .id("get_metrics_tree_deprecated") .metrics_tag() - .summary("Metrics catalog") + .deprecated() + .summary("Metrics catalog (deprecated)") .description( - "Returns the complete hierarchical catalog of available metrics organized as a tree structure. \ - Metrics are grouped by categories and subcategories." + "**DEPRECATED** - Use `/api/series` instead.\n\n\ + Sunset date: 2027-01-01." ) .ok_response::() .not_modified(), @@ -72,14 +69,18 @@ impl ApiMetricsRoutes for ApiRouter { headers: HeaderMap, State(state): State | { - state.cached_json(&headers, CacheStrategy::Static, &uri, |q| Ok(q.metric_count())).await + state.cached_json(&headers, CacheStrategy::Static, &uri, |q| Ok(q.series_count())).await }, |op| op - .id("get_metrics_count") + .id("get_metrics_count_deprecated") .metrics_tag() - .summary("Metric count") - .description("Returns the number of metrics available per index type.") - .ok_response::>() + .deprecated() + .summary("Metric count (deprecated)") + .description( + "**DEPRECATED** - Use `/api/series/count` instead.\n\n\ + Sunset date: 2027-01-01." + ) + .ok_response::() .not_modified(), ), ) @@ -94,11 +95,13 @@ impl ApiMetricsRoutes for ApiRouter { state.cached_json(&headers, CacheStrategy::Static, &uri, |q| Ok(q.indexes().to_vec())).await }, |op| op - .id("get_indexes") + .id("get_indexes_deprecated") .metrics_tag() - .summary("List available indexes") + .deprecated() + .summary("List available indexes (deprecated)") .description( - "Returns all available indexes with their accepted query aliases. Use any alias when querying metrics." + "**DEPRECATED** - Use `/api/series/indexes` instead.\n\n\ + Sunset date: 2027-01-01." ) .ok_response::>() .not_modified(), @@ -113,14 +116,18 @@ impl ApiMetricsRoutes for ApiRouter { State(state): State, Query(pagination): Query | { - state.cached_json(&headers, CacheStrategy::Static, &uri, move |q| Ok(q.metrics(pagination))).await + state.cached_json(&headers, CacheStrategy::Static, &uri, move |q| Ok(q.series_list(pagination))).await }, |op| op - .id("list_metrics") + .id("list_metrics_deprecated") .metrics_tag() - .summary("Metrics list") - .description("Paginated flat list of all available metric names. Use `page` query param for pagination.") - .ok_response::() + .deprecated() + .summary("Metrics list (deprecated)") + .description( + "**DEPRECATED** - Use `/api/series/list` instead.\n\n\ + Sunset date: 2027-01-01." + ) + .ok_response::() .not_modified(), ), ) @@ -133,18 +140,45 @@ impl ApiMetricsRoutes for ApiRouter { State(state): State, Query(query): Query | { - state.cached_json(&headers, CacheStrategy::Static, &uri, move |q| Ok(q.search_metrics(&query))).await + state.cached_json(&headers, CacheStrategy::Static, &uri, move |q| Ok(q.search_series(&query))).await }, |op| op - .id("search_metrics") + .id("search_metrics_deprecated") .metrics_tag() - .summary("Search metrics") - .description("Fuzzy search for metrics by name. Supports partial matches and typos.") - .ok_response::>() + .deprecated() + .summary("Search metrics (deprecated)") + .description( + "**DEPRECATED** - Use `/api/series/search` instead.\n\n\ + Sunset date: 2027-01-01." + ) + .ok_response::>() .not_modified() .server_error(), ), ) + .api_route( + "/api/metrics/bulk", + get_with( + |uri: Uri, headers: HeaderMap, addr: Extension, query: Query, state: State| async move { + legacy::handler(uri, headers, addr, query, state) + .await + .into_response() + }, + |op| op + .id("get_metrics_bulk_deprecated") + .metrics_tag() + .deprecated() + .summary("Bulk metric data (deprecated)") + .description( + "**DEPRECATED** - Use `/api/series/bulk` instead.\n\n\ + Sunset date: 2027-01-01." + ) + .ok_response::>() + .csv_response() + .not_modified(), + ), + ) + // --- Deprecated /api/metric/{metric} routes --- .api_route( "/api/metric/{metric}", get_with( @@ -152,20 +186,22 @@ impl ApiMetricsRoutes for ApiRouter { uri: Uri, headers: HeaderMap, State(state): State, - Path(path): Path + Path(path): Path | { state.cached_json(&headers, CacheStrategy::Static, &uri, move |q| { - q.metric_info(&path.metric).ok_or_else(|| q.metric_not_found_error(&path.metric)) + q.series_info(&path.metric).ok_or_else(|| q.series_not_found_error(&path.metric)) }).await }, |op| op - .id("get_metric_info") + .id("get_metric_info_deprecated") .metrics_tag() - .summary("Get metric info") + .deprecated() + .summary("Get metric info (deprecated)") .description( - "Returns the supported indexes and value type for the specified metric." + "**DEPRECATED** - Use `/api/series/{series}` instead.\n\n\ + Sunset date: 2027-01-01." ) - .ok_response::() + .ok_response::() .not_modified() .not_found() .server_error(), @@ -178,28 +214,24 @@ impl ApiMetricsRoutes for ApiRouter { headers: HeaderMap, addr: Extension, state: State, - Path(path): Path, + Path(path): Path, Query(range): Query| -> Response { - data::handler( - uri, - headers, - addr, - Query(MetricSelection::from((path.index, path.metric, range))), - state, - ) - .await - .into_response() + let params = SeriesSelection::from((path.index, path.metric, range)); + legacy::handler(uri, headers, addr, Query(params), state) + .await + .into_response() }, |op| op - .id("get_metric") + .id("get_metric_deprecated") .metrics_tag() - .summary("Get metric data") + .deprecated() + .summary("Get metric data (deprecated)") .description( - "Fetch data for a specific metric at the given index. \ - Use query parameters to filter by date range and format (json/csv)." + "**DEPRECATED** - Use `/api/series/{series}/{index}` instead.\n\n\ + Sunset date: 2027-01-01." ) - .ok_response::() + .ok_response::() .csv_response() .not_modified() .not_found(), @@ -212,26 +244,22 @@ impl ApiMetricsRoutes for ApiRouter { headers: HeaderMap, addr: Extension, state: State, - Path(path): Path, + Path(path): Path, Query(range): Query| -> Response { - data::raw_handler( - uri, - headers, - addr, - Query(MetricSelection::from((path.index, path.metric, range))), - state, - ) - .await - .into_response() + let params = SeriesSelection::from((path.index, path.metric, range)); + legacy::handler(uri, headers, addr, Query(params), state) + .await + .into_response() }, |op| op - .id("get_metric_data") + .id("get_metric_data_deprecated") .metrics_tag() - .summary("Get raw metric data") + .deprecated() + .summary("Get raw metric data (deprecated)") .description( - "Returns just the data array without the MetricData wrapper. \ - Supports the same range and format parameters as the standard endpoint." + "**DEPRECATED** - Use `/api/series/{series}/{index}/data` instead.\n\n\ + Sunset date: 2027-01-01." ) .ok_response::>() .csv_response() @@ -245,7 +273,7 @@ impl ApiMetricsRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, State(state): State, - Path(path): Path| { + Path(path): Path| { state .cached_json(&headers, CacheStrategy::Height, &uri, move |q| { q.latest(&path.metric, path.index) @@ -253,11 +281,13 @@ impl ApiMetricsRoutes for ApiRouter { .await }, |op| op - .id("get_metric_latest") + .id("get_metric_latest_deprecated") .metrics_tag() - .summary("Get latest metric value") + .deprecated() + .summary("Get latest metric value (deprecated)") .description( - "Returns the single most recent value for a metric, unwrapped (not inside a MetricData object)." + "**DEPRECATED** - Use `/api/series/{series}/{index}/latest` instead.\n\n\ + Sunset date: 2027-01-01." ) .ok_response::() .not_found(), @@ -269,7 +299,7 @@ impl ApiMetricsRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, State(state): State, - Path(path): Path| { + Path(path): Path| { state .cached_json(&headers, CacheStrategy::Height, &uri, move |q| { q.len(&path.metric, path.index) @@ -277,10 +307,14 @@ impl ApiMetricsRoutes for ApiRouter { .await }, |op| op - .id("get_metric_len") + .id("get_metric_len_deprecated") .metrics_tag() - .summary("Get metric data length") - .description("Returns the total number of data points for a metric at the given index.") + .deprecated() + .summary("Get metric data length (deprecated)") + .description( + "**DEPRECATED** - Use `/api/series/{series}/{index}/len` instead.\n\n\ + Sunset date: 2027-01-01." + ) .ok_response::() .not_found(), ), @@ -291,7 +325,7 @@ impl ApiMetricsRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, State(state): State, - Path(path): Path| { + Path(path): Path| { state .cached_json(&headers, CacheStrategy::Height, &uri, move |q| { q.version(&path.metric, path.index) @@ -299,34 +333,19 @@ impl ApiMetricsRoutes for ApiRouter { .await }, |op| op - .id("get_metric_version") + .id("get_metric_version_deprecated") .metrics_tag() - .summary("Get metric version") - .description("Returns the current version of a metric. Changes when the metric data is updated.") + .deprecated() + .summary("Get metric version (deprecated)") + .description( + "**DEPRECATED** - Use `/api/series/{series}/{index}/version` instead.\n\n\ + Sunset date: 2027-01-01." + ) .ok_response::() .not_found(), ), ) - .api_route( - "/api/metrics/bulk", - get_with( - |uri, headers, addr, query, state| async move { - bulk::handler(uri, headers, addr, query, state).await.into_response() - }, - |op| op - .id("get_metrics") - .metrics_tag() - .summary("Bulk metric data") - .description( - "Fetch multiple metrics in a single request. Supports filtering by index and date range. \ - Returns an array of MetricData objects. For a single metric, use `get_metric` instead." - ) - .ok_response::>() - .csv_response() - .not_modified(), - ), - ) - // Cost basis distribution endpoints + // --- Deprecated cost basis routes --- .api_route( "/api/metrics/cost-basis", get_with( @@ -336,10 +355,14 @@ impl ApiMetricsRoutes for ApiRouter { .await }, |op| { - op.id("get_cost_basis_cohorts") + op.id("get_cost_basis_cohorts_deprecated") .metrics_tag() - .summary("Available cost basis cohorts") - .description("List available cohorts for cost basis distribution.") + .deprecated() + .summary("Available cost basis cohorts (deprecated)") + .description( + "**DEPRECATED** - Use `/api/series/cost-basis` instead.\n\n\ + Sunset date: 2027-01-01." + ) .ok_response::>() .server_error() }, @@ -359,10 +382,14 @@ impl ApiMetricsRoutes for ApiRouter { .await }, |op| { - op.id("get_cost_basis_dates") + op.id("get_cost_basis_dates_deprecated") .metrics_tag() - .summary("Available cost basis dates") - .description("List available dates for a cohort's cost basis distribution.") + .deprecated() + .summary("Available cost basis dates (deprecated)") + .description( + "**DEPRECATED** - Use `/api/series/cost-basis/{cohort}/dates` instead.\n\n\ + Sunset date: 2027-01-01." + ) .ok_response::>() .not_found() .server_error() @@ -389,14 +416,13 @@ impl ApiMetricsRoutes for ApiRouter { .await }, |op| { - op.id("get_cost_basis") + op.id("get_cost_basis_deprecated") .metrics_tag() - .summary("Cost basis distribution") + .deprecated() + .summary("Cost basis distribution (deprecated)") .description( - "Get the cost basis distribution for a cohort on a specific date.\n\n\ - Query params:\n\ - - `bucket`: raw (default), lin200, lin500, lin1000, log10, log50, log100\n\ - - `value`: supply (default, in BTC), realized (USD), unrealized (USD)", + "**DEPRECATED** - Use `/api/series/cost-basis/{cohort}/{date}` instead.\n\n\ + Sunset date: 2027-01-01." ) .ok_response::() .not_found() @@ -404,7 +430,7 @@ impl ApiMetricsRoutes for ApiRouter { }, ), ) - // Deprecated endpoints + // --- Deprecated /api/vecs/ routes (moved from series module) --- .api_route( "/api/vecs/{variant}", get_with( @@ -426,9 +452,9 @@ impl ApiMetricsRoutes for ApiRouter { ).into_response(); }; - let params = MetricSelection::from(( + let params = SeriesSelection::from(( index, - Metrics::from(split.collect::>().join(separator)), + SeriesList::from(split.collect::>().join(separator)), range, )); legacy::handler(uri, headers, addr, Query(params), state) @@ -439,10 +465,10 @@ impl ApiMetricsRoutes for ApiRouter { .metrics_tag() .summary("Legacy variant endpoint") .description( - "**DEPRECATED** - Use `/api/metric/{metric}/{index}` instead.\n\n\ + "**DEPRECATED** - Use `/api/series/{series}/{index}` instead.\n\n\ Sunset date: 2027-01-01. May be removed earlier in case of abuse.\n\n\ - Legacy endpoint for querying metrics by variant path (e.g., `day1_to_price`). \ - Returns raw data without the MetricData wrapper." + Legacy endpoint for querying series by variant path (e.g., `day1_to_price`). \ + Returns raw data without the SeriesData wrapper." ) .deprecated() .ok_response::() @@ -455,10 +481,10 @@ impl ApiMetricsRoutes for ApiRouter { async |uri: Uri, headers: HeaderMap, addr: Extension, - Query(params): Query, + Query(params): Query, state: State| -> Response { - let params: MetricSelection = params.into(); + let params: SeriesSelection = params.into(); legacy::handler(uri, headers, addr, Query(params), state) .await .into_response() @@ -467,9 +493,9 @@ impl ApiMetricsRoutes for ApiRouter { .metrics_tag() .summary("Legacy query endpoint") .description( - "**DEPRECATED** - Use `/api/metric/{metric}/{index}` or `/api/metrics/bulk` instead.\n\n\ + "**DEPRECATED** - Use `/api/series/{series}/{index}` or `/api/series/bulk` instead.\n\n\ Sunset date: 2027-01-01. May be removed earlier in case of abuse.\n\n\ - Legacy endpoint for querying metrics. Returns raw data without the MetricData wrapper." + Legacy endpoint for querying series. Returns raw data without the SeriesData wrapper." ) .deprecated() .ok_response::() diff --git a/crates/brk_server/src/api/mod.rs b/crates/brk_server/src/api/mod.rs index b5a8ed854..414b98654 100644 --- a/crates/brk_server/src/api/mod.rs +++ b/crates/brk_server/src/api/mod.rs @@ -15,8 +15,8 @@ use crate::{ Error, api::{ addresses::AddressRoutes, blocks::BlockRoutes, mempool::MempoolRoutes, - metrics::ApiMetricsRoutes, mining::MiningRoutes, server::ServerRoutes, - transactions::TxRoutes, + metrics_legacy::ApiMetricsLegacyRoutes, mining::MiningRoutes, + series::ApiSeriesRoutes, server::ServerRoutes, transactions::TxRoutes, }, extended::{ResponseExtended, TransformResponseExtended}, }; @@ -26,7 +26,8 @@ use super::AppState; mod addresses; mod blocks; mod mempool; -mod metrics; +mod metrics_legacy; +mod series; mod mining; mod openapi; mod server; @@ -41,7 +42,8 @@ pub trait ApiRoutes { impl ApiRoutes for ApiRouter { fn add_api_routes(self) -> Self { self.add_server_routes() - .add_metrics_routes() + .add_series_routes() + .add_metrics_legacy_routes() .add_block_routes() .add_tx_routes() .add_addresses_routes() diff --git a/crates/brk_server/src/api/openapi/mod.rs b/crates/brk_server/src/api/openapi/mod.rs index a3b408de0..10909947f 100644 --- a/crates/brk_server/src/api/openapi/mod.rs +++ b/crates/brk_server/src/api/openapi/mod.rs @@ -22,12 +22,12 @@ pub fn create_openapi() -> OpenApi { let info = Info { title: "Bitcoin Research Kit".to_string(), description: Some( - r#"API for querying Bitcoin blockchain data and on-chain metrics. + r#"API for querying Bitcoin blockchain data and on-chain series. ### Features -- **Metrics**: Thousands of time-series metrics across multiple indexes (date, block height, etc.) -- **[Mempool.space](https://mempool.space/docs/api/rest) compatible** (WIP): Most non-metrics endpoints follow the mempool.space API format +- **Series**: Thousands of time-series across multiple indexes (date, block height, etc.) +- **[Mempool.space](https://mempool.space/docs/api/rest) compatible** (WIP): Most non-series endpoints follow the mempool.space API format - **Multiple formats**: JSON and CSV output - **LLM-optimized**: [`/llms.txt`](/llms.txt) for discovery, [`/api.json`](/api.json) compact OpenAPI spec for tool use (full spec at [`/openapi.json`](/openapi.json)) @@ -35,9 +35,9 @@ pub fn create_openapi() -> OpenApi { ```bash curl -s https://bitview.space/api/block-height/0 -curl -s https://bitview.space/api/metrics/search?q=price -curl -s https://bitview.space/api/metric/price/day -curl -s https://bitview.space/api/metric/price/day/latest +curl -s https://bitview.space/api/series/search?q=price +curl -s https://bitview.space/api/series/price/day +curl -s https://bitview.space/api/series/price/day/latest ``` ### Errors @@ -48,7 +48,7 @@ All errors return structured JSON with a consistent format: { "error": { "type": "not_found", - "code": "metric_not_found", + "code": "series_not_found", "message": "'foo' not found, did you mean 'bar'?", "doc_url": "https://bitcoinresearchkit.org/api" } @@ -56,7 +56,7 @@ All errors return structured JSON with a consistent format: ``` - **`type`**: Error category — `invalid_request` (400), `forbidden` (403), `not_found` (404), `unavailable` (503), or `internal` (500) -- **`code`**: Machine-readable error code (e.g. `invalid_address`, `metric_not_found`, `weight_exceeded`) +- **`code`**: Machine-readable error code (e.g. `invalid_address`, `series_not_found`, `weight_exceeded`) - **`message`**: Human-readable description - **`doc_url`**: Link to API documentation @@ -97,13 +97,20 @@ All errors return structured JSON with a consistent format: ), ..Default::default() }, + Tag { + name: "Series".to_string(), + description: Some( + "Access thousands of Bitcoin network time-series data. Query historical statistics \ + across various indexes (date, week, month, block height) with JSON or CSV output.\n\n\ + **Note:** Series names are subject to change while the project is in active development." + .to_string(), + ), + ..Default::default() + }, Tag { name: "Metrics".to_string(), description: Some( - "Access thousands of Bitcoin network metrics and time-series data. Query historical statistics \ - across various indexes (date, week, month, block height) with JSON or CSV output.\n\n\ - **Note:** Metric names are subject to change while the project is in active development." - .to_string(), + "Deprecated — use Series".to_string(), ), ..Default::default() }, diff --git a/crates/brk_server/src/api/metrics/bulk.rs b/crates/brk_server/src/api/series/bulk.rs similarity index 93% rename from crates/brk_server/src/api/metrics/bulk.rs rename to crates/brk_server/src/api/series/bulk.rs index 7f4645eac..8cbf9a380 100644 --- a/crates/brk_server/src/api/metrics/bulk.rs +++ b/crates/brk_server/src/api/series/bulk.rs @@ -7,11 +7,11 @@ use axum::{ http::{HeaderMap, StatusCode, Uri}, response::{IntoResponse, Response}, }; -use brk_types::{Format, MetricSelection, Output}; +use brk_types::{Format, Output, SeriesSelection}; use crate::{ Result, - api::metrics::{CACHE_CONTROL, max_weight}, + api::series::{CACHE_CONTROL, max_weight}, extended::{ContentEncoding, HeaderMapExtended}, }; @@ -21,7 +21,7 @@ pub async fn handler( uri: Uri, headers: HeaderMap, Extension(addr): Extension, - Query(params): Query, + Query(params): Query, State(state): State, ) -> Result { // Phase 1: Search and resolve metadata (cheap) diff --git a/crates/brk_server/src/api/metrics/data.rs b/crates/brk_server/src/api/series/data.rs similarity index 90% rename from crates/brk_server/src/api/metrics/data.rs rename to crates/brk_server/src/api/series/data.rs index e233f071e..cdcf25e05 100644 --- a/crates/brk_server/src/api/metrics/data.rs +++ b/crates/brk_server/src/api/series/data.rs @@ -9,11 +9,11 @@ use axum::{ }; use brk_error::Result as BrkResult; use brk_query::{Query as BrkQuery, ResolvedQuery}; -use brk_types::{Format, MetricOutput, MetricSelection, Output}; +use brk_types::{Format, Output, SeriesOutput, SeriesSelection}; use crate::{ Result, - api::metrics::{CACHE_CONTROL, max_weight}, + api::series::{CACHE_CONTROL, max_weight}, extended::{ContentEncoding, HeaderMapExtended}, }; @@ -23,7 +23,7 @@ pub async fn handler( uri: Uri, headers: HeaderMap, addr: Extension, - Query(params): Query, + Query(params): Query, state: State, ) -> Result { format_and_respond(uri, headers, addr, params, state, |q, r| q.format(r)).await @@ -33,7 +33,7 @@ pub async fn raw_handler( uri: Uri, headers: HeaderMap, addr: Extension, - Query(params): Query, + Query(params): Query, state: State, ) -> Result { format_and_respond(uri, headers, addr, params, state, |q, r| q.format_raw(r)).await @@ -43,9 +43,9 @@ async fn format_and_respond( uri: Uri, headers: HeaderMap, Extension(addr): Extension, - params: MetricSelection, + params: SeriesSelection, state: State, - formatter: fn(&BrkQuery, ResolvedQuery) -> BrkResult, + formatter: fn(&BrkQuery, ResolvedQuery) -> BrkResult, ) -> Result { // Phase 1: Search and resolve metadata (cheap) let resolved = state diff --git a/crates/brk_server/src/api/metrics/legacy.rs b/crates/brk_server/src/api/series/legacy.rs similarity index 91% rename from crates/brk_server/src/api/metrics/legacy.rs rename to crates/brk_server/src/api/series/legacy.rs index f77f42a85..8f973b7a9 100644 --- a/crates/brk_server/src/api/metrics/legacy.rs +++ b/crates/brk_server/src/api/series/legacy.rs @@ -7,15 +7,15 @@ use axum::{ http::{HeaderMap, StatusCode, Uri}, response::{IntoResponse, Response}, }; -use brk_types::{Format, MetricSelection, OutputLegacy}; +use brk_types::{Format, OutputLegacy, SeriesSelection}; use crate::{ Result, - api::metrics::{CACHE_CONTROL, max_weight}, + api::series::{CACHE_CONTROL, max_weight}, extended::{ContentEncoding, HeaderMapExtended}, }; -const SUNSET: &str = "2027-01-01T00:00:00Z"; +pub const SUNSET: &str = "2027-01-01T00:00:00Z"; use super::AppState; @@ -23,7 +23,7 @@ pub async fn handler( uri: Uri, headers: HeaderMap, Extension(addr): Extension, - Query(params): Query, + Query(params): Query, State(state): State, ) -> Result { // Phase 1: Search and resolve metadata (cheap) diff --git a/crates/brk_server/src/api/series/mod.rs b/crates/brk_server/src/api/series/mod.rs new file mode 100644 index 000000000..1c203ae99 --- /dev/null +++ b/crates/brk_server/src/api/series/mod.rs @@ -0,0 +1,407 @@ +use std::net::SocketAddr; + +use aide::axum::{ApiRouter, routing::get_with}; +use axum::{ + Extension, + extract::{Path, Query, State}, + http::{HeaderMap, Uri}, + response::{IntoResponse, Response}, +}; +use brk_traversable::TreeNode; +use brk_types::{ + CostBasisCohortParam, CostBasisFormatted, CostBasisParams, CostBasisQuery, DataRangeFormat, + Date, IndexInfo, PaginatedSeries, Pagination, SearchQuery, SeriesCount, SeriesData, + SeriesInfo, SeriesParam, SeriesSelection, SeriesWithIndex, +}; + +use crate::{CacheStrategy, extended::TransformResponseExtended}; + +use super::AppState; + +mod bulk; +mod data; +pub mod legacy; + +/// Maximum allowed request weight in bytes (650KB) +const MAX_WEIGHT: usize = 65 * 10_000; +/// Maximum allowed request weight for localhost (50MB) +const MAX_WEIGHT_LOCALHOST: usize = 50 * 1_000_000; +/// Cache control header for series data responses +const CACHE_CONTROL: &str = "public, max-age=1, must-revalidate"; + +/// Returns the max weight for a request based on the client address. +/// Localhost requests get a generous limit, external requests get a stricter one. +fn max_weight(addr: &SocketAddr) -> usize { + if addr.ip().is_loopback() { + MAX_WEIGHT_LOCALHOST + } else { + MAX_WEIGHT + } +} + +pub trait ApiSeriesRoutes { + fn add_series_routes(self) -> Self; +} + +impl ApiSeriesRoutes for ApiRouter { + fn add_series_routes(self) -> Self { + self.api_route( + "/api/series", + get_with( + async |uri: Uri, headers: HeaderMap, State(state): State| { + state.cached_json(&headers, CacheStrategy::Static, &uri, |q| Ok(q.series_catalog().clone())).await + }, + |op| op + .id("get_series_tree") + .series_tag() + .summary("Series catalog") + .description( + "Returns the complete hierarchical catalog of available series organized as a tree structure. \ + Series are grouped by categories and subcategories." + ) + .ok_response::() + .not_modified(), + ), + ) + .api_route( + "/api/series/count", + get_with( + async | + uri: Uri, + headers: HeaderMap, + State(state): State + | { + state.cached_json(&headers, CacheStrategy::Static, &uri, |q| Ok(q.series_count())).await + }, + |op| op + .id("get_series_count") + .series_tag() + .summary("Series count") + .description("Returns the number of series available per index type.") + .ok_response::>() + .not_modified(), + ), + ) + .api_route( + "/api/series/indexes", + get_with( + async | + uri: Uri, + headers: HeaderMap, + State(state): State + | { + state.cached_json(&headers, CacheStrategy::Static, &uri, |q| Ok(q.indexes().to_vec())).await + }, + |op| op + .id("get_indexes") + .series_tag() + .summary("List available indexes") + .description( + "Returns all available indexes with their accepted query aliases. Use any alias when querying series." + ) + .ok_response::>() + .not_modified(), + ), + ) + .api_route( + "/api/series/list", + get_with( + async | + uri: Uri, + headers: HeaderMap, + State(state): State, + Query(pagination): Query + | { + state.cached_json(&headers, CacheStrategy::Static, &uri, move |q| Ok(q.series_list(pagination))).await + }, + |op| op + .id("list_series") + .series_tag() + .summary("Series list") + .description("Paginated flat list of all available series names. Use `page` query param for pagination.") + .ok_response::() + .not_modified(), + ), + ) + .api_route( + "/api/series/search", + get_with( + async | + uri: Uri, + headers: HeaderMap, + State(state): State, + Query(query): Query + | { + state.cached_json(&headers, CacheStrategy::Static, &uri, move |q| Ok(q.search_series(&query))).await + }, + |op| op + .id("search_series") + .series_tag() + .summary("Search series") + .description("Fuzzy search for series by name. Supports partial matches and typos.") + .ok_response::>() + .not_modified() + .server_error(), + ), + ) + .api_route( + "/api/series/{series}", + get_with( + async | + uri: Uri, + headers: HeaderMap, + State(state): State, + Path(path): Path + | { + state.cached_json(&headers, CacheStrategy::Static, &uri, move |q| { + q.series_info(&path.series).ok_or_else(|| q.series_not_found_error(&path.series)) + }).await + }, + |op| op + .id("get_series_info") + .series_tag() + .summary("Get series info") + .description( + "Returns the supported indexes and value type for the specified series." + ) + .ok_response::() + .not_modified() + .not_found() + .server_error(), + ), + ) + .api_route( + "/api/series/{series}/{index}", + get_with( + async |uri: Uri, + headers: HeaderMap, + addr: Extension, + state: State, + Path(path): Path, + Query(range): Query| + -> Response { + data::handler( + uri, + headers, + addr, + Query(SeriesSelection::from((path.index, path.series, range))), + state, + ) + .await + .into_response() + }, + |op| op + .id("get_series") + .series_tag() + .summary("Get series data") + .description( + "Fetch data for a specific series at the given index. \ + Use query parameters to filter by date range and format (json/csv)." + ) + .ok_response::() + .csv_response() + .not_modified() + .not_found(), + ), + ) + .api_route( + "/api/series/{series}/{index}/data", + get_with( + async |uri: Uri, + headers: HeaderMap, + addr: Extension, + state: State, + Path(path): Path, + Query(range): Query| + -> Response { + data::raw_handler( + uri, + headers, + addr, + Query(SeriesSelection::from((path.index, path.series, range))), + state, + ) + .await + .into_response() + }, + |op| op + .id("get_series_data") + .series_tag() + .summary("Get raw series data") + .description( + "Returns just the data array without the SeriesData wrapper. \ + Supports the same range and format parameters as the standard endpoint." + ) + .ok_response::>() + .csv_response() + .not_modified() + .not_found(), + ), + ) + .api_route( + "/api/series/{series}/{index}/latest", + get_with( + async |uri: Uri, + headers: HeaderMap, + State(state): State, + Path(path): Path| { + state + .cached_json(&headers, CacheStrategy::Height, &uri, move |q| { + q.latest(&path.series, path.index) + }) + .await + }, + |op| op + .id("get_series_latest") + .series_tag() + .summary("Get latest series value") + .description( + "Returns the single most recent value for a series, unwrapped (not inside a SeriesData object)." + ) + .ok_response::() + .not_found(), + ), + ) + .api_route( + "/api/series/{series}/{index}/len", + get_with( + async |uri: Uri, + headers: HeaderMap, + State(state): State, + Path(path): Path| { + state + .cached_json(&headers, CacheStrategy::Height, &uri, move |q| { + q.len(&path.series, path.index) + }) + .await + }, + |op| op + .id("get_series_len") + .series_tag() + .summary("Get series data length") + .description("Returns the total number of data points for a series at the given index.") + .ok_response::() + .not_found(), + ), + ) + .api_route( + "/api/series/{series}/{index}/version", + get_with( + async |uri: Uri, + headers: HeaderMap, + State(state): State, + Path(path): Path| { + state + .cached_json(&headers, CacheStrategy::Height, &uri, move |q| { + q.version(&path.series, path.index) + }) + .await + }, + |op| op + .id("get_series_version") + .series_tag() + .summary("Get series version") + .description("Returns the current version of a series. Changes when the series data is updated.") + .ok_response::() + .not_found(), + ), + ) + .api_route( + "/api/series/bulk", + get_with( + |uri, headers, addr, query, state| async move { + bulk::handler(uri, headers, addr, query, state).await.into_response() + }, + |op| op + .id("get_series_bulk") + .series_tag() + .summary("Bulk series data") + .description( + "Fetch multiple series in a single request. Supports filtering by index and date range. \ + Returns an array of SeriesData objects. For a single series, use `get_series` instead." + ) + .ok_response::>() + .csv_response() + .not_modified(), + ), + ) + // Cost basis distribution endpoints + .api_route( + "/api/series/cost-basis", + get_with( + async |uri: Uri, headers: HeaderMap, State(state): State| { + state + .cached_json(&headers, CacheStrategy::Static, &uri, |q| q.cost_basis_cohorts()) + .await + }, + |op| { + op.id("get_cost_basis_cohorts") + .series_tag() + .summary("Available cost basis cohorts") + .description("List available cohorts for cost basis distribution.") + .ok_response::>() + .server_error() + }, + ), + ) + .api_route( + "/api/series/cost-basis/{cohort}/dates", + get_with( + async |uri: Uri, + headers: HeaderMap, + Path(params): Path, + State(state): State| { + state + .cached_json(&headers, CacheStrategy::Height, &uri, move |q| { + q.cost_basis_dates(¶ms.cohort) + }) + .await + }, + |op| { + op.id("get_cost_basis_dates") + .series_tag() + .summary("Available cost basis dates") + .description("List available dates for a cohort's cost basis distribution.") + .ok_response::>() + .not_found() + .server_error() + }, + ), + ) + .api_route( + "/api/series/cost-basis/{cohort}/{date}", + get_with( + async |uri: Uri, + headers: HeaderMap, + Path(params): Path, + Query(query): Query, + State(state): State| { + state + .cached_json(&headers, CacheStrategy::Static, &uri, move |q| { + q.cost_basis_formatted( + ¶ms.cohort, + params.date, + query.bucket, + query.value, + ) + }) + .await + }, + |op| { + op.id("get_cost_basis") + .series_tag() + .summary("Cost basis distribution") + .description( + "Get the cost basis distribution for a cohort on a specific date.\n\n\ + Query params:\n\ + - `bucket`: raw (default), lin200, lin500, lin1000, log10, log50, log100\n\ + - `value`: supply (default, in BTC), realized (USD), unrealized (USD)", + ) + .ok_response::() + .not_found() + .server_error() + }, + ), + ) + } +} diff --git a/crates/brk_server/src/cache.rs b/crates/brk_server/src/cache.rs index bbeb8172f..d5de5d0e9 100644 --- a/crates/brk_server/src/cache.rs +++ b/crates/brk_server/src/cache.rs @@ -8,7 +8,7 @@ pub enum CacheStrategy { /// Etag = VERSION-{height}, Cache-Control: must-revalidate Height, - /// Static/immutable data (blocks by hash, validate-address, metrics catalog) + /// Static/immutable data (blocks by hash, validate-address, series catalog) /// Etag = VERSION only, Cache-Control: must-revalidate Static, diff --git a/crates/brk_server/src/error.rs b/crates/brk_server/src/error.rs index 03c71e800..b166d0eba 100644 --- a/crates/brk_server/src/error.rs +++ b/crates/brk_server/src/error.rs @@ -23,7 +23,7 @@ struct ErrorDetail { /// Error category: "invalid_request", "forbidden", "not_found", "unavailable", or "internal" #[schemars(with = "String")] r#type: &'static str, - /// Machine-readable error code (e.g. "invalid_address", "metric_not_found") + /// Machine-readable error code (e.g. "invalid_address", "series_not_found") #[schemars(with = "String")] code: &'static str, /// Human-readable description @@ -50,8 +50,8 @@ fn error_status(e: &BrkError) -> StatusCode { | BrkError::InvalidAddress | BrkError::UnsupportedType(_) | BrkError::Parse(_) - | BrkError::NoMetrics - | BrkError::MetricUnsupportedIndex { .. } + | BrkError::NoSeries + | BrkError::SeriesUnsupportedIndex { .. } | BrkError::WeightExceeded { .. } => StatusCode::BAD_REQUEST, BrkError::UnknownAddress @@ -59,7 +59,7 @@ fn error_status(e: &BrkError) -> StatusCode { | BrkError::NotFound(_) | BrkError::NoData | BrkError::OutOfRange(_) - | BrkError::MetricNotFound(_) => StatusCode::NOT_FOUND, + | BrkError::SeriesNotFound(_) => StatusCode::NOT_FOUND, BrkError::AuthFailed => StatusCode::FORBIDDEN, BrkError::MempoolNotAvailable => StatusCode::SERVICE_UNAVAILABLE, @@ -75,15 +75,15 @@ fn error_code(e: &BrkError) -> &'static str { BrkError::InvalidNetwork => "invalid_network", BrkError::UnsupportedType(_) => "unsupported_type", BrkError::Parse(_) => "parse_error", - BrkError::NoMetrics => "no_metrics", - BrkError::MetricUnsupportedIndex { .. } => "metric_unsupported_index", + BrkError::NoSeries => "no_series", + BrkError::SeriesUnsupportedIndex { .. } => "series_unsupported_index", BrkError::WeightExceeded { .. } => "weight_exceeded", BrkError::UnknownAddress => "unknown_address", BrkError::UnknownTxid => "unknown_txid", BrkError::NotFound(_) => "not_found", BrkError::OutOfRange(_) => "out_of_range", BrkError::NoData => "no_data", - BrkError::MetricNotFound(_) => "metric_not_found", + BrkError::SeriesNotFound(_) => "series_not_found", BrkError::MempoolNotAvailable => "mempool_not_available", BrkError::AuthFailed => "auth_failed", _ => "internal_error", diff --git a/crates/brk_server/src/extended/transform_operation.rs b/crates/brk_server/src/extended/transform_operation.rs index 085196305..47a2c67f0 100644 --- a/crates/brk_server/src/extended/transform_operation.rs +++ b/crates/brk_server/src/extended/transform_operation.rs @@ -11,6 +11,7 @@ pub trait TransformResponseExtended<'t> { fn mempool_tag(self) -> Self; fn metrics_tag(self) -> Self; fn mining_tag(self) -> Self; + fn series_tag(self) -> Self; fn server_tag(self) -> Self; fn transactions_tag(self) -> Self; @@ -55,6 +56,10 @@ impl<'t> TransformResponseExtended<'t> for TransformOperation<'t> { self.tag("Metrics") } + fn series_tag(self) -> Self { + self.tag("Series") + } + fn mining_tag(self) -> Self { self.tag("Mining") } diff --git a/crates/brk_traversable/src/lib.rs b/crates/brk_traversable/src/lib.rs index def482ea4..68e0cb740 100644 --- a/crates/brk_traversable/src/lib.rs +++ b/crates/brk_traversable/src/lib.rs @@ -1,6 +1,6 @@ use std::{collections::BTreeMap, fmt::Display}; -pub use brk_types::{Index, MetricLeaf, MetricLeafWithSchema, TreeNode}; +pub use brk_types::{Index, SeriesLeaf, SeriesLeafWithSchema, TreeNode}; pub use indexmap::IndexMap; #[cfg(feature = "derive")] @@ -18,13 +18,13 @@ pub trait Traversable { fn iter_any_exportable(&self) -> impl Iterator; } -/// Helper to create a MetricLeafWithSchema from a vec +/// Helper to create a SeriesLeafWithSchema from a vec fn make_leaf(vec: &V) -> TreeNode { let index_str = I::to_string(); let index = Index::try_from(index_str).ok(); let indexes = index.into_iter().collect(); - let leaf = MetricLeaf::new( + let leaf = SeriesLeaf::new( vec.name().to_string(), vec.value_type_to_string().to_string(), indexes, @@ -33,7 +33,7 @@ fn make_leaf(vec: &V) -> TreeNode { let schema = schemars::SchemaGenerator::default().into_root_schema_for::(); let schema_json = serde_json::to_value(schema).unwrap_or_default(); - TreeNode::Leaf(MetricLeafWithSchema::new(leaf, schema_json)) + TreeNode::Leaf(SeriesLeafWithSchema::new(leaf, schema_json)) } // BytesVec implementation diff --git a/crates/brk_types/src/etag.rs b/crates/brk_types/src/etag.rs index af0ae3be2..020e25d9b 100644 --- a/crates/brk_types/src/etag.rs +++ b/crates/brk_types/src/etag.rs @@ -40,14 +40,14 @@ impl From<&str> for Etag { } impl Etag { - /// Create ETag from metric data response info. + /// Create ETag from series data response info. /// /// Format varies based on whether the slice touches the end: - /// - Slice ends before total: `{version:x}-{start}-{end}` (len irrelevant, data won't change if metric grows) + /// - Slice ends before total: `{version:x}-{start}-{end}` (len irrelevant, data won't change if series grows) /// - Slice reaches the end: `{version:x}-{start}-{total}-{height}` (includes height since last value may be recomputed each block) /// - /// `version` is the metric version for single queries, or the sum of versions for bulk queries. - pub fn from_metric( + /// `version` is the series version for single queries, or the sum of versions for bulk queries. + pub fn from_series( version: super::Version, total: usize, start: usize, diff --git a/crates/brk_types/src/index.rs b/crates/brk_types/src/index.rs index 4523124ab..d3739e563 100644 --- a/crates/brk_types/src/index.rs +++ b/crates/brk_types/src/index.rs @@ -15,7 +15,7 @@ use super::{ minute10::MINUTE10_INTERVAL, minute30::MINUTE30_INTERVAL, timestamp::INDEX_EPOCH, }; -/// Aggregation dimension for querying metrics. Includes time-based (date, week, month, year), +/// Aggregation dimension for querying series. Includes time-based (date, week, month, year), /// block-based (height, tx_index), and address/output type indexes. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, JsonSchema)] #[serde(rename_all = "lowercase")] diff --git a/crates/brk_types/src/lib.rs b/crates/brk_types/src/lib.rs index d0c93f80b..9858d72b8 100644 --- a/crates/brk_types/src/lib.rs +++ b/crates/brk_types/src/lib.rs @@ -89,17 +89,17 @@ mod limit_param; mod mempool_block; mod mempool_entry_info; mod mempool_info; -mod metric; -mod metric_count; -mod metric_data; -mod metric_info; -mod metric_output; -mod metric_param; -mod metrics; -mod metric_selection; -mod metric_selection_legacy; -mod metrics_paginated; -mod metric_with_index; +mod series; +mod series_count; +mod series_data; +mod series_info; +mod series_output; +mod series_param; +mod series_list; +mod series_selection; +mod series_selection_legacy; +mod series_paginated; +mod series_with_index; mod minute10; mod minute30; mod month1; @@ -284,17 +284,17 @@ pub use limit_param::*; pub use mempool_block::*; pub use mempool_entry_info::*; pub use mempool_info::*; -pub use metric::*; -pub use metric_count::*; -pub use metric_data::*; -pub use metric_info::*; -pub use metric_output::*; -pub use metric_param::*; -pub use metrics::*; -pub use metric_selection::*; -pub use metric_selection_legacy::*; -pub use metrics_paginated::*; -pub use metric_with_index::*; +pub use series::*; +pub use series_count::*; +pub use series_data::*; +pub use series_info::*; +pub use series_output::*; +pub use series_param::*; +pub use series_list::*; +pub use series_selection::*; +pub use series_selection_legacy::*; +pub use series_paginated::*; +pub use series_with_index::*; pub use minute10::*; pub use minute30::*; pub use month1::*; diff --git a/crates/brk_types/src/metric_selection.rs b/crates/brk_types/src/metric_selection.rs deleted file mode 100644 index c3abf7136..000000000 --- a/crates/brk_types/src/metric_selection.rs +++ /dev/null @@ -1,43 +0,0 @@ -use derive_more::Deref; -use schemars::JsonSchema; -use serde::Deserialize; - -use crate::{DataRangeFormat, Index, Metric, Metrics}; - -/// Selection of metrics to query -#[derive(Debug, Deref, Deserialize, JsonSchema)] -pub struct MetricSelection { - /// Requested metrics - #[serde(alias = "m")] - pub metrics: Metrics, - - /// Index to query - #[serde(alias = "i")] - pub index: Index, - - #[deref] - #[serde(flatten)] - pub range: DataRangeFormat, -} - -impl From<(Index, Metric, DataRangeFormat)> for MetricSelection { - #[inline] - fn from((index, metric, range): (Index, Metric, DataRangeFormat)) -> Self { - Self { - index, - metrics: Metrics::from(metric), - range, - } - } -} - -impl From<(Index, Metrics, DataRangeFormat)> for MetricSelection { - #[inline] - fn from((index, metrics, range): (Index, Metrics, DataRangeFormat)) -> Self { - Self { - index, - metrics, - range, - } - } -} diff --git a/crates/brk_types/src/metric_selection_legacy.rs b/crates/brk_types/src/metric_selection_legacy.rs deleted file mode 100644 index b895133ab..000000000 --- a/crates/brk_types/src/metric_selection_legacy.rs +++ /dev/null @@ -1,26 +0,0 @@ -use schemars::JsonSchema; -use serde::Deserialize; - -use crate::{DataRangeFormat, Index, MetricSelection, Metrics}; - -/// Legacy metric selection parameters (deprecated) -#[derive(Debug, Deserialize, JsonSchema)] -pub struct MetricSelectionLegacy { - #[serde(alias = "i")] - pub index: Index, - #[serde(alias = "v")] - pub ids: Metrics, - #[serde(flatten)] - pub range: DataRangeFormat, -} - -impl From for MetricSelection { - #[inline] - fn from(value: MetricSelectionLegacy) -> Self { - MetricSelection { - index: value.index, - metrics: value.ids, - range: value.range, - } - } -} diff --git a/crates/brk_types/src/metric_with_index.rs b/crates/brk_types/src/metric_with_index.rs deleted file mode 100644 index deed228a7..000000000 --- a/crates/brk_types/src/metric_with_index.rs +++ /dev/null @@ -1,37 +0,0 @@ -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; - -use crate::{Index, Metric}; - -#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] -pub struct MetricWithIndex { - /// Metric name - pub metric: Metric, - - /// Aggregation index - pub index: Index, -} - -impl MetricWithIndex { - pub fn new(metric: impl Into, index: Index) -> Self { - Self { - metric: metric.into(), - index, - } - } -} - -impl From<(Metric, Index)> for MetricWithIndex { - fn from((metric, index): (Metric, Index)) -> Self { - Self { metric, index } - } -} - -impl From<(&str, Index)> for MetricWithIndex { - fn from((metric, index): (&str, Index)) -> Self { - Self { - metric: metric.into(), - index, - } - } -} diff --git a/crates/brk_types/src/output.rs b/crates/brk_types/src/output.rs index 0b81be7a1..853bc305b 100644 --- a/crates/brk_types/src/output.rs +++ b/crates/brk_types/src/output.rs @@ -1,6 +1,6 @@ use crate::Format; -/// Metric data output format +/// Series data output format #[derive(Debug)] pub enum Output { Json(Vec), diff --git a/crates/brk_types/src/pool_slug.rs b/crates/brk_types/src/pool_slug.rs index da5793485..a316aacb3 100644 --- a/crates/brk_types/src/pool_slug.rs +++ b/crates/brk_types/src/pool_slug.rs @@ -377,7 +377,7 @@ pub enum PoolSlug { } impl PoolSlug { - /// Pools with dominance above per-window thresholds get full metrics. + /// Pools with dominance above per-window thresholds get full series. /// Thresholds: all-time>=1.0%, 1y>=1.0%, 1m>=0.75%, 1w>=0.5%. /// Generated by `scripts/pool_major_threshold.py`. pub fn is_major(&self) -> bool { diff --git a/crates/brk_types/src/search_query.rs b/crates/brk_types/src/search_query.rs index 715c4c288..e805c815d 100644 --- a/crates/brk_types/src/search_query.rs +++ b/crates/brk_types/src/search_query.rs @@ -1,12 +1,12 @@ use schemars::JsonSchema; use serde::Deserialize; -use crate::{Limit, Metric}; +use crate::{Limit, Series}; #[derive(Debug, Deserialize, JsonSchema)] pub struct SearchQuery { /// Search query string - pub q: Metric, + pub q: Series, /// Maximum number of results #[serde(default)] pub limit: Limit, diff --git a/crates/brk_types/src/metric.rs b/crates/brk_types/src/series.rs similarity index 65% rename from crates/brk_types/src/metric.rs rename to crates/brk_types/src/series.rs index 0b6f6b124..412a60984 100644 --- a/crates/brk_types/src/metric.rs +++ b/crates/brk_types/src/series.rs @@ -4,7 +4,7 @@ use derive_more::Deref; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -/// Metric name +/// Series name #[derive(Debug, Clone, Deref, Serialize, Deserialize, JsonSchema)] #[serde(transparent)] #[schemars( @@ -13,23 +13,23 @@ use serde::{Deserialize, Serialize}; example = &"market_cap", example = &"realized_price" )] -pub struct Metric(String); +pub struct Series(String); -impl From for Metric { +impl From for Series { #[inline] - fn from(metric: String) -> Self { - Self(metric) + fn from(series: String) -> Self { + Self(series) } } -impl From<&str> for Metric { +impl From<&str> for Series { #[inline] - fn from(metric: &str) -> Self { - Self(metric.to_owned()) + fn from(series: &str) -> Self { + Self(series.to_owned()) } } -impl Display for Metric { +impl Display for Series { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0) } diff --git a/crates/brk_types/src/metric_count.rs b/crates/brk_types/src/series_count.rs similarity index 59% rename from crates/brk_types/src/metric_count.rs rename to crates/brk_types/src/series_count.rs index 949d0993f..30d9a3443 100644 --- a/crates/brk_types/src/metric_count.rs +++ b/crates/brk_types/src/series_count.rs @@ -4,26 +4,26 @@ use rustc_hash::FxHashSet; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -/// Metric count statistics - distinct metrics and total metric-index combinations +/// Series count statistics - distinct series and total series-index combinations #[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema)] -pub struct MetricCount { - /// Number of unique metrics available (e.g., realized_price, market_cap) +pub struct SeriesCount { + /// Number of unique series available (e.g., realized_price, market_cap) #[schemars(example = 3141)] - pub distinct_metrics: usize, - /// Total number of metric-index combinations across all timeframes + pub distinct_series: usize, + /// Total number of series-index combinations across all timeframes #[schemars(example = 21000)] pub total_endpoints: usize, - /// Number of lazy (computed on-the-fly) metric-index combinations + /// Number of lazy (computed on-the-fly) series-index combinations #[schemars(example = 5000)] pub lazy_endpoints: usize, - /// Number of eager (stored on disk) metric-index combinations + /// Number of eager (stored on disk) series-index combinations #[schemars(example = 16000)] pub stored_endpoints: usize, #[serde(skip)] seen: FxHashSet, } -impl MetricCount { +impl SeriesCount { pub fn add_endpoint(&mut self, name: &str, is_lazy: bool) { self.total_endpoints += 1; if is_lazy { @@ -32,17 +32,17 @@ impl MetricCount { self.stored_endpoints += 1; } if self.seen.insert(name.to_string()) { - self.distinct_metrics += 1; + self.distinct_series += 1; } } } -/// Detailed metric count with per-database breakdown +/// Detailed series count with per-database breakdown #[derive(Debug, Serialize, Deserialize, JsonSchema)] -pub struct DetailedMetricCount { +pub struct DetailedSeriesCount { /// Aggregate counts #[serde(flatten)] - pub total: MetricCount, + pub total: SeriesCount, /// Per-database breakdown of counts - pub by_db: BTreeMap, + pub by_db: BTreeMap, } diff --git a/crates/brk_types/src/metric_data.rs b/crates/brk_types/src/series_data.rs similarity index 82% rename from crates/brk_types/src/metric_data.rs rename to crates/brk_types/src/series_data.rs index 296dce5c4..e3b4905a7 100644 --- a/crates/brk_types/src/metric_data.rs +++ b/crates/brk_types/src/series_data.rs @@ -7,20 +7,20 @@ use vecdb::AnySerializableVec; use super::{Date, Index, Timestamp, Version}; -/// Metric data with range information. +/// Series data with range information. /// -/// All metric data endpoints return this structure when format is JSON. -/// This type is not instantiated - use `MetricData::serialize()` to write JSON bytes directly. +/// All series data endpoints return this structure when format is JSON. +/// This type is not instantiated - use `SeriesData::serialize()` to write JSON bytes directly. #[derive(Debug, JsonSchema, Deserialize)] -pub struct MetricData { - /// Version of the metric data +pub struct SeriesData { + /// Version of the series data pub version: Version, /// The index type used for this query pub index: Index, /// Value type (e.g. "f32", "u64", "Sats") #[serde(rename = "type", default)] pub value_type: String, - /// Total number of data points in the metric + /// Total number of data points in the series pub total: usize, /// Start index (inclusive) of the returned range pub start: usize, @@ -28,12 +28,12 @@ pub struct MetricData { pub end: usize, /// ISO 8601 timestamp of when the response was generated pub stamp: String, - /// The metric data + /// The series data pub data: Vec, } -impl MetricData { - /// Write metric data as JSON to buffer: `{"version":N,"index":"...","total":N,"start":N,"end":N,"stamp":"...","data":[...]}` +impl SeriesData { + /// Write series data as JSON to buffer: `{"version":N,"index":"...","total":N,"start":N,"end":N,"stamp":"...","data":[...]}` pub fn serialize( vec: &dyn AnySerializableVec, index: Index, @@ -69,13 +69,13 @@ impl MetricData { } } -impl MetricData { +impl SeriesData { /// Returns an iterator over the index range. pub fn indexes(&self) -> std::ops::Range { self.start..self.end } - /// Returns true if this metric uses a date-based index. + /// Returns true if this series uses a date-based index. pub fn is_date_based(&self) -> bool { self.index.is_date_based() } @@ -122,16 +122,16 @@ impl MetricData { } } -/// Metric data that is guaranteed to use a date-based index. +/// Series data that is guaranteed to use a date-based index. /// -/// This is a newtype around `MetricData` that guarantees `is_date_based()` is true, +/// This is a newtype around `SeriesData` that guarantees `is_date_based()` is true, /// making date methods infallible. #[derive(Debug)] -pub struct DateMetricData(MetricData); +pub struct DateSeriesData(SeriesData); -impl DateMetricData { - /// Create a `DateMetricData` from a `MetricData`, returning `Err` if the index is not date-based. - pub fn try_new(inner: MetricData) -> Result> { +impl DateSeriesData { + /// Create a `DateSeriesData` from a `SeriesData`, returning `Err` if the index is not date-based. + pub fn try_new(inner: SeriesData) -> Result> { if inner.is_date_based() { Ok(Self(inner)) } else { @@ -139,8 +139,8 @@ impl DateMetricData { } } - /// Consume and return the inner `MetricData`. - pub fn into_inner(self) -> MetricData { + /// Consume and return the inner `SeriesData`. + pub fn into_inner(self) -> SeriesData { self.0 } @@ -161,7 +161,7 @@ impl DateMetricData { pub fn timestamps(&self) -> impl Iterator + '_ { self.0 .timestamps() - .expect("DateMetricData is always date-based") + .expect("DateSeriesData is always date-based") } /// Iterate over (timestamp, &value) pairs (infallible). @@ -169,23 +169,23 @@ impl DateMetricData { pub fn iter_timestamps(&self) -> impl Iterator + '_ { self.0 .iter_timestamps() - .expect("DateMetricData is always date-based") + .expect("DateSeriesData is always date-based") } } -impl Deref for DateMetricData { - type Target = MetricData; +impl Deref for DateSeriesData { + type Target = SeriesData; fn deref(&self) -> &Self::Target { &self.0 } } -impl<'de, T: DeserializeOwned> Deserialize<'de> for DateMetricData { +impl<'de, T: DeserializeOwned> Deserialize<'de> for DateSeriesData { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { - let inner = MetricData::::deserialize(deserializer)?; + let inner = SeriesData::::deserialize(deserializer)?; Self::try_new(inner).map_err(|m| { serde::de::Error::custom(format!("expected date-based index, got {:?}", m.index)) }) diff --git a/crates/brk_types/src/metric_info.rs b/crates/brk_types/src/series_info.rs similarity index 86% rename from crates/brk_types/src/metric_info.rs rename to crates/brk_types/src/series_info.rs index 670f1af38..80f9acd12 100644 --- a/crates/brk_types/src/metric_info.rs +++ b/crates/brk_types/src/series_info.rs @@ -5,9 +5,9 @@ use serde::{Deserialize, Serialize}; use crate::Index; -/// Metadata about a metric +/// Metadata about a series #[derive(Debug, Serialize, Deserialize, JsonSchema)] -pub struct MetricInfo { +pub struct SeriesInfo { /// Available indexes pub indexes: Vec, /// Value type (e.g. "f32", "u64", "Sats") diff --git a/crates/brk_types/src/metrics.rs b/crates/brk_types/src/series_list.rs similarity index 82% rename from crates/brk_types/src/metrics.rs rename to crates/brk_types/src/series_list.rs index 0b0cf4be8..1921ee962 100644 --- a/crates/brk_types/src/metrics.rs +++ b/crates/brk_types/src/series_list.rs @@ -4,9 +4,9 @@ use derive_more::Deref; use schemars::JsonSchema; use serde::Deserialize; -use super::Metric; +use super::Series; -/// Comma-separated list of metric names +/// Comma-separated list of series names #[derive(Debug, Deref, JsonSchema)] #[schemars( with = "String", @@ -15,38 +15,38 @@ use super::Metric; example = &"price_close,market_cap", example = &"realized_price,market_cap,mvrv" )] -pub struct Metrics(Vec); +pub struct SeriesList(Vec); const MAX_VECS: usize = 32; const MAX_STRING_SIZE: usize = 64 * MAX_VECS; -impl From for Metrics { +impl From for SeriesList { #[inline] - fn from(metric: Metric) -> Self { - Self(vec![metric]) + fn from(series: Series) -> Self { + Self(vec![series]) } } -impl From for Metrics { +impl From for SeriesList { #[inline] fn from(value: String) -> Self { - Self::from(Metric::from(value.replace("-", "_").to_lowercase())) + Self::from(Series::from(value.replace("-", "_").to_lowercase())) } } -impl<'a> From> for Metrics { +impl<'a> From> for SeriesList { #[inline] fn from(value: Vec<&'a str>) -> Self { Self( value .iter() - .map(|s| Metric::from(s.replace("-", "_").to_lowercase())) + .map(|s| Series::from(s.replace("-", "_").to_lowercase())) .collect::>(), ) } } -impl<'de> Deserialize<'de> for Metrics { +impl<'de> Deserialize<'de> for SeriesList { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, @@ -58,7 +58,7 @@ impl<'de> Deserialize<'de> for Metrics { Ok(Self( sanitize(str.split(",").map(|s| s.to_string())) .into_iter() - .map(Metric::from) + .map(Series::from) .collect(), )) } else { @@ -69,7 +69,7 @@ impl<'de> Deserialize<'de> for Metrics { Ok(Self( sanitize(vec.iter().filter_map(|s| s.as_str().map(String::from))) .into_iter() - .map(Metric::from) + .map(Series::from) .collect(), )) } else { @@ -81,7 +81,7 @@ impl<'de> Deserialize<'de> for Metrics { } } -impl fmt::Display for Metrics { +impl fmt::Display for SeriesList { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let s = self .0 diff --git a/crates/brk_types/src/metric_output.rs b/crates/brk_types/src/series_output.rs similarity index 65% rename from crates/brk_types/src/metric_output.rs rename to crates/brk_types/src/series_output.rs index 05a6648f5..291118680 100644 --- a/crates/brk_types/src/metric_output.rs +++ b/crates/brk_types/src/series_output.rs @@ -1,8 +1,8 @@ use crate::{Output, OutputLegacy, Version}; -/// Metric output with metadata for caching. +/// Series output with metadata for caching. #[derive(Debug)] -pub struct MetricOutput { +pub struct SeriesOutput { pub output: Output, pub version: Version, pub total: usize, @@ -10,9 +10,9 @@ pub struct MetricOutput { pub end: usize, } -/// Deprecated: Legacy metric output with metadata for caching. +/// Deprecated: Legacy series output with metadata for caching. #[derive(Debug)] -pub struct MetricOutputLegacy { +pub struct SeriesOutputLegacy { pub output: OutputLegacy, pub version: Version, pub total: usize, diff --git a/crates/brk_types/src/metrics_paginated.rs b/crates/brk_types/src/series_paginated.rs similarity index 72% rename from crates/brk_types/src/metrics_paginated.rs rename to crates/brk_types/src/series_paginated.rs index f4ec20926..a5233def8 100644 --- a/crates/brk_types/src/metrics_paginated.rs +++ b/crates/brk_types/src/series_paginated.rs @@ -3,21 +3,21 @@ use std::borrow::Cow; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -/// A paginated list of available metric names (1000 per page) +/// A paginated list of available series names (1000 per page) #[derive(Debug, Serialize, Deserialize, JsonSchema)] -pub struct PaginatedMetrics { +pub struct PaginatedSeries { /// Current page number (0-indexed) #[schemars(example = 0)] pub current_page: usize, /// Maximum valid page index (0-indexed) #[schemars(example = 21)] pub max_page: usize, - /// Total number of metrics + /// Total number of series pub total_count: usize, /// Results per page pub per_page: usize, /// Whether more pages are available after the current one pub has_more: bool, - /// List of metric names - pub metrics: Vec>, + /// List of series names + pub series: Vec>, } diff --git a/crates/brk_types/src/metric_param.rs b/crates/brk_types/src/series_param.rs similarity index 56% rename from crates/brk_types/src/metric_param.rs rename to crates/brk_types/src/series_param.rs index 2ea7dcd0c..268f0f06d 100644 --- a/crates/brk_types/src/metric_param.rs +++ b/crates/brk_types/src/series_param.rs @@ -1,9 +1,9 @@ use schemars::JsonSchema; use serde::Deserialize; -use crate::Metric; +use crate::Series; #[derive(Deserialize, JsonSchema)] -pub struct MetricParam { - pub metric: Metric, +pub struct SeriesParam { + pub series: Series, } diff --git a/crates/brk_types/src/series_selection.rs b/crates/brk_types/src/series_selection.rs new file mode 100644 index 000000000..16003b758 --- /dev/null +++ b/crates/brk_types/src/series_selection.rs @@ -0,0 +1,43 @@ +use derive_more::Deref; +use schemars::JsonSchema; +use serde::Deserialize; + +use crate::{DataRangeFormat, Index, Series, SeriesList}; + +/// Selection of series to query +#[derive(Debug, Deref, Deserialize, JsonSchema)] +pub struct SeriesSelection { + /// Requested series + #[serde(alias = "m", alias = "metrics")] + pub series: SeriesList, + + /// Index to query + #[serde(alias = "i")] + pub index: Index, + + #[deref] + #[serde(flatten)] + pub range: DataRangeFormat, +} + +impl From<(Index, Series, DataRangeFormat)> for SeriesSelection { + #[inline] + fn from((index, series, range): (Index, Series, DataRangeFormat)) -> Self { + Self { + index, + series: SeriesList::from(series), + range, + } + } +} + +impl From<(Index, SeriesList, DataRangeFormat)> for SeriesSelection { + #[inline] + fn from((index, series, range): (Index, SeriesList, DataRangeFormat)) -> Self { + Self { + index, + series, + range, + } + } +} diff --git a/crates/brk_types/src/series_selection_legacy.rs b/crates/brk_types/src/series_selection_legacy.rs new file mode 100644 index 000000000..f89832cce --- /dev/null +++ b/crates/brk_types/src/series_selection_legacy.rs @@ -0,0 +1,26 @@ +use schemars::JsonSchema; +use serde::Deserialize; + +use crate::{DataRangeFormat, Index, SeriesList, SeriesSelection}; + +/// Legacy series selection parameters (deprecated) +#[derive(Debug, Deserialize, JsonSchema)] +pub struct SeriesSelectionLegacy { + #[serde(alias = "i")] + pub index: Index, + #[serde(alias = "v")] + pub ids: SeriesList, + #[serde(flatten)] + pub range: DataRangeFormat, +} + +impl From for SeriesSelection { + #[inline] + fn from(value: SeriesSelectionLegacy) -> Self { + SeriesSelection { + index: value.index, + series: value.ids, + range: value.range, + } + } +} diff --git a/crates/brk_types/src/series_with_index.rs b/crates/brk_types/src/series_with_index.rs new file mode 100644 index 000000000..2527f0fc5 --- /dev/null +++ b/crates/brk_types/src/series_with_index.rs @@ -0,0 +1,37 @@ +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +use crate::{Index, Series}; + +#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] +pub struct SeriesWithIndex { + /// Series name + pub series: Series, + + /// Aggregation index + pub index: Index, +} + +impl SeriesWithIndex { + pub fn new(series: impl Into, index: Index) -> Self { + Self { + series: series.into(), + index, + } + } +} + +impl From<(Series, Index)> for SeriesWithIndex { + fn from((series, index): (Series, Index)) -> Self { + Self { series, index } + } +} + +impl From<(&str, Index)> for SeriesWithIndex { + fn from((series, index): (&str, Index)) -> Self { + Self { + series: series.into(), + index, + } + } +} diff --git a/crates/brk_types/src/sync_status.rs b/crates/brk_types/src/sync_status.rs index 392f2aa16..2d6d41d02 100644 --- a/crates/brk_types/src/sync_status.rs +++ b/crates/brk_types/src/sync_status.rs @@ -8,7 +8,7 @@ use crate::{Height, Timestamp}; pub struct SyncStatus { /// Height of the last indexed block pub indexed_height: Height, - /// Height of the last computed block (metrics) + /// Height of the last computed block (series) pub computed_height: Height, /// Height of the chain tip (from Bitcoin node) pub tip_height: Height, diff --git a/crates/brk_types/src/time_period.rs b/crates/brk_types/src/time_period.rs index 7039a57b5..7d37bec94 100644 --- a/crates/brk_types/src/time_period.rs +++ b/crates/brk_types/src/time_period.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; /// Time period for mining statistics. /// /// Used to specify the lookback window for pool statistics, hashrate calculations, -/// and other time-based mining metrics. +/// and other time-based mining series. #[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] pub enum TimePeriod { #[default] diff --git a/crates/brk_types/src/tree_node.rs b/crates/brk_types/src/tree_node.rs index b8a41ed75..9a1d7993e 100644 --- a/crates/brk_types/src/tree_node.rs +++ b/crates/brk_types/src/tree_node.rs @@ -6,18 +6,18 @@ use serde::{Deserialize, Serialize}; use super::Index; -/// Leaf node containing metric metadata +/// Leaf node containing series metadata #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, JsonSchema)] -pub struct MetricLeaf { - /// The metric name/identifier +pub struct SeriesLeaf { + /// The series name/identifier pub name: String, /// The Rust type (e.g., "Sats", "StoredF64") pub kind: String, - /// Available indexes for this metric + /// Available indexes for this series pub indexes: BTreeSet, } -impl MetricLeaf { +impl SeriesLeaf { pub fn new(name: String, kind: String, indexes: BTreeSet) -> Self { Self { name, @@ -27,17 +27,17 @@ impl MetricLeaf { } /// Merge another leaf's indexes into this one (union) - pub fn merge_indexes(&mut self, other: &MetricLeaf) { + pub fn merge_indexes(&mut self, other: &SeriesLeaf) { self.indexes.extend(other.indexes.iter().copied()); } } -/// MetricLeaf with JSON Schema for client generation +/// SeriesLeaf with JSON Schema for client generation #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] -pub struct MetricLeafWithSchema { - /// The core metric metadata +pub struct SeriesLeafWithSchema { + /// The core series metadata #[serde(flatten)] - pub leaf: MetricLeaf, + pub leaf: SeriesLeaf, /// JSON Schema type (e.g., "integer", "number", "string", "boolean", "array", "object") #[serde(rename = "type")] pub openapi_type: String, @@ -92,8 +92,8 @@ fn extract_json_type_inner(node: &serde_json::Value, root: &serde_json::Value) - "object".to_string() } -impl MetricLeafWithSchema { - pub fn new(leaf: MetricLeaf, schema: serde_json::Value) -> Self { +impl SeriesLeafWithSchema { + pub fn new(leaf: SeriesLeaf, schema: serde_json::Value) -> Self { let openapi_type = extract_json_type(&schema); Self { leaf, @@ -107,7 +107,7 @@ impl MetricLeafWithSchema { &self.openapi_type } - /// The metric name/identifier + /// The series name/identifier pub fn name(&self) -> &str { &self.leaf.name } @@ -117,38 +117,38 @@ impl MetricLeafWithSchema { &self.leaf.kind } - /// Available indexes for this metric + /// Available indexes for this series pub fn indexes(&self) -> &BTreeSet { &self.leaf.indexes } - /// Check if this leaf refers to the same metric as another - pub fn is_same_metric(&self, other: &MetricLeafWithSchema) -> bool { + /// Check if this leaf refers to the same series as another + pub fn is_same_series(&self, other: &SeriesLeafWithSchema) -> bool { self.leaf.name == other.leaf.name } /// Merge another leaf's indexes into this one (union) - pub fn merge_indexes(&mut self, other: &MetricLeafWithSchema) { + pub fn merge_indexes(&mut self, other: &SeriesLeafWithSchema) { self.leaf.merge_indexes(&other.leaf); } } -impl PartialEq for MetricLeafWithSchema { +impl PartialEq for SeriesLeafWithSchema { fn eq(&self, other: &Self) -> bool { self.leaf == other.leaf } } -impl Eq for MetricLeafWithSchema {} +impl Eq for SeriesLeafWithSchema {} -/// Hierarchical tree node for organizing metrics into categories +/// Hierarchical tree node for organizing series into categories #[derive(Debug, Clone, Serialize, PartialEq, Eq, Deserialize, JsonSchema)] #[serde(untagged)] pub enum TreeNode { /// Branch node containing subcategories Branch(IndexMap), - /// Leaf node containing metric metadata with schema - Leaf(MetricLeafWithSchema), + /// Leaf node containing series metadata with schema + Leaf(SeriesLeafWithSchema), } const BASE: &str = "raw"; @@ -180,7 +180,7 @@ impl TreeNode { /// Merges all first-level branches into a single flattened structure (consuming version). /// Direct leaves use their key (use #[traversable(rename = "...")] to control). /// Branch children are lifted with their keys. - /// If all resulting children are leaves with the same metric name, collapses to a single leaf. + /// If all resulting children are leaves with the same series name, collapses to a single leaf. /// Returns None if conflicts are found (same key with incompatible values). pub fn merge_branches(self) -> Option { let Self::Branch(tree) = self else { @@ -204,11 +204,11 @@ impl TreeNode { } } - // If all children are leaves with the same metric name, collapse into single leaf + // If all children are leaves with the same series name, collapse into single leaf Some(Self::try_collapse_same_name_leaves(merged)) } - /// If all entries in the map are leaves with the same metric name, + /// If all entries in the map are leaves with the same series name, /// collapse them into a single leaf with merged indexes. fn try_collapse_same_name_leaves(map: IndexMap) -> Self { if map.is_empty() { @@ -216,7 +216,7 @@ impl TreeNode { } // Check if all entries are leaves with the same name - let mut first_leaf: Option<&MetricLeafWithSchema> = None; + let mut first_leaf: Option<&SeriesLeafWithSchema> = None; let mut merged_indexes = BTreeSet::new(); for node in map.values() { @@ -241,8 +241,8 @@ impl TreeNode { // All entries were leaves with the same name let first = first_leaf.unwrap(); - Self::Leaf(MetricLeafWithSchema::new( - MetricLeaf::new( + Self::Leaf(SeriesLeafWithSchema::new( + SeriesLeaf::new( first.name().to_string(), first.kind().to_string(), merged_indexes, @@ -265,7 +265,7 @@ impl TreeNode { } Some(existing) => { match (existing, node) { - (Self::Leaf(a), Self::Leaf(b)) if a.is_same_metric(&b) => { + (Self::Leaf(a), Self::Leaf(b)) if a.is_same_series(&b) => { a.merge_indexes(&b); Some(()) } @@ -313,8 +313,8 @@ mod tests { use super::*; fn leaf(name: &str, index: Index) -> TreeNode { - TreeNode::Leaf(MetricLeafWithSchema { - leaf: MetricLeaf { + TreeNode::Leaf(SeriesLeafWithSchema { + leaf: SeriesLeaf { name: name.to_string(), kind: "TestType".to_string(), indexes: BTreeSet::from([index]), @@ -344,7 +344,7 @@ mod tests { #[test] fn merge_leaf_passthrough() { - let tree = leaf("metric", Index::Height); + let tree = leaf("s", Index::Height); let merged = tree.merge_branches().unwrap(); assert!(matches!(merged, TreeNode::Leaf(_))); } @@ -365,8 +365,8 @@ mod tests { fn merge_direct_leaves_keep_keys() { // Direct leaves with different keys stay separate let tree = branch(vec![ - ("sum", leaf("metric_sum", Index::Height)), - ("cumulative", leaf("metric_cumulative", Index::Height)), + ("sum", leaf("s_sum", Index::Height)), + ("cumulative", leaf("s_cumulative", Index::Height)), ]); let merged = tree.merge_branches().unwrap(); @@ -388,8 +388,8 @@ mod tests { let tree = branch(vec![( "week1", branch(vec![ - ("sum", leaf("metric_sum", Index::Week1)), - ("cumulative", leaf("metric_cumulative", Index::Week1)), + ("sum", leaf("s_sum", Index::Week1)), + ("cumulative", leaf("s_cumulative", Index::Week1)), ]), )]); let merged = tree.merge_branches().unwrap(); @@ -411,15 +411,15 @@ mod tests { ( "week1", branch(vec![ - ("sum", leaf("metric_sum", Index::Week1)), - ("cumulative", leaf("metric_cumulative", Index::Week1)), + ("sum", leaf("s_sum", Index::Week1)), + ("cumulative", leaf("s_cumulative", Index::Week1)), ]), ), ( "month1", branch(vec![ - ("sum", leaf("metric_sum", Index::Month1)), - ("cumulative", leaf("metric_cumulative", Index::Month1)), + ("sum", leaf("s_sum", Index::Month1)), + ("cumulative", leaf("s_cumulative", Index::Month1)), ]), ), ]); @@ -446,12 +446,12 @@ mod tests { // Direct leaf with key "cumulative" merges with lifted "cumulative" from branch // This simulates: height_cumulative (renamed) + day1 branch let tree = branch(vec![ - ("cumulative", leaf("metric_cumulative", Index::Height)), + ("cumulative", leaf("s_cumulative", Index::Height)), ( "day1", branch(vec![ - ("sum", leaf("metric_sum", Index::Day1)), - ("cumulative", leaf("metric_cumulative", Index::Day1)), + ("sum", leaf("s_sum", Index::Day1)), + ("cumulative", leaf("s_cumulative", Index::Day1)), ]), ), ]); @@ -483,26 +483,26 @@ mod tests { // - week1 (flattened from dates) → branch with sum/cumulative at Week1 // - epoch → branch with sum/cumulative at Epoch let tree = branch(vec![ - ("cumulative", leaf("metric_cumulative", Index::Height)), + ("cumulative", leaf("s_cumulative", Index::Height)), ( "day1", branch(vec![ - ("sum", leaf("metric_sum", Index::Day1)), - ("cumulative", leaf("metric_cumulative", Index::Day1)), + ("sum", leaf("s_sum", Index::Day1)), + ("cumulative", leaf("s_cumulative", Index::Day1)), ]), ), ( "week1", branch(vec![ - ("sum", leaf("metric_sum", Index::Week1)), - ("cumulative", leaf("metric_cumulative", Index::Week1)), + ("sum", leaf("s_sum", Index::Week1)), + ("cumulative", leaf("s_cumulative", Index::Week1)), ]), ), ( "epoch", branch(vec![ - ("sum", leaf("metric_sum", Index::Epoch)), - ("cumulative", leaf("metric_cumulative", Index::Epoch)), + ("sum", leaf("s_sum", Index::Epoch)), + ("cumulative", leaf("s_cumulative", Index::Epoch)), ]), ), ]); @@ -535,24 +535,24 @@ mod tests { #[test] fn merge_conflict_from_lifted_branches() { - // Two branches lifting children with same key but different metric names → conflict + // Two branches lifting children with same key but different series names → conflict let tree = branch(vec![ - ("a", branch(vec![("data", leaf("metric_a", Index::Height))])), - ("b", branch(vec![("data", leaf("metric_b", Index::Day1))])), + ("a", branch(vec![("data", leaf("s_a", Index::Height))])), + ("b", branch(vec![("data", leaf("s_b", Index::Day1))])), ]); let result = tree.merge_branches(); assert!(result.is_none(), "Should detect conflict"); } #[test] - fn merge_no_conflict_same_metric_different_indexes() { - // Same key, same metric name, different indexes → merges indexes → collapses to Leaf + fn merge_no_conflict_same_series_different_indexes() { + // Same key, same series name, different indexes → merges indexes → collapses to Leaf let tree = branch(vec![ ( "a", - branch(vec![("sum", leaf("metric_sum", Index::Height))]), + branch(vec![("sum", leaf("s_sum", Index::Height))]), ), - ("b", branch(vec![("sum", leaf("metric_sum", Index::Day1))])), + ("b", branch(vec![("sum", leaf("s_sum", Index::Day1))])), ]); let result = tree.merge_branches(); assert!(result.is_some(), "Should merge successfully"); @@ -560,7 +560,7 @@ mod tests { let merged = result.unwrap(); match merged { TreeNode::Leaf(leaf) => { - assert_eq!(leaf.name(), "metric_sum"); + assert_eq!(leaf.name(), "s_sum"); let indexes = leaf.indexes(); assert!(indexes.contains(&Index::Height)); assert!(indexes.contains(&Index::Day1)); @@ -578,7 +578,7 @@ mod tests { "outer", branch(vec![( "inner", - branch(vec![("leaf", leaf("metric", Index::Height))]), + branch(vec![("leaf", leaf("s", Index::Height))]), )]), )]); let merged = tree.merge_branches().unwrap(); @@ -600,7 +600,7 @@ mod tests { // ComputedVecsDateLast pattern: // - day1: direct leaf (field name as key) // - rest (flattened): DerivedDateLast → branches with "last" children - // All leaves have same metric name → collapse to single Leaf + // All leaves have same series name → collapse to single Leaf let tree = branch(vec![ // Direct leaf from day1 field (no wrap attribute) ("day1", leaf("1m_block_count", Index::Day1)), @@ -635,11 +635,11 @@ mod tests { } } - // ========== Case 1: DerivedDateLast (all same metric name) ========== + // ========== Case 1: DerivedDateLast (all same series name) ========== #[test] fn case1_derived_date_last() { - // All leaves have the same metric name, all wrapped as "last" + // All leaves have the same series name, all wrapped as "last" // All branches lift to same key → collapses to single Leaf let tree = branch(vec![ ( @@ -686,15 +686,15 @@ mod tests { ( "day1", branch(vec![ - ("sum", leaf("metric_sum", Index::Day1)), - ("cumulative", leaf("metric_cumulative", Index::Day1)), + ("sum", leaf("s_sum", Index::Day1)), + ("cumulative", leaf("s_cumulative", Index::Day1)), ]), ), ( "week1", branch(vec![ - ("sum", leaf("metric_sum", Index::Week1)), - ("cumulative", leaf("metric_cumulative", Index::Week1)), + ("sum", leaf("s_sum", Index::Week1)), + ("cumulative", leaf("s_cumulative", Index::Week1)), ]), ), ]); @@ -729,16 +729,16 @@ mod tests { // height wrapped as "raw" ( "height", - branch(vec![("raw", leaf("metric", Index::Height))]), + branch(vec![("raw", leaf("s", Index::Height))]), ), // rest (flattened) produces branches ( "day1", - branch(vec![("sum", leaf("metric_sum", Index::Day1))]), + branch(vec![("sum", leaf("s_sum", Index::Day1))]), ), ( "week1", - branch(vec![("sum", leaf("metric_sum", Index::Week1))]), + branch(vec![("sum", leaf("s_sum", Index::Week1))]), ), ]); @@ -780,16 +780,16 @@ mod tests { // height wrapped as "raw" ( "height", - branch(vec![("raw", leaf("metric", Index::Height))]), + branch(vec![("raw", leaf("s", Index::Height))]), ), // rest (flattened) produces branches with "last" key ( "day1", - branch(vec![("last", leaf("metric_last", Index::Day1))]), + branch(vec![("last", leaf("s_last", Index::Day1))]), ), ( "week1", - branch(vec![("last", leaf("metric_last", Index::Week1))]), + branch(vec![("last", leaf("s_last", Index::Week1))]), ), ]); @@ -835,36 +835,36 @@ mod tests { // height wrapped as "raw" (raw values at height granularity) ( "height", - branch(vec![("raw", leaf("metric", Index::Height))]), + branch(vec![("raw", leaf("s", Index::Height))]), ), // height_cumulative wrapped as cumulative ( "height_cumulative", branch(vec![( "cumulative", - leaf("metric_cumulative", Index::Height), + leaf("s_cumulative", Index::Height), )]), ), // day1 Full ( "day1", branch(vec![ - ("average", leaf("metric_average", Index::Day1)), - ("min", leaf("metric_min", Index::Day1)), - ("max", leaf("metric_max", Index::Day1)), - ("sum", leaf("metric_sum", Index::Day1)), - ("cumulative", leaf("metric_cumulative", Index::Day1)), + ("average", leaf("s_average", Index::Day1)), + ("min", leaf("s_min", Index::Day1)), + ("max", leaf("s_max", Index::Day1)), + ("sum", leaf("s_sum", Index::Day1)), + ("cumulative", leaf("s_cumulative", Index::Day1)), ]), ), // week1 (from flattened dates) ( "week1", branch(vec![ - ("average", leaf("metric_average", Index::Week1)), - ("min", leaf("metric_min", Index::Week1)), - ("max", leaf("metric_max", Index::Week1)), - ("sum", leaf("metric_sum", Index::Week1)), - ("cumulative", leaf("metric_cumulative", Index::Week1)), + ("average", leaf("s_average", Index::Week1)), + ("min", leaf("s_min", Index::Week1)), + ("max", leaf("s_max", Index::Week1)), + ("sum", leaf("s_sum", Index::Week1)), + ("cumulative", leaf("s_cumulative", Index::Week1)), ]), ), ]); @@ -912,7 +912,7 @@ mod tests { #[test] fn case6_lazy_date_last_all_branches_same_key_collapses() { // LazyDateLast pattern: All fields are branches with same inner key "last" - // All leaves have the same metric name → should collapse to single Leaf + // All leaves have the same series name → should collapse to single Leaf let tree = branch(vec![ ( "day1", @@ -938,7 +938,7 @@ mod tests { let merged = tree.merge_branches().unwrap(); - // All branches lifted to same "last" key, all same metric name → collapse to Leaf + // All branches lifted to same "last" key, all same series name → collapse to Leaf match &merged { TreeNode::Leaf(leaf) => { assert_eq!(leaf.name(), "price_200d_sma"); @@ -973,14 +973,14 @@ mod tests { // sats with wrap="sats" produces Branch { sats: Leaf } ( "sats", - branch(vec![("sats", leaf("metric", Index::Height))]), + branch(vec![("sats", leaf("s", Index::Height))]), ), // rest with flatten: LazyDerivedBlockValue fields lifted ( "rest", branch(vec![ - ("bitcoin", leaf("metric_btc", Index::Height)), - ("dollars", leaf("metric_usd", Index::Height)), + ("bitcoin", leaf("s_btc", Index::Height)), + ("dollars", leaf("s_usd", Index::Height)), ]), ), ]); @@ -1020,25 +1020,25 @@ mod tests { // height with wrap="raw" ( "height", - branch(vec![("raw", leaf("metric", Index::Height))]), + branch(vec![("raw", leaf("s", Index::Height))]), ), // height_cumulative with wrap="cumulative" ( "height_cumulative", branch(vec![( "cumulative", - leaf("metric_cumulative", Index::Height), + leaf("s_cumulative", Index::Height), )]), ), // From rest (flatten) - inner struct already merged to { sum, cumulative } // Each leaf has merged indexes from all time periods ( "sum", - leaf("metric_sum", Index::Day1), // Would have all time indexes + leaf("s_sum", Index::Day1), // Would have all time indexes ), ( "cumulative", - leaf("metric_cumulative", Index::Day1), // Would have all time indexes + leaf("s_cumulative", Index::Day1), // Would have all time indexes ), ]); @@ -1082,21 +1082,21 @@ mod tests { // Each denomination has already been merged internally // Simulating the output after inner merge let sats_merged = branch(vec![ - ("raw", leaf("metric", Index::Height)), - ("sum", leaf("metric_sum", Index::Day1)), - ("cumulative", leaf("metric_cumulative", Index::Height)), + ("raw", leaf("s", Index::Height)), + ("sum", leaf("s_sum", Index::Day1)), + ("cumulative", leaf("s_cumulative", Index::Height)), ]); let bitcoin_merged = branch(vec![ - ("raw", leaf("metric_btc", Index::Height)), - ("sum", leaf("metric_btc_sum", Index::Day1)), - ("cumulative", leaf("metric_btc_cumulative", Index::Height)), + ("raw", leaf("s_btc", Index::Height)), + ("sum", leaf("s_btc_sum", Index::Day1)), + ("cumulative", leaf("s_btc_cumulative", Index::Height)), ]); let dollars_merged = branch(vec![ - ("raw", leaf("metric_usd", Index::Height)), - ("sum", leaf("metric_usd_sum", Index::Day1)), - ("cumulative", leaf("metric_usd_cumulative", Index::Height)), + ("raw", leaf("s_usd", Index::Height)), + ("sum", leaf("s_usd_sum", Index::Day1)), + ("cumulative", leaf("s_usd_cumulative", Index::Height)), ]); // Outer struct has no merge, so denominations stay as branches @@ -1133,19 +1133,19 @@ mod tests { fn case10_derived_date_last_collapses_to_leaf() { // DerivedDateLast with merge: all fields have wrap="last" // week1: { last: Leaf }, month1: { last: Leaf }, etc. - // After merge: all "last" keys merge, same metric name → collapses to Leaf + // After merge: all "last" keys merge, same series name → collapses to Leaf let tree = branch(vec![ ( "week1", - branch(vec![("last", leaf("metric", Index::Week1))]), + branch(vec![("last", leaf("s", Index::Week1))]), ), ( "month1", - branch(vec![("last", leaf("metric", Index::Month1))]), + branch(vec![("last", leaf("s", Index::Month1))]), ), ( "year1", - branch(vec![("last", leaf("metric", Index::Year1))]), + branch(vec![("last", leaf("s", Index::Year1))]), ), ]); @@ -1175,18 +1175,18 @@ mod tests { // - rest (flatten): DerivedDateLast already merged to Leaf // → flatten inserts with field name "rest" as key // - // Both have same metric name → collapses to single Leaf + // Both have same series name → collapses to single Leaf let tree = branch(vec![ // day1 with wrap="raw" - ("day1", branch(vec![("raw", leaf("metric", Index::Day1))])), + ("day1", branch(vec![("raw", leaf("s", Index::Day1))])), // rest (flatten): DerivedDateLast merged to Leaf - // Same metric name as base - ("rest", leaf("metric", Index::Week1)), + // Same series name as base + ("rest", leaf("s", Index::Week1)), ]); let merged = tree.merge_branches().unwrap(); - // Same metric name → collapses to single Leaf with all indexes + // Same series name → collapses to single Leaf with all indexes match &merged { TreeNode::Leaf(leaf) => { let indexes = leaf.indexes(); @@ -1216,23 +1216,23 @@ mod tests { // From sats_day1 with wrap="sats" ( "sats_day1", - branch(vec![("sats", leaf("metric", Index::Day1))]), + branch(vec![("sats", leaf("s", Index::Day1))]), ), // From rest (flatten): ValueDerivedDateLast ( "rest", branch(vec![ // sats field: DerivedDateLast merged to Leaf - ("sats", leaf("metric", Index::Week1)), // Same metric name! - ("bitcoin", leaf("metric_btc", Index::Day1)), - ("dollars", leaf("metric_usd", Index::Day1)), + ("sats", leaf("s", Index::Week1)), // Same series name! + ("bitcoin", leaf("s_btc", Index::Day1)), + ("dollars", leaf("s_usd", Index::Day1)), ]), ), ]); let merged = tree.merge_branches(); - // Should succeed because both "sats" have the same metric name + // Should succeed because both "sats" have the same series name // Indexes should be merged match merged { Some(TreeNode::Branch(map)) => { @@ -1258,9 +1258,9 @@ mod tests { // Simulating final merged output let tree = branch(vec![ - ("sats", leaf("metric", Index::Day1)), // placeholder, would have all indexes - ("bitcoin", leaf("metric_btc", Index::Day1)), - ("dollars", leaf("metric_usd", Index::Day1)), + ("sats", leaf("s", Index::Day1)), // placeholder, would have all indexes + ("bitcoin", leaf("s_btc", Index::Day1)), + ("dollars", leaf("s_usd", Index::Day1)), ]); match &tree { diff --git a/modules/brk-client/index.js b/modules/brk-client/index.js index d0d0be69b..b52968d04 100644 --- a/modules/brk-client/index.js +++ b/modules/brk-client/index.js @@ -273,6 +273,16 @@ */ /** @typedef {number} Day1 */ /** @typedef {number} Day3 */ +/** + * Detailed series count with per-database breakdown + * + * @typedef {Object} DetailedSeriesCount + * @property {number} distinctSeries - Number of unique series available (e.g., realized_price, market_cap) + * @property {number} totalEndpoints - Total number of series-index combinations across all timeframes + * @property {number} lazyEndpoints - Number of lazy (computed on-the-fly) series-index combinations + * @property {number} storedEndpoints - Number of eager (stored on disk) series-index combinations + * @property {{ [key: string]: SeriesCount }} byDb - Per-database breakdown of counts + */ /** * Difficulty adjustment information. * @@ -339,7 +349,7 @@ /** * @typedef {Object} ErrorDetail * @property {string} type - Error category: "invalid_request", "forbidden", "not_found", "unavailable", or "internal" - * @property {string} code - Machine-readable error code (e.g. "invalid_address", "metric_not_found") + * @property {string} code - Machine-readable error code (e.g. "invalid_address", "series_not_found") * @property {string} message - Human-readable description * @property {string} docUrl - Link to API documentation */ @@ -394,7 +404,7 @@ * @property {string} startedAt - Server start time (ISO 8601) * @property {number} uptimeSeconds - Uptime in seconds * @property {Height} indexedHeight - Height of the last indexed block - * @property {Height} computedHeight - Height of the last computed block (metrics) + * @property {Height} computedHeight - Height of the last computed block (series) * @property {Height} tipHeight - Height of the chain tip (from Bitcoin node) * @property {Height} blocksBehind - Number of blocks behind the tip * @property {string} lastIndexedAt - Human-readable timestamp of the last indexed block (ISO 8601) @@ -423,7 +433,7 @@ /** @typedef {number} Hour12 */ /** @typedef {number} Hour4 */ /** - * Aggregation dimension for querying metrics. Includes time-based (date, week, month, year), + * Aggregation dimension for querying series. Includes time-based (date, week, month, year), * block-based (height, tx_index), and address/output type indexes. * * @typedef {("minute10"|"minute30"|"hour1"|"hour4"|"hour12"|"day1"|"day3"|"week1"|"month1"|"month3"|"month6"|"year1"|"year10"|"halving"|"epoch"|"height"|"tx_index"|"txin_index"|"txout_index"|"empty_output_index"|"op_return_index"|"p2a_address_index"|"p2ms_output_index"|"p2pk33_address_index"|"p2pk65_address_index"|"p2pkh_address_index"|"p2sh_address_index"|"p2tr_address_index"|"p2wpkh_address_index"|"p2wsh_address_index"|"unknown_output_index"|"funded_address_index"|"empty_address_index")} Index @@ -435,6 +445,19 @@ * @property {Index} index - The canonical index name * @property {string[]} aliases - All Accepted query aliases */ +/** + * Legacy path parameter for `/api/metric/{metric}` + * + * @typedef {Object} LegacySeriesParam + * @property {Series} metric + */ +/** + * Legacy path parameters for `/api/metric/{metric}/{index}` + * + * @typedef {Object} LegacySeriesWithIndex + * @property {Series} metric + * @property {Index} index + */ /** * Maximum number of results to return. Defaults to 100 if not specified. * @@ -464,72 +487,6 @@ * @property {VSize} vsize - Total virtual size of all transactions in the mempool (vbytes) * @property {Sats} totalFee - Total fees of all transactions in the mempool (satoshis) */ -/** - * Metric name - * - * @typedef {string} Metric - */ -/** - * Metric count statistics - distinct metrics and total metric-index combinations - * - * @typedef {Object} MetricCount - * @property {number} distinctMetrics - Number of unique metrics available (e.g., realized_price, market_cap) - * @property {number} totalEndpoints - Total number of metric-index combinations across all timeframes - * @property {number} lazyEndpoints - Number of lazy (computed on-the-fly) metric-index combinations - * @property {number} storedEndpoints - Number of eager (stored on disk) metric-index combinations - */ -/** - * Metadata about a metric - * - * @typedef {Object} MetricInfo - * @property {Index[]} indexes - Available indexes - * @property {string} type - Value type (e.g. "f32", "u64", "Sats") - */ -/** - * MetricLeaf with JSON Schema for client generation - * - * @typedef {Object} MetricLeafWithSchema - * @property {string} name - The metric name/identifier - * @property {string} kind - The Rust type (e.g., "Sats", "StoredF64") - * @property {Index[]} indexes - Available indexes for this metric - * @property {string} type - JSON Schema type (e.g., "integer", "number", "string", "boolean", "array", "object") - */ -/** - * @typedef {Object} MetricParam - * @property {Metric} metric - */ -/** - * Selection of metrics to query - * - * @typedef {Object} MetricSelection - * @property {Metrics} metrics - Requested metrics - * @property {Index} index - Index to query - * @property {(RangeIndex|null)=} start - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` - * @property {(RangeIndex|null)=} end - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` - * @property {(Limit|null)=} limit - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` - * @property {Format=} format - Format of the output - */ -/** - * Legacy metric selection parameters (deprecated) - * - * @typedef {Object} MetricSelectionLegacy - * @property {Index} index - * @property {Metrics} ids - * @property {(RangeIndex|null)=} start - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` - * @property {(RangeIndex|null)=} end - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` - * @property {(Limit|null)=} limit - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` - * @property {Format=} format - Format of the output - */ -/** - * @typedef {Object} MetricWithIndex - * @property {Metric} metric - Metric name - * @property {Index} index - Aggregation index - */ -/** - * Comma-separated list of metric names - * - * @typedef {string} Metrics - */ /** @typedef {number} Minute10 */ /** @typedef {number} Minute30 */ /** @typedef {number} Month1 */ @@ -592,15 +549,15 @@ /** @typedef {TypeIndex} P2WSHAddressIndex */ /** @typedef {U8x32} P2WSHBytes */ /** - * A paginated list of available metric names (1000 per page) + * A paginated list of available series names (1000 per page) * - * @typedef {Object} PaginatedMetrics + * @typedef {Object} PaginatedSeries * @property {number} currentPage - Current page number (0-indexed) * @property {number} maxPage - Maximum valid page index (0-indexed) - * @property {number} totalCount - Total number of metrics + * @property {number} totalCount - Total number of series * @property {number} perPage - Results per page * @property {boolean} hasMore - Whether more pages are available after the current one - * @property {string[]} metrics - List of metric names + * @property {string[]} series - List of series names */ /** * Pagination parameters for paginated API endpoints @@ -735,9 +692,75 @@ */ /** * @typedef {Object} SearchQuery - * @property {Metric} q - Search query string + * @property {Series} q - Search query string * @property {Limit=} limit - Maximum number of results */ +/** + * Series name + * + * @typedef {string} Series + */ +/** + * Series count statistics - distinct series and total series-index combinations + * + * @typedef {Object} SeriesCount + * @property {number} distinctSeries - Number of unique series available (e.g., realized_price, market_cap) + * @property {number} totalEndpoints - Total number of series-index combinations across all timeframes + * @property {number} lazyEndpoints - Number of lazy (computed on-the-fly) series-index combinations + * @property {number} storedEndpoints - Number of eager (stored on disk) series-index combinations + */ +/** + * Metadata about a series + * + * @typedef {Object} SeriesInfo + * @property {Index[]} indexes - Available indexes + * @property {string} type - Value type (e.g. "f32", "u64", "Sats") + */ +/** + * SeriesLeaf with JSON Schema for client generation + * + * @typedef {Object} SeriesLeafWithSchema + * @property {string} name - The series name/identifier + * @property {string} kind - The Rust type (e.g., "Sats", "StoredF64") + * @property {Index[]} indexes - Available indexes for this series + * @property {string} type - JSON Schema type (e.g., "integer", "number", "string", "boolean", "array", "object") + */ +/** + * Comma-separated list of series names + * + * @typedef {string} SeriesList + */ +/** + * @typedef {Object} SeriesParam + * @property {Series} series + */ +/** + * Selection of series to query + * + * @typedef {Object} SeriesSelection + * @property {SeriesList} series - Requested series + * @property {Index} index - Index to query + * @property {(RangeIndex|null)=} start - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` + * @property {(RangeIndex|null)=} end - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` + * @property {(Limit|null)=} limit - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` + * @property {Format=} format - Format of the output + */ +/** + * Legacy series selection parameters (deprecated) + * + * @typedef {Object} SeriesSelectionLegacy + * @property {Index} index + * @property {SeriesList} ids + * @property {(RangeIndex|null)=} start - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` + * @property {(RangeIndex|null)=} end - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` + * @property {(Limit|null)=} limit - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` + * @property {Format=} format - Format of the output + */ +/** + * @typedef {Object} SeriesWithIndex + * @property {Series} series - Series name + * @property {Index} index - Aggregation index + */ /** @typedef {boolean} StoredBool */ /** * Stored 32-bit floating point value @@ -778,7 +801,7 @@ * * @typedef {Object} SyncStatus * @property {Height} indexedHeight - Height of the last indexed block - * @property {Height} computedHeight - Height of the last computed block (metrics) + * @property {Height} computedHeight - Height of the last computed block (series) * @property {Height} tipHeight - Height of the chain tip (from Bitcoin node) * @property {Height} blocksBehind - Number of blocks behind the tip * @property {string} lastIndexedAt - Human-readable timestamp of the last indexed block (ISO 8601) @@ -788,7 +811,7 @@ * Time period for mining statistics. * * Used to specify the lookback window for pool statistics, hashrate calculations, - * and other time-based mining metrics. + * and other time-based mining series. * * @typedef {("24h"|"3d"|"1w"|"1m"|"3m"|"6m"|"1y"|"2y"|"3y")} TimePeriod */ @@ -822,9 +845,9 @@ * @property {TxStatus} status */ /** - * Hierarchical tree node for organizing metrics into categories + * Hierarchical tree node for organizing series into categories * - * @typedef {({ [key: string]: TreeNode }|MetricLeafWithSchema)} TreeNode + * @typedef {({ [key: string]: TreeNode }|SeriesLeafWithSchema)} TreeNode */ /** * Transaction input @@ -1054,15 +1077,15 @@ function dateToIndex(index, d) { } /** - * Wrap raw metric data with helper methods. + * Wrap raw series data with helper methods. * @template T - * @param {MetricData} raw - Raw JSON response - * @returns {DateMetricData} + * @param {SeriesData} raw - Raw JSON response + * @returns {DateSeriesData} */ -function _wrapMetricData(raw) { +function _wrapSeriesData(raw) { const { index, start, end, data } = raw; const _dateBased = _DATE_INDEXES.has(index); - return /** @type {DateMetricData} */ ({ + return /** @type {DateSeriesData} */ ({ ...raw, isDateBased: _dateBased, indexes() { @@ -1089,7 +1112,7 @@ function _wrapMetricData(raw) { *[Symbol.iterator]() { for (let i = 0; i < data.length; i++) yield /** @type {[number, T]} */ ([start + i, data[i]]); }, - // DateMetricData methods (only meaningful for date-based indexes) + // DateSeriesData methods (only meaningful for date-based indexes) dates() { /** @type {globalThis.Date[]} */ const result = []; @@ -1113,47 +1136,47 @@ function _wrapMetricData(raw) { /** * @template T - * @typedef {Object} MetricDataBase - * @property {number} version - Version of the metric data + * @typedef {Object} SeriesDataBase + * @property {number} version - Version of the series data * @property {Index} index - The index type used for this query * @property {string} type - Value type (e.g. "f32", "u64", "Sats") * @property {number} total - Total number of data points * @property {number} start - Start index (inclusive) * @property {number} end - End index (exclusive) * @property {string} stamp - ISO 8601 timestamp of when the response was generated - * @property {T[]} data - The metric data - * @property {boolean} isDateBased - Whether this metric uses a date-based index + * @property {T[]} data - The series data + * @property {boolean} isDateBased - Whether this series uses a date-based index * @property {() => number[]} indexes - Get index numbers * @property {() => number[]} keys - Get keys as index numbers (alias for indexes) * @property {() => Array<[number, T]>} entries - Get [index, value] pairs * @property {() => Map} toMap - Convert to Map */ -/** @template T @typedef {MetricDataBase & Iterable<[number, T]>} MetricData */ +/** @template T @typedef {SeriesDataBase & Iterable<[number, T]>} SeriesData */ /** * @template T - * @typedef {Object} DateMetricDataExtras + * @typedef {Object} DateSeriesDataExtras * @property {() => globalThis.Date[]} dates - Get dates for each data point * @property {() => Array<[globalThis.Date, T]>} dateEntries - Get [date, value] pairs * @property {() => Map} toDateMap - Convert to Map */ -/** @template T @typedef {MetricData & DateMetricDataExtras} DateMetricData */ -/** @typedef {MetricData} AnyMetricData */ +/** @template T @typedef {SeriesData & DateSeriesDataExtras} DateSeriesData */ +/** @typedef {SeriesData} AnySeriesData */ -/** @template T @typedef {(onfulfilled?: (value: MetricData) => any, onrejected?: (reason: Error) => never) => Promise>} Thenable */ -/** @template T @typedef {(onfulfilled?: (value: DateMetricData) => any, onrejected?: (reason: Error) => never) => Promise>} DateThenable */ +/** @template T @typedef {(onfulfilled?: (value: SeriesData) => any, onrejected?: (reason: Error) => never) => Promise>} Thenable */ +/** @template T @typedef {(onfulfilled?: (value: DateSeriesData) => any, onrejected?: (reason: Error) => never) => Promise>} DateThenable */ /** * @template T - * @typedef {Object} MetricEndpointBuilder + * @typedef {Object} SeriesEndpointBuilder * @property {(index: number) => SingleItemBuilder} get - Get single item at index * @property {(start?: number, end?: number) => RangeBuilder} slice - Slice by index * @property {(n: number) => RangeBuilder} first - Get first n items * @property {(n: number) => RangeBuilder} last - Get last n items * @property {(n: number) => SkippedBuilder} skip - Skip first n items, chain with take() - * @property {(onUpdate?: (value: MetricData) => void) => Promise>} fetch - Fetch all data + * @property {(onUpdate?: (value: SeriesData) => void) => Promise>} fetch - Fetch all data * @property {() => Promise} fetchCsv - Fetch all data as CSV * @property {Thenable} then - Thenable (await endpoint) * @property {string} path - The endpoint path @@ -1161,79 +1184,79 @@ function _wrapMetricData(raw) { /** * @template T - * @typedef {Object} DateMetricEndpointBuilder + * @typedef {Object} DateSeriesEndpointBuilder * @property {(index: number | globalThis.Date) => DateSingleItemBuilder} get - Get single item at index or Date * @property {(start?: number | globalThis.Date, end?: number | globalThis.Date) => DateRangeBuilder} slice - Slice by index or Date * @property {(n: number) => DateRangeBuilder} first - Get first n items * @property {(n: number) => DateRangeBuilder} last - Get last n items * @property {(n: number) => DateSkippedBuilder} skip - Skip first n items, chain with take() - * @property {(onUpdate?: (value: DateMetricData) => void) => Promise>} fetch - Fetch all data + * @property {(onUpdate?: (value: DateSeriesData) => void) => Promise>} fetch - Fetch all data * @property {() => Promise} fetchCsv - Fetch all data as CSV * @property {DateThenable} then - Thenable (await endpoint) * @property {string} path - The endpoint path */ -/** @typedef {MetricEndpointBuilder} AnyMetricEndpointBuilder */ +/** @typedef {SeriesEndpointBuilder} AnySeriesEndpointBuilder */ /** @template T @typedef {Object} SingleItemBuilder - * @property {(onUpdate?: (value: MetricData) => void) => Promise>} fetch - Fetch the item + * @property {(onUpdate?: (value: SeriesData) => void) => Promise>} fetch - Fetch the item * @property {() => Promise} fetchCsv - Fetch as CSV * @property {Thenable} then - Thenable */ /** @template T @typedef {Object} DateSingleItemBuilder - * @property {(onUpdate?: (value: DateMetricData) => void) => Promise>} fetch - Fetch the item + * @property {(onUpdate?: (value: DateSeriesData) => void) => Promise>} fetch - Fetch the item * @property {() => Promise} fetchCsv - Fetch as CSV * @property {DateThenable} then - Thenable */ /** @template T @typedef {Object} SkippedBuilder * @property {(n: number) => RangeBuilder} take - Take n items after skipped position - * @property {(onUpdate?: (value: MetricData) => void) => Promise>} fetch - Fetch from skipped position to end + * @property {(onUpdate?: (value: SeriesData) => void) => Promise>} fetch - Fetch from skipped position to end * @property {() => Promise} fetchCsv - Fetch as CSV * @property {Thenable} then - Thenable */ /** @template T @typedef {Object} DateSkippedBuilder * @property {(n: number) => DateRangeBuilder} take - Take n items after skipped position - * @property {(onUpdate?: (value: DateMetricData) => void) => Promise>} fetch - Fetch from skipped position to end + * @property {(onUpdate?: (value: DateSeriesData) => void) => Promise>} fetch - Fetch from skipped position to end * @property {() => Promise} fetchCsv - Fetch as CSV * @property {DateThenable} then - Thenable */ /** @template T @typedef {Object} RangeBuilder - * @property {(onUpdate?: (value: MetricData) => void) => Promise>} fetch - Fetch the range + * @property {(onUpdate?: (value: SeriesData) => void) => Promise>} fetch - Fetch the range * @property {() => Promise} fetchCsv - Fetch as CSV * @property {Thenable} then - Thenable */ /** @template T @typedef {Object} DateRangeBuilder - * @property {(onUpdate?: (value: DateMetricData) => void) => Promise>} fetch - Fetch the range + * @property {(onUpdate?: (value: DateSeriesData) => void) => Promise>} fetch - Fetch the range * @property {() => Promise} fetchCsv - Fetch as CSV * @property {DateThenable} then - Thenable */ /** * @template T - * @typedef {Object} MetricPattern - * @property {string} name - The metric name - * @property {Readonly>>>} by - Index endpoints as lazy getters + * @typedef {Object} SeriesPattern + * @property {string} name - The series name + * @property {Readonly>>>} by - Index endpoints as lazy getters * @property {() => readonly Index[]} indexes - Get the list of available indexes - * @property {(index: Index) => MetricEndpointBuilder|undefined} get - Get an endpoint for a specific index + * @property {(index: Index) => SeriesEndpointBuilder|undefined} get - Get an endpoint for a specific index */ -/** @typedef {MetricPattern} AnyMetricPattern */ +/** @typedef {SeriesPattern} AnySeriesPattern */ /** - * Create a metric endpoint builder with typestate pattern. + * Create a series endpoint builder with typestate pattern. * @template T * @param {BrkClientBase} client - * @param {string} name - The metric vec name + * @param {string} name - The series vec name * @param {Index} index - The index name - * @returns {DateMetricEndpointBuilder} + * @returns {DateSeriesEndpointBuilder} */ function _endpoint(client, name, index) { - const p = `/api/metric/${name}/${index}`; + const p = `/api/series/${name}/${index}`; /** * @param {number} [start] @@ -1256,7 +1279,7 @@ function _endpoint(client, name, index) { * @returns {DateRangeBuilder} */ const rangeBuilder = (start, end) => ({ - fetch(onUpdate) { return client._fetchMetricData(buildPath(start, end), onUpdate); }, + fetch(onUpdate) { return client._fetchSeriesData(buildPath(start, end), onUpdate); }, fetchCsv() { return client.getText(buildPath(start, end, 'csv')); }, then(resolve, reject) { return this.fetch().then(resolve, reject); }, }); @@ -1266,7 +1289,7 @@ function _endpoint(client, name, index) { * @returns {DateSingleItemBuilder} */ const singleItemBuilder = (idx) => ({ - fetch(onUpdate) { return client._fetchMetricData(buildPath(idx, idx + 1), onUpdate); }, + fetch(onUpdate) { return client._fetchSeriesData(buildPath(idx, idx + 1), onUpdate); }, fetchCsv() { return client.getText(buildPath(idx, idx + 1, 'csv')); }, then(resolve, reject) { return this.fetch().then(resolve, reject); }, }); @@ -1277,12 +1300,12 @@ function _endpoint(client, name, index) { */ const skippedBuilder = (start) => ({ take(n) { return rangeBuilder(start, start + n); }, - fetch(onUpdate) { return client._fetchMetricData(buildPath(start, undefined), onUpdate); }, + fetch(onUpdate) { return client._fetchSeriesData(buildPath(start, undefined), onUpdate); }, fetchCsv() { return client.getText(buildPath(start, undefined, 'csv')); }, then(resolve, reject) { return this.fetch().then(resolve, reject); }, }); - /** @type {DateMetricEndpointBuilder} */ + /** @type {DateSeriesEndpointBuilder} */ const endpoint = { get(idx) { if (idx instanceof Date) idx = dateToIndex(index, idx); return singleItemBuilder(idx); }, slice(start, end) { @@ -1293,7 +1316,7 @@ function _endpoint(client, name, index) { first(n) { return rangeBuilder(undefined, n); }, last(n) { return n === 0 ? rangeBuilder(undefined, 0) : rangeBuilder(-n, undefined); }, skip(n) { return skippedBuilder(n); }, - fetch(onUpdate) { return client._fetchMetricData(buildPath(), onUpdate); }, + fetch(onUpdate) { return client._fetchSeriesData(buildPath(), onUpdate); }, fetchCsv() { return client.getText(buildPath(undefined, undefined, 'csv')); }, then(resolve, reject) { return this.fetch().then(resolve, reject); }, get path() { return p; }, @@ -1399,29 +1422,29 @@ class BrkClientBase { } /** - * Fetch metric data and wrap with helper methods (internal) + * Fetch series data and wrap with helper methods (internal) * @template T * @param {string} path - * @param {(value: DateMetricData) => void} [onUpdate] - * @returns {Promise>} + * @param {(value: DateSeriesData) => void} [onUpdate] + * @returns {Promise>} */ - async _fetchMetricData(path, onUpdate) { - const wrappedOnUpdate = onUpdate ? (/** @type {MetricData} */ raw) => onUpdate(_wrapMetricData(raw)) : undefined; + async _fetchSeriesData(path, onUpdate) { + const wrappedOnUpdate = onUpdate ? (/** @type {SeriesData} */ raw) => onUpdate(_wrapSeriesData(raw)) : undefined; const raw = await this.getJson(path, wrappedOnUpdate); - return _wrapMetricData(raw); + return _wrapSeriesData(raw); } } /** - * Build metric name with suffix. + * Build series name with suffix. * @param {string} acc - Accumulated prefix - * @param {string} s - Metric suffix + * @param {string} s - Series suffix * @returns {string} */ const _m = (acc, s) => s ? (acc ? `${acc}_${s}` : s) : acc; /** - * Build metric name with prefix. + * Build series name with prefix. * @param {string} prefix - Prefix to prepend * @param {string} acc - Accumulated name * @returns {string} @@ -1468,10 +1491,10 @@ const _i34 = /** @type {const} */ (["funded_address_index"]); const _i35 = /** @type {const} */ (["empty_address_index"]); /** - * Generic metric pattern factory. + * Generic series pattern factory. * @template T * @param {BrkClientBase} client - * @param {string} name - The metric vec name + * @param {string} name - The series vec name * @param {readonly Index[]} indexes - The supported indexes */ function _mp(client, name, indexes) { @@ -1488,116 +1511,116 @@ function _mp(client, name, indexes) { by, /** @returns {readonly Index[]} */ indexes() { return indexes; }, - /** @param {Index} index @returns {MetricEndpointBuilder|undefined} */ + /** @param {Index} index @returns {SeriesEndpointBuilder|undefined} */ get(index) { return indexes.includes(index) ? _endpoint(client, name, index) : undefined; } }; } -/** @template T @typedef {{ name: string, by: { readonly minute10: DateMetricEndpointBuilder, readonly minute30: DateMetricEndpointBuilder, readonly hour1: DateMetricEndpointBuilder, readonly hour4: DateMetricEndpointBuilder, readonly hour12: DateMetricEndpointBuilder, readonly day1: DateMetricEndpointBuilder, readonly day3: DateMetricEndpointBuilder, readonly week1: DateMetricEndpointBuilder, readonly month1: DateMetricEndpointBuilder, readonly month3: DateMetricEndpointBuilder, readonly month6: DateMetricEndpointBuilder, readonly year1: DateMetricEndpointBuilder, readonly year10: DateMetricEndpointBuilder, readonly halving: MetricEndpointBuilder, readonly epoch: MetricEndpointBuilder, readonly height: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern1 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern1} */ -function createMetricPattern1(client, name) { return /** @type {MetricPattern1} */ (_mp(client, name, _i1)); } -/** @template T @typedef {{ name: string, by: { readonly minute10: DateMetricEndpointBuilder, readonly minute30: DateMetricEndpointBuilder, readonly hour1: DateMetricEndpointBuilder, readonly hour4: DateMetricEndpointBuilder, readonly hour12: DateMetricEndpointBuilder, readonly day1: DateMetricEndpointBuilder, readonly day3: DateMetricEndpointBuilder, readonly week1: DateMetricEndpointBuilder, readonly month1: DateMetricEndpointBuilder, readonly month3: DateMetricEndpointBuilder, readonly month6: DateMetricEndpointBuilder, readonly year1: DateMetricEndpointBuilder, readonly year10: DateMetricEndpointBuilder, readonly halving: MetricEndpointBuilder, readonly epoch: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern2 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern2} */ -function createMetricPattern2(client, name) { return /** @type {MetricPattern2} */ (_mp(client, name, _i2)); } -/** @template T @typedef {{ name: string, by: { readonly minute10: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern3 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern3} */ -function createMetricPattern3(client, name) { return /** @type {MetricPattern3} */ (_mp(client, name, _i3)); } -/** @template T @typedef {{ name: string, by: { readonly minute30: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern4 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern4} */ -function createMetricPattern4(client, name) { return /** @type {MetricPattern4} */ (_mp(client, name, _i4)); } -/** @template T @typedef {{ name: string, by: { readonly hour1: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern5 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern5} */ -function createMetricPattern5(client, name) { return /** @type {MetricPattern5} */ (_mp(client, name, _i5)); } -/** @template T @typedef {{ name: string, by: { readonly hour4: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern6 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern6} */ -function createMetricPattern6(client, name) { return /** @type {MetricPattern6} */ (_mp(client, name, _i6)); } -/** @template T @typedef {{ name: string, by: { readonly hour12: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern7 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern7} */ -function createMetricPattern7(client, name) { return /** @type {MetricPattern7} */ (_mp(client, name, _i7)); } -/** @template T @typedef {{ name: string, by: { readonly day1: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern8 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern8} */ -function createMetricPattern8(client, name) { return /** @type {MetricPattern8} */ (_mp(client, name, _i8)); } -/** @template T @typedef {{ name: string, by: { readonly day3: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern9 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern9} */ -function createMetricPattern9(client, name) { return /** @type {MetricPattern9} */ (_mp(client, name, _i9)); } -/** @template T @typedef {{ name: string, by: { readonly week1: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern10 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern10} */ -function createMetricPattern10(client, name) { return /** @type {MetricPattern10} */ (_mp(client, name, _i10)); } -/** @template T @typedef {{ name: string, by: { readonly month1: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern11 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern11} */ -function createMetricPattern11(client, name) { return /** @type {MetricPattern11} */ (_mp(client, name, _i11)); } -/** @template T @typedef {{ name: string, by: { readonly month3: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern12 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern12} */ -function createMetricPattern12(client, name) { return /** @type {MetricPattern12} */ (_mp(client, name, _i12)); } -/** @template T @typedef {{ name: string, by: { readonly month6: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern13 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern13} */ -function createMetricPattern13(client, name) { return /** @type {MetricPattern13} */ (_mp(client, name, _i13)); } -/** @template T @typedef {{ name: string, by: { readonly year1: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern14 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern14} */ -function createMetricPattern14(client, name) { return /** @type {MetricPattern14} */ (_mp(client, name, _i14)); } -/** @template T @typedef {{ name: string, by: { readonly year10: DateMetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern15 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern15} */ -function createMetricPattern15(client, name) { return /** @type {MetricPattern15} */ (_mp(client, name, _i15)); } -/** @template T @typedef {{ name: string, by: { readonly halving: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern16 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern16} */ -function createMetricPattern16(client, name) { return /** @type {MetricPattern16} */ (_mp(client, name, _i16)); } -/** @template T @typedef {{ name: string, by: { readonly epoch: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern17 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern17} */ -function createMetricPattern17(client, name) { return /** @type {MetricPattern17} */ (_mp(client, name, _i17)); } -/** @template T @typedef {{ name: string, by: { readonly height: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern18 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern18} */ -function createMetricPattern18(client, name) { return /** @type {MetricPattern18} */ (_mp(client, name, _i18)); } -/** @template T @typedef {{ name: string, by: { readonly tx_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern19 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern19} */ -function createMetricPattern19(client, name) { return /** @type {MetricPattern19} */ (_mp(client, name, _i19)); } -/** @template T @typedef {{ name: string, by: { readonly txin_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern20 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern20} */ -function createMetricPattern20(client, name) { return /** @type {MetricPattern20} */ (_mp(client, name, _i20)); } -/** @template T @typedef {{ name: string, by: { readonly txout_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern21 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern21} */ -function createMetricPattern21(client, name) { return /** @type {MetricPattern21} */ (_mp(client, name, _i21)); } -/** @template T @typedef {{ name: string, by: { readonly empty_output_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern22 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern22} */ -function createMetricPattern22(client, name) { return /** @type {MetricPattern22} */ (_mp(client, name, _i22)); } -/** @template T @typedef {{ name: string, by: { readonly op_return_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern23 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern23} */ -function createMetricPattern23(client, name) { return /** @type {MetricPattern23} */ (_mp(client, name, _i23)); } -/** @template T @typedef {{ name: string, by: { readonly p2a_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern24 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern24} */ -function createMetricPattern24(client, name) { return /** @type {MetricPattern24} */ (_mp(client, name, _i24)); } -/** @template T @typedef {{ name: string, by: { readonly p2ms_output_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern25 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern25} */ -function createMetricPattern25(client, name) { return /** @type {MetricPattern25} */ (_mp(client, name, _i25)); } -/** @template T @typedef {{ name: string, by: { readonly p2pk33_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern26 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern26} */ -function createMetricPattern26(client, name) { return /** @type {MetricPattern26} */ (_mp(client, name, _i26)); } -/** @template T @typedef {{ name: string, by: { readonly p2pk65_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern27 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern27} */ -function createMetricPattern27(client, name) { return /** @type {MetricPattern27} */ (_mp(client, name, _i27)); } -/** @template T @typedef {{ name: string, by: { readonly p2pkh_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern28 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern28} */ -function createMetricPattern28(client, name) { return /** @type {MetricPattern28} */ (_mp(client, name, _i28)); } -/** @template T @typedef {{ name: string, by: { readonly p2sh_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern29 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern29} */ -function createMetricPattern29(client, name) { return /** @type {MetricPattern29} */ (_mp(client, name, _i29)); } -/** @template T @typedef {{ name: string, by: { readonly p2tr_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern30 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern30} */ -function createMetricPattern30(client, name) { return /** @type {MetricPattern30} */ (_mp(client, name, _i30)); } -/** @template T @typedef {{ name: string, by: { readonly p2wpkh_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern31 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern31} */ -function createMetricPattern31(client, name) { return /** @type {MetricPattern31} */ (_mp(client, name, _i31)); } -/** @template T @typedef {{ name: string, by: { readonly p2wsh_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern32 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern32} */ -function createMetricPattern32(client, name) { return /** @type {MetricPattern32} */ (_mp(client, name, _i32)); } -/** @template T @typedef {{ name: string, by: { readonly unknown_output_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern33 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern33} */ -function createMetricPattern33(client, name) { return /** @type {MetricPattern33} */ (_mp(client, name, _i33)); } -/** @template T @typedef {{ name: string, by: { readonly funded_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern34 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern34} */ -function createMetricPattern34(client, name) { return /** @type {MetricPattern34} */ (_mp(client, name, _i34)); } -/** @template T @typedef {{ name: string, by: { readonly empty_address_index: MetricEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => MetricEndpointBuilder|undefined }} MetricPattern35 */ -/** @template T @param {BrkClientBase} client @param {string} name @returns {MetricPattern35} */ -function createMetricPattern35(client, name) { return /** @type {MetricPattern35} */ (_mp(client, name, _i35)); } +/** @template T @typedef {{ name: string, by: { readonly minute10: DateSeriesEndpointBuilder, readonly minute30: DateSeriesEndpointBuilder, readonly hour1: DateSeriesEndpointBuilder, readonly hour4: DateSeriesEndpointBuilder, readonly hour12: DateSeriesEndpointBuilder, readonly day1: DateSeriesEndpointBuilder, readonly day3: DateSeriesEndpointBuilder, readonly week1: DateSeriesEndpointBuilder, readonly month1: DateSeriesEndpointBuilder, readonly month3: DateSeriesEndpointBuilder, readonly month6: DateSeriesEndpointBuilder, readonly year1: DateSeriesEndpointBuilder, readonly year10: DateSeriesEndpointBuilder, readonly halving: SeriesEndpointBuilder, readonly epoch: SeriesEndpointBuilder, readonly height: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern1 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern1} */ +function createSeriesPattern1(client, name) { return /** @type {SeriesPattern1} */ (_mp(client, name, _i1)); } +/** @template T @typedef {{ name: string, by: { readonly minute10: DateSeriesEndpointBuilder, readonly minute30: DateSeriesEndpointBuilder, readonly hour1: DateSeriesEndpointBuilder, readonly hour4: DateSeriesEndpointBuilder, readonly hour12: DateSeriesEndpointBuilder, readonly day1: DateSeriesEndpointBuilder, readonly day3: DateSeriesEndpointBuilder, readonly week1: DateSeriesEndpointBuilder, readonly month1: DateSeriesEndpointBuilder, readonly month3: DateSeriesEndpointBuilder, readonly month6: DateSeriesEndpointBuilder, readonly year1: DateSeriesEndpointBuilder, readonly year10: DateSeriesEndpointBuilder, readonly halving: SeriesEndpointBuilder, readonly epoch: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern2 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern2} */ +function createSeriesPattern2(client, name) { return /** @type {SeriesPattern2} */ (_mp(client, name, _i2)); } +/** @template T @typedef {{ name: string, by: { readonly minute10: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern3 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern3} */ +function createSeriesPattern3(client, name) { return /** @type {SeriesPattern3} */ (_mp(client, name, _i3)); } +/** @template T @typedef {{ name: string, by: { readonly minute30: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern4 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern4} */ +function createSeriesPattern4(client, name) { return /** @type {SeriesPattern4} */ (_mp(client, name, _i4)); } +/** @template T @typedef {{ name: string, by: { readonly hour1: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern5 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern5} */ +function createSeriesPattern5(client, name) { return /** @type {SeriesPattern5} */ (_mp(client, name, _i5)); } +/** @template T @typedef {{ name: string, by: { readonly hour4: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern6 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern6} */ +function createSeriesPattern6(client, name) { return /** @type {SeriesPattern6} */ (_mp(client, name, _i6)); } +/** @template T @typedef {{ name: string, by: { readonly hour12: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern7 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern7} */ +function createSeriesPattern7(client, name) { return /** @type {SeriesPattern7} */ (_mp(client, name, _i7)); } +/** @template T @typedef {{ name: string, by: { readonly day1: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern8 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern8} */ +function createSeriesPattern8(client, name) { return /** @type {SeriesPattern8} */ (_mp(client, name, _i8)); } +/** @template T @typedef {{ name: string, by: { readonly day3: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern9 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern9} */ +function createSeriesPattern9(client, name) { return /** @type {SeriesPattern9} */ (_mp(client, name, _i9)); } +/** @template T @typedef {{ name: string, by: { readonly week1: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern10 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern10} */ +function createSeriesPattern10(client, name) { return /** @type {SeriesPattern10} */ (_mp(client, name, _i10)); } +/** @template T @typedef {{ name: string, by: { readonly month1: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern11 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern11} */ +function createSeriesPattern11(client, name) { return /** @type {SeriesPattern11} */ (_mp(client, name, _i11)); } +/** @template T @typedef {{ name: string, by: { readonly month3: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern12 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern12} */ +function createSeriesPattern12(client, name) { return /** @type {SeriesPattern12} */ (_mp(client, name, _i12)); } +/** @template T @typedef {{ name: string, by: { readonly month6: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern13 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern13} */ +function createSeriesPattern13(client, name) { return /** @type {SeriesPattern13} */ (_mp(client, name, _i13)); } +/** @template T @typedef {{ name: string, by: { readonly year1: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern14 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern14} */ +function createSeriesPattern14(client, name) { return /** @type {SeriesPattern14} */ (_mp(client, name, _i14)); } +/** @template T @typedef {{ name: string, by: { readonly year10: DateSeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern15 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern15} */ +function createSeriesPattern15(client, name) { return /** @type {SeriesPattern15} */ (_mp(client, name, _i15)); } +/** @template T @typedef {{ name: string, by: { readonly halving: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern16 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern16} */ +function createSeriesPattern16(client, name) { return /** @type {SeriesPattern16} */ (_mp(client, name, _i16)); } +/** @template T @typedef {{ name: string, by: { readonly epoch: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern17 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern17} */ +function createSeriesPattern17(client, name) { return /** @type {SeriesPattern17} */ (_mp(client, name, _i17)); } +/** @template T @typedef {{ name: string, by: { readonly height: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern18 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern18} */ +function createSeriesPattern18(client, name) { return /** @type {SeriesPattern18} */ (_mp(client, name, _i18)); } +/** @template T @typedef {{ name: string, by: { readonly tx_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern19 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern19} */ +function createSeriesPattern19(client, name) { return /** @type {SeriesPattern19} */ (_mp(client, name, _i19)); } +/** @template T @typedef {{ name: string, by: { readonly txin_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern20 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern20} */ +function createSeriesPattern20(client, name) { return /** @type {SeriesPattern20} */ (_mp(client, name, _i20)); } +/** @template T @typedef {{ name: string, by: { readonly txout_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern21 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern21} */ +function createSeriesPattern21(client, name) { return /** @type {SeriesPattern21} */ (_mp(client, name, _i21)); } +/** @template T @typedef {{ name: string, by: { readonly empty_output_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern22 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern22} */ +function createSeriesPattern22(client, name) { return /** @type {SeriesPattern22} */ (_mp(client, name, _i22)); } +/** @template T @typedef {{ name: string, by: { readonly op_return_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern23 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern23} */ +function createSeriesPattern23(client, name) { return /** @type {SeriesPattern23} */ (_mp(client, name, _i23)); } +/** @template T @typedef {{ name: string, by: { readonly p2a_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern24 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern24} */ +function createSeriesPattern24(client, name) { return /** @type {SeriesPattern24} */ (_mp(client, name, _i24)); } +/** @template T @typedef {{ name: string, by: { readonly p2ms_output_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern25 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern25} */ +function createSeriesPattern25(client, name) { return /** @type {SeriesPattern25} */ (_mp(client, name, _i25)); } +/** @template T @typedef {{ name: string, by: { readonly p2pk33_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern26 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern26} */ +function createSeriesPattern26(client, name) { return /** @type {SeriesPattern26} */ (_mp(client, name, _i26)); } +/** @template T @typedef {{ name: string, by: { readonly p2pk65_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern27 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern27} */ +function createSeriesPattern27(client, name) { return /** @type {SeriesPattern27} */ (_mp(client, name, _i27)); } +/** @template T @typedef {{ name: string, by: { readonly p2pkh_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern28 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern28} */ +function createSeriesPattern28(client, name) { return /** @type {SeriesPattern28} */ (_mp(client, name, _i28)); } +/** @template T @typedef {{ name: string, by: { readonly p2sh_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern29 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern29} */ +function createSeriesPattern29(client, name) { return /** @type {SeriesPattern29} */ (_mp(client, name, _i29)); } +/** @template T @typedef {{ name: string, by: { readonly p2tr_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern30 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern30} */ +function createSeriesPattern30(client, name) { return /** @type {SeriesPattern30} */ (_mp(client, name, _i30)); } +/** @template T @typedef {{ name: string, by: { readonly p2wpkh_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern31 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern31} */ +function createSeriesPattern31(client, name) { return /** @type {SeriesPattern31} */ (_mp(client, name, _i31)); } +/** @template T @typedef {{ name: string, by: { readonly p2wsh_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern32 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern32} */ +function createSeriesPattern32(client, name) { return /** @type {SeriesPattern32} */ (_mp(client, name, _i32)); } +/** @template T @typedef {{ name: string, by: { readonly unknown_output_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern33 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern33} */ +function createSeriesPattern33(client, name) { return /** @type {SeriesPattern33} */ (_mp(client, name, _i33)); } +/** @template T @typedef {{ name: string, by: { readonly funded_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern34 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern34} */ +function createSeriesPattern34(client, name) { return /** @type {SeriesPattern34} */ (_mp(client, name, _i34)); } +/** @template T @typedef {{ name: string, by: { readonly empty_address_index: SeriesEndpointBuilder }, indexes: () => readonly Index[], get: (index: Index) => SeriesEndpointBuilder|undefined }} SeriesPattern35 */ +/** @template T @param {BrkClientBase} client @param {string} name @returns {SeriesPattern35} */ +function createSeriesPattern35(client, name) { return /** @type {SeriesPattern35} */ (_mp(client, name, _i35)); } // Reusable structural pattern factories @@ -1627,7 +1650,7 @@ function createMetricPattern35(client, name) { return /** @type {MetricPattern35 /** * Create a Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} */ function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, acc) { @@ -1669,8 +1692,8 @@ function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65 * @property {PriceRatioPattern} p25sd * @property {PriceRatioPattern} p2sd * @property {PriceRatioPattern} p3sd - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore */ /** @@ -1692,7 +1715,7 @@ function createPct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65 /** * Create a _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_10y1m1w1y2y3m3y4y5y6m6y8yPattern2} */ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, acc) { @@ -1731,7 +1754,7 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, acc) { /** * Create a _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_10y1m1w1y2y3m3y4y5y6m6y8yPattern3} */ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) { @@ -1757,7 +1780,7 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) { * @property {BaseCumulativeSumPattern3} grossPnl * @property {LowerPriceUpperPattern} investor * @property {BaseCapitulationCumulativeNegativeRelSumValuePattern} loss - * @property {MetricPattern1} mvrv + * @property {SeriesPattern1} mvrv * @property {BaseChangeCumulativeDeltaRelSumPattern} netPnl * @property {BaseCumulativeRelPattern} peakRegret * @property {BpsCentsPercentilesRatioSatsSmaStdUsdPattern} price @@ -1769,46 +1792,46 @@ function create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, acc) { /** * @typedef {Object} AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern - * @property {MetricPattern18} average - * @property {MetricPattern18} cumulative - * @property {MetricPattern18} max - * @property {MetricPattern18} median - * @property {MetricPattern18} min - * @property {MetricPattern18} pct10 - * @property {MetricPattern18} pct25 - * @property {MetricPattern18} pct75 - * @property {MetricPattern18} pct90 + * @property {SeriesPattern18} average + * @property {SeriesPattern18} cumulative + * @property {SeriesPattern18} max + * @property {SeriesPattern18} median + * @property {SeriesPattern18} min + * @property {SeriesPattern18} pct10 + * @property {SeriesPattern18} pct25 + * @property {SeriesPattern18} pct75 + * @property {SeriesPattern18} pct90 * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern} rolling - * @property {MetricPattern18} sum + * @property {SeriesPattern18} sum */ /** * Create a AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern} */ function createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(client, acc) { return { - average: createMetricPattern18(client, _m(acc, 'average')), - cumulative: createMetricPattern18(client, _m(acc, 'cumulative')), - max: createMetricPattern18(client, _m(acc, 'max')), - median: createMetricPattern18(client, _m(acc, 'median')), - min: createMetricPattern18(client, _m(acc, 'min')), - pct10: createMetricPattern18(client, _m(acc, 'pct10')), - pct25: createMetricPattern18(client, _m(acc, 'pct25')), - pct75: createMetricPattern18(client, _m(acc, 'pct75')), - pct90: createMetricPattern18(client, _m(acc, 'pct90')), + average: createSeriesPattern18(client, _m(acc, 'average')), + cumulative: createSeriesPattern18(client, _m(acc, 'cumulative')), + max: createSeriesPattern18(client, _m(acc, 'max')), + median: createSeriesPattern18(client, _m(acc, 'median')), + min: createSeriesPattern18(client, _m(acc, 'min')), + pct10: createSeriesPattern18(client, _m(acc, 'pct10')), + pct25: createSeriesPattern18(client, _m(acc, 'pct25')), + pct75: createSeriesPattern18(client, _m(acc, 'pct75')), + pct90: createSeriesPattern18(client, _m(acc, 'pct90')), rolling: createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc), - sum: createMetricPattern18(client, _m(acc, 'sum')), + sum: createSeriesPattern18(client, _m(acc, 'sum')), }; } /** * @typedef {Object} AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern * @property {_1m1w1y24hPattern} average - * @property {MetricPattern1} base - * @property {MetricPattern1} cumulative + * @property {SeriesPattern1} base + * @property {SeriesPattern1} cumulative * @property {_1m1w1y24hPattern} max * @property {_1m1w1y24hPattern} median * @property {_1m1w1y24hPattern} min @@ -1822,14 +1845,14 @@ function createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPatter /** * Create a AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} */ function createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) { return { average: create_1m1w1y24hPattern(client, _m(acc, 'average')), - base: createMetricPattern1(client, acc), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + base: createSeriesPattern1(client, acc), + cumulative: createSeriesPattern1(client, _m(acc, 'cumulative')), max: create_1m1w1y24hPattern(client, _m(acc, 'max')), median: create_1m1w1y24hPattern(client, _m(acc, 'median')), min: create_1m1w1y24hPattern(client, _m(acc, 'min')), @@ -1843,10 +1866,10 @@ function createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(c /** * @typedef {Object} AverageGainsLossesRsiStochPattern - * @property {MetricPattern1} averageGain - * @property {MetricPattern1} averageLoss - * @property {MetricPattern1} gains - * @property {MetricPattern1} losses + * @property {SeriesPattern1} averageGain + * @property {SeriesPattern1} averageLoss + * @property {SeriesPattern1} gains + * @property {SeriesPattern1} losses * @property {BpsPercentRatioPattern3} rsi * @property {BpsPercentRatioPattern3} rsiMax * @property {BpsPercentRatioPattern3} rsiMin @@ -1858,16 +1881,16 @@ function createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(c /** * Create a AverageGainsLossesRsiStochPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @param {string} disc - Discriminator suffix * @returns {AverageGainsLossesRsiStochPattern} */ function createAverageGainsLossesRsiStochPattern(client, acc, disc) { return { - averageGain: createMetricPattern1(client, _m(_m(acc, 'average_gain'), disc)), - averageLoss: createMetricPattern1(client, _m(_m(acc, 'average_loss'), disc)), - gains: createMetricPattern1(client, _m(_m(acc, 'gains'), disc)), - losses: createMetricPattern1(client, _m(_m(acc, 'losses'), disc)), + averageGain: createSeriesPattern1(client, _m(_m(acc, 'average_gain'), disc)), + averageLoss: createSeriesPattern1(client, _m(_m(acc, 'average_loss'), disc)), + gains: createSeriesPattern1(client, _m(_m(acc, 'gains'), disc)), + losses: createSeriesPattern1(client, _m(_m(acc, 'losses'), disc)), rsi: createBpsPercentRatioPattern3(client, _m(acc, disc)), rsiMax: createBpsPercentRatioPattern3(client, _m(_m(acc, 'max'), disc)), rsiMin: createBpsPercentRatioPattern3(client, _m(_m(acc, 'min'), disc)), @@ -1879,34 +1902,34 @@ function createAverageGainsLossesRsiStochPattern(client, acc, disc) { /** * @typedef {Object} AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3 - * @property {MetricPattern1} all - * @property {MetricPattern1} p2a - * @property {MetricPattern1} p2pk33 - * @property {MetricPattern1} p2pk65 - * @property {MetricPattern1} p2pkh - * @property {MetricPattern1} p2sh - * @property {MetricPattern1} p2tr - * @property {MetricPattern1} p2wpkh - * @property {MetricPattern1} p2wsh + * @property {SeriesPattern1} all + * @property {SeriesPattern1} p2a + * @property {SeriesPattern1} p2pk33 + * @property {SeriesPattern1} p2pk65 + * @property {SeriesPattern1} p2pkh + * @property {SeriesPattern1} p2sh + * @property {SeriesPattern1} p2tr + * @property {SeriesPattern1} p2wpkh + * @property {SeriesPattern1} p2wsh */ /** * Create a AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3} */ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, acc) { return { - all: createMetricPattern1(client, acc), - p2a: createMetricPattern1(client, _p('p2a', acc)), - p2pk33: createMetricPattern1(client, _p('p2pk33', acc)), - p2pk65: createMetricPattern1(client, _p('p2pk65', acc)), - p2pkh: createMetricPattern1(client, _p('p2pkh', acc)), - p2sh: createMetricPattern1(client, _p('p2sh', acc)), - p2tr: createMetricPattern1(client, _p('p2tr', acc)), - p2wpkh: createMetricPattern1(client, _p('p2wpkh', acc)), - p2wsh: createMetricPattern1(client, _p('p2wsh', acc)), + all: createSeriesPattern1(client, acc), + p2a: createSeriesPattern1(client, _p('p2a', acc)), + p2pk33: createSeriesPattern1(client, _p('p2pk33', acc)), + p2pk65: createSeriesPattern1(client, _p('p2pk65', acc)), + p2pkh: createSeriesPattern1(client, _p('p2pkh', acc)), + p2sh: createSeriesPattern1(client, _p('p2sh', acc)), + p2tr: createSeriesPattern1(client, _p('p2tr', acc)), + p2wpkh: createSeriesPattern1(client, _p('p2wpkh', acc)), + p2wsh: createSeriesPattern1(client, _p('p2wsh', acc)), }; } @@ -1926,7 +1949,7 @@ function createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, acc) { /** * Create a AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern} */ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) { @@ -1958,7 +1981,7 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) { /** * Create a AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} */ function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) { @@ -1977,9 +2000,9 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) { /** * @typedef {Object} BaseCapitulationCumulativeNegativeRelSumValuePattern * @property {CentsUsdPattern2} base - * @property {MetricPattern1} capitulationFlow + * @property {SeriesPattern1} capitulationFlow * @property {CentsUsdPattern2} cumulative - * @property {MetricPattern1} negative + * @property {SeriesPattern1} negative * @property {BpsPercentRatioPattern4} relToRcap * @property {_1m1w1y24hPattern4} sum * @property {BaseCumulativeSumPattern} valueCreated @@ -1988,46 +2011,46 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, acc) { /** * @typedef {Object} BpsCentsPercentilesRatioSatsSmaStdUsdPattern - * @property {MetricPattern1} bps - * @property {MetricPattern1} cents + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} cents * @property {Pct1Pct2Pct5Pct95Pct98Pct99Pattern} percentiles - * @property {MetricPattern1} ratio - * @property {MetricPattern1} sats + * @property {SeriesPattern1} ratio + * @property {SeriesPattern1} sats * @property {_1m1w1y2y4yAllPattern} sma * @property {_1y2y4yAllPattern} stdDev - * @property {MetricPattern1} usd + * @property {SeriesPattern1} usd */ /** * @template T * @typedef {Object} AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2 - * @property {MetricPattern18} average - * @property {MetricPattern18} max - * @property {MetricPattern18} median - * @property {MetricPattern18} min - * @property {MetricPattern18} pct10 - * @property {MetricPattern18} pct25 - * @property {MetricPattern18} pct75 - * @property {MetricPattern18} pct90 + * @property {SeriesPattern18} average + * @property {SeriesPattern18} max + * @property {SeriesPattern18} median + * @property {SeriesPattern18} min + * @property {SeriesPattern18} pct10 + * @property {SeriesPattern18} pct25 + * @property {SeriesPattern18} pct75 + * @property {SeriesPattern18} pct90 */ /** * Create a AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2 pattern node * @template T * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2} */ function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(client, acc) { return { - average: createMetricPattern18(client, _m(acc, 'average')), - max: createMetricPattern18(client, _m(acc, 'max')), - median: createMetricPattern18(client, _m(acc, 'median')), - min: createMetricPattern18(client, _m(acc, 'min')), - pct10: createMetricPattern18(client, _m(acc, 'pct10')), - pct25: createMetricPattern18(client, _m(acc, 'pct25')), - pct75: createMetricPattern18(client, _m(acc, 'pct75')), - pct90: createMetricPattern18(client, _m(acc, 'pct90')), + average: createSeriesPattern18(client, _m(acc, 'average')), + max: createSeriesPattern18(client, _m(acc, 'max')), + median: createSeriesPattern18(client, _m(acc, 'median')), + min: createSeriesPattern18(client, _m(acc, 'min')), + pct10: createSeriesPattern18(client, _m(acc, 'pct10')), + pct25: createSeriesPattern18(client, _m(acc, 'pct25')), + pct75: createSeriesPattern18(client, _m(acc, 'pct75')), + pct90: createSeriesPattern18(client, _m(acc, 'pct90')), }; } @@ -2045,7 +2068,7 @@ function createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(client, acc) { /** * Create a _10y2y3y4y5y6y8yPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_10y2y3y4y5y6y8yPattern} */ function create_10y2y3y4y5y6y8yPattern(client, acc) { @@ -2066,15 +2089,15 @@ function create_10y2y3y4y5y6y8yPattern(client, acc) { * @property {BpsPercentRatioPattern3} _1w * @property {BpsPercentRatioPattern3} _1y * @property {BpsPercentRatioPattern3} _24h - * @property {MetricPattern1} bps - * @property {MetricPattern1} percent - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} percent + * @property {SeriesPattern1} ratio */ /** * Create a _1m1w1y24hBpsPercentRatioPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y24hBpsPercentRatioPattern} */ function create_1m1w1y24hBpsPercentRatioPattern(client, acc) { @@ -2083,9 +2106,9 @@ function create_1m1w1y24hBpsPercentRatioPattern(client, acc) { _1w: createBpsPercentRatioPattern3(client, _m(acc, '1w')), _1y: createBpsPercentRatioPattern3(client, _m(acc, '1y')), _24h: createBpsPercentRatioPattern3(client, _m(acc, '24h')), - bps: createMetricPattern1(client, _m(acc, 'bps')), - percent: createMetricPattern1(client, acc), - ratio: createMetricPattern1(client, _m(acc, 'ratio')), + bps: createSeriesPattern1(client, _m(acc, 'bps')), + percent: createSeriesPattern1(client, acc), + ratio: createSeriesPattern1(client, _m(acc, 'ratio')), }; } @@ -2093,7 +2116,7 @@ function create_1m1w1y24hBpsPercentRatioPattern(client, acc) { * @typedef {Object} BaseCumulativeDistributionRelSumValuePattern * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative - * @property {MetricPattern1} distributionFlow + * @property {SeriesPattern1} distributionFlow * @property {BpsPercentRatioPattern4} relToRcap * @property {_1m1w1y24hPattern4} sum * @property {BaseCumulativeSumPattern} valueCreated @@ -2104,7 +2127,7 @@ function create_1m1w1y24hBpsPercentRatioPattern(client, acc) { * @typedef {Object} BaseCumulativeNegativeRelSumPattern2 * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative - * @property {MetricPattern1} negative + * @property {SeriesPattern1} negative * @property {BpsPercentRatioPattern3} relToMcap * @property {BpsPercentRatioPattern3} relToOwnGross * @property {BpsPercentRatioPattern4} relToOwnMcap @@ -2114,14 +2137,14 @@ function create_1m1w1y24hBpsPercentRatioPattern(client, acc) { /** * Create a BaseCumulativeNegativeRelSumPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseCumulativeNegativeRelSumPattern2} */ function createBaseCumulativeNegativeRelSumPattern2(client, acc) { return { base: createCentsUsdPattern2(client, _m(acc, 'unrealized_loss')), cumulative: createCentsUsdPattern2(client, _m(acc, 'unrealized_loss_cumulative')), - negative: createMetricPattern1(client, _m(acc, 'neg_unrealized_loss')), + negative: createSeriesPattern1(client, _m(acc, 'neg_unrealized_loss')), relToMcap: createBpsPercentRatioPattern3(client, _m(acc, 'unrealized_loss_rel_to_mcap')), relToOwnGross: createBpsPercentRatioPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_gross_pnl')), relToOwnMcap: createBpsPercentRatioPattern4(client, _m(acc, 'unrealized_loss_rel_to_own_mcap')), @@ -2133,7 +2156,7 @@ function createBaseCumulativeNegativeRelSumPattern2(client, acc) { * @typedef {Object} CapLossMvrvNetPriceProfitSoprPattern * @property {CentsDeltaUsdPattern} cap * @property {BaseCumulativeNegativeSumPattern} loss - * @property {MetricPattern1} mvrv + * @property {SeriesPattern1} mvrv * @property {BaseCumulativeDeltaSumPattern} netPnl * @property {BpsCentsRatioSatsUsdPattern} price * @property {BaseCumulativeSumPattern3} profit @@ -2143,14 +2166,14 @@ function createBaseCumulativeNegativeRelSumPattern2(client, acc) { /** * Create a CapLossMvrvNetPriceProfitSoprPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CapLossMvrvNetPriceProfitSoprPattern} */ function createCapLossMvrvNetPriceProfitSoprPattern(client, acc) { return { cap: createCentsDeltaUsdPattern(client, _m(acc, 'realized_cap')), loss: createBaseCumulativeNegativeSumPattern(client, acc, 'realized_loss'), - mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), + mvrv: createSeriesPattern1(client, _m(acc, 'mvrv')), netPnl: createBaseCumulativeDeltaSumPattern(client, _m(acc, 'net_realized_pnl')), price: createBpsCentsRatioSatsUsdPattern(client, _m(acc, 'realized_price')), profit: createBaseCumulativeSumPattern3(client, _m(acc, 'realized_profit')), @@ -2182,7 +2205,7 @@ function createCapLossMvrvNetPriceProfitSoprPattern(client, acc) { /** * Create a _1m1w1y2y4yAllPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y2y4yAllPattern} */ function create_1m1w1y2y4yAllPattern(client, acc) { @@ -2209,7 +2232,7 @@ function create_1m1w1y2y4yAllPattern(client, acc) { /** * Create a BaseChangeCumulativeDeltaRelSumPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseChangeCumulativeDeltaRelSumPattern} */ function createBaseChangeCumulativeDeltaRelSumPattern(client, acc) { @@ -2236,7 +2259,7 @@ function createBaseChangeCumulativeDeltaRelSumPattern(client, acc) { /** * Create a BaseCumulativeRelSumPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseCumulativeRelSumPattern2} */ function createBaseCumulativeRelSumPattern2(client, acc) { @@ -2252,55 +2275,55 @@ function createBaseCumulativeRelSumPattern2(client, acc) { /** * @typedef {Object} BpsCentsPercentilesRatioSatsUsdPattern - * @property {MetricPattern1} bps - * @property {MetricPattern1} cents + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} cents * @property {Pct1Pct2Pct5Pct95Pct98Pct99Pattern} percentiles - * @property {MetricPattern1} ratio - * @property {MetricPattern1} sats - * @property {MetricPattern1} usd + * @property {SeriesPattern1} ratio + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} usd */ /** * Create a BpsCentsPercentilesRatioSatsUsdPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BpsCentsPercentilesRatioSatsUsdPattern} */ function createBpsCentsPercentilesRatioSatsUsdPattern(client, acc) { return { - bps: createMetricPattern1(client, _m(acc, 'ratio_bps')), - cents: createMetricPattern1(client, _m(acc, 'cents')), + bps: createSeriesPattern1(client, _m(acc, 'ratio_bps')), + cents: createSeriesPattern1(client, _m(acc, 'cents')), percentiles: createPct1Pct2Pct5Pct95Pct98Pct99Pattern(client, acc), - ratio: createMetricPattern1(client, _m(acc, 'ratio')), - sats: createMetricPattern1(client, _m(acc, 'sats')), - usd: createMetricPattern1(client, acc), + ratio: createSeriesPattern1(client, _m(acc, 'ratio')), + sats: createSeriesPattern1(client, _m(acc, 'sats')), + usd: createSeriesPattern1(client, acc), }; } /** * @typedef {Object} BtcCentsRelSatsUsdPattern3 - * @property {MetricPattern1} btc - * @property {MetricPattern1} cents + * @property {SeriesPattern1} btc + * @property {SeriesPattern1} cents * @property {BpsPercentRatioPattern3} relToCirculating * @property {BpsPercentRatioPattern3} relToOwn - * @property {MetricPattern1} sats - * @property {MetricPattern1} usd + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} usd */ /** * Create a BtcCentsRelSatsUsdPattern3 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BtcCentsRelSatsUsdPattern3} */ function createBtcCentsRelSatsUsdPattern3(client, acc) { return { - btc: createMetricPattern1(client, acc), - cents: createMetricPattern1(client, _m(acc, 'cents')), + btc: createSeriesPattern1(client, acc), + cents: createSeriesPattern1(client, _m(acc, 'cents')), relToCirculating: createBpsPercentRatioPattern3(client, _m(acc, 'rel_to_circulating')), relToOwn: createBpsPercentRatioPattern3(client, _m(acc, 'rel_to_own')), - sats: createMetricPattern1(client, _m(acc, 'sats')), - usd: createMetricPattern1(client, _m(acc, 'usd')), + sats: createSeriesPattern1(client, _m(acc, 'sats')), + usd: createSeriesPattern1(client, _m(acc, 'usd')), }; } @@ -2308,7 +2331,7 @@ function createBtcCentsRelSatsUsdPattern3(client, acc) { * @typedef {Object} CapLossMvrvPriceProfitSoprPattern * @property {CentsDeltaUsdPattern} cap * @property {BaseCumulativeSumPattern3} loss - * @property {MetricPattern1} mvrv + * @property {SeriesPattern1} mvrv * @property {BpsCentsRatioSatsUsdPattern} price * @property {BaseCumulativeSumPattern3} profit * @property {ValuePattern} sopr @@ -2317,14 +2340,14 @@ function createBtcCentsRelSatsUsdPattern3(client, acc) { /** * Create a CapLossMvrvPriceProfitSoprPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CapLossMvrvPriceProfitSoprPattern} */ function createCapLossMvrvPriceProfitSoprPattern(client, acc) { return { cap: createCentsDeltaUsdPattern(client, _m(acc, 'realized_cap')), loss: createBaseCumulativeSumPattern3(client, _m(acc, 'realized_loss')), - mvrv: createMetricPattern1(client, _m(acc, 'mvrv')), + mvrv: createSeriesPattern1(client, _m(acc, 'mvrv')), price: createBpsCentsRatioSatsUsdPattern(client, _m(acc, 'realized_price')), profit: createBaseCumulativeSumPattern3(client, _m(acc, 'realized_profit')), sopr: createValuePattern(client, _m(acc, 'value')), @@ -2344,7 +2367,7 @@ function createCapLossMvrvPriceProfitSoprPattern(client, acc) { /** * Create a DeltaHalfInRelTotalPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {DeltaHalfInRelTotalPattern} */ function createDeltaHalfInRelTotalPattern(client, acc) { @@ -2371,7 +2394,7 @@ function createDeltaHalfInRelTotalPattern(client, acc) { /** * Create a DeltaHalfInRelTotalPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {DeltaHalfInRelTotalPattern2} */ function createDeltaHalfInRelTotalPattern2(client, acc) { @@ -2398,7 +2421,7 @@ function createDeltaHalfInRelTotalPattern2(client, acc) { /** * Create a Pct1Pct2Pct5Pct95Pct98Pct99Pattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {Pct1Pct2Pct5Pct95Pct98Pct99Pattern} */ function createPct1Pct2Pct5Pct95Pct98Pct99Pattern(client, acc) { @@ -2424,7 +2447,7 @@ function createPct1Pct2Pct5Pct95Pct98Pct99Pattern(client, acc) { /** * Create a ActivityOutputsRealizedSupplyUnrealizedPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {ActivityOutputsRealizedSupplyUnrealizedPattern} */ function createActivityOutputsRealizedSupplyUnrealizedPattern(client, acc) { @@ -2449,7 +2472,7 @@ function createActivityOutputsRealizedSupplyUnrealizedPattern(client, acc) { /** * Create a AddressOutputsRealizedSupplyUnrealizedPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AddressOutputsRealizedSupplyUnrealizedPattern} */ function createAddressOutputsRealizedSupplyUnrealizedPattern(client, acc) { @@ -2464,8 +2487,8 @@ function createAddressOutputsRealizedSupplyUnrealizedPattern(client, acc) { /** * @typedef {Object} BaseCumulativeInSumPattern - * @property {MetricPattern1} base - * @property {MetricPattern1} cumulative + * @property {SeriesPattern1} base + * @property {SeriesPattern1} cumulative * @property {BaseCumulativeSumPattern4} inLoss * @property {BaseCumulativeSumPattern4} inProfit * @property {_1m1w1y24hPattern} sum @@ -2474,13 +2497,13 @@ function createAddressOutputsRealizedSupplyUnrealizedPattern(client, acc) { /** * Create a BaseCumulativeInSumPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseCumulativeInSumPattern} */ function createBaseCumulativeInSumPattern(client, acc) { return { - base: createMetricPattern1(client, acc), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + base: createSeriesPattern1(client, acc), + cumulative: createSeriesPattern1(client, _m(acc, 'cumulative')), inLoss: createBaseCumulativeSumPattern4(client, _m(acc, 'in_loss')), inProfit: createBaseCumulativeSumPattern4(client, _m(acc, 'in_profit')), sum: create_1m1w1y24hPattern(client, _m(acc, 'sum')), @@ -2489,101 +2512,101 @@ function createBaseCumulativeInSumPattern(client, acc) { /** * @typedef {Object} BpsCentsRatioSatsUsdPattern - * @property {MetricPattern1} bps - * @property {MetricPattern1} cents - * @property {MetricPattern1} ratio - * @property {MetricPattern1} sats - * @property {MetricPattern1} usd + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} ratio + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} usd */ /** * Create a BpsCentsRatioSatsUsdPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BpsCentsRatioSatsUsdPattern} */ function createBpsCentsRatioSatsUsdPattern(client, acc) { return { - bps: createMetricPattern1(client, _m(acc, 'ratio_bps')), - cents: createMetricPattern1(client, _m(acc, 'cents')), - ratio: createMetricPattern1(client, _m(acc, 'ratio')), - sats: createMetricPattern1(client, _m(acc, 'sats')), - usd: createMetricPattern1(client, acc), + bps: createSeriesPattern1(client, _m(acc, 'ratio_bps')), + cents: createSeriesPattern1(client, _m(acc, 'cents')), + ratio: createSeriesPattern1(client, _m(acc, 'ratio')), + sats: createSeriesPattern1(client, _m(acc, 'sats')), + usd: createSeriesPattern1(client, acc), }; } /** * @typedef {Object} BtcCentsDeltaSatsUsdPattern - * @property {MetricPattern1} btc - * @property {MetricPattern1} cents + * @property {SeriesPattern1} btc + * @property {SeriesPattern1} cents * @property {AbsoluteRatePattern} delta - * @property {MetricPattern1} sats - * @property {MetricPattern1} usd + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} usd */ /** * Create a BtcCentsDeltaSatsUsdPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BtcCentsDeltaSatsUsdPattern} */ function createBtcCentsDeltaSatsUsdPattern(client, acc) { return { - btc: createMetricPattern1(client, acc), - cents: createMetricPattern1(client, _m(acc, 'cents')), + btc: createSeriesPattern1(client, acc), + cents: createSeriesPattern1(client, _m(acc, 'cents')), delta: createAbsoluteRatePattern(client, _m(acc, 'delta')), - sats: createMetricPattern1(client, _m(acc, 'sats')), - usd: createMetricPattern1(client, _m(acc, 'usd')), + sats: createSeriesPattern1(client, _m(acc, 'sats')), + usd: createSeriesPattern1(client, _m(acc, 'usd')), }; } /** * @typedef {Object} BtcCentsRelSatsUsdPattern - * @property {MetricPattern1} btc - * @property {MetricPattern1} cents + * @property {SeriesPattern1} btc + * @property {SeriesPattern1} cents * @property {BpsPercentRatioPattern3} relToCirculating - * @property {MetricPattern1} sats - * @property {MetricPattern1} usd + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} usd */ /** * Create a BtcCentsRelSatsUsdPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BtcCentsRelSatsUsdPattern} */ function createBtcCentsRelSatsUsdPattern(client, acc) { return { - btc: createMetricPattern1(client, acc), - cents: createMetricPattern1(client, _m(acc, 'cents')), + btc: createSeriesPattern1(client, acc), + cents: createSeriesPattern1(client, _m(acc, 'cents')), relToCirculating: createBpsPercentRatioPattern3(client, _m(acc, 'rel_to_circulating')), - sats: createMetricPattern1(client, _m(acc, 'sats')), - usd: createMetricPattern1(client, _m(acc, 'usd')), + sats: createSeriesPattern1(client, _m(acc, 'sats')), + usd: createSeriesPattern1(client, _m(acc, 'usd')), }; } /** * @typedef {Object} BtcCentsRelSatsUsdPattern2 - * @property {MetricPattern1} btc - * @property {MetricPattern1} cents + * @property {SeriesPattern1} btc + * @property {SeriesPattern1} cents * @property {BpsPercentRatioPattern3} relToOwn - * @property {MetricPattern1} sats - * @property {MetricPattern1} usd + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} usd */ /** * Create a BtcCentsRelSatsUsdPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BtcCentsRelSatsUsdPattern2} */ function createBtcCentsRelSatsUsdPattern2(client, acc) { return { - btc: createMetricPattern1(client, acc), - cents: createMetricPattern1(client, _m(acc, 'cents')), + btc: createSeriesPattern1(client, acc), + cents: createSeriesPattern1(client, _m(acc, 'cents')), relToOwn: createBpsPercentRatioPattern3(client, _m(acc, 'rel_to_own')), - sats: createMetricPattern1(client, _m(acc, 'sats')), - usd: createMetricPattern1(client, _m(acc, 'usd')), + sats: createSeriesPattern1(client, _m(acc, 'sats')), + usd: createSeriesPattern1(client, _m(acc, 'usd')), }; } @@ -2599,7 +2622,7 @@ function createBtcCentsRelSatsUsdPattern2(client, acc) { /** * Create a DeltaHalfInTotalPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {DeltaHalfInTotalPattern2} */ function createDeltaHalfInTotalPattern2(client, acc) { @@ -2614,11 +2637,11 @@ function createDeltaHalfInTotalPattern2(client, acc) { /** * @typedef {Object} EmaHistogramLineSignalPattern - * @property {MetricPattern1} emaFast - * @property {MetricPattern1} emaSlow - * @property {MetricPattern1} histogram - * @property {MetricPattern1} line - * @property {MetricPattern1} signal + * @property {SeriesPattern1} emaFast + * @property {SeriesPattern1} emaSlow + * @property {SeriesPattern1} histogram + * @property {SeriesPattern1} line + * @property {SeriesPattern1} signal */ /** @@ -2632,53 +2655,53 @@ function createDeltaHalfInTotalPattern2(client, acc) { /** * @typedef {Object} PhsReboundThsPattern - * @property {MetricPattern1} phs - * @property {MetricPattern1} phsMin + * @property {SeriesPattern1} phs + * @property {SeriesPattern1} phsMin * @property {BpsPercentRatioPattern} rebound - * @property {MetricPattern1} ths - * @property {MetricPattern1} thsMin + * @property {SeriesPattern1} ths + * @property {SeriesPattern1} thsMin */ /** * Create a PhsReboundThsPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {PhsReboundThsPattern} */ function createPhsReboundThsPattern(client, acc) { return { - phs: createMetricPattern1(client, _m(acc, 'phs')), - phsMin: createMetricPattern1(client, _m(acc, 'phs_min')), + phs: createSeriesPattern1(client, _m(acc, 'phs')), + phsMin: createSeriesPattern1(client, _m(acc, 'phs_min')), rebound: createBpsPercentRatioPattern(client, _m(acc, 'rebound')), - ths: createMetricPattern1(client, _m(acc, 'ths')), - thsMin: createMetricPattern1(client, _m(acc, 'ths_min')), + ths: createSeriesPattern1(client, _m(acc, 'ths')), + thsMin: createSeriesPattern1(client, _m(acc, 'ths_min')), }; } /** * @template T * @typedef {Object} _1m1w1y24hHeightPattern - * @property {MetricPattern1} _1m - * @property {MetricPattern1} _1w - * @property {MetricPattern1} _1y - * @property {MetricPattern1} _24h - * @property {MetricPattern18} height + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _24h + * @property {SeriesPattern18} height */ /** * Create a _1m1w1y24hHeightPattern pattern node * @template T * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y24hHeightPattern} */ function create_1m1w1y24hHeightPattern(client, acc) { return { - _1m: createMetricPattern1(client, _m(acc, 'average_1m')), - _1w: createMetricPattern1(client, _m(acc, 'average_1w')), - _1y: createMetricPattern1(client, _m(acc, 'average_1y')), - _24h: createMetricPattern1(client, _m(acc, 'average_24h')), - height: createMetricPattern18(client, acc), + _1m: createSeriesPattern1(client, _m(acc, 'average_1m')), + _1w: createSeriesPattern1(client, _m(acc, 'average_1w')), + _1y: createSeriesPattern1(client, _m(acc, 'average_1y')), + _24h: createSeriesPattern1(client, _m(acc, 'average_24h')), + height: createSeriesPattern18(client, acc), }; } @@ -2693,7 +2716,7 @@ function create_1m1w1y24hHeightPattern(client, acc) { /** * Create a _1m1w1y24hPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y24hPattern2} */ function create_1m1w1y24hPattern2(client, acc) { @@ -2716,7 +2739,7 @@ function create_1m1w1y24hPattern2(client, acc) { /** * Create a _1m1w1y24hPattern6 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y24hPattern6} */ function create_1m1w1y24hPattern6(client, acc) { @@ -2739,7 +2762,7 @@ function create_1m1w1y24hPattern6(client, acc) { /** * Create a _1m1w1y24hPattern5 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y24hPattern5} */ function create_1m1w1y24hPattern5(client, acc) { @@ -2762,7 +2785,7 @@ function create_1m1w1y24hPattern5(client, acc) { /** * Create a _1m1w1y2wPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y2wPattern} */ function create_1m1w1y2wPattern(client, acc) { @@ -2785,7 +2808,7 @@ function create_1m1w1y2wPattern(client, acc) { /** * Create a _1m1w1y24hPattern3 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y24hPattern3} */ function create_1m1w1y24hPattern3(client, acc) { @@ -2808,7 +2831,7 @@ function create_1m1w1y24hPattern3(client, acc) { /** * Create a _1m1w1y24hPattern4 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y24hPattern4} */ function create_1m1w1y24hPattern4(client, acc) { @@ -2847,7 +2870,7 @@ function create_1m1w1y24hPattern4(client, acc) { /** * Create a BaseCumulativeDeltaSumPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseCumulativeDeltaSumPattern} */ function createBaseCumulativeDeltaSumPattern(client, acc) { @@ -2863,14 +2886,14 @@ function createBaseCumulativeDeltaSumPattern(client, acc) { * @typedef {Object} BaseCumulativeNegativeSumPattern * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative - * @property {MetricPattern1} negative + * @property {SeriesPattern1} negative * @property {_1m1w1y24hPattern4} sum */ /** * Create a BaseCumulativeNegativeSumPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @param {string} disc - Discriminator suffix * @returns {BaseCumulativeNegativeSumPattern} */ @@ -2878,7 +2901,7 @@ function createBaseCumulativeNegativeSumPattern(client, acc, disc) { return { base: createCentsUsdPattern2(client, _m(acc, disc)), cumulative: createCentsUsdPattern2(client, _m(acc, `${disc}_cumulative`)), - negative: createMetricPattern1(client, _m(_m(acc, 'neg'), disc)), + negative: createSeriesPattern1(client, _m(_m(acc, 'neg'), disc)), sum: create_1m1w1y24hPattern4(client, _m(acc, `${disc}_sum`)), }; } @@ -2894,7 +2917,7 @@ function createBaseCumulativeNegativeSumPattern(client, acc, disc) { /** * Create a BothReactivatedReceivingSendingPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BothReactivatedReceivingSendingPattern} */ function createBothReactivatedReceivingSendingPattern(client, acc) { @@ -2908,78 +2931,78 @@ function createBothReactivatedReceivingSendingPattern(client, acc) { /** * @typedef {Object} BtcCentsSatsUsdPattern - * @property {MetricPattern1} btc - * @property {MetricPattern1} cents - * @property {MetricPattern1} sats - * @property {MetricPattern1} usd + * @property {SeriesPattern1} btc + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} usd */ /** * Create a BtcCentsSatsUsdPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BtcCentsSatsUsdPattern} */ function createBtcCentsSatsUsdPattern(client, acc) { return { - btc: createMetricPattern1(client, acc), - cents: createMetricPattern1(client, _m(acc, 'cents')), - sats: createMetricPattern1(client, _m(acc, 'sats')), - usd: createMetricPattern1(client, _m(acc, 'usd')), + btc: createSeriesPattern1(client, acc), + cents: createSeriesPattern1(client, _m(acc, 'cents')), + sats: createSeriesPattern1(client, _m(acc, 'sats')), + usd: createSeriesPattern1(client, _m(acc, 'usd')), }; } /** * @typedef {Object} CentsDeltaRelUsdPattern - * @property {MetricPattern1} cents + * @property {SeriesPattern1} cents * @property {AbsoluteRatePattern2} delta * @property {BpsPercentRatioPattern4} relToOwnMcap - * @property {MetricPattern1} usd + * @property {SeriesPattern1} usd */ /** * Create a CentsDeltaRelUsdPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CentsDeltaRelUsdPattern} */ function createCentsDeltaRelUsdPattern(client, acc) { return { - cents: createMetricPattern1(client, _m(acc, 'cents')), + cents: createSeriesPattern1(client, _m(acc, 'cents')), delta: createAbsoluteRatePattern2(client, _m(acc, 'delta')), relToOwnMcap: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_own_mcap')), - usd: createMetricPattern1(client, acc), + usd: createSeriesPattern1(client, acc), }; } /** * @typedef {Object} CentsRelUsdPattern2 - * @property {MetricPattern1} cents + * @property {SeriesPattern1} cents * @property {BpsPercentRatioPattern} relToOwnGross * @property {BpsPercentRatioPattern} relToOwnMcap - * @property {MetricPattern1} usd + * @property {SeriesPattern1} usd */ /** * Create a CentsRelUsdPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CentsRelUsdPattern2} */ function createCentsRelUsdPattern2(client, acc) { return { - cents: createMetricPattern1(client, _m(acc, 'cents')), + cents: createSeriesPattern1(client, _m(acc, 'cents')), relToOwnGross: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_own_gross_pnl')), relToOwnMcap: createBpsPercentRatioPattern(client, _m(acc, 'rel_to_own_mcap')), - usd: createMetricPattern1(client, acc), + usd: createSeriesPattern1(client, acc), }; } /** * @typedef {Object} CoindaysCoinyearsDormancySentPattern * @property {BaseCumulativeSumPattern} coindaysDestroyed - * @property {MetricPattern1} coinyearsDestroyed - * @property {MetricPattern1} dormancy + * @property {SeriesPattern1} coinyearsDestroyed + * @property {SeriesPattern1} dormancy * @property {BaseCumulativeInSumPattern} sent */ @@ -2994,7 +3017,7 @@ function createCentsRelUsdPattern2(client, acc) { /** * Create a LossNetNuplProfitPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {LossNetNuplProfitPattern} */ function createLossNetNuplProfitPattern(client, acc) { @@ -3017,7 +3040,7 @@ function createLossNetNuplProfitPattern(client, acc) { /** * Create a OutputsRealizedSupplyUnrealizedPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {OutputsRealizedSupplyUnrealizedPattern2} */ function createOutputsRealizedSupplyUnrealizedPattern2(client, acc) { @@ -3040,7 +3063,7 @@ function createOutputsRealizedSupplyUnrealizedPattern2(client, acc) { /** * Create a OutputsRealizedSupplyUnrealizedPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {OutputsRealizedSupplyUnrealizedPattern} */ function createOutputsRealizedSupplyUnrealizedPattern(client, acc) { @@ -3055,25 +3078,25 @@ function createOutputsRealizedSupplyUnrealizedPattern(client, acc) { /** * @template T * @typedef {Object} _1m1w1y24hPattern - * @property {MetricPattern1} _1m - * @property {MetricPattern1} _1w - * @property {MetricPattern1} _1y - * @property {MetricPattern1} _24h + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1y + * @property {SeriesPattern1} _24h */ /** * Create a _1m1w1y24hPattern pattern node * @template T * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_1m1w1y24hPattern} */ function create_1m1w1y24hPattern(client, acc) { return { - _1m: createMetricPattern1(client, _m(acc, '1m')), - _1w: createMetricPattern1(client, _m(acc, '1w')), - _1y: createMetricPattern1(client, _m(acc, '1y')), - _24h: createMetricPattern1(client, _m(acc, '24h')), + _1m: createSeriesPattern1(client, _m(acc, '1m')), + _1w: createSeriesPattern1(client, _m(acc, '1w')), + _1y: createSeriesPattern1(client, _m(acc, '1y')), + _24h: createSeriesPattern1(client, _m(acc, '24h')), }; } @@ -3087,7 +3110,7 @@ function create_1m1w1y24hPattern(client, acc) { /** * Create a BaseCumulativeSumPattern4 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseCumulativeSumPattern4} */ function createBaseCumulativeSumPattern4(client, acc) { @@ -3100,21 +3123,21 @@ function createBaseCumulativeSumPattern4(client, acc) { /** * @typedef {Object} BaseCumulativeRelPattern - * @property {MetricPattern1} base - * @property {MetricPattern1} cumulative + * @property {SeriesPattern1} base + * @property {SeriesPattern1} cumulative * @property {BpsPercentRatioPattern4} relToRcap */ /** * Create a BaseCumulativeRelPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseCumulativeRelPattern} */ function createBaseCumulativeRelPattern(client, acc) { return { - base: createMetricPattern1(client, acc), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + base: createSeriesPattern1(client, acc), + cumulative: createSeriesPattern1(client, _m(acc, 'cumulative')), relToRcap: createBpsPercentRatioPattern4(client, _m(acc, 'rel_to_rcap')), }; } @@ -3129,7 +3152,7 @@ function createBaseCumulativeRelPattern(client, acc) { /** * Create a BaseCumulativeSumPattern3 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseCumulativeSumPattern3} */ function createBaseCumulativeSumPattern3(client, acc) { @@ -3142,21 +3165,21 @@ function createBaseCumulativeSumPattern3(client, acc) { /** * @typedef {Object} BaseCumulativeSumPattern2 - * @property {MetricPattern1} base - * @property {MetricPattern1} cumulative + * @property {SeriesPattern1} base + * @property {SeriesPattern1} cumulative * @property {_1m1w1y24hPattern} sum */ /** * Create a BaseCumulativeSumPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseCumulativeSumPattern2} */ function createBaseCumulativeSumPattern2(client, acc) { return { - base: createMetricPattern1(client, acc), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + base: createSeriesPattern1(client, acc), + cumulative: createSeriesPattern1(client, _m(acc, 'cumulative')), sum: create_1m1w1y24hPattern(client, _m(acc, 'sum')), }; } @@ -3171,7 +3194,7 @@ function createBaseCumulativeSumPattern2(client, acc) { /** * Create a BlocksDominanceRewardsPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BlocksDominanceRewardsPattern} */ function createBlocksDominanceRewardsPattern(client, acc) { @@ -3184,170 +3207,170 @@ function createBlocksDominanceRewardsPattern(client, acc) { /** * @typedef {Object} BpsPercentRatioPattern3 - * @property {MetricPattern1} bps - * @property {MetricPattern1} percent - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} percent + * @property {SeriesPattern1} ratio */ /** * Create a BpsPercentRatioPattern3 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BpsPercentRatioPattern3} */ function createBpsPercentRatioPattern3(client, acc) { return { - bps: createMetricPattern1(client, _m(acc, 'bps')), - percent: createMetricPattern1(client, acc), - ratio: createMetricPattern1(client, _m(acc, 'ratio')), + bps: createSeriesPattern1(client, _m(acc, 'bps')), + percent: createSeriesPattern1(client, acc), + ratio: createSeriesPattern1(client, _m(acc, 'ratio')), }; } /** * @typedef {Object} BpsPercentRatioPattern4 - * @property {MetricPattern1} bps - * @property {MetricPattern1} percent - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} percent + * @property {SeriesPattern1} ratio */ /** * Create a BpsPercentRatioPattern4 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BpsPercentRatioPattern4} */ function createBpsPercentRatioPattern4(client, acc) { return { - bps: createMetricPattern1(client, _m(acc, 'bps')), - percent: createMetricPattern1(client, acc), - ratio: createMetricPattern1(client, _m(acc, 'ratio')), + bps: createSeriesPattern1(client, _m(acc, 'bps')), + percent: createSeriesPattern1(client, acc), + ratio: createSeriesPattern1(client, _m(acc, 'ratio')), }; } /** * @typedef {Object} BpsPriceRatioPattern - * @property {MetricPattern1} bps + * @property {SeriesPattern1} bps * @property {CentsSatsUsdPattern} price - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} ratio */ /** * Create a BpsPriceRatioPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @param {string} disc - Discriminator suffix * @returns {BpsPriceRatioPattern} */ function createBpsPriceRatioPattern(client, acc, disc) { return { - bps: createMetricPattern1(client, _m(acc, `ratio_${disc}_bps`)), + bps: createSeriesPattern1(client, _m(acc, `ratio_${disc}_bps`)), price: createCentsSatsUsdPattern(client, _m(acc, disc)), - ratio: createMetricPattern1(client, _m(_m(acc, 'ratio'), disc)), + ratio: createSeriesPattern1(client, _m(_m(acc, 'ratio'), disc)), }; } /** * @typedef {Object} BpsPercentRatioPattern5 - * @property {MetricPattern1} bps - * @property {MetricPattern1} percent - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} percent + * @property {SeriesPattern1} ratio */ /** * Create a BpsPercentRatioPattern5 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BpsPercentRatioPattern5} */ function createBpsPercentRatioPattern5(client, acc) { return { - bps: createMetricPattern1(client, _m(acc, 'bps')), - percent: createMetricPattern1(client, acc), - ratio: createMetricPattern1(client, _m(acc, 'ratio')), + bps: createSeriesPattern1(client, _m(acc, 'bps')), + percent: createSeriesPattern1(client, acc), + ratio: createSeriesPattern1(client, _m(acc, 'ratio')), }; } /** * @typedef {Object} BpsPercentRatioPattern - * @property {MetricPattern1} bps - * @property {MetricPattern1} percent - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} percent + * @property {SeriesPattern1} ratio */ /** * Create a BpsPercentRatioPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BpsPercentRatioPattern} */ function createBpsPercentRatioPattern(client, acc) { return { - bps: createMetricPattern1(client, _m(acc, 'bps')), - percent: createMetricPattern1(client, acc), - ratio: createMetricPattern1(client, _m(acc, 'ratio')), + bps: createSeriesPattern1(client, _m(acc, 'bps')), + percent: createSeriesPattern1(client, acc), + ratio: createSeriesPattern1(client, _m(acc, 'ratio')), }; } /** * @typedef {Object} CentsSatsUsdPattern3 - * @property {MetricPattern2} cents - * @property {MetricPattern2} sats - * @property {MetricPattern2} usd + * @property {SeriesPattern2} cents + * @property {SeriesPattern2} sats + * @property {SeriesPattern2} usd */ /** * Create a CentsSatsUsdPattern3 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CentsSatsUsdPattern3} */ function createCentsSatsUsdPattern3(client, acc) { return { - cents: createMetricPattern2(client, _m(acc, 'cents')), - sats: createMetricPattern2(client, _m(acc, 'sats')), - usd: createMetricPattern2(client, acc), + cents: createSeriesPattern2(client, _m(acc, 'cents')), + sats: createSeriesPattern2(client, _m(acc, 'sats')), + usd: createSeriesPattern2(client, acc), }; } /** * @typedef {Object} CentsDeltaUsdPattern - * @property {MetricPattern1} cents + * @property {SeriesPattern1} cents * @property {AbsoluteRatePattern2} delta - * @property {MetricPattern1} usd + * @property {SeriesPattern1} usd */ /** * Create a CentsDeltaUsdPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CentsDeltaUsdPattern} */ function createCentsDeltaUsdPattern(client, acc) { return { - cents: createMetricPattern1(client, _m(acc, 'cents')), + cents: createSeriesPattern1(client, _m(acc, 'cents')), delta: createAbsoluteRatePattern2(client, _m(acc, 'delta')), - usd: createMetricPattern1(client, acc), + usd: createSeriesPattern1(client, acc), }; } /** * @typedef {Object} CentsSatsUsdPattern - * @property {MetricPattern1} cents - * @property {MetricPattern1} sats - * @property {MetricPattern1} usd + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} usd */ /** * Create a CentsSatsUsdPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CentsSatsUsdPattern} */ function createCentsSatsUsdPattern(client, acc) { return { - cents: createMetricPattern1(client, _m(acc, 'cents')), - sats: createMetricPattern1(client, _m(acc, 'sats')), - usd: createMetricPattern1(client, acc), + cents: createSeriesPattern1(client, _m(acc, 'cents')), + sats: createSeriesPattern1(client, _m(acc, 'sats')), + usd: createSeriesPattern1(client, acc), }; } @@ -3361,7 +3384,7 @@ function createCentsSatsUsdPattern(client, acc) { /** * Create a DeltaHalfTotalPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {DeltaHalfTotalPattern} */ function createDeltaHalfTotalPattern(client, acc) { @@ -3389,7 +3412,7 @@ function createDeltaHalfTotalPattern(client, acc) { /** * Create a LossNuplProfitPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {LossNuplProfitPattern} */ function createLossNuplProfitPattern(client, acc) { @@ -3417,7 +3440,7 @@ function createLossNuplProfitPattern(client, acc) { /** * Create a NuplRealizedSupplyPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {NuplRealizedSupplyPattern} */ function createNuplRealizedSupplyPattern(client, acc) { @@ -3445,7 +3468,7 @@ function createNuplRealizedSupplyPattern(client, acc) { /** * Create a RatioValuePattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {RatioValuePattern} */ function createRatioValuePattern(client, acc) { @@ -3461,29 +3484,29 @@ function createRatioValuePattern(client, acc) { * @typedef {Object} _6bBlockTxPattern * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2} _6b * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2} block - * @property {MetricPattern19} txIndex + * @property {SeriesPattern19} txIndex */ /** * Create a _6bBlockTxPattern pattern node * @template T * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_6bBlockTxPattern} */ function create_6bBlockTxPattern(client, acc) { return { _6b: createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(client, _m(acc, '6b')), block: createAverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(client, acc), - txIndex: createMetricPattern19(client, acc), + txIndex: createSeriesPattern19(client, acc), }; } /** * @template T * @typedef {Object} BaseCumulativeSumPattern - * @property {MetricPattern1} base - * @property {MetricPattern1} cumulative + * @property {SeriesPattern1} base + * @property {SeriesPattern1} cumulative * @property {_1m1w1y24hPattern} sum */ @@ -3491,13 +3514,13 @@ function create_6bBlockTxPattern(client, acc) { * Create a BaseCumulativeSumPattern pattern node * @template T * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BaseCumulativeSumPattern} */ function createBaseCumulativeSumPattern(client, acc) { return { - base: createMetricPattern1(client, acc), - cumulative: createMetricPattern1(client, _m(acc, 'cumulative')), + base: createSeriesPattern1(client, acc), + cumulative: createSeriesPattern1(client, _m(acc, 'cumulative')), sum: create_1m1w1y24hPattern(client, _m(acc, 'sum')), }; } @@ -3511,7 +3534,7 @@ function createBaseCumulativeSumPattern(client, acc) { /** * Create a AbsoluteRatePattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AbsoluteRatePattern} */ function createAbsoluteRatePattern(client, acc) { @@ -3530,7 +3553,7 @@ function createAbsoluteRatePattern(client, acc) { /** * Create a AbsoluteRatePattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AbsoluteRatePattern2} */ function createAbsoluteRatePattern2(client, acc) { @@ -3549,7 +3572,7 @@ function createAbsoluteRatePattern2(client, acc) { /** * Create a AllSthPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AllSthPattern2} */ function createAllSthPattern2(client, acc) { @@ -3561,20 +3584,20 @@ function createAllSthPattern2(client, acc) { /** * @typedef {Object} AllSthPattern - * @property {MetricPattern1} all - * @property {MetricPattern1} sth + * @property {SeriesPattern1} all + * @property {SeriesPattern1} sth */ /** * Create a AllSthPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {AllSthPattern} */ function createAllSthPattern(client, acc) { return { - all: createMetricPattern1(client, _m(acc, 'realized_cap')), - sth: createMetricPattern1(client, _m(acc, 'sth_realized_cap')), + all: createSeriesPattern1(client, _m(acc, 'realized_cap')), + sth: createSeriesPattern1(client, _m(acc, 'sth_realized_cap')), }; } @@ -3587,7 +3610,7 @@ function createAllSthPattern(client, acc) { /** * Create a BlocksDominancePattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BlocksDominancePattern} */ function createBlocksDominancePattern(client, acc) { @@ -3599,77 +3622,77 @@ function createBlocksDominancePattern(client, acc) { /** * @typedef {Object} BpsRatioPattern2 - * @property {MetricPattern1} bps - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} ratio */ /** * Create a BpsRatioPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BpsRatioPattern2} */ function createBpsRatioPattern2(client, acc) { return { - bps: createMetricPattern1(client, _m(acc, 'bps')), - ratio: createMetricPattern1(client, acc), + bps: createSeriesPattern1(client, _m(acc, 'bps')), + ratio: createSeriesPattern1(client, acc), }; } /** * @typedef {Object} BpsRatioPattern - * @property {MetricPattern1} bps - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} ratio */ /** * Create a BpsRatioPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {BpsRatioPattern} */ function createBpsRatioPattern(client, acc) { return { - bps: createMetricPattern1(client, _m(acc, 'bps')), - ratio: createMetricPattern1(client, acc), + bps: createSeriesPattern1(client, _m(acc, 'bps')), + ratio: createSeriesPattern1(client, acc), }; } /** * @typedef {Object} CentsUsdPattern2 - * @property {MetricPattern1} cents - * @property {MetricPattern1} usd + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} usd */ /** * Create a CentsUsdPattern2 pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CentsUsdPattern2} */ function createCentsUsdPattern2(client, acc) { return { - cents: createMetricPattern1(client, _m(acc, 'cents')), - usd: createMetricPattern1(client, acc), + cents: createSeriesPattern1(client, _m(acc, 'cents')), + usd: createSeriesPattern1(client, acc), }; } /** * @typedef {Object} CentsUsdPattern - * @property {MetricPattern1} cents - * @property {MetricPattern1} usd + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} usd */ /** * Create a CentsUsdPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CentsUsdPattern} */ function createCentsUsdPattern(client, acc) { return { - cents: createMetricPattern1(client, _m(acc, 'cents')), - usd: createMetricPattern1(client, acc), + cents: createSeriesPattern1(client, _m(acc, 'cents')), + usd: createSeriesPattern1(client, acc), }; } @@ -3682,7 +3705,7 @@ function createCentsUsdPattern(client, acc) { /** * Create a CoindaysSentPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {CoindaysSentPattern} */ function createCoindaysSentPattern(client, acc) { @@ -3695,19 +3718,19 @@ function createCoindaysSentPattern(client, acc) { /** * @typedef {Object} DeltaInnerPattern * @property {AbsoluteRatePattern} delta - * @property {MetricPattern1} inner + * @property {SeriesPattern1} inner */ /** * Create a DeltaInnerPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {DeltaInnerPattern} */ function createDeltaInnerPattern(client, acc) { return { delta: createAbsoluteRatePattern(client, _m(acc, 'delta')), - inner: createMetricPattern1(client, acc), + inner: createSeriesPattern1(client, acc), }; } @@ -3720,7 +3743,7 @@ function createDeltaInnerPattern(client, acc) { /** * Create a InPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {InPattern} */ function createInPattern(client, acc) { @@ -3733,20 +3756,20 @@ function createInPattern(client, acc) { /** * @typedef {Object} PriceRatioPattern * @property {CentsSatsUsdPattern} price - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} ratio */ /** * Create a PriceRatioPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @param {string} disc - Discriminator suffix * @returns {PriceRatioPattern} */ function createPriceRatioPattern(client, acc, disc) { return { price: createCentsSatsUsdPattern(client, _m(acc, disc)), - ratio: createMetricPattern1(client, _m(_m(acc, 'ratio'), disc)), + ratio: createSeriesPattern1(client, _m(_m(acc, 'ratio'), disc)), }; } @@ -3759,7 +3782,7 @@ function createPriceRatioPattern(client, acc, disc) { /** * Create a RelPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {RelPattern} */ function createRelPattern(client, acc) { @@ -3771,8 +3794,8 @@ function createRelPattern(client, acc) { /** * @typedef {Object} SdSmaPattern - * @property {MetricPattern1} sd - * @property {MetricPattern1} sma + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} sma */ /** @@ -3784,7 +3807,7 @@ function createRelPattern(client, acc) { /** * Create a ValuePattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {ValuePattern} */ function createValuePattern(client, acc) { @@ -3796,18 +3819,18 @@ function createValuePattern(client, acc) { /** * @typedef {Object} _24hPattern - * @property {MetricPattern1} _24h + * @property {SeriesPattern1} _24h */ /** * Create a _24hPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {_24hPattern} */ function create_24hPattern(client, acc) { return { - _24h: createMetricPattern1(client, acc), + _24h: createSeriesPattern1(client, acc), }; } @@ -3819,7 +3842,7 @@ function create_24hPattern(client, acc) { /** * Create a NuplPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {NuplPattern} */ function createNuplPattern(client, acc) { @@ -3836,7 +3859,7 @@ function createNuplPattern(client, acc) { /** * Create a UnspentPattern pattern node * @param {BrkClientBase} client - * @param {string} acc - Accumulated metric name + * @param {string} acc - Accumulated series name * @returns {UnspentPattern} */ function createUnspentPattern(client, acc) { @@ -3848,61 +3871,61 @@ function createUnspentPattern(client, acc) { // Catalog tree typedefs /** - * @typedef {Object} MetricsTree - * @property {MetricsTree_Blocks} blocks - * @property {MetricsTree_Transactions} transactions - * @property {MetricsTree_Inputs} inputs - * @property {MetricsTree_Outputs} outputs - * @property {MetricsTree_Addresses} addresses - * @property {MetricsTree_Scripts} scripts - * @property {MetricsTree_Mining} mining - * @property {MetricsTree_Cointime} cointime - * @property {MetricsTree_Constants} constants - * @property {MetricsTree_Indexes} indexes - * @property {MetricsTree_Indicators} indicators - * @property {MetricsTree_Market} market - * @property {MetricsTree_Pools} pools - * @property {MetricsTree_Prices} prices - * @property {MetricsTree_Supply} supply - * @property {MetricsTree_Cohorts} cohorts + * @typedef {Object} SeriesTree + * @property {SeriesTree_Blocks} blocks + * @property {SeriesTree_Transactions} transactions + * @property {SeriesTree_Inputs} inputs + * @property {SeriesTree_Outputs} outputs + * @property {SeriesTree_Addresses} addresses + * @property {SeriesTree_Scripts} scripts + * @property {SeriesTree_Mining} mining + * @property {SeriesTree_Cointime} cointime + * @property {SeriesTree_Constants} constants + * @property {SeriesTree_Indexes} indexes + * @property {SeriesTree_Indicators} indicators + * @property {SeriesTree_Market} market + * @property {SeriesTree_Pools} pools + * @property {SeriesTree_Prices} prices + * @property {SeriesTree_Supply} supply + * @property {SeriesTree_Cohorts} cohorts */ /** - * @typedef {Object} MetricsTree_Blocks - * @property {MetricPattern18} blockhash - * @property {MetricsTree_Blocks_Difficulty} difficulty - * @property {MetricsTree_Blocks_Time} time - * @property {MetricsTree_Blocks_Size} size - * @property {MetricsTree_Blocks_Weight} weight - * @property {MetricsTree_Blocks_Count} count - * @property {MetricsTree_Blocks_Lookback} lookback + * @typedef {Object} SeriesTree_Blocks + * @property {SeriesPattern18} blockhash + * @property {SeriesTree_Blocks_Difficulty} difficulty + * @property {SeriesTree_Blocks_Time} time + * @property {SeriesTree_Blocks_Size} size + * @property {SeriesTree_Blocks_Weight} weight + * @property {SeriesTree_Blocks_Count} count + * @property {SeriesTree_Blocks_Lookback} lookback * @property {_1m1w1y24hHeightPattern} interval * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} vbytes - * @property {MetricsTree_Blocks_Fullness} fullness - * @property {MetricsTree_Blocks_Halving} halving + * @property {SeriesTree_Blocks_Fullness} fullness + * @property {SeriesTree_Blocks_Halving} halving */ /** - * @typedef {Object} MetricsTree_Blocks_Difficulty - * @property {MetricPattern1} value - * @property {MetricPattern1} asHash + * @typedef {Object} SeriesTree_Blocks_Difficulty + * @property {SeriesPattern1} value + * @property {SeriesPattern1} asHash * @property {BpsPercentRatioPattern} adjustment - * @property {MetricPattern1} epoch - * @property {MetricPattern1} blocksBeforeNext - * @property {MetricPattern1} daysBeforeNext + * @property {SeriesPattern1} epoch + * @property {SeriesPattern1} blocksBeforeNext + * @property {SeriesPattern1} daysBeforeNext */ /** - * @typedef {Object} MetricsTree_Blocks_Time - * @property {MetricPattern1} timestamp - * @property {MetricPattern18} date - * @property {MetricPattern18} timestampMonotonic + * @typedef {Object} SeriesTree_Blocks_Time + * @property {SeriesPattern1} timestamp + * @property {SeriesPattern18} date + * @property {SeriesPattern18} timestampMonotonic */ /** - * @typedef {Object} MetricsTree_Blocks_Size - * @property {MetricPattern18} total - * @property {MetricPattern1} cumulative + * @typedef {Object} SeriesTree_Blocks_Size + * @property {SeriesPattern18} total + * @property {SeriesPattern1} cumulative * @property {_1m1w1y24hPattern} sum * @property {_1m1w1y24hPattern} average * @property {_1m1w1y24hPattern} min @@ -3915,9 +3938,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Blocks_Weight - * @property {MetricPattern18} raw - * @property {MetricPattern1} cumulative + * @typedef {Object} SeriesTree_Blocks_Weight + * @property {SeriesPattern18} raw + * @property {SeriesPattern1} cumulative * @property {_1m1w1y24hPattern} sum * @property {_1m1w1y24hPattern} average * @property {_1m1w1y24hPattern} min @@ -3930,276 +3953,276 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Blocks_Count - * @property {MetricPattern1} target + * @typedef {Object} SeriesTree_Blocks_Count + * @property {SeriesPattern1} target * @property {BaseCumulativeSumPattern2} total */ /** - * @typedef {Object} MetricsTree_Blocks_Lookback - * @property {MetricPattern18} _1h - * @property {MetricPattern18} _24h - * @property {MetricPattern18} _3d - * @property {MetricPattern18} _1w - * @property {MetricPattern18} _8d - * @property {MetricPattern18} _9d - * @property {MetricPattern18} _12d - * @property {MetricPattern18} _13d - * @property {MetricPattern18} _2w - * @property {MetricPattern18} _21d - * @property {MetricPattern18} _26d - * @property {MetricPattern18} _1m - * @property {MetricPattern18} _34d - * @property {MetricPattern18} _55d - * @property {MetricPattern18} _2m - * @property {MetricPattern18} _9w - * @property {MetricPattern18} _12w - * @property {MetricPattern18} _89d - * @property {MetricPattern18} _3m - * @property {MetricPattern18} _14w - * @property {MetricPattern18} _111d - * @property {MetricPattern18} _144d - * @property {MetricPattern18} _6m - * @property {MetricPattern18} _26w - * @property {MetricPattern18} _200d - * @property {MetricPattern18} _9m - * @property {MetricPattern18} _350d - * @property {MetricPattern18} _12m - * @property {MetricPattern18} _1y - * @property {MetricPattern18} _14m - * @property {MetricPattern18} _2y - * @property {MetricPattern18} _26m - * @property {MetricPattern18} _3y - * @property {MetricPattern18} _200w - * @property {MetricPattern18} _4y - * @property {MetricPattern18} _5y - * @property {MetricPattern18} _6y - * @property {MetricPattern18} _8y - * @property {MetricPattern18} _9y - * @property {MetricPattern18} _10y - * @property {MetricPattern18} _12y - * @property {MetricPattern18} _14y - * @property {MetricPattern18} _26y + * @typedef {Object} SeriesTree_Blocks_Lookback + * @property {SeriesPattern18} _1h + * @property {SeriesPattern18} _24h + * @property {SeriesPattern18} _3d + * @property {SeriesPattern18} _1w + * @property {SeriesPattern18} _8d + * @property {SeriesPattern18} _9d + * @property {SeriesPattern18} _12d + * @property {SeriesPattern18} _13d + * @property {SeriesPattern18} _2w + * @property {SeriesPattern18} _21d + * @property {SeriesPattern18} _26d + * @property {SeriesPattern18} _1m + * @property {SeriesPattern18} _34d + * @property {SeriesPattern18} _55d + * @property {SeriesPattern18} _2m + * @property {SeriesPattern18} _9w + * @property {SeriesPattern18} _12w + * @property {SeriesPattern18} _89d + * @property {SeriesPattern18} _3m + * @property {SeriesPattern18} _14w + * @property {SeriesPattern18} _111d + * @property {SeriesPattern18} _144d + * @property {SeriesPattern18} _6m + * @property {SeriesPattern18} _26w + * @property {SeriesPattern18} _200d + * @property {SeriesPattern18} _9m + * @property {SeriesPattern18} _350d + * @property {SeriesPattern18} _12m + * @property {SeriesPattern18} _1y + * @property {SeriesPattern18} _14m + * @property {SeriesPattern18} _2y + * @property {SeriesPattern18} _26m + * @property {SeriesPattern18} _3y + * @property {SeriesPattern18} _200w + * @property {SeriesPattern18} _4y + * @property {SeriesPattern18} _5y + * @property {SeriesPattern18} _6y + * @property {SeriesPattern18} _8y + * @property {SeriesPattern18} _9y + * @property {SeriesPattern18} _10y + * @property {SeriesPattern18} _12y + * @property {SeriesPattern18} _14y + * @property {SeriesPattern18} _26y */ /** - * @typedef {Object} MetricsTree_Blocks_Fullness + * @typedef {Object} SeriesTree_Blocks_Fullness * @property {_1m1w1y24hHeightPattern} bps - * @property {MetricPattern1} ratio - * @property {MetricPattern1} percent + * @property {SeriesPattern1} ratio + * @property {SeriesPattern1} percent */ /** - * @typedef {Object} MetricsTree_Blocks_Halving - * @property {MetricPattern1} epoch - * @property {MetricPattern1} blocksBeforeNext - * @property {MetricPattern1} daysBeforeNext + * @typedef {Object} SeriesTree_Blocks_Halving + * @property {SeriesPattern1} epoch + * @property {SeriesPattern1} blocksBeforeNext + * @property {SeriesPattern1} daysBeforeNext */ /** - * @typedef {Object} MetricsTree_Transactions - * @property {MetricsTree_Transactions_Raw} raw - * @property {MetricsTree_Transactions_Count} count - * @property {MetricsTree_Transactions_Size} size - * @property {MetricsTree_Transactions_Fees} fees - * @property {MetricsTree_Transactions_Versions} versions - * @property {MetricsTree_Transactions_Volume} volume + * @typedef {Object} SeriesTree_Transactions + * @property {SeriesTree_Transactions_Raw} raw + * @property {SeriesTree_Transactions_Count} count + * @property {SeriesTree_Transactions_Size} size + * @property {SeriesTree_Transactions_Fees} fees + * @property {SeriesTree_Transactions_Versions} versions + * @property {SeriesTree_Transactions_Volume} volume */ /** - * @typedef {Object} MetricsTree_Transactions_Raw - * @property {MetricPattern18} firstTxIndex - * @property {MetricPattern19} height - * @property {MetricPattern19} txid - * @property {MetricPattern19} txVersion - * @property {MetricPattern19} rawLocktime - * @property {MetricPattern19} baseSize - * @property {MetricPattern19} totalSize - * @property {MetricPattern19} isExplicitlyRbf - * @property {MetricPattern19} firstTxinIndex - * @property {MetricPattern19} firstTxoutIndex + * @typedef {Object} SeriesTree_Transactions_Raw + * @property {SeriesPattern18} firstTxIndex + * @property {SeriesPattern19} height + * @property {SeriesPattern19} txid + * @property {SeriesPattern19} txVersion + * @property {SeriesPattern19} rawLocktime + * @property {SeriesPattern19} baseSize + * @property {SeriesPattern19} totalSize + * @property {SeriesPattern19} isExplicitlyRbf + * @property {SeriesPattern19} firstTxinIndex + * @property {SeriesPattern19} firstTxoutIndex */ /** - * @typedef {Object} MetricsTree_Transactions_Count + * @typedef {Object} SeriesTree_Transactions_Count * @property {AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern} total - * @property {MetricPattern19} isCoinbase + * @property {SeriesPattern19} isCoinbase */ /** - * @typedef {Object} MetricsTree_Transactions_Size + * @typedef {Object} SeriesTree_Transactions_Size * @property {_6bBlockTxPattern} vsize * @property {_6bBlockTxPattern} weight */ /** - * @typedef {Object} MetricsTree_Transactions_Fees - * @property {MetricPattern19} inputValue - * @property {MetricPattern19} outputValue + * @typedef {Object} SeriesTree_Transactions_Fees + * @property {SeriesPattern19} inputValue + * @property {SeriesPattern19} outputValue * @property {_6bBlockTxPattern} fee * @property {_6bBlockTxPattern} feeRate */ /** - * @typedef {Object} MetricsTree_Transactions_Versions + * @typedef {Object} SeriesTree_Transactions_Versions * @property {BaseCumulativeSumPattern} v1 * @property {BaseCumulativeSumPattern} v2 * @property {BaseCumulativeSumPattern} v3 */ /** - * @typedef {Object} MetricsTree_Transactions_Volume + * @typedef {Object} SeriesTree_Transactions_Volume * @property {BaseCumulativeSumPattern4} sentSum * @property {BaseCumulativeSumPattern4} receivedSum - * @property {MetricPattern1} txPerSec - * @property {MetricPattern1} outputsPerSec - * @property {MetricPattern1} inputsPerSec + * @property {SeriesPattern1} txPerSec + * @property {SeriesPattern1} outputsPerSec + * @property {SeriesPattern1} inputsPerSec */ /** - * @typedef {Object} MetricsTree_Inputs - * @property {MetricsTree_Inputs_Raw} raw - * @property {MetricsTree_Inputs_Spent} spent + * @typedef {Object} SeriesTree_Inputs + * @property {SeriesTree_Inputs_Raw} raw + * @property {SeriesTree_Inputs_Spent} spent * @property {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern} count */ /** - * @typedef {Object} MetricsTree_Inputs_Raw - * @property {MetricPattern18} firstTxinIndex - * @property {MetricPattern20} outpoint - * @property {MetricPattern20} txIndex - * @property {MetricPattern20} outputType - * @property {MetricPattern20} typeIndex + * @typedef {Object} SeriesTree_Inputs_Raw + * @property {SeriesPattern18} firstTxinIndex + * @property {SeriesPattern20} outpoint + * @property {SeriesPattern20} txIndex + * @property {SeriesPattern20} outputType + * @property {SeriesPattern20} typeIndex */ /** - * @typedef {Object} MetricsTree_Inputs_Spent - * @property {MetricPattern20} txoutIndex - * @property {MetricPattern20} value + * @typedef {Object} SeriesTree_Inputs_Spent + * @property {SeriesPattern20} txoutIndex + * @property {SeriesPattern20} value */ /** - * @typedef {Object} MetricsTree_Outputs - * @property {MetricsTree_Outputs_Raw} raw - * @property {MetricsTree_Outputs_Spent} spent - * @property {MetricsTree_Outputs_Count} count + * @typedef {Object} SeriesTree_Outputs + * @property {SeriesTree_Outputs_Raw} raw + * @property {SeriesTree_Outputs_Spent} spent + * @property {SeriesTree_Outputs_Count} count */ /** - * @typedef {Object} MetricsTree_Outputs_Raw - * @property {MetricPattern18} firstTxoutIndex - * @property {MetricPattern21} value - * @property {MetricPattern21} outputType - * @property {MetricPattern21} typeIndex - * @property {MetricPattern21} txIndex + * @typedef {Object} SeriesTree_Outputs_Raw + * @property {SeriesPattern18} firstTxoutIndex + * @property {SeriesPattern21} value + * @property {SeriesPattern21} outputType + * @property {SeriesPattern21} typeIndex + * @property {SeriesPattern21} txIndex */ /** - * @typedef {Object} MetricsTree_Outputs_Spent - * @property {MetricPattern21} txinIndex + * @typedef {Object} SeriesTree_Outputs_Spent + * @property {SeriesPattern21} txinIndex */ /** - * @typedef {Object} MetricsTree_Outputs_Count + * @typedef {Object} SeriesTree_Outputs_Count * @property {AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern} total - * @property {MetricPattern1} unspent + * @property {SeriesPattern1} unspent */ /** - * @typedef {Object} MetricsTree_Addresses - * @property {MetricsTree_Addresses_Raw} raw - * @property {MetricsTree_Addresses_Indexes} indexes - * @property {MetricsTree_Addresses_Data} data + * @typedef {Object} SeriesTree_Addresses + * @property {SeriesTree_Addresses_Raw} raw + * @property {SeriesTree_Addresses_Indexes} indexes + * @property {SeriesTree_Addresses_Data} data * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3} funded * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3} empty - * @property {MetricsTree_Addresses_Activity} activity + * @property {SeriesTree_Addresses_Activity} activity * @property {AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3} total - * @property {MetricsTree_Addresses_New} new - * @property {MetricsTree_Addresses_Delta} delta + * @property {SeriesTree_Addresses_New} new + * @property {SeriesTree_Addresses_Delta} delta */ /** - * @typedef {Object} MetricsTree_Addresses_Raw - * @property {MetricsTree_Addresses_Raw_P2pk65} p2pk65 - * @property {MetricsTree_Addresses_Raw_P2pk33} p2pk33 - * @property {MetricsTree_Addresses_Raw_P2pkh} p2pkh - * @property {MetricsTree_Addresses_Raw_P2sh} p2sh - * @property {MetricsTree_Addresses_Raw_P2wpkh} p2wpkh - * @property {MetricsTree_Addresses_Raw_P2wsh} p2wsh - * @property {MetricsTree_Addresses_Raw_P2tr} p2tr - * @property {MetricsTree_Addresses_Raw_P2a} p2a + * @typedef {Object} SeriesTree_Addresses_Raw + * @property {SeriesTree_Addresses_Raw_P2pk65} p2pk65 + * @property {SeriesTree_Addresses_Raw_P2pk33} p2pk33 + * @property {SeriesTree_Addresses_Raw_P2pkh} p2pkh + * @property {SeriesTree_Addresses_Raw_P2sh} p2sh + * @property {SeriesTree_Addresses_Raw_P2wpkh} p2wpkh + * @property {SeriesTree_Addresses_Raw_P2wsh} p2wsh + * @property {SeriesTree_Addresses_Raw_P2tr} p2tr + * @property {SeriesTree_Addresses_Raw_P2a} p2a */ /** - * @typedef {Object} MetricsTree_Addresses_Raw_P2pk65 - * @property {MetricPattern18} firstIndex - * @property {MetricPattern27} bytes + * @typedef {Object} SeriesTree_Addresses_Raw_P2pk65 + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern27} bytes */ /** - * @typedef {Object} MetricsTree_Addresses_Raw_P2pk33 - * @property {MetricPattern18} firstIndex - * @property {MetricPattern26} bytes + * @typedef {Object} SeriesTree_Addresses_Raw_P2pk33 + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern26} bytes */ /** - * @typedef {Object} MetricsTree_Addresses_Raw_P2pkh - * @property {MetricPattern18} firstIndex - * @property {MetricPattern28} bytes + * @typedef {Object} SeriesTree_Addresses_Raw_P2pkh + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern28} bytes */ /** - * @typedef {Object} MetricsTree_Addresses_Raw_P2sh - * @property {MetricPattern18} firstIndex - * @property {MetricPattern29} bytes + * @typedef {Object} SeriesTree_Addresses_Raw_P2sh + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern29} bytes */ /** - * @typedef {Object} MetricsTree_Addresses_Raw_P2wpkh - * @property {MetricPattern18} firstIndex - * @property {MetricPattern31} bytes + * @typedef {Object} SeriesTree_Addresses_Raw_P2wpkh + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern31} bytes */ /** - * @typedef {Object} MetricsTree_Addresses_Raw_P2wsh - * @property {MetricPattern18} firstIndex - * @property {MetricPattern32} bytes + * @typedef {Object} SeriesTree_Addresses_Raw_P2wsh + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern32} bytes */ /** - * @typedef {Object} MetricsTree_Addresses_Raw_P2tr - * @property {MetricPattern18} firstIndex - * @property {MetricPattern30} bytes + * @typedef {Object} SeriesTree_Addresses_Raw_P2tr + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern30} bytes */ /** - * @typedef {Object} MetricsTree_Addresses_Raw_P2a - * @property {MetricPattern18} firstIndex - * @property {MetricPattern24} bytes + * @typedef {Object} SeriesTree_Addresses_Raw_P2a + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern24} bytes */ /** - * @typedef {Object} MetricsTree_Addresses_Indexes - * @property {MetricPattern24} p2a - * @property {MetricPattern26} p2pk33 - * @property {MetricPattern27} p2pk65 - * @property {MetricPattern28} p2pkh - * @property {MetricPattern29} p2sh - * @property {MetricPattern30} p2tr - * @property {MetricPattern31} p2wpkh - * @property {MetricPattern32} p2wsh - * @property {MetricPattern34} funded - * @property {MetricPattern35} empty + * @typedef {Object} SeriesTree_Addresses_Indexes + * @property {SeriesPattern24} p2a + * @property {SeriesPattern26} p2pk33 + * @property {SeriesPattern27} p2pk65 + * @property {SeriesPattern28} p2pkh + * @property {SeriesPattern29} p2sh + * @property {SeriesPattern30} p2tr + * @property {SeriesPattern31} p2wpkh + * @property {SeriesPattern32} p2wsh + * @property {SeriesPattern34} funded + * @property {SeriesPattern35} empty */ /** - * @typedef {Object} MetricsTree_Addresses_Data - * @property {MetricPattern34} funded - * @property {MetricPattern35} empty + * @typedef {Object} SeriesTree_Addresses_Data + * @property {SeriesPattern34} funded + * @property {SeriesPattern35} empty */ /** - * @typedef {Object} MetricsTree_Addresses_Activity + * @typedef {Object} SeriesTree_Addresses_Activity * @property {BothReactivatedReceivingSendingPattern} all * @property {BothReactivatedReceivingSendingPattern} p2pk65 * @property {BothReactivatedReceivingSendingPattern} p2pk33 @@ -4212,7 +4235,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Addresses_New + * @typedef {Object} SeriesTree_Addresses_New * @property {BaseCumulativeSumPattern} all * @property {BaseCumulativeSumPattern} p2pk65 * @property {BaseCumulativeSumPattern} p2pk33 @@ -4225,7 +4248,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Addresses_Delta + * @typedef {Object} SeriesTree_Addresses_Delta * @property {AbsoluteRatePattern} all * @property {AbsoluteRatePattern} p2pk65 * @property {AbsoluteRatePattern} p2pk33 @@ -4238,47 +4261,47 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Scripts - * @property {MetricsTree_Scripts_Raw} raw - * @property {MetricsTree_Scripts_Count} count - * @property {MetricsTree_Scripts_Value} value - * @property {MetricsTree_Scripts_Adoption} adoption + * @typedef {Object} SeriesTree_Scripts + * @property {SeriesTree_Scripts_Raw} raw + * @property {SeriesTree_Scripts_Count} count + * @property {SeriesTree_Scripts_Value} value + * @property {SeriesTree_Scripts_Adoption} adoption */ /** - * @typedef {Object} MetricsTree_Scripts_Raw - * @property {MetricsTree_Scripts_Raw_Empty} empty - * @property {MetricsTree_Scripts_Raw_OpReturn} opReturn - * @property {MetricsTree_Scripts_Raw_P2ms} p2ms - * @property {MetricsTree_Scripts_Raw_Unknown} unknown + * @typedef {Object} SeriesTree_Scripts_Raw + * @property {SeriesTree_Scripts_Raw_Empty} empty + * @property {SeriesTree_Scripts_Raw_OpReturn} opReturn + * @property {SeriesTree_Scripts_Raw_P2ms} p2ms + * @property {SeriesTree_Scripts_Raw_Unknown} unknown */ /** - * @typedef {Object} MetricsTree_Scripts_Raw_Empty - * @property {MetricPattern18} firstIndex - * @property {MetricPattern22} toTxIndex + * @typedef {Object} SeriesTree_Scripts_Raw_Empty + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern22} toTxIndex */ /** - * @typedef {Object} MetricsTree_Scripts_Raw_OpReturn - * @property {MetricPattern18} firstIndex - * @property {MetricPattern23} toTxIndex + * @typedef {Object} SeriesTree_Scripts_Raw_OpReturn + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern23} toTxIndex */ /** - * @typedef {Object} MetricsTree_Scripts_Raw_P2ms - * @property {MetricPattern18} firstIndex - * @property {MetricPattern25} toTxIndex + * @typedef {Object} SeriesTree_Scripts_Raw_P2ms + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern25} toTxIndex */ /** - * @typedef {Object} MetricsTree_Scripts_Raw_Unknown - * @property {MetricPattern18} firstIndex - * @property {MetricPattern33} toTxIndex + * @typedef {Object} SeriesTree_Scripts_Raw_Unknown + * @property {SeriesPattern18} firstIndex + * @property {SeriesPattern33} toTxIndex */ /** - * @typedef {Object} MetricsTree_Scripts_Count + * @typedef {Object} SeriesTree_Scripts_Count * @property {BaseCumulativeSumPattern} p2a * @property {BaseCumulativeSumPattern} p2ms * @property {BaseCumulativeSumPattern} p2pk33 @@ -4295,32 +4318,32 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Scripts_Value + * @typedef {Object} SeriesTree_Scripts_Value * @property {BaseCumulativeSumPattern4} opReturn */ /** - * @typedef {Object} MetricsTree_Scripts_Adoption + * @typedef {Object} SeriesTree_Scripts_Adoption * @property {BpsPercentRatioPattern3} taproot * @property {BpsPercentRatioPattern3} segwit */ /** - * @typedef {Object} MetricsTree_Mining - * @property {MetricsTree_Mining_Rewards} rewards - * @property {MetricsTree_Mining_Hashrate} hashrate + * @typedef {Object} SeriesTree_Mining + * @property {SeriesTree_Mining_Rewards} rewards + * @property {SeriesTree_Mining_Hashrate} hashrate */ /** - * @typedef {Object} MetricsTree_Mining_Rewards + * @typedef {Object} SeriesTree_Mining_Rewards * @property {BaseCumulativeSumPattern4} coinbase - * @property {MetricsTree_Mining_Rewards_Subsidy} subsidy - * @property {MetricsTree_Mining_Rewards_Fees} fees + * @property {SeriesTree_Mining_Rewards_Subsidy} subsidy + * @property {SeriesTree_Mining_Rewards_Fees} fees * @property {BaseCumulativeSumPattern4} unclaimed */ /** - * @typedef {Object} MetricsTree_Mining_Rewards_Subsidy + * @typedef {Object} SeriesTree_Mining_Rewards_Subsidy * @property {BtcCentsSatsUsdPattern} base * @property {BtcCentsSatsUsdPattern} cumulative * @property {_1m1w1y24hBpsPercentRatioPattern} dominance @@ -4328,7 +4351,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Mining_Rewards_Fees + * @typedef {Object} SeriesTree_Mining_Rewards_Fees * @property {BtcCentsSatsUsdPattern} base * @property {BtcCentsSatsUsdPattern} cumulative * @property {_1m1w1y24hPattern5} sum @@ -4337,11 +4360,11 @@ function createUnspentPattern(client, acc) { * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} _1m * @property {AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern} _1y * @property {_1m1w1y24hBpsPercentRatioPattern} dominance - * @property {MetricsTree_Mining_Rewards_Fees_RatioMultiple} ratioMultiple + * @property {SeriesTree_Mining_Rewards_Fees_RatioMultiple} ratioMultiple */ /** - * @typedef {Object} MetricsTree_Mining_Rewards_Fees_RatioMultiple + * @typedef {Object} SeriesTree_Mining_Rewards_Fees_RatioMultiple * @property {BpsRatioPattern2} _24h * @property {BpsRatioPattern2} _1w * @property {BpsRatioPattern2} _1m @@ -4349,57 +4372,57 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Mining_Hashrate - * @property {MetricsTree_Mining_Hashrate_Rate} rate + * @typedef {Object} SeriesTree_Mining_Hashrate + * @property {SeriesTree_Mining_Hashrate_Rate} rate * @property {PhsReboundThsPattern} price * @property {PhsReboundThsPattern} value */ /** - * @typedef {Object} MetricsTree_Mining_Hashrate_Rate - * @property {MetricPattern1} base - * @property {MetricsTree_Mining_Hashrate_Rate_Sma} sma - * @property {MetricPattern1} ath + * @typedef {Object} SeriesTree_Mining_Hashrate_Rate + * @property {SeriesPattern1} base + * @property {SeriesTree_Mining_Hashrate_Rate_Sma} sma + * @property {SeriesPattern1} ath * @property {BpsPercentRatioPattern5} drawdown */ /** - * @typedef {Object} MetricsTree_Mining_Hashrate_Rate_Sma - * @property {MetricPattern1} _1w - * @property {MetricPattern1} _1m - * @property {MetricPattern1} _2m - * @property {MetricPattern1} _1y + * @typedef {Object} SeriesTree_Mining_Hashrate_Rate_Sma + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _2m + * @property {SeriesPattern1} _1y */ /** - * @typedef {Object} MetricsTree_Cointime - * @property {MetricsTree_Cointime_Activity} activity - * @property {MetricsTree_Cointime_Supply} supply - * @property {MetricsTree_Cointime_Value} value - * @property {MetricsTree_Cointime_Cap} cap - * @property {MetricsTree_Cointime_Prices} prices - * @property {MetricsTree_Cointime_Adjusted} adjusted - * @property {MetricsTree_Cointime_ReserveRisk} reserveRisk + * @typedef {Object} SeriesTree_Cointime + * @property {SeriesTree_Cointime_Activity} activity + * @property {SeriesTree_Cointime_Supply} supply + * @property {SeriesTree_Cointime_Value} value + * @property {SeriesTree_Cointime_Cap} cap + * @property {SeriesTree_Cointime_Prices} prices + * @property {SeriesTree_Cointime_Adjusted} adjusted + * @property {SeriesTree_Cointime_ReserveRisk} reserveRisk * @property {BaseCumulativeSumPattern} coinblocksDestroyed */ /** - * @typedef {Object} MetricsTree_Cointime_Activity + * @typedef {Object} SeriesTree_Cointime_Activity * @property {BaseCumulativeSumPattern} coinblocksCreated * @property {BaseCumulativeSumPattern} coinblocksStored - * @property {MetricPattern1} liveliness - * @property {MetricPattern1} vaultedness - * @property {MetricPattern1} ratio + * @property {SeriesPattern1} liveliness + * @property {SeriesPattern1} vaultedness + * @property {SeriesPattern1} ratio */ /** - * @typedef {Object} MetricsTree_Cointime_Supply + * @typedef {Object} SeriesTree_Cointime_Supply * @property {BtcCentsSatsUsdPattern} vaulted * @property {BtcCentsSatsUsdPattern} active */ /** - * @typedef {Object} MetricsTree_Cointime_Value + * @typedef {Object} SeriesTree_Cointime_Value * @property {BaseCumulativeSumPattern} destroyed * @property {BaseCumulativeSumPattern} created * @property {BaseCumulativeSumPattern} stored @@ -4407,7 +4430,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cointime_Cap + * @typedef {Object} SeriesTree_Cointime_Cap * @property {CentsUsdPattern2} thermo * @property {CentsUsdPattern2} investor * @property {CentsUsdPattern2} vaulted @@ -4417,7 +4440,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cointime_Prices + * @typedef {Object} SeriesTree_Cointime_Prices * @property {BpsCentsPercentilesRatioSatsUsdPattern} vaulted * @property {BpsCentsPercentilesRatioSatsUsdPattern} active * @property {BpsCentsPercentilesRatioSatsUsdPattern} trueMarketMean @@ -4426,334 +4449,334 @@ function createUnspentPattern(client, acc) { * @property {BpsCentsPercentilesRatioSatsUsdPattern} balanced * @property {BpsCentsPercentilesRatioSatsUsdPattern} terminal * @property {BpsCentsPercentilesRatioSatsUsdPattern} delta - * @property {MetricPattern1} cumulativeMarketCap + * @property {SeriesPattern1} cumulativeMarketCap */ /** - * @typedef {Object} MetricsTree_Cointime_Adjusted + * @typedef {Object} SeriesTree_Cointime_Adjusted * @property {BpsPercentRatioPattern} inflationRate - * @property {MetricPattern1} txVelocityNative - * @property {MetricPattern1} txVelocityFiat + * @property {SeriesPattern1} txVelocityNative + * @property {SeriesPattern1} txVelocityFiat */ /** - * @typedef {Object} MetricsTree_Cointime_ReserveRisk - * @property {MetricPattern1} value - * @property {MetricPattern18} vocddMedian1y - * @property {MetricPattern18} hodlBank + * @typedef {Object} SeriesTree_Cointime_ReserveRisk + * @property {SeriesPattern1} value + * @property {SeriesPattern18} vocddMedian1y + * @property {SeriesPattern18} hodlBank */ /** - * @typedef {Object} MetricsTree_Constants - * @property {MetricPattern1} _0 - * @property {MetricPattern1} _1 - * @property {MetricPattern1} _2 - * @property {MetricPattern1} _3 - * @property {MetricPattern1} _4 - * @property {MetricPattern1} _20 - * @property {MetricPattern1} _30 - * @property {MetricPattern1} _382 - * @property {MetricPattern1} _50 - * @property {MetricPattern1} _618 - * @property {MetricPattern1} _70 - * @property {MetricPattern1} _80 - * @property {MetricPattern1} _100 - * @property {MetricPattern1} _600 - * @property {MetricPattern1} minus1 - * @property {MetricPattern1} minus2 - * @property {MetricPattern1} minus3 - * @property {MetricPattern1} minus4 + * @typedef {Object} SeriesTree_Constants + * @property {SeriesPattern1} _0 + * @property {SeriesPattern1} _1 + * @property {SeriesPattern1} _2 + * @property {SeriesPattern1} _3 + * @property {SeriesPattern1} _4 + * @property {SeriesPattern1} _20 + * @property {SeriesPattern1} _30 + * @property {SeriesPattern1} _382 + * @property {SeriesPattern1} _50 + * @property {SeriesPattern1} _618 + * @property {SeriesPattern1} _70 + * @property {SeriesPattern1} _80 + * @property {SeriesPattern1} _100 + * @property {SeriesPattern1} _600 + * @property {SeriesPattern1} minus1 + * @property {SeriesPattern1} minus2 + * @property {SeriesPattern1} minus3 + * @property {SeriesPattern1} minus4 */ /** - * @typedef {Object} MetricsTree_Indexes - * @property {MetricsTree_Indexes_Address} address - * @property {MetricsTree_Indexes_Height} height - * @property {MetricsTree_Indexes_Epoch} epoch - * @property {MetricsTree_Indexes_Halving} halving - * @property {MetricsTree_Indexes_Minute10} minute10 - * @property {MetricsTree_Indexes_Minute30} minute30 - * @property {MetricsTree_Indexes_Hour1} hour1 - * @property {MetricsTree_Indexes_Hour4} hour4 - * @property {MetricsTree_Indexes_Hour12} hour12 - * @property {MetricsTree_Indexes_Day1} day1 - * @property {MetricsTree_Indexes_Day3} day3 - * @property {MetricsTree_Indexes_Week1} week1 - * @property {MetricsTree_Indexes_Month1} month1 - * @property {MetricsTree_Indexes_Month3} month3 - * @property {MetricsTree_Indexes_Month6} month6 - * @property {MetricsTree_Indexes_Year1} year1 - * @property {MetricsTree_Indexes_Year10} year10 - * @property {MetricsTree_Indexes_TxIndex} txIndex - * @property {MetricsTree_Indexes_TxinIndex} txinIndex - * @property {MetricsTree_Indexes_TxoutIndex} txoutIndex + * @typedef {Object} SeriesTree_Indexes + * @property {SeriesTree_Indexes_Address} address + * @property {SeriesTree_Indexes_Height} height + * @property {SeriesTree_Indexes_Epoch} epoch + * @property {SeriesTree_Indexes_Halving} halving + * @property {SeriesTree_Indexes_Minute10} minute10 + * @property {SeriesTree_Indexes_Minute30} minute30 + * @property {SeriesTree_Indexes_Hour1} hour1 + * @property {SeriesTree_Indexes_Hour4} hour4 + * @property {SeriesTree_Indexes_Hour12} hour12 + * @property {SeriesTree_Indexes_Day1} day1 + * @property {SeriesTree_Indexes_Day3} day3 + * @property {SeriesTree_Indexes_Week1} week1 + * @property {SeriesTree_Indexes_Month1} month1 + * @property {SeriesTree_Indexes_Month3} month3 + * @property {SeriesTree_Indexes_Month6} month6 + * @property {SeriesTree_Indexes_Year1} year1 + * @property {SeriesTree_Indexes_Year10} year10 + * @property {SeriesTree_Indexes_TxIndex} txIndex + * @property {SeriesTree_Indexes_TxinIndex} txinIndex + * @property {SeriesTree_Indexes_TxoutIndex} txoutIndex */ /** - * @typedef {Object} MetricsTree_Indexes_Address - * @property {MetricsTree_Indexes_Address_P2pk33} p2pk33 - * @property {MetricsTree_Indexes_Address_P2pk65} p2pk65 - * @property {MetricsTree_Indexes_Address_P2pkh} p2pkh - * @property {MetricsTree_Indexes_Address_P2sh} p2sh - * @property {MetricsTree_Indexes_Address_P2tr} p2tr - * @property {MetricsTree_Indexes_Address_P2wpkh} p2wpkh - * @property {MetricsTree_Indexes_Address_P2wsh} p2wsh - * @property {MetricsTree_Indexes_Address_P2a} p2a - * @property {MetricsTree_Indexes_Address_P2ms} p2ms - * @property {MetricsTree_Indexes_Address_Empty} empty - * @property {MetricsTree_Indexes_Address_Unknown} unknown - * @property {MetricsTree_Indexes_Address_OpReturn} opReturn + * @typedef {Object} SeriesTree_Indexes_Address + * @property {SeriesTree_Indexes_Address_P2pk33} p2pk33 + * @property {SeriesTree_Indexes_Address_P2pk65} p2pk65 + * @property {SeriesTree_Indexes_Address_P2pkh} p2pkh + * @property {SeriesTree_Indexes_Address_P2sh} p2sh + * @property {SeriesTree_Indexes_Address_P2tr} p2tr + * @property {SeriesTree_Indexes_Address_P2wpkh} p2wpkh + * @property {SeriesTree_Indexes_Address_P2wsh} p2wsh + * @property {SeriesTree_Indexes_Address_P2a} p2a + * @property {SeriesTree_Indexes_Address_P2ms} p2ms + * @property {SeriesTree_Indexes_Address_Empty} empty + * @property {SeriesTree_Indexes_Address_Unknown} unknown + * @property {SeriesTree_Indexes_Address_OpReturn} opReturn */ /** - * @typedef {Object} MetricsTree_Indexes_Address_P2pk33 - * @property {MetricPattern26} identity - * @property {MetricPattern26
} address + * @typedef {Object} SeriesTree_Indexes_Address_P2pk33 + * @property {SeriesPattern26} identity + * @property {SeriesPattern26
} address */ /** - * @typedef {Object} MetricsTree_Indexes_Address_P2pk65 - * @property {MetricPattern27} identity - * @property {MetricPattern27
} address + * @typedef {Object} SeriesTree_Indexes_Address_P2pk65 + * @property {SeriesPattern27} identity + * @property {SeriesPattern27
} address */ /** - * @typedef {Object} MetricsTree_Indexes_Address_P2pkh - * @property {MetricPattern28} identity - * @property {MetricPattern28
} address + * @typedef {Object} SeriesTree_Indexes_Address_P2pkh + * @property {SeriesPattern28} identity + * @property {SeriesPattern28
} address */ /** - * @typedef {Object} MetricsTree_Indexes_Address_P2sh - * @property {MetricPattern29} identity - * @property {MetricPattern29
} address + * @typedef {Object} SeriesTree_Indexes_Address_P2sh + * @property {SeriesPattern29} identity + * @property {SeriesPattern29
} address */ /** - * @typedef {Object} MetricsTree_Indexes_Address_P2tr - * @property {MetricPattern30} identity - * @property {MetricPattern30
} address + * @typedef {Object} SeriesTree_Indexes_Address_P2tr + * @property {SeriesPattern30} identity + * @property {SeriesPattern30
} address */ /** - * @typedef {Object} MetricsTree_Indexes_Address_P2wpkh - * @property {MetricPattern31} identity - * @property {MetricPattern31
} address + * @typedef {Object} SeriesTree_Indexes_Address_P2wpkh + * @property {SeriesPattern31} identity + * @property {SeriesPattern31
} address */ /** - * @typedef {Object} MetricsTree_Indexes_Address_P2wsh - * @property {MetricPattern32} identity - * @property {MetricPattern32
} address + * @typedef {Object} SeriesTree_Indexes_Address_P2wsh + * @property {SeriesPattern32} identity + * @property {SeriesPattern32
} address */ /** - * @typedef {Object} MetricsTree_Indexes_Address_P2a - * @property {MetricPattern24} identity - * @property {MetricPattern24
} address + * @typedef {Object} SeriesTree_Indexes_Address_P2a + * @property {SeriesPattern24} identity + * @property {SeriesPattern24
} address */ /** - * @typedef {Object} MetricsTree_Indexes_Address_P2ms - * @property {MetricPattern25} identity + * @typedef {Object} SeriesTree_Indexes_Address_P2ms + * @property {SeriesPattern25} identity */ /** - * @typedef {Object} MetricsTree_Indexes_Address_Empty - * @property {MetricPattern22} identity + * @typedef {Object} SeriesTree_Indexes_Address_Empty + * @property {SeriesPattern22} identity */ /** - * @typedef {Object} MetricsTree_Indexes_Address_Unknown - * @property {MetricPattern33} identity + * @typedef {Object} SeriesTree_Indexes_Address_Unknown + * @property {SeriesPattern33} identity */ /** - * @typedef {Object} MetricsTree_Indexes_Address_OpReturn - * @property {MetricPattern23} identity + * @typedef {Object} SeriesTree_Indexes_Address_OpReturn + * @property {SeriesPattern23} identity */ /** - * @typedef {Object} MetricsTree_Indexes_Height - * @property {MetricPattern18} identity - * @property {MetricPattern18} minute10 - * @property {MetricPattern18} minute30 - * @property {MetricPattern18} hour1 - * @property {MetricPattern18} hour4 - * @property {MetricPattern18} hour12 - * @property {MetricPattern18} day1 - * @property {MetricPattern18} day3 - * @property {MetricPattern18} epoch - * @property {MetricPattern18} halving - * @property {MetricPattern18} week1 - * @property {MetricPattern18} month1 - * @property {MetricPattern18} month3 - * @property {MetricPattern18} month6 - * @property {MetricPattern18} year1 - * @property {MetricPattern18} year10 - * @property {MetricPattern18} txIndexCount + * @typedef {Object} SeriesTree_Indexes_Height + * @property {SeriesPattern18} identity + * @property {SeriesPattern18} minute10 + * @property {SeriesPattern18} minute30 + * @property {SeriesPattern18} hour1 + * @property {SeriesPattern18} hour4 + * @property {SeriesPattern18} hour12 + * @property {SeriesPattern18} day1 + * @property {SeriesPattern18} day3 + * @property {SeriesPattern18} epoch + * @property {SeriesPattern18} halving + * @property {SeriesPattern18} week1 + * @property {SeriesPattern18} month1 + * @property {SeriesPattern18} month3 + * @property {SeriesPattern18} month6 + * @property {SeriesPattern18} year1 + * @property {SeriesPattern18} year10 + * @property {SeriesPattern18} txIndexCount */ /** - * @typedef {Object} MetricsTree_Indexes_Epoch - * @property {MetricPattern17} identity - * @property {MetricPattern17} firstHeight - * @property {MetricPattern17} heightCount + * @typedef {Object} SeriesTree_Indexes_Epoch + * @property {SeriesPattern17} identity + * @property {SeriesPattern17} firstHeight + * @property {SeriesPattern17} heightCount */ /** - * @typedef {Object} MetricsTree_Indexes_Halving - * @property {MetricPattern16} identity - * @property {MetricPattern16} firstHeight + * @typedef {Object} SeriesTree_Indexes_Halving + * @property {SeriesPattern16} identity + * @property {SeriesPattern16} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Minute10 - * @property {MetricPattern3} identity - * @property {MetricPattern3} firstHeight + * @typedef {Object} SeriesTree_Indexes_Minute10 + * @property {SeriesPattern3} identity + * @property {SeriesPattern3} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Minute30 - * @property {MetricPattern4} identity - * @property {MetricPattern4} firstHeight + * @typedef {Object} SeriesTree_Indexes_Minute30 + * @property {SeriesPattern4} identity + * @property {SeriesPattern4} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Hour1 - * @property {MetricPattern5} identity - * @property {MetricPattern5} firstHeight + * @typedef {Object} SeriesTree_Indexes_Hour1 + * @property {SeriesPattern5} identity + * @property {SeriesPattern5} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Hour4 - * @property {MetricPattern6} identity - * @property {MetricPattern6} firstHeight + * @typedef {Object} SeriesTree_Indexes_Hour4 + * @property {SeriesPattern6} identity + * @property {SeriesPattern6} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Hour12 - * @property {MetricPattern7} identity - * @property {MetricPattern7} firstHeight + * @typedef {Object} SeriesTree_Indexes_Hour12 + * @property {SeriesPattern7} identity + * @property {SeriesPattern7} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Day1 - * @property {MetricPattern8} identity - * @property {MetricPattern8} date - * @property {MetricPattern8} firstHeight - * @property {MetricPattern8} heightCount + * @typedef {Object} SeriesTree_Indexes_Day1 + * @property {SeriesPattern8} identity + * @property {SeriesPattern8} date + * @property {SeriesPattern8} firstHeight + * @property {SeriesPattern8} heightCount */ /** - * @typedef {Object} MetricsTree_Indexes_Day3 - * @property {MetricPattern9} identity - * @property {MetricPattern9} firstHeight + * @typedef {Object} SeriesTree_Indexes_Day3 + * @property {SeriesPattern9} identity + * @property {SeriesPattern9} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Week1 - * @property {MetricPattern10} identity - * @property {MetricPattern10} date - * @property {MetricPattern10} firstHeight + * @typedef {Object} SeriesTree_Indexes_Week1 + * @property {SeriesPattern10} identity + * @property {SeriesPattern10} date + * @property {SeriesPattern10} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Month1 - * @property {MetricPattern11} identity - * @property {MetricPattern11} date - * @property {MetricPattern11} firstHeight + * @typedef {Object} SeriesTree_Indexes_Month1 + * @property {SeriesPattern11} identity + * @property {SeriesPattern11} date + * @property {SeriesPattern11} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Month3 - * @property {MetricPattern12} identity - * @property {MetricPattern12} date - * @property {MetricPattern12} firstHeight + * @typedef {Object} SeriesTree_Indexes_Month3 + * @property {SeriesPattern12} identity + * @property {SeriesPattern12} date + * @property {SeriesPattern12} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Month6 - * @property {MetricPattern13} identity - * @property {MetricPattern13} date - * @property {MetricPattern13} firstHeight + * @typedef {Object} SeriesTree_Indexes_Month6 + * @property {SeriesPattern13} identity + * @property {SeriesPattern13} date + * @property {SeriesPattern13} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Year1 - * @property {MetricPattern14} identity - * @property {MetricPattern14} date - * @property {MetricPattern14} firstHeight + * @typedef {Object} SeriesTree_Indexes_Year1 + * @property {SeriesPattern14} identity + * @property {SeriesPattern14} date + * @property {SeriesPattern14} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_Year10 - * @property {MetricPattern15} identity - * @property {MetricPattern15} date - * @property {MetricPattern15} firstHeight + * @typedef {Object} SeriesTree_Indexes_Year10 + * @property {SeriesPattern15} identity + * @property {SeriesPattern15} date + * @property {SeriesPattern15} firstHeight */ /** - * @typedef {Object} MetricsTree_Indexes_TxIndex - * @property {MetricPattern19} identity - * @property {MetricPattern19} inputCount - * @property {MetricPattern19} outputCount + * @typedef {Object} SeriesTree_Indexes_TxIndex + * @property {SeriesPattern19} identity + * @property {SeriesPattern19} inputCount + * @property {SeriesPattern19} outputCount */ /** - * @typedef {Object} MetricsTree_Indexes_TxinIndex - * @property {MetricPattern20} identity + * @typedef {Object} SeriesTree_Indexes_TxinIndex + * @property {SeriesPattern20} identity */ /** - * @typedef {Object} MetricsTree_Indexes_TxoutIndex - * @property {MetricPattern21} identity + * @typedef {Object} SeriesTree_Indexes_TxoutIndex + * @property {SeriesPattern21} identity */ /** - * @typedef {Object} MetricsTree_Indicators + * @typedef {Object} SeriesTree_Indicators * @property {BpsRatioPattern2} puellMultiple * @property {BpsRatioPattern2} nvt * @property {BpsPercentRatioPattern3} gini * @property {BpsRatioPattern2} rhodlRatio * @property {BpsRatioPattern2} thermocapMultiple - * @property {MetricPattern1} coindaysDestroyedSupplyAdjusted - * @property {MetricPattern1} coinyearsDestroyedSupplyAdjusted - * @property {MetricsTree_Indicators_Dormancy} dormancy - * @property {MetricPattern1} stockToFlow - * @property {MetricPattern1} sellerExhaustionConstant + * @property {SeriesPattern1} coindaysDestroyedSupplyAdjusted + * @property {SeriesPattern1} coinyearsDestroyedSupplyAdjusted + * @property {SeriesTree_Indicators_Dormancy} dormancy + * @property {SeriesPattern1} stockToFlow + * @property {SeriesPattern1} sellerExhaustionConstant */ /** - * @typedef {Object} MetricsTree_Indicators_Dormancy - * @property {MetricPattern1} supplyAdjusted - * @property {MetricPattern1} flow + * @typedef {Object} SeriesTree_Indicators_Dormancy + * @property {SeriesPattern1} supplyAdjusted + * @property {SeriesPattern1} flow */ /** - * @typedef {Object} MetricsTree_Market - * @property {MetricsTree_Market_Ath} ath - * @property {MetricsTree_Market_Lookback} lookback - * @property {MetricsTree_Market_Returns} returns - * @property {MetricsTree_Market_Volatility} volatility - * @property {MetricsTree_Market_Range} range - * @property {MetricsTree_Market_MovingAverage} movingAverage - * @property {MetricsTree_Market_Dca} dca - * @property {MetricsTree_Market_Technical} technical + * @typedef {Object} SeriesTree_Market + * @property {SeriesTree_Market_Ath} ath + * @property {SeriesTree_Market_Lookback} lookback + * @property {SeriesTree_Market_Returns} returns + * @property {SeriesTree_Market_Volatility} volatility + * @property {SeriesTree_Market_Range} range + * @property {SeriesTree_Market_MovingAverage} movingAverage + * @property {SeriesTree_Market_Dca} dca + * @property {SeriesTree_Market_Technical} technical */ /** - * @typedef {Object} MetricsTree_Market_Ath + * @typedef {Object} SeriesTree_Market_Ath * @property {CentsSatsUsdPattern} high * @property {BpsPercentRatioPattern5} drawdown - * @property {MetricPattern1} daysSince - * @property {MetricPattern1} yearsSince - * @property {MetricPattern1} maxDaysBetween - * @property {MetricPattern1} maxYearsBetween + * @property {SeriesPattern1} daysSince + * @property {SeriesPattern1} yearsSince + * @property {SeriesPattern1} maxDaysBetween + * @property {SeriesPattern1} maxYearsBetween */ /** - * @typedef {Object} MetricsTree_Market_Lookback + * @typedef {Object} SeriesTree_Market_Lookback * @property {CentsSatsUsdPattern} _24h * @property {CentsSatsUsdPattern} _1w * @property {CentsSatsUsdPattern} _1m @@ -4770,14 +4793,14 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Returns - * @property {MetricsTree_Market_Returns_Periods} periods + * @typedef {Object} SeriesTree_Market_Returns + * @property {SeriesTree_Market_Returns_Periods} periods * @property {_10y2y3y4y5y6y8yPattern} cagr - * @property {MetricsTree_Market_Returns_Sd24h} sd24h + * @property {SeriesTree_Market_Returns_Sd24h} sd24h */ /** - * @typedef {Object} MetricsTree_Market_Returns_Periods + * @typedef {Object} SeriesTree_Market_Returns_Periods * @property {BpsPercentRatioPattern} _24h * @property {BpsPercentRatioPattern} _1w * @property {BpsPercentRatioPattern} _1m @@ -4794,54 +4817,54 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Returns_Sd24h - * @property {MetricsTree_Market_Returns_Sd24h_1w} _1w - * @property {MetricsTree_Market_Returns_Sd24h_1m} _1m - * @property {MetricsTree_Market_Returns_Sd24h_1y} _1y + * @typedef {Object} SeriesTree_Market_Returns_Sd24h + * @property {SeriesTree_Market_Returns_Sd24h_1w} _1w + * @property {SeriesTree_Market_Returns_Sd24h_1m} _1m + * @property {SeriesTree_Market_Returns_Sd24h_1y} _1y */ /** - * @typedef {Object} MetricsTree_Market_Returns_Sd24h_1w - * @property {MetricPattern1} sma - * @property {MetricPattern1} sd + * @typedef {Object} SeriesTree_Market_Returns_Sd24h_1w + * @property {SeriesPattern1} sma + * @property {SeriesPattern1} sd */ /** - * @typedef {Object} MetricsTree_Market_Returns_Sd24h_1m - * @property {MetricPattern1} sma - * @property {MetricPattern1} sd + * @typedef {Object} SeriesTree_Market_Returns_Sd24h_1m + * @property {SeriesPattern1} sma + * @property {SeriesPattern1} sd */ /** - * @typedef {Object} MetricsTree_Market_Returns_Sd24h_1y - * @property {MetricPattern1} sma - * @property {MetricPattern1} sd + * @typedef {Object} SeriesTree_Market_Returns_Sd24h_1y + * @property {SeriesPattern1} sma + * @property {SeriesPattern1} sd */ /** - * @typedef {Object} MetricsTree_Market_Volatility - * @property {MetricPattern1} _1w - * @property {MetricPattern1} _1m - * @property {MetricPattern1} _1y + * @typedef {Object} SeriesTree_Market_Volatility + * @property {SeriesPattern1} _1w + * @property {SeriesPattern1} _1m + * @property {SeriesPattern1} _1y */ /** - * @typedef {Object} MetricsTree_Market_Range + * @typedef {Object} SeriesTree_Market_Range * @property {_1m1w1y2wPattern} min * @property {_1m1w1y2wPattern} max - * @property {MetricPattern1} trueRange - * @property {MetricPattern1} trueRangeSum2w + * @property {SeriesPattern1} trueRange + * @property {SeriesPattern1} trueRangeSum2w * @property {BpsPercentRatioPattern3} choppinessIndex2w */ /** - * @typedef {Object} MetricsTree_Market_MovingAverage - * @property {MetricsTree_Market_MovingAverage_Sma} sma - * @property {MetricsTree_Market_MovingAverage_Ema} ema + * @typedef {Object} SeriesTree_Market_MovingAverage + * @property {SeriesTree_Market_MovingAverage_Sma} sma + * @property {SeriesTree_Market_MovingAverage_Ema} ema */ /** - * @typedef {Object} MetricsTree_Market_MovingAverage_Sma + * @typedef {Object} SeriesTree_Market_MovingAverage_Sma * @property {BpsCentsRatioSatsUsdPattern} _1w * @property {BpsCentsRatioSatsUsdPattern} _8d * @property {BpsCentsRatioSatsUsdPattern} _13d @@ -4852,8 +4875,8 @@ function createUnspentPattern(client, acc) { * @property {BpsCentsRatioSatsUsdPattern} _89d * @property {BpsCentsRatioSatsUsdPattern} _111d * @property {BpsCentsRatioSatsUsdPattern} _144d - * @property {MetricsTree_Market_MovingAverage_Sma_200d} _200d - * @property {MetricsTree_Market_MovingAverage_Sma_350d} _350d + * @property {SeriesTree_Market_MovingAverage_Sma_200d} _200d + * @property {SeriesTree_Market_MovingAverage_Sma_350d} _350d * @property {BpsCentsRatioSatsUsdPattern} _1y * @property {BpsCentsRatioSatsUsdPattern} _2y * @property {BpsCentsRatioSatsUsdPattern} _200w @@ -4861,28 +4884,28 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_MovingAverage_Sma_200d - * @property {MetricPattern1} usd - * @property {MetricPattern1} cents - * @property {MetricPattern1} sats - * @property {MetricPattern1} bps - * @property {MetricPattern1} ratio + * @typedef {Object} SeriesTree_Market_MovingAverage_Sma_200d + * @property {SeriesPattern1} usd + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} ratio * @property {CentsSatsUsdPattern} x24 * @property {CentsSatsUsdPattern} x08 */ /** - * @typedef {Object} MetricsTree_Market_MovingAverage_Sma_350d - * @property {MetricPattern1} usd - * @property {MetricPattern1} cents - * @property {MetricPattern1} sats - * @property {MetricPattern1} bps - * @property {MetricPattern1} ratio + * @typedef {Object} SeriesTree_Market_MovingAverage_Sma_350d + * @property {SeriesPattern1} usd + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} ratio * @property {CentsSatsUsdPattern} x2 */ /** - * @typedef {Object} MetricsTree_Market_MovingAverage_Ema + * @typedef {Object} SeriesTree_Market_MovingAverage_Ema * @property {BpsCentsRatioSatsUsdPattern} _1w * @property {BpsCentsRatioSatsUsdPattern} _8d * @property {BpsCentsRatioSatsUsdPattern} _12d @@ -4902,16 +4925,16 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Dca - * @property {MetricPattern18} satsPerDay - * @property {MetricsTree_Market_Dca_Period} period - * @property {MetricsTree_Market_Dca_Class} class + * @typedef {Object} SeriesTree_Market_Dca + * @property {SeriesPattern18} satsPerDay + * @property {SeriesTree_Market_Dca_Period} period + * @property {SeriesTree_Market_Dca_Class} class */ /** - * @typedef {Object} MetricsTree_Market_Dca_Period + * @typedef {Object} SeriesTree_Market_Dca_Period * @property {_10y1m1w1y2y3m3y4y5y6m6y8yPattern3} stack - * @property {MetricsTree_Market_Dca_Period_CostBasis} costBasis + * @property {SeriesTree_Market_Dca_Period_CostBasis} costBasis * @property {_10y1m1w1y2y3m3y4y5y6m6y8yPattern2} return * @property {_10y2y3y4y5y6y8yPattern} cagr * @property {_10y1m1w1y2y3m3y4y5y6m6y8yPattern3} lumpSumStack @@ -4919,7 +4942,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Dca_Period_CostBasis + * @typedef {Object} SeriesTree_Market_Dca_Period_CostBasis * @property {CentsSatsUsdPattern} _1w * @property {CentsSatsUsdPattern} _1m * @property {CentsSatsUsdPattern} _3m @@ -4935,14 +4958,14 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Dca_Class - * @property {MetricsTree_Market_Dca_Class_Stack} stack - * @property {MetricsTree_Market_Dca_Class_CostBasis} costBasis - * @property {MetricsTree_Market_Dca_Class_Return} return + * @typedef {Object} SeriesTree_Market_Dca_Class + * @property {SeriesTree_Market_Dca_Class_Stack} stack + * @property {SeriesTree_Market_Dca_Class_CostBasis} costBasis + * @property {SeriesTree_Market_Dca_Class_Return} return */ /** - * @typedef {Object} MetricsTree_Market_Dca_Class_Stack + * @typedef {Object} SeriesTree_Market_Dca_Class_Stack * @property {BtcCentsSatsUsdPattern} from2015 * @property {BtcCentsSatsUsdPattern} from2016 * @property {BtcCentsSatsUsdPattern} from2017 @@ -4958,7 +4981,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Dca_Class_CostBasis + * @typedef {Object} SeriesTree_Market_Dca_Class_CostBasis * @property {CentsSatsUsdPattern} from2015 * @property {CentsSatsUsdPattern} from2016 * @property {CentsSatsUsdPattern} from2017 @@ -4974,7 +4997,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Dca_Class_Return + * @typedef {Object} SeriesTree_Market_Dca_Class_Return * @property {BpsPercentRatioPattern} from2015 * @property {BpsPercentRatioPattern} from2016 * @property {BpsPercentRatioPattern} from2017 @@ -4990,16 +5013,16 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Technical - * @property {MetricsTree_Market_Technical_Rsi} rsi + * @typedef {Object} SeriesTree_Market_Technical + * @property {SeriesTree_Market_Technical_Rsi} rsi * @property {BpsPercentRatioPattern3} stochK * @property {BpsPercentRatioPattern3} stochD * @property {BpsRatioPattern2} piCycle - * @property {MetricsTree_Market_Technical_Macd} macd + * @property {SeriesTree_Market_Technical_Macd} macd */ /** - * @typedef {Object} MetricsTree_Market_Technical_Rsi + * @typedef {Object} SeriesTree_Market_Technical_Rsi * @property {AverageGainsLossesRsiStochPattern} _24h * @property {AverageGainsLossesRsiStochPattern} _1w * @property {AverageGainsLossesRsiStochPattern} _1m @@ -5007,58 +5030,58 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Market_Technical_Macd - * @property {MetricsTree_Market_Technical_Macd_24h} _24h - * @property {MetricsTree_Market_Technical_Macd_1w} _1w - * @property {MetricsTree_Market_Technical_Macd_1m} _1m - * @property {MetricsTree_Market_Technical_Macd_1y} _1y + * @typedef {Object} SeriesTree_Market_Technical_Macd + * @property {SeriesTree_Market_Technical_Macd_24h} _24h + * @property {SeriesTree_Market_Technical_Macd_1w} _1w + * @property {SeriesTree_Market_Technical_Macd_1m} _1m + * @property {SeriesTree_Market_Technical_Macd_1y} _1y */ /** - * @typedef {Object} MetricsTree_Market_Technical_Macd_24h - * @property {MetricPattern1} emaFast - * @property {MetricPattern1} emaSlow - * @property {MetricPattern1} line - * @property {MetricPattern1} signal - * @property {MetricPattern1} histogram + * @typedef {Object} SeriesTree_Market_Technical_Macd_24h + * @property {SeriesPattern1} emaFast + * @property {SeriesPattern1} emaSlow + * @property {SeriesPattern1} line + * @property {SeriesPattern1} signal + * @property {SeriesPattern1} histogram */ /** - * @typedef {Object} MetricsTree_Market_Technical_Macd_1w - * @property {MetricPattern1} emaFast - * @property {MetricPattern1} emaSlow - * @property {MetricPattern1} line - * @property {MetricPattern1} signal - * @property {MetricPattern1} histogram + * @typedef {Object} SeriesTree_Market_Technical_Macd_1w + * @property {SeriesPattern1} emaFast + * @property {SeriesPattern1} emaSlow + * @property {SeriesPattern1} line + * @property {SeriesPattern1} signal + * @property {SeriesPattern1} histogram */ /** - * @typedef {Object} MetricsTree_Market_Technical_Macd_1m - * @property {MetricPattern1} emaFast - * @property {MetricPattern1} emaSlow - * @property {MetricPattern1} line - * @property {MetricPattern1} signal - * @property {MetricPattern1} histogram + * @typedef {Object} SeriesTree_Market_Technical_Macd_1m + * @property {SeriesPattern1} emaFast + * @property {SeriesPattern1} emaSlow + * @property {SeriesPattern1} line + * @property {SeriesPattern1} signal + * @property {SeriesPattern1} histogram */ /** - * @typedef {Object} MetricsTree_Market_Technical_Macd_1y - * @property {MetricPattern1} emaFast - * @property {MetricPattern1} emaSlow - * @property {MetricPattern1} line - * @property {MetricPattern1} signal - * @property {MetricPattern1} histogram + * @typedef {Object} SeriesTree_Market_Technical_Macd_1y + * @property {SeriesPattern1} emaFast + * @property {SeriesPattern1} emaSlow + * @property {SeriesPattern1} line + * @property {SeriesPattern1} signal + * @property {SeriesPattern1} histogram */ /** - * @typedef {Object} MetricsTree_Pools - * @property {MetricPattern18} heightToPool - * @property {MetricsTree_Pools_Major} major - * @property {MetricsTree_Pools_Minor} minor + * @typedef {Object} SeriesTree_Pools + * @property {SeriesPattern18} heightToPool + * @property {SeriesTree_Pools_Major} major + * @property {SeriesTree_Pools_Minor} minor */ /** - * @typedef {Object} MetricsTree_Pools_Major + * @typedef {Object} SeriesTree_Pools_Major * @property {BlocksDominanceRewardsPattern} unknown * @property {BlocksDominanceRewardsPattern} luxor * @property {BlocksDominanceRewardsPattern} btccom @@ -5084,7 +5107,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Pools_Minor + * @typedef {Object} SeriesTree_Pools_Minor * @property {BlocksDominancePattern} blockfills * @property {BlocksDominancePattern} ultimuspool * @property {BlocksDominancePattern} terrapool @@ -5228,14 +5251,14 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Prices - * @property {MetricsTree_Prices_Split} split - * @property {MetricsTree_Prices_Ohlc} ohlc - * @property {MetricsTree_Prices_Spot} spot + * @typedef {Object} SeriesTree_Prices + * @property {SeriesTree_Prices_Split} split + * @property {SeriesTree_Prices_Ohlc} ohlc + * @property {SeriesTree_Prices_Spot} spot */ /** - * @typedef {Object} MetricsTree_Prices_Split + * @typedef {Object} SeriesTree_Prices_Split * @property {CentsSatsUsdPattern3} open * @property {CentsSatsUsdPattern3} high * @property {CentsSatsUsdPattern3} low @@ -5243,78 +5266,78 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Prices_Ohlc - * @property {MetricPattern2} usd - * @property {MetricPattern2} cents - * @property {MetricPattern2} sats + * @typedef {Object} SeriesTree_Prices_Ohlc + * @property {SeriesPattern2} usd + * @property {SeriesPattern2} cents + * @property {SeriesPattern2} sats */ /** - * @typedef {Object} MetricsTree_Prices_Spot - * @property {MetricPattern1} usd - * @property {MetricPattern1} cents - * @property {MetricPattern1} sats + * @typedef {Object} SeriesTree_Prices_Spot + * @property {SeriesPattern1} usd + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} sats */ /** - * @typedef {Object} MetricsTree_Supply - * @property {MetricPattern18} state + * @typedef {Object} SeriesTree_Supply + * @property {SeriesPattern18} state * @property {BtcCentsSatsUsdPattern} circulating - * @property {MetricsTree_Supply_Burned} burned + * @property {SeriesTree_Supply_Burned} burned * @property {BpsPercentRatioPattern} inflationRate - * @property {MetricsTree_Supply_Velocity} velocity + * @property {SeriesTree_Supply_Velocity} velocity * @property {CentsDeltaUsdPattern} marketCap * @property {_1m1w1y24hPattern} marketMinusRealizedCapGrowthRate * @property {BtcCentsSatsUsdPattern} hodledOrLost */ /** - * @typedef {Object} MetricsTree_Supply_Burned + * @typedef {Object} SeriesTree_Supply_Burned * @property {BaseCumulativeSumPattern4} unspendable */ /** - * @typedef {Object} MetricsTree_Supply_Velocity - * @property {MetricPattern1} native - * @property {MetricPattern1} fiat + * @typedef {Object} SeriesTree_Supply_Velocity + * @property {SeriesPattern1} native + * @property {SeriesPattern1} fiat */ /** - * @typedef {Object} MetricsTree_Cohorts - * @property {MetricsTree_Cohorts_Utxo} utxo - * @property {MetricsTree_Cohorts_Address} address + * @typedef {Object} SeriesTree_Cohorts + * @property {SeriesTree_Cohorts_Utxo} utxo + * @property {SeriesTree_Cohorts_Address} address */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo - * @property {MetricsTree_Cohorts_Utxo_All} all - * @property {MetricsTree_Cohorts_Utxo_Sth} sth - * @property {MetricsTree_Cohorts_Utxo_Lth} lth - * @property {MetricsTree_Cohorts_Utxo_AgeRange} ageRange - * @property {MetricsTree_Cohorts_Utxo_UnderAge} underAge - * @property {MetricsTree_Cohorts_Utxo_OverAge} overAge - * @property {MetricsTree_Cohorts_Utxo_Epoch} epoch - * @property {MetricsTree_Cohorts_Utxo_Class} class - * @property {MetricsTree_Cohorts_Utxo_OverAmount} overAmount - * @property {MetricsTree_Cohorts_Utxo_AmountRange} amountRange - * @property {MetricsTree_Cohorts_Utxo_UnderAmount} underAmount - * @property {MetricsTree_Cohorts_Utxo_Type} type - * @property {MetricsTree_Cohorts_Utxo_Profitability} profitability - * @property {MetricsTree_Cohorts_Utxo_Matured} matured + * @typedef {Object} SeriesTree_Cohorts_Utxo + * @property {SeriesTree_Cohorts_Utxo_All} all + * @property {SeriesTree_Cohorts_Utxo_Sth} sth + * @property {SeriesTree_Cohorts_Utxo_Lth} lth + * @property {SeriesTree_Cohorts_Utxo_AgeRange} ageRange + * @property {SeriesTree_Cohorts_Utxo_UnderAge} underAge + * @property {SeriesTree_Cohorts_Utxo_OverAge} overAge + * @property {SeriesTree_Cohorts_Utxo_Epoch} epoch + * @property {SeriesTree_Cohorts_Utxo_Class} class + * @property {SeriesTree_Cohorts_Utxo_OverAmount} overAmount + * @property {SeriesTree_Cohorts_Utxo_AmountRange} amountRange + * @property {SeriesTree_Cohorts_Utxo_UnderAmount} underAmount + * @property {SeriesTree_Cohorts_Utxo_Type} type + * @property {SeriesTree_Cohorts_Utxo_Profitability} profitability + * @property {SeriesTree_Cohorts_Utxo_Matured} matured */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All - * @property {MetricsTree_Cohorts_Utxo_All_Supply} supply + * @typedef {Object} SeriesTree_Cohorts_Utxo_All + * @property {SeriesTree_Cohorts_Utxo_All_Supply} supply * @property {UnspentPattern} outputs - * @property {MetricsTree_Cohorts_Utxo_All_Activity} activity - * @property {MetricsTree_Cohorts_Utxo_All_Realized} realized - * @property {MetricsTree_Cohorts_Utxo_All_CostBasis} costBasis - * @property {MetricsTree_Cohorts_Utxo_All_Unrealized} unrealized + * @property {SeriesTree_Cohorts_Utxo_All_Activity} activity + * @property {SeriesTree_Cohorts_Utxo_All_Realized} realized + * @property {SeriesTree_Cohorts_Utxo_All_CostBasis} costBasis + * @property {SeriesTree_Cohorts_Utxo_All_Unrealized} unrealized */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Supply + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Supply * @property {BtcCentsSatsUsdPattern} total * @property {BtcCentsSatsUsdPattern} half * @property {AbsoluteRatePattern} delta @@ -5323,76 +5346,76 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Activity + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Activity * @property {BaseCumulativeInSumPattern} sent * @property {BaseCumulativeSumPattern} coindaysDestroyed - * @property {MetricPattern1} coinyearsDestroyed - * @property {MetricPattern1} dormancy + * @property {SeriesPattern1} coinyearsDestroyed + * @property {SeriesPattern1} dormancy */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized * @property {CentsDeltaRelUsdPattern} cap - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Profit} profit - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Loss} loss - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Price} price - * @property {MetricPattern1} mvrv - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Sopr} sopr + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Profit} profit + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Loss} loss + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Price} price + * @property {SeriesPattern1} mvrv + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Sopr} sopr * @property {BaseChangeCumulativeDeltaRelSumPattern} netPnl * @property {BaseCumulativeSumPattern3} grossPnl * @property {_1m1w1y24hPattern6} sellSideRiskRatio * @property {BaseCumulativeRelPattern} peakRegret - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Investor} investor + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Investor} investor * @property {_1m1w1y24hPattern} profitToLossRatio */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Profit + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Profit * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative * @property {_1m1w1y24hPattern4} sum * @property {BpsPercentRatioPattern4} relToRcap * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed - * @property {MetricPattern1} distributionFlow + * @property {SeriesPattern1} distributionFlow */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Loss + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Loss * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative * @property {_1m1w1y24hPattern4} sum - * @property {MetricPattern1} negative + * @property {SeriesPattern1} negative * @property {BpsPercentRatioPattern4} relToRcap * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed - * @property {MetricPattern1} capitulationFlow + * @property {SeriesPattern1} capitulationFlow */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Price - * @property {MetricPattern1} usd - * @property {MetricPattern1} cents - * @property {MetricPattern1} sats - * @property {MetricPattern1} bps - * @property {MetricPattern1} ratio + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Price + * @property {SeriesPattern1} usd + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} ratio * @property {Pct1Pct2Pct5Pct95Pct98Pct99Pattern} percentiles * @property {_1m1w1y2y4yAllPattern} sma - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev} stdDev + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev} stdDev */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All} all - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y} _4y - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y} _2y - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y} _1y + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All} all + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y} _4y + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y} _2y + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y} _1y */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5409,9 +5432,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5428,9 +5451,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5447,9 +5470,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5466,29 +5489,29 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Sopr + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Sopr * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed * @property {_1m1w1y24hPattern} ratio - * @property {MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted} adjusted + * @property {SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted} adjusted */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted * @property {_1m1w1y24hPattern} ratio * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Realized_Investor + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Realized_Investor * @property {BpsCentsPercentilesRatioSatsUsdPattern} price * @property {CentsSatsUsdPattern} lowerPriceBand * @property {CentsSatsUsdPattern} upperPriceBand */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_CostBasis + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_CostBasis * @property {CentsSatsUsdPattern} min * @property {CentsSatsUsdPattern} max * @property {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} percentiles @@ -5497,18 +5520,18 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Unrealized + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized * @property {BpsRatioPattern} nupl - * @property {MetricsTree_Cohorts_Utxo_All_Unrealized_Profit} profit - * @property {MetricsTree_Cohorts_Utxo_All_Unrealized_Loss} loss - * @property {MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl} netPnl + * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_Profit} profit + * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_Loss} loss + * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl} netPnl * @property {CentsUsdPattern2} grossPnl * @property {InPattern} investedCapital - * @property {MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment} sentiment + * @property {SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment} sentiment */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Unrealized_Profit + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized_Profit * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative * @property {_1m1w1y24hPattern4} sum @@ -5517,110 +5540,110 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Unrealized_Loss + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized_Loss * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative * @property {_1m1w1y24hPattern4} sum - * @property {MetricPattern1} negative + * @property {SeriesPattern1} negative * @property {BpsPercentRatioPattern3} relToMcap * @property {BpsPercentRatioPattern3} relToOwnGross */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl - * @property {MetricPattern1} usd - * @property {MetricPattern1} cents + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl + * @property {SeriesPattern1} usd + * @property {SeriesPattern1} cents * @property {BpsPercentRatioPattern} relToOwnGross */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment + * @typedef {Object} SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment * @property {CentsUsdPattern2} painIndex * @property {CentsUsdPattern2} greedIndex * @property {CentsUsdPattern} net */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth * @property {DeltaHalfInRelTotalPattern2} supply * @property {UnspentPattern} outputs - * @property {MetricsTree_Cohorts_Utxo_Sth_Activity} activity - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized} realized - * @property {MetricsTree_Cohorts_Utxo_Sth_CostBasis} costBasis - * @property {MetricsTree_Cohorts_Utxo_Sth_Unrealized} unrealized + * @property {SeriesTree_Cohorts_Utxo_Sth_Activity} activity + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized} realized + * @property {SeriesTree_Cohorts_Utxo_Sth_CostBasis} costBasis + * @property {SeriesTree_Cohorts_Utxo_Sth_Unrealized} unrealized */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Activity + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Activity * @property {BaseCumulativeInSumPattern} sent * @property {BaseCumulativeSumPattern} coindaysDestroyed - * @property {MetricPattern1} coinyearsDestroyed - * @property {MetricPattern1} dormancy + * @property {SeriesPattern1} coinyearsDestroyed + * @property {SeriesPattern1} dormancy */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized * @property {CentsDeltaRelUsdPattern} cap - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Profit} profit - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Loss} loss - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Price} price - * @property {MetricPattern1} mvrv - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr} sopr + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Profit} profit + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Loss} loss + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Price} price + * @property {SeriesPattern1} mvrv + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr} sopr * @property {BaseChangeCumulativeDeltaRelSumPattern} netPnl * @property {BaseCumulativeSumPattern3} grossPnl * @property {_1m1w1y24hPattern6} sellSideRiskRatio * @property {BaseCumulativeRelPattern} peakRegret - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Investor} investor + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Investor} investor * @property {_1m1w1y24hPattern} profitToLossRatio */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Profit + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Profit * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative * @property {_1m1w1y24hPattern4} sum * @property {BpsPercentRatioPattern4} relToRcap * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed - * @property {MetricPattern1} distributionFlow + * @property {SeriesPattern1} distributionFlow */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Loss + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Loss * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative * @property {_1m1w1y24hPattern4} sum - * @property {MetricPattern1} negative + * @property {SeriesPattern1} negative * @property {BpsPercentRatioPattern4} relToRcap * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed - * @property {MetricPattern1} capitulationFlow + * @property {SeriesPattern1} capitulationFlow */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Price - * @property {MetricPattern1} usd - * @property {MetricPattern1} cents - * @property {MetricPattern1} sats - * @property {MetricPattern1} bps - * @property {MetricPattern1} ratio + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Price + * @property {SeriesPattern1} usd + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} ratio * @property {Pct1Pct2Pct5Pct95Pct98Pct99Pattern} percentiles * @property {_1m1w1y2y4yAllPattern} sma - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev} stdDev + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev} stdDev */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All} all - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y} _4y - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y} _2y - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y} _1y + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All} all + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y} _4y + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y} _2y + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y} _1y */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5637,9 +5660,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5656,9 +5679,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5675,9 +5698,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5694,29 +5717,29 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed * @property {_1m1w1y24hPattern} ratio - * @property {MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted} adjusted + * @property {SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted} adjusted */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted * @property {_1m1w1y24hPattern} ratio * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Realized_Investor + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Realized_Investor * @property {BpsCentsPercentilesRatioSatsUsdPattern} price * @property {CentsSatsUsdPattern} lowerPriceBand * @property {CentsSatsUsdPattern} upperPriceBand */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_CostBasis + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_CostBasis * @property {CentsSatsUsdPattern} min * @property {CentsSatsUsdPattern} max * @property {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} percentiles @@ -5725,104 +5748,104 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Unrealized + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Unrealized * @property {BpsRatioPattern} nupl * @property {BaseCumulativeRelSumPattern2} profit * @property {BaseCumulativeNegativeRelSumPattern2} loss * @property {CentsRelUsdPattern2} netPnl * @property {CentsUsdPattern2} grossPnl * @property {InPattern} investedCapital - * @property {MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment} sentiment + * @property {SeriesTree_Cohorts_Utxo_Sth_Unrealized_Sentiment} sentiment */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment + * @typedef {Object} SeriesTree_Cohorts_Utxo_Sth_Unrealized_Sentiment * @property {CentsUsdPattern2} painIndex * @property {CentsUsdPattern2} greedIndex * @property {CentsUsdPattern} net */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth * @property {DeltaHalfInRelTotalPattern2} supply * @property {UnspentPattern} outputs - * @property {MetricsTree_Cohorts_Utxo_Lth_Activity} activity - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized} realized - * @property {MetricsTree_Cohorts_Utxo_Lth_CostBasis} costBasis - * @property {MetricsTree_Cohorts_Utxo_Lth_Unrealized} unrealized + * @property {SeriesTree_Cohorts_Utxo_Lth_Activity} activity + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized} realized + * @property {SeriesTree_Cohorts_Utxo_Lth_CostBasis} costBasis + * @property {SeriesTree_Cohorts_Utxo_Lth_Unrealized} unrealized */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Activity + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Activity * @property {BaseCumulativeInSumPattern} sent * @property {BaseCumulativeSumPattern} coindaysDestroyed - * @property {MetricPattern1} coinyearsDestroyed - * @property {MetricPattern1} dormancy + * @property {SeriesPattern1} coinyearsDestroyed + * @property {SeriesPattern1} dormancy */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized * @property {CentsDeltaRelUsdPattern} cap - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Profit} profit - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Loss} loss - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Price} price - * @property {MetricPattern1} mvrv - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr} sopr + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Profit} profit + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Loss} loss + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Price} price + * @property {SeriesPattern1} mvrv + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr} sopr * @property {BaseChangeCumulativeDeltaRelSumPattern} netPnl * @property {BaseCumulativeSumPattern3} grossPnl * @property {_1m1w1y24hPattern6} sellSideRiskRatio * @property {BaseCumulativeRelPattern} peakRegret - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Investor} investor + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Investor} investor * @property {_1m1w1y24hPattern} profitToLossRatio */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Profit + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Profit * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative * @property {_1m1w1y24hPattern4} sum * @property {BpsPercentRatioPattern4} relToRcap * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed - * @property {MetricPattern1} distributionFlow + * @property {SeriesPattern1} distributionFlow */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Loss + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Loss * @property {CentsUsdPattern2} base * @property {CentsUsdPattern2} cumulative * @property {_1m1w1y24hPattern4} sum - * @property {MetricPattern1} negative + * @property {SeriesPattern1} negative * @property {BpsPercentRatioPattern4} relToRcap * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed - * @property {MetricPattern1} capitulationFlow + * @property {SeriesPattern1} capitulationFlow */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Price - * @property {MetricPattern1} usd - * @property {MetricPattern1} cents - * @property {MetricPattern1} sats - * @property {MetricPattern1} bps - * @property {MetricPattern1} ratio + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Price + * @property {SeriesPattern1} usd + * @property {SeriesPattern1} cents + * @property {SeriesPattern1} sats + * @property {SeriesPattern1} bps + * @property {SeriesPattern1} ratio * @property {Pct1Pct2Pct5Pct95Pct98Pct99Pattern} percentiles * @property {_1m1w1y2y4yAllPattern} sma - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev} stdDev + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev} stdDev */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All} all - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y} _4y - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y} _2y - * @property {MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y} _1y + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All} all + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y} _4y + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y} _2y + * @property {SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y} _1y */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5839,9 +5862,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5858,9 +5881,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5877,9 +5900,9 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y - * @property {MetricPattern1} sd - * @property {MetricPattern1} zscore + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y + * @property {SeriesPattern1} sd + * @property {SeriesPattern1} zscore * @property {CentsSatsUsdPattern} _0sd * @property {PriceRatioPattern} p05sd * @property {PriceRatioPattern} p1sd @@ -5896,21 +5919,21 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr * @property {BaseCumulativeSumPattern} valueCreated * @property {BaseCumulativeSumPattern} valueDestroyed * @property {_1m1w1y24hPattern} ratio */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Realized_Investor + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Realized_Investor * @property {BpsCentsPercentilesRatioSatsUsdPattern} price * @property {CentsSatsUsdPattern} lowerPriceBand * @property {CentsSatsUsdPattern} upperPriceBand */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_CostBasis + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_CostBasis * @property {CentsSatsUsdPattern} min * @property {CentsSatsUsdPattern} max * @property {Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern} percentiles @@ -5919,25 +5942,25 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Unrealized + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Unrealized * @property {BpsRatioPattern} nupl * @property {BaseCumulativeRelSumPattern2} profit * @property {BaseCumulativeNegativeRelSumPattern2} loss * @property {CentsRelUsdPattern2} netPnl * @property {CentsUsdPattern2} grossPnl * @property {InPattern} investedCapital - * @property {MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment} sentiment + * @property {SeriesTree_Cohorts_Utxo_Lth_Unrealized_Sentiment} sentiment */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment + * @typedef {Object} SeriesTree_Cohorts_Utxo_Lth_Unrealized_Sentiment * @property {CentsUsdPattern2} painIndex * @property {CentsUsdPattern2} greedIndex * @property {CentsUsdPattern} net */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_AgeRange + * @typedef {Object} SeriesTree_Cohorts_Utxo_AgeRange * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} under1h * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1hTo1d * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1dTo1w @@ -5962,7 +5985,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_UnderAge + * @typedef {Object} SeriesTree_Cohorts_Utxo_UnderAge * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1w * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1m * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2m @@ -5984,7 +6007,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_OverAge + * @typedef {Object} SeriesTree_Cohorts_Utxo_OverAge * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1d * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1w * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1m @@ -6006,7 +6029,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Epoch + * @typedef {Object} SeriesTree_Cohorts_Utxo_Epoch * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _0 * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _1 * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2 @@ -6015,7 +6038,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Class + * @typedef {Object} SeriesTree_Cohorts_Utxo_Class * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2009 * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2010 * @property {ActivityOutputsRealizedSupplyUnrealizedPattern} _2011 @@ -6037,7 +6060,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_OverAmount + * @typedef {Object} SeriesTree_Cohorts_Utxo_OverAmount * @property {OutputsRealizedSupplyUnrealizedPattern} _1sat * @property {OutputsRealizedSupplyUnrealizedPattern} _10sats * @property {OutputsRealizedSupplyUnrealizedPattern} _100sats @@ -6054,7 +6077,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_AmountRange + * @typedef {Object} SeriesTree_Cohorts_Utxo_AmountRange * @property {OutputsRealizedSupplyUnrealizedPattern} _0sats * @property {OutputsRealizedSupplyUnrealizedPattern} _1satTo10sats * @property {OutputsRealizedSupplyUnrealizedPattern} _10satsTo100sats @@ -6073,7 +6096,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_UnderAmount + * @typedef {Object} SeriesTree_Cohorts_Utxo_UnderAmount * @property {OutputsRealizedSupplyUnrealizedPattern} _10sats * @property {OutputsRealizedSupplyUnrealizedPattern} _100sats * @property {OutputsRealizedSupplyUnrealizedPattern} _1kSats @@ -6090,7 +6113,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Type + * @typedef {Object} SeriesTree_Cohorts_Utxo_Type * @property {OutputsRealizedSupplyUnrealizedPattern2} p2pk65 * @property {OutputsRealizedSupplyUnrealizedPattern2} p2pk33 * @property {OutputsRealizedSupplyUnrealizedPattern2} p2pkh @@ -6105,14 +6128,14 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Profitability - * @property {MetricsTree_Cohorts_Utxo_Profitability_Range} range - * @property {MetricsTree_Cohorts_Utxo_Profitability_Profit} profit - * @property {MetricsTree_Cohorts_Utxo_Profitability_Loss} loss + * @typedef {Object} SeriesTree_Cohorts_Utxo_Profitability + * @property {SeriesTree_Cohorts_Utxo_Profitability_Range} range + * @property {SeriesTree_Cohorts_Utxo_Profitability_Profit} profit + * @property {SeriesTree_Cohorts_Utxo_Profitability_Loss} loss */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Profitability_Range + * @typedef {Object} SeriesTree_Cohorts_Utxo_Profitability_Range * @property {NuplRealizedSupplyPattern} over1000pctInProfit * @property {NuplRealizedSupplyPattern} _500pctTo1000pctInProfit * @property {NuplRealizedSupplyPattern} _300pctTo500pctInProfit @@ -6141,8 +6164,8 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Profitability_Profit - * @property {NuplRealizedSupplyPattern} breakeven + * @typedef {Object} SeriesTree_Cohorts_Utxo_Profitability_Profit + * @property {NuplRealizedSupplyPattern} all * @property {NuplRealizedSupplyPattern} _10pct * @property {NuplRealizedSupplyPattern} _20pct * @property {NuplRealizedSupplyPattern} _30pct @@ -6159,8 +6182,8 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Profitability_Loss - * @property {NuplRealizedSupplyPattern} breakeven + * @typedef {Object} SeriesTree_Cohorts_Utxo_Profitability_Loss + * @property {NuplRealizedSupplyPattern} all * @property {NuplRealizedSupplyPattern} _10pct * @property {NuplRealizedSupplyPattern} _20pct * @property {NuplRealizedSupplyPattern} _30pct @@ -6172,7 +6195,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Utxo_Matured + * @typedef {Object} SeriesTree_Cohorts_Utxo_Matured * @property {BaseCumulativeSumPattern4} under1h * @property {BaseCumulativeSumPattern4} _1hTo1d * @property {BaseCumulativeSumPattern4} _1dTo1w @@ -6197,14 +6220,14 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Address - * @property {MetricsTree_Cohorts_Address_OverAmount} overAmount - * @property {MetricsTree_Cohorts_Address_AmountRange} amountRange - * @property {MetricsTree_Cohorts_Address_UnderAmount} underAmount + * @typedef {Object} SeriesTree_Cohorts_Address + * @property {SeriesTree_Cohorts_Address_OverAmount} overAmount + * @property {SeriesTree_Cohorts_Address_AmountRange} amountRange + * @property {SeriesTree_Cohorts_Address_UnderAmount} underAmount */ /** - * @typedef {Object} MetricsTree_Cohorts_Address_OverAmount + * @typedef {Object} SeriesTree_Cohorts_Address_OverAmount * @property {AddressOutputsRealizedSupplyUnrealizedPattern} _1sat * @property {AddressOutputsRealizedSupplyUnrealizedPattern} _10sats * @property {AddressOutputsRealizedSupplyUnrealizedPattern} _100sats @@ -6221,7 +6244,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Address_AmountRange + * @typedef {Object} SeriesTree_Cohorts_Address_AmountRange * @property {AddressOutputsRealizedSupplyUnrealizedPattern} _0sats * @property {AddressOutputsRealizedSupplyUnrealizedPattern} _1satTo10sats * @property {AddressOutputsRealizedSupplyUnrealizedPattern} _10satsTo100sats @@ -6240,7 +6263,7 @@ function createUnspentPattern(client, acc) { */ /** - * @typedef {Object} MetricsTree_Cohorts_Address_UnderAmount + * @typedef {Object} SeriesTree_Cohorts_Address_UnderAmount * @property {AddressOutputsRealizedSupplyUnrealizedPattern} _10sats * @property {AddressOutputsRealizedSupplyUnrealizedPattern} _100sats * @property {AddressOutputsRealizedSupplyUnrealizedPattern} _1kSats @@ -6257,7 +6280,7 @@ function createUnspentPattern(client, acc) { */ /** - * Main BRK client with metrics tree and API methods + * Main BRK client with series tree and API methods * @extends BrkClientBase */ class BrkClient extends BrkClientBase { @@ -7167,249 +7190,249 @@ class BrkClient extends BrkClientBase { PROFITABILITY_RANGE_NAMES = /** @type {const} */ ({ "over1000pctInProfit": { "id": "utxos_over_1000pct_in_profit", - "short": ">1000%", - "long": "Over 1000% Profit" + "short": "+>1000%", + "long": "Over 1000% in Profit" }, "_500pctTo1000pctInProfit": { "id": "utxos_500pct_to_1000pct_in_profit", - "short": "500-1000%", - "long": "500-1000% Profit" + "short": "+500-1000%", + "long": "500-1000% in Profit" }, "_300pctTo500pctInProfit": { "id": "utxos_300pct_to_500pct_in_profit", - "short": "300-500%", - "long": "300-500% Profit" + "short": "+300-500%", + "long": "300-500% in Profit" }, "_200pctTo300pctInProfit": { "id": "utxos_200pct_to_300pct_in_profit", - "short": "200-300%", - "long": "200-300% Profit" + "short": "+200-300%", + "long": "200-300% in Profit" }, "_100pctTo200pctInProfit": { "id": "utxos_100pct_to_200pct_in_profit", - "short": "100-200%", - "long": "100-200% Profit" + "short": "+100-200%", + "long": "100-200% in Profit" }, "_90pctTo100pctInProfit": { "id": "utxos_90pct_to_100pct_in_profit", - "short": "90-100%", - "long": "90-100% Profit" + "short": "+90-100%", + "long": "90-100% in Profit" }, "_80pctTo90pctInProfit": { "id": "utxos_80pct_to_90pct_in_profit", - "short": "80-90%", - "long": "80-90% Profit" + "short": "+80-90%", + "long": "80-90% in Profit" }, "_70pctTo80pctInProfit": { "id": "utxos_70pct_to_80pct_in_profit", - "short": "70-80%", - "long": "70-80% Profit" + "short": "+70-80%", + "long": "70-80% in Profit" }, "_60pctTo70pctInProfit": { "id": "utxos_60pct_to_70pct_in_profit", - "short": "60-70%", - "long": "60-70% Profit" + "short": "+60-70%", + "long": "60-70% in Profit" }, "_50pctTo60pctInProfit": { "id": "utxos_50pct_to_60pct_in_profit", - "short": "50-60%", - "long": "50-60% Profit" + "short": "+50-60%", + "long": "50-60% in Profit" }, "_40pctTo50pctInProfit": { "id": "utxos_40pct_to_50pct_in_profit", - "short": "40-50%", - "long": "40-50% Profit" + "short": "+40-50%", + "long": "40-50% in Profit" }, "_30pctTo40pctInProfit": { "id": "utxos_30pct_to_40pct_in_profit", - "short": "30-40%", - "long": "30-40% Profit" + "short": "+30-40%", + "long": "30-40% in Profit" }, "_20pctTo30pctInProfit": { "id": "utxos_20pct_to_30pct_in_profit", - "short": "20-30%", - "long": "20-30% Profit" + "short": "+20-30%", + "long": "20-30% in Profit" }, "_10pctTo20pctInProfit": { "id": "utxos_10pct_to_20pct_in_profit", - "short": "10-20%", - "long": "10-20% Profit" + "short": "+10-20%", + "long": "10-20% in Profit" }, "_0pctTo10pctInProfit": { "id": "utxos_0pct_to_10pct_in_profit", - "short": "0-10%", - "long": "0-10% Profit" + "short": "+0-10%", + "long": "0-10% in Profit" }, "_0pctTo10pctInLoss": { "id": "utxos_0pct_to_10pct_in_loss", - "short": "0-10%L", - "long": "0-10% Loss" + "short": "-0-10%", + "long": "0-10% in Loss" }, "_10pctTo20pctInLoss": { "id": "utxos_10pct_to_20pct_in_loss", - "short": "10-20%L", - "long": "10-20% Loss" + "short": "-10-20%", + "long": "10-20% in Loss" }, "_20pctTo30pctInLoss": { "id": "utxos_20pct_to_30pct_in_loss", - "short": "20-30%L", - "long": "20-30% Loss" + "short": "-20-30%", + "long": "20-30% in Loss" }, "_30pctTo40pctInLoss": { "id": "utxos_30pct_to_40pct_in_loss", - "short": "30-40%L", - "long": "30-40% Loss" + "short": "-30-40%", + "long": "30-40% in Loss" }, "_40pctTo50pctInLoss": { "id": "utxos_40pct_to_50pct_in_loss", - "short": "40-50%L", - "long": "40-50% Loss" + "short": "-40-50%", + "long": "40-50% in Loss" }, "_50pctTo60pctInLoss": { "id": "utxos_50pct_to_60pct_in_loss", - "short": "50-60%L", - "long": "50-60% Loss" + "short": "-50-60%", + "long": "50-60% in Loss" }, "_60pctTo70pctInLoss": { "id": "utxos_60pct_to_70pct_in_loss", - "short": "60-70%L", - "long": "60-70% Loss" + "short": "-60-70%", + "long": "60-70% in Loss" }, "_70pctTo80pctInLoss": { "id": "utxos_70pct_to_80pct_in_loss", - "short": "70-80%L", - "long": "70-80% Loss" + "short": "-70-80%", + "long": "70-80% in Loss" }, "_80pctTo90pctInLoss": { "id": "utxos_80pct_to_90pct_in_loss", - "short": "80-90%L", - "long": "80-90% Loss" + "short": "-80-90%", + "long": "80-90% in Loss" }, "_90pctTo100pctInLoss": { "id": "utxos_90pct_to_100pct_in_loss", - "short": "90-100%L", - "long": "90-100% Loss" + "short": "-90-100%", + "long": "90-100% in Loss" } }); PROFIT_NAMES = /** @type {const} */ ({ - "breakeven": { + "all": { "id": "utxos_in_profit", - "short": "≥0%", - "long": "In Profit (Breakeven+)" + "short": "All", + "long": "In Profit" }, "_10pct": { "id": "utxos_over_10pct_in_profit", - "short": "≥10%", - "long": "10%+ Profit" + "short": ">=10%", + "long": "Over 10% in Profit" }, "_20pct": { "id": "utxos_over_20pct_in_profit", - "short": "≥20%", - "long": "20%+ Profit" + "short": ">=20%", + "long": "Over 20% in Profit" }, "_30pct": { "id": "utxos_over_30pct_in_profit", - "short": "≥30%", - "long": "30%+ Profit" + "short": ">=30%", + "long": "Over 30% in Profit" }, "_40pct": { "id": "utxos_over_40pct_in_profit", - "short": "≥40%", - "long": "40%+ Profit" + "short": ">=40%", + "long": "Over 40% in Profit" }, "_50pct": { "id": "utxos_over_50pct_in_profit", - "short": "≥50%", - "long": "50%+ Profit" + "short": ">=50%", + "long": "Over 50% in Profit" }, "_60pct": { "id": "utxos_over_60pct_in_profit", - "short": "≥60%", - "long": "60%+ Profit" + "short": ">=60%", + "long": "Over 60% in Profit" }, "_70pct": { "id": "utxos_over_70pct_in_profit", - "short": "≥70%", - "long": "70%+ Profit" + "short": ">=70%", + "long": "Over 70% in Profit" }, "_80pct": { "id": "utxos_over_80pct_in_profit", - "short": "≥80%", - "long": "80%+ Profit" + "short": ">=80%", + "long": "Over 80% in Profit" }, "_90pct": { "id": "utxos_over_90pct_in_profit", - "short": "≥90%", - "long": "90%+ Profit" + "short": ">=90%", + "long": "Over 90% in Profit" }, "_100pct": { "id": "utxos_over_100pct_in_profit", - "short": "≥100%", - "long": "100%+ Profit" + "short": ">=100%", + "long": "Over 100% in Profit" }, "_200pct": { "id": "utxos_over_200pct_in_profit", - "short": "≥200%", - "long": "200%+ Profit" + "short": ">=200%", + "long": "Over 200% in Profit" }, "_300pct": { "id": "utxos_over_300pct_in_profit", - "short": "≥300%", - "long": "300%+ Profit" + "short": ">=300%", + "long": "Over 300% in Profit" }, "_500pct": { "id": "utxos_over_500pct_in_profit", - "short": "≥500%", - "long": "500%+ Profit" + "short": ">=500%", + "long": "Over 500% in Profit" } }); LOSS_NAMES = /** @type {const} */ ({ - "breakeven": { + "all": { "id": "utxos_in_loss", - "short": "<0%", - "long": "In Loss (Below Breakeven)" + "short": "All", + "long": "In Loss" }, "_10pct": { "id": "utxos_over_10pct_in_loss", - "short": "≥10%L", - "long": "10%+ Loss" + "short": ">=10%", + "long": "Over 10% in Loss" }, "_20pct": { "id": "utxos_over_20pct_in_loss", - "short": "≥20%L", - "long": "20%+ Loss" + "short": ">=20%", + "long": "Over 20% in Loss" }, "_30pct": { "id": "utxos_over_30pct_in_loss", - "short": "≥30%L", - "long": "30%+ Loss" + "short": ">=30%", + "long": "Over 30% in Loss" }, "_40pct": { "id": "utxos_over_40pct_in_loss", - "short": "≥40%L", - "long": "40%+ Loss" + "short": ">=40%", + "long": "Over 40% in Loss" }, "_50pct": { "id": "utxos_over_50pct_in_loss", - "short": "≥50%L", - "long": "50%+ Loss" + "short": ">=50%", + "long": "Over 50% in Loss" }, "_60pct": { "id": "utxos_over_60pct_in_loss", - "short": "≥60%L", - "long": "60%+ Loss" + "short": ">=60%", + "long": "Over 60% in Loss" }, "_70pct": { "id": "utxos_over_70pct_in_loss", - "short": "≥70%L", - "long": "70%+ Loss" + "short": ">=70%", + "long": "Over 70% in Loss" }, "_80pct": { "id": "utxos_over_80pct_in_loss", - "short": "≥80%L", - "long": "80%+ Loss" + "short": ">=80%", + "long": "Over 80% in Loss" } }); @@ -7439,35 +7462,35 @@ class BrkClient extends BrkClientBase { */ constructor(options) { super(options); - /** @type {MetricsTree} */ - this.metrics = this._buildTree(''); + /** @type {SeriesTree} */ + this.series = this._buildTree(''); } /** * @private * @param {string} basePath - * @returns {MetricsTree} + * @returns {SeriesTree} */ _buildTree(basePath) { return { blocks: { - blockhash: createMetricPattern18(this, 'blockhash'), + blockhash: createSeriesPattern18(this, 'blockhash'), difficulty: { - value: createMetricPattern1(this, 'difficulty'), - asHash: createMetricPattern1(this, 'difficulty_as_hash'), + value: createSeriesPattern1(this, 'difficulty'), + asHash: createSeriesPattern1(this, 'difficulty_as_hash'), adjustment: createBpsPercentRatioPattern(this, 'difficulty_adjustment'), - epoch: createMetricPattern1(this, 'difficulty_epoch'), - blocksBeforeNext: createMetricPattern1(this, 'blocks_before_next_difficulty_adjustment'), - daysBeforeNext: createMetricPattern1(this, 'days_before_next_difficulty_adjustment'), + epoch: createSeriesPattern1(this, 'difficulty_epoch'), + blocksBeforeNext: createSeriesPattern1(this, 'blocks_before_next_difficulty_adjustment'), + daysBeforeNext: createSeriesPattern1(this, 'days_before_next_difficulty_adjustment'), }, time: { - timestamp: createMetricPattern1(this, 'timestamp'), - date: createMetricPattern18(this, 'date'), - timestampMonotonic: createMetricPattern18(this, 'timestamp_monotonic'), + timestamp: createSeriesPattern1(this, 'timestamp'), + date: createSeriesPattern18(this, 'date'), + timestampMonotonic: createSeriesPattern18(this, 'timestamp_monotonic'), }, size: { - total: createMetricPattern18(this, 'total_size'), - cumulative: createMetricPattern1(this, 'block_size_cumulative'), + total: createSeriesPattern18(this, 'total_size'), + cumulative: createSeriesPattern1(this, 'block_size_cumulative'), sum: create_1m1w1y24hPattern(this, 'block_size_sum'), average: create_1m1w1y24hPattern(this, 'block_size_average'), min: create_1m1w1y24hPattern(this, 'block_size_min'), @@ -7479,8 +7502,8 @@ class BrkClient extends BrkClientBase { pct90: create_1m1w1y24hPattern(this, 'block_size_pct90'), }, weight: { - raw: createMetricPattern18(this, 'block_weight'), - cumulative: createMetricPattern1(this, 'block_weight_cumulative'), + raw: createSeriesPattern18(this, 'block_weight'), + cumulative: createSeriesPattern1(this, 'block_weight_cumulative'), sum: create_1m1w1y24hPattern(this, 'block_weight_sum'), average: create_1m1w1y24hPattern(this, 'block_weight_average'), min: create_1m1w1y24hPattern(this, 'block_weight_min'), @@ -7492,91 +7515,91 @@ class BrkClient extends BrkClientBase { pct90: create_1m1w1y24hPattern(this, 'block_weight_pct90'), }, count: { - target: createMetricPattern1(this, 'block_count_target'), + target: createSeriesPattern1(this, 'block_count_target'), total: createBaseCumulativeSumPattern2(this, 'block_count'), }, lookback: { - _1h: createMetricPattern18(this, 'height_1h_ago'), - _24h: createMetricPattern18(this, 'height_24h_ago'), - _3d: createMetricPattern18(this, 'height_3d_ago'), - _1w: createMetricPattern18(this, 'height_1w_ago'), - _8d: createMetricPattern18(this, 'height_8d_ago'), - _9d: createMetricPattern18(this, 'height_9d_ago'), - _12d: createMetricPattern18(this, 'height_12d_ago'), - _13d: createMetricPattern18(this, 'height_13d_ago'), - _2w: createMetricPattern18(this, 'height_2w_ago'), - _21d: createMetricPattern18(this, 'height_21d_ago'), - _26d: createMetricPattern18(this, 'height_26d_ago'), - _1m: createMetricPattern18(this, 'height_1m_ago'), - _34d: createMetricPattern18(this, 'height_34d_ago'), - _55d: createMetricPattern18(this, 'height_55d_ago'), - _2m: createMetricPattern18(this, 'height_2m_ago'), - _9w: createMetricPattern18(this, 'height_9w_ago'), - _12w: createMetricPattern18(this, 'height_12w_ago'), - _89d: createMetricPattern18(this, 'height_89d_ago'), - _3m: createMetricPattern18(this, 'height_3m_ago'), - _14w: createMetricPattern18(this, 'height_14w_ago'), - _111d: createMetricPattern18(this, 'height_111d_ago'), - _144d: createMetricPattern18(this, 'height_144d_ago'), - _6m: createMetricPattern18(this, 'height_6m_ago'), - _26w: createMetricPattern18(this, 'height_26w_ago'), - _200d: createMetricPattern18(this, 'height_200d_ago'), - _9m: createMetricPattern18(this, 'height_9m_ago'), - _350d: createMetricPattern18(this, 'height_350d_ago'), - _12m: createMetricPattern18(this, 'height_12m_ago'), - _1y: createMetricPattern18(this, 'height_1y_ago'), - _14m: createMetricPattern18(this, 'height_14m_ago'), - _2y: createMetricPattern18(this, 'height_2y_ago'), - _26m: createMetricPattern18(this, 'height_26m_ago'), - _3y: createMetricPattern18(this, 'height_3y_ago'), - _200w: createMetricPattern18(this, 'height_200w_ago'), - _4y: createMetricPattern18(this, 'height_4y_ago'), - _5y: createMetricPattern18(this, 'height_5y_ago'), - _6y: createMetricPattern18(this, 'height_6y_ago'), - _8y: createMetricPattern18(this, 'height_8y_ago'), - _9y: createMetricPattern18(this, 'height_9y_ago'), - _10y: createMetricPattern18(this, 'height_10y_ago'), - _12y: createMetricPattern18(this, 'height_12y_ago'), - _14y: createMetricPattern18(this, 'height_14y_ago'), - _26y: createMetricPattern18(this, 'height_26y_ago'), + _1h: createSeriesPattern18(this, 'height_1h_ago'), + _24h: createSeriesPattern18(this, 'height_24h_ago'), + _3d: createSeriesPattern18(this, 'height_3d_ago'), + _1w: createSeriesPattern18(this, 'height_1w_ago'), + _8d: createSeriesPattern18(this, 'height_8d_ago'), + _9d: createSeriesPattern18(this, 'height_9d_ago'), + _12d: createSeriesPattern18(this, 'height_12d_ago'), + _13d: createSeriesPattern18(this, 'height_13d_ago'), + _2w: createSeriesPattern18(this, 'height_2w_ago'), + _21d: createSeriesPattern18(this, 'height_21d_ago'), + _26d: createSeriesPattern18(this, 'height_26d_ago'), + _1m: createSeriesPattern18(this, 'height_1m_ago'), + _34d: createSeriesPattern18(this, 'height_34d_ago'), + _55d: createSeriesPattern18(this, 'height_55d_ago'), + _2m: createSeriesPattern18(this, 'height_2m_ago'), + _9w: createSeriesPattern18(this, 'height_9w_ago'), + _12w: createSeriesPattern18(this, 'height_12w_ago'), + _89d: createSeriesPattern18(this, 'height_89d_ago'), + _3m: createSeriesPattern18(this, 'height_3m_ago'), + _14w: createSeriesPattern18(this, 'height_14w_ago'), + _111d: createSeriesPattern18(this, 'height_111d_ago'), + _144d: createSeriesPattern18(this, 'height_144d_ago'), + _6m: createSeriesPattern18(this, 'height_6m_ago'), + _26w: createSeriesPattern18(this, 'height_26w_ago'), + _200d: createSeriesPattern18(this, 'height_200d_ago'), + _9m: createSeriesPattern18(this, 'height_9m_ago'), + _350d: createSeriesPattern18(this, 'height_350d_ago'), + _12m: createSeriesPattern18(this, 'height_12m_ago'), + _1y: createSeriesPattern18(this, 'height_1y_ago'), + _14m: createSeriesPattern18(this, 'height_14m_ago'), + _2y: createSeriesPattern18(this, 'height_2y_ago'), + _26m: createSeriesPattern18(this, 'height_26m_ago'), + _3y: createSeriesPattern18(this, 'height_3y_ago'), + _200w: createSeriesPattern18(this, 'height_200w_ago'), + _4y: createSeriesPattern18(this, 'height_4y_ago'), + _5y: createSeriesPattern18(this, 'height_5y_ago'), + _6y: createSeriesPattern18(this, 'height_6y_ago'), + _8y: createSeriesPattern18(this, 'height_8y_ago'), + _9y: createSeriesPattern18(this, 'height_9y_ago'), + _10y: createSeriesPattern18(this, 'height_10y_ago'), + _12y: createSeriesPattern18(this, 'height_12y_ago'), + _14y: createSeriesPattern18(this, 'height_14y_ago'), + _26y: createSeriesPattern18(this, 'height_26y_ago'), }, interval: create_1m1w1y24hHeightPattern(this, 'block_interval'), vbytes: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'block_vbytes'), fullness: { bps: create_1m1w1y24hHeightPattern(this, 'block_fullness_bps'), - ratio: createMetricPattern1(this, 'block_fullness_ratio'), - percent: createMetricPattern1(this, 'block_fullness'), + ratio: createSeriesPattern1(this, 'block_fullness_ratio'), + percent: createSeriesPattern1(this, 'block_fullness'), }, halving: { - epoch: createMetricPattern1(this, 'halving_epoch'), - blocksBeforeNext: createMetricPattern1(this, 'blocks_before_next_halving'), - daysBeforeNext: createMetricPattern1(this, 'days_before_next_halving'), + epoch: createSeriesPattern1(this, 'halving_epoch'), + blocksBeforeNext: createSeriesPattern1(this, 'blocks_before_next_halving'), + daysBeforeNext: createSeriesPattern1(this, 'days_before_next_halving'), }, }, transactions: { raw: { - firstTxIndex: createMetricPattern18(this, 'first_tx_index'), - height: createMetricPattern19(this, 'height'), - txid: createMetricPattern19(this, 'txid'), - txVersion: createMetricPattern19(this, 'tx_version'), - rawLocktime: createMetricPattern19(this, 'raw_locktime'), - baseSize: createMetricPattern19(this, 'base_size'), - totalSize: createMetricPattern19(this, 'total_size'), - isExplicitlyRbf: createMetricPattern19(this, 'is_explicitly_rbf'), - firstTxinIndex: createMetricPattern19(this, 'first_txin_index'), - firstTxoutIndex: createMetricPattern19(this, 'first_txout_index'), + firstTxIndex: createSeriesPattern18(this, 'first_tx_index'), + height: createSeriesPattern19(this, 'height'), + txid: createSeriesPattern19(this, 'txid'), + txVersion: createSeriesPattern19(this, 'tx_version'), + rawLocktime: createSeriesPattern19(this, 'raw_locktime'), + baseSize: createSeriesPattern19(this, 'base_size'), + totalSize: createSeriesPattern19(this, 'total_size'), + isExplicitlyRbf: createSeriesPattern19(this, 'is_explicitly_rbf'), + firstTxinIndex: createSeriesPattern19(this, 'first_txin_index'), + firstTxoutIndex: createSeriesPattern19(this, 'first_txout_index'), }, count: { total: createAverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(this, 'tx_count'), - isCoinbase: createMetricPattern19(this, 'is_coinbase'), + isCoinbase: createSeriesPattern19(this, 'is_coinbase'), }, size: { vsize: create_6bBlockTxPattern(this, 'tx_vsize'), weight: create_6bBlockTxPattern(this, 'tx_weight'), }, fees: { - inputValue: createMetricPattern19(this, 'input_value'), - outputValue: createMetricPattern19(this, 'output_value'), + inputValue: createSeriesPattern19(this, 'input_value'), + outputValue: createSeriesPattern19(this, 'output_value'), fee: create_6bBlockTxPattern(this, 'fee'), feeRate: create_6bBlockTxPattern(this, 'fee_rate'), }, @@ -7588,91 +7611,91 @@ class BrkClient extends BrkClientBase { volume: { sentSum: createBaseCumulativeSumPattern4(this, 'sent_sum'), receivedSum: createBaseCumulativeSumPattern4(this, 'received_sum'), - txPerSec: createMetricPattern1(this, 'tx_per_sec'), - outputsPerSec: createMetricPattern1(this, 'outputs_per_sec'), - inputsPerSec: createMetricPattern1(this, 'inputs_per_sec'), + txPerSec: createSeriesPattern1(this, 'tx_per_sec'), + outputsPerSec: createSeriesPattern1(this, 'outputs_per_sec'), + inputsPerSec: createSeriesPattern1(this, 'inputs_per_sec'), }, }, inputs: { raw: { - firstTxinIndex: createMetricPattern18(this, 'first_txin_index'), - outpoint: createMetricPattern20(this, 'outpoint'), - txIndex: createMetricPattern20(this, 'tx_index'), - outputType: createMetricPattern20(this, 'output_type'), - typeIndex: createMetricPattern20(this, 'type_index'), + firstTxinIndex: createSeriesPattern18(this, 'first_txin_index'), + outpoint: createSeriesPattern20(this, 'outpoint'), + txIndex: createSeriesPattern20(this, 'tx_index'), + outputType: createSeriesPattern20(this, 'output_type'), + typeIndex: createSeriesPattern20(this, 'type_index'), }, spent: { - txoutIndex: createMetricPattern20(this, 'txout_index'), - value: createMetricPattern20(this, 'value'), + txoutIndex: createSeriesPattern20(this, 'txout_index'), + value: createSeriesPattern20(this, 'value'), }, count: createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(this, 'input_count'), }, outputs: { raw: { - firstTxoutIndex: createMetricPattern18(this, 'first_txout_index'), - value: createMetricPattern21(this, 'value'), - outputType: createMetricPattern21(this, 'output_type'), - typeIndex: createMetricPattern21(this, 'type_index'), - txIndex: createMetricPattern21(this, 'tx_index'), + firstTxoutIndex: createSeriesPattern18(this, 'first_txout_index'), + value: createSeriesPattern21(this, 'value'), + outputType: createSeriesPattern21(this, 'output_type'), + typeIndex: createSeriesPattern21(this, 'type_index'), + txIndex: createSeriesPattern21(this, 'tx_index'), }, spent: { - txinIndex: createMetricPattern21(this, 'txin_index'), + txinIndex: createSeriesPattern21(this, 'txin_index'), }, count: { total: createAverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(this, 'output_count'), - unspent: createMetricPattern1(this, 'exact_utxo_count'), + unspent: createSeriesPattern1(this, 'exact_utxo_count'), }, }, addresses: { raw: { p2pk65: { - firstIndex: createMetricPattern18(this, 'first_p2pk65_address_index'), - bytes: createMetricPattern27(this, 'p2pk65_bytes'), + firstIndex: createSeriesPattern18(this, 'first_p2pk65_address_index'), + bytes: createSeriesPattern27(this, 'p2pk65_bytes'), }, p2pk33: { - firstIndex: createMetricPattern18(this, 'first_p2pk33_address_index'), - bytes: createMetricPattern26(this, 'p2pk33_bytes'), + firstIndex: createSeriesPattern18(this, 'first_p2pk33_address_index'), + bytes: createSeriesPattern26(this, 'p2pk33_bytes'), }, p2pkh: { - firstIndex: createMetricPattern18(this, 'first_p2pkh_address_index'), - bytes: createMetricPattern28(this, 'p2pkh_bytes'), + firstIndex: createSeriesPattern18(this, 'first_p2pkh_address_index'), + bytes: createSeriesPattern28(this, 'p2pkh_bytes'), }, p2sh: { - firstIndex: createMetricPattern18(this, 'first_p2sh_address_index'), - bytes: createMetricPattern29(this, 'p2sh_bytes'), + firstIndex: createSeriesPattern18(this, 'first_p2sh_address_index'), + bytes: createSeriesPattern29(this, 'p2sh_bytes'), }, p2wpkh: { - firstIndex: createMetricPattern18(this, 'first_p2wpkh_address_index'), - bytes: createMetricPattern31(this, 'p2wpkh_bytes'), + firstIndex: createSeriesPattern18(this, 'first_p2wpkh_address_index'), + bytes: createSeriesPattern31(this, 'p2wpkh_bytes'), }, p2wsh: { - firstIndex: createMetricPattern18(this, 'first_p2wsh_address_index'), - bytes: createMetricPattern32(this, 'p2wsh_bytes'), + firstIndex: createSeriesPattern18(this, 'first_p2wsh_address_index'), + bytes: createSeriesPattern32(this, 'p2wsh_bytes'), }, p2tr: { - firstIndex: createMetricPattern18(this, 'first_p2tr_address_index'), - bytes: createMetricPattern30(this, 'p2tr_bytes'), + firstIndex: createSeriesPattern18(this, 'first_p2tr_address_index'), + bytes: createSeriesPattern30(this, 'p2tr_bytes'), }, p2a: { - firstIndex: createMetricPattern18(this, 'first_p2a_address_index'), - bytes: createMetricPattern24(this, 'p2a_bytes'), + firstIndex: createSeriesPattern18(this, 'first_p2a_address_index'), + bytes: createSeriesPattern24(this, 'p2a_bytes'), }, }, indexes: { - p2a: createMetricPattern24(this, 'any_address_index'), - p2pk33: createMetricPattern26(this, 'any_address_index'), - p2pk65: createMetricPattern27(this, 'any_address_index'), - p2pkh: createMetricPattern28(this, 'any_address_index'), - p2sh: createMetricPattern29(this, 'any_address_index'), - p2tr: createMetricPattern30(this, 'any_address_index'), - p2wpkh: createMetricPattern31(this, 'any_address_index'), - p2wsh: createMetricPattern32(this, 'any_address_index'), - funded: createMetricPattern34(this, 'funded_address_index'), - empty: createMetricPattern35(this, 'empty_address_index'), + p2a: createSeriesPattern24(this, 'any_address_index'), + p2pk33: createSeriesPattern26(this, 'any_address_index'), + p2pk65: createSeriesPattern27(this, 'any_address_index'), + p2pkh: createSeriesPattern28(this, 'any_address_index'), + p2sh: createSeriesPattern29(this, 'any_address_index'), + p2tr: createSeriesPattern30(this, 'any_address_index'), + p2wpkh: createSeriesPattern31(this, 'any_address_index'), + p2wsh: createSeriesPattern32(this, 'any_address_index'), + funded: createSeriesPattern34(this, 'funded_address_index'), + empty: createSeriesPattern35(this, 'empty_address_index'), }, data: { - funded: createMetricPattern34(this, 'funded_address_data'), - empty: createMetricPattern35(this, 'empty_address_data'), + funded: createSeriesPattern34(this, 'funded_address_data'), + empty: createSeriesPattern35(this, 'empty_address_data'), }, funded: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(this, 'address_count'), empty: createAllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(this, 'empty_address_count'), @@ -7714,20 +7737,20 @@ class BrkClient extends BrkClientBase { scripts: { raw: { empty: { - firstIndex: createMetricPattern18(this, 'first_empty_output_index'), - toTxIndex: createMetricPattern22(this, 'tx_index'), + firstIndex: createSeriesPattern18(this, 'first_empty_output_index'), + toTxIndex: createSeriesPattern22(this, 'tx_index'), }, opReturn: { - firstIndex: createMetricPattern18(this, 'first_op_return_index'), - toTxIndex: createMetricPattern23(this, 'tx_index'), + firstIndex: createSeriesPattern18(this, 'first_op_return_index'), + toTxIndex: createSeriesPattern23(this, 'tx_index'), }, p2ms: { - firstIndex: createMetricPattern18(this, 'first_p2ms_output_index'), - toTxIndex: createMetricPattern25(this, 'tx_index'), + firstIndex: createSeriesPattern18(this, 'first_p2ms_output_index'), + toTxIndex: createSeriesPattern25(this, 'tx_index'), }, unknown: { - firstIndex: createMetricPattern18(this, 'first_unknown_output_index'), - toTxIndex: createMetricPattern33(this, 'tx_index'), + firstIndex: createSeriesPattern18(this, 'first_unknown_output_index'), + toTxIndex: createSeriesPattern33(this, 'tx_index'), }, }, count: { @@ -7782,14 +7805,14 @@ class BrkClient extends BrkClientBase { }, hashrate: { rate: { - base: createMetricPattern1(this, 'hash_rate'), + base: createSeriesPattern1(this, 'hash_rate'), sma: { - _1w: createMetricPattern1(this, 'hash_rate_sma_1w'), - _1m: createMetricPattern1(this, 'hash_rate_sma_1m'), - _2m: createMetricPattern1(this, 'hash_rate_sma_2m'), - _1y: createMetricPattern1(this, 'hash_rate_sma_1y'), + _1w: createSeriesPattern1(this, 'hash_rate_sma_1w'), + _1m: createSeriesPattern1(this, 'hash_rate_sma_1m'), + _2m: createSeriesPattern1(this, 'hash_rate_sma_2m'), + _1y: createSeriesPattern1(this, 'hash_rate_sma_1y'), }, - ath: createMetricPattern1(this, 'hash_rate_ath'), + ath: createSeriesPattern1(this, 'hash_rate_ath'), drawdown: createBpsPercentRatioPattern5(this, 'hash_rate_drawdown'), }, price: createPhsReboundThsPattern(this, 'hash_price'), @@ -7800,9 +7823,9 @@ class BrkClient extends BrkClientBase { activity: { coinblocksCreated: createBaseCumulativeSumPattern(this, 'coinblocks_created'), coinblocksStored: createBaseCumulativeSumPattern(this, 'coinblocks_stored'), - liveliness: createMetricPattern1(this, 'liveliness'), - vaultedness: createMetricPattern1(this, 'vaultedness'), - ratio: createMetricPattern1(this, 'activity_to_vaultedness_ratio'), + liveliness: createSeriesPattern1(this, 'liveliness'), + vaultedness: createSeriesPattern1(this, 'vaultedness'), + ratio: createSeriesPattern1(this, 'activity_to_vaultedness_ratio'), }, supply: { vaulted: createBtcCentsSatsUsdPattern(this, 'vaulted_supply'), @@ -7831,185 +7854,185 @@ class BrkClient extends BrkClientBase { balanced: createBpsCentsPercentilesRatioSatsUsdPattern(this, 'balanced_price'), terminal: createBpsCentsPercentilesRatioSatsUsdPattern(this, 'terminal_price'), delta: createBpsCentsPercentilesRatioSatsUsdPattern(this, 'delta_price'), - cumulativeMarketCap: createMetricPattern1(this, 'cumulative_market_cap'), + cumulativeMarketCap: createSeriesPattern1(this, 'cumulative_market_cap'), }, adjusted: { inflationRate: createBpsPercentRatioPattern(this, 'cointime_adj_inflation_rate'), - txVelocityNative: createMetricPattern1(this, 'cointime_adj_tx_velocity'), - txVelocityFiat: createMetricPattern1(this, 'cointime_adj_tx_velocity_fiat'), + txVelocityNative: createSeriesPattern1(this, 'cointime_adj_tx_velocity'), + txVelocityFiat: createSeriesPattern1(this, 'cointime_adj_tx_velocity_fiat'), }, reserveRisk: { - value: createMetricPattern1(this, 'reserve_risk'), - vocddMedian1y: createMetricPattern18(this, 'vocdd_median_1y'), - hodlBank: createMetricPattern18(this, 'hodl_bank'), + value: createSeriesPattern1(this, 'reserve_risk'), + vocddMedian1y: createSeriesPattern18(this, 'vocdd_median_1y'), + hodlBank: createSeriesPattern18(this, 'hodl_bank'), }, coinblocksDestroyed: createBaseCumulativeSumPattern(this, 'coinblocks_destroyed'), }, constants: { - _0: createMetricPattern1(this, 'constant_0'), - _1: createMetricPattern1(this, 'constant_1'), - _2: createMetricPattern1(this, 'constant_2'), - _3: createMetricPattern1(this, 'constant_3'), - _4: createMetricPattern1(this, 'constant_4'), - _20: createMetricPattern1(this, 'constant_20'), - _30: createMetricPattern1(this, 'constant_30'), - _382: createMetricPattern1(this, 'constant_38_2'), - _50: createMetricPattern1(this, 'constant_50'), - _618: createMetricPattern1(this, 'constant_61_8'), - _70: createMetricPattern1(this, 'constant_70'), - _80: createMetricPattern1(this, 'constant_80'), - _100: createMetricPattern1(this, 'constant_100'), - _600: createMetricPattern1(this, 'constant_600'), - minus1: createMetricPattern1(this, 'constant_minus_1'), - minus2: createMetricPattern1(this, 'constant_minus_2'), - minus3: createMetricPattern1(this, 'constant_minus_3'), - minus4: createMetricPattern1(this, 'constant_minus_4'), + _0: createSeriesPattern1(this, 'constant_0'), + _1: createSeriesPattern1(this, 'constant_1'), + _2: createSeriesPattern1(this, 'constant_2'), + _3: createSeriesPattern1(this, 'constant_3'), + _4: createSeriesPattern1(this, 'constant_4'), + _20: createSeriesPattern1(this, 'constant_20'), + _30: createSeriesPattern1(this, 'constant_30'), + _382: createSeriesPattern1(this, 'constant_38_2'), + _50: createSeriesPattern1(this, 'constant_50'), + _618: createSeriesPattern1(this, 'constant_61_8'), + _70: createSeriesPattern1(this, 'constant_70'), + _80: createSeriesPattern1(this, 'constant_80'), + _100: createSeriesPattern1(this, 'constant_100'), + _600: createSeriesPattern1(this, 'constant_600'), + minus1: createSeriesPattern1(this, 'constant_minus_1'), + minus2: createSeriesPattern1(this, 'constant_minus_2'), + minus3: createSeriesPattern1(this, 'constant_minus_3'), + minus4: createSeriesPattern1(this, 'constant_minus_4'), }, indexes: { address: { p2pk33: { - identity: createMetricPattern26(this, 'p2pk33_address_index'), - address: createMetricPattern26(this, 'p2pk33_address'), + identity: createSeriesPattern26(this, 'p2pk33_address_index'), + address: createSeriesPattern26(this, 'p2pk33_address'), }, p2pk65: { - identity: createMetricPattern27(this, 'p2pk65_address_index'), - address: createMetricPattern27(this, 'p2pk65_address'), + identity: createSeriesPattern27(this, 'p2pk65_address_index'), + address: createSeriesPattern27(this, 'p2pk65_address'), }, p2pkh: { - identity: createMetricPattern28(this, 'p2pkh_address_index'), - address: createMetricPattern28(this, 'p2pkh_address'), + identity: createSeriesPattern28(this, 'p2pkh_address_index'), + address: createSeriesPattern28(this, 'p2pkh_address'), }, p2sh: { - identity: createMetricPattern29(this, 'p2sh_address_index'), - address: createMetricPattern29(this, 'p2sh_address'), + identity: createSeriesPattern29(this, 'p2sh_address_index'), + address: createSeriesPattern29(this, 'p2sh_address'), }, p2tr: { - identity: createMetricPattern30(this, 'p2tr_address_index'), - address: createMetricPattern30(this, 'p2tr_address'), + identity: createSeriesPattern30(this, 'p2tr_address_index'), + address: createSeriesPattern30(this, 'p2tr_address'), }, p2wpkh: { - identity: createMetricPattern31(this, 'p2wpkh_address_index'), - address: createMetricPattern31(this, 'p2wpkh_address'), + identity: createSeriesPattern31(this, 'p2wpkh_address_index'), + address: createSeriesPattern31(this, 'p2wpkh_address'), }, p2wsh: { - identity: createMetricPattern32(this, 'p2wsh_address_index'), - address: createMetricPattern32(this, 'p2wsh_address'), + identity: createSeriesPattern32(this, 'p2wsh_address_index'), + address: createSeriesPattern32(this, 'p2wsh_address'), }, p2a: { - identity: createMetricPattern24(this, 'p2a_address_index'), - address: createMetricPattern24(this, 'p2a_address'), + identity: createSeriesPattern24(this, 'p2a_address_index'), + address: createSeriesPattern24(this, 'p2a_address'), }, p2ms: { - identity: createMetricPattern25(this, 'p2ms_output_index'), + identity: createSeriesPattern25(this, 'p2ms_output_index'), }, empty: { - identity: createMetricPattern22(this, 'empty_output_index'), + identity: createSeriesPattern22(this, 'empty_output_index'), }, unknown: { - identity: createMetricPattern33(this, 'unknown_output_index'), + identity: createSeriesPattern33(this, 'unknown_output_index'), }, opReturn: { - identity: createMetricPattern23(this, 'op_return_index'), + identity: createSeriesPattern23(this, 'op_return_index'), }, }, height: { - identity: createMetricPattern18(this, 'height'), - minute10: createMetricPattern18(this, 'minute10'), - minute30: createMetricPattern18(this, 'minute30'), - hour1: createMetricPattern18(this, 'hour1'), - hour4: createMetricPattern18(this, 'hour4'), - hour12: createMetricPattern18(this, 'hour12'), - day1: createMetricPattern18(this, 'day1'), - day3: createMetricPattern18(this, 'day3'), - epoch: createMetricPattern18(this, 'epoch'), - halving: createMetricPattern18(this, 'halving'), - week1: createMetricPattern18(this, 'week1'), - month1: createMetricPattern18(this, 'month1'), - month3: createMetricPattern18(this, 'month3'), - month6: createMetricPattern18(this, 'month6'), - year1: createMetricPattern18(this, 'year1'), - year10: createMetricPattern18(this, 'year10'), - txIndexCount: createMetricPattern18(this, 'tx_index_count'), + identity: createSeriesPattern18(this, 'height'), + minute10: createSeriesPattern18(this, 'minute10'), + minute30: createSeriesPattern18(this, 'minute30'), + hour1: createSeriesPattern18(this, 'hour1'), + hour4: createSeriesPattern18(this, 'hour4'), + hour12: createSeriesPattern18(this, 'hour12'), + day1: createSeriesPattern18(this, 'day1'), + day3: createSeriesPattern18(this, 'day3'), + epoch: createSeriesPattern18(this, 'epoch'), + halving: createSeriesPattern18(this, 'halving'), + week1: createSeriesPattern18(this, 'week1'), + month1: createSeriesPattern18(this, 'month1'), + month3: createSeriesPattern18(this, 'month3'), + month6: createSeriesPattern18(this, 'month6'), + year1: createSeriesPattern18(this, 'year1'), + year10: createSeriesPattern18(this, 'year10'), + txIndexCount: createSeriesPattern18(this, 'tx_index_count'), }, epoch: { - identity: createMetricPattern17(this, 'epoch'), - firstHeight: createMetricPattern17(this, 'first_height'), - heightCount: createMetricPattern17(this, 'height_count'), + identity: createSeriesPattern17(this, 'epoch'), + firstHeight: createSeriesPattern17(this, 'first_height'), + heightCount: createSeriesPattern17(this, 'height_count'), }, halving: { - identity: createMetricPattern16(this, 'halving'), - firstHeight: createMetricPattern16(this, 'first_height'), + identity: createSeriesPattern16(this, 'halving'), + firstHeight: createSeriesPattern16(this, 'first_height'), }, minute10: { - identity: createMetricPattern3(this, 'minute10_index'), - firstHeight: createMetricPattern3(this, 'first_height'), + identity: createSeriesPattern3(this, 'minute10_index'), + firstHeight: createSeriesPattern3(this, 'first_height'), }, minute30: { - identity: createMetricPattern4(this, 'minute30_index'), - firstHeight: createMetricPattern4(this, 'first_height'), + identity: createSeriesPattern4(this, 'minute30_index'), + firstHeight: createSeriesPattern4(this, 'first_height'), }, hour1: { - identity: createMetricPattern5(this, 'hour1_index'), - firstHeight: createMetricPattern5(this, 'first_height'), + identity: createSeriesPattern5(this, 'hour1_index'), + firstHeight: createSeriesPattern5(this, 'first_height'), }, hour4: { - identity: createMetricPattern6(this, 'hour4_index'), - firstHeight: createMetricPattern6(this, 'first_height'), + identity: createSeriesPattern6(this, 'hour4_index'), + firstHeight: createSeriesPattern6(this, 'first_height'), }, hour12: { - identity: createMetricPattern7(this, 'hour12_index'), - firstHeight: createMetricPattern7(this, 'first_height'), + identity: createSeriesPattern7(this, 'hour12_index'), + firstHeight: createSeriesPattern7(this, 'first_height'), }, day1: { - identity: createMetricPattern8(this, 'day1_index'), - date: createMetricPattern8(this, 'date'), - firstHeight: createMetricPattern8(this, 'first_height'), - heightCount: createMetricPattern8(this, 'height_count'), + identity: createSeriesPattern8(this, 'day1_index'), + date: createSeriesPattern8(this, 'date'), + firstHeight: createSeriesPattern8(this, 'first_height'), + heightCount: createSeriesPattern8(this, 'height_count'), }, day3: { - identity: createMetricPattern9(this, 'day3_index'), - firstHeight: createMetricPattern9(this, 'first_height'), + identity: createSeriesPattern9(this, 'day3_index'), + firstHeight: createSeriesPattern9(this, 'first_height'), }, week1: { - identity: createMetricPattern10(this, 'week1_index'), - date: createMetricPattern10(this, 'date'), - firstHeight: createMetricPattern10(this, 'first_height'), + identity: createSeriesPattern10(this, 'week1_index'), + date: createSeriesPattern10(this, 'date'), + firstHeight: createSeriesPattern10(this, 'first_height'), }, month1: { - identity: createMetricPattern11(this, 'month1_index'), - date: createMetricPattern11(this, 'date'), - firstHeight: createMetricPattern11(this, 'first_height'), + identity: createSeriesPattern11(this, 'month1_index'), + date: createSeriesPattern11(this, 'date'), + firstHeight: createSeriesPattern11(this, 'first_height'), }, month3: { - identity: createMetricPattern12(this, 'month3_index'), - date: createMetricPattern12(this, 'date'), - firstHeight: createMetricPattern12(this, 'first_height'), + identity: createSeriesPattern12(this, 'month3_index'), + date: createSeriesPattern12(this, 'date'), + firstHeight: createSeriesPattern12(this, 'first_height'), }, month6: { - identity: createMetricPattern13(this, 'month6_index'), - date: createMetricPattern13(this, 'date'), - firstHeight: createMetricPattern13(this, 'first_height'), + identity: createSeriesPattern13(this, 'month6_index'), + date: createSeriesPattern13(this, 'date'), + firstHeight: createSeriesPattern13(this, 'first_height'), }, year1: { - identity: createMetricPattern14(this, 'year1_index'), - date: createMetricPattern14(this, 'date'), - firstHeight: createMetricPattern14(this, 'first_height'), + identity: createSeriesPattern14(this, 'year1_index'), + date: createSeriesPattern14(this, 'date'), + firstHeight: createSeriesPattern14(this, 'first_height'), }, year10: { - identity: createMetricPattern15(this, 'year10_index'), - date: createMetricPattern15(this, 'date'), - firstHeight: createMetricPattern15(this, 'first_height'), + identity: createSeriesPattern15(this, 'year10_index'), + date: createSeriesPattern15(this, 'date'), + firstHeight: createSeriesPattern15(this, 'first_height'), }, txIndex: { - identity: createMetricPattern19(this, 'tx_index'), - inputCount: createMetricPattern19(this, 'input_count'), - outputCount: createMetricPattern19(this, 'output_count'), + identity: createSeriesPattern19(this, 'tx_index'), + inputCount: createSeriesPattern19(this, 'input_count'), + outputCount: createSeriesPattern19(this, 'output_count'), }, txinIndex: { - identity: createMetricPattern20(this, 'txin_index'), + identity: createSeriesPattern20(this, 'txin_index'), }, txoutIndex: { - identity: createMetricPattern21(this, 'txout_index'), + identity: createSeriesPattern21(this, 'txout_index'), }, }, indicators: { @@ -8018,23 +8041,23 @@ class BrkClient extends BrkClientBase { gini: createBpsPercentRatioPattern3(this, 'gini'), rhodlRatio: createBpsRatioPattern2(this, 'rhodl_ratio'), thermocapMultiple: createBpsRatioPattern2(this, 'thermocap_multiple'), - coindaysDestroyedSupplyAdjusted: createMetricPattern1(this, 'coindays_destroyed_supply_adjusted'), - coinyearsDestroyedSupplyAdjusted: createMetricPattern1(this, 'coinyears_destroyed_supply_adjusted'), + coindaysDestroyedSupplyAdjusted: createSeriesPattern1(this, 'coindays_destroyed_supply_adjusted'), + coinyearsDestroyedSupplyAdjusted: createSeriesPattern1(this, 'coinyears_destroyed_supply_adjusted'), dormancy: { - supplyAdjusted: createMetricPattern1(this, 'dormancy_supply_adjusted'), - flow: createMetricPattern1(this, 'dormancy_flow'), + supplyAdjusted: createSeriesPattern1(this, 'dormancy_supply_adjusted'), + flow: createSeriesPattern1(this, 'dormancy_flow'), }, - stockToFlow: createMetricPattern1(this, 'stock_to_flow'), - sellerExhaustionConstant: createMetricPattern1(this, 'seller_exhaustion_constant'), + stockToFlow: createSeriesPattern1(this, 'stock_to_flow'), + sellerExhaustionConstant: createSeriesPattern1(this, 'seller_exhaustion_constant'), }, market: { ath: { high: createCentsSatsUsdPattern(this, 'price_ath'), drawdown: createBpsPercentRatioPattern5(this, 'price_drawdown'), - daysSince: createMetricPattern1(this, 'days_since_price_ath'), - yearsSince: createMetricPattern1(this, 'years_since_price_ath'), - maxDaysBetween: createMetricPattern1(this, 'max_days_between_price_ath'), - maxYearsBetween: createMetricPattern1(this, 'max_years_between_price_ath'), + daysSince: createSeriesPattern1(this, 'days_since_price_ath'), + yearsSince: createSeriesPattern1(this, 'years_since_price_ath'), + maxDaysBetween: createSeriesPattern1(this, 'max_days_between_price_ath'), + maxYearsBetween: createSeriesPattern1(this, 'max_years_between_price_ath'), }, lookback: { _24h: createCentsSatsUsdPattern(this, 'price_lookback_24h'), @@ -8070,29 +8093,29 @@ class BrkClient extends BrkClientBase { cagr: create_10y2y3y4y5y6y8yPattern(this, 'price_cagr'), sd24h: { _1w: { - sma: createMetricPattern1(this, 'price_return_24h_sma_1w'), - sd: createMetricPattern1(this, 'price_return_24h_sd_1w'), + sma: createSeriesPattern1(this, 'price_return_24h_sma_1w'), + sd: createSeriesPattern1(this, 'price_return_24h_sd_1w'), }, _1m: { - sma: createMetricPattern1(this, 'price_return_24h_sma_1m'), - sd: createMetricPattern1(this, 'price_return_24h_sd_1m'), + sma: createSeriesPattern1(this, 'price_return_24h_sma_1m'), + sd: createSeriesPattern1(this, 'price_return_24h_sd_1m'), }, _1y: { - sma: createMetricPattern1(this, 'price_return_24h_sma_1y'), - sd: createMetricPattern1(this, 'price_return_24h_sd_1y'), + sma: createSeriesPattern1(this, 'price_return_24h_sma_1y'), + sd: createSeriesPattern1(this, 'price_return_24h_sd_1y'), }, }, }, volatility: { - _1w: createMetricPattern1(this, 'price_volatility_1w'), - _1m: createMetricPattern1(this, 'price_volatility_1m'), - _1y: createMetricPattern1(this, 'price_volatility_1y'), + _1w: createSeriesPattern1(this, 'price_volatility_1w'), + _1m: createSeriesPattern1(this, 'price_volatility_1m'), + _1y: createSeriesPattern1(this, 'price_volatility_1y'), }, range: { min: create_1m1w1y2wPattern(this, 'price_min'), max: create_1m1w1y2wPattern(this, 'price_max'), - trueRange: createMetricPattern1(this, 'price_true_range'), - trueRangeSum2w: createMetricPattern1(this, 'price_true_range_sum_2w'), + trueRange: createSeriesPattern1(this, 'price_true_range'), + trueRangeSum2w: createSeriesPattern1(this, 'price_true_range_sum_2w'), choppinessIndex2w: createBpsPercentRatioPattern3(this, 'price_choppiness_index_2w'), }, movingAverage: { @@ -8108,20 +8131,20 @@ class BrkClient extends BrkClientBase { _111d: createBpsCentsRatioSatsUsdPattern(this, 'price_sma_111d'), _144d: createBpsCentsRatioSatsUsdPattern(this, 'price_sma_144d'), _200d: { - usd: createMetricPattern1(this, 'price_sma_200d'), - cents: createMetricPattern1(this, 'price_sma_200d_cents'), - sats: createMetricPattern1(this, 'price_sma_200d_sats'), - bps: createMetricPattern1(this, 'price_sma_200d_ratio_bps'), - ratio: createMetricPattern1(this, 'price_sma_200d_ratio'), + usd: createSeriesPattern1(this, 'price_sma_200d'), + cents: createSeriesPattern1(this, 'price_sma_200d_cents'), + sats: createSeriesPattern1(this, 'price_sma_200d_sats'), + bps: createSeriesPattern1(this, 'price_sma_200d_ratio_bps'), + ratio: createSeriesPattern1(this, 'price_sma_200d_ratio'), x24: createCentsSatsUsdPattern(this, 'price_sma_200d_x2_4'), x08: createCentsSatsUsdPattern(this, 'price_sma_200d_x0_8'), }, _350d: { - usd: createMetricPattern1(this, 'price_sma_350d'), - cents: createMetricPattern1(this, 'price_sma_350d_cents'), - sats: createMetricPattern1(this, 'price_sma_350d_sats'), - bps: createMetricPattern1(this, 'price_sma_350d_ratio_bps'), - ratio: createMetricPattern1(this, 'price_sma_350d_ratio'), + usd: createSeriesPattern1(this, 'price_sma_350d'), + cents: createSeriesPattern1(this, 'price_sma_350d_cents'), + sats: createSeriesPattern1(this, 'price_sma_350d_sats'), + bps: createSeriesPattern1(this, 'price_sma_350d_ratio_bps'), + ratio: createSeriesPattern1(this, 'price_sma_350d_ratio'), x2: createCentsSatsUsdPattern(this, 'price_sma_350d_x2'), }, _1y: createBpsCentsRatioSatsUsdPattern(this, 'price_sma_1y'), @@ -8149,7 +8172,7 @@ class BrkClient extends BrkClientBase { }, }, dca: { - satsPerDay: createMetricPattern18(this, 'dca_sats_per_day'), + satsPerDay: createSeriesPattern18(this, 'dca_sats_per_day'), period: { stack: create_10y1m1w1y2y3m3y4y5y6m6y8yPattern3(this, 'dca_stack'), costBasis: { @@ -8228,38 +8251,38 @@ class BrkClient extends BrkClientBase { piCycle: createBpsRatioPattern2(this, 'pi_cycle'), macd: { _24h: { - emaFast: createMetricPattern1(this, 'macd_ema_fast_24h'), - emaSlow: createMetricPattern1(this, 'macd_ema_slow_24h'), - line: createMetricPattern1(this, 'macd_line_24h'), - signal: createMetricPattern1(this, 'macd_signal_24h'), - histogram: createMetricPattern1(this, 'macd_histogram_24h'), + emaFast: createSeriesPattern1(this, 'macd_ema_fast_24h'), + emaSlow: createSeriesPattern1(this, 'macd_ema_slow_24h'), + line: createSeriesPattern1(this, 'macd_line_24h'), + signal: createSeriesPattern1(this, 'macd_signal_24h'), + histogram: createSeriesPattern1(this, 'macd_histogram_24h'), }, _1w: { - emaFast: createMetricPattern1(this, 'macd_ema_fast_1w'), - emaSlow: createMetricPattern1(this, 'macd_ema_slow_1w'), - line: createMetricPattern1(this, 'macd_line_1w'), - signal: createMetricPattern1(this, 'macd_signal_1w'), - histogram: createMetricPattern1(this, 'macd_histogram_1w'), + emaFast: createSeriesPattern1(this, 'macd_ema_fast_1w'), + emaSlow: createSeriesPattern1(this, 'macd_ema_slow_1w'), + line: createSeriesPattern1(this, 'macd_line_1w'), + signal: createSeriesPattern1(this, 'macd_signal_1w'), + histogram: createSeriesPattern1(this, 'macd_histogram_1w'), }, _1m: { - emaFast: createMetricPattern1(this, 'macd_ema_fast_1m'), - emaSlow: createMetricPattern1(this, 'macd_ema_slow_1m'), - line: createMetricPattern1(this, 'macd_line_1m'), - signal: createMetricPattern1(this, 'macd_signal_1m'), - histogram: createMetricPattern1(this, 'macd_histogram_1m'), + emaFast: createSeriesPattern1(this, 'macd_ema_fast_1m'), + emaSlow: createSeriesPattern1(this, 'macd_ema_slow_1m'), + line: createSeriesPattern1(this, 'macd_line_1m'), + signal: createSeriesPattern1(this, 'macd_signal_1m'), + histogram: createSeriesPattern1(this, 'macd_histogram_1m'), }, _1y: { - emaFast: createMetricPattern1(this, 'macd_ema_fast_1y'), - emaSlow: createMetricPattern1(this, 'macd_ema_slow_1y'), - line: createMetricPattern1(this, 'macd_line_1y'), - signal: createMetricPattern1(this, 'macd_signal_1y'), - histogram: createMetricPattern1(this, 'macd_histogram_1y'), + emaFast: createSeriesPattern1(this, 'macd_ema_fast_1y'), + emaSlow: createSeriesPattern1(this, 'macd_ema_slow_1y'), + line: createSeriesPattern1(this, 'macd_line_1y'), + signal: createSeriesPattern1(this, 'macd_signal_1y'), + histogram: createSeriesPattern1(this, 'macd_histogram_1y'), }, }, }, }, pools: { - heightToPool: createMetricPattern18(this, 'pool'), + heightToPool: createSeriesPattern18(this, 'pool'), major: { unknown: createBlocksDominanceRewardsPattern(this, 'unknown'), luxor: createBlocksDominanceRewardsPattern(this, 'luxor'), @@ -8435,26 +8458,26 @@ class BrkClient extends BrkClientBase { close: createCentsSatsUsdPattern3(this, 'price_close'), }, ohlc: { - usd: createMetricPattern2(this, 'price_ohlc'), - cents: createMetricPattern2(this, 'price_ohlc_cents'), - sats: createMetricPattern2(this, 'price_ohlc_sats'), + usd: createSeriesPattern2(this, 'price_ohlc'), + cents: createSeriesPattern2(this, 'price_ohlc_cents'), + sats: createSeriesPattern2(this, 'price_ohlc_sats'), }, spot: { - usd: createMetricPattern1(this, 'price'), - cents: createMetricPattern1(this, 'price_cents'), - sats: createMetricPattern1(this, 'price_sats'), + usd: createSeriesPattern1(this, 'price'), + cents: createSeriesPattern1(this, 'price_cents'), + sats: createSeriesPattern1(this, 'price_sats'), }, }, supply: { - state: createMetricPattern18(this, 'supply_state'), + state: createSeriesPattern18(this, 'supply_state'), circulating: createBtcCentsSatsUsdPattern(this, 'circulating_supply'), burned: { unspendable: createBaseCumulativeSumPattern4(this, 'unspendable_supply'), }, inflationRate: createBpsPercentRatioPattern(this, 'inflation_rate'), velocity: { - native: createMetricPattern1(this, 'velocity'), - fiat: createMetricPattern1(this, 'velocity_fiat'), + native: createSeriesPattern1(this, 'velocity'), + fiat: createSeriesPattern1(this, 'velocity_fiat'), }, marketCap: createCentsDeltaUsdPattern(this, 'market_cap'), marketMinusRealizedCapGrowthRate: create_1m1w1y24hPattern(this, 'market_minus_realized_cap_growth_rate'), @@ -8474,8 +8497,8 @@ class BrkClient extends BrkClientBase { activity: { sent: createBaseCumulativeInSumPattern(this, 'sent'), coindaysDestroyed: createBaseCumulativeSumPattern(this, 'coindays_destroyed'), - coinyearsDestroyed: createMetricPattern1(this, 'coinyears_destroyed'), - dormancy: createMetricPattern1(this, 'dormancy'), + coinyearsDestroyed: createSeriesPattern1(this, 'coinyears_destroyed'), + dormancy: createSeriesPattern1(this, 'dormancy'), }, realized: { cap: createCentsDeltaRelUsdPattern(this, 'realized_cap'), @@ -8486,30 +8509,30 @@ class BrkClient extends BrkClientBase { relToRcap: createBpsPercentRatioPattern4(this, 'realized_profit_rel_to_rcap'), valueCreated: createBaseCumulativeSumPattern(this, 'profit_value_created'), valueDestroyed: createBaseCumulativeSumPattern(this, 'profit_value_destroyed'), - distributionFlow: createMetricPattern1(this, 'distribution_flow'), + distributionFlow: createSeriesPattern1(this, 'distribution_flow'), }, loss: { base: createCentsUsdPattern2(this, 'realized_loss'), cumulative: createCentsUsdPattern2(this, 'realized_loss_cumulative'), sum: create_1m1w1y24hPattern4(this, 'realized_loss_sum'), - negative: createMetricPattern1(this, 'neg_realized_loss'), + negative: createSeriesPattern1(this, 'neg_realized_loss'), relToRcap: createBpsPercentRatioPattern4(this, 'realized_loss_rel_to_rcap'), valueCreated: createBaseCumulativeSumPattern(this, 'loss_value_created'), valueDestroyed: createBaseCumulativeSumPattern(this, 'loss_value_destroyed'), - capitulationFlow: createMetricPattern1(this, 'capitulation_flow'), + capitulationFlow: createSeriesPattern1(this, 'capitulation_flow'), }, price: { - usd: createMetricPattern1(this, 'realized_price'), - cents: createMetricPattern1(this, 'realized_price_cents'), - sats: createMetricPattern1(this, 'realized_price_sats'), - bps: createMetricPattern1(this, 'realized_price_ratio_bps'), - ratio: createMetricPattern1(this, 'realized_price_ratio'), + usd: createSeriesPattern1(this, 'realized_price'), + cents: createSeriesPattern1(this, 'realized_price_cents'), + sats: createSeriesPattern1(this, 'realized_price_sats'), + bps: createSeriesPattern1(this, 'realized_price_ratio_bps'), + ratio: createSeriesPattern1(this, 'realized_price_ratio'), percentiles: createPct1Pct2Pct5Pct95Pct98Pct99Pattern(this, 'realized_price'), sma: create_1m1w1y2y4yAllPattern(this, 'realized_price_ratio_sma'), stdDev: { all: { - sd: createMetricPattern1(this, 'realized_price_ratio_sd'), - zscore: createMetricPattern1(this, 'realized_price_ratio_zscore'), + sd: createSeriesPattern1(this, 'realized_price_ratio_sd'), + zscore: createSeriesPattern1(this, 'realized_price_ratio_zscore'), _0sd: createCentsSatsUsdPattern(this, 'realized_price_0sd'), p05sd: createPriceRatioPattern(this, 'realized_price', 'p0_5sd'), p1sd: createPriceRatioPattern(this, 'realized_price', 'p1sd'), @@ -8525,8 +8548,8 @@ class BrkClient extends BrkClientBase { m3sd: createPriceRatioPattern(this, 'realized_price', 'm3sd'), }, _4y: { - sd: createMetricPattern1(this, 'realized_price_ratio_sd_4y'), - zscore: createMetricPattern1(this, 'realized_price_ratio_zscore_4y'), + sd: createSeriesPattern1(this, 'realized_price_ratio_sd_4y'), + zscore: createSeriesPattern1(this, 'realized_price_ratio_zscore_4y'), _0sd: createCentsSatsUsdPattern(this, 'realized_price_0sd_4y'), p05sd: createPriceRatioPattern(this, 'realized_price', 'p0_5sd_4y'), p1sd: createPriceRatioPattern(this, 'realized_price', 'p1sd_4y'), @@ -8542,8 +8565,8 @@ class BrkClient extends BrkClientBase { m3sd: createPriceRatioPattern(this, 'realized_price', 'm3sd_4y'), }, _2y: { - sd: createMetricPattern1(this, 'realized_price_ratio_sd_2y'), - zscore: createMetricPattern1(this, 'realized_price_ratio_zscore_2y'), + sd: createSeriesPattern1(this, 'realized_price_ratio_sd_2y'), + zscore: createSeriesPattern1(this, 'realized_price_ratio_zscore_2y'), _0sd: createCentsSatsUsdPattern(this, 'realized_price_0sd_2y'), p05sd: createPriceRatioPattern(this, 'realized_price', 'p0_5sd_2y'), p1sd: createPriceRatioPattern(this, 'realized_price', 'p1sd_2y'), @@ -8559,8 +8582,8 @@ class BrkClient extends BrkClientBase { m3sd: createPriceRatioPattern(this, 'realized_price', 'm3sd_2y'), }, _1y: { - sd: createMetricPattern1(this, 'realized_price_ratio_sd_1y'), - zscore: createMetricPattern1(this, 'realized_price_ratio_zscore_1y'), + sd: createSeriesPattern1(this, 'realized_price_ratio_sd_1y'), + zscore: createSeriesPattern1(this, 'realized_price_ratio_zscore_1y'), _0sd: createCentsSatsUsdPattern(this, 'realized_price_0sd_1y'), p05sd: createPriceRatioPattern(this, 'realized_price', 'p0_5sd_1y'), p1sd: createPriceRatioPattern(this, 'realized_price', 'p1sd_1y'), @@ -8577,7 +8600,7 @@ class BrkClient extends BrkClientBase { }, }, }, - mvrv: createMetricPattern1(this, 'mvrv'), + mvrv: createSeriesPattern1(this, 'mvrv'), sopr: { valueCreated: createBaseCumulativeSumPattern(this, 'value_created'), valueDestroyed: createBaseCumulativeSumPattern(this, 'value_destroyed'), @@ -8619,13 +8642,13 @@ class BrkClient extends BrkClientBase { base: createCentsUsdPattern2(this, 'unrealized_loss'), cumulative: createCentsUsdPattern2(this, 'unrealized_loss_cumulative'), sum: create_1m1w1y24hPattern4(this, 'unrealized_loss_sum'), - negative: createMetricPattern1(this, 'neg_unrealized_loss'), + negative: createSeriesPattern1(this, 'neg_unrealized_loss'), relToMcap: createBpsPercentRatioPattern3(this, 'unrealized_loss_rel_to_mcap'), relToOwnGross: createBpsPercentRatioPattern3(this, 'unrealized_loss_rel_to_own_gross_pnl'), }, netPnl: { - usd: createMetricPattern1(this, 'net_unrealized_pnl'), - cents: createMetricPattern1(this, 'net_unrealized_pnl_cents'), + usd: createSeriesPattern1(this, 'net_unrealized_pnl'), + cents: createSeriesPattern1(this, 'net_unrealized_pnl_cents'), relToOwnGross: createBpsPercentRatioPattern(this, 'net_unrealized_pnl_rel_to_own_gross_pnl'), }, grossPnl: createCentsUsdPattern2(this, 'unrealized_gross_pnl'), @@ -8643,8 +8666,8 @@ class BrkClient extends BrkClientBase { activity: { sent: createBaseCumulativeInSumPattern(this, 'sth_sent'), coindaysDestroyed: createBaseCumulativeSumPattern(this, 'sth_coindays_destroyed'), - coinyearsDestroyed: createMetricPattern1(this, 'sth_coinyears_destroyed'), - dormancy: createMetricPattern1(this, 'sth_dormancy'), + coinyearsDestroyed: createSeriesPattern1(this, 'sth_coinyears_destroyed'), + dormancy: createSeriesPattern1(this, 'sth_dormancy'), }, realized: { cap: createCentsDeltaRelUsdPattern(this, 'sth_realized_cap'), @@ -8655,30 +8678,30 @@ class BrkClient extends BrkClientBase { relToRcap: createBpsPercentRatioPattern4(this, 'sth_realized_profit_rel_to_rcap'), valueCreated: createBaseCumulativeSumPattern(this, 'sth_profit_value_created'), valueDestroyed: createBaseCumulativeSumPattern(this, 'sth_profit_value_destroyed'), - distributionFlow: createMetricPattern1(this, 'sth_distribution_flow'), + distributionFlow: createSeriesPattern1(this, 'sth_distribution_flow'), }, loss: { base: createCentsUsdPattern2(this, 'sth_realized_loss'), cumulative: createCentsUsdPattern2(this, 'sth_realized_loss_cumulative'), sum: create_1m1w1y24hPattern4(this, 'sth_realized_loss_sum'), - negative: createMetricPattern1(this, 'sth_neg_realized_loss'), + negative: createSeriesPattern1(this, 'sth_neg_realized_loss'), relToRcap: createBpsPercentRatioPattern4(this, 'sth_realized_loss_rel_to_rcap'), valueCreated: createBaseCumulativeSumPattern(this, 'sth_loss_value_created'), valueDestroyed: createBaseCumulativeSumPattern(this, 'sth_loss_value_destroyed'), - capitulationFlow: createMetricPattern1(this, 'sth_capitulation_flow'), + capitulationFlow: createSeriesPattern1(this, 'sth_capitulation_flow'), }, price: { - usd: createMetricPattern1(this, 'sth_realized_price'), - cents: createMetricPattern1(this, 'sth_realized_price_cents'), - sats: createMetricPattern1(this, 'sth_realized_price_sats'), - bps: createMetricPattern1(this, 'sth_realized_price_ratio_bps'), - ratio: createMetricPattern1(this, 'sth_realized_price_ratio'), + usd: createSeriesPattern1(this, 'sth_realized_price'), + cents: createSeriesPattern1(this, 'sth_realized_price_cents'), + sats: createSeriesPattern1(this, 'sth_realized_price_sats'), + bps: createSeriesPattern1(this, 'sth_realized_price_ratio_bps'), + ratio: createSeriesPattern1(this, 'sth_realized_price_ratio'), percentiles: createPct1Pct2Pct5Pct95Pct98Pct99Pattern(this, 'sth_realized_price'), sma: create_1m1w1y2y4yAllPattern(this, 'sth_realized_price_ratio_sma'), stdDev: { all: { - sd: createMetricPattern1(this, 'sth_realized_price_ratio_sd'), - zscore: createMetricPattern1(this, 'sth_realized_price_ratio_zscore'), + sd: createSeriesPattern1(this, 'sth_realized_price_ratio_sd'), + zscore: createSeriesPattern1(this, 'sth_realized_price_ratio_zscore'), _0sd: createCentsSatsUsdPattern(this, 'sth_realized_price_0sd'), p05sd: createPriceRatioPattern(this, 'sth_realized_price', 'p0_5sd'), p1sd: createPriceRatioPattern(this, 'sth_realized_price', 'p1sd'), @@ -8694,8 +8717,8 @@ class BrkClient extends BrkClientBase { m3sd: createPriceRatioPattern(this, 'sth_realized_price', 'm3sd'), }, _4y: { - sd: createMetricPattern1(this, 'sth_realized_price_ratio_sd_4y'), - zscore: createMetricPattern1(this, 'sth_realized_price_ratio_zscore_4y'), + sd: createSeriesPattern1(this, 'sth_realized_price_ratio_sd_4y'), + zscore: createSeriesPattern1(this, 'sth_realized_price_ratio_zscore_4y'), _0sd: createCentsSatsUsdPattern(this, 'sth_realized_price_0sd_4y'), p05sd: createPriceRatioPattern(this, 'sth_realized_price', 'p0_5sd_4y'), p1sd: createPriceRatioPattern(this, 'sth_realized_price', 'p1sd_4y'), @@ -8711,8 +8734,8 @@ class BrkClient extends BrkClientBase { m3sd: createPriceRatioPattern(this, 'sth_realized_price', 'm3sd_4y'), }, _2y: { - sd: createMetricPattern1(this, 'sth_realized_price_ratio_sd_2y'), - zscore: createMetricPattern1(this, 'sth_realized_price_ratio_zscore_2y'), + sd: createSeriesPattern1(this, 'sth_realized_price_ratio_sd_2y'), + zscore: createSeriesPattern1(this, 'sth_realized_price_ratio_zscore_2y'), _0sd: createCentsSatsUsdPattern(this, 'sth_realized_price_0sd_2y'), p05sd: createPriceRatioPattern(this, 'sth_realized_price', 'p0_5sd_2y'), p1sd: createPriceRatioPattern(this, 'sth_realized_price', 'p1sd_2y'), @@ -8728,8 +8751,8 @@ class BrkClient extends BrkClientBase { m3sd: createPriceRatioPattern(this, 'sth_realized_price', 'm3sd_2y'), }, _1y: { - sd: createMetricPattern1(this, 'sth_realized_price_ratio_sd_1y'), - zscore: createMetricPattern1(this, 'sth_realized_price_ratio_zscore_1y'), + sd: createSeriesPattern1(this, 'sth_realized_price_ratio_sd_1y'), + zscore: createSeriesPattern1(this, 'sth_realized_price_ratio_zscore_1y'), _0sd: createCentsSatsUsdPattern(this, 'sth_realized_price_0sd_1y'), p05sd: createPriceRatioPattern(this, 'sth_realized_price', 'p0_5sd_1y'), p1sd: createPriceRatioPattern(this, 'sth_realized_price', 'p1sd_1y'), @@ -8746,7 +8769,7 @@ class BrkClient extends BrkClientBase { }, }, }, - mvrv: createMetricPattern1(this, 'sth_mvrv'), + mvrv: createSeriesPattern1(this, 'sth_mvrv'), sopr: { valueCreated: createBaseCumulativeSumPattern(this, 'sth_value_created'), valueDestroyed: createBaseCumulativeSumPattern(this, 'sth_value_destroyed'), @@ -8795,8 +8818,8 @@ class BrkClient extends BrkClientBase { activity: { sent: createBaseCumulativeInSumPattern(this, 'lth_sent'), coindaysDestroyed: createBaseCumulativeSumPattern(this, 'lth_coindays_destroyed'), - coinyearsDestroyed: createMetricPattern1(this, 'lth_coinyears_destroyed'), - dormancy: createMetricPattern1(this, 'lth_dormancy'), + coinyearsDestroyed: createSeriesPattern1(this, 'lth_coinyears_destroyed'), + dormancy: createSeriesPattern1(this, 'lth_dormancy'), }, realized: { cap: createCentsDeltaRelUsdPattern(this, 'lth_realized_cap'), @@ -8807,30 +8830,30 @@ class BrkClient extends BrkClientBase { relToRcap: createBpsPercentRatioPattern4(this, 'lth_realized_profit_rel_to_rcap'), valueCreated: createBaseCumulativeSumPattern(this, 'lth_profit_value_created'), valueDestroyed: createBaseCumulativeSumPattern(this, 'lth_profit_value_destroyed'), - distributionFlow: createMetricPattern1(this, 'lth_distribution_flow'), + distributionFlow: createSeriesPattern1(this, 'lth_distribution_flow'), }, loss: { base: createCentsUsdPattern2(this, 'lth_realized_loss'), cumulative: createCentsUsdPattern2(this, 'lth_realized_loss_cumulative'), sum: create_1m1w1y24hPattern4(this, 'lth_realized_loss_sum'), - negative: createMetricPattern1(this, 'lth_neg_realized_loss'), + negative: createSeriesPattern1(this, 'lth_neg_realized_loss'), relToRcap: createBpsPercentRatioPattern4(this, 'lth_realized_loss_rel_to_rcap'), valueCreated: createBaseCumulativeSumPattern(this, 'lth_loss_value_created'), valueDestroyed: createBaseCumulativeSumPattern(this, 'lth_loss_value_destroyed'), - capitulationFlow: createMetricPattern1(this, 'lth_capitulation_flow'), + capitulationFlow: createSeriesPattern1(this, 'lth_capitulation_flow'), }, price: { - usd: createMetricPattern1(this, 'lth_realized_price'), - cents: createMetricPattern1(this, 'lth_realized_price_cents'), - sats: createMetricPattern1(this, 'lth_realized_price_sats'), - bps: createMetricPattern1(this, 'lth_realized_price_ratio_bps'), - ratio: createMetricPattern1(this, 'lth_realized_price_ratio'), + usd: createSeriesPattern1(this, 'lth_realized_price'), + cents: createSeriesPattern1(this, 'lth_realized_price_cents'), + sats: createSeriesPattern1(this, 'lth_realized_price_sats'), + bps: createSeriesPattern1(this, 'lth_realized_price_ratio_bps'), + ratio: createSeriesPattern1(this, 'lth_realized_price_ratio'), percentiles: createPct1Pct2Pct5Pct95Pct98Pct99Pattern(this, 'lth_realized_price'), sma: create_1m1w1y2y4yAllPattern(this, 'lth_realized_price_ratio_sma'), stdDev: { all: { - sd: createMetricPattern1(this, 'lth_realized_price_ratio_sd'), - zscore: createMetricPattern1(this, 'lth_realized_price_ratio_zscore'), + sd: createSeriesPattern1(this, 'lth_realized_price_ratio_sd'), + zscore: createSeriesPattern1(this, 'lth_realized_price_ratio_zscore'), _0sd: createCentsSatsUsdPattern(this, 'lth_realized_price_0sd'), p05sd: createPriceRatioPattern(this, 'lth_realized_price', 'p0_5sd'), p1sd: createPriceRatioPattern(this, 'lth_realized_price', 'p1sd'), @@ -8846,8 +8869,8 @@ class BrkClient extends BrkClientBase { m3sd: createPriceRatioPattern(this, 'lth_realized_price', 'm3sd'), }, _4y: { - sd: createMetricPattern1(this, 'lth_realized_price_ratio_sd_4y'), - zscore: createMetricPattern1(this, 'lth_realized_price_ratio_zscore_4y'), + sd: createSeriesPattern1(this, 'lth_realized_price_ratio_sd_4y'), + zscore: createSeriesPattern1(this, 'lth_realized_price_ratio_zscore_4y'), _0sd: createCentsSatsUsdPattern(this, 'lth_realized_price_0sd_4y'), p05sd: createPriceRatioPattern(this, 'lth_realized_price', 'p0_5sd_4y'), p1sd: createPriceRatioPattern(this, 'lth_realized_price', 'p1sd_4y'), @@ -8863,8 +8886,8 @@ class BrkClient extends BrkClientBase { m3sd: createPriceRatioPattern(this, 'lth_realized_price', 'm3sd_4y'), }, _2y: { - sd: createMetricPattern1(this, 'lth_realized_price_ratio_sd_2y'), - zscore: createMetricPattern1(this, 'lth_realized_price_ratio_zscore_2y'), + sd: createSeriesPattern1(this, 'lth_realized_price_ratio_sd_2y'), + zscore: createSeriesPattern1(this, 'lth_realized_price_ratio_zscore_2y'), _0sd: createCentsSatsUsdPattern(this, 'lth_realized_price_0sd_2y'), p05sd: createPriceRatioPattern(this, 'lth_realized_price', 'p0_5sd_2y'), p1sd: createPriceRatioPattern(this, 'lth_realized_price', 'p1sd_2y'), @@ -8880,8 +8903,8 @@ class BrkClient extends BrkClientBase { m3sd: createPriceRatioPattern(this, 'lth_realized_price', 'm3sd_2y'), }, _1y: { - sd: createMetricPattern1(this, 'lth_realized_price_ratio_sd_1y'), - zscore: createMetricPattern1(this, 'lth_realized_price_ratio_zscore_1y'), + sd: createSeriesPattern1(this, 'lth_realized_price_ratio_sd_1y'), + zscore: createSeriesPattern1(this, 'lth_realized_price_ratio_zscore_1y'), _0sd: createCentsSatsUsdPattern(this, 'lth_realized_price_0sd_1y'), p05sd: createPriceRatioPattern(this, 'lth_realized_price', 'p0_5sd_1y'), p1sd: createPriceRatioPattern(this, 'lth_realized_price', 'p1sd_1y'), @@ -8898,7 +8921,7 @@ class BrkClient extends BrkClientBase { }, }, }, - mvrv: createMetricPattern1(this, 'lth_mvrv'), + mvrv: createSeriesPattern1(this, 'lth_mvrv'), sopr: { valueCreated: createBaseCumulativeSumPattern(this, 'lth_value_created'), valueDestroyed: createBaseCumulativeSumPattern(this, 'lth_value_destroyed'), @@ -9115,7 +9138,7 @@ class BrkClient extends BrkClientBase { _90pctTo100pctInLoss: createNuplRealizedSupplyPattern(this, 'utxos_90pct_to_100pct_in_loss'), }, profit: { - breakeven: createNuplRealizedSupplyPattern(this, 'utxos_in_profit'), + all: createNuplRealizedSupplyPattern(this, 'utxos_in_profit'), _10pct: createNuplRealizedSupplyPattern(this, 'utxos_over_10pct_in_profit'), _20pct: createNuplRealizedSupplyPattern(this, 'utxos_over_20pct_in_profit'), _30pct: createNuplRealizedSupplyPattern(this, 'utxos_over_30pct_in_profit'), @@ -9131,7 +9154,7 @@ class BrkClient extends BrkClientBase { _500pct: createNuplRealizedSupplyPattern(this, 'utxos_over_500pct_in_profit'), }, loss: { - breakeven: createNuplRealizedSupplyPattern(this, 'utxos_in_loss'), + all: createNuplRealizedSupplyPattern(this, 'utxos_in_loss'), _10pct: createNuplRealizedSupplyPattern(this, 'utxos_over_10pct_in_loss'), _20pct: createNuplRealizedSupplyPattern(this, 'utxos_over_20pct_in_loss'), _30pct: createNuplRealizedSupplyPattern(this, 'utxos_over_30pct_in_loss'), @@ -9220,17 +9243,17 @@ class BrkClient extends BrkClientBase { } /** - * Create a dynamic metric endpoint builder for any metric/index combination. + * Create a dynamic series endpoint builder for any series/index combination. * - * Use this for programmatic access when the metric name is determined at runtime. - * For type-safe access, use the `metrics` tree instead. + * Use this for programmatic access when the series name is determined at runtime. + * For type-safe access, use the `series` tree instead. * - * @param {string} metric - The metric name + * @param {string} series - The series name * @param {Index} index - The index name - * @returns {MetricEndpointBuilder} + * @returns {SeriesEndpointBuilder} */ - metric(metric, index) { - return _endpoint(this, metric, index); + seriesEndpoint(series, index) { + return _endpoint(this, series, index); } /** @@ -9520,159 +9543,42 @@ class BrkClient extends BrkClientBase { } /** - * Get metric info + * Series catalog * - * Returns the supported indexes and value type for the specified metric. + * Returns the complete hierarchical catalog of available series organized as a tree structure. Series are grouped by categories and subcategories. * - * Endpoint: `GET /api/metric/{metric}` - * - * @param {Metric} metric - * @returns {Promise} - */ - async getMetricInfo(metric) { - return this.getJson(`/api/metric/${metric}`); - } - - /** - * Get metric data - * - * Fetch data for a specific metric at the given index. Use query parameters to filter by date range and format (json/csv). - * - * Endpoint: `GET /api/metric/{metric}/{index}` - * - * @param {Metric} metric - Metric name - * @param {Index} index - Aggregation index - * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` - * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` - * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` - * @param {Format=} [format] - Format of the output - * @returns {Promise} - */ - async getMetric(metric, index, start, end, limit, format) { - const params = new URLSearchParams(); - if (start !== undefined) params.set('start', String(start)); - if (end !== undefined) params.set('end', String(end)); - if (limit !== undefined) params.set('limit', String(limit)); - if (format !== undefined) params.set('format', String(format)); - const query = params.toString(); - const path = `/api/metric/${metric}/${index}${query ? '?' + query : ''}`; - if (format === 'csv') { - return this.getText(path); - } - return this.getJson(path); - } - - /** - * Get raw metric data - * - * Returns just the data array without the MetricData wrapper. Supports the same range and format parameters as the standard endpoint. - * - * Endpoint: `GET /api/metric/{metric}/{index}/data` - * - * @param {Metric} metric - Metric name - * @param {Index} index - Aggregation index - * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` - * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` - * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` - * @param {Format=} [format] - Format of the output - * @returns {Promise} - */ - async getMetricData(metric, index, start, end, limit, format) { - const params = new URLSearchParams(); - if (start !== undefined) params.set('start', String(start)); - if (end !== undefined) params.set('end', String(end)); - if (limit !== undefined) params.set('limit', String(limit)); - if (format !== undefined) params.set('format', String(format)); - const query = params.toString(); - const path = `/api/metric/${metric}/${index}/data${query ? '?' + query : ''}`; - if (format === 'csv') { - return this.getText(path); - } - return this.getJson(path); - } - - /** - * Get latest metric value - * - * Returns the single most recent value for a metric, unwrapped (not inside a MetricData object). - * - * Endpoint: `GET /api/metric/{metric}/{index}/latest` - * - * @param {Metric} metric - Metric name - * @param {Index} index - Aggregation index - * @returns {Promise<*>} - */ - async getMetricLatest(metric, index) { - return this.getJson(`/api/metric/${metric}/${index}/latest`); - } - - /** - * Get metric data length - * - * Returns the total number of data points for a metric at the given index. - * - * Endpoint: `GET /api/metric/{metric}/{index}/len` - * - * @param {Metric} metric - Metric name - * @param {Index} index - Aggregation index - * @returns {Promise} - */ - async getMetricLen(metric, index) { - return this.getJson(`/api/metric/${metric}/${index}/len`); - } - - /** - * Get metric version - * - * Returns the current version of a metric. Changes when the metric data is updated. - * - * Endpoint: `GET /api/metric/{metric}/{index}/version` - * - * @param {Metric} metric - Metric name - * @param {Index} index - Aggregation index - * @returns {Promise} - */ - async getMetricVersion(metric, index) { - return this.getJson(`/api/metric/${metric}/${index}/version`); - } - - /** - * Metrics catalog - * - * Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. - * - * Endpoint: `GET /api/metrics` + * Endpoint: `GET /api/series` * @returns {Promise} */ - async getMetricsTree() { - return this.getJson(`/api/metrics`); + async getSeriesTree() { + return this.getJson(`/api/series`); } /** - * Bulk metric data + * Bulk series data * - * Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. For a single metric, use `get_metric` instead. + * Fetch multiple series in a single request. Supports filtering by index and date range. Returns an array of SeriesData objects. For a single series, use `get_series` instead. * - * Endpoint: `GET /api/metrics/bulk` + * Endpoint: `GET /api/series/bulk` * - * @param {Metrics} [metrics] - Requested metrics + * @param {SeriesList} [series] - Requested series * @param {Index} [index] - Index to query * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` * @param {Format=} [format] - Format of the output - * @returns {Promise} + * @returns {Promise} */ - async getMetrics(metrics, index, start, end, limit, format) { + async getSeriesBulk(series, index, start, end, limit, format) { const params = new URLSearchParams(); - params.set('metrics', String(metrics)); + params.set('series', String(series)); params.set('index', String(index)); if (start !== undefined) params.set('start', String(start)); if (end !== undefined) params.set('end', String(end)); if (limit !== undefined) params.set('limit', String(limit)); if (format !== undefined) params.set('format', String(format)); const query = params.toString(); - const path = `/api/metrics/bulk${query ? '?' + query : ''}`; + const path = `/api/series/bulk${query ? '?' + query : ''}`; if (format === 'csv') { return this.getText(path); } @@ -9684,11 +9590,11 @@ class BrkClient extends BrkClientBase { * * List available cohorts for cost basis distribution. * - * Endpoint: `GET /api/metrics/cost-basis` + * Endpoint: `GET /api/series/cost-basis` * @returns {Promise} */ async getCostBasisCohorts() { - return this.getJson(`/api/metrics/cost-basis`); + return this.getJson(`/api/series/cost-basis`); } /** @@ -9696,13 +9602,13 @@ class BrkClient extends BrkClientBase { * * List available dates for a cohort's cost basis distribution. * - * Endpoint: `GET /api/metrics/cost-basis/{cohort}/dates` + * Endpoint: `GET /api/series/cost-basis/{cohort}/dates` * * @param {Cohort} cohort * @returns {Promise} */ async getCostBasisDates(cohort) { - return this.getJson(`/api/metrics/cost-basis/${cohort}/dates`); + return this.getJson(`/api/series/cost-basis/${cohort}/dates`); } /** @@ -9714,7 +9620,7 @@ class BrkClient extends BrkClientBase { * - `bucket`: raw (default), lin200, lin500, lin1000, log10, log50, log100 * - `value`: supply (default, in BTC), realized (USD), unrealized (USD) * - * Endpoint: `GET /api/metrics/cost-basis/{cohort}/{date}` + * Endpoint: `GET /api/series/cost-basis/{cohort}/{date}` * * @param {Cohort} cohort * @param {string} date @@ -9727,74 +9633,191 @@ class BrkClient extends BrkClientBase { if (bucket !== undefined) params.set('bucket', String(bucket)); if (value !== undefined) params.set('value', String(value)); const query = params.toString(); - const path = `/api/metrics/cost-basis/${cohort}/${date}${query ? '?' + query : ''}`; + const path = `/api/series/cost-basis/${cohort}/${date}${query ? '?' + query : ''}`; return this.getJson(path); } /** - * Metric count + * Series count * - * Returns the number of metrics available per index type. + * Returns the number of series available per index type. * - * Endpoint: `GET /api/metrics/count` - * @returns {Promise} + * Endpoint: `GET /api/series/count` + * @returns {Promise} */ - async getMetricsCount() { - return this.getJson(`/api/metrics/count`); + async getSeriesCount() { + return this.getJson(`/api/series/count`); } /** * List available indexes * - * Returns all available indexes with their accepted query aliases. Use any alias when querying metrics. + * Returns all available indexes with their accepted query aliases. Use any alias when querying series. * - * Endpoint: `GET /api/metrics/indexes` + * Endpoint: `GET /api/series/indexes` * @returns {Promise} */ async getIndexes() { - return this.getJson(`/api/metrics/indexes`); + return this.getJson(`/api/series/indexes`); } /** - * Metrics list + * Series list * - * Paginated flat list of all available metric names. Use `page` query param for pagination. + * Paginated flat list of all available series names. Use `page` query param for pagination. * - * Endpoint: `GET /api/metrics/list` + * Endpoint: `GET /api/series/list` * * @param {number=} [page] - Pagination index * @param {number=} [per_page] - Results per page (default: 1000, max: 1000) - * @returns {Promise} + * @returns {Promise} */ - async listMetrics(page, per_page) { + async listSeries(page, per_page) { const params = new URLSearchParams(); if (page !== undefined) params.set('page', String(page)); if (per_page !== undefined) params.set('per_page', String(per_page)); const query = params.toString(); - const path = `/api/metrics/list${query ? '?' + query : ''}`; + const path = `/api/series/list${query ? '?' + query : ''}`; return this.getJson(path); } /** - * Search metrics + * Search series * - * Fuzzy search for metrics by name. Supports partial matches and typos. + * Fuzzy search for series by name. Supports partial matches and typos. * - * Endpoint: `GET /api/metrics/search` + * Endpoint: `GET /api/series/search` * - * @param {Metric} [q] - Search query string + * @param {Series} [q] - Search query string * @param {Limit=} [limit] - Maximum number of results - * @returns {Promise} + * @returns {Promise} */ - async searchMetrics(q, limit) { + async searchSeries(q, limit) { const params = new URLSearchParams(); params.set('q', String(q)); if (limit !== undefined) params.set('limit', String(limit)); const query = params.toString(); - const path = `/api/metrics/search${query ? '?' + query : ''}`; + const path = `/api/series/search${query ? '?' + query : ''}`; return this.getJson(path); } + /** + * Get series info + * + * Returns the supported indexes and value type for the specified series. + * + * Endpoint: `GET /api/series/{series}` + * + * @param {Series} series + * @returns {Promise} + */ + async getSeriesInfo(series) { + return this.getJson(`/api/series/${series}`); + } + + /** + * Get series data + * + * Fetch data for a specific series at the given index. Use query parameters to filter by date range and format (json/csv). + * + * Endpoint: `GET /api/series/{series}/{index}` + * + * @param {Series} series - Series name + * @param {Index} index - Aggregation index + * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` + * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` + * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` + * @param {Format=} [format] - Format of the output + * @returns {Promise} + */ + async getSeries(series, index, start, end, limit, format) { + const params = new URLSearchParams(); + if (start !== undefined) params.set('start', String(start)); + if (end !== undefined) params.set('end', String(end)); + if (limit !== undefined) params.set('limit', String(limit)); + if (format !== undefined) params.set('format', String(format)); + const query = params.toString(); + const path = `/api/series/${series}/${index}${query ? '?' + query : ''}`; + if (format === 'csv') { + return this.getText(path); + } + return this.getJson(path); + } + + /** + * Get raw series data + * + * Returns just the data array without the SeriesData wrapper. Supports the same range and format parameters as the standard endpoint. + * + * Endpoint: `GET /api/series/{series}/{index}/data` + * + * @param {Series} series - Series name + * @param {Index} index - Aggregation index + * @param {RangeIndex=} [start] - Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` + * @param {RangeIndex=} [end] - Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` + * @param {Limit=} [limit] - Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` + * @param {Format=} [format] - Format of the output + * @returns {Promise} + */ + async getSeriesData(series, index, start, end, limit, format) { + const params = new URLSearchParams(); + if (start !== undefined) params.set('start', String(start)); + if (end !== undefined) params.set('end', String(end)); + if (limit !== undefined) params.set('limit', String(limit)); + if (format !== undefined) params.set('format', String(format)); + const query = params.toString(); + const path = `/api/series/${series}/${index}/data${query ? '?' + query : ''}`; + if (format === 'csv') { + return this.getText(path); + } + return this.getJson(path); + } + + /** + * Get latest series value + * + * Returns the single most recent value for a series, unwrapped (not inside a SeriesData object). + * + * Endpoint: `GET /api/series/{series}/{index}/latest` + * + * @param {Series} series - Series name + * @param {Index} index - Aggregation index + * @returns {Promise<*>} + */ + async getSeriesLatest(series, index) { + return this.getJson(`/api/series/${series}/${index}/latest`); + } + + /** + * Get series data length + * + * Returns the total number of data points for a series at the given index. + * + * Endpoint: `GET /api/series/{series}/{index}/len` + * + * @param {Series} series - Series name + * @param {Index} index - Aggregation index + * @returns {Promise} + */ + async getSeriesLen(series, index) { + return this.getJson(`/api/series/${series}/${index}/len`); + } + + /** + * Get series version + * + * Returns the current version of a series. Changes when the series data is updated. + * + * Endpoint: `GET /api/series/{series}/{index}/version` + * + * @param {Series} series - Series name + * @param {Index} index - Aggregation index + * @returns {Promise} + */ + async getSeriesVersion(series, index) { + return this.getJson(`/api/series/${series}/${index}/version`); + } + /** * Disk usage * diff --git a/packages/brk_client/brk_client/__init__.py b/packages/brk_client/brk_client/__init__.py index 382fb9c3d..095c5428d 100644 --- a/packages/brk_client/brk_client/__init__.py +++ b/packages/brk_client/brk_client/__init__.py @@ -104,20 +104,12 @@ High = Dollars Hour1 = int Hour12 = int Hour4 = int +# Series name +Series = str # Lowest price value for a time period Low = Dollars # Virtual size in vbytes (weight / 4, rounded up) VSize = int -# Metric name -Metric = str -# Version tracking for data schema and computed values. -# -# Used to detect when stored data needs to be recomputed due to changes -# in computation logic or source data versions. Supports validation -# against persisted versions to ensure compatibility. -Version = int -# Comma-separated list of metric names -Metrics = str Minute10 = int Minute30 = int Month1 = int @@ -166,6 +158,14 @@ SatsFract = float # Signed satoshis (i64) - for values that can be negative. # Used for changes, deltas, profit/loss calculations, etc. SatsSigned = int +# Version tracking for data schema and computed values. +# +# Used to detect when stored data needs to be recomputed due to changes +# in computation logic or source data versions. Supports validation +# against persisted versions to ensure compatibility. +Version = int +# Comma-separated list of series names +SeriesList = str StoredBool = bool # Stored 32-bit floating point value StoredF32 = float @@ -182,7 +182,7 @@ StoredU64 = int # Time period for mining statistics. # # Used to specify the lookback window for pool statistics, hashrate calculations, -# and other time-based mining metrics. +# and other time-based mining series. TimePeriod = Literal["24h", "3d", "1w", "1m", "3m", "6m", "1y", "2y", "3y"] # Index of the output being spent in the previous transaction Vout = int @@ -196,11 +196,11 @@ UnknownOutputIndex = TypeIndex Week1 = int Year1 = int Year10 = int -# Aggregation dimension for querying metrics. Includes time-based (date, week, month, year), +# Aggregation dimension for querying series. Includes time-based (date, week, month, year), # block-based (height, tx_index), and address/output type indexes. Index = Literal["minute10", "minute30", "hour1", "hour4", "hour12", "day1", "day3", "week1", "month1", "month3", "month6", "year1", "year10", "halving", "epoch", "height", "tx_index", "txin_index", "txout_index", "empty_output_index", "op_return_index", "p2a_address_index", "p2ms_output_index", "p2pk33_address_index", "p2pk65_address_index", "p2pkh_address_index", "p2sh_address_index", "p2tr_address_index", "p2wpkh_address_index", "p2wsh_address_index", "unknown_output_index", "funded_address_index", "empty_address_index"] -# Hierarchical tree node for organizing metrics into categories -TreeNode = Union[dict[str, "TreeNode"], "MetricLeafWithSchema"] +# Hierarchical tree node for organizing series into categories +TreeNode = Union[dict[str, "TreeNode"], "SeriesLeafWithSchema"] class AddressChainStats(TypedDict): """ Address statistics on the blockchain (confirmed transactions only) @@ -438,6 +438,38 @@ class DataRangeFormat(TypedDict): limit: Union[Limit, None] format: Format +class SeriesCount(TypedDict): + """ + Series count statistics - distinct series and total series-index combinations + + Attributes: + distinct_series: Number of unique series available (e.g., realized_price, market_cap) + total_endpoints: Total number of series-index combinations across all timeframes + lazy_endpoints: Number of lazy (computed on-the-fly) series-index combinations + stored_endpoints: Number of eager (stored on disk) series-index combinations + """ + distinct_series: int + total_endpoints: int + lazy_endpoints: int + stored_endpoints: int + +class DetailedSeriesCount(TypedDict): + """ + Detailed series count with per-database breakdown + + Attributes: + distinct_series: Number of unique series available (e.g., realized_price, market_cap) + total_endpoints: Total number of series-index combinations across all timeframes + lazy_endpoints: Number of lazy (computed on-the-fly) series-index combinations + stored_endpoints: Number of eager (stored on disk) series-index combinations + by_db: Per-database breakdown of counts + """ + distinct_series: int + total_endpoints: int + lazy_endpoints: int + stored_endpoints: int + by_db: dict[str, SeriesCount] + class DifficultyAdjustment(TypedDict): """ Difficulty adjustment information. @@ -522,7 +554,7 @@ class ErrorDetail(TypedDict): """ Attributes: type: Error category: "invalid_request", "forbidden", "not_found", "unavailable", or "internal" - code: Machine-readable error code (e.g. "invalid_address", "metric_not_found") + code: Machine-readable error code (e.g. "invalid_address", "series_not_found") message: Human-readable description doc_url: Link to API documentation """ @@ -589,7 +621,7 @@ class Health(TypedDict): started_at: Server start time (ISO 8601) uptime_seconds: Uptime in seconds indexed_height: Height of the last indexed block - computed_height: Height of the last computed block (metrics) + computed_height: Height of the last computed block (series) tip_height: Height of the chain tip (from Bitcoin node) blocks_behind: Number of blocks behind the tip last_indexed_at: Human-readable timestamp of the last indexed block (ISO 8601) @@ -622,6 +654,19 @@ class IndexInfo(TypedDict): index: Index aliases: List[str] +class LegacySeriesParam(TypedDict): + """ + Legacy path parameter for `/api/metric/{metric}` + """ + metric: Series + +class LegacySeriesWithIndex(TypedDict): + """ + Legacy path parameters for `/api/metric/{metric}/{index}` + """ + metric: Series + index: Index + class MempoolBlock(TypedDict): """ Block info in a mempool.space like format for fee estimation. @@ -654,80 +699,6 @@ class MempoolInfo(TypedDict): vsize: VSize total_fee: Sats -class MetricCount(TypedDict): - """ - Metric count statistics - distinct metrics and total metric-index combinations - - Attributes: - distinct_metrics: Number of unique metrics available (e.g., realized_price, market_cap) - total_endpoints: Total number of metric-index combinations across all timeframes - lazy_endpoints: Number of lazy (computed on-the-fly) metric-index combinations - stored_endpoints: Number of eager (stored on disk) metric-index combinations - """ - distinct_metrics: int - total_endpoints: int - lazy_endpoints: int - stored_endpoints: int - -class MetricInfo(TypedDict): - """ - Metadata about a metric - - Attributes: - indexes: Available indexes - type: Value type (e.g. "f32", "u64", "Sats") - """ - indexes: List[Index] - type: str - -class MetricParam(TypedDict): - metric: Metric - -class MetricSelection(TypedDict): - """ - Selection of metrics to query - - Attributes: - metrics: Requested metrics - index: Index to query - start: Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` - end: Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` - limit: Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` - format: Format of the output - """ - metrics: Metrics - index: Index - start: Union[RangeIndex, None] - end: Union[RangeIndex, None] - limit: Union[Limit, None] - format: Format - -class MetricSelectionLegacy(TypedDict): - """ - Legacy metric selection parameters (deprecated) - - Attributes: - start: Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` - end: Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` - limit: Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` - format: Format of the output - """ - index: Index - ids: Metrics - start: Union[RangeIndex, None] - end: Union[RangeIndex, None] - limit: Union[Limit, None] - format: Format - -class MetricWithIndex(TypedDict): - """ - Attributes: - metric: Metric name - index: Aggregation index - """ - metric: Metric - index: Index - class OHLCCents(TypedDict): """ OHLC (Open, High, Low, Close) data in cents @@ -755,24 +726,24 @@ class OHLCSats(TypedDict): low: Low close: Close -class PaginatedMetrics(TypedDict): +class PaginatedSeries(TypedDict): """ - A paginated list of available metric names (1000 per page) + A paginated list of available series names (1000 per page) Attributes: current_page: Current page number (0-indexed) max_page: Maximum valid page index (0-indexed) - total_count: Total number of metrics + total_count: Total number of series per_page: Results per page has_more: Whether more pages are available after the current one - metrics: List of metric names + series: List of series names """ current_page: int max_page: int total_count: int per_page: int has_more: bool - metrics: List[str] + series: List[str] class Pagination(TypedDict): """ @@ -936,9 +907,68 @@ class SearchQuery(TypedDict): q: Search query string limit: Maximum number of results """ - q: Metric + q: Series limit: Limit +class SeriesInfo(TypedDict): + """ + Metadata about a series + + Attributes: + indexes: Available indexes + type: Value type (e.g. "f32", "u64", "Sats") + """ + indexes: List[Index] + type: str + +class SeriesParam(TypedDict): + series: Series + +class SeriesSelection(TypedDict): + """ + Selection of series to query + + Attributes: + series: Requested series + index: Index to query + start: Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` + end: Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` + limit: Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` + format: Format of the output + """ + series: SeriesList + index: Index + start: Union[RangeIndex, None] + end: Union[RangeIndex, None] + limit: Union[Limit, None] + format: Format + +class SeriesSelectionLegacy(TypedDict): + """ + Legacy series selection parameters (deprecated) + + Attributes: + start: Inclusive start: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `from`, `f`, `s` + end: Exclusive end: integer index, date (YYYY-MM-DD), or timestamp (ISO 8601). Negative integers count from end. Aliases: `to`, `t`, `e` + limit: Maximum number of values to return (ignored if `end` is set). Aliases: `count`, `c`, `l` + format: Format of the output + """ + index: Index + ids: SeriesList + start: Union[RangeIndex, None] + end: Union[RangeIndex, None] + limit: Union[Limit, None] + format: Format + +class SeriesWithIndex(TypedDict): + """ + Attributes: + series: Series name + index: Aggregation index + """ + series: Series + index: Index + class SupplyState(TypedDict): """ Current supply state tracking UTXO count and total value @@ -956,7 +986,7 @@ class SyncStatus(TypedDict): Attributes: indexed_height: Height of the last indexed block - computed_height: Height of the last computed block (metrics) + computed_height: Height of the last computed block (series) tip_height: Height of the chain tip (from Bitcoin node) blocks_behind: Number of blocks behind the tip last_indexed_at: Human-readable timestamp of the last indexed block (ISO 8601) @@ -1092,14 +1122,14 @@ class ValidateAddressParam(TypedDict): """ address: str -class MetricLeafWithSchema(TypedDict): +class SeriesLeafWithSchema(TypedDict): """ - MetricLeaf with JSON Schema for client generation + SeriesLeaf with JSON Schema for client generation Attributes: - name: The metric name/identifier + name: The series name/identifier kind: The Rust type (e.g., "Sats", "StoredF64") - indexes: Available indexes for this metric + indexes: Available indexes for this series type: JSON Schema type (e.g., "integer", "number", "string", "boolean", "array", "object") """ name: str @@ -1171,13 +1201,13 @@ class BrkClientBase: def _m(acc: str, s: str) -> str: - """Build metric name with suffix.""" + """Build series name with suffix.""" if not s: return acc return f"{acc}_{s}" if acc else s def _p(prefix: str, acc: str) -> str: - """Build metric name with prefix.""" + """Build series name with prefix.""" return f"{prefix}_{acc}" if acc else prefix @@ -1266,8 +1296,8 @@ def _date_to_index(index: str, d: Union[date, datetime]) -> int: @dataclass -class MetricData(Generic[T]): - """Metric data with range information. Always int-indexed.""" +class SeriesData(Generic[T]): + """Series data with range information. Always int-indexed.""" version: int index: Index type: str @@ -1279,7 +1309,7 @@ class MetricData(Generic[T]): @property def is_date_based(self) -> bool: - """Whether this metric uses a date-based index.""" + """Whether this series uses a date-based index.""" return self.index in _DATE_INDEXES def indexes(self) -> List[int]: @@ -1323,8 +1353,8 @@ class MetricData(Generic[T]): @dataclass -class DateMetricData(MetricData[T]): - """Metric data with date-based index. Extends MetricData with date methods.""" +class DateSeriesData(SeriesData[T]): + """Series data with date-based index. Extends SeriesData with date methods.""" def dates(self) -> List[Union[date, datetime]]: """Get dates for the index range. Returns datetime for sub-daily indexes, date for daily+.""" @@ -1370,8 +1400,8 @@ class DateMetricData(MetricData[T]): # Type aliases for non-generic usage -AnyMetricData = MetricData[Any] -AnyDateMetricData = DateMetricData[Any] +AnySeriesData = SeriesData[Any] +AnyDateSeriesData = DateSeriesData[Any] class _EndpointConfig: @@ -1391,7 +1421,7 @@ class _EndpointConfig: self.end = end def path(self) -> str: - return f"/api/metric/{self.name}/{self.index}" + return f"/api/series/{self.name}/{self.index}" def _build_path(self, format: Optional[str] = None) -> str: params = [] @@ -1408,11 +1438,11 @@ class _EndpointConfig: def _new(self, start: Optional[int] = None, end: Optional[int] = None) -> _EndpointConfig: return _EndpointConfig(self.client, self.name, self.index, start, end) - def get_metric(self) -> MetricData[Any]: - return MetricData(**self.client.get_json(self._build_path())) + def get_series(self) -> SeriesData[Any]: + return SeriesData(**self.client.get_json(self._build_path())) - def get_date_metric(self) -> DateMetricData[Any]: - return DateMetricData(**self.client.get_json(self._build_path())) + def get_date_series(self) -> DateSeriesData[Any]: + return DateSeriesData(**self.client.get_json(self._build_path())) def get_csv(self) -> str: return self.client.get_text(self._build_path(format='csv')) @@ -1424,9 +1454,9 @@ class RangeBuilder(Generic[T]): def __init__(self, config: _EndpointConfig): self._config = config - def fetch(self) -> MetricData[T]: + def fetch(self) -> SeriesData[T]: """Fetch the range as parsed JSON.""" - return self._config.get_metric() + return self._config.get_series() def fetch_csv(self) -> str: """Fetch the range as CSV string.""" @@ -1439,9 +1469,9 @@ class SingleItemBuilder(Generic[T]): def __init__(self, config: _EndpointConfig): self._config = config - def fetch(self) -> MetricData[T]: + def fetch(self) -> SeriesData[T]: """Fetch the single item.""" - return self._config.get_metric() + return self._config.get_series() def fetch_csv(self) -> str: """Fetch as CSV.""" @@ -1459,9 +1489,9 @@ class SkippedBuilder(Generic[T]): start = self._config.start or 0 return RangeBuilder(self._config._new(start, start + n)) - def fetch(self) -> MetricData[T]: + def fetch(self) -> SeriesData[T]: """Fetch from skipped position to end.""" - return self._config.get_metric() + return self._config.get_series() def fetch_csv(self) -> str: """Fetch as CSV.""" @@ -1469,28 +1499,28 @@ class SkippedBuilder(Generic[T]): class DateRangeBuilder(RangeBuilder[T]): - """Range builder that returns DateMetricData.""" - def fetch(self) -> DateMetricData[T]: - return self._config.get_date_metric() + """Range builder that returns DateSeriesData.""" + def fetch(self) -> DateSeriesData[T]: + return self._config.get_date_series() class DateSingleItemBuilder(SingleItemBuilder[T]): - """Single item builder that returns DateMetricData.""" - def fetch(self) -> DateMetricData[T]: - return self._config.get_date_metric() + """Single item builder that returns DateSeriesData.""" + def fetch(self) -> DateSeriesData[T]: + return self._config.get_date_series() class DateSkippedBuilder(SkippedBuilder[T]): - """Skipped builder that returns DateMetricData.""" + """Skipped builder that returns DateSeriesData.""" def take(self, n: int) -> DateRangeBuilder[T]: start = self._config.start or 0 return DateRangeBuilder(self._config._new(start, start + n)) - def fetch(self) -> DateMetricData[T]: - return self._config.get_date_metric() + def fetch(self) -> DateSeriesData[T]: + return self._config.get_date_series() -class MetricEndpointBuilder(Generic[T]): - """Builder for metric endpoint queries with int-based indexing. +class SeriesEndpointBuilder(Generic[T]): + """Builder for series endpoint queries with int-based indexing. Examples: data = endpoint.fetch() @@ -1526,9 +1556,9 @@ class MetricEndpointBuilder(Generic[T]): """Skip the first n items.""" return SkippedBuilder(self._config._new(start=n)) - def fetch(self) -> MetricData[T]: + def fetch(self) -> SeriesData[T]: """Fetch all data.""" - return self._config.get_metric() + return self._config.get_series() def fetch_csv(self) -> str: """Fetch all data as CSV.""" @@ -1539,10 +1569,10 @@ class MetricEndpointBuilder(Generic[T]): return self._config.path() -class DateMetricEndpointBuilder(Generic[T]): - """Builder for metric endpoint queries with date-based indexing. +class DateSeriesEndpointBuilder(Generic[T]): + """Builder for series endpoint queries with date-based indexing. - Accepts dates in __getitem__ and returns DateMetricData from fetch(). + Accepts dates in __getitem__ and returns DateSeriesData from fetch(). Examples: data = endpoint.fetch() @@ -1589,9 +1619,9 @@ class DateMetricEndpointBuilder(Generic[T]): """Skip the first n items.""" return DateSkippedBuilder(self._config._new(start=n)) - def fetch(self) -> DateMetricData[T]: + def fetch(self) -> DateSeriesData[T]: """Fetch all data.""" - return self._config.get_date_metric() + return self._config.get_date_series() def fetch_csv(self) -> str: """Fetch all data as CSV.""" @@ -1603,23 +1633,23 @@ class DateMetricEndpointBuilder(Generic[T]): # Type aliases for non-generic usage -AnyMetricEndpointBuilder = MetricEndpointBuilder[Any] -AnyDateMetricEndpointBuilder = DateMetricEndpointBuilder[Any] +AnySeriesEndpointBuilder = SeriesEndpointBuilder[Any] +AnyDateSeriesEndpointBuilder = DateSeriesEndpointBuilder[Any] -class MetricPattern(Protocol[T]): - """Protocol for metric patterns with different index sets.""" +class SeriesPattern(Protocol[T]): + """Protocol for series patterns with different index sets.""" @property def name(self) -> str: - """Get the metric name.""" + """Get the series name.""" ... def indexes(self) -> List[str]: - """Get the list of available indexes for this metric.""" + """Get the list of available indexes for this series.""" ... - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: """Get an endpoint builder for a specific index, if supported.""" ... @@ -1661,462 +1691,462 @@ _i33 = ('unknown_output_index',) _i34 = ('funded_address_index',) _i35 = ('empty_address_index',) -def _ep(c: BrkClientBase, n: str, i: Index) -> MetricEndpointBuilder[Any]: - return MetricEndpointBuilder(c, n, i) +def _ep(c: BrkClientBase, n: str, i: Index) -> SeriesEndpointBuilder[Any]: + return SeriesEndpointBuilder(c, n, i) -def _dep(c: BrkClientBase, n: str, i: Index) -> DateMetricEndpointBuilder[Any]: - return DateMetricEndpointBuilder(c, n, i) +def _dep(c: BrkClientBase, n: str, i: Index) -> DateSeriesEndpointBuilder[Any]: + return DateSeriesEndpointBuilder(c, n, i) # Index accessor classes -class _MetricPattern1By(Generic[T]): +class _SeriesPattern1By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def minute10(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'minute10') - def minute30(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'minute30') - def hour1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'hour1') - def hour4(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'hour4') - def hour12(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'hour12') - def day1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'day1') - def day3(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'day3') - def week1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'week1') - def month1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'month1') - def month3(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'month3') - def month6(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'month6') - def year1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'year1') - def year10(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'year10') - def halving(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'halving') - def epoch(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'epoch') - def height(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'height') + def minute10(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'minute10') + def minute30(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'minute30') + def hour1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'hour1') + def hour4(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'hour4') + def hour12(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'hour12') + def day1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'day1') + def day3(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'day3') + def week1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'week1') + def month1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'month1') + def month3(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'month3') + def month6(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'month6') + def year1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'year1') + def year10(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'year10') + def halving(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'halving') + def epoch(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'epoch') + def height(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'height') -class MetricPattern1(Generic[T]): - by: _MetricPattern1By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern1By(c, n) +class SeriesPattern1(Generic[T]): + by: _SeriesPattern1By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern1By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i1) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i1 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i1 else None -class _MetricPattern2By(Generic[T]): +class _SeriesPattern2By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def minute10(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'minute10') - def minute30(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'minute30') - def hour1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'hour1') - def hour4(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'hour4') - def hour12(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'hour12') - def day1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'day1') - def day3(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'day3') - def week1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'week1') - def month1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'month1') - def month3(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'month3') - def month6(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'month6') - def year1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'year1') - def year10(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'year10') - def halving(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'halving') - def epoch(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'epoch') + def minute10(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'minute10') + def minute30(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'minute30') + def hour1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'hour1') + def hour4(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'hour4') + def hour12(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'hour12') + def day1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'day1') + def day3(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'day3') + def week1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'week1') + def month1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'month1') + def month3(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'month3') + def month6(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'month6') + def year1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'year1') + def year10(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'year10') + def halving(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'halving') + def epoch(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'epoch') -class MetricPattern2(Generic[T]): - by: _MetricPattern2By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern2By(c, n) +class SeriesPattern2(Generic[T]): + by: _SeriesPattern2By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern2By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i2) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i2 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i2 else None -class _MetricPattern3By(Generic[T]): +class _SeriesPattern3By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def minute10(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'minute10') + def minute10(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'minute10') -class MetricPattern3(Generic[T]): - by: _MetricPattern3By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern3By(c, n) +class SeriesPattern3(Generic[T]): + by: _SeriesPattern3By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern3By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i3) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i3 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i3 else None -class _MetricPattern4By(Generic[T]): +class _SeriesPattern4By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def minute30(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'minute30') + def minute30(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'minute30') -class MetricPattern4(Generic[T]): - by: _MetricPattern4By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern4By(c, n) +class SeriesPattern4(Generic[T]): + by: _SeriesPattern4By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern4By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i4) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i4 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i4 else None -class _MetricPattern5By(Generic[T]): +class _SeriesPattern5By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def hour1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'hour1') + def hour1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'hour1') -class MetricPattern5(Generic[T]): - by: _MetricPattern5By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern5By(c, n) +class SeriesPattern5(Generic[T]): + by: _SeriesPattern5By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern5By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i5) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i5 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i5 else None -class _MetricPattern6By(Generic[T]): +class _SeriesPattern6By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def hour4(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'hour4') + def hour4(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'hour4') -class MetricPattern6(Generic[T]): - by: _MetricPattern6By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern6By(c, n) +class SeriesPattern6(Generic[T]): + by: _SeriesPattern6By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern6By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i6) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i6 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i6 else None -class _MetricPattern7By(Generic[T]): +class _SeriesPattern7By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def hour12(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'hour12') + def hour12(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'hour12') -class MetricPattern7(Generic[T]): - by: _MetricPattern7By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern7By(c, n) +class SeriesPattern7(Generic[T]): + by: _SeriesPattern7By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern7By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i7) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i7 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i7 else None -class _MetricPattern8By(Generic[T]): +class _SeriesPattern8By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def day1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'day1') + def day1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'day1') -class MetricPattern8(Generic[T]): - by: _MetricPattern8By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern8By(c, n) +class SeriesPattern8(Generic[T]): + by: _SeriesPattern8By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern8By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i8) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i8 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i8 else None -class _MetricPattern9By(Generic[T]): +class _SeriesPattern9By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def day3(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'day3') + def day3(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'day3') -class MetricPattern9(Generic[T]): - by: _MetricPattern9By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern9By(c, n) +class SeriesPattern9(Generic[T]): + by: _SeriesPattern9By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern9By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i9) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i9 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i9 else None -class _MetricPattern10By(Generic[T]): +class _SeriesPattern10By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def week1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'week1') + def week1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'week1') -class MetricPattern10(Generic[T]): - by: _MetricPattern10By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern10By(c, n) +class SeriesPattern10(Generic[T]): + by: _SeriesPattern10By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern10By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i10) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i10 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i10 else None -class _MetricPattern11By(Generic[T]): +class _SeriesPattern11By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def month1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'month1') + def month1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'month1') -class MetricPattern11(Generic[T]): - by: _MetricPattern11By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern11By(c, n) +class SeriesPattern11(Generic[T]): + by: _SeriesPattern11By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern11By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i11) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i11 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i11 else None -class _MetricPattern12By(Generic[T]): +class _SeriesPattern12By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def month3(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'month3') + def month3(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'month3') -class MetricPattern12(Generic[T]): - by: _MetricPattern12By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern12By(c, n) +class SeriesPattern12(Generic[T]): + by: _SeriesPattern12By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern12By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i12) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i12 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i12 else None -class _MetricPattern13By(Generic[T]): +class _SeriesPattern13By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def month6(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'month6') + def month6(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'month6') -class MetricPattern13(Generic[T]): - by: _MetricPattern13By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern13By(c, n) +class SeriesPattern13(Generic[T]): + by: _SeriesPattern13By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern13By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i13) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i13 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i13 else None -class _MetricPattern14By(Generic[T]): +class _SeriesPattern14By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def year1(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'year1') + def year1(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'year1') -class MetricPattern14(Generic[T]): - by: _MetricPattern14By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern14By(c, n) +class SeriesPattern14(Generic[T]): + by: _SeriesPattern14By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern14By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i14) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i14 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i14 else None -class _MetricPattern15By(Generic[T]): +class _SeriesPattern15By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def year10(self) -> DateMetricEndpointBuilder[T]: return _dep(self._c, self._n, 'year10') + def year10(self) -> DateSeriesEndpointBuilder[T]: return _dep(self._c, self._n, 'year10') -class MetricPattern15(Generic[T]): - by: _MetricPattern15By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern15By(c, n) +class SeriesPattern15(Generic[T]): + by: _SeriesPattern15By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern15By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i15) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i15 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i15 else None -class _MetricPattern16By(Generic[T]): +class _SeriesPattern16By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def halving(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'halving') + def halving(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'halving') -class MetricPattern16(Generic[T]): - by: _MetricPattern16By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern16By(c, n) +class SeriesPattern16(Generic[T]): + by: _SeriesPattern16By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern16By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i16) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i16 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i16 else None -class _MetricPattern17By(Generic[T]): +class _SeriesPattern17By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def epoch(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'epoch') + def epoch(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'epoch') -class MetricPattern17(Generic[T]): - by: _MetricPattern17By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern17By(c, n) +class SeriesPattern17(Generic[T]): + by: _SeriesPattern17By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern17By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i17) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i17 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i17 else None -class _MetricPattern18By(Generic[T]): +class _SeriesPattern18By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def height(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'height') + def height(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'height') -class MetricPattern18(Generic[T]): - by: _MetricPattern18By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern18By(c, n) +class SeriesPattern18(Generic[T]): + by: _SeriesPattern18By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern18By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i18) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i18 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i18 else None -class _MetricPattern19By(Generic[T]): +class _SeriesPattern19By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def tx_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'tx_index') + def tx_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'tx_index') -class MetricPattern19(Generic[T]): - by: _MetricPattern19By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern19By(c, n) +class SeriesPattern19(Generic[T]): + by: _SeriesPattern19By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern19By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i19) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i19 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i19 else None -class _MetricPattern20By(Generic[T]): +class _SeriesPattern20By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def txin_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'txin_index') + def txin_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'txin_index') -class MetricPattern20(Generic[T]): - by: _MetricPattern20By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern20By(c, n) +class SeriesPattern20(Generic[T]): + by: _SeriesPattern20By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern20By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i20) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i20 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i20 else None -class _MetricPattern21By(Generic[T]): +class _SeriesPattern21By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def txout_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'txout_index') + def txout_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'txout_index') -class MetricPattern21(Generic[T]): - by: _MetricPattern21By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern21By(c, n) +class SeriesPattern21(Generic[T]): + by: _SeriesPattern21By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern21By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i21) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i21 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i21 else None -class _MetricPattern22By(Generic[T]): +class _SeriesPattern22By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def empty_output_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'empty_output_index') + def empty_output_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'empty_output_index') -class MetricPattern22(Generic[T]): - by: _MetricPattern22By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern22By(c, n) +class SeriesPattern22(Generic[T]): + by: _SeriesPattern22By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern22By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i22) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i22 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i22 else None -class _MetricPattern23By(Generic[T]): +class _SeriesPattern23By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def op_return_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'op_return_index') + def op_return_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'op_return_index') -class MetricPattern23(Generic[T]): - by: _MetricPattern23By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern23By(c, n) +class SeriesPattern23(Generic[T]): + by: _SeriesPattern23By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern23By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i23) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i23 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i23 else None -class _MetricPattern24By(Generic[T]): +class _SeriesPattern24By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def p2a_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'p2a_address_index') + def p2a_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'p2a_address_index') -class MetricPattern24(Generic[T]): - by: _MetricPattern24By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern24By(c, n) +class SeriesPattern24(Generic[T]): + by: _SeriesPattern24By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern24By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i24) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i24 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i24 else None -class _MetricPattern25By(Generic[T]): +class _SeriesPattern25By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def p2ms_output_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'p2ms_output_index') + def p2ms_output_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'p2ms_output_index') -class MetricPattern25(Generic[T]): - by: _MetricPattern25By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern25By(c, n) +class SeriesPattern25(Generic[T]): + by: _SeriesPattern25By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern25By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i25) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i25 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i25 else None -class _MetricPattern26By(Generic[T]): +class _SeriesPattern26By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def p2pk33_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'p2pk33_address_index') + def p2pk33_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'p2pk33_address_index') -class MetricPattern26(Generic[T]): - by: _MetricPattern26By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern26By(c, n) +class SeriesPattern26(Generic[T]): + by: _SeriesPattern26By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern26By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i26) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i26 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i26 else None -class _MetricPattern27By(Generic[T]): +class _SeriesPattern27By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def p2pk65_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'p2pk65_address_index') + def p2pk65_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'p2pk65_address_index') -class MetricPattern27(Generic[T]): - by: _MetricPattern27By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern27By(c, n) +class SeriesPattern27(Generic[T]): + by: _SeriesPattern27By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern27By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i27) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i27 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i27 else None -class _MetricPattern28By(Generic[T]): +class _SeriesPattern28By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def p2pkh_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'p2pkh_address_index') + def p2pkh_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'p2pkh_address_index') -class MetricPattern28(Generic[T]): - by: _MetricPattern28By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern28By(c, n) +class SeriesPattern28(Generic[T]): + by: _SeriesPattern28By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern28By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i28) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i28 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i28 else None -class _MetricPattern29By(Generic[T]): +class _SeriesPattern29By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def p2sh_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'p2sh_address_index') + def p2sh_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'p2sh_address_index') -class MetricPattern29(Generic[T]): - by: _MetricPattern29By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern29By(c, n) +class SeriesPattern29(Generic[T]): + by: _SeriesPattern29By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern29By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i29) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i29 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i29 else None -class _MetricPattern30By(Generic[T]): +class _SeriesPattern30By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def p2tr_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'p2tr_address_index') + def p2tr_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'p2tr_address_index') -class MetricPattern30(Generic[T]): - by: _MetricPattern30By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern30By(c, n) +class SeriesPattern30(Generic[T]): + by: _SeriesPattern30By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern30By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i30) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i30 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i30 else None -class _MetricPattern31By(Generic[T]): +class _SeriesPattern31By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def p2wpkh_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'p2wpkh_address_index') + def p2wpkh_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'p2wpkh_address_index') -class MetricPattern31(Generic[T]): - by: _MetricPattern31By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern31By(c, n) +class SeriesPattern31(Generic[T]): + by: _SeriesPattern31By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern31By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i31) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i31 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i31 else None -class _MetricPattern32By(Generic[T]): +class _SeriesPattern32By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def p2wsh_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'p2wsh_address_index') + def p2wsh_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'p2wsh_address_index') -class MetricPattern32(Generic[T]): - by: _MetricPattern32By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern32By(c, n) +class SeriesPattern32(Generic[T]): + by: _SeriesPattern32By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern32By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i32) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i32 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i32 else None -class _MetricPattern33By(Generic[T]): +class _SeriesPattern33By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def unknown_output_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'unknown_output_index') + def unknown_output_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'unknown_output_index') -class MetricPattern33(Generic[T]): - by: _MetricPattern33By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern33By(c, n) +class SeriesPattern33(Generic[T]): + by: _SeriesPattern33By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern33By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i33) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i33 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i33 else None -class _MetricPattern34By(Generic[T]): +class _SeriesPattern34By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def funded_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'funded_address_index') + def funded_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'funded_address_index') -class MetricPattern34(Generic[T]): - by: _MetricPattern34By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern34By(c, n) +class SeriesPattern34(Generic[T]): + by: _SeriesPattern34By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern34By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i34) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i34 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i34 else None -class _MetricPattern35By(Generic[T]): +class _SeriesPattern35By(Generic[T]): def __init__(self, c: BrkClientBase, n: str): self._c, self._n = c, n - def empty_address_index(self) -> MetricEndpointBuilder[T]: return _ep(self._c, self._n, 'empty_address_index') + def empty_address_index(self) -> SeriesEndpointBuilder[T]: return _ep(self._c, self._n, 'empty_address_index') -class MetricPattern35(Generic[T]): - by: _MetricPattern35By[T] - def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _MetricPattern35By(c, n) +class SeriesPattern35(Generic[T]): + by: _SeriesPattern35By[T] + def __init__(self, c: BrkClientBase, n: str): self._n, self.by = n, _SeriesPattern35By(c, n) @property def name(self) -> str: return self._n def indexes(self) -> List[str]: return list(_i35) - def get(self, index: Index) -> Optional[MetricEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i35 else None + def get(self, index: Index) -> Optional[SeriesEndpointBuilder[T]]: return _ep(self.by._c, self._n, index) if index in _i35 else None # Reusable structural pattern classes @@ -2124,7 +2154,7 @@ class Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct7 """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.pct05: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct05')) self.pct10: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct10')) self.pct15: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, 'pct15')) @@ -2153,7 +2183,7 @@ class _10y1m1w1y2y3m3y4y5y6m6y8yPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._10y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '10y')) self._1m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1m')) self._1w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1w')) @@ -2171,7 +2201,7 @@ class _10y1m1w1y2y3m3y4y5y6m6y8yPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._10y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '10y')) self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1m')) self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1w')) @@ -2193,27 +2223,27 @@ class AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.average: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'average')) - self.cumulative: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'cumulative')) - self.max: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'max')) - self.median: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'median')) - self.min: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'min')) - self.pct10: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'pct10')) - self.pct25: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'pct25')) - self.pct75: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'pct75')) - self.pct90: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'pct90')) + """Create pattern node with accumulated series name.""" + self.average: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'average')) + self.cumulative: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'cumulative')) + self.max: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'max')) + self.median: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'median')) + self.min: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'min')) + self.pct10: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'pct10')) + self.pct25: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'pct25')) + self.pct75: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'pct75')) + self.pct90: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'pct90')) self.rolling: AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern = AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, acc) - self.sum: MetricPattern18[StoredU64] = MetricPattern18(client, _m(acc, 'sum')) + self.sum: SeriesPattern18[StoredU64] = SeriesPattern18(client, _m(acc, 'sum')) class AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.average: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'average')) - self.base: MetricPattern1[StoredU64] = MetricPattern1(client, acc) - self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'cumulative')) + self.base: SeriesPattern1[StoredU64] = SeriesPattern1(client, acc) + self.cumulative: SeriesPattern1[StoredU64] = SeriesPattern1(client, _m(acc, 'cumulative')) self.max: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'max')) self.median: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'median')) self.min: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'min')) @@ -2227,11 +2257,11 @@ class AverageGainsLossesRsiStochPattern: """Pattern struct for repeated tree structure.""" 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}')) - self.gains: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, f'gains_{disc}')) - self.losses: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, f'losses_{disc}')) + """Create pattern node with accumulated series name.""" + self.average_gain: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, f'average_gain_{disc}')) + self.average_loss: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, f'average_loss_{disc}')) + self.gains: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, f'gains_{disc}')) + self.losses: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, f'losses_{disc}')) self.rsi: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, disc)) self.rsi_max: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, f'max_{disc}')) self.rsi_min: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, f'min_{disc}')) @@ -2243,22 +2273,22 @@ class AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.all: MetricPattern1[StoredU64] = MetricPattern1(client, acc) - self.p2a: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2a', acc)) - self.p2pk33: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2pk33', acc)) - self.p2pk65: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2pk65', acc)) - self.p2pkh: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2pkh', acc)) - self.p2sh: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2sh', acc)) - self.p2tr: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2tr', acc)) - self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2wpkh', acc)) - self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1(client, _p('p2wsh', acc)) + """Create pattern node with accumulated series name.""" + self.all: SeriesPattern1[StoredU64] = SeriesPattern1(client, acc) + self.p2a: SeriesPattern1[StoredU64] = SeriesPattern1(client, _p('p2a', acc)) + self.p2pk33: SeriesPattern1[StoredU64] = SeriesPattern1(client, _p('p2pk33', acc)) + self.p2pk65: SeriesPattern1[StoredU64] = SeriesPattern1(client, _p('p2pk65', acc)) + self.p2pkh: SeriesPattern1[StoredU64] = SeriesPattern1(client, _p('p2pkh', acc)) + self.p2sh: SeriesPattern1[StoredU64] = SeriesPattern1(client, _p('p2sh', acc)) + self.p2tr: SeriesPattern1[StoredU64] = SeriesPattern1(client, _p('p2tr', acc)) + self.p2wpkh: SeriesPattern1[StoredU64] = SeriesPattern1(client, _p('p2wpkh', acc)) + self.p2wsh: SeriesPattern1[StoredU64] = SeriesPattern1(client, _p('p2wsh', acc)) class AverageMaxMedianMinPct10Pct25Pct75Pct90SumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.average: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'average')) self.max: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'max')) self.median: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'median')) @@ -2273,7 +2303,7 @@ class AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.average: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'average')) self.max: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'max')) self.median: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'median')) @@ -2295,21 +2325,21 @@ class AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.average: MetricPattern18[T] = MetricPattern18(client, _m(acc, 'average')) - self.max: MetricPattern18[T] = MetricPattern18(client, _m(acc, 'max')) - self.median: MetricPattern18[T] = MetricPattern18(client, _m(acc, 'median')) - self.min: MetricPattern18[T] = MetricPattern18(client, _m(acc, 'min')) - self.pct10: MetricPattern18[T] = MetricPattern18(client, _m(acc, 'pct10')) - self.pct25: MetricPattern18[T] = MetricPattern18(client, _m(acc, 'pct25')) - self.pct75: MetricPattern18[T] = MetricPattern18(client, _m(acc, 'pct75')) - self.pct90: MetricPattern18[T] = MetricPattern18(client, _m(acc, 'pct90')) + """Create pattern node with accumulated series name.""" + self.average: SeriesPattern18[T] = SeriesPattern18(client, _m(acc, 'average')) + self.max: SeriesPattern18[T] = SeriesPattern18(client, _m(acc, 'max')) + self.median: SeriesPattern18[T] = SeriesPattern18(client, _m(acc, 'median')) + self.min: SeriesPattern18[T] = SeriesPattern18(client, _m(acc, 'min')) + self.pct10: SeriesPattern18[T] = SeriesPattern18(client, _m(acc, 'pct10')) + self.pct25: SeriesPattern18[T] = SeriesPattern18(client, _m(acc, 'pct25')) + self.pct75: SeriesPattern18[T] = SeriesPattern18(client, _m(acc, 'pct75')) + self.pct90: SeriesPattern18[T] = SeriesPattern18(client, _m(acc, 'pct90')) class _10y2y3y4y5y6y8yPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._10y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '10y')) self._2y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '2y')) self._3y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '3y')) @@ -2322,14 +2352,14 @@ class _1m1w1y24hBpsPercentRatioPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._1m: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, '1m')) self._1w: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, '1w')) self._1y: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, '1y')) self._24h: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, '24h')) - self.bps: MetricPattern1[BasisPoints16] = MetricPattern1(client, _m(acc, 'bps')) - self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) + self.bps: SeriesPattern1[BasisPoints16] = SeriesPattern1(client, _m(acc, 'bps')) + self.percent: SeriesPattern1[StoredF32] = SeriesPattern1(client, acc) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ratio')) class BaseCumulativeDistributionRelSumValuePattern: """Pattern struct for repeated tree structure.""" @@ -2339,10 +2369,10 @@ class BaseCumulativeNegativeRelSumPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.base: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'unrealized_loss')) self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'unrealized_loss_cumulative')) - self.negative: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss')) + self.negative: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'neg_unrealized_loss')) self.rel_to_mcap: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, 'unrealized_loss_rel_to_mcap')) self.rel_to_own_gross: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, 'unrealized_loss_rel_to_own_gross_pnl')) self.rel_to_own_mcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'unrealized_loss_rel_to_own_mcap')) @@ -2352,10 +2382,10 @@ class CapLossMvrvNetPriceProfitSoprPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.cap: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, 'realized_cap')) self.loss: BaseCumulativeNegativeSumPattern = BaseCumulativeNegativeSumPattern(client, acc, 'realized_loss') - self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) + self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'mvrv')) self.net_pnl: BaseCumulativeDeltaSumPattern = BaseCumulativeDeltaSumPattern(client, _m(acc, 'net_realized_pnl')) self.price: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, _m(acc, 'realized_price')) self.profit: BaseCumulativeSumPattern3 = BaseCumulativeSumPattern3(client, _m(acc, 'realized_profit')) @@ -2369,7 +2399,7 @@ class _1m1w1y2y4yAllPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._1m: BpsRatioPattern2 = BpsRatioPattern2(client, _m(acc, '1m')) self._1w: BpsRatioPattern2 = BpsRatioPattern2(client, _m(acc, '1w')) self._1y: BpsRatioPattern2 = BpsRatioPattern2(client, _m(acc, '1y')) @@ -2381,7 +2411,7 @@ class BaseChangeCumulativeDeltaRelSumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.base: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_pnl')) self.change_1m: RelPattern = RelPattern(client, _m(acc, 'pnl_change_1m_rel_to')) self.cumulative: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'realized_pnl_cumulative')) @@ -2393,7 +2423,7 @@ class BaseCumulativeRelSumPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.base: CentsUsdPattern2 = CentsUsdPattern2(client, acc) self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'cumulative')) self.rel_to_mcap: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, 'rel_to_mcap')) @@ -2405,34 +2435,34 @@ class BpsCentsPercentilesRatioSatsUsdPattern: """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')) + """Create pattern node with accumulated series name.""" + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, _m(acc, 'ratio_bps')) + self.cents: SeriesPattern1[Cents] = SeriesPattern1(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.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ratio')) + self.sats: SeriesPattern1[SatsFract] = SeriesPattern1(client, _m(acc, 'sats')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) class BtcCentsRelSatsUsdPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, acc) - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) + """Create pattern node with accumulated series name.""" + self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, acc) + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) self.rel_to_circulating: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, 'rel_to_circulating')) self.rel_to_own: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, 'rel_to_own')) - self.sats: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sats')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) + self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, _m(acc, 'sats')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'usd')) class CapLossMvrvPriceProfitSoprPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.cap: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, _m(acc, 'realized_cap')) self.loss: BaseCumulativeSumPattern3 = BaseCumulativeSumPattern3(client, _m(acc, 'realized_loss')) - self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'mvrv')) + self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'mvrv')) self.price: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, _m(acc, 'realized_price')) self.profit: BaseCumulativeSumPattern3 = BaseCumulativeSumPattern3(client, _m(acc, 'realized_profit')) self.sopr: ValuePattern = ValuePattern(client, _m(acc, 'value')) @@ -2441,7 +2471,7 @@ class DeltaHalfInRelTotalPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.delta: AbsoluteRatePattern = AbsoluteRatePattern(client, _m(acc, 'delta')) self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) self.in_loss: BtcCentsRelSatsUsdPattern = BtcCentsRelSatsUsdPattern(client, _m(acc, 'in_loss')) @@ -2453,7 +2483,7 @@ class DeltaHalfInRelTotalPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.delta: AbsoluteRatePattern = AbsoluteRatePattern(client, _m(acc, 'delta')) self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) self.in_loss: BtcCentsRelSatsUsdPattern3 = BtcCentsRelSatsUsdPattern3(client, _m(acc, 'in_loss')) @@ -2465,7 +2495,7 @@ class Pct1Pct2Pct5Pct95Pct98Pct99Pattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.pct1: BpsPriceRatioPattern = BpsPriceRatioPattern(client, acc, 'pct1') self.pct2: BpsPriceRatioPattern = BpsPriceRatioPattern(client, acc, 'pct2') self.pct5: BpsPriceRatioPattern = BpsPriceRatioPattern(client, acc, 'pct5') @@ -2477,7 +2507,7 @@ class ActivityOutputsRealizedSupplyUnrealizedPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.activity: CoindaysSentPattern = CoindaysSentPattern(client, acc) self.outputs: UnspentPattern = UnspentPattern(client, _m(acc, 'utxo_count')) self.realized: CapLossMvrvNetPriceProfitSoprPattern = CapLossMvrvNetPriceProfitSoprPattern(client, acc) @@ -2488,7 +2518,7 @@ class AddressOutputsRealizedSupplyUnrealizedPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.address_count: DeltaInnerPattern = DeltaInnerPattern(client, _m(acc, 'address_count')) self.outputs: UnspentPattern = UnspentPattern(client, _m(acc, 'utxo_count')) self.realized: CapLossMvrvPriceProfitSoprPattern = CapLossMvrvPriceProfitSoprPattern(client, acc) @@ -2499,9 +2529,9 @@ class BaseCumulativeInSumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.base: MetricPattern1[Sats] = MetricPattern1(client, acc) - self.cumulative: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'cumulative')) + """Create pattern node with accumulated series name.""" + self.base: SeriesPattern1[Sats] = SeriesPattern1(client, acc) + self.cumulative: SeriesPattern1[Sats] = SeriesPattern1(client, _m(acc, 'cumulative')) self.in_loss: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, _m(acc, 'in_loss')) self.in_profit: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, _m(acc, 'in_profit')) self.sum: _1m1w1y24hPattern[Sats] = _1m1w1y24hPattern(client, _m(acc, 'sum')) @@ -2510,51 +2540,51 @@ class BpsCentsRatioSatsUsdPattern: """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.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) - self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, _m(acc, 'sats')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) + """Create pattern node with accumulated series name.""" + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, _m(acc, 'ratio_bps')) + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ratio')) + self.sats: SeriesPattern1[SatsFract] = SeriesPattern1(client, _m(acc, 'sats')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) class BtcCentsDeltaSatsUsdPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, acc) - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) + """Create pattern node with accumulated series name.""" + self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, acc) + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) self.delta: AbsoluteRatePattern = AbsoluteRatePattern(client, _m(acc, 'delta')) - self.sats: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sats')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) + self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, _m(acc, 'sats')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'usd')) class BtcCentsRelSatsUsdPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, acc) - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) + """Create pattern node with accumulated series name.""" + self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, acc) + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) self.rel_to_circulating: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, 'rel_to_circulating')) - self.sats: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sats')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) + self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, _m(acc, 'sats')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'usd')) class BtcCentsRelSatsUsdPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, acc) - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) + """Create pattern node with accumulated series name.""" + self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, acc) + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) self.rel_to_own: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, 'rel_to_own')) - self.sats: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sats')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) + self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, _m(acc, 'sats')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'usd')) class DeltaHalfInTotalPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.delta: AbsoluteRatePattern = AbsoluteRatePattern(client, _m(acc, 'delta')) self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) self.in_loss: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'in_loss')) @@ -2573,29 +2603,29 @@ class PhsReboundThsPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.phs: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'phs')) - self.phs_min: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'phs_min')) + """Create pattern node with accumulated series name.""" + self.phs: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'phs')) + self.phs_min: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'phs_min')) self.rebound: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rebound')) - self.ths: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ths')) - self.ths_min: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ths_min')) + self.ths: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ths')) + self.ths_min: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ths_min')) class _1m1w1y24hHeightPattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._1m: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average_1m')) - self._1w: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average_1w')) - self._1y: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average_1y')) - self._24h: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average_24h')) - self.height: MetricPattern18[T] = MetricPattern18(client, acc) + """Create pattern node with accumulated series name.""" + self._1m: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, 'average_1m')) + self._1w: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, 'average_1w')) + self._1y: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, 'average_1y')) + self._24h: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, 'average_24h')) + self.height: SeriesPattern18[T] = SeriesPattern18(client, acc) class _1m1w1y24hPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._1m: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1m_rate')) self._1w: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1w_rate')) self._1y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, '1y_rate')) @@ -2605,7 +2635,7 @@ class _1m1w1y24hPattern6: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._1m: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, '1m')) self._1w: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, '1w')) self._1y: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, '1y')) @@ -2615,7 +2645,7 @@ class _1m1w1y24hPattern5: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._1m: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1m')) self._1w: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1w')) self._1y: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, '1y')) @@ -2625,7 +2655,7 @@ class _1m1w1y2wPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._1m: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, '1m')) self._1w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, '1w')) self._1y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, '1y')) @@ -2635,7 +2665,7 @@ class _1m1w1y24hPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._1m: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1m')) self._1w: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1w')) self._1y: CentsUsdPattern = CentsUsdPattern(client, _m(acc, '1y')) @@ -2645,7 +2675,7 @@ class _1m1w1y24hPattern4: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._1m: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, '1m')) self._1w: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, '1w')) self._1y: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, '1y')) @@ -2663,7 +2693,7 @@ class BaseCumulativeDeltaSumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.base: CentsUsdPattern = CentsUsdPattern(client, acc) self.cumulative: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'cumulative')) self.delta: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, 'delta')) @@ -2673,17 +2703,17 @@ class BaseCumulativeNegativeSumPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str, disc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.base: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, disc)) self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, f'{disc}_cumulative')) - self.negative: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, f'neg_{disc}')) + self.negative: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, f'neg_{disc}')) self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, _m(acc, f'{disc}_sum')) class BothReactivatedReceivingSendingPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.both: _1m1w1y24hHeightPattern[StoredU32] = _1m1w1y24hHeightPattern(client, _m(acc, 'both')) self.reactivated: _1m1w1y24hHeightPattern[StoredU32] = _1m1w1y24hHeightPattern(client, _m(acc, 'reactivated')) self.receiving: _1m1w1y24hHeightPattern[StoredU32] = _1m1w1y24hHeightPattern(client, _m(acc, 'receiving')) @@ -2693,31 +2723,31 @@ class BtcCentsSatsUsdPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.btc: MetricPattern1[Bitcoin] = MetricPattern1(client, acc) - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) - self.sats: MetricPattern1[Sats] = MetricPattern1(client, _m(acc, 'sats')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'usd')) + """Create pattern node with accumulated series name.""" + self.btc: SeriesPattern1[Bitcoin] = SeriesPattern1(client, acc) + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) + self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, _m(acc, 'sats')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'usd')) class CentsDeltaRelUsdPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) + """Create pattern node with accumulated series name.""" + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) self.delta: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, 'delta')) self.rel_to_own_mcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_own_mcap')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) class CentsRelUsdPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cents: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'cents')) + """Create pattern node with accumulated series name.""" + self.cents: SeriesPattern1[CentsSigned] = SeriesPattern1(client, _m(acc, 'cents')) self.rel_to_own_gross: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_own_gross_pnl')) self.rel_to_own_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rel_to_own_mcap')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) class CoindaysCoinyearsDormancySentPattern: """Pattern struct for repeated tree structure.""" @@ -2727,7 +2757,7 @@ class LossNetNuplProfitPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.loss: BaseCumulativeNegativeSumPattern = BaseCumulativeNegativeSumPattern(client, acc, 'unrealized_loss') self.net_pnl: CentsUsdPattern = CentsUsdPattern(client, _m(acc, 'net_unrealized_pnl')) self.nupl: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'nupl')) @@ -2737,7 +2767,7 @@ class OutputsRealizedSupplyUnrealizedPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.outputs: UnspentPattern = UnspentPattern(client, _m(acc, 'utxo_count')) self.realized: CapLossMvrvPriceProfitSoprPattern = CapLossMvrvPriceProfitSoprPattern(client, acc) self.supply: DeltaHalfInTotalPattern2 = DeltaHalfInTotalPattern2(client, _m(acc, 'supply')) @@ -2747,7 +2777,7 @@ class OutputsRealizedSupplyUnrealizedPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.outputs: UnspentPattern = UnspentPattern(client, _m(acc, 'utxo_count')) self.realized: CapLossMvrvPriceProfitSoprPattern = CapLossMvrvPriceProfitSoprPattern(client, acc) self.supply: DeltaHalfTotalPattern = DeltaHalfTotalPattern(client, _m(acc, 'supply')) @@ -2757,17 +2787,17 @@ class _1m1w1y24hPattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._1m: MetricPattern1[T] = MetricPattern1(client, _m(acc, '1m')) - self._1w: MetricPattern1[T] = MetricPattern1(client, _m(acc, '1w')) - self._1y: MetricPattern1[T] = MetricPattern1(client, _m(acc, '1y')) - self._24h: MetricPattern1[T] = MetricPattern1(client, _m(acc, '24h')) + """Create pattern node with accumulated series name.""" + self._1m: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, '1m')) + self._1w: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, '1w')) + self._1y: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, '1y')) + self._24h: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, '24h')) class BaseCumulativeSumPattern4: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.base: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) self.cumulative: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'cumulative')) self.sum: _1m1w1y24hPattern5 = _1m1w1y24hPattern5(client, _m(acc, 'sum')) @@ -2776,16 +2806,16 @@ class BaseCumulativeRelPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.base: MetricPattern1[Cents] = MetricPattern1(client, acc) - self.cumulative: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cumulative')) + """Create pattern node with accumulated series name.""" + self.base: SeriesPattern1[Cents] = SeriesPattern1(client, acc) + self.cumulative: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cumulative')) self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, _m(acc, 'rel_to_rcap')) class BaseCumulativeSumPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.base: CentsUsdPattern2 = CentsUsdPattern2(client, acc) self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'cumulative')) self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, _m(acc, 'sum')) @@ -2794,16 +2824,16 @@ class BaseCumulativeSumPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.base: MetricPattern1[StoredU32] = MetricPattern1(client, acc) - self.cumulative: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'cumulative')) + """Create pattern node with accumulated series name.""" + self.base: SeriesPattern1[StoredU32] = SeriesPattern1(client, acc) + self.cumulative: SeriesPattern1[StoredU64] = SeriesPattern1(client, _m(acc, 'cumulative')) self.sum: _1m1w1y24hPattern[StoredU64] = _1m1w1y24hPattern(client, _m(acc, 'sum')) class BlocksDominanceRewardsPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.blocks_mined: BaseCumulativeSumPattern2 = BaseCumulativeSumPattern2(client, _m(acc, 'blocks_mined')) self.dominance: _1m1w1y24hBpsPercentRatioPattern = _1m1w1y24hBpsPercentRatioPattern(client, _m(acc, 'dominance')) self.rewards: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, _m(acc, 'rewards')) @@ -2812,79 +2842,79 @@ class BpsPercentRatioPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bps: MetricPattern1[BasisPoints16] = MetricPattern1(client, _m(acc, 'bps')) - self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) + """Create pattern node with accumulated series name.""" + self.bps: SeriesPattern1[BasisPoints16] = SeriesPattern1(client, _m(acc, 'bps')) + self.percent: SeriesPattern1[StoredF32] = SeriesPattern1(client, acc) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ratio')) class BpsPercentRatioPattern4: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, _m(acc, 'bps')) - self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) + """Create pattern node with accumulated series name.""" + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, _m(acc, 'bps')) + self.percent: SeriesPattern1[StoredF32] = SeriesPattern1(client, acc) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ratio')) class BpsPriceRatioPattern: """Pattern struct for repeated tree structure.""" 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')) + """Create pattern node with accumulated series name.""" + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, _m(acc, f'ratio_{disc}_bps')) self.price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, disc)) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, f'ratio_{disc}')) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, f'ratio_{disc}')) class BpsPercentRatioPattern5: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bps: MetricPattern1[BasisPointsSigned16] = MetricPattern1(client, _m(acc, 'bps')) - self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) + """Create pattern node with accumulated series name.""" + self.bps: SeriesPattern1[BasisPointsSigned16] = SeriesPattern1(client, _m(acc, 'bps')) + self.percent: SeriesPattern1[StoredF32] = SeriesPattern1(client, acc) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ratio')) class BpsPercentRatioPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bps: MetricPattern1[BasisPointsSigned32] = MetricPattern1(client, _m(acc, 'bps')) - self.percent: MetricPattern1[StoredF32] = MetricPattern1(client, acc) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'ratio')) + """Create pattern node with accumulated series name.""" + self.bps: SeriesPattern1[BasisPointsSigned32] = SeriesPattern1(client, _m(acc, 'bps')) + self.percent: SeriesPattern1[StoredF32] = SeriesPattern1(client, acc) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, 'ratio')) class CentsSatsUsdPattern3: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cents: MetricPattern2[Cents] = MetricPattern2(client, _m(acc, 'cents')) - self.sats: MetricPattern2[Sats] = MetricPattern2(client, _m(acc, 'sats')) - self.usd: MetricPattern2[Dollars] = MetricPattern2(client, acc) + """Create pattern node with accumulated series name.""" + self.cents: SeriesPattern2[Cents] = SeriesPattern2(client, _m(acc, 'cents')) + self.sats: SeriesPattern2[Sats] = SeriesPattern2(client, _m(acc, 'sats')) + self.usd: SeriesPattern2[Dollars] = SeriesPattern2(client, acc) class CentsDeltaUsdPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) + """Create pattern node with accumulated series name.""" + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) self.delta: AbsoluteRatePattern2 = AbsoluteRatePattern2(client, _m(acc, 'delta')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) class CentsSatsUsdPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) - self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, _m(acc, 'sats')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) + """Create pattern node with accumulated series name.""" + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) + self.sats: SeriesPattern1[SatsFract] = SeriesPattern1(client, _m(acc, 'sats')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) class DeltaHalfTotalPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.delta: AbsoluteRatePattern = AbsoluteRatePattern(client, _m(acc, 'delta')) self.half: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'half')) self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, acc) @@ -2897,7 +2927,7 @@ class LossNuplProfitPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.loss: BaseCumulativeNegativeSumPattern = BaseCumulativeNegativeSumPattern(client, acc, 'unrealized_loss') self.nupl: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'nupl')) self.profit: BaseCumulativeSumPattern3 = BaseCumulativeSumPattern3(client, _m(acc, 'unrealized_profit')) @@ -2910,7 +2940,7 @@ class NuplRealizedSupplyPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.nupl: BpsRatioPattern = BpsRatioPattern(client, _m(acc, 'nupl')) self.realized_cap: AllSthPattern = AllSthPattern(client, acc) self.supply: AllSthPattern2 = AllSthPattern2(client, acc) @@ -2923,7 +2953,7 @@ class RatioValuePattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.ratio: _24hPattern = _24hPattern(client, _m(acc, 'sopr_24h')) self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, _m(acc, 'value_created')) self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, _m(acc, 'value_destroyed')) @@ -2932,25 +2962,25 @@ class _6bBlockTxPattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self._6b: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2[T] = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(client, _m(acc, '6b')) self.block: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2[T] = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern2(client, acc) - self.tx_index: MetricPattern19[T] = MetricPattern19(client, acc) + self.tx_index: SeriesPattern19[T] = SeriesPattern19(client, acc) class BaseCumulativeSumPattern(Generic[T]): """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.base: MetricPattern1[T] = MetricPattern1(client, acc) - self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative')) + """Create pattern node with accumulated series name.""" + self.base: SeriesPattern1[T] = SeriesPattern1(client, acc) + self.cumulative: SeriesPattern1[T] = SeriesPattern1(client, _m(acc, 'cumulative')) self.sum: _1m1w1y24hPattern[T] = _1m1w1y24hPattern(client, _m(acc, 'sum')) class AbsoluteRatePattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.absolute: _1m1w1y24hPattern[StoredI64] = _1m1w1y24hPattern(client, acc) self.rate: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, acc) @@ -2958,7 +2988,7 @@ class AbsoluteRatePattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.absolute: _1m1w1y24hPattern3 = _1m1w1y24hPattern3(client, acc) self.rate: _1m1w1y24hPattern2 = _1m1w1y24hPattern2(client, acc) @@ -2966,7 +2996,7 @@ class AllSthPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.all: BtcCentsDeltaSatsUsdPattern = BtcCentsDeltaSatsUsdPattern(client, _m(acc, 'supply')) self.sth: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, _m(acc, 'sth_supply')) @@ -2974,15 +3004,15 @@ class AllSthPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.all: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'realized_cap')) - self.sth: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'sth_realized_cap')) + """Create pattern node with accumulated series name.""" + self.all: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'realized_cap')) + self.sth: SeriesPattern1[Dollars] = SeriesPattern1(client, _m(acc, 'sth_realized_cap')) class BlocksDominancePattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.blocks_mined: BaseCumulativeSumPattern2 = BaseCumulativeSumPattern2(client, _m(acc, 'blocks_mined')) self.dominance: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, _m(acc, 'dominance')) @@ -2990,39 +3020,39 @@ class BpsRatioPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, _m(acc, 'bps')) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + """Create pattern node with accumulated series name.""" + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, _m(acc, 'bps')) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, acc) class BpsRatioPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.bps: MetricPattern1[BasisPointsSigned32] = MetricPattern1(client, _m(acc, 'bps')) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, acc) + """Create pattern node with accumulated series name.""" + self.bps: SeriesPattern1[BasisPointsSigned32] = SeriesPattern1(client, _m(acc, 'bps')) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, acc) class CentsUsdPattern2: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cents: MetricPattern1[Cents] = MetricPattern1(client, _m(acc, 'cents')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) + """Create pattern node with accumulated series name.""" + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, _m(acc, 'cents')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) class CentsUsdPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self.cents: MetricPattern1[CentsSigned] = MetricPattern1(client, _m(acc, 'cents')) - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, acc) + """Create pattern node with accumulated series name.""" + self.cents: SeriesPattern1[CentsSigned] = SeriesPattern1(client, _m(acc, 'cents')) + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, acc) class CoindaysSentPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.coindays_destroyed: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, _m(acc, 'coindays_destroyed')) self.sent: BaseCumulativeInSumPattern = BaseCumulativeInSumPattern(client, _m(acc, 'sent')) @@ -3030,15 +3060,15 @@ class DeltaInnerPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.delta: AbsoluteRatePattern = AbsoluteRatePattern(client, _m(acc, 'delta')) - self.inner: MetricPattern1[StoredU64] = MetricPattern1(client, acc) + self.inner: SeriesPattern1[StoredU64] = SeriesPattern1(client, acc) class InPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.in_loss: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'loss')) self.in_profit: CentsUsdPattern2 = CentsUsdPattern2(client, _m(acc, 'profit')) @@ -3046,15 +3076,15 @@ class PriceRatioPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str, disc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.price: CentsSatsUsdPattern = CentsSatsUsdPattern(client, _m(acc, disc)) - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, f'ratio_{disc}')) + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, _m(acc, f'ratio_{disc}')) class RelPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.rel_to_mcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'mcap')) self.rel_to_rcap: BpsPercentRatioPattern = BpsPercentRatioPattern(client, _m(acc, 'rcap')) @@ -3066,7 +3096,7 @@ class ValuePattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.value_created: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, _m(acc, 'created')) self.value_destroyed: BaseCumulativeSumPattern[Cents] = BaseCumulativeSumPattern(client, _m(acc, 'destroyed')) @@ -3074,50 +3104,50 @@ class _24hPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" - self._24h: MetricPattern1[StoredF64] = MetricPattern1(client, acc) + """Create pattern node with accumulated series name.""" + self._24h: SeriesPattern1[StoredF64] = SeriesPattern1(client, acc) class NuplPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.nupl: BpsRatioPattern = BpsRatioPattern(client, acc) class UnspentPattern: """Pattern struct for repeated tree structure.""" def __init__(self, client: BrkClientBase, acc: str): - """Create pattern node with accumulated metric name.""" + """Create pattern node with accumulated series name.""" self.unspent_count: DeltaInnerPattern = DeltaInnerPattern(client, acc) -# Metrics tree classes +# Series tree classes -class MetricsTree_Blocks_Difficulty: - """Metrics tree node.""" +class SeriesTree_Blocks_Difficulty: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.value: MetricPattern1[StoredF64] = MetricPattern1(client, 'difficulty') - self.as_hash: MetricPattern1[StoredF64] = MetricPattern1(client, 'difficulty_as_hash') + self.value: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'difficulty') + self.as_hash: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'difficulty_as_hash') self.adjustment: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'difficulty_adjustment') - self.epoch: MetricPattern1[Epoch] = MetricPattern1(client, 'difficulty_epoch') - self.blocks_before_next: MetricPattern1[StoredU32] = MetricPattern1(client, 'blocks_before_next_difficulty_adjustment') - self.days_before_next: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_before_next_difficulty_adjustment') + self.epoch: SeriesPattern1[Epoch] = SeriesPattern1(client, 'difficulty_epoch') + self.blocks_before_next: SeriesPattern1[StoredU32] = SeriesPattern1(client, 'blocks_before_next_difficulty_adjustment') + self.days_before_next: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'days_before_next_difficulty_adjustment') -class MetricsTree_Blocks_Time: - """Metrics tree node.""" +class SeriesTree_Blocks_Time: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.timestamp: MetricPattern1[Timestamp] = MetricPattern1(client, 'timestamp') - self.date: MetricPattern18[Date] = MetricPattern18(client, 'date') - self.timestamp_monotonic: MetricPattern18[Timestamp] = MetricPattern18(client, 'timestamp_monotonic') + self.timestamp: SeriesPattern1[Timestamp] = SeriesPattern1(client, 'timestamp') + self.date: SeriesPattern18[Date] = SeriesPattern18(client, 'date') + self.timestamp_monotonic: SeriesPattern18[Timestamp] = SeriesPattern18(client, 'timestamp_monotonic') -class MetricsTree_Blocks_Size: - """Metrics tree node.""" +class SeriesTree_Blocks_Size: + """Series tree node.""" 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.total: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'total_size') + self.cumulative: SeriesPattern1[StoredU64] = SeriesPattern1(client, 'block_size_cumulative') 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') @@ -3128,12 +3158,12 @@ class MetricsTree_Blocks_Size: 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.""" +class SeriesTree_Blocks_Weight: + """Series tree node.""" 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.raw: SeriesPattern18[Weight] = SeriesPattern18(client, 'block_weight') + self.cumulative: SeriesPattern1[Weight] = SeriesPattern1(client, 'block_weight_cumulative') 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') @@ -3144,309 +3174,309 @@ class MetricsTree_Blocks_Weight: 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.""" +class SeriesTree_Blocks_Count: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.target: MetricPattern1[StoredU64] = MetricPattern1(client, 'block_count_target') + self.target: SeriesPattern1[StoredU64] = SeriesPattern1(client, 'block_count_target') self.total: BaseCumulativeSumPattern2 = BaseCumulativeSumPattern2(client, 'block_count') -class MetricsTree_Blocks_Lookback: - """Metrics tree node.""" +class SeriesTree_Blocks_Lookback: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1h: MetricPattern18[Height] = MetricPattern18(client, 'height_1h_ago') - self._24h: MetricPattern18[Height] = MetricPattern18(client, 'height_24h_ago') - self._3d: MetricPattern18[Height] = MetricPattern18(client, 'height_3d_ago') - self._1w: MetricPattern18[Height] = MetricPattern18(client, 'height_1w_ago') - self._8d: MetricPattern18[Height] = MetricPattern18(client, 'height_8d_ago') - self._9d: MetricPattern18[Height] = MetricPattern18(client, 'height_9d_ago') - self._12d: MetricPattern18[Height] = MetricPattern18(client, 'height_12d_ago') - self._13d: MetricPattern18[Height] = MetricPattern18(client, 'height_13d_ago') - self._2w: MetricPattern18[Height] = MetricPattern18(client, 'height_2w_ago') - self._21d: MetricPattern18[Height] = MetricPattern18(client, 'height_21d_ago') - self._26d: MetricPattern18[Height] = MetricPattern18(client, 'height_26d_ago') - self._1m: MetricPattern18[Height] = MetricPattern18(client, 'height_1m_ago') - self._34d: MetricPattern18[Height] = MetricPattern18(client, 'height_34d_ago') - self._55d: MetricPattern18[Height] = MetricPattern18(client, 'height_55d_ago') - self._2m: MetricPattern18[Height] = MetricPattern18(client, 'height_2m_ago') - self._9w: MetricPattern18[Height] = MetricPattern18(client, 'height_9w_ago') - self._12w: MetricPattern18[Height] = MetricPattern18(client, 'height_12w_ago') - self._89d: MetricPattern18[Height] = MetricPattern18(client, 'height_89d_ago') - self._3m: MetricPattern18[Height] = MetricPattern18(client, 'height_3m_ago') - self._14w: MetricPattern18[Height] = MetricPattern18(client, 'height_14w_ago') - self._111d: MetricPattern18[Height] = MetricPattern18(client, 'height_111d_ago') - self._144d: MetricPattern18[Height] = MetricPattern18(client, 'height_144d_ago') - self._6m: MetricPattern18[Height] = MetricPattern18(client, 'height_6m_ago') - self._26w: MetricPattern18[Height] = MetricPattern18(client, 'height_26w_ago') - self._200d: MetricPattern18[Height] = MetricPattern18(client, 'height_200d_ago') - self._9m: MetricPattern18[Height] = MetricPattern18(client, 'height_9m_ago') - self._350d: MetricPattern18[Height] = MetricPattern18(client, 'height_350d_ago') - self._12m: MetricPattern18[Height] = MetricPattern18(client, 'height_12m_ago') - self._1y: MetricPattern18[Height] = MetricPattern18(client, 'height_1y_ago') - self._14m: MetricPattern18[Height] = MetricPattern18(client, 'height_14m_ago') - self._2y: MetricPattern18[Height] = MetricPattern18(client, 'height_2y_ago') - self._26m: MetricPattern18[Height] = MetricPattern18(client, 'height_26m_ago') - self._3y: MetricPattern18[Height] = MetricPattern18(client, 'height_3y_ago') - self._200w: MetricPattern18[Height] = MetricPattern18(client, 'height_200w_ago') - self._4y: MetricPattern18[Height] = MetricPattern18(client, 'height_4y_ago') - self._5y: MetricPattern18[Height] = MetricPattern18(client, 'height_5y_ago') - self._6y: MetricPattern18[Height] = MetricPattern18(client, 'height_6y_ago') - self._8y: MetricPattern18[Height] = MetricPattern18(client, 'height_8y_ago') - self._9y: MetricPattern18[Height] = MetricPattern18(client, 'height_9y_ago') - self._10y: MetricPattern18[Height] = MetricPattern18(client, 'height_10y_ago') - self._12y: MetricPattern18[Height] = MetricPattern18(client, 'height_12y_ago') - self._14y: MetricPattern18[Height] = MetricPattern18(client, 'height_14y_ago') - self._26y: MetricPattern18[Height] = MetricPattern18(client, 'height_26y_ago') + self._1h: SeriesPattern18[Height] = SeriesPattern18(client, 'height_1h_ago') + self._24h: SeriesPattern18[Height] = SeriesPattern18(client, 'height_24h_ago') + self._3d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_3d_ago') + self._1w: SeriesPattern18[Height] = SeriesPattern18(client, 'height_1w_ago') + self._8d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_8d_ago') + self._9d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_9d_ago') + self._12d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_12d_ago') + self._13d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_13d_ago') + self._2w: SeriesPattern18[Height] = SeriesPattern18(client, 'height_2w_ago') + self._21d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_21d_ago') + self._26d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_26d_ago') + self._1m: SeriesPattern18[Height] = SeriesPattern18(client, 'height_1m_ago') + self._34d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_34d_ago') + self._55d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_55d_ago') + self._2m: SeriesPattern18[Height] = SeriesPattern18(client, 'height_2m_ago') + self._9w: SeriesPattern18[Height] = SeriesPattern18(client, 'height_9w_ago') + self._12w: SeriesPattern18[Height] = SeriesPattern18(client, 'height_12w_ago') + self._89d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_89d_ago') + self._3m: SeriesPattern18[Height] = SeriesPattern18(client, 'height_3m_ago') + self._14w: SeriesPattern18[Height] = SeriesPattern18(client, 'height_14w_ago') + self._111d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_111d_ago') + self._144d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_144d_ago') + self._6m: SeriesPattern18[Height] = SeriesPattern18(client, 'height_6m_ago') + self._26w: SeriesPattern18[Height] = SeriesPattern18(client, 'height_26w_ago') + self._200d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_200d_ago') + self._9m: SeriesPattern18[Height] = SeriesPattern18(client, 'height_9m_ago') + self._350d: SeriesPattern18[Height] = SeriesPattern18(client, 'height_350d_ago') + self._12m: SeriesPattern18[Height] = SeriesPattern18(client, 'height_12m_ago') + self._1y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_1y_ago') + self._14m: SeriesPattern18[Height] = SeriesPattern18(client, 'height_14m_ago') + self._2y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_2y_ago') + self._26m: SeriesPattern18[Height] = SeriesPattern18(client, 'height_26m_ago') + self._3y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_3y_ago') + self._200w: SeriesPattern18[Height] = SeriesPattern18(client, 'height_200w_ago') + self._4y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_4y_ago') + self._5y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_5y_ago') + self._6y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_6y_ago') + self._8y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_8y_ago') + self._9y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_9y_ago') + self._10y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_10y_ago') + self._12y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_12y_ago') + self._14y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_14y_ago') + self._26y: SeriesPattern18[Height] = SeriesPattern18(client, 'height_26y_ago') -class MetricsTree_Blocks_Fullness: - """Metrics tree node.""" +class SeriesTree_Blocks_Fullness: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): 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') + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'block_fullness_ratio') + self.percent: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'block_fullness') -class MetricsTree_Blocks_Halving: - """Metrics tree node.""" +class SeriesTree_Blocks_Halving: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.epoch: MetricPattern1[Halving] = MetricPattern1(client, 'halving_epoch') - self.blocks_before_next: MetricPattern1[StoredU32] = MetricPattern1(client, 'blocks_before_next_halving') - self.days_before_next: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_before_next_halving') + self.epoch: SeriesPattern1[Halving] = SeriesPattern1(client, 'halving_epoch') + self.blocks_before_next: SeriesPattern1[StoredU32] = SeriesPattern1(client, 'blocks_before_next_halving') + self.days_before_next: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'days_before_next_halving') -class MetricsTree_Blocks: - """Metrics tree node.""" +class SeriesTree_Blocks: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.blockhash: MetricPattern18[BlockHash] = MetricPattern18(client, 'blockhash') - self.difficulty: MetricsTree_Blocks_Difficulty = MetricsTree_Blocks_Difficulty(client) - self.time: MetricsTree_Blocks_Time = MetricsTree_Blocks_Time(client) - self.size: MetricsTree_Blocks_Size = MetricsTree_Blocks_Size(client) - 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.blockhash: SeriesPattern18[BlockHash] = SeriesPattern18(client, 'blockhash') + self.difficulty: SeriesTree_Blocks_Difficulty = SeriesTree_Blocks_Difficulty(client) + self.time: SeriesTree_Blocks_Time = SeriesTree_Blocks_Time(client) + self.size: SeriesTree_Blocks_Size = SeriesTree_Blocks_Size(client) + self.weight: SeriesTree_Blocks_Weight = SeriesTree_Blocks_Weight(client) + self.count: SeriesTree_Blocks_Count = SeriesTree_Blocks_Count(client) + self.lookback: SeriesTree_Blocks_Lookback = SeriesTree_Blocks_Lookback(client) 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) + self.fullness: SeriesTree_Blocks_Fullness = SeriesTree_Blocks_Fullness(client) + self.halving: SeriesTree_Blocks_Halving = SeriesTree_Blocks_Halving(client) -class MetricsTree_Transactions_Raw: - """Metrics tree node.""" +class SeriesTree_Transactions_Raw: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_tx_index: MetricPattern18[TxIndex] = MetricPattern18(client, 'first_tx_index') - self.height: MetricPattern19[Height] = MetricPattern19(client, 'height') - self.txid: MetricPattern19[Txid] = MetricPattern19(client, 'txid') - self.tx_version: MetricPattern19[TxVersion] = MetricPattern19(client, 'tx_version') - self.raw_locktime: MetricPattern19[RawLockTime] = MetricPattern19(client, 'raw_locktime') - self.base_size: MetricPattern19[StoredU32] = MetricPattern19(client, 'base_size') - self.total_size: MetricPattern19[StoredU32] = MetricPattern19(client, 'total_size') - self.is_explicitly_rbf: MetricPattern19[StoredBool] = MetricPattern19(client, 'is_explicitly_rbf') - self.first_txin_index: MetricPattern19[TxInIndex] = MetricPattern19(client, 'first_txin_index') - self.first_txout_index: MetricPattern19[TxOutIndex] = MetricPattern19(client, 'first_txout_index') + self.first_tx_index: SeriesPattern18[TxIndex] = SeriesPattern18(client, 'first_tx_index') + self.height: SeriesPattern19[Height] = SeriesPattern19(client, 'height') + self.txid: SeriesPattern19[Txid] = SeriesPattern19(client, 'txid') + self.tx_version: SeriesPattern19[TxVersion] = SeriesPattern19(client, 'tx_version') + self.raw_locktime: SeriesPattern19[RawLockTime] = SeriesPattern19(client, 'raw_locktime') + self.base_size: SeriesPattern19[StoredU32] = SeriesPattern19(client, 'base_size') + self.total_size: SeriesPattern19[StoredU32] = SeriesPattern19(client, 'total_size') + self.is_explicitly_rbf: SeriesPattern19[StoredBool] = SeriesPattern19(client, 'is_explicitly_rbf') + self.first_txin_index: SeriesPattern19[TxInIndex] = SeriesPattern19(client, 'first_txin_index') + self.first_txout_index: SeriesPattern19[TxOutIndex] = SeriesPattern19(client, 'first_txout_index') -class MetricsTree_Transactions_Count: - """Metrics tree node.""" +class SeriesTree_Transactions_Count: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.total: AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern = AverageBaseCumulativeMaxMedianMinPct10Pct25Pct75Pct90SumPattern(client, 'tx_count') - self.is_coinbase: MetricPattern19[StoredBool] = MetricPattern19(client, 'is_coinbase') + self.is_coinbase: SeriesPattern19[StoredBool] = SeriesPattern19(client, 'is_coinbase') -class MetricsTree_Transactions_Size: - """Metrics tree node.""" +class SeriesTree_Transactions_Size: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.vsize: _6bBlockTxPattern[VSize] = _6bBlockTxPattern(client, 'tx_vsize') self.weight: _6bBlockTxPattern[Weight] = _6bBlockTxPattern(client, 'tx_weight') -class MetricsTree_Transactions_Fees: - """Metrics tree node.""" +class SeriesTree_Transactions_Fees: + """Series tree node.""" 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.input_value: SeriesPattern19[Sats] = SeriesPattern19(client, 'input_value') + self.output_value: SeriesPattern19[Sats] = SeriesPattern19(client, 'output_value') self.fee: _6bBlockTxPattern[Sats] = _6bBlockTxPattern(client, 'fee') self.fee_rate: _6bBlockTxPattern[FeeRate] = _6bBlockTxPattern(client, 'fee_rate') -class MetricsTree_Transactions_Versions: - """Metrics tree node.""" +class SeriesTree_Transactions_Versions: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): 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.""" +class SeriesTree_Transactions_Volume: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.sent_sum: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, 'sent_sum') self.received_sum: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, 'received_sum') - self.tx_per_sec: MetricPattern1[StoredF32] = MetricPattern1(client, 'tx_per_sec') - self.outputs_per_sec: MetricPattern1[StoredF32] = MetricPattern1(client, 'outputs_per_sec') - self.inputs_per_sec: MetricPattern1[StoredF32] = MetricPattern1(client, 'inputs_per_sec') + self.tx_per_sec: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'tx_per_sec') + self.outputs_per_sec: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'outputs_per_sec') + self.inputs_per_sec: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'inputs_per_sec') -class MetricsTree_Transactions: - """Metrics tree node.""" +class SeriesTree_Transactions: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.raw: MetricsTree_Transactions_Raw = MetricsTree_Transactions_Raw(client) - self.count: MetricsTree_Transactions_Count = MetricsTree_Transactions_Count(client) - self.size: MetricsTree_Transactions_Size = MetricsTree_Transactions_Size(client) - self.fees: MetricsTree_Transactions_Fees = MetricsTree_Transactions_Fees(client) - self.versions: MetricsTree_Transactions_Versions = MetricsTree_Transactions_Versions(client) - self.volume: MetricsTree_Transactions_Volume = MetricsTree_Transactions_Volume(client) + self.raw: SeriesTree_Transactions_Raw = SeriesTree_Transactions_Raw(client) + self.count: SeriesTree_Transactions_Count = SeriesTree_Transactions_Count(client) + self.size: SeriesTree_Transactions_Size = SeriesTree_Transactions_Size(client) + self.fees: SeriesTree_Transactions_Fees = SeriesTree_Transactions_Fees(client) + self.versions: SeriesTree_Transactions_Versions = SeriesTree_Transactions_Versions(client) + self.volume: SeriesTree_Transactions_Volume = SeriesTree_Transactions_Volume(client) -class MetricsTree_Inputs_Raw: - """Metrics tree node.""" +class SeriesTree_Inputs_Raw: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_txin_index: MetricPattern18[TxInIndex] = MetricPattern18(client, 'first_txin_index') - self.outpoint: MetricPattern20[OutPoint] = MetricPattern20(client, 'outpoint') - self.tx_index: MetricPattern20[TxIndex] = MetricPattern20(client, 'tx_index') - self.output_type: MetricPattern20[OutputType] = MetricPattern20(client, 'output_type') - self.type_index: MetricPattern20[TypeIndex] = MetricPattern20(client, 'type_index') + self.first_txin_index: SeriesPattern18[TxInIndex] = SeriesPattern18(client, 'first_txin_index') + self.outpoint: SeriesPattern20[OutPoint] = SeriesPattern20(client, 'outpoint') + self.tx_index: SeriesPattern20[TxIndex] = SeriesPattern20(client, 'tx_index') + self.output_type: SeriesPattern20[OutputType] = SeriesPattern20(client, 'output_type') + self.type_index: SeriesPattern20[TypeIndex] = SeriesPattern20(client, 'type_index') -class MetricsTree_Inputs_Spent: - """Metrics tree node.""" +class SeriesTree_Inputs_Spent: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.txout_index: MetricPattern20[TxOutIndex] = MetricPattern20(client, 'txout_index') - self.value: MetricPattern20[Sats] = MetricPattern20(client, 'value') + self.txout_index: SeriesPattern20[TxOutIndex] = SeriesPattern20(client, 'txout_index') + self.value: SeriesPattern20[Sats] = SeriesPattern20(client, 'value') -class MetricsTree_Inputs: - """Metrics tree node.""" +class SeriesTree_Inputs: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.raw: MetricsTree_Inputs_Raw = MetricsTree_Inputs_Raw(client) - self.spent: MetricsTree_Inputs_Spent = MetricsTree_Inputs_Spent(client) + self.raw: SeriesTree_Inputs_Raw = SeriesTree_Inputs_Raw(client) + self.spent: SeriesTree_Inputs_Spent = SeriesTree_Inputs_Spent(client) self.count: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern = AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(client, 'input_count') -class MetricsTree_Outputs_Raw: - """Metrics tree node.""" +class SeriesTree_Outputs_Raw: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_txout_index: MetricPattern18[TxOutIndex] = MetricPattern18(client, 'first_txout_index') - self.value: MetricPattern21[Sats] = MetricPattern21(client, 'value') - self.output_type: MetricPattern21[OutputType] = MetricPattern21(client, 'output_type') - self.type_index: MetricPattern21[TypeIndex] = MetricPattern21(client, 'type_index') - self.tx_index: MetricPattern21[TxIndex] = MetricPattern21(client, 'tx_index') + self.first_txout_index: SeriesPattern18[TxOutIndex] = SeriesPattern18(client, 'first_txout_index') + self.value: SeriesPattern21[Sats] = SeriesPattern21(client, 'value') + self.output_type: SeriesPattern21[OutputType] = SeriesPattern21(client, 'output_type') + self.type_index: SeriesPattern21[TypeIndex] = SeriesPattern21(client, 'type_index') + self.tx_index: SeriesPattern21[TxIndex] = SeriesPattern21(client, 'tx_index') -class MetricsTree_Outputs_Spent: - """Metrics tree node.""" +class SeriesTree_Outputs_Spent: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.txin_index: MetricPattern21[TxInIndex] = MetricPattern21(client, 'txin_index') + self.txin_index: SeriesPattern21[TxInIndex] = SeriesPattern21(client, 'txin_index') -class MetricsTree_Outputs_Count: - """Metrics tree node.""" +class SeriesTree_Outputs_Count: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.total: AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern = AverageCumulativeMaxMedianMinPct10Pct25Pct75Pct90RollingSumPattern(client, 'output_count') - self.unspent: MetricPattern1[StoredU64] = MetricPattern1(client, 'exact_utxo_count') + self.unspent: SeriesPattern1[StoredU64] = SeriesPattern1(client, 'exact_utxo_count') -class MetricsTree_Outputs: - """Metrics tree node.""" +class SeriesTree_Outputs: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.raw: MetricsTree_Outputs_Raw = MetricsTree_Outputs_Raw(client) - self.spent: MetricsTree_Outputs_Spent = MetricsTree_Outputs_Spent(client) - self.count: MetricsTree_Outputs_Count = MetricsTree_Outputs_Count(client) + self.raw: SeriesTree_Outputs_Raw = SeriesTree_Outputs_Raw(client) + self.spent: SeriesTree_Outputs_Spent = SeriesTree_Outputs_Spent(client) + self.count: SeriesTree_Outputs_Count = SeriesTree_Outputs_Count(client) -class MetricsTree_Addresses_Raw_P2pk65: - """Metrics tree node.""" +class SeriesTree_Addresses_Raw_P2pk65: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[P2PK65AddressIndex] = MetricPattern18(client, 'first_p2pk65_address_index') - self.bytes: MetricPattern27[P2PK65Bytes] = MetricPattern27(client, 'p2pk65_bytes') + self.first_index: SeriesPattern18[P2PK65AddressIndex] = SeriesPattern18(client, 'first_p2pk65_address_index') + self.bytes: SeriesPattern27[P2PK65Bytes] = SeriesPattern27(client, 'p2pk65_bytes') -class MetricsTree_Addresses_Raw_P2pk33: - """Metrics tree node.""" +class SeriesTree_Addresses_Raw_P2pk33: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[P2PK33AddressIndex] = MetricPattern18(client, 'first_p2pk33_address_index') - self.bytes: MetricPattern26[P2PK33Bytes] = MetricPattern26(client, 'p2pk33_bytes') + self.first_index: SeriesPattern18[P2PK33AddressIndex] = SeriesPattern18(client, 'first_p2pk33_address_index') + self.bytes: SeriesPattern26[P2PK33Bytes] = SeriesPattern26(client, 'p2pk33_bytes') -class MetricsTree_Addresses_Raw_P2pkh: - """Metrics tree node.""" +class SeriesTree_Addresses_Raw_P2pkh: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[P2PKHAddressIndex] = MetricPattern18(client, 'first_p2pkh_address_index') - self.bytes: MetricPattern28[P2PKHBytes] = MetricPattern28(client, 'p2pkh_bytes') + self.first_index: SeriesPattern18[P2PKHAddressIndex] = SeriesPattern18(client, 'first_p2pkh_address_index') + self.bytes: SeriesPattern28[P2PKHBytes] = SeriesPattern28(client, 'p2pkh_bytes') -class MetricsTree_Addresses_Raw_P2sh: - """Metrics tree node.""" +class SeriesTree_Addresses_Raw_P2sh: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[P2SHAddressIndex] = MetricPattern18(client, 'first_p2sh_address_index') - self.bytes: MetricPattern29[P2SHBytes] = MetricPattern29(client, 'p2sh_bytes') + self.first_index: SeriesPattern18[P2SHAddressIndex] = SeriesPattern18(client, 'first_p2sh_address_index') + self.bytes: SeriesPattern29[P2SHBytes] = SeriesPattern29(client, 'p2sh_bytes') -class MetricsTree_Addresses_Raw_P2wpkh: - """Metrics tree node.""" +class SeriesTree_Addresses_Raw_P2wpkh: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[P2WPKHAddressIndex] = MetricPattern18(client, 'first_p2wpkh_address_index') - self.bytes: MetricPattern31[P2WPKHBytes] = MetricPattern31(client, 'p2wpkh_bytes') + self.first_index: SeriesPattern18[P2WPKHAddressIndex] = SeriesPattern18(client, 'first_p2wpkh_address_index') + self.bytes: SeriesPattern31[P2WPKHBytes] = SeriesPattern31(client, 'p2wpkh_bytes') -class MetricsTree_Addresses_Raw_P2wsh: - """Metrics tree node.""" +class SeriesTree_Addresses_Raw_P2wsh: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[P2WSHAddressIndex] = MetricPattern18(client, 'first_p2wsh_address_index') - self.bytes: MetricPattern32[P2WSHBytes] = MetricPattern32(client, 'p2wsh_bytes') + self.first_index: SeriesPattern18[P2WSHAddressIndex] = SeriesPattern18(client, 'first_p2wsh_address_index') + self.bytes: SeriesPattern32[P2WSHBytes] = SeriesPattern32(client, 'p2wsh_bytes') -class MetricsTree_Addresses_Raw_P2tr: - """Metrics tree node.""" +class SeriesTree_Addresses_Raw_P2tr: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[P2TRAddressIndex] = MetricPattern18(client, 'first_p2tr_address_index') - self.bytes: MetricPattern30[P2TRBytes] = MetricPattern30(client, 'p2tr_bytes') + self.first_index: SeriesPattern18[P2TRAddressIndex] = SeriesPattern18(client, 'first_p2tr_address_index') + self.bytes: SeriesPattern30[P2TRBytes] = SeriesPattern30(client, 'p2tr_bytes') -class MetricsTree_Addresses_Raw_P2a: - """Metrics tree node.""" +class SeriesTree_Addresses_Raw_P2a: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[P2AAddressIndex] = MetricPattern18(client, 'first_p2a_address_index') - self.bytes: MetricPattern24[P2ABytes] = MetricPattern24(client, 'p2a_bytes') + self.first_index: SeriesPattern18[P2AAddressIndex] = SeriesPattern18(client, 'first_p2a_address_index') + self.bytes: SeriesPattern24[P2ABytes] = SeriesPattern24(client, 'p2a_bytes') -class MetricsTree_Addresses_Raw: - """Metrics tree node.""" +class SeriesTree_Addresses_Raw: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.p2pk65: MetricsTree_Addresses_Raw_P2pk65 = MetricsTree_Addresses_Raw_P2pk65(client) - self.p2pk33: MetricsTree_Addresses_Raw_P2pk33 = MetricsTree_Addresses_Raw_P2pk33(client) - self.p2pkh: MetricsTree_Addresses_Raw_P2pkh = MetricsTree_Addresses_Raw_P2pkh(client) - self.p2sh: MetricsTree_Addresses_Raw_P2sh = MetricsTree_Addresses_Raw_P2sh(client) - self.p2wpkh: MetricsTree_Addresses_Raw_P2wpkh = MetricsTree_Addresses_Raw_P2wpkh(client) - self.p2wsh: MetricsTree_Addresses_Raw_P2wsh = MetricsTree_Addresses_Raw_P2wsh(client) - self.p2tr: MetricsTree_Addresses_Raw_P2tr = MetricsTree_Addresses_Raw_P2tr(client) - self.p2a: MetricsTree_Addresses_Raw_P2a = MetricsTree_Addresses_Raw_P2a(client) + self.p2pk65: SeriesTree_Addresses_Raw_P2pk65 = SeriesTree_Addresses_Raw_P2pk65(client) + self.p2pk33: SeriesTree_Addresses_Raw_P2pk33 = SeriesTree_Addresses_Raw_P2pk33(client) + self.p2pkh: SeriesTree_Addresses_Raw_P2pkh = SeriesTree_Addresses_Raw_P2pkh(client) + self.p2sh: SeriesTree_Addresses_Raw_P2sh = SeriesTree_Addresses_Raw_P2sh(client) + self.p2wpkh: SeriesTree_Addresses_Raw_P2wpkh = SeriesTree_Addresses_Raw_P2wpkh(client) + self.p2wsh: SeriesTree_Addresses_Raw_P2wsh = SeriesTree_Addresses_Raw_P2wsh(client) + self.p2tr: SeriesTree_Addresses_Raw_P2tr = SeriesTree_Addresses_Raw_P2tr(client) + self.p2a: SeriesTree_Addresses_Raw_P2a = SeriesTree_Addresses_Raw_P2a(client) -class MetricsTree_Addresses_Indexes: - """Metrics tree node.""" +class SeriesTree_Addresses_Indexes: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.p2a: MetricPattern24[AnyAddressIndex] = MetricPattern24(client, 'any_address_index') - self.p2pk33: MetricPattern26[AnyAddressIndex] = MetricPattern26(client, 'any_address_index') - self.p2pk65: MetricPattern27[AnyAddressIndex] = MetricPattern27(client, 'any_address_index') - self.p2pkh: MetricPattern28[AnyAddressIndex] = MetricPattern28(client, 'any_address_index') - self.p2sh: MetricPattern29[AnyAddressIndex] = MetricPattern29(client, 'any_address_index') - self.p2tr: MetricPattern30[AnyAddressIndex] = MetricPattern30(client, 'any_address_index') - self.p2wpkh: MetricPattern31[AnyAddressIndex] = MetricPattern31(client, 'any_address_index') - self.p2wsh: MetricPattern32[AnyAddressIndex] = MetricPattern32(client, 'any_address_index') - self.funded: MetricPattern34[FundedAddressIndex] = MetricPattern34(client, 'funded_address_index') - self.empty: MetricPattern35[EmptyAddressIndex] = MetricPattern35(client, 'empty_address_index') + self.p2a: SeriesPattern24[AnyAddressIndex] = SeriesPattern24(client, 'any_address_index') + self.p2pk33: SeriesPattern26[AnyAddressIndex] = SeriesPattern26(client, 'any_address_index') + self.p2pk65: SeriesPattern27[AnyAddressIndex] = SeriesPattern27(client, 'any_address_index') + self.p2pkh: SeriesPattern28[AnyAddressIndex] = SeriesPattern28(client, 'any_address_index') + self.p2sh: SeriesPattern29[AnyAddressIndex] = SeriesPattern29(client, 'any_address_index') + self.p2tr: SeriesPattern30[AnyAddressIndex] = SeriesPattern30(client, 'any_address_index') + self.p2wpkh: SeriesPattern31[AnyAddressIndex] = SeriesPattern31(client, 'any_address_index') + self.p2wsh: SeriesPattern32[AnyAddressIndex] = SeriesPattern32(client, 'any_address_index') + self.funded: SeriesPattern34[FundedAddressIndex] = SeriesPattern34(client, 'funded_address_index') + self.empty: SeriesPattern35[EmptyAddressIndex] = SeriesPattern35(client, 'empty_address_index') -class MetricsTree_Addresses_Data: - """Metrics tree node.""" +class SeriesTree_Addresses_Data: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.funded: MetricPattern34[FundedAddressData] = MetricPattern34(client, 'funded_address_data') - self.empty: MetricPattern35[EmptyAddressData] = MetricPattern35(client, 'empty_address_data') + self.funded: SeriesPattern34[FundedAddressData] = SeriesPattern34(client, 'funded_address_data') + self.empty: SeriesPattern35[EmptyAddressData] = SeriesPattern35(client, 'empty_address_data') -class MetricsTree_Addresses_Activity: - """Metrics tree node.""" +class SeriesTree_Addresses_Activity: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.all: BothReactivatedReceivingSendingPattern = BothReactivatedReceivingSendingPattern(client, 'address_activity') @@ -3459,8 +3489,8 @@ class MetricsTree_Addresses_Activity: self.p2tr: BothReactivatedReceivingSendingPattern = BothReactivatedReceivingSendingPattern(client, 'p2tr_address_activity') self.p2a: BothReactivatedReceivingSendingPattern = BothReactivatedReceivingSendingPattern(client, 'p2a_address_activity') -class MetricsTree_Addresses_New: - """Metrics tree node.""" +class SeriesTree_Addresses_New: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.all: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'new_address_count') @@ -3473,8 +3503,8 @@ class MetricsTree_Addresses_New: 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.""" +class SeriesTree_Addresses_Delta: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.all: AbsoluteRatePattern = AbsoluteRatePattern(client, 'address_count') @@ -3487,59 +3517,59 @@ class MetricsTree_Addresses_Delta: self.p2tr: AbsoluteRatePattern = AbsoluteRatePattern(client, 'p2tr_address_count') self.p2a: AbsoluteRatePattern = AbsoluteRatePattern(client, 'p2a_address_count') -class MetricsTree_Addresses: - """Metrics tree node.""" +class SeriesTree_Addresses: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.raw: MetricsTree_Addresses_Raw = MetricsTree_Addresses_Raw(client) - self.indexes: MetricsTree_Addresses_Indexes = MetricsTree_Addresses_Indexes(client) - self.data: MetricsTree_Addresses_Data = MetricsTree_Addresses_Data(client) + self.raw: SeriesTree_Addresses_Raw = SeriesTree_Addresses_Raw(client) + self.indexes: SeriesTree_Addresses_Indexes = SeriesTree_Addresses_Indexes(client) + self.data: SeriesTree_Addresses_Data = SeriesTree_Addresses_Data(client) self.funded: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3 = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, 'address_count') self.empty: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3 = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, 'empty_address_count') - self.activity: MetricsTree_Addresses_Activity = MetricsTree_Addresses_Activity(client) + self.activity: SeriesTree_Addresses_Activity = SeriesTree_Addresses_Activity(client) self.total: AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3 = AllP2aP2pk33P2pk65P2pkhP2shP2trP2wpkhP2wshPattern3(client, 'total_address_count') - self.new: MetricsTree_Addresses_New = MetricsTree_Addresses_New(client) - self.delta: MetricsTree_Addresses_Delta = MetricsTree_Addresses_Delta(client) + self.new: SeriesTree_Addresses_New = SeriesTree_Addresses_New(client) + self.delta: SeriesTree_Addresses_Delta = SeriesTree_Addresses_Delta(client) -class MetricsTree_Scripts_Raw_Empty: - """Metrics tree node.""" +class SeriesTree_Scripts_Raw_Empty: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[EmptyOutputIndex] = MetricPattern18(client, 'first_empty_output_index') - self.to_tx_index: MetricPattern22[TxIndex] = MetricPattern22(client, 'tx_index') + self.first_index: SeriesPattern18[EmptyOutputIndex] = SeriesPattern18(client, 'first_empty_output_index') + self.to_tx_index: SeriesPattern22[TxIndex] = SeriesPattern22(client, 'tx_index') -class MetricsTree_Scripts_Raw_OpReturn: - """Metrics tree node.""" +class SeriesTree_Scripts_Raw_OpReturn: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[OpReturnIndex] = MetricPattern18(client, 'first_op_return_index') - self.to_tx_index: MetricPattern23[TxIndex] = MetricPattern23(client, 'tx_index') + self.first_index: SeriesPattern18[OpReturnIndex] = SeriesPattern18(client, 'first_op_return_index') + self.to_tx_index: SeriesPattern23[TxIndex] = SeriesPattern23(client, 'tx_index') -class MetricsTree_Scripts_Raw_P2ms: - """Metrics tree node.""" +class SeriesTree_Scripts_Raw_P2ms: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[P2MSOutputIndex] = MetricPattern18(client, 'first_p2ms_output_index') - self.to_tx_index: MetricPattern25[TxIndex] = MetricPattern25(client, 'tx_index') + self.first_index: SeriesPattern18[P2MSOutputIndex] = SeriesPattern18(client, 'first_p2ms_output_index') + self.to_tx_index: SeriesPattern25[TxIndex] = SeriesPattern25(client, 'tx_index') -class MetricsTree_Scripts_Raw_Unknown: - """Metrics tree node.""" +class SeriesTree_Scripts_Raw_Unknown: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.first_index: MetricPattern18[UnknownOutputIndex] = MetricPattern18(client, 'first_unknown_output_index') - self.to_tx_index: MetricPattern33[TxIndex] = MetricPattern33(client, 'tx_index') + self.first_index: SeriesPattern18[UnknownOutputIndex] = SeriesPattern18(client, 'first_unknown_output_index') + self.to_tx_index: SeriesPattern33[TxIndex] = SeriesPattern33(client, 'tx_index') -class MetricsTree_Scripts_Raw: - """Metrics tree node.""" +class SeriesTree_Scripts_Raw: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.empty: MetricsTree_Scripts_Raw_Empty = MetricsTree_Scripts_Raw_Empty(client) - self.op_return: MetricsTree_Scripts_Raw_OpReturn = MetricsTree_Scripts_Raw_OpReturn(client) - self.p2ms: MetricsTree_Scripts_Raw_P2ms = MetricsTree_Scripts_Raw_P2ms(client) - self.unknown: MetricsTree_Scripts_Raw_Unknown = MetricsTree_Scripts_Raw_Unknown(client) + self.empty: SeriesTree_Scripts_Raw_Empty = SeriesTree_Scripts_Raw_Empty(client) + self.op_return: SeriesTree_Scripts_Raw_OpReturn = SeriesTree_Scripts_Raw_OpReturn(client) + self.p2ms: SeriesTree_Scripts_Raw_P2ms = SeriesTree_Scripts_Raw_P2ms(client) + self.unknown: SeriesTree_Scripts_Raw_Unknown = SeriesTree_Scripts_Raw_Unknown(client) -class MetricsTree_Scripts_Count: - """Metrics tree node.""" +class SeriesTree_Scripts_Count: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.p2a: BaseCumulativeSumPattern[StoredU64] = BaseCumulativeSumPattern(client, 'p2a_count') @@ -3556,30 +3586,30 @@ class MetricsTree_Scripts_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.""" +class SeriesTree_Scripts_Value: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.op_return: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, 'op_return_value') -class MetricsTree_Scripts_Adoption: - """Metrics tree node.""" +class SeriesTree_Scripts_Adoption: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.taproot: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'taproot_adoption') self.segwit: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'segwit_adoption') -class MetricsTree_Scripts: - """Metrics tree node.""" +class SeriesTree_Scripts: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.raw: MetricsTree_Scripts_Raw = MetricsTree_Scripts_Raw(client) - self.count: MetricsTree_Scripts_Count = MetricsTree_Scripts_Count(client) - self.value: MetricsTree_Scripts_Value = MetricsTree_Scripts_Value(client) - self.adoption: MetricsTree_Scripts_Adoption = MetricsTree_Scripts_Adoption(client) + self.raw: SeriesTree_Scripts_Raw = SeriesTree_Scripts_Raw(client) + self.count: SeriesTree_Scripts_Count = SeriesTree_Scripts_Count(client) + self.value: SeriesTree_Scripts_Value = SeriesTree_Scripts_Value(client) + self.adoption: SeriesTree_Scripts_Adoption = SeriesTree_Scripts_Adoption(client) -class MetricsTree_Mining_Rewards_Subsidy: - """Metrics tree node.""" +class SeriesTree_Mining_Rewards_Subsidy: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'subsidy') @@ -3587,8 +3617,8 @@ class MetricsTree_Mining_Rewards_Subsidy: self.dominance: _1m1w1y24hBpsPercentRatioPattern = _1m1w1y24hBpsPercentRatioPattern(client, 'subsidy_dominance') self.sma_1y: CentsUsdPattern2 = CentsUsdPattern2(client, 'subsidy_sma_1y') -class MetricsTree_Mining_Rewards_Fees_RatioMultiple: - """Metrics tree node.""" +class SeriesTree_Mining_Rewards_Fees_RatioMultiple: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._24h: BpsRatioPattern2 = BpsRatioPattern2(client, 'fee_ratio_multiple_24h') @@ -3596,8 +3626,8 @@ class MetricsTree_Mining_Rewards_Fees_RatioMultiple: self._1m: BpsRatioPattern2 = BpsRatioPattern2(client, 'fee_ratio_multiple_1m') self._1y: BpsRatioPattern2 = BpsRatioPattern2(client, 'fee_ratio_multiple_1y') -class MetricsTree_Mining_Rewards_Fees: - """Metrics tree node.""" +class SeriesTree_Mining_Rewards_Fees: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'fees') @@ -3608,69 +3638,69 @@ class MetricsTree_Mining_Rewards_Fees: self._1m: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'fees_1m') self._1y: AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern = AverageMaxMedianMinPct10Pct25Pct75Pct90Pattern(client, 'fees_1y') self.dominance: _1m1w1y24hBpsPercentRatioPattern = _1m1w1y24hBpsPercentRatioPattern(client, 'fee_dominance') - self.ratio_multiple: MetricsTree_Mining_Rewards_Fees_RatioMultiple = MetricsTree_Mining_Rewards_Fees_RatioMultiple(client) + self.ratio_multiple: SeriesTree_Mining_Rewards_Fees_RatioMultiple = SeriesTree_Mining_Rewards_Fees_RatioMultiple(client) -class MetricsTree_Mining_Rewards: - """Metrics tree node.""" +class SeriesTree_Mining_Rewards: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.coinbase: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, 'coinbase') - self.subsidy: MetricsTree_Mining_Rewards_Subsidy = MetricsTree_Mining_Rewards_Subsidy(client) - self.fees: MetricsTree_Mining_Rewards_Fees = MetricsTree_Mining_Rewards_Fees(client) + self.subsidy: SeriesTree_Mining_Rewards_Subsidy = SeriesTree_Mining_Rewards_Subsidy(client) + self.fees: SeriesTree_Mining_Rewards_Fees = SeriesTree_Mining_Rewards_Fees(client) self.unclaimed: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, 'unclaimed_rewards') -class MetricsTree_Mining_Hashrate_Rate_Sma: - """Metrics tree node.""" +class SeriesTree_Mining_Hashrate_Rate_Sma: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1w: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_sma_1w') - self._1m: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_sma_1m') - self._2m: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_sma_2m') - self._1y: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_sma_1y') + self._1w: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'hash_rate_sma_1w') + self._1m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'hash_rate_sma_1m') + self._2m: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'hash_rate_sma_2m') + self._1y: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'hash_rate_sma_1y') -class MetricsTree_Mining_Hashrate_Rate: - """Metrics tree node.""" +class SeriesTree_Mining_Hashrate_Rate: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.base: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate') - self.sma: MetricsTree_Mining_Hashrate_Rate_Sma = MetricsTree_Mining_Hashrate_Rate_Sma(client) - self.ath: MetricPattern1[StoredF64] = MetricPattern1(client, 'hash_rate_ath') + self.base: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'hash_rate') + self.sma: SeriesTree_Mining_Hashrate_Rate_Sma = SeriesTree_Mining_Hashrate_Rate_Sma(client) + self.ath: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'hash_rate_ath') self.drawdown: BpsPercentRatioPattern5 = BpsPercentRatioPattern5(client, 'hash_rate_drawdown') -class MetricsTree_Mining_Hashrate: - """Metrics tree node.""" +class SeriesTree_Mining_Hashrate: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.rate: MetricsTree_Mining_Hashrate_Rate = MetricsTree_Mining_Hashrate_Rate(client) + self.rate: SeriesTree_Mining_Hashrate_Rate = SeriesTree_Mining_Hashrate_Rate(client) self.price: PhsReboundThsPattern = PhsReboundThsPattern(client, 'hash_price') self.value: PhsReboundThsPattern = PhsReboundThsPattern(client, 'hash_value') -class MetricsTree_Mining: - """Metrics tree node.""" +class SeriesTree_Mining: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.rewards: MetricsTree_Mining_Rewards = MetricsTree_Mining_Rewards(client) - self.hashrate: MetricsTree_Mining_Hashrate = MetricsTree_Mining_Hashrate(client) + self.rewards: SeriesTree_Mining_Rewards = SeriesTree_Mining_Rewards(client) + self.hashrate: SeriesTree_Mining_Hashrate = SeriesTree_Mining_Hashrate(client) -class MetricsTree_Cointime_Activity: - """Metrics tree node.""" +class SeriesTree_Cointime_Activity: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): 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') + self.liveliness: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'liveliness') + self.vaultedness: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'vaultedness') + self.ratio: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'activity_to_vaultedness_ratio') -class MetricsTree_Cointime_Supply: - """Metrics tree node.""" +class SeriesTree_Cointime_Supply: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.vaulted: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'vaulted_supply') self.active: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'active_supply') -class MetricsTree_Cointime_Value: - """Metrics tree node.""" +class SeriesTree_Cointime_Value: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.destroyed: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'cointime_value_destroyed') @@ -3678,8 +3708,8 @@ class MetricsTree_Cointime_Value: self.stored: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'cointime_value_stored') self.vocdd: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'vocdd') -class MetricsTree_Cointime_Cap: - """Metrics tree node.""" +class SeriesTree_Cointime_Cap: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.thermo: CentsUsdPattern2 = CentsUsdPattern2(client, 'thermo_cap') @@ -3689,8 +3719,8 @@ class MetricsTree_Cointime_Cap: self.cointime: CentsUsdPattern2 = CentsUsdPattern2(client, 'cointime_cap') self.aviv: BpsRatioPattern2 = BpsRatioPattern2(client, 'aviv_ratio') -class MetricsTree_Cointime_Prices: - """Metrics tree node.""" +class SeriesTree_Cointime_Prices: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.vaulted: BpsCentsPercentilesRatioSatsUsdPattern = BpsCentsPercentilesRatioSatsUsdPattern(client, 'vaulted_price') @@ -3701,347 +3731,347 @@ class MetricsTree_Cointime_Prices: self.balanced: BpsCentsPercentilesRatioSatsUsdPattern = BpsCentsPercentilesRatioSatsUsdPattern(client, 'balanced_price') self.terminal: BpsCentsPercentilesRatioSatsUsdPattern = BpsCentsPercentilesRatioSatsUsdPattern(client, 'terminal_price') self.delta: BpsCentsPercentilesRatioSatsUsdPattern = BpsCentsPercentilesRatioSatsUsdPattern(client, 'delta_price') - self.cumulative_market_cap: MetricPattern1[Dollars] = MetricPattern1(client, 'cumulative_market_cap') + self.cumulative_market_cap: SeriesPattern1[Dollars] = SeriesPattern1(client, 'cumulative_market_cap') -class MetricsTree_Cointime_Adjusted: - """Metrics tree node.""" +class SeriesTree_Cointime_Adjusted: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.inflation_rate: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'cointime_adj_inflation_rate') - self.tx_velocity_native: MetricPattern1[StoredF64] = MetricPattern1(client, 'cointime_adj_tx_velocity') - self.tx_velocity_fiat: MetricPattern1[StoredF64] = MetricPattern1(client, 'cointime_adj_tx_velocity_fiat') + self.tx_velocity_native: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'cointime_adj_tx_velocity') + self.tx_velocity_fiat: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'cointime_adj_tx_velocity_fiat') -class MetricsTree_Cointime_ReserveRisk: - """Metrics tree node.""" +class SeriesTree_Cointime_ReserveRisk: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.value: MetricPattern1[StoredF64] = MetricPattern1(client, 'reserve_risk') - self.vocdd_median_1y: MetricPattern18[StoredF64] = MetricPattern18(client, 'vocdd_median_1y') - self.hodl_bank: MetricPattern18[StoredF64] = MetricPattern18(client, 'hodl_bank') + self.value: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'reserve_risk') + self.vocdd_median_1y: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'vocdd_median_1y') + self.hodl_bank: SeriesPattern18[StoredF64] = SeriesPattern18(client, 'hodl_bank') -class MetricsTree_Cointime: - """Metrics tree node.""" +class SeriesTree_Cointime: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.activity: MetricsTree_Cointime_Activity = MetricsTree_Cointime_Activity(client) - self.supply: MetricsTree_Cointime_Supply = MetricsTree_Cointime_Supply(client) - self.value: MetricsTree_Cointime_Value = MetricsTree_Cointime_Value(client) - self.cap: MetricsTree_Cointime_Cap = MetricsTree_Cointime_Cap(client) - 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.activity: SeriesTree_Cointime_Activity = SeriesTree_Cointime_Activity(client) + self.supply: SeriesTree_Cointime_Supply = SeriesTree_Cointime_Supply(client) + self.value: SeriesTree_Cointime_Value = SeriesTree_Cointime_Value(client) + self.cap: SeriesTree_Cointime_Cap = SeriesTree_Cointime_Cap(client) + self.prices: SeriesTree_Cointime_Prices = SeriesTree_Cointime_Prices(client) + self.adjusted: SeriesTree_Cointime_Adjusted = SeriesTree_Cointime_Adjusted(client) + self.reserve_risk: SeriesTree_Cointime_ReserveRisk = SeriesTree_Cointime_ReserveRisk(client) self.coinblocks_destroyed: BaseCumulativeSumPattern[StoredF64] = BaseCumulativeSumPattern(client, 'coinblocks_destroyed') -class MetricsTree_Constants: - """Metrics tree node.""" +class SeriesTree_Constants: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._0: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_0') - self._1: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_1') - self._2: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_2') - self._3: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_3') - self._4: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_4') - self._20: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_20') - self._30: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_30') - self._38_2: MetricPattern1[StoredF32] = MetricPattern1(client, 'constant_38_2') - self._50: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_50') - self._61_8: MetricPattern1[StoredF32] = MetricPattern1(client, 'constant_61_8') - self._70: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_70') - self._80: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_80') - self._100: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_100') - self._600: MetricPattern1[StoredU16] = MetricPattern1(client, 'constant_600') - self.minus_1: MetricPattern1[StoredI8] = MetricPattern1(client, 'constant_minus_1') - self.minus_2: MetricPattern1[StoredI8] = MetricPattern1(client, 'constant_minus_2') - self.minus_3: MetricPattern1[StoredI8] = MetricPattern1(client, 'constant_minus_3') - self.minus_4: MetricPattern1[StoredI8] = MetricPattern1(client, 'constant_minus_4') + self._0: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_0') + self._1: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_1') + self._2: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_2') + self._3: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_3') + self._4: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_4') + self._20: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_20') + self._30: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_30') + self._38_2: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'constant_38_2') + self._50: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_50') + self._61_8: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'constant_61_8') + self._70: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_70') + self._80: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_80') + self._100: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_100') + self._600: SeriesPattern1[StoredU16] = SeriesPattern1(client, 'constant_600') + self.minus_1: SeriesPattern1[StoredI8] = SeriesPattern1(client, 'constant_minus_1') + self.minus_2: SeriesPattern1[StoredI8] = SeriesPattern1(client, 'constant_minus_2') + self.minus_3: SeriesPattern1[StoredI8] = SeriesPattern1(client, 'constant_minus_3') + self.minus_4: SeriesPattern1[StoredI8] = SeriesPattern1(client, 'constant_minus_4') -class MetricsTree_Indexes_Address_P2pk33: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_P2pk33: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern26[P2PK33AddressIndex] = MetricPattern26(client, 'p2pk33_address_index') - self.address: MetricPattern26[Address] = MetricPattern26(client, 'p2pk33_address') + self.identity: SeriesPattern26[P2PK33AddressIndex] = SeriesPattern26(client, 'p2pk33_address_index') + self.address: SeriesPattern26[Address] = SeriesPattern26(client, 'p2pk33_address') -class MetricsTree_Indexes_Address_P2pk65: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_P2pk65: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern27[P2PK65AddressIndex] = MetricPattern27(client, 'p2pk65_address_index') - self.address: MetricPattern27[Address] = MetricPattern27(client, 'p2pk65_address') + self.identity: SeriesPattern27[P2PK65AddressIndex] = SeriesPattern27(client, 'p2pk65_address_index') + self.address: SeriesPattern27[Address] = SeriesPattern27(client, 'p2pk65_address') -class MetricsTree_Indexes_Address_P2pkh: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_P2pkh: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern28[P2PKHAddressIndex] = MetricPattern28(client, 'p2pkh_address_index') - self.address: MetricPattern28[Address] = MetricPattern28(client, 'p2pkh_address') + self.identity: SeriesPattern28[P2PKHAddressIndex] = SeriesPattern28(client, 'p2pkh_address_index') + self.address: SeriesPattern28[Address] = SeriesPattern28(client, 'p2pkh_address') -class MetricsTree_Indexes_Address_P2sh: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_P2sh: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern29[P2SHAddressIndex] = MetricPattern29(client, 'p2sh_address_index') - self.address: MetricPattern29[Address] = MetricPattern29(client, 'p2sh_address') + self.identity: SeriesPattern29[P2SHAddressIndex] = SeriesPattern29(client, 'p2sh_address_index') + self.address: SeriesPattern29[Address] = SeriesPattern29(client, 'p2sh_address') -class MetricsTree_Indexes_Address_P2tr: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_P2tr: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern30[P2TRAddressIndex] = MetricPattern30(client, 'p2tr_address_index') - self.address: MetricPattern30[Address] = MetricPattern30(client, 'p2tr_address') + self.identity: SeriesPattern30[P2TRAddressIndex] = SeriesPattern30(client, 'p2tr_address_index') + self.address: SeriesPattern30[Address] = SeriesPattern30(client, 'p2tr_address') -class MetricsTree_Indexes_Address_P2wpkh: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_P2wpkh: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern31[P2WPKHAddressIndex] = MetricPattern31(client, 'p2wpkh_address_index') - self.address: MetricPattern31[Address] = MetricPattern31(client, 'p2wpkh_address') + self.identity: SeriesPattern31[P2WPKHAddressIndex] = SeriesPattern31(client, 'p2wpkh_address_index') + self.address: SeriesPattern31[Address] = SeriesPattern31(client, 'p2wpkh_address') -class MetricsTree_Indexes_Address_P2wsh: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_P2wsh: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern32[P2WSHAddressIndex] = MetricPattern32(client, 'p2wsh_address_index') - self.address: MetricPattern32[Address] = MetricPattern32(client, 'p2wsh_address') + self.identity: SeriesPattern32[P2WSHAddressIndex] = SeriesPattern32(client, 'p2wsh_address_index') + self.address: SeriesPattern32[Address] = SeriesPattern32(client, 'p2wsh_address') -class MetricsTree_Indexes_Address_P2a: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_P2a: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern24[P2AAddressIndex] = MetricPattern24(client, 'p2a_address_index') - self.address: MetricPattern24[Address] = MetricPattern24(client, 'p2a_address') + self.identity: SeriesPattern24[P2AAddressIndex] = SeriesPattern24(client, 'p2a_address_index') + self.address: SeriesPattern24[Address] = SeriesPattern24(client, 'p2a_address') -class MetricsTree_Indexes_Address_P2ms: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_P2ms: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern25[P2MSOutputIndex] = MetricPattern25(client, 'p2ms_output_index') + self.identity: SeriesPattern25[P2MSOutputIndex] = SeriesPattern25(client, 'p2ms_output_index') -class MetricsTree_Indexes_Address_Empty: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_Empty: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern22[EmptyOutputIndex] = MetricPattern22(client, 'empty_output_index') + self.identity: SeriesPattern22[EmptyOutputIndex] = SeriesPattern22(client, 'empty_output_index') -class MetricsTree_Indexes_Address_Unknown: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_Unknown: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern33[UnknownOutputIndex] = MetricPattern33(client, 'unknown_output_index') + self.identity: SeriesPattern33[UnknownOutputIndex] = SeriesPattern33(client, 'unknown_output_index') -class MetricsTree_Indexes_Address_OpReturn: - """Metrics tree node.""" +class SeriesTree_Indexes_Address_OpReturn: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern23[OpReturnIndex] = MetricPattern23(client, 'op_return_index') + self.identity: SeriesPattern23[OpReturnIndex] = SeriesPattern23(client, 'op_return_index') -class MetricsTree_Indexes_Address: - """Metrics tree node.""" +class SeriesTree_Indexes_Address: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.p2pk33: MetricsTree_Indexes_Address_P2pk33 = MetricsTree_Indexes_Address_P2pk33(client) - self.p2pk65: MetricsTree_Indexes_Address_P2pk65 = MetricsTree_Indexes_Address_P2pk65(client) - self.p2pkh: MetricsTree_Indexes_Address_P2pkh = MetricsTree_Indexes_Address_P2pkh(client) - self.p2sh: MetricsTree_Indexes_Address_P2sh = MetricsTree_Indexes_Address_P2sh(client) - self.p2tr: MetricsTree_Indexes_Address_P2tr = MetricsTree_Indexes_Address_P2tr(client) - self.p2wpkh: MetricsTree_Indexes_Address_P2wpkh = MetricsTree_Indexes_Address_P2wpkh(client) - self.p2wsh: MetricsTree_Indexes_Address_P2wsh = MetricsTree_Indexes_Address_P2wsh(client) - self.p2a: MetricsTree_Indexes_Address_P2a = MetricsTree_Indexes_Address_P2a(client) - self.p2ms: MetricsTree_Indexes_Address_P2ms = MetricsTree_Indexes_Address_P2ms(client) - self.empty: MetricsTree_Indexes_Address_Empty = MetricsTree_Indexes_Address_Empty(client) - self.unknown: MetricsTree_Indexes_Address_Unknown = MetricsTree_Indexes_Address_Unknown(client) - self.op_return: MetricsTree_Indexes_Address_OpReturn = MetricsTree_Indexes_Address_OpReturn(client) + self.p2pk33: SeriesTree_Indexes_Address_P2pk33 = SeriesTree_Indexes_Address_P2pk33(client) + self.p2pk65: SeriesTree_Indexes_Address_P2pk65 = SeriesTree_Indexes_Address_P2pk65(client) + self.p2pkh: SeriesTree_Indexes_Address_P2pkh = SeriesTree_Indexes_Address_P2pkh(client) + self.p2sh: SeriesTree_Indexes_Address_P2sh = SeriesTree_Indexes_Address_P2sh(client) + self.p2tr: SeriesTree_Indexes_Address_P2tr = SeriesTree_Indexes_Address_P2tr(client) + self.p2wpkh: SeriesTree_Indexes_Address_P2wpkh = SeriesTree_Indexes_Address_P2wpkh(client) + self.p2wsh: SeriesTree_Indexes_Address_P2wsh = SeriesTree_Indexes_Address_P2wsh(client) + self.p2a: SeriesTree_Indexes_Address_P2a = SeriesTree_Indexes_Address_P2a(client) + self.p2ms: SeriesTree_Indexes_Address_P2ms = SeriesTree_Indexes_Address_P2ms(client) + self.empty: SeriesTree_Indexes_Address_Empty = SeriesTree_Indexes_Address_Empty(client) + self.unknown: SeriesTree_Indexes_Address_Unknown = SeriesTree_Indexes_Address_Unknown(client) + self.op_return: SeriesTree_Indexes_Address_OpReturn = SeriesTree_Indexes_Address_OpReturn(client) -class MetricsTree_Indexes_Height: - """Metrics tree node.""" +class SeriesTree_Indexes_Height: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern18[Height] = MetricPattern18(client, 'height') - self.minute10: MetricPattern18[Minute10] = MetricPattern18(client, 'minute10') - self.minute30: MetricPattern18[Minute30] = MetricPattern18(client, 'minute30') - self.hour1: MetricPattern18[Hour1] = MetricPattern18(client, 'hour1') - self.hour4: MetricPattern18[Hour4] = MetricPattern18(client, 'hour4') - self.hour12: MetricPattern18[Hour12] = MetricPattern18(client, 'hour12') - self.day1: MetricPattern18[Day1] = MetricPattern18(client, 'day1') - self.day3: MetricPattern18[Day3] = MetricPattern18(client, 'day3') - self.epoch: MetricPattern18[Epoch] = MetricPattern18(client, 'epoch') - self.halving: MetricPattern18[Halving] = MetricPattern18(client, 'halving') - self.week1: MetricPattern18[Week1] = MetricPattern18(client, 'week1') - self.month1: MetricPattern18[Month1] = MetricPattern18(client, 'month1') - self.month3: MetricPattern18[Month3] = MetricPattern18(client, 'month3') - self.month6: MetricPattern18[Month6] = MetricPattern18(client, 'month6') - self.year1: MetricPattern18[Year1] = MetricPattern18(client, 'year1') - self.year10: MetricPattern18[Year10] = MetricPattern18(client, 'year10') - self.tx_index_count: MetricPattern18[StoredU64] = MetricPattern18(client, 'tx_index_count') + self.identity: SeriesPattern18[Height] = SeriesPattern18(client, 'height') + self.minute10: SeriesPattern18[Minute10] = SeriesPattern18(client, 'minute10') + self.minute30: SeriesPattern18[Minute30] = SeriesPattern18(client, 'minute30') + self.hour1: SeriesPattern18[Hour1] = SeriesPattern18(client, 'hour1') + self.hour4: SeriesPattern18[Hour4] = SeriesPattern18(client, 'hour4') + self.hour12: SeriesPattern18[Hour12] = SeriesPattern18(client, 'hour12') + self.day1: SeriesPattern18[Day1] = SeriesPattern18(client, 'day1') + self.day3: SeriesPattern18[Day3] = SeriesPattern18(client, 'day3') + self.epoch: SeriesPattern18[Epoch] = SeriesPattern18(client, 'epoch') + self.halving: SeriesPattern18[Halving] = SeriesPattern18(client, 'halving') + self.week1: SeriesPattern18[Week1] = SeriesPattern18(client, 'week1') + self.month1: SeriesPattern18[Month1] = SeriesPattern18(client, 'month1') + self.month3: SeriesPattern18[Month3] = SeriesPattern18(client, 'month3') + self.month6: SeriesPattern18[Month6] = SeriesPattern18(client, 'month6') + self.year1: SeriesPattern18[Year1] = SeriesPattern18(client, 'year1') + self.year10: SeriesPattern18[Year10] = SeriesPattern18(client, 'year10') + self.tx_index_count: SeriesPattern18[StoredU64] = SeriesPattern18(client, 'tx_index_count') -class MetricsTree_Indexes_Epoch: - """Metrics tree node.""" +class SeriesTree_Indexes_Epoch: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern17[Epoch] = MetricPattern17(client, 'epoch') - self.first_height: MetricPattern17[Height] = MetricPattern17(client, 'first_height') - self.height_count: MetricPattern17[StoredU64] = MetricPattern17(client, 'height_count') + self.identity: SeriesPattern17[Epoch] = SeriesPattern17(client, 'epoch') + self.first_height: SeriesPattern17[Height] = SeriesPattern17(client, 'first_height') + self.height_count: SeriesPattern17[StoredU64] = SeriesPattern17(client, 'height_count') -class MetricsTree_Indexes_Halving: - """Metrics tree node.""" +class SeriesTree_Indexes_Halving: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern16[Halving] = MetricPattern16(client, 'halving') - self.first_height: MetricPattern16[Height] = MetricPattern16(client, 'first_height') + self.identity: SeriesPattern16[Halving] = SeriesPattern16(client, 'halving') + self.first_height: SeriesPattern16[Height] = SeriesPattern16(client, 'first_height') -class MetricsTree_Indexes_Minute10: - """Metrics tree node.""" +class SeriesTree_Indexes_Minute10: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern3[Minute10] = MetricPattern3(client, 'minute10_index') - self.first_height: MetricPattern3[Height] = MetricPattern3(client, 'first_height') + self.identity: SeriesPattern3[Minute10] = SeriesPattern3(client, 'minute10_index') + self.first_height: SeriesPattern3[Height] = SeriesPattern3(client, 'first_height') -class MetricsTree_Indexes_Minute30: - """Metrics tree node.""" +class SeriesTree_Indexes_Minute30: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern4[Minute30] = MetricPattern4(client, 'minute30_index') - self.first_height: MetricPattern4[Height] = MetricPattern4(client, 'first_height') + self.identity: SeriesPattern4[Minute30] = SeriesPattern4(client, 'minute30_index') + self.first_height: SeriesPattern4[Height] = SeriesPattern4(client, 'first_height') -class MetricsTree_Indexes_Hour1: - """Metrics tree node.""" +class SeriesTree_Indexes_Hour1: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern5[Hour1] = MetricPattern5(client, 'hour1_index') - self.first_height: MetricPattern5[Height] = MetricPattern5(client, 'first_height') + self.identity: SeriesPattern5[Hour1] = SeriesPattern5(client, 'hour1_index') + self.first_height: SeriesPattern5[Height] = SeriesPattern5(client, 'first_height') -class MetricsTree_Indexes_Hour4: - """Metrics tree node.""" +class SeriesTree_Indexes_Hour4: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern6[Hour4] = MetricPattern6(client, 'hour4_index') - self.first_height: MetricPattern6[Height] = MetricPattern6(client, 'first_height') + self.identity: SeriesPattern6[Hour4] = SeriesPattern6(client, 'hour4_index') + self.first_height: SeriesPattern6[Height] = SeriesPattern6(client, 'first_height') -class MetricsTree_Indexes_Hour12: - """Metrics tree node.""" +class SeriesTree_Indexes_Hour12: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern7[Hour12] = MetricPattern7(client, 'hour12_index') - self.first_height: MetricPattern7[Height] = MetricPattern7(client, 'first_height') + self.identity: SeriesPattern7[Hour12] = SeriesPattern7(client, 'hour12_index') + self.first_height: SeriesPattern7[Height] = SeriesPattern7(client, 'first_height') -class MetricsTree_Indexes_Day1: - """Metrics tree node.""" +class SeriesTree_Indexes_Day1: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern8[Day1] = MetricPattern8(client, 'day1_index') - self.date: MetricPattern8[Date] = MetricPattern8(client, 'date') - self.first_height: MetricPattern8[Height] = MetricPattern8(client, 'first_height') - self.height_count: MetricPattern8[StoredU64] = MetricPattern8(client, 'height_count') + self.identity: SeriesPattern8[Day1] = SeriesPattern8(client, 'day1_index') + self.date: SeriesPattern8[Date] = SeriesPattern8(client, 'date') + self.first_height: SeriesPattern8[Height] = SeriesPattern8(client, 'first_height') + self.height_count: SeriesPattern8[StoredU64] = SeriesPattern8(client, 'height_count') -class MetricsTree_Indexes_Day3: - """Metrics tree node.""" +class SeriesTree_Indexes_Day3: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern9[Day3] = MetricPattern9(client, 'day3_index') - self.first_height: MetricPattern9[Height] = MetricPattern9(client, 'first_height') + self.identity: SeriesPattern9[Day3] = SeriesPattern9(client, 'day3_index') + self.first_height: SeriesPattern9[Height] = SeriesPattern9(client, 'first_height') -class MetricsTree_Indexes_Week1: - """Metrics tree node.""" +class SeriesTree_Indexes_Week1: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern10[Week1] = MetricPattern10(client, 'week1_index') - self.date: MetricPattern10[Date] = MetricPattern10(client, 'date') - self.first_height: MetricPattern10[Height] = MetricPattern10(client, 'first_height') + self.identity: SeriesPattern10[Week1] = SeriesPattern10(client, 'week1_index') + self.date: SeriesPattern10[Date] = SeriesPattern10(client, 'date') + self.first_height: SeriesPattern10[Height] = SeriesPattern10(client, 'first_height') -class MetricsTree_Indexes_Month1: - """Metrics tree node.""" +class SeriesTree_Indexes_Month1: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern11[Month1] = MetricPattern11(client, 'month1_index') - self.date: MetricPattern11[Date] = MetricPattern11(client, 'date') - self.first_height: MetricPattern11[Height] = MetricPattern11(client, 'first_height') + self.identity: SeriesPattern11[Month1] = SeriesPattern11(client, 'month1_index') + self.date: SeriesPattern11[Date] = SeriesPattern11(client, 'date') + self.first_height: SeriesPattern11[Height] = SeriesPattern11(client, 'first_height') -class MetricsTree_Indexes_Month3: - """Metrics tree node.""" +class SeriesTree_Indexes_Month3: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern12[Month3] = MetricPattern12(client, 'month3_index') - self.date: MetricPattern12[Date] = MetricPattern12(client, 'date') - self.first_height: MetricPattern12[Height] = MetricPattern12(client, 'first_height') + self.identity: SeriesPattern12[Month3] = SeriesPattern12(client, 'month3_index') + self.date: SeriesPattern12[Date] = SeriesPattern12(client, 'date') + self.first_height: SeriesPattern12[Height] = SeriesPattern12(client, 'first_height') -class MetricsTree_Indexes_Month6: - """Metrics tree node.""" +class SeriesTree_Indexes_Month6: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern13[Month6] = MetricPattern13(client, 'month6_index') - self.date: MetricPattern13[Date] = MetricPattern13(client, 'date') - self.first_height: MetricPattern13[Height] = MetricPattern13(client, 'first_height') + self.identity: SeriesPattern13[Month6] = SeriesPattern13(client, 'month6_index') + self.date: SeriesPattern13[Date] = SeriesPattern13(client, 'date') + self.first_height: SeriesPattern13[Height] = SeriesPattern13(client, 'first_height') -class MetricsTree_Indexes_Year1: - """Metrics tree node.""" +class SeriesTree_Indexes_Year1: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern14[Year1] = MetricPattern14(client, 'year1_index') - self.date: MetricPattern14[Date] = MetricPattern14(client, 'date') - self.first_height: MetricPattern14[Height] = MetricPattern14(client, 'first_height') + self.identity: SeriesPattern14[Year1] = SeriesPattern14(client, 'year1_index') + self.date: SeriesPattern14[Date] = SeriesPattern14(client, 'date') + self.first_height: SeriesPattern14[Height] = SeriesPattern14(client, 'first_height') -class MetricsTree_Indexes_Year10: - """Metrics tree node.""" +class SeriesTree_Indexes_Year10: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern15[Year10] = MetricPattern15(client, 'year10_index') - self.date: MetricPattern15[Date] = MetricPattern15(client, 'date') - self.first_height: MetricPattern15[Height] = MetricPattern15(client, 'first_height') + self.identity: SeriesPattern15[Year10] = SeriesPattern15(client, 'year10_index') + self.date: SeriesPattern15[Date] = SeriesPattern15(client, 'date') + self.first_height: SeriesPattern15[Height] = SeriesPattern15(client, 'first_height') -class MetricsTree_Indexes_TxIndex: - """Metrics tree node.""" +class SeriesTree_Indexes_TxIndex: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern19[TxIndex] = MetricPattern19(client, 'tx_index') - self.input_count: MetricPattern19[StoredU64] = MetricPattern19(client, 'input_count') - self.output_count: MetricPattern19[StoredU64] = MetricPattern19(client, 'output_count') + self.identity: SeriesPattern19[TxIndex] = SeriesPattern19(client, 'tx_index') + self.input_count: SeriesPattern19[StoredU64] = SeriesPattern19(client, 'input_count') + self.output_count: SeriesPattern19[StoredU64] = SeriesPattern19(client, 'output_count') -class MetricsTree_Indexes_TxinIndex: - """Metrics tree node.""" +class SeriesTree_Indexes_TxinIndex: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern20[TxInIndex] = MetricPattern20(client, 'txin_index') + self.identity: SeriesPattern20[TxInIndex] = SeriesPattern20(client, 'txin_index') -class MetricsTree_Indexes_TxoutIndex: - """Metrics tree node.""" +class SeriesTree_Indexes_TxoutIndex: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.identity: MetricPattern21[TxOutIndex] = MetricPattern21(client, 'txout_index') + self.identity: SeriesPattern21[TxOutIndex] = SeriesPattern21(client, 'txout_index') -class MetricsTree_Indexes: - """Metrics tree node.""" +class SeriesTree_Indexes: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.address: MetricsTree_Indexes_Address = MetricsTree_Indexes_Address(client) - self.height: MetricsTree_Indexes_Height = MetricsTree_Indexes_Height(client) - self.epoch: MetricsTree_Indexes_Epoch = MetricsTree_Indexes_Epoch(client) - self.halving: MetricsTree_Indexes_Halving = MetricsTree_Indexes_Halving(client) - self.minute10: MetricsTree_Indexes_Minute10 = MetricsTree_Indexes_Minute10(client) - self.minute30: MetricsTree_Indexes_Minute30 = MetricsTree_Indexes_Minute30(client) - self.hour1: MetricsTree_Indexes_Hour1 = MetricsTree_Indexes_Hour1(client) - self.hour4: MetricsTree_Indexes_Hour4 = MetricsTree_Indexes_Hour4(client) - self.hour12: MetricsTree_Indexes_Hour12 = MetricsTree_Indexes_Hour12(client) - self.day1: MetricsTree_Indexes_Day1 = MetricsTree_Indexes_Day1(client) - self.day3: MetricsTree_Indexes_Day3 = MetricsTree_Indexes_Day3(client) - self.week1: MetricsTree_Indexes_Week1 = MetricsTree_Indexes_Week1(client) - self.month1: MetricsTree_Indexes_Month1 = MetricsTree_Indexes_Month1(client) - self.month3: MetricsTree_Indexes_Month3 = MetricsTree_Indexes_Month3(client) - self.month6: MetricsTree_Indexes_Month6 = MetricsTree_Indexes_Month6(client) - self.year1: MetricsTree_Indexes_Year1 = MetricsTree_Indexes_Year1(client) - self.year10: MetricsTree_Indexes_Year10 = MetricsTree_Indexes_Year10(client) - self.tx_index: MetricsTree_Indexes_TxIndex = MetricsTree_Indexes_TxIndex(client) - self.txin_index: MetricsTree_Indexes_TxinIndex = MetricsTree_Indexes_TxinIndex(client) - self.txout_index: MetricsTree_Indexes_TxoutIndex = MetricsTree_Indexes_TxoutIndex(client) + self.address: SeriesTree_Indexes_Address = SeriesTree_Indexes_Address(client) + self.height: SeriesTree_Indexes_Height = SeriesTree_Indexes_Height(client) + self.epoch: SeriesTree_Indexes_Epoch = SeriesTree_Indexes_Epoch(client) + self.halving: SeriesTree_Indexes_Halving = SeriesTree_Indexes_Halving(client) + self.minute10: SeriesTree_Indexes_Minute10 = SeriesTree_Indexes_Minute10(client) + self.minute30: SeriesTree_Indexes_Minute30 = SeriesTree_Indexes_Minute30(client) + self.hour1: SeriesTree_Indexes_Hour1 = SeriesTree_Indexes_Hour1(client) + self.hour4: SeriesTree_Indexes_Hour4 = SeriesTree_Indexes_Hour4(client) + self.hour12: SeriesTree_Indexes_Hour12 = SeriesTree_Indexes_Hour12(client) + self.day1: SeriesTree_Indexes_Day1 = SeriesTree_Indexes_Day1(client) + self.day3: SeriesTree_Indexes_Day3 = SeriesTree_Indexes_Day3(client) + self.week1: SeriesTree_Indexes_Week1 = SeriesTree_Indexes_Week1(client) + self.month1: SeriesTree_Indexes_Month1 = SeriesTree_Indexes_Month1(client) + self.month3: SeriesTree_Indexes_Month3 = SeriesTree_Indexes_Month3(client) + self.month6: SeriesTree_Indexes_Month6 = SeriesTree_Indexes_Month6(client) + self.year1: SeriesTree_Indexes_Year1 = SeriesTree_Indexes_Year1(client) + self.year10: SeriesTree_Indexes_Year10 = SeriesTree_Indexes_Year10(client) + self.tx_index: SeriesTree_Indexes_TxIndex = SeriesTree_Indexes_TxIndex(client) + self.txin_index: SeriesTree_Indexes_TxinIndex = SeriesTree_Indexes_TxinIndex(client) + self.txout_index: SeriesTree_Indexes_TxoutIndex = SeriesTree_Indexes_TxoutIndex(client) -class MetricsTree_Indicators_Dormancy: - """Metrics tree node.""" +class SeriesTree_Indicators_Dormancy: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.supply_adjusted: MetricPattern1[StoredF32] = MetricPattern1(client, 'dormancy_supply_adjusted') - self.flow: MetricPattern1[StoredF32] = MetricPattern1(client, 'dormancy_flow') + self.supply_adjusted: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'dormancy_supply_adjusted') + self.flow: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'dormancy_flow') -class MetricsTree_Indicators: - """Metrics tree node.""" +class SeriesTree_Indicators: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.puell_multiple: BpsRatioPattern2 = BpsRatioPattern2(client, 'puell_multiple') @@ -4049,25 +4079,25 @@ class MetricsTree_Indicators: self.gini: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'gini') self.rhodl_ratio: BpsRatioPattern2 = BpsRatioPattern2(client, 'rhodl_ratio') self.thermocap_multiple: BpsRatioPattern2 = BpsRatioPattern2(client, 'thermocap_multiple') - self.coindays_destroyed_supply_adjusted: MetricPattern1[StoredF32] = MetricPattern1(client, 'coindays_destroyed_supply_adjusted') - self.coinyears_destroyed_supply_adjusted: MetricPattern1[StoredF32] = MetricPattern1(client, 'coinyears_destroyed_supply_adjusted') - self.dormancy: MetricsTree_Indicators_Dormancy = MetricsTree_Indicators_Dormancy(client) - self.stock_to_flow: MetricPattern1[StoredF32] = MetricPattern1(client, 'stock_to_flow') - self.seller_exhaustion_constant: MetricPattern1[StoredF32] = MetricPattern1(client, 'seller_exhaustion_constant') + self.coindays_destroyed_supply_adjusted: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'coindays_destroyed_supply_adjusted') + self.coinyears_destroyed_supply_adjusted: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'coinyears_destroyed_supply_adjusted') + self.dormancy: SeriesTree_Indicators_Dormancy = SeriesTree_Indicators_Dormancy(client) + self.stock_to_flow: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'stock_to_flow') + self.seller_exhaustion_constant: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'seller_exhaustion_constant') -class MetricsTree_Market_Ath: - """Metrics tree node.""" +class SeriesTree_Market_Ath: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.high: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_ath') self.drawdown: BpsPercentRatioPattern5 = BpsPercentRatioPattern5(client, 'price_drawdown') - self.days_since: MetricPattern1[StoredF32] = MetricPattern1(client, 'days_since_price_ath') - self.years_since: MetricPattern1[StoredF32] = MetricPattern1(client, 'years_since_price_ath') - self.max_days_between: MetricPattern1[StoredF32] = MetricPattern1(client, 'max_days_between_price_ath') - self.max_years_between: MetricPattern1[StoredF32] = MetricPattern1(client, 'max_years_between_price_ath') + self.days_since: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'days_since_price_ath') + self.years_since: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'years_since_price_ath') + self.max_days_between: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'max_days_between_price_ath') + self.max_years_between: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'max_years_between_price_ath') -class MetricsTree_Market_Lookback: - """Metrics tree node.""" +class SeriesTree_Market_Lookback: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._24h: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_24h') @@ -4084,8 +4114,8 @@ class MetricsTree_Market_Lookback: self._8y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_8y') self._10y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_lookback_10y') -class MetricsTree_Market_Returns_Periods: - """Metrics tree node.""" +class SeriesTree_Market_Returns_Periods: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._24h: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_24h') @@ -4102,86 +4132,86 @@ class MetricsTree_Market_Returns_Periods: self._8y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_8y') self._10y: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'price_return_10y') -class MetricsTree_Market_Returns_Sd24h_1w: - """Metrics tree node.""" +class SeriesTree_Market_Returns_Sd24h_1w: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sma_1w') - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sd_1w') + self.sma: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_return_24h_sma_1w') + self.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_return_24h_sd_1w') -class MetricsTree_Market_Returns_Sd24h_1m: - """Metrics tree node.""" +class SeriesTree_Market_Returns_Sd24h_1m: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sma_1m') - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sd_1m') + self.sma: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_return_24h_sma_1m') + self.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_return_24h_sd_1m') -class MetricsTree_Market_Returns_Sd24h_1y: - """Metrics tree node.""" +class SeriesTree_Market_Returns_Sd24h_1y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sma: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sma_1y') - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_return_24h_sd_1y') + self.sma: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_return_24h_sma_1y') + self.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_return_24h_sd_1y') -class MetricsTree_Market_Returns_Sd24h: - """Metrics tree node.""" +class SeriesTree_Market_Returns_Sd24h: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1w: MetricsTree_Market_Returns_Sd24h_1w = MetricsTree_Market_Returns_Sd24h_1w(client) - self._1m: MetricsTree_Market_Returns_Sd24h_1m = MetricsTree_Market_Returns_Sd24h_1m(client) - self._1y: MetricsTree_Market_Returns_Sd24h_1y = MetricsTree_Market_Returns_Sd24h_1y(client) + self._1w: SeriesTree_Market_Returns_Sd24h_1w = SeriesTree_Market_Returns_Sd24h_1w(client) + self._1m: SeriesTree_Market_Returns_Sd24h_1m = SeriesTree_Market_Returns_Sd24h_1m(client) + self._1y: SeriesTree_Market_Returns_Sd24h_1y = SeriesTree_Market_Returns_Sd24h_1y(client) -class MetricsTree_Market_Returns: - """Metrics tree node.""" +class SeriesTree_Market_Returns: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.periods: MetricsTree_Market_Returns_Periods = MetricsTree_Market_Returns_Periods(client) + self.periods: SeriesTree_Market_Returns_Periods = SeriesTree_Market_Returns_Periods(client) self.cagr: _10y2y3y4y5y6y8yPattern = _10y2y3y4y5y6y8yPattern(client, 'price_cagr') - self.sd_24h: MetricsTree_Market_Returns_Sd24h = MetricsTree_Market_Returns_Sd24h(client) + self.sd_24h: SeriesTree_Market_Returns_Sd24h = SeriesTree_Market_Returns_Sd24h(client) -class MetricsTree_Market_Volatility: - """Metrics tree node.""" +class SeriesTree_Market_Volatility: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._1w: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_volatility_1w') - self._1m: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_volatility_1m') - self._1y: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_volatility_1y') + self._1w: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_volatility_1w') + self._1m: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_volatility_1m') + self._1y: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_volatility_1y') -class MetricsTree_Market_Range: - """Metrics tree node.""" +class SeriesTree_Market_Range: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.min: _1m1w1y2wPattern = _1m1w1y2wPattern(client, 'price_min') self.max: _1m1w1y2wPattern = _1m1w1y2wPattern(client, 'price_max') - self.true_range: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_true_range') - self.true_range_sum_2w: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_true_range_sum_2w') + self.true_range: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_true_range') + self.true_range_sum_2w: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_true_range_sum_2w') self.choppiness_index_2w: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'price_choppiness_index_2w') -class MetricsTree_Market_MovingAverage_Sma_200d: - """Metrics tree node.""" +class SeriesTree_Market_MovingAverage_Sma_200d: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, 'price_sma_200d') - self.cents: MetricPattern1[Cents] = MetricPattern1(client, 'price_sma_200d_cents') - self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, 'price_sma_200d_sats') - self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, 'price_sma_200d_ratio_bps') - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_sma_200d_ratio') + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'price_sma_200d') + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'price_sma_200d_cents') + self.sats: SeriesPattern1[SatsFract] = SeriesPattern1(client, 'price_sma_200d_sats') + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, 'price_sma_200d_ratio_bps') + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_sma_200d_ratio') self.x2_4: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_sma_200d_x2_4') self.x0_8: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_sma_200d_x0_8') -class MetricsTree_Market_MovingAverage_Sma_350d: - """Metrics tree node.""" +class SeriesTree_Market_MovingAverage_Sma_350d: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, 'price_sma_350d') - self.cents: MetricPattern1[Cents] = MetricPattern1(client, 'price_sma_350d_cents') - self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, 'price_sma_350d_sats') - self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, 'price_sma_350d_ratio_bps') - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, 'price_sma_350d_ratio') + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'price_sma_350d') + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'price_sma_350d_cents') + self.sats: SeriesPattern1[SatsFract] = SeriesPattern1(client, 'price_sma_350d_sats') + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, 'price_sma_350d_ratio_bps') + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'price_sma_350d_ratio') self.x2: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'price_sma_350d_x2') -class MetricsTree_Market_MovingAverage_Sma: - """Metrics tree node.""" +class SeriesTree_Market_MovingAverage_Sma: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._1w: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_sma_1w') @@ -4194,15 +4224,15 @@ class MetricsTree_Market_MovingAverage_Sma: self._89d: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_sma_89d') self._111d: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_sma_111d') self._144d: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_sma_144d') - self._200d: MetricsTree_Market_MovingAverage_Sma_200d = MetricsTree_Market_MovingAverage_Sma_200d(client) - self._350d: MetricsTree_Market_MovingAverage_Sma_350d = MetricsTree_Market_MovingAverage_Sma_350d(client) + self._200d: SeriesTree_Market_MovingAverage_Sma_200d = SeriesTree_Market_MovingAverage_Sma_200d(client) + self._350d: SeriesTree_Market_MovingAverage_Sma_350d = SeriesTree_Market_MovingAverage_Sma_350d(client) self._1y: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_sma_1y') self._2y: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_sma_2y') self._200w: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_sma_200w') self._4y: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_sma_4y') -class MetricsTree_Market_MovingAverage_Ema: - """Metrics tree node.""" +class SeriesTree_Market_MovingAverage_Ema: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._1w: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_ema_1w') @@ -4222,15 +4252,15 @@ class MetricsTree_Market_MovingAverage_Ema: self._200w: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_ema_200w') self._4y: BpsCentsRatioSatsUsdPattern = BpsCentsRatioSatsUsdPattern(client, 'price_ema_4y') -class MetricsTree_Market_MovingAverage: - """Metrics tree node.""" +class SeriesTree_Market_MovingAverage: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sma: MetricsTree_Market_MovingAverage_Sma = MetricsTree_Market_MovingAverage_Sma(client) - self.ema: MetricsTree_Market_MovingAverage_Ema = MetricsTree_Market_MovingAverage_Ema(client) + self.sma: SeriesTree_Market_MovingAverage_Sma = SeriesTree_Market_MovingAverage_Sma(client) + self.ema: SeriesTree_Market_MovingAverage_Ema = SeriesTree_Market_MovingAverage_Ema(client) -class MetricsTree_Market_Dca_Period_CostBasis: - """Metrics tree node.""" +class SeriesTree_Market_Dca_Period_CostBasis: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._1w: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_1w') @@ -4246,19 +4276,19 @@ class MetricsTree_Market_Dca_Period_CostBasis: self._8y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_8y') self._10y: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_10y') -class MetricsTree_Market_Dca_Period: - """Metrics tree node.""" +class SeriesTree_Market_Dca_Period: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, 'dca_stack') - self.cost_basis: MetricsTree_Market_Dca_Period_CostBasis = MetricsTree_Market_Dca_Period_CostBasis(client) + self.cost_basis: SeriesTree_Market_Dca_Period_CostBasis = SeriesTree_Market_Dca_Period_CostBasis(client) self.return_: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, 'dca_return') self.cagr: _10y2y3y4y5y6y8yPattern = _10y2y3y4y5y6y8yPattern(client, 'dca_cagr') self.lump_sum_stack: _10y1m1w1y2y3m3y4y5y6m6y8yPattern3 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern3(client, 'lump_sum_stack') self.lump_sum_return: _10y1m1w1y2y3m3y4y5y6m6y8yPattern2 = _10y1m1w1y2y3m3y4y5y6m6y8yPattern2(client, 'lump_sum_return') -class MetricsTree_Market_Dca_Class_Stack: - """Metrics tree node.""" +class SeriesTree_Market_Dca_Class_Stack: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.from_2015: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2015') @@ -4274,8 +4304,8 @@ class MetricsTree_Market_Dca_Class_Stack: self.from_2025: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2025') self.from_2026: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'dca_stack_from_2026') -class MetricsTree_Market_Dca_Class_CostBasis: - """Metrics tree node.""" +class SeriesTree_Market_Dca_Class_CostBasis: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.from_2015: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2015') @@ -4291,8 +4321,8 @@ class MetricsTree_Market_Dca_Class_CostBasis: self.from_2025: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2025') self.from_2026: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'dca_cost_basis_from_2026') -class MetricsTree_Market_Dca_Class_Return: - """Metrics tree node.""" +class SeriesTree_Market_Dca_Class_Return: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.from_2015: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2015') @@ -4308,24 +4338,24 @@ class MetricsTree_Market_Dca_Class_Return: self.from_2025: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2025') self.from_2026: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'dca_return_from_2026') -class MetricsTree_Market_Dca_Class: - """Metrics tree node.""" +class SeriesTree_Market_Dca_Class: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.stack: MetricsTree_Market_Dca_Class_Stack = MetricsTree_Market_Dca_Class_Stack(client) - self.cost_basis: MetricsTree_Market_Dca_Class_CostBasis = MetricsTree_Market_Dca_Class_CostBasis(client) - self.return_: MetricsTree_Market_Dca_Class_Return = MetricsTree_Market_Dca_Class_Return(client) + self.stack: SeriesTree_Market_Dca_Class_Stack = SeriesTree_Market_Dca_Class_Stack(client) + self.cost_basis: SeriesTree_Market_Dca_Class_CostBasis = SeriesTree_Market_Dca_Class_CostBasis(client) + self.return_: SeriesTree_Market_Dca_Class_Return = SeriesTree_Market_Dca_Class_Return(client) -class MetricsTree_Market_Dca: - """Metrics tree node.""" +class SeriesTree_Market_Dca: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sats_per_day: MetricPattern18[Sats] = MetricPattern18(client, 'dca_sats_per_day') - self.period: MetricsTree_Market_Dca_Period = MetricsTree_Market_Dca_Period(client) - self.class_: MetricsTree_Market_Dca_Class = MetricsTree_Market_Dca_Class(client) + self.sats_per_day: SeriesPattern18[Sats] = SeriesPattern18(client, 'dca_sats_per_day') + self.period: SeriesTree_Market_Dca_Period = SeriesTree_Market_Dca_Period(client) + self.class_: SeriesTree_Market_Dca_Class = SeriesTree_Market_Dca_Class(client) -class MetricsTree_Market_Technical_Rsi: - """Metrics tree node.""" +class SeriesTree_Market_Technical_Rsi: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._24h: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi', '24h') @@ -4333,80 +4363,80 @@ class MetricsTree_Market_Technical_Rsi: self._1m: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi', '1m') self._1y: AverageGainsLossesRsiStochPattern = AverageGainsLossesRsiStochPattern(client, 'rsi', '1y') -class MetricsTree_Market_Technical_Macd_24h: - """Metrics tree node.""" +class SeriesTree_Market_Technical_Macd_24h: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.ema_fast: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_fast_24h') - self.ema_slow: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_slow_24h') - self.line: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_line_24h') - self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_24h') - self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_24h') + self.ema_fast: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_ema_fast_24h') + self.ema_slow: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_ema_slow_24h') + self.line: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_line_24h') + self.signal: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_signal_24h') + self.histogram: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_histogram_24h') -class MetricsTree_Market_Technical_Macd_1w: - """Metrics tree node.""" +class SeriesTree_Market_Technical_Macd_1w: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.ema_fast: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_fast_1w') - self.ema_slow: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_slow_1w') - self.line: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_line_1w') - self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_1w') - self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_1w') + self.ema_fast: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_ema_fast_1w') + self.ema_slow: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_ema_slow_1w') + self.line: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_line_1w') + self.signal: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_signal_1w') + self.histogram: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_histogram_1w') -class MetricsTree_Market_Technical_Macd_1m: - """Metrics tree node.""" +class SeriesTree_Market_Technical_Macd_1m: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.ema_fast: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_fast_1m') - self.ema_slow: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_slow_1m') - self.line: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_line_1m') - self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_1m') - self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_1m') + self.ema_fast: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_ema_fast_1m') + self.ema_slow: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_ema_slow_1m') + self.line: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_line_1m') + self.signal: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_signal_1m') + self.histogram: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_histogram_1m') -class MetricsTree_Market_Technical_Macd_1y: - """Metrics tree node.""" +class SeriesTree_Market_Technical_Macd_1y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.ema_fast: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_fast_1y') - self.ema_slow: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_ema_slow_1y') - self.line: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_line_1y') - self.signal: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_signal_1y') - self.histogram: MetricPattern1[StoredF32] = MetricPattern1(client, 'macd_histogram_1y') + self.ema_fast: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_ema_fast_1y') + self.ema_slow: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_ema_slow_1y') + self.line: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_line_1y') + self.signal: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_signal_1y') + self.histogram: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'macd_histogram_1y') -class MetricsTree_Market_Technical_Macd: - """Metrics tree node.""" +class SeriesTree_Market_Technical_Macd: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self._24h: MetricsTree_Market_Technical_Macd_24h = MetricsTree_Market_Technical_Macd_24h(client) - self._1w: MetricsTree_Market_Technical_Macd_1w = MetricsTree_Market_Technical_Macd_1w(client) - self._1m: MetricsTree_Market_Technical_Macd_1m = MetricsTree_Market_Technical_Macd_1m(client) - self._1y: MetricsTree_Market_Technical_Macd_1y = MetricsTree_Market_Technical_Macd_1y(client) + self._24h: SeriesTree_Market_Technical_Macd_24h = SeriesTree_Market_Technical_Macd_24h(client) + self._1w: SeriesTree_Market_Technical_Macd_1w = SeriesTree_Market_Technical_Macd_1w(client) + self._1m: SeriesTree_Market_Technical_Macd_1m = SeriesTree_Market_Technical_Macd_1m(client) + self._1y: SeriesTree_Market_Technical_Macd_1y = SeriesTree_Market_Technical_Macd_1y(client) -class MetricsTree_Market_Technical: - """Metrics tree node.""" +class SeriesTree_Market_Technical: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.rsi: MetricsTree_Market_Technical_Rsi = MetricsTree_Market_Technical_Rsi(client) + self.rsi: SeriesTree_Market_Technical_Rsi = SeriesTree_Market_Technical_Rsi(client) self.stoch_k: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'stoch_k') self.stoch_d: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'stoch_d') self.pi_cycle: BpsRatioPattern2 = BpsRatioPattern2(client, 'pi_cycle') - self.macd: MetricsTree_Market_Technical_Macd = MetricsTree_Market_Technical_Macd(client) + self.macd: SeriesTree_Market_Technical_Macd = SeriesTree_Market_Technical_Macd(client) -class MetricsTree_Market: - """Metrics tree node.""" +class SeriesTree_Market: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.ath: MetricsTree_Market_Ath = MetricsTree_Market_Ath(client) - self.lookback: MetricsTree_Market_Lookback = MetricsTree_Market_Lookback(client) - self.returns: MetricsTree_Market_Returns = MetricsTree_Market_Returns(client) - self.volatility: MetricsTree_Market_Volatility = MetricsTree_Market_Volatility(client) - self.range: MetricsTree_Market_Range = MetricsTree_Market_Range(client) - self.moving_average: MetricsTree_Market_MovingAverage = MetricsTree_Market_MovingAverage(client) - self.dca: MetricsTree_Market_Dca = MetricsTree_Market_Dca(client) - self.technical: MetricsTree_Market_Technical = MetricsTree_Market_Technical(client) + self.ath: SeriesTree_Market_Ath = SeriesTree_Market_Ath(client) + self.lookback: SeriesTree_Market_Lookback = SeriesTree_Market_Lookback(client) + self.returns: SeriesTree_Market_Returns = SeriesTree_Market_Returns(client) + self.volatility: SeriesTree_Market_Volatility = SeriesTree_Market_Volatility(client) + self.range: SeriesTree_Market_Range = SeriesTree_Market_Range(client) + self.moving_average: SeriesTree_Market_MovingAverage = SeriesTree_Market_MovingAverage(client) + self.dca: SeriesTree_Market_Dca = SeriesTree_Market_Dca(client) + self.technical: SeriesTree_Market_Technical = SeriesTree_Market_Technical(client) -class MetricsTree_Pools_Major: - """Metrics tree node.""" +class SeriesTree_Pools_Major: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.unknown: BlocksDominanceRewardsPattern = BlocksDominanceRewardsPattern(client, 'unknown') @@ -4432,8 +4462,8 @@ class MetricsTree_Pools_Major: self.ocean: BlocksDominanceRewardsPattern = BlocksDominanceRewardsPattern(client, 'ocean') self.whitepool: BlocksDominanceRewardsPattern = BlocksDominanceRewardsPattern(client, 'whitepool') -class MetricsTree_Pools_Minor: - """Metrics tree node.""" +class SeriesTree_Pools_Minor: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.blockfills: BlocksDominancePattern = BlocksDominancePattern(client, 'blockfills') @@ -4577,16 +4607,16 @@ class MetricsTree_Pools_Minor: self.redrockpool: BlocksDominancePattern = BlocksDominancePattern(client, 'redrockpool') self.est3lar: BlocksDominancePattern = BlocksDominancePattern(client, 'est3lar') -class MetricsTree_Pools: - """Metrics tree node.""" +class SeriesTree_Pools: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.height_to_pool: MetricPattern18[PoolSlug] = MetricPattern18(client, 'pool') - self.major: MetricsTree_Pools_Major = MetricsTree_Pools_Major(client) - self.minor: MetricsTree_Pools_Minor = MetricsTree_Pools_Minor(client) + self.height_to_pool: SeriesPattern18[PoolSlug] = SeriesPattern18(client, 'pool') + self.major: SeriesTree_Pools_Major = SeriesTree_Pools_Major(client) + self.minor: SeriesTree_Pools_Minor = SeriesTree_Pools_Minor(client) -class MetricsTree_Prices_Split: - """Metrics tree node.""" +class SeriesTree_Prices_Split: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.open: CentsSatsUsdPattern3 = CentsSatsUsdPattern3(client, 'price_open') @@ -4594,58 +4624,58 @@ class MetricsTree_Prices_Split: self.low: CentsSatsUsdPattern3 = CentsSatsUsdPattern3(client, 'price_low') self.close: CentsSatsUsdPattern3 = CentsSatsUsdPattern3(client, 'price_close') -class MetricsTree_Prices_Ohlc: - """Metrics tree node.""" +class SeriesTree_Prices_Ohlc: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.usd: MetricPattern2[OHLCDollars] = MetricPattern2(client, 'price_ohlc') - self.cents: MetricPattern2[OHLCCents] = MetricPattern2(client, 'price_ohlc_cents') - self.sats: MetricPattern2[OHLCSats] = MetricPattern2(client, 'price_ohlc_sats') + self.usd: SeriesPattern2[OHLCDollars] = SeriesPattern2(client, 'price_ohlc') + self.cents: SeriesPattern2[OHLCCents] = SeriesPattern2(client, 'price_ohlc_cents') + self.sats: SeriesPattern2[OHLCSats] = SeriesPattern2(client, 'price_ohlc_sats') -class MetricsTree_Prices_Spot: - """Metrics tree node.""" +class SeriesTree_Prices_Spot: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, 'price') - self.cents: MetricPattern1[Cents] = MetricPattern1(client, 'price_cents') - self.sats: MetricPattern1[Sats] = MetricPattern1(client, 'price_sats') + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'price') + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'price_cents') + self.sats: SeriesPattern1[Sats] = SeriesPattern1(client, 'price_sats') -class MetricsTree_Prices: - """Metrics tree node.""" +class SeriesTree_Prices: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.split: MetricsTree_Prices_Split = MetricsTree_Prices_Split(client) - self.ohlc: MetricsTree_Prices_Ohlc = MetricsTree_Prices_Ohlc(client) - self.spot: MetricsTree_Prices_Spot = MetricsTree_Prices_Spot(client) + self.split: SeriesTree_Prices_Split = SeriesTree_Prices_Split(client) + self.ohlc: SeriesTree_Prices_Ohlc = SeriesTree_Prices_Ohlc(client) + self.spot: SeriesTree_Prices_Spot = SeriesTree_Prices_Spot(client) -class MetricsTree_Supply_Burned: - """Metrics tree node.""" +class SeriesTree_Supply_Burned: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.unspendable: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, 'unspendable_supply') -class MetricsTree_Supply_Velocity: - """Metrics tree node.""" +class SeriesTree_Supply_Velocity: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.native: MetricPattern1[StoredF64] = MetricPattern1(client, 'velocity') - self.fiat: MetricPattern1[StoredF64] = MetricPattern1(client, 'velocity_fiat') + self.native: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'velocity') + self.fiat: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'velocity_fiat') -class MetricsTree_Supply: - """Metrics tree node.""" +class SeriesTree_Supply: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.state: MetricPattern18[SupplyState] = MetricPattern18(client, 'supply_state') + self.state: SeriesPattern18[SupplyState] = SeriesPattern18(client, 'supply_state') self.circulating: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'circulating_supply') - self.burned: MetricsTree_Supply_Burned = MetricsTree_Supply_Burned(client) + self.burned: SeriesTree_Supply_Burned = SeriesTree_Supply_Burned(client) self.inflation_rate: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'inflation_rate') - self.velocity: MetricsTree_Supply_Velocity = MetricsTree_Supply_Velocity(client) + self.velocity: SeriesTree_Supply_Velocity = SeriesTree_Supply_Velocity(client) self.market_cap: CentsDeltaUsdPattern = CentsDeltaUsdPattern(client, 'market_cap') self.market_minus_realized_cap_growth_rate: _1m1w1y24hPattern[BasisPointsSigned32] = _1m1w1y24hPattern(client, 'market_minus_realized_cap_growth_rate') self.hodled_or_lost: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'hodled_or_lost_coins') -class MetricsTree_Cohorts_Utxo_All_Supply: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Supply: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.total: BtcCentsSatsUsdPattern = BtcCentsSatsUsdPattern(client, 'supply') @@ -4654,17 +4684,17 @@ class MetricsTree_Cohorts_Utxo_All_Supply: self.in_profit: BtcCentsRelSatsUsdPattern2 = BtcCentsRelSatsUsdPattern2(client, 'supply_in_profit') self.in_loss: BtcCentsRelSatsUsdPattern2 = BtcCentsRelSatsUsdPattern2(client, 'supply_in_loss') -class MetricsTree_Cohorts_Utxo_All_Activity: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Activity: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.sent: BaseCumulativeInSumPattern = BaseCumulativeInSumPattern(client, 'sent') 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') + self.coinyears_destroyed: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'coinyears_destroyed') + self.dormancy: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'dormancy') -class MetricsTree_Cohorts_Utxo_All_Realized_Profit: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Profit: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: CentsUsdPattern2 = CentsUsdPattern2(client, 'realized_profit') @@ -4673,27 +4703,27 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Profit: self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'realized_profit_rel_to_rcap') 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') + self.distribution_flow: SeriesPattern1[Dollars] = SeriesPattern1(client, 'distribution_flow') -class MetricsTree_Cohorts_Utxo_All_Realized_Loss: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Loss: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: CentsUsdPattern2 = CentsUsdPattern2(client, 'realized_loss') self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, 'realized_loss_cumulative') self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'realized_loss_sum') - self.negative: MetricPattern1[Dollars] = MetricPattern1(client, 'neg_realized_loss') + self.negative: SeriesPattern1[Dollars] = SeriesPattern1(client, 'neg_realized_loss') self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'realized_loss_rel_to_rcap') 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') + self.capitulation_flow: SeriesPattern1[Dollars] = SeriesPattern1(client, 'capitulation_flow') -class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_sd') - self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_zscore') + self.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'realized_price_ratio_sd') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'realized_price_ratio_zscore') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'realized_price_0sd') self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p0_5sd') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1sd') @@ -4708,12 +4738,12 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All: 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.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_sd_4y') - self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_zscore_4y') + self.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'realized_price_ratio_sd_4y') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'realized_price_ratio_zscore_4y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'realized_price_0sd_4y') self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p0_5sd_4y') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1sd_4y') @@ -4728,12 +4758,12 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_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.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_sd_2y') - self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_zscore_2y') + self.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'realized_price_ratio_sd_2y') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'realized_price_ratio_zscore_2y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'realized_price_0sd_2y') self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p0_5sd_2y') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1sd_2y') @@ -4748,12 +4778,12 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_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.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_sd_1y') - self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio_zscore_1y') + self.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'realized_price_ratio_sd_1y') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'realized_price_ratio_zscore_1y') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'realized_price_0sd_1y') self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p0_5sd_1y') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'realized_price', 'p1sd_1y') @@ -4768,72 +4798,72 @@ class MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_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.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.all: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All = MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_All(client) - self._4y: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y = MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y(client) - self._2y: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y = MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y(client) - self._1y: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y = MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y(client) + self.all: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All = SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_All(client) + self._4y: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y = SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_4y(client) + self._2y: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y = SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_2y(client) + self._1y: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y = SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev_1y(client) -class MetricsTree_Cohorts_Utxo_All_Realized_Price: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Price: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, 'realized_price') - self.cents: MetricPattern1[Cents] = MetricPattern1(client, 'realized_price_cents') - self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, 'realized_price_sats') - self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, 'realized_price_ratio_bps') - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, 'realized_price_ratio') + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'realized_price') + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'realized_price_cents') + self.sats: SeriesPattern1[SatsFract] = SeriesPattern1(client, 'realized_price_sats') + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, 'realized_price_ratio_bps') + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'realized_price_ratio') self.percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern = Pct1Pct2Pct5Pct95Pct98Pct99Pattern(client, 'realized_price') self.sma: _1m1w1y2y4yAllPattern = _1m1w1y2y4yAllPattern(client, 'realized_price_ratio_sma') - self.std_dev: MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev = MetricsTree_Cohorts_Utxo_All_Realized_Price_StdDev(client) + self.std_dev: SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev = SeriesTree_Cohorts_Utxo_All_Realized_Price_StdDev(client) -class MetricsTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): 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.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Sopr: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): 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) + self.adjusted: SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted = SeriesTree_Cohorts_Utxo_All_Realized_Sopr_Adjusted(client) -class MetricsTree_Cohorts_Utxo_All_Realized_Investor: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Realized_Investor: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.price: BpsCentsPercentilesRatioSatsUsdPattern = BpsCentsPercentilesRatioSatsUsdPattern(client, 'investor_price') self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lower_price_band') self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'upper_price_band') -class MetricsTree_Cohorts_Utxo_All_Realized: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Realized: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.cap: CentsDeltaRelUsdPattern = CentsDeltaRelUsdPattern(client, 'realized_cap') - self.profit: MetricsTree_Cohorts_Utxo_All_Realized_Profit = MetricsTree_Cohorts_Utxo_All_Realized_Profit(client) - self.loss: MetricsTree_Cohorts_Utxo_All_Realized_Loss = MetricsTree_Cohorts_Utxo_All_Realized_Loss(client) - self.price: MetricsTree_Cohorts_Utxo_All_Realized_Price = MetricsTree_Cohorts_Utxo_All_Realized_Price(client) - self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, 'mvrv') - self.sopr: MetricsTree_Cohorts_Utxo_All_Realized_Sopr = MetricsTree_Cohorts_Utxo_All_Realized_Sopr(client) + self.profit: SeriesTree_Cohorts_Utxo_All_Realized_Profit = SeriesTree_Cohorts_Utxo_All_Realized_Profit(client) + self.loss: SeriesTree_Cohorts_Utxo_All_Realized_Loss = SeriesTree_Cohorts_Utxo_All_Realized_Loss(client) + self.price: SeriesTree_Cohorts_Utxo_All_Realized_Price = SeriesTree_Cohorts_Utxo_All_Realized_Price(client) + self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'mvrv') + self.sopr: SeriesTree_Cohorts_Utxo_All_Realized_Sopr = SeriesTree_Cohorts_Utxo_All_Realized_Sopr(client) self.net_pnl: BaseChangeCumulativeDeltaRelSumPattern = BaseChangeCumulativeDeltaRelSumPattern(client, 'net') self.gross_pnl: BaseCumulativeSumPattern3 = BaseCumulativeSumPattern3(client, 'realized_gross_pnl') 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.investor: SeriesTree_Cohorts_Utxo_All_Realized_Investor = SeriesTree_Cohorts_Utxo_All_Realized_Investor(client) self.profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'realized_profit_to_loss_ratio') -class MetricsTree_Cohorts_Utxo_All_CostBasis: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_CostBasis: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'cost_basis_min') @@ -4842,8 +4872,8 @@ class MetricsTree_Cohorts_Utxo_All_CostBasis: self.invested_capital: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, 'invested_capital') self.supply_density: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'supply_density') -class MetricsTree_Cohorts_Utxo_All_Unrealized_Profit: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Unrealized_Profit: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: CentsUsdPattern2 = CentsUsdPattern2(client, 'unrealized_profit') @@ -4852,67 +4882,67 @@ class MetricsTree_Cohorts_Utxo_All_Unrealized_Profit: self.rel_to_mcap: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'unrealized_profit_rel_to_mcap') self.rel_to_own_gross: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'unrealized_profit_rel_to_own_gross_pnl') -class MetricsTree_Cohorts_Utxo_All_Unrealized_Loss: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Unrealized_Loss: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: CentsUsdPattern2 = CentsUsdPattern2(client, 'unrealized_loss') self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, 'unrealized_loss_cumulative') self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'unrealized_loss_sum') - self.negative: MetricPattern1[Dollars] = MetricPattern1(client, 'neg_unrealized_loss') + self.negative: SeriesPattern1[Dollars] = SeriesPattern1(client, 'neg_unrealized_loss') self.rel_to_mcap: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'unrealized_loss_rel_to_mcap') self.rel_to_own_gross: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'unrealized_loss_rel_to_own_gross_pnl') -class MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, 'net_unrealized_pnl') - self.cents: MetricPattern1[CentsSigned] = MetricPattern1(client, 'net_unrealized_pnl_cents') + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'net_unrealized_pnl') + self.cents: SeriesPattern1[CentsSigned] = SeriesPattern1(client, 'net_unrealized_pnl_cents') self.rel_to_own_gross: BpsPercentRatioPattern = BpsPercentRatioPattern(client, 'net_unrealized_pnl_rel_to_own_gross_pnl') -class MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.pain_index: CentsUsdPattern2 = CentsUsdPattern2(client, 'pain_index') self.greed_index: CentsUsdPattern2 = CentsUsdPattern2(client, 'greed_index') self.net: CentsUsdPattern = CentsUsdPattern(client, 'net_sentiment') -class MetricsTree_Cohorts_Utxo_All_Unrealized: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All_Unrealized: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.nupl: BpsRatioPattern = BpsRatioPattern(client, 'nupl') - self.profit: MetricsTree_Cohorts_Utxo_All_Unrealized_Profit = MetricsTree_Cohorts_Utxo_All_Unrealized_Profit(client) - self.loss: MetricsTree_Cohorts_Utxo_All_Unrealized_Loss = MetricsTree_Cohorts_Utxo_All_Unrealized_Loss(client) - self.net_pnl: MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl = MetricsTree_Cohorts_Utxo_All_Unrealized_NetPnl(client) + self.profit: SeriesTree_Cohorts_Utxo_All_Unrealized_Profit = SeriesTree_Cohorts_Utxo_All_Unrealized_Profit(client) + self.loss: SeriesTree_Cohorts_Utxo_All_Unrealized_Loss = SeriesTree_Cohorts_Utxo_All_Unrealized_Loss(client) + self.net_pnl: SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl = SeriesTree_Cohorts_Utxo_All_Unrealized_NetPnl(client) self.gross_pnl: CentsUsdPattern2 = CentsUsdPattern2(client, 'unrealized_gross_pnl') self.invested_capital: InPattern = InPattern(client, 'invested_capital_in') - self.sentiment: MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment = MetricsTree_Cohorts_Utxo_All_Unrealized_Sentiment(client) + self.sentiment: SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment = SeriesTree_Cohorts_Utxo_All_Unrealized_Sentiment(client) -class MetricsTree_Cohorts_Utxo_All: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_All: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.supply: MetricsTree_Cohorts_Utxo_All_Supply = MetricsTree_Cohorts_Utxo_All_Supply(client) + self.supply: SeriesTree_Cohorts_Utxo_All_Supply = SeriesTree_Cohorts_Utxo_All_Supply(client) self.outputs: UnspentPattern = UnspentPattern(client, 'utxo_count') - self.activity: MetricsTree_Cohorts_Utxo_All_Activity = MetricsTree_Cohorts_Utxo_All_Activity(client) - self.realized: MetricsTree_Cohorts_Utxo_All_Realized = MetricsTree_Cohorts_Utxo_All_Realized(client) - self.cost_basis: MetricsTree_Cohorts_Utxo_All_CostBasis = MetricsTree_Cohorts_Utxo_All_CostBasis(client) - self.unrealized: MetricsTree_Cohorts_Utxo_All_Unrealized = MetricsTree_Cohorts_Utxo_All_Unrealized(client) + self.activity: SeriesTree_Cohorts_Utxo_All_Activity = SeriesTree_Cohorts_Utxo_All_Activity(client) + self.realized: SeriesTree_Cohorts_Utxo_All_Realized = SeriesTree_Cohorts_Utxo_All_Realized(client) + self.cost_basis: SeriesTree_Cohorts_Utxo_All_CostBasis = SeriesTree_Cohorts_Utxo_All_CostBasis(client) + self.unrealized: SeriesTree_Cohorts_Utxo_All_Unrealized = SeriesTree_Cohorts_Utxo_All_Unrealized(client) -class MetricsTree_Cohorts_Utxo_Sth_Activity: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Activity: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.sent: BaseCumulativeInSumPattern = BaseCumulativeInSumPattern(client, 'sth_sent') 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') + self.coinyears_destroyed: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'sth_coinyears_destroyed') + self.dormancy: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'sth_dormancy') -class MetricsTree_Cohorts_Utxo_Sth_Realized_Profit: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Profit: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: CentsUsdPattern2 = CentsUsdPattern2(client, 'sth_realized_profit') @@ -4921,27 +4951,27 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Profit: self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'sth_realized_profit_rel_to_rcap') 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') + self.distribution_flow: SeriesPattern1[Dollars] = SeriesPattern1(client, 'sth_distribution_flow') -class MetricsTree_Cohorts_Utxo_Sth_Realized_Loss: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Loss: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: CentsUsdPattern2 = CentsUsdPattern2(client, 'sth_realized_loss') self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, 'sth_realized_loss_cumulative') self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'sth_realized_loss_sum') - self.negative: MetricPattern1[Dollars] = MetricPattern1(client, 'sth_neg_realized_loss') + self.negative: SeriesPattern1[Dollars] = SeriesPattern1(client, 'sth_neg_realized_loss') self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'sth_realized_loss_rel_to_rcap') 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') + self.capitulation_flow: SeriesPattern1[Dollars] = SeriesPattern1(client, 'sth_capitulation_flow') -class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_sd') - self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio_zscore') + self.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'sth_realized_price_ratio_sd') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'sth_realized_price_ratio_zscore') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'sth_realized_price_0sd') self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p0_5sd') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1sd') @@ -4956,12 +4986,12 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All: 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.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - 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.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'sth_realized_price_ratio_sd_4y') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(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', 'p0_5sd_4y') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1sd_4y') @@ -4976,12 +5006,12 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_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.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - 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.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'sth_realized_price_ratio_sd_2y') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(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', 'p0_5sd_2y') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1sd_2y') @@ -4996,12 +5026,12 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_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.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - 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.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'sth_realized_price_ratio_sd_1y') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(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', 'p0_5sd_1y') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'sth_realized_price', 'p1sd_1y') @@ -5016,72 +5046,72 @@ class MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_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.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.all: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All = MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All(client) - self._4y: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y = MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y(client) - self._2y: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y = MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y(client) - self._1y: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y = MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y(client) + self.all: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All = SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_All(client) + self._4y: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y = SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_4y(client) + self._2y: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y = SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_2y(client) + self._1y: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y = SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev_1y(client) -class MetricsTree_Cohorts_Utxo_Sth_Realized_Price: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Price: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, 'sth_realized_price') - self.cents: MetricPattern1[Cents] = MetricPattern1(client, 'sth_realized_price_cents') - self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, 'sth_realized_price_sats') - self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, 'sth_realized_price_ratio_bps') - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_realized_price_ratio') + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'sth_realized_price') + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'sth_realized_price_cents') + self.sats: SeriesPattern1[SatsFract] = SeriesPattern1(client, 'sth_realized_price_sats') + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, 'sth_realized_price_ratio_bps') + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'sth_realized_price_ratio') self.percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern = Pct1Pct2Pct5Pct95Pct98Pct99Pattern(client, 'sth_realized_price') self.sma: _1m1w1y2y4yAllPattern = _1m1w1y2y4yAllPattern(client, 'sth_realized_price_ratio_sma') - self.std_dev: MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev = MetricsTree_Cohorts_Utxo_Sth_Realized_Price_StdDev(client) + self.std_dev: SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev = SeriesTree_Cohorts_Utxo_Sth_Realized_Price_StdDev(client) -class MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): 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.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): 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) + self.adjusted: SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted = SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr_Adjusted(client) -class MetricsTree_Cohorts_Utxo_Sth_Realized_Investor: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized_Investor: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.price: BpsCentsPercentilesRatioSatsUsdPattern = BpsCentsPercentilesRatioSatsUsdPattern(client, 'sth_investor_price') self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'sth_lower_price_band') self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'sth_upper_price_band') -class MetricsTree_Cohorts_Utxo_Sth_Realized: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Realized: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.cap: CentsDeltaRelUsdPattern = CentsDeltaRelUsdPattern(client, 'sth_realized_cap') - self.profit: MetricsTree_Cohorts_Utxo_Sth_Realized_Profit = MetricsTree_Cohorts_Utxo_Sth_Realized_Profit(client) - self.loss: MetricsTree_Cohorts_Utxo_Sth_Realized_Loss = MetricsTree_Cohorts_Utxo_Sth_Realized_Loss(client) - self.price: MetricsTree_Cohorts_Utxo_Sth_Realized_Price = MetricsTree_Cohorts_Utxo_Sth_Realized_Price(client) - self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, 'sth_mvrv') - self.sopr: MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr = MetricsTree_Cohorts_Utxo_Sth_Realized_Sopr(client) + self.profit: SeriesTree_Cohorts_Utxo_Sth_Realized_Profit = SeriesTree_Cohorts_Utxo_Sth_Realized_Profit(client) + self.loss: SeriesTree_Cohorts_Utxo_Sth_Realized_Loss = SeriesTree_Cohorts_Utxo_Sth_Realized_Loss(client) + self.price: SeriesTree_Cohorts_Utxo_Sth_Realized_Price = SeriesTree_Cohorts_Utxo_Sth_Realized_Price(client) + self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'sth_mvrv') + self.sopr: SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr = SeriesTree_Cohorts_Utxo_Sth_Realized_Sopr(client) self.net_pnl: BaseChangeCumulativeDeltaRelSumPattern = BaseChangeCumulativeDeltaRelSumPattern(client, 'sth_net') self.gross_pnl: BaseCumulativeSumPattern3 = BaseCumulativeSumPattern3(client, 'sth_realized_gross_pnl') 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.investor: SeriesTree_Cohorts_Utxo_Sth_Realized_Investor = SeriesTree_Cohorts_Utxo_Sth_Realized_Investor(client) self.profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'sth_realized_profit_to_loss_ratio') -class MetricsTree_Cohorts_Utxo_Sth_CostBasis: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_CostBasis: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'sth_cost_basis_min') @@ -5090,16 +5120,16 @@ class MetricsTree_Cohorts_Utxo_Sth_CostBasis: self.invested_capital: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, 'sth_invested_capital') self.supply_density: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'sth_supply_density') -class MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Unrealized_Sentiment: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.pain_index: CentsUsdPattern2 = CentsUsdPattern2(client, 'sth_pain_index') self.greed_index: CentsUsdPattern2 = CentsUsdPattern2(client, 'sth_greed_index') self.net: CentsUsdPattern = CentsUsdPattern(client, 'sth_net_sentiment') -class MetricsTree_Cohorts_Utxo_Sth_Unrealized: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth_Unrealized: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.nupl: BpsRatioPattern = BpsRatioPattern(client, 'sth_nupl') @@ -5108,30 +5138,30 @@ class MetricsTree_Cohorts_Utxo_Sth_Unrealized: self.net_pnl: CentsRelUsdPattern2 = CentsRelUsdPattern2(client, 'sth_net_unrealized_pnl') self.gross_pnl: CentsUsdPattern2 = CentsUsdPattern2(client, 'sth_unrealized_gross_pnl') self.invested_capital: InPattern = InPattern(client, 'sth_invested_capital_in') - self.sentiment: MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment = MetricsTree_Cohorts_Utxo_Sth_Unrealized_Sentiment(client) + self.sentiment: SeriesTree_Cohorts_Utxo_Sth_Unrealized_Sentiment = SeriesTree_Cohorts_Utxo_Sth_Unrealized_Sentiment(client) -class MetricsTree_Cohorts_Utxo_Sth: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Sth: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.supply: DeltaHalfInRelTotalPattern2 = DeltaHalfInRelTotalPattern2(client, 'sth_supply') self.outputs: UnspentPattern = UnspentPattern(client, 'sth_utxo_count') - self.activity: MetricsTree_Cohorts_Utxo_Sth_Activity = MetricsTree_Cohorts_Utxo_Sth_Activity(client) - self.realized: MetricsTree_Cohorts_Utxo_Sth_Realized = MetricsTree_Cohorts_Utxo_Sth_Realized(client) - self.cost_basis: MetricsTree_Cohorts_Utxo_Sth_CostBasis = MetricsTree_Cohorts_Utxo_Sth_CostBasis(client) - self.unrealized: MetricsTree_Cohorts_Utxo_Sth_Unrealized = MetricsTree_Cohorts_Utxo_Sth_Unrealized(client) + self.activity: SeriesTree_Cohorts_Utxo_Sth_Activity = SeriesTree_Cohorts_Utxo_Sth_Activity(client) + self.realized: SeriesTree_Cohorts_Utxo_Sth_Realized = SeriesTree_Cohorts_Utxo_Sth_Realized(client) + self.cost_basis: SeriesTree_Cohorts_Utxo_Sth_CostBasis = SeriesTree_Cohorts_Utxo_Sth_CostBasis(client) + self.unrealized: SeriesTree_Cohorts_Utxo_Sth_Unrealized = SeriesTree_Cohorts_Utxo_Sth_Unrealized(client) -class MetricsTree_Cohorts_Utxo_Lth_Activity: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_Activity: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.sent: BaseCumulativeInSumPattern = BaseCumulativeInSumPattern(client, 'lth_sent') 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') + self.coinyears_destroyed: SeriesPattern1[StoredF64] = SeriesPattern1(client, 'lth_coinyears_destroyed') + self.dormancy: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'lth_dormancy') -class MetricsTree_Cohorts_Utxo_Lth_Realized_Profit: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Profit: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: CentsUsdPattern2 = CentsUsdPattern2(client, 'lth_realized_profit') @@ -5140,27 +5170,27 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Profit: self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'lth_realized_profit_rel_to_rcap') 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') + self.distribution_flow: SeriesPattern1[Dollars] = SeriesPattern1(client, 'lth_distribution_flow') -class MetricsTree_Cohorts_Utxo_Lth_Realized_Loss: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Loss: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.base: CentsUsdPattern2 = CentsUsdPattern2(client, 'lth_realized_loss') self.cumulative: CentsUsdPattern2 = CentsUsdPattern2(client, 'lth_realized_loss_cumulative') self.sum: _1m1w1y24hPattern4 = _1m1w1y24hPattern4(client, 'lth_realized_loss_sum') - self.negative: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_neg_realized_loss') + self.negative: SeriesPattern1[Dollars] = SeriesPattern1(client, 'lth_neg_realized_loss') self.rel_to_rcap: BpsPercentRatioPattern4 = BpsPercentRatioPattern4(client, 'lth_realized_loss_rel_to_rcap') 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') + self.capitulation_flow: SeriesPattern1[Dollars] = SeriesPattern1(client, 'lth_capitulation_flow') -class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.sd: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_sd') - self.zscore: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio_zscore') + self.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'lth_realized_price_ratio_sd') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'lth_realized_price_ratio_zscore') self._0sd: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_realized_price_0sd') self.p0_5sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p0_5sd') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1sd') @@ -5175,12 +5205,12 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All: 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.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - 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.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'lth_realized_price_ratio_sd_4y') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(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', 'p0_5sd_4y') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1sd_4y') @@ -5195,12 +5225,12 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_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.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - 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.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'lth_realized_price_ratio_sd_2y') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(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', 'p0_5sd_2y') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1sd_2y') @@ -5215,12 +5245,12 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_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.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - 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.sd: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'lth_realized_price_ratio_sd_1y') + self.zscore: SeriesPattern1[StoredF32] = SeriesPattern1(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', 'p0_5sd_1y') self.p1sd: PriceRatioPattern = PriceRatioPattern(client, 'lth_realized_price', 'p1sd_1y') @@ -5235,63 +5265,63 @@ class MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_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.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.all: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All = MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All(client) - self._4y: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y = MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y(client) - self._2y: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y = MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y(client) - self._1y: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y = MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y(client) + self.all: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All = SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_All(client) + self._4y: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y = SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_4y(client) + self._2y: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y = SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_2y(client) + self._1y: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y = SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev_1y(client) -class MetricsTree_Cohorts_Utxo_Lth_Realized_Price: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Price: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.usd: MetricPattern1[Dollars] = MetricPattern1(client, 'lth_realized_price') - self.cents: MetricPattern1[Cents] = MetricPattern1(client, 'lth_realized_price_cents') - self.sats: MetricPattern1[SatsFract] = MetricPattern1(client, 'lth_realized_price_sats') - self.bps: MetricPattern1[BasisPoints32] = MetricPattern1(client, 'lth_realized_price_ratio_bps') - self.ratio: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_realized_price_ratio') + self.usd: SeriesPattern1[Dollars] = SeriesPattern1(client, 'lth_realized_price') + self.cents: SeriesPattern1[Cents] = SeriesPattern1(client, 'lth_realized_price_cents') + self.sats: SeriesPattern1[SatsFract] = SeriesPattern1(client, 'lth_realized_price_sats') + self.bps: SeriesPattern1[BasisPoints32] = SeriesPattern1(client, 'lth_realized_price_ratio_bps') + self.ratio: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'lth_realized_price_ratio') self.percentiles: Pct1Pct2Pct5Pct95Pct98Pct99Pattern = Pct1Pct2Pct5Pct95Pct98Pct99Pattern(client, 'lth_realized_price') self.sma: _1m1w1y2y4yAllPattern = _1m1w1y2y4yAllPattern(client, 'lth_realized_price_ratio_sma') - self.std_dev: MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev = MetricsTree_Cohorts_Utxo_Lth_Realized_Price_StdDev(client) + self.std_dev: SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev = SeriesTree_Cohorts_Utxo_Lth_Realized_Price_StdDev(client) -class MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): 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.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized_Investor: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.price: BpsCentsPercentilesRatioSatsUsdPattern = BpsCentsPercentilesRatioSatsUsdPattern(client, 'lth_investor_price') self.lower_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_lower_price_band') self.upper_price_band: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_upper_price_band') -class MetricsTree_Cohorts_Utxo_Lth_Realized: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_Realized: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.cap: CentsDeltaRelUsdPattern = CentsDeltaRelUsdPattern(client, 'lth_realized_cap') - self.profit: MetricsTree_Cohorts_Utxo_Lth_Realized_Profit = MetricsTree_Cohorts_Utxo_Lth_Realized_Profit(client) - self.loss: MetricsTree_Cohorts_Utxo_Lth_Realized_Loss = MetricsTree_Cohorts_Utxo_Lth_Realized_Loss(client) - self.price: MetricsTree_Cohorts_Utxo_Lth_Realized_Price = MetricsTree_Cohorts_Utxo_Lth_Realized_Price(client) - self.mvrv: MetricPattern1[StoredF32] = MetricPattern1(client, 'lth_mvrv') - self.sopr: MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr = MetricsTree_Cohorts_Utxo_Lth_Realized_Sopr(client) + self.profit: SeriesTree_Cohorts_Utxo_Lth_Realized_Profit = SeriesTree_Cohorts_Utxo_Lth_Realized_Profit(client) + self.loss: SeriesTree_Cohorts_Utxo_Lth_Realized_Loss = SeriesTree_Cohorts_Utxo_Lth_Realized_Loss(client) + self.price: SeriesTree_Cohorts_Utxo_Lth_Realized_Price = SeriesTree_Cohorts_Utxo_Lth_Realized_Price(client) + self.mvrv: SeriesPattern1[StoredF32] = SeriesPattern1(client, 'lth_mvrv') + self.sopr: SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr = SeriesTree_Cohorts_Utxo_Lth_Realized_Sopr(client) self.net_pnl: BaseChangeCumulativeDeltaRelSumPattern = BaseChangeCumulativeDeltaRelSumPattern(client, 'lth_net') self.gross_pnl: BaseCumulativeSumPattern3 = BaseCumulativeSumPattern3(client, 'lth_realized_gross_pnl') 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.investor: SeriesTree_Cohorts_Utxo_Lth_Realized_Investor = SeriesTree_Cohorts_Utxo_Lth_Realized_Investor(client) self.profit_to_loss_ratio: _1m1w1y24hPattern[StoredF64] = _1m1w1y24hPattern(client, 'lth_realized_profit_to_loss_ratio') -class MetricsTree_Cohorts_Utxo_Lth_CostBasis: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_CostBasis: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.min: CentsSatsUsdPattern = CentsSatsUsdPattern(client, 'lth_cost_basis_min') @@ -5300,16 +5330,16 @@ class MetricsTree_Cohorts_Utxo_Lth_CostBasis: self.invested_capital: Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern = Pct05Pct10Pct15Pct20Pct25Pct30Pct35Pct40Pct45Pct50Pct55Pct60Pct65Pct70Pct75Pct80Pct85Pct90Pct95Pattern(client, 'lth_invested_capital') self.supply_density: BpsPercentRatioPattern3 = BpsPercentRatioPattern3(client, 'lth_supply_density') -class MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_Unrealized_Sentiment: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.pain_index: CentsUsdPattern2 = CentsUsdPattern2(client, 'lth_pain_index') self.greed_index: CentsUsdPattern2 = CentsUsdPattern2(client, 'lth_greed_index') self.net: CentsUsdPattern = CentsUsdPattern(client, 'lth_net_sentiment') -class MetricsTree_Cohorts_Utxo_Lth_Unrealized: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth_Unrealized: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.nupl: BpsRatioPattern = BpsRatioPattern(client, 'lth_nupl') @@ -5318,21 +5348,21 @@ class MetricsTree_Cohorts_Utxo_Lth_Unrealized: self.net_pnl: CentsRelUsdPattern2 = CentsRelUsdPattern2(client, 'lth_net_unrealized_pnl') self.gross_pnl: CentsUsdPattern2 = CentsUsdPattern2(client, 'lth_unrealized_gross_pnl') self.invested_capital: InPattern = InPattern(client, 'lth_invested_capital_in') - self.sentiment: MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment = MetricsTree_Cohorts_Utxo_Lth_Unrealized_Sentiment(client) + self.sentiment: SeriesTree_Cohorts_Utxo_Lth_Unrealized_Sentiment = SeriesTree_Cohorts_Utxo_Lth_Unrealized_Sentiment(client) -class MetricsTree_Cohorts_Utxo_Lth: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Lth: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.supply: DeltaHalfInRelTotalPattern2 = DeltaHalfInRelTotalPattern2(client, 'lth_supply') self.outputs: UnspentPattern = UnspentPattern(client, 'lth_utxo_count') - self.activity: MetricsTree_Cohorts_Utxo_Lth_Activity = MetricsTree_Cohorts_Utxo_Lth_Activity(client) - self.realized: MetricsTree_Cohorts_Utxo_Lth_Realized = MetricsTree_Cohorts_Utxo_Lth_Realized(client) - self.cost_basis: MetricsTree_Cohorts_Utxo_Lth_CostBasis = MetricsTree_Cohorts_Utxo_Lth_CostBasis(client) - self.unrealized: MetricsTree_Cohorts_Utxo_Lth_Unrealized = MetricsTree_Cohorts_Utxo_Lth_Unrealized(client) + self.activity: SeriesTree_Cohorts_Utxo_Lth_Activity = SeriesTree_Cohorts_Utxo_Lth_Activity(client) + self.realized: SeriesTree_Cohorts_Utxo_Lth_Realized = SeriesTree_Cohorts_Utxo_Lth_Realized(client) + self.cost_basis: SeriesTree_Cohorts_Utxo_Lth_CostBasis = SeriesTree_Cohorts_Utxo_Lth_CostBasis(client) + self.unrealized: SeriesTree_Cohorts_Utxo_Lth_Unrealized = SeriesTree_Cohorts_Utxo_Lth_Unrealized(client) -class MetricsTree_Cohorts_Utxo_AgeRange: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_AgeRange: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.under_1h: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_1h_old') @@ -5357,8 +5387,8 @@ class MetricsTree_Cohorts_Utxo_AgeRange: self._12y_to_15y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_12y_to_15y_old') self.over_15y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_15y_old') -class MetricsTree_Cohorts_Utxo_UnderAge: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_UnderAge: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._1w: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_1w_old') @@ -5380,8 +5410,8 @@ class MetricsTree_Cohorts_Utxo_UnderAge: self._12y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_12y_old') self._15y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_15y_old') -class MetricsTree_Cohorts_Utxo_OverAge: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_OverAge: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._1d: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_1d_old') @@ -5403,8 +5433,8 @@ class MetricsTree_Cohorts_Utxo_OverAge: self._10y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_10y_old') self._12y: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_12y_old') -class MetricsTree_Cohorts_Utxo_Epoch: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Epoch: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._0: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'epoch_0') @@ -5413,8 +5443,8 @@ class MetricsTree_Cohorts_Utxo_Epoch: self._3: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'epoch_3') self._4: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'epoch_4') -class MetricsTree_Cohorts_Utxo_Class: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Class: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._2009: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2009') @@ -5436,8 +5466,8 @@ class MetricsTree_Cohorts_Utxo_Class: self._2025: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2025') self._2026: ActivityOutputsRealizedSupplyUnrealizedPattern = ActivityOutputsRealizedSupplyUnrealizedPattern(client, 'class_2026') -class MetricsTree_Cohorts_Utxo_OverAmount: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_OverAmount: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._1sat: OutputsRealizedSupplyUnrealizedPattern = OutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_1sat') @@ -5454,8 +5484,8 @@ class MetricsTree_Cohorts_Utxo_OverAmount: self._1k_btc: OutputsRealizedSupplyUnrealizedPattern = OutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_1k_btc') self._10k_btc: OutputsRealizedSupplyUnrealizedPattern = OutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_10k_btc') -class MetricsTree_Cohorts_Utxo_AmountRange: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_AmountRange: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._0sats: OutputsRealizedSupplyUnrealizedPattern = OutputsRealizedSupplyUnrealizedPattern(client, 'utxos_0sats') @@ -5474,8 +5504,8 @@ class MetricsTree_Cohorts_Utxo_AmountRange: self._10k_btc_to_100k_btc: OutputsRealizedSupplyUnrealizedPattern = OutputsRealizedSupplyUnrealizedPattern(client, 'utxos_10k_btc_to_100k_btc') self.over_100k_btc: OutputsRealizedSupplyUnrealizedPattern = OutputsRealizedSupplyUnrealizedPattern(client, 'utxos_over_100k_btc') -class MetricsTree_Cohorts_Utxo_UnderAmount: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_UnderAmount: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._10sats: OutputsRealizedSupplyUnrealizedPattern = OutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_10sats') @@ -5492,8 +5522,8 @@ class MetricsTree_Cohorts_Utxo_UnderAmount: self._10k_btc: OutputsRealizedSupplyUnrealizedPattern = OutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_10k_btc') self._100k_btc: OutputsRealizedSupplyUnrealizedPattern = OutputsRealizedSupplyUnrealizedPattern(client, 'utxos_under_100k_btc') -class MetricsTree_Cohorts_Utxo_Type: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Type: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.p2pk65: OutputsRealizedSupplyUnrealizedPattern2 = OutputsRealizedSupplyUnrealizedPattern2(client, 'p2pk65') @@ -5508,8 +5538,8 @@ class MetricsTree_Cohorts_Utxo_Type: self.unknown: OutputsRealizedSupplyUnrealizedPattern2 = OutputsRealizedSupplyUnrealizedPattern2(client, 'unknown_outputs') self.empty: OutputsRealizedSupplyUnrealizedPattern2 = OutputsRealizedSupplyUnrealizedPattern2(client, 'empty_outputs') -class MetricsTree_Cohorts_Utxo_Profitability_Range: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Profitability_Range: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.over_1000pct_in_profit: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_1000pct_in_profit') @@ -5538,11 +5568,11 @@ class MetricsTree_Cohorts_Utxo_Profitability_Range: self._80pct_to_90pct_in_loss: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_80pct_to_90pct_in_loss') self._90pct_to_100pct_in_loss: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_90pct_to_100pct_in_loss') -class MetricsTree_Cohorts_Utxo_Profitability_Profit: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Profitability_Profit: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.breakeven: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_in_profit') + self.all: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_in_profit') self._10pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_10pct_in_profit') self._20pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_20pct_in_profit') self._30pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_30pct_in_profit') @@ -5557,11 +5587,11 @@ class MetricsTree_Cohorts_Utxo_Profitability_Profit: self._300pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_300pct_in_profit') self._500pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_500pct_in_profit') -class MetricsTree_Cohorts_Utxo_Profitability_Loss: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Profitability_Loss: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.breakeven: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_in_loss') + self.all: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_in_loss') self._10pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_10pct_in_loss') self._20pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_20pct_in_loss') self._30pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_30pct_in_loss') @@ -5571,16 +5601,16 @@ class MetricsTree_Cohorts_Utxo_Profitability_Loss: self._70pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_70pct_in_loss') self._80pct: NuplRealizedSupplyPattern = NuplRealizedSupplyPattern(client, 'utxos_over_80pct_in_loss') -class MetricsTree_Cohorts_Utxo_Profitability: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Profitability: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.range: MetricsTree_Cohorts_Utxo_Profitability_Range = MetricsTree_Cohorts_Utxo_Profitability_Range(client) - self.profit: MetricsTree_Cohorts_Utxo_Profitability_Profit = MetricsTree_Cohorts_Utxo_Profitability_Profit(client) - self.loss: MetricsTree_Cohorts_Utxo_Profitability_Loss = MetricsTree_Cohorts_Utxo_Profitability_Loss(client) + self.range: SeriesTree_Cohorts_Utxo_Profitability_Range = SeriesTree_Cohorts_Utxo_Profitability_Range(client) + self.profit: SeriesTree_Cohorts_Utxo_Profitability_Profit = SeriesTree_Cohorts_Utxo_Profitability_Profit(client) + self.loss: SeriesTree_Cohorts_Utxo_Profitability_Loss = SeriesTree_Cohorts_Utxo_Profitability_Loss(client) -class MetricsTree_Cohorts_Utxo_Matured: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo_Matured: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self.under_1h: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, 'utxos_under_1h_old_matured_supply') @@ -5605,27 +5635,27 @@ class MetricsTree_Cohorts_Utxo_Matured: self._12y_to_15y: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, 'utxos_12y_to_15y_old_matured_supply') self.over_15y: BaseCumulativeSumPattern4 = BaseCumulativeSumPattern4(client, 'utxos_over_15y_old_matured_supply') -class MetricsTree_Cohorts_Utxo: - """Metrics tree node.""" +class SeriesTree_Cohorts_Utxo: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.all: MetricsTree_Cohorts_Utxo_All = MetricsTree_Cohorts_Utxo_All(client) - self.sth: MetricsTree_Cohorts_Utxo_Sth = MetricsTree_Cohorts_Utxo_Sth(client) - self.lth: MetricsTree_Cohorts_Utxo_Lth = MetricsTree_Cohorts_Utxo_Lth(client) - self.age_range: MetricsTree_Cohorts_Utxo_AgeRange = MetricsTree_Cohorts_Utxo_AgeRange(client) - self.under_age: MetricsTree_Cohorts_Utxo_UnderAge = MetricsTree_Cohorts_Utxo_UnderAge(client) - self.over_age: MetricsTree_Cohorts_Utxo_OverAge = MetricsTree_Cohorts_Utxo_OverAge(client) - self.epoch: MetricsTree_Cohorts_Utxo_Epoch = MetricsTree_Cohorts_Utxo_Epoch(client) - self.class_: MetricsTree_Cohorts_Utxo_Class = MetricsTree_Cohorts_Utxo_Class(client) - self.over_amount: MetricsTree_Cohorts_Utxo_OverAmount = MetricsTree_Cohorts_Utxo_OverAmount(client) - self.amount_range: MetricsTree_Cohorts_Utxo_AmountRange = MetricsTree_Cohorts_Utxo_AmountRange(client) - self.under_amount: MetricsTree_Cohorts_Utxo_UnderAmount = MetricsTree_Cohorts_Utxo_UnderAmount(client) - self.type: MetricsTree_Cohorts_Utxo_Type = MetricsTree_Cohorts_Utxo_Type(client) - self.profitability: MetricsTree_Cohorts_Utxo_Profitability = MetricsTree_Cohorts_Utxo_Profitability(client) - self.matured: MetricsTree_Cohorts_Utxo_Matured = MetricsTree_Cohorts_Utxo_Matured(client) + self.all: SeriesTree_Cohorts_Utxo_All = SeriesTree_Cohorts_Utxo_All(client) + self.sth: SeriesTree_Cohorts_Utxo_Sth = SeriesTree_Cohorts_Utxo_Sth(client) + self.lth: SeriesTree_Cohorts_Utxo_Lth = SeriesTree_Cohorts_Utxo_Lth(client) + self.age_range: SeriesTree_Cohorts_Utxo_AgeRange = SeriesTree_Cohorts_Utxo_AgeRange(client) + self.under_age: SeriesTree_Cohorts_Utxo_UnderAge = SeriesTree_Cohorts_Utxo_UnderAge(client) + self.over_age: SeriesTree_Cohorts_Utxo_OverAge = SeriesTree_Cohorts_Utxo_OverAge(client) + self.epoch: SeriesTree_Cohorts_Utxo_Epoch = SeriesTree_Cohorts_Utxo_Epoch(client) + self.class_: SeriesTree_Cohorts_Utxo_Class = SeriesTree_Cohorts_Utxo_Class(client) + self.over_amount: SeriesTree_Cohorts_Utxo_OverAmount = SeriesTree_Cohorts_Utxo_OverAmount(client) + self.amount_range: SeriesTree_Cohorts_Utxo_AmountRange = SeriesTree_Cohorts_Utxo_AmountRange(client) + self.under_amount: SeriesTree_Cohorts_Utxo_UnderAmount = SeriesTree_Cohorts_Utxo_UnderAmount(client) + self.type: SeriesTree_Cohorts_Utxo_Type = SeriesTree_Cohorts_Utxo_Type(client) + self.profitability: SeriesTree_Cohorts_Utxo_Profitability = SeriesTree_Cohorts_Utxo_Profitability(client) + self.matured: SeriesTree_Cohorts_Utxo_Matured = SeriesTree_Cohorts_Utxo_Matured(client) -class MetricsTree_Cohorts_Address_OverAmount: - """Metrics tree node.""" +class SeriesTree_Cohorts_Address_OverAmount: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._1sat: AddressOutputsRealizedSupplyUnrealizedPattern = AddressOutputsRealizedSupplyUnrealizedPattern(client, 'addrs_over_1sat') @@ -5642,8 +5672,8 @@ class MetricsTree_Cohorts_Address_OverAmount: self._1k_btc: AddressOutputsRealizedSupplyUnrealizedPattern = AddressOutputsRealizedSupplyUnrealizedPattern(client, 'addrs_over_1k_btc') self._10k_btc: AddressOutputsRealizedSupplyUnrealizedPattern = AddressOutputsRealizedSupplyUnrealizedPattern(client, 'addrs_over_10k_btc') -class MetricsTree_Cohorts_Address_AmountRange: - """Metrics tree node.""" +class SeriesTree_Cohorts_Address_AmountRange: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._0sats: AddressOutputsRealizedSupplyUnrealizedPattern = AddressOutputsRealizedSupplyUnrealizedPattern(client, 'addrs_0sats') @@ -5662,8 +5692,8 @@ class MetricsTree_Cohorts_Address_AmountRange: self._10k_btc_to_100k_btc: AddressOutputsRealizedSupplyUnrealizedPattern = AddressOutputsRealizedSupplyUnrealizedPattern(client, 'addrs_10k_btc_to_100k_btc') self.over_100k_btc: AddressOutputsRealizedSupplyUnrealizedPattern = AddressOutputsRealizedSupplyUnrealizedPattern(client, 'addrs_over_100k_btc') -class MetricsTree_Cohorts_Address_UnderAmount: - """Metrics tree node.""" +class SeriesTree_Cohorts_Address_UnderAmount: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): self._10sats: AddressOutputsRealizedSupplyUnrealizedPattern = AddressOutputsRealizedSupplyUnrealizedPattern(client, 'addrs_under_10sats') @@ -5680,44 +5710,44 @@ class MetricsTree_Cohorts_Address_UnderAmount: self._10k_btc: AddressOutputsRealizedSupplyUnrealizedPattern = AddressOutputsRealizedSupplyUnrealizedPattern(client, 'addrs_under_10k_btc') self._100k_btc: AddressOutputsRealizedSupplyUnrealizedPattern = AddressOutputsRealizedSupplyUnrealizedPattern(client, 'addrs_under_100k_btc') -class MetricsTree_Cohorts_Address: - """Metrics tree node.""" +class SeriesTree_Cohorts_Address: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.over_amount: MetricsTree_Cohorts_Address_OverAmount = MetricsTree_Cohorts_Address_OverAmount(client) - self.amount_range: MetricsTree_Cohorts_Address_AmountRange = MetricsTree_Cohorts_Address_AmountRange(client) - self.under_amount: MetricsTree_Cohorts_Address_UnderAmount = MetricsTree_Cohorts_Address_UnderAmount(client) + self.over_amount: SeriesTree_Cohorts_Address_OverAmount = SeriesTree_Cohorts_Address_OverAmount(client) + self.amount_range: SeriesTree_Cohorts_Address_AmountRange = SeriesTree_Cohorts_Address_AmountRange(client) + self.under_amount: SeriesTree_Cohorts_Address_UnderAmount = SeriesTree_Cohorts_Address_UnderAmount(client) -class MetricsTree_Cohorts: - """Metrics tree node.""" +class SeriesTree_Cohorts: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.utxo: MetricsTree_Cohorts_Utxo = MetricsTree_Cohorts_Utxo(client) - self.address: MetricsTree_Cohorts_Address = MetricsTree_Cohorts_Address(client) + self.utxo: SeriesTree_Cohorts_Utxo = SeriesTree_Cohorts_Utxo(client) + self.address: SeriesTree_Cohorts_Address = SeriesTree_Cohorts_Address(client) -class MetricsTree: - """Metrics tree node.""" +class SeriesTree: + """Series tree node.""" def __init__(self, client: BrkClientBase, base_path: str = ''): - self.blocks: MetricsTree_Blocks = MetricsTree_Blocks(client) - self.transactions: MetricsTree_Transactions = MetricsTree_Transactions(client) - self.inputs: MetricsTree_Inputs = MetricsTree_Inputs(client) - self.outputs: MetricsTree_Outputs = MetricsTree_Outputs(client) - self.addresses: MetricsTree_Addresses = MetricsTree_Addresses(client) - self.scripts: MetricsTree_Scripts = MetricsTree_Scripts(client) - self.mining: MetricsTree_Mining = MetricsTree_Mining(client) - self.cointime: MetricsTree_Cointime = MetricsTree_Cointime(client) - self.constants: MetricsTree_Constants = MetricsTree_Constants(client) - self.indexes: MetricsTree_Indexes = MetricsTree_Indexes(client) - self.indicators: MetricsTree_Indicators = MetricsTree_Indicators(client) - self.market: MetricsTree_Market = MetricsTree_Market(client) - self.pools: MetricsTree_Pools = MetricsTree_Pools(client) - self.prices: MetricsTree_Prices = MetricsTree_Prices(client) - self.supply: MetricsTree_Supply = MetricsTree_Supply(client) - self.cohorts: MetricsTree_Cohorts = MetricsTree_Cohorts(client) + self.blocks: SeriesTree_Blocks = SeriesTree_Blocks(client) + self.transactions: SeriesTree_Transactions = SeriesTree_Transactions(client) + self.inputs: SeriesTree_Inputs = SeriesTree_Inputs(client) + self.outputs: SeriesTree_Outputs = SeriesTree_Outputs(client) + self.addresses: SeriesTree_Addresses = SeriesTree_Addresses(client) + self.scripts: SeriesTree_Scripts = SeriesTree_Scripts(client) + self.mining: SeriesTree_Mining = SeriesTree_Mining(client) + self.cointime: SeriesTree_Cointime = SeriesTree_Cointime(client) + self.constants: SeriesTree_Constants = SeriesTree_Constants(client) + self.indexes: SeriesTree_Indexes = SeriesTree_Indexes(client) + self.indicators: SeriesTree_Indicators = SeriesTree_Indicators(client) + self.market: SeriesTree_Market = SeriesTree_Market(client) + self.pools: SeriesTree_Pools = SeriesTree_Pools(client) + self.prices: SeriesTree_Prices = SeriesTree_Prices(client) + self.supply: SeriesTree_Supply = SeriesTree_Supply(client) + self.cohorts: SeriesTree_Cohorts = SeriesTree_Cohorts(client) class BrkClient(BrkClientBase): - """Main BRK client with metrics tree and API methods.""" + """Main BRK client with series tree and API methods.""" VERSION = "v0.1.9" @@ -6625,263 +6655,263 @@ class BrkClient(BrkClientBase): PROFITABILITY_RANGE_NAMES = { "over_1000pct_in_profit": { "id": "utxos_over_1000pct_in_profit", - "short": ">1000%", - "long": "Over 1000% Profit" + "short": "+>1000%", + "long": "Over 1000% in Profit" }, "_500pct_to_1000pct_in_profit": { "id": "utxos_500pct_to_1000pct_in_profit", - "short": "500-1000%", - "long": "500-1000% Profit" + "short": "+500-1000%", + "long": "500-1000% in Profit" }, "_300pct_to_500pct_in_profit": { "id": "utxos_300pct_to_500pct_in_profit", - "short": "300-500%", - "long": "300-500% Profit" + "short": "+300-500%", + "long": "300-500% in Profit" }, "_200pct_to_300pct_in_profit": { "id": "utxos_200pct_to_300pct_in_profit", - "short": "200-300%", - "long": "200-300% Profit" + "short": "+200-300%", + "long": "200-300% in Profit" }, "_100pct_to_200pct_in_profit": { "id": "utxos_100pct_to_200pct_in_profit", - "short": "100-200%", - "long": "100-200% Profit" + "short": "+100-200%", + "long": "100-200% in Profit" }, "_90pct_to_100pct_in_profit": { "id": "utxos_90pct_to_100pct_in_profit", - "short": "90-100%", - "long": "90-100% Profit" + "short": "+90-100%", + "long": "90-100% in Profit" }, "_80pct_to_90pct_in_profit": { "id": "utxos_80pct_to_90pct_in_profit", - "short": "80-90%", - "long": "80-90% Profit" + "short": "+80-90%", + "long": "80-90% in Profit" }, "_70pct_to_80pct_in_profit": { "id": "utxos_70pct_to_80pct_in_profit", - "short": "70-80%", - "long": "70-80% Profit" + "short": "+70-80%", + "long": "70-80% in Profit" }, "_60pct_to_70pct_in_profit": { "id": "utxos_60pct_to_70pct_in_profit", - "short": "60-70%", - "long": "60-70% Profit" + "short": "+60-70%", + "long": "60-70% in Profit" }, "_50pct_to_60pct_in_profit": { "id": "utxos_50pct_to_60pct_in_profit", - "short": "50-60%", - "long": "50-60% Profit" + "short": "+50-60%", + "long": "50-60% in Profit" }, "_40pct_to_50pct_in_profit": { "id": "utxos_40pct_to_50pct_in_profit", - "short": "40-50%", - "long": "40-50% Profit" + "short": "+40-50%", + "long": "40-50% in Profit" }, "_30pct_to_40pct_in_profit": { "id": "utxos_30pct_to_40pct_in_profit", - "short": "30-40%", - "long": "30-40% Profit" + "short": "+30-40%", + "long": "30-40% in Profit" }, "_20pct_to_30pct_in_profit": { "id": "utxos_20pct_to_30pct_in_profit", - "short": "20-30%", - "long": "20-30% Profit" + "short": "+20-30%", + "long": "20-30% in Profit" }, "_10pct_to_20pct_in_profit": { "id": "utxos_10pct_to_20pct_in_profit", - "short": "10-20%", - "long": "10-20% Profit" + "short": "+10-20%", + "long": "10-20% in Profit" }, "_0pct_to_10pct_in_profit": { "id": "utxos_0pct_to_10pct_in_profit", - "short": "0-10%", - "long": "0-10% Profit" + "short": "+0-10%", + "long": "0-10% in Profit" }, "_0pct_to_10pct_in_loss": { "id": "utxos_0pct_to_10pct_in_loss", - "short": "0-10%L", - "long": "0-10% Loss" + "short": "-0-10%", + "long": "0-10% in Loss" }, "_10pct_to_20pct_in_loss": { "id": "utxos_10pct_to_20pct_in_loss", - "short": "10-20%L", - "long": "10-20% Loss" + "short": "-10-20%", + "long": "10-20% in Loss" }, "_20pct_to_30pct_in_loss": { "id": "utxos_20pct_to_30pct_in_loss", - "short": "20-30%L", - "long": "20-30% Loss" + "short": "-20-30%", + "long": "20-30% in Loss" }, "_30pct_to_40pct_in_loss": { "id": "utxos_30pct_to_40pct_in_loss", - "short": "30-40%L", - "long": "30-40% Loss" + "short": "-30-40%", + "long": "30-40% in Loss" }, "_40pct_to_50pct_in_loss": { "id": "utxos_40pct_to_50pct_in_loss", - "short": "40-50%L", - "long": "40-50% Loss" + "short": "-40-50%", + "long": "40-50% in Loss" }, "_50pct_to_60pct_in_loss": { "id": "utxos_50pct_to_60pct_in_loss", - "short": "50-60%L", - "long": "50-60% Loss" + "short": "-50-60%", + "long": "50-60% in Loss" }, "_60pct_to_70pct_in_loss": { "id": "utxos_60pct_to_70pct_in_loss", - "short": "60-70%L", - "long": "60-70% Loss" + "short": "-60-70%", + "long": "60-70% in Loss" }, "_70pct_to_80pct_in_loss": { "id": "utxos_70pct_to_80pct_in_loss", - "short": "70-80%L", - "long": "70-80% Loss" + "short": "-70-80%", + "long": "70-80% in Loss" }, "_80pct_to_90pct_in_loss": { "id": "utxos_80pct_to_90pct_in_loss", - "short": "80-90%L", - "long": "80-90% Loss" + "short": "-80-90%", + "long": "80-90% in Loss" }, "_90pct_to_100pct_in_loss": { "id": "utxos_90pct_to_100pct_in_loss", - "short": "90-100%L", - "long": "90-100% Loss" + "short": "-90-100%", + "long": "90-100% in Loss" } } PROFIT_NAMES = { - "breakeven": { + "all": { "id": "utxos_in_profit", - "short": "≥0%", - "long": "In Profit (Breakeven+)" + "short": "All", + "long": "In Profit" }, "_10pct": { "id": "utxos_over_10pct_in_profit", - "short": "≥10%", - "long": "10%+ Profit" + "short": ">=10%", + "long": "Over 10% in Profit" }, "_20pct": { "id": "utxos_over_20pct_in_profit", - "short": "≥20%", - "long": "20%+ Profit" + "short": ">=20%", + "long": "Over 20% in Profit" }, "_30pct": { "id": "utxos_over_30pct_in_profit", - "short": "≥30%", - "long": "30%+ Profit" + "short": ">=30%", + "long": "Over 30% in Profit" }, "_40pct": { "id": "utxos_over_40pct_in_profit", - "short": "≥40%", - "long": "40%+ Profit" + "short": ">=40%", + "long": "Over 40% in Profit" }, "_50pct": { "id": "utxos_over_50pct_in_profit", - "short": "≥50%", - "long": "50%+ Profit" + "short": ">=50%", + "long": "Over 50% in Profit" }, "_60pct": { "id": "utxos_over_60pct_in_profit", - "short": "≥60%", - "long": "60%+ Profit" + "short": ">=60%", + "long": "Over 60% in Profit" }, "_70pct": { "id": "utxos_over_70pct_in_profit", - "short": "≥70%", - "long": "70%+ Profit" + "short": ">=70%", + "long": "Over 70% in Profit" }, "_80pct": { "id": "utxos_over_80pct_in_profit", - "short": "≥80%", - "long": "80%+ Profit" + "short": ">=80%", + "long": "Over 80% in Profit" }, "_90pct": { "id": "utxos_over_90pct_in_profit", - "short": "≥90%", - "long": "90%+ Profit" + "short": ">=90%", + "long": "Over 90% in Profit" }, "_100pct": { "id": "utxos_over_100pct_in_profit", - "short": "≥100%", - "long": "100%+ Profit" + "short": ">=100%", + "long": "Over 100% in Profit" }, "_200pct": { "id": "utxos_over_200pct_in_profit", - "short": "≥200%", - "long": "200%+ Profit" + "short": ">=200%", + "long": "Over 200% in Profit" }, "_300pct": { "id": "utxos_over_300pct_in_profit", - "short": "≥300%", - "long": "300%+ Profit" + "short": ">=300%", + "long": "Over 300% in Profit" }, "_500pct": { "id": "utxos_over_500pct_in_profit", - "short": "≥500%", - "long": "500%+ Profit" + "short": ">=500%", + "long": "Over 500% in Profit" } } LOSS_NAMES = { - "breakeven": { + "all": { "id": "utxos_in_loss", - "short": "<0%", - "long": "In Loss (Below Breakeven)" + "short": "All", + "long": "In Loss" }, "_10pct": { "id": "utxos_over_10pct_in_loss", - "short": "≥10%L", - "long": "10%+ Loss" + "short": ">=10%", + "long": "Over 10% in Loss" }, "_20pct": { "id": "utxos_over_20pct_in_loss", - "short": "≥20%L", - "long": "20%+ Loss" + "short": ">=20%", + "long": "Over 20% in Loss" }, "_30pct": { "id": "utxos_over_30pct_in_loss", - "short": "≥30%L", - "long": "30%+ Loss" + "short": ">=30%", + "long": "Over 30% in Loss" }, "_40pct": { "id": "utxos_over_40pct_in_loss", - "short": "≥40%L", - "long": "40%+ Loss" + "short": ">=40%", + "long": "Over 40% in Loss" }, "_50pct": { "id": "utxos_over_50pct_in_loss", - "short": "≥50%L", - "long": "50%+ Loss" + "short": ">=50%", + "long": "Over 50% in Loss" }, "_60pct": { "id": "utxos_over_60pct_in_loss", - "short": "≥60%L", - "long": "60%+ Loss" + "short": ">=60%", + "long": "Over 60% in Loss" }, "_70pct": { "id": "utxos_over_70pct_in_loss", - "short": "≥70%L", - "long": "70%+ Loss" + "short": ">=70%", + "long": "Over 70% in Loss" }, "_80pct": { "id": "utxos_over_80pct_in_loss", - "short": "≥80%L", - "long": "80%+ Loss" + "short": ">=80%", + "long": "Over 80% in Loss" } } def __init__(self, base_url: str = 'http://localhost:3000', timeout: float = 30.0): super().__init__(base_url, timeout) - self.metrics = MetricsTree(self) + self.series = SeriesTree(self) - def metric(self, metric: str, index: Index) -> MetricEndpointBuilder[Any]: - """Create a dynamic metric endpoint builder for any metric/index combination. + def series_endpoint(self, series: str, index: Index) -> SeriesEndpointBuilder[Any]: + """Create a dynamic series endpoint builder for any series/index combination. - Use this for programmatic access when the metric name is determined at runtime. - For type-safe access, use the `metrics` tree instead. + Use this for programmatic access when the series name is determined at runtime. + For type-safe access, use the `series` tree instead. """ - return MetricEndpointBuilder(self, metric, index) + return SeriesEndpointBuilder(self, series, index) def index_to_date(self, index: Index, i: int) -> Union[date, datetime]: """Convert an index value to a date/datetime for date-based indexes.""" @@ -7075,95 +7105,29 @@ class BrkClient(BrkClientBase): Endpoint: `GET /api/mempool/txids`""" return self.get_json('/api/mempool/txids') - def get_metric_info(self, metric: Metric) -> MetricInfo: - """Get metric info. + def get_series_tree(self) -> TreeNode: + """Series catalog. - Returns the supported indexes and value type for the specified metric. + Returns the complete hierarchical catalog of available series organized as a tree structure. Series are grouped by categories and subcategories. - Endpoint: `GET /api/metric/{metric}`""" - return self.get_json(f'/api/metric/{metric}') + Endpoint: `GET /api/series`""" + return self.get_json('/api/series') - def get_metric(self, metric: Metric, index: Index, start: Optional[RangeIndex] = None, end: Optional[RangeIndex] = None, limit: Optional[Limit] = None, format: Optional[Format] = None) -> Union[AnyMetricData, str]: - """Get metric data. + def get_series_bulk(self, series: SeriesList, index: Index, start: Optional[RangeIndex] = None, end: Optional[RangeIndex] = None, limit: Optional[Limit] = None, format: Optional[Format] = None) -> Union[List[AnySeriesData], str]: + """Bulk series data. - Fetch data for a specific metric at the given index. Use query parameters to filter by date range and format (json/csv). + Fetch multiple series in a single request. Supports filtering by index and date range. Returns an array of SeriesData objects. For a single series, use `get_series` instead. - Endpoint: `GET /api/metric/{metric}/{index}`""" + Endpoint: `GET /api/series/bulk`""" params = [] - if start is not None: params.append(f'start={start}') - if end is not None: params.append(f'end={end}') - if limit is not None: params.append(f'limit={limit}') - if format is not None: params.append(f'format={format}') - query = '&'.join(params) - path = f'/api/metric/{metric}/{index}{"?" + query if query else ""}' - if format == 'csv': - return self.get_text(path) - return self.get_json(path) - - def get_metric_data(self, metric: Metric, index: Index, start: Optional[RangeIndex] = None, end: Optional[RangeIndex] = None, limit: Optional[Limit] = None, format: Optional[Format] = None) -> Union[List[bool], str]: - """Get raw metric data. - - Returns just the data array without the MetricData wrapper. Supports the same range and format parameters as the standard endpoint. - - Endpoint: `GET /api/metric/{metric}/{index}/data`""" - params = [] - if start is not None: params.append(f'start={start}') - if end is not None: params.append(f'end={end}') - if limit is not None: params.append(f'limit={limit}') - if format is not None: params.append(f'format={format}') - query = '&'.join(params) - path = f'/api/metric/{metric}/{index}/data{"?" + query if query else ""}' - if format == 'csv': - return self.get_text(path) - return self.get_json(path) - - def get_metric_latest(self, metric: Metric, index: Index) -> Any: - """Get latest metric value. - - Returns the single most recent value for a metric, unwrapped (not inside a MetricData object). - - Endpoint: `GET /api/metric/{metric}/{index}/latest`""" - return self.get_json(f'/api/metric/{metric}/{index}/latest') - - def get_metric_len(self, metric: Metric, index: Index) -> float: - """Get metric data length. - - Returns the total number of data points for a metric at the given index. - - Endpoint: `GET /api/metric/{metric}/{index}/len`""" - return self.get_json(f'/api/metric/{metric}/{index}/len') - - def get_metric_version(self, metric: Metric, index: Index) -> Version: - """Get metric version. - - Returns the current version of a metric. Changes when the metric data is updated. - - Endpoint: `GET /api/metric/{metric}/{index}/version`""" - return self.get_json(f'/api/metric/{metric}/{index}/version') - - def get_metrics_tree(self) -> TreeNode: - """Metrics catalog. - - Returns the complete hierarchical catalog of available metrics organized as a tree structure. Metrics are grouped by categories and subcategories. - - Endpoint: `GET /api/metrics`""" - return self.get_json('/api/metrics') - - def get_metrics(self, metrics: Metrics, index: Index, start: Optional[RangeIndex] = None, end: Optional[RangeIndex] = None, limit: Optional[Limit] = None, format: Optional[Format] = None) -> Union[List[AnyMetricData], str]: - """Bulk metric data. - - Fetch multiple metrics in a single request. Supports filtering by index and date range. Returns an array of MetricData objects. For a single metric, use `get_metric` instead. - - Endpoint: `GET /api/metrics/bulk`""" - params = [] - params.append(f'metrics={metrics}') + params.append(f'series={series}') params.append(f'index={index}') if start is not None: params.append(f'start={start}') if end is not None: params.append(f'end={end}') if limit is not None: params.append(f'limit={limit}') if format is not None: params.append(f'format={format}') query = '&'.join(params) - path = f'/api/metrics/bulk{"?" + query if query else ""}' + path = f'/api/series/bulk{"?" + query if query else ""}' if format == 'csv': return self.get_text(path) return self.get_json(path) @@ -7173,16 +7137,16 @@ class BrkClient(BrkClientBase): List available cohorts for cost basis distribution. - Endpoint: `GET /api/metrics/cost-basis`""" - return self.get_json('/api/metrics/cost-basis') + Endpoint: `GET /api/series/cost-basis`""" + return self.get_json('/api/series/cost-basis') def get_cost_basis_dates(self, cohort: Cohort) -> List[Date]: """Available cost basis dates. List available dates for a cohort's cost basis distribution. - Endpoint: `GET /api/metrics/cost-basis/{cohort}/dates`""" - return self.get_json(f'/api/metrics/cost-basis/{cohort}/dates') + Endpoint: `GET /api/series/cost-basis/{cohort}/dates`""" + return self.get_json(f'/api/series/cost-basis/{cohort}/dates') def get_cost_basis(self, cohort: Cohort, date: str, bucket: Optional[CostBasisBucket] = None, value: Optional[CostBasisValue] = None) -> dict: """Cost basis distribution. @@ -7193,56 +7157,122 @@ class BrkClient(BrkClientBase): - `bucket`: raw (default), lin200, lin500, lin1000, log10, log50, log100 - `value`: supply (default, in BTC), realized (USD), unrealized (USD) - Endpoint: `GET /api/metrics/cost-basis/{cohort}/{date}`""" + Endpoint: `GET /api/series/cost-basis/{cohort}/{date}`""" params = [] if bucket is not None: params.append(f'bucket={bucket}') if value is not None: params.append(f'value={value}') query = '&'.join(params) - path = f'/api/metrics/cost-basis/{cohort}/{date}{"?" + query if query else ""}' + path = f'/api/series/cost-basis/{cohort}/{date}{"?" + query if query else ""}' return self.get_json(path) - def get_metrics_count(self) -> List[MetricCount]: - """Metric count. + def get_series_count(self) -> List[SeriesCount]: + """Series count. - Returns the number of metrics available per index type. + Returns the number of series available per index type. - Endpoint: `GET /api/metrics/count`""" - return self.get_json('/api/metrics/count') + Endpoint: `GET /api/series/count`""" + return self.get_json('/api/series/count') def get_indexes(self) -> List[IndexInfo]: """List available indexes. - Returns all available indexes with their accepted query aliases. Use any alias when querying metrics. + Returns all available indexes with their accepted query aliases. Use any alias when querying series. - Endpoint: `GET /api/metrics/indexes`""" - return self.get_json('/api/metrics/indexes') + Endpoint: `GET /api/series/indexes`""" + return self.get_json('/api/series/indexes') - def list_metrics(self, page: Optional[float] = None, per_page: Optional[float] = None) -> PaginatedMetrics: - """Metrics list. + def list_series(self, page: Optional[float] = None, per_page: Optional[float] = None) -> PaginatedSeries: + """Series list. - Paginated flat list of all available metric names. Use `page` query param for pagination. + Paginated flat list of all available series names. Use `page` query param for pagination. - Endpoint: `GET /api/metrics/list`""" + Endpoint: `GET /api/series/list`""" params = [] if page is not None: params.append(f'page={page}') if per_page is not None: params.append(f'per_page={per_page}') query = '&'.join(params) - path = f'/api/metrics/list{"?" + query if query else ""}' + path = f'/api/series/list{"?" + query if query else ""}' return self.get_json(path) - def search_metrics(self, q: Metric, limit: Optional[Limit] = None) -> List[Metric]: - """Search metrics. + def search_series(self, q: Series, limit: Optional[Limit] = None) -> List[str]: + """Search series. - Fuzzy search for metrics by name. Supports partial matches and typos. + Fuzzy search for series by name. Supports partial matches and typos. - Endpoint: `GET /api/metrics/search`""" + Endpoint: `GET /api/series/search`""" params = [] params.append(f'q={q}') if limit is not None: params.append(f'limit={limit}') query = '&'.join(params) - path = f'/api/metrics/search{"?" + query if query else ""}' + path = f'/api/series/search{"?" + query if query else ""}' return self.get_json(path) + def get_series_info(self, series: Series) -> SeriesInfo: + """Get series info. + + Returns the supported indexes and value type for the specified series. + + Endpoint: `GET /api/series/{series}`""" + return self.get_json(f'/api/series/{series}') + + def get_series(self, series: Series, index: Index, start: Optional[RangeIndex] = None, end: Optional[RangeIndex] = None, limit: Optional[Limit] = None, format: Optional[Format] = None) -> Union[AnySeriesData, str]: + """Get series data. + + Fetch data for a specific series at the given index. Use query parameters to filter by date range and format (json/csv). + + Endpoint: `GET /api/series/{series}/{index}`""" + params = [] + if start is not None: params.append(f'start={start}') + if end is not None: params.append(f'end={end}') + if limit is not None: params.append(f'limit={limit}') + if format is not None: params.append(f'format={format}') + query = '&'.join(params) + path = f'/api/series/{series}/{index}{"?" + query if query else ""}' + if format == 'csv': + return self.get_text(path) + return self.get_json(path) + + def get_series_data(self, series: Series, index: Index, start: Optional[RangeIndex] = None, end: Optional[RangeIndex] = None, limit: Optional[Limit] = None, format: Optional[Format] = None) -> Union[List[bool], str]: + """Get raw series data. + + Returns just the data array without the SeriesData wrapper. Supports the same range and format parameters as the standard endpoint. + + Endpoint: `GET /api/series/{series}/{index}/data`""" + params = [] + if start is not None: params.append(f'start={start}') + if end is not None: params.append(f'end={end}') + if limit is not None: params.append(f'limit={limit}') + if format is not None: params.append(f'format={format}') + query = '&'.join(params) + path = f'/api/series/{series}/{index}/data{"?" + query if query else ""}' + if format == 'csv': + return self.get_text(path) + return self.get_json(path) + + def get_series_latest(self, series: Series, index: Index) -> Any: + """Get latest series value. + + Returns the single most recent value for a series, unwrapped (not inside a SeriesData object). + + Endpoint: `GET /api/series/{series}/{index}/latest`""" + return self.get_json(f'/api/series/{series}/{index}/latest') + + def get_series_len(self, series: Series, index: Index) -> float: + """Get series data length. + + Returns the total number of data points for a series at the given index. + + Endpoint: `GET /api/series/{series}/{index}/len`""" + return self.get_json(f'/api/series/{series}/{index}/len') + + def get_series_version(self, series: Series, index: Index) -> Version: + """Get series version. + + Returns the current version of a series. Changes when the series data is updated. + + Endpoint: `GET /api/series/{series}/{index}/version`""" + return self.get_json(f'/api/series/{series}/{index}/version') + def get_disk_usage(self) -> DiskUsage: """Disk usage. diff --git a/scripts/pool_major_threshold.py b/scripts/pool_major_threshold.py index c45a046c3..25ef7d193 100644 --- a/scripts/pool_major_threshold.py +++ b/scripts/pool_major_threshold.py @@ -19,7 +19,7 @@ import urllib.request import concurrent.futures from pathlib import Path -API_BASE = "https://bitview.space/api/metric" +API_BASE = "https://bitview.space/api/series" POOLSLUG_PATH = Path(__file__).resolve().parent.parent / "crates/brk_types/src/poolslug.rs" HEADERS = {"User-Agent": "pool-threshold-script"} WINDOWS = {"1w": 7, "1m": 30, "1y": 365} diff --git a/website/scripts/chart/index.js b/website/scripts/chart/index.js index 79f76ee8c..e7e8045c5 100644 --- a/website/scripts/chart/index.js +++ b/website/scripts/chart/index.js @@ -88,8 +88,8 @@ export function createChart({ parent, brk, fitContent }) { /** @param {ChartableIndex} idx */ const getTimeEndpoint = (idx) => idx === "height" - ? brk.metrics.blocks.time.timestampMonotonic.by[idx] - : brk.metrics.blocks.time.timestamp.by[idx]; + ? brk.series.blocks.time.timestampMonotonic.by[idx] + : brk.series.blocks.time.timestamp.by[idx]; const index = { /** @type {Set<(index: ChartableIndex) => void>} */ @@ -118,9 +118,9 @@ export function createChart({ parent, brk, fitContent }) { let generation = 0; const time = { - /** @type {MetricData | null} */ + /** @type {SeriesData | null} */ data: null, - /** @type {Set<(data: MetricData) => void>} */ + /** @type {Set<(data: SeriesData) => void>} */ callbacks: new Set(), /** @type {ReturnType | null} */ endpoint: null, @@ -150,7 +150,7 @@ export function createChart({ parent, brk, fitContent }) { }; // Memory cache for instant index switching - /** @type {Map>} */ + /** @type {Map>} */ const cache = new Map(); // Range state: localStorage stores all ranges per-index, URL stores current range only @@ -425,7 +425,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {string} args.name * @param {number} args.order * @param {Color[]} args.colors - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.source * @param {number} args.paneIndex * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) @@ -438,7 +438,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {() => void} args.onRemove */ create({ - metric, + source, name, order, paneIndex, @@ -486,7 +486,7 @@ export function createChart({ parent, brk, fitContent }) { lastTimeVersion: null, /** @type {VoidFunction | null} */ fetch: null, - /** @type {((data: MetricData) => void) | null} */ + /** @type {((data: SeriesData) => void) | null} */ onTime: null, reset() { this.hasData = false; @@ -572,8 +572,8 @@ export function createChart({ parent, brk, fitContent }) { state.reset(); state.fetch = null; - const _valuesEndpoint = metric.by[idx]; - // Gracefully skip - series may be about to be removed by option change + const _valuesEndpoint = source.by[idx]; + // Gracefully skip - source may be about to be removed by option change if (!_valuesEndpoint) return; const valuesEndpoint = _valuesEndpoint; @@ -702,7 +702,7 @@ export function createChart({ parent, brk, fitContent }) { } async function fetchAndProcess() { - /** @type {MetricData | null} */ + /** @type {SeriesData | null} */ let timeData = null; /** @type {(number | null | [number, number, number, number])[] | null} */ let valuesData = null; @@ -769,7 +769,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {Object} args * @param {string} args.name * @param {number} args.order - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.source * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) * @param {number} [args.paneIndex] @@ -778,7 +778,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {CandlestickSeriesPartialOptions} [args.options] */ addCandlestick({ - metric, + source, name, key, order, @@ -830,7 +830,7 @@ export function createChart({ parent, brk, fitContent }) { paneIndex, unit, defaultActive, - metric, + source, setOrder(order) { candlestickISeries.setSeriesOrder(order); lineISeries.setSeriesOrder(order); @@ -880,7 +880,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {Object} args * @param {string} args.name * @param {number} args.order - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.source * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) * @param {Color | [Color, Color]} [args.color] - Single color or [positive, negative] colors @@ -889,7 +889,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {HistogramSeriesPartialOptions} [args.options] */ addHistogram({ - metric, + source, name, key, color = colors.bi.p1, @@ -920,7 +920,7 @@ export function createChart({ parent, brk, fitContent }) { paneIndex, unit, defaultActive, - metric, + source, setOrder: (order) => iseries.setSeriesOrder(order), applyOptions(active, highlighted) { iseries.applyOptions({ @@ -953,7 +953,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {Object} args * @param {string} args.name * @param {number} args.order - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.source * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) * @param {Color} args.color @@ -962,7 +962,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {LineSeriesPartialOptions} [args.options] */ addLine({ - metric, + source, name, key, order, @@ -991,7 +991,7 @@ export function createChart({ parent, brk, fitContent }) { paneIndex, unit, defaultActive, - metric, + source, setOrder: (order) => iseries.setSeriesOrder(order), applyOptions(active, highlighted) { iseries.applyOptions({ @@ -1010,7 +1010,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {Object} args * @param {string} args.name * @param {number} args.order - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.source * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) * @param {Color} args.color @@ -1019,7 +1019,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {LineSeriesPartialOptions} [args.options] */ addDots({ - metric, + source, name, key, order, @@ -1063,7 +1063,7 @@ export function createChart({ parent, brk, fitContent }) { paneIndex, unit, defaultActive, - metric, + source, setOrder: (order) => iseries.setSeriesOrder(order), applyOptions(active, highlighted) { iseries.applyOptions({ @@ -1089,7 +1089,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {Object} args * @param {string} args.name * @param {number} args.order - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.source * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) * @param {number} [args.paneIndex] @@ -1099,7 +1099,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {BaselineSeriesPartialOptions} [args.options] */ addBaseline({ - metric, + source, name, key, order, @@ -1139,7 +1139,7 @@ export function createChart({ parent, brk, fitContent }) { paneIndex, unit, defaultActive, - metric, + source, setOrder: (order) => iseries.setSeriesOrder(order), applyOptions(active, highlighted) { iseries.applyOptions({ @@ -1159,7 +1159,7 @@ export function createChart({ parent, brk, fitContent }) { /** * Add a DotsBaseline series (baseline with point markers instead of line) * @param {Object} args - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.source * @param {string} args.name * @param {string} [args.key] * @param {number} args.order @@ -1171,7 +1171,7 @@ export function createChart({ parent, brk, fitContent }) { * @param {BaselineSeriesPartialOptions} [args.options] */ addDotsBaseline({ - metric, + source, name, key, order, @@ -1224,7 +1224,7 @@ export function createChart({ parent, brk, fitContent }) { paneIndex, unit, defaultActive, - metric, + source, setOrder: (order) => iseries.setSeriesOrder(order), applyOptions(active, highlighted) { iseries.applyOptions({ @@ -1343,10 +1343,10 @@ export function createChart({ parent, brk, fitContent }) { const defaultColor = unit === Unit.usd ? colors.usd : colors.bitcoin; map.get(unit)?.forEach((blueprint, order) => { - if (!Object.keys(blueprint.metric.by).includes(idx)) return; + if (!Object.keys(blueprint.series.by).includes(idx)) return; const common = { - metric: blueprint.metric, + source: blueprint.series, name: blueprint.title, key: blueprint.key, defaultActive: blueprint.defaultActive, @@ -1398,7 +1398,7 @@ export function createChart({ parent, brk, fitContent }) { pane.series.push( serieses.addCandlestick({ ...common, - metric: blueprint.ohlcMetric, + source: blueprint.ohlcSeries, colors: blueprint.colors, }), ); diff --git a/website/scripts/chart/legend.js b/website/scripts/chart/legend.js index 458f45a83..6a7961d8a 100644 --- a/website/scripts/chart/legend.js +++ b/website/scripts/chart/legend.js @@ -119,7 +119,7 @@ export function createLegend() { anchor.href = series.url; anchor.target = "_blank"; anchor.rel = "noopener noreferrer"; - anchor.title = "Open the metric data in a new tab"; + anchor.title = "Open the series data in a new tab"; div.append(anchor); } }, diff --git a/website/scripts/options/cointime.js b/website/scripts/options/cointime.js index 3bdf31229..b79e2bde7 100644 --- a/website/scripts/options/cointime.js +++ b/website/scripts/options/cointime.js @@ -9,7 +9,7 @@ import { satsBtcUsd, priceRatioPercentilesTree } from "./shared.js"; * @returns {PartialOptionsGroup} */ export function createCointimeSection() { - const { cointime, cohorts, supply } = brk.metrics; + const { cointime, cohorts, supply } = brk.series; const { prices: cointimePrices, cap, @@ -24,9 +24,9 @@ export function createCointimeSection() { // Reference lines for cap comparisons const capReferenceLines = /** @type {const} */ ([ - { metric: supply.marketCap.usd, name: "Market", color: colors.default }, + { series: supply.marketCap.usd, name: "Market", color: colors.default }, { - metric: all.realized.cap.usd, + series: all.realized.cap.usd, name: "Realized", color: colors.realized, }, @@ -76,11 +76,11 @@ export function createCointimeSection() { ]); const caps = /** @type {const} */ ([ - { metric: cap.vaulted.usd, name: "Vaulted", color: colors.vaulted }, - { metric: cap.active.usd, name: "Active", color: colors.active }, - { metric: cap.cointime.usd, name: "Cointime", color: colors.cointime }, - { metric: cap.investor.usd, name: "Investor", color: colors.investor }, - { metric: cap.thermo.usd, name: "Thermo", color: colors.thermo }, + { series: cap.vaulted.usd, name: "Vaulted", color: colors.vaulted }, + { series: cap.active.usd, name: "Active", color: colors.active }, + { series: cap.cointime.usd, name: "Cointime", color: colors.cointime }, + { series: cap.investor.usd, name: "Investor", color: colors.investor }, + { series: cap.thermo.usd, name: "Thermo", color: colors.thermo }, ]); const supplyBreakdown = /** @type {const} */ ([ @@ -159,17 +159,17 @@ export function createCointimeSection() { title: "Cointime Prices", top: [ price({ - metric: all.realized.price, + series: all.realized.price, name: "Realized", color: colors.realized, }), price({ - metric: all.realized.investor.price, + series: all.realized.investor.price, name: "Investor", color: colors.investor, }), ...prices.map(({ pattern, name, color }) => - price({ metric: pattern, name, color }), + price({ series: pattern, name, color }), ), ], }, @@ -181,7 +181,7 @@ export function createCointimeSection() { legend: name, color, priceReferences: [ - price({ metric: all.realized.price, name: "Realized", color: colors.realized, defaultActive: false }), + price({ series: all.realized.price, name: "Realized", color: colors.realized, defaultActive: false }), ], }), })), @@ -196,22 +196,22 @@ export function createCointimeSection() { name: "Compare", title: "Cointime Caps", bottom: [ - ...capReferenceLines.map(({ metric, name, color }) => - line({ metric, name, color, unit: Unit.usd }), + ...capReferenceLines.map(({ series, name, color }) => + line({ series, name, color, unit: Unit.usd }), ), - ...caps.map(({ metric, name, color }) => - line({ metric, name, color, unit: Unit.usd }), + ...caps.map(({ series, name, color }) => + line({ series, name, color, unit: Unit.usd }), ), ], }, - ...caps.map(({ metric, name, color }) => ({ + ...caps.map(({ series, name, color }) => ({ name, title: `${name} Cap`, bottom: [ - line({ metric, name, color, unit: Unit.usd }), + line({ series, name, color, unit: Unit.usd }), ...capReferenceLines.map((ref) => line({ - metric: ref.metric, + series: ref.series, name: ref.name, color: ref.color, unit: Unit.usd, @@ -237,19 +237,19 @@ export function createCointimeSection() { title: "Liveliness & Vaultedness", bottom: [ line({ - metric: activity.liveliness, + series: activity.liveliness, name: "Liveliness", color: colors.liveliness, unit: Unit.ratio, }), line({ - metric: activity.vaultedness, + series: activity.vaultedness, name: "Vaultedness", color: colors.vaulted, unit: Unit.ratio, }), line({ - metric: activity.ratio, + series: activity.ratio, name: "L/V Ratio", color: colors.activity, unit: Unit.ratio, @@ -270,7 +270,7 @@ export function createCointimeSection() { title: "Coinblocks", bottom: coinblocks.map(({ pattern, name, color }) => line({ - metric: pattern.base, + series: pattern.base, name, color, unit: Unit.coinblocks, @@ -282,7 +282,7 @@ export function createCointimeSection() { title: "Coinblocks (Total)", bottom: coinblocks.map(({ pattern, name, color }) => line({ - metric: pattern.cumulative, + series: pattern.cumulative, name, color, unit: Unit.coinblocks, @@ -299,7 +299,7 @@ export function createCointimeSection() { title, bottom: [ line({ - metric: pattern.base, + series: pattern.base, name, color, unit: Unit.coinblocks, @@ -312,7 +312,7 @@ export function createCointimeSection() { title: `${title} (Total)`, bottom: [ line({ - metric: pattern.cumulative, + series: pattern.cumulative, name, color, unit: Unit.coinblocks, @@ -336,10 +336,10 @@ export function createCointimeSection() { title: "Cointime Value", bottom: [ ...cointimeValues.map(({ pattern, name, color }) => - line({ metric: pattern.base, name, color, unit: Unit.usd }), + line({ series: pattern.base, name, color, unit: Unit.usd }), ), line({ - metric: vocdd.pattern.base, + series: vocdd.pattern.base, name: vocdd.name, color: vocdd.color, unit: Unit.usd, @@ -352,14 +352,14 @@ export function createCointimeSection() { bottom: [ ...cointimeValues.map(({ pattern, name, color }) => line({ - metric: pattern.cumulative, + series: pattern.cumulative, name, color, unit: Unit.usd, }), ), line({ - metric: vocdd.pattern.cumulative, + series: vocdd.pattern.cumulative, name: vocdd.name, color: vocdd.color, unit: Unit.usd, @@ -375,7 +375,7 @@ export function createCointimeSection() { name: "Base", title, bottom: [ - line({ metric: pattern.base, name, color, unit: Unit.usd }), + line({ series: pattern.base, name, color, unit: Unit.usd }), ], }, rollingWindowsTree({ windows: pattern.sum, title, unit: Unit.usd }), @@ -384,7 +384,7 @@ export function createCointimeSection() { title: `${title} (Total)`, bottom: [ line({ - metric: pattern.cumulative, + series: pattern.cumulative, name, color, unit: Unit.usd, @@ -401,13 +401,13 @@ export function createCointimeSection() { title: vocdd.title, bottom: [ line({ - metric: vocdd.pattern.base, + series: vocdd.pattern.base, name: vocdd.name, color: vocdd.color, unit: Unit.usd, }), line({ - metric: reserveRisk.vocddMedian1y, + series: reserveRisk.vocddMedian1y, name: "365d Median", color: colors.time._1y, unit: Unit.usd, @@ -420,7 +420,7 @@ export function createCointimeSection() { title: `${vocdd.title} (Total)`, bottom: [ line({ - metric: vocdd.pattern.cumulative, + series: vocdd.pattern.cumulative, name: vocdd.name, color: vocdd.color, unit: Unit.usd, @@ -432,7 +432,7 @@ export function createCointimeSection() { ], }, - // Indicators - derived decision metrics + // Indicators - derived decision series { name: "Indicators", tree: [ @@ -441,7 +441,7 @@ export function createCointimeSection() { title: "Reserve Risk", bottom: [ line({ - metric: reserveRisk.value, + series: reserveRisk.value, name: "Ratio", color: colors.reserveRisk, unit: Unit.ratio, @@ -453,7 +453,7 @@ export function createCointimeSection() { title: "AVIV Ratio", bottom: [ baseline({ - metric: cap.aviv.ratio, + series: cap.aviv.ratio, name: "Ratio", color: colors.reserveRisk, unit: Unit.ratio, @@ -466,7 +466,7 @@ export function createCointimeSection() { title: "HODL Bank", bottom: [ line({ - metric: reserveRisk.hodlBank, + series: reserveRisk.hodlBank, name: "Value", color: colors.hodlBank, unit: Unit.usd, @@ -476,7 +476,7 @@ export function createCointimeSection() { ], }, - // Cointime-Adjusted - comparing base vs adjusted metrics + // Cointime-Adjusted - comparing base vs adjusted series { name: "Cointime-Adjusted", tree: [ @@ -485,7 +485,7 @@ export function createCointimeSection() { title: "Cointime-Adjusted Inflation", bottom: [ dots({ - metric: supply.inflationRate.percent, + series: supply.inflationRate.percent, name: "Base", color: colors.base, unit: Unit.percentage, @@ -505,13 +505,13 @@ export function createCointimeSection() { title: "Cointime-Adjusted BTC Velocity", bottom: [ line({ - metric: supply.velocity.native, + series: supply.velocity.native, name: "Base", color: colors.base, unit: Unit.ratio, }), line({ - metric: adjusted.txVelocityNative, + series: adjusted.txVelocityNative, name: "Cointime-Adjusted", color: colors.adjusted, unit: Unit.ratio, @@ -523,13 +523,13 @@ export function createCointimeSection() { title: "Cointime-Adjusted USD Velocity", bottom: [ line({ - metric: supply.velocity.fiat, + series: supply.velocity.fiat, name: "Base", color: colors.thermo, unit: Unit.ratio, }), line({ - metric: adjusted.txVelocityFiat, + series: adjusted.txVelocityFiat, name: "Cointime-Adjusted", color: colors.vaulted, unit: Unit.ratio, diff --git a/website/scripts/options/constants.js b/website/scripts/options/constants.js index 9a23c70b1..3f01094a2 100644 --- a/website/scripts/options/constants.js +++ b/website/scripts/options/constants.js @@ -7,17 +7,17 @@ import { line } from "./series.js"; /** * Get constant pattern by number dynamically from tree * Examples: 0 → _0, 38.2 → _382, -1 → minus1 - * @param {BrkClient["metrics"]["constants"]} constants + * @param {BrkClient["series"]["constants"]} constants * @param {number} num - * @returns {AnyMetricPattern} + * @returns {AnySeriesPattern} */ export function getConstant(constants, num) { const key = num >= 0 ? `_${String(num).replace(".", "")}` : `minus${Math.abs(num)}`; - const constant = /** @type {AnyMetricPattern | undefined} */ ( - /** @type {Record} */ (constants)[key] + const constant = /** @type {AnySeriesPattern | undefined} */ ( + /** @type {Record} */ (constants)[key] ); if (!constant) throw new Error(`Unknown constant: ${num} (key: ${key})`); return constant; @@ -25,12 +25,12 @@ export function getConstant(constants, num) { /** * Create a price line series (horizontal reference line) - * @param {{ number?: number, name?: string } & Omit<(Parameters)[0], 'name' | 'metric'>} args + * @param {{ number?: number, name?: string } & Omit<(Parameters)[0], 'name' | 'series'>} args */ export function priceLine(args) { return line({ ...args, - metric: getConstant(brk.metrics.constants, args.number || 0), + series: getConstant(brk.series.constants, args.number || 0), name: args.name || `${args.number ?? 0}`, color: args.color ?? colors.gray, options: { diff --git a/website/scripts/options/distribution/activity.js b/website/scripts/options/distribution/activity.js index 159312ca6..57f85967f 100644 --- a/website/scripts/options/distribution/activity.js +++ b/website/scripts/options/distribution/activity.js @@ -23,7 +23,7 @@ import { colors } from "../../utils/colors.js"; /** * @param {{ sent: Brk.BaseCumulativeInSumPattern, coindaysDestroyed: Brk.BaseCumulativeSumPattern }} activity * @param {Color} color - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function volumeAndCoinsTree(activity, color, title) { @@ -35,18 +35,18 @@ function volumeAndCoinsTree(activity, color, title) { name: "Sum", title: title("Sent Volume"), bottom: [ - line({ metric: activity.sent.base, name: "Sum", color, unit: Unit.sats }), - line({ metric: activity.sent.sum._24h, name: "24h", color: colors.time._24h, unit: Unit.sats, defaultActive: false }), - line({ metric: activity.sent.sum._1w, name: "1w", color: colors.time._1w, unit: Unit.sats, defaultActive: false }), - line({ metric: activity.sent.sum._1m, name: "1m", color: colors.time._1m, unit: Unit.sats, defaultActive: false }), - line({ metric: activity.sent.sum._1y, name: "1y", color: colors.time._1y, unit: Unit.sats, defaultActive: false }), + line({ series: activity.sent.base, name: "Sum", color, unit: Unit.sats }), + line({ series: activity.sent.sum._24h, name: "24h", color: colors.time._24h, unit: Unit.sats, defaultActive: false }), + line({ series: activity.sent.sum._1w, name: "1w", color: colors.time._1w, unit: Unit.sats, defaultActive: false }), + line({ series: activity.sent.sum._1m, name: "1m", color: colors.time._1m, unit: Unit.sats, defaultActive: false }), + line({ series: activity.sent.sum._1y, name: "1y", color: colors.time._1y, unit: Unit.sats, defaultActive: false }), ], }, { name: "Cumulative", title: title("Sent Volume (Total)"), bottom: [ - line({ metric: activity.sent.cumulative, name: "All-time", color, unit: Unit.sats }), + line({ series: activity.sent.cumulative, name: "All-time", color, unit: Unit.sats }), ], }, ], @@ -58,18 +58,18 @@ function volumeAndCoinsTree(activity, color, title) { name: "Base", title: title("Coindays Destroyed"), bottom: [ - line({ metric: activity.coindaysDestroyed.base, name: "Base", color, unit: Unit.coindays }), - line({ metric: activity.coindaysDestroyed.sum._24h, name: "24h", color: colors.time._24h, unit: Unit.coindays, defaultActive: false }), - line({ metric: activity.coindaysDestroyed.sum._1w, name: "1w", color: colors.time._1w, unit: Unit.coindays, defaultActive: false }), - line({ metric: activity.coindaysDestroyed.sum._1m, name: "1m", color: colors.time._1m, unit: Unit.coindays, defaultActive: false }), - line({ metric: activity.coindaysDestroyed.sum._1y, name: "1y", color: colors.time._1y, unit: Unit.coindays, defaultActive: false }), + line({ series: activity.coindaysDestroyed.base, name: "Base", color, unit: Unit.coindays }), + line({ series: activity.coindaysDestroyed.sum._24h, name: "24h", color: colors.time._24h, unit: Unit.coindays, defaultActive: false }), + line({ series: activity.coindaysDestroyed.sum._1w, name: "1w", color: colors.time._1w, unit: Unit.coindays, defaultActive: false }), + line({ series: activity.coindaysDestroyed.sum._1m, name: "1m", color: colors.time._1m, unit: Unit.coindays, defaultActive: false }), + line({ series: activity.coindaysDestroyed.sum._1y, name: "1y", color: colors.time._1y, unit: Unit.coindays, defaultActive: false }), ], }, { name: "Cumulative", title: title("Cumulative Coindays Destroyed"), bottom: [ - line({ metric: activity.coindaysDestroyed.cumulative, name: "All-time", color, unit: Unit.coindays }), + line({ series: activity.coindaysDestroyed.cumulative, name: "All-time", color, unit: Unit.coindays }), ], }, ], @@ -80,7 +80,7 @@ function volumeAndCoinsTree(activity, color, title) { /** * Sent in profit/loss breakdown tree (shared by full and mid-level activity) * @param {Brk.BaseCumulativeInSumPattern} sent - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function sentProfitLossTree(sent, title) { @@ -92,39 +92,39 @@ function sentProfitLossTree(sent, title) { name: "USD", title: title("Sent Volume In Profit"), bottom: [ - line({ metric: sent.inProfit.base.usd, name: "Base", color: colors.profit, unit: Unit.usd }), - line({ metric: sent.inProfit.sum._24h.usd, name: "24h", color: colors.time._24h, unit: Unit.usd, defaultActive: false }), - line({ metric: sent.inProfit.sum._1w.usd, name: "1w", color: colors.time._1w, unit: Unit.usd, defaultActive: false }), - line({ metric: sent.inProfit.sum._1m.usd, name: "1m", color: colors.time._1m, unit: Unit.usd, defaultActive: false }), - line({ metric: sent.inProfit.sum._1y.usd, name: "1y", color: colors.time._1y, unit: Unit.usd, defaultActive: false }), + line({ series: sent.inProfit.base.usd, name: "Base", color: colors.profit, unit: Unit.usd }), + line({ series: sent.inProfit.sum._24h.usd, name: "24h", color: colors.time._24h, unit: Unit.usd, defaultActive: false }), + line({ series: sent.inProfit.sum._1w.usd, name: "1w", color: colors.time._1w, unit: Unit.usd, defaultActive: false }), + line({ series: sent.inProfit.sum._1m.usd, name: "1m", color: colors.time._1m, unit: Unit.usd, defaultActive: false }), + line({ series: sent.inProfit.sum._1y.usd, name: "1y", color: colors.time._1y, unit: Unit.usd, defaultActive: false }), ], }, { name: "BTC", title: title("Sent Volume In Profit (BTC)"), bottom: [ - line({ metric: sent.inProfit.base.btc, name: "Base", color: colors.profit, unit: Unit.btc }), - line({ metric: sent.inProfit.sum._24h.btc, name: "24h", color: colors.time._24h, unit: Unit.btc, defaultActive: false }), - line({ metric: sent.inProfit.sum._1w.btc, name: "1w", color: colors.time._1w, unit: Unit.btc, defaultActive: false }), - line({ metric: sent.inProfit.sum._1m.btc, name: "1m", color: colors.time._1m, unit: Unit.btc, defaultActive: false }), - line({ metric: sent.inProfit.sum._1y.btc, name: "1y", color: colors.time._1y, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inProfit.base.btc, name: "Base", color: colors.profit, unit: Unit.btc }), + line({ series: sent.inProfit.sum._24h.btc, name: "24h", color: colors.time._24h, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inProfit.sum._1w.btc, name: "1w", color: colors.time._1w, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inProfit.sum._1m.btc, name: "1m", color: colors.time._1m, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inProfit.sum._1y.btc, name: "1y", color: colors.time._1y, unit: Unit.btc, defaultActive: false }), ], }, { name: "Sats", title: title("Sent Volume In Profit (Sats)"), bottom: [ - line({ metric: sent.inProfit.base.sats, name: "Base", color: colors.profit, unit: Unit.sats }), - line({ metric: sent.inProfit.sum._24h.sats, name: "24h", color: colors.time._24h, unit: Unit.sats, defaultActive: false }), - line({ metric: sent.inProfit.sum._1w.sats, name: "1w", color: colors.time._1w, unit: Unit.sats, defaultActive: false }), - line({ metric: sent.inProfit.sum._1m.sats, name: "1m", color: colors.time._1m, unit: Unit.sats, defaultActive: false }), - line({ metric: sent.inProfit.sum._1y.sats, name: "1y", color: colors.time._1y, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inProfit.base.sats, name: "Base", color: colors.profit, unit: Unit.sats }), + line({ series: sent.inProfit.sum._24h.sats, name: "24h", color: colors.time._24h, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inProfit.sum._1w.sats, name: "1w", color: colors.time._1w, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inProfit.sum._1m.sats, name: "1m", color: colors.time._1m, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inProfit.sum._1y.sats, name: "1y", color: colors.time._1y, unit: Unit.sats, defaultActive: false }), ], }, { name: "Cumulative", title: title("Cumulative Sent In Profit"), bottom: [ - line({ metric: sent.inProfit.cumulative.usd, name: "USD", color: colors.profit, unit: Unit.usd }), - line({ metric: sent.inProfit.cumulative.btc, name: "BTC", color: colors.profit, unit: Unit.btc, defaultActive: false }), - line({ metric: sent.inProfit.cumulative.sats, name: "Sats", color: colors.profit, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inProfit.cumulative.usd, name: "USD", color: colors.profit, unit: Unit.usd }), + line({ series: sent.inProfit.cumulative.btc, name: "BTC", color: colors.profit, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inProfit.cumulative.sats, name: "Sats", color: colors.profit, unit: Unit.sats, defaultActive: false }), ]}, ], }, @@ -135,39 +135,39 @@ function sentProfitLossTree(sent, title) { name: "USD", title: title("Sent Volume In Loss"), bottom: [ - line({ metric: sent.inLoss.base.usd, name: "Base", color: colors.loss, unit: Unit.usd }), - line({ metric: sent.inLoss.sum._24h.usd, name: "24h", color: colors.time._24h, unit: Unit.usd, defaultActive: false }), - line({ metric: sent.inLoss.sum._1w.usd, name: "1w", color: colors.time._1w, unit: Unit.usd, defaultActive: false }), - line({ metric: sent.inLoss.sum._1m.usd, name: "1m", color: colors.time._1m, unit: Unit.usd, defaultActive: false }), - line({ metric: sent.inLoss.sum._1y.usd, name: "1y", color: colors.time._1y, unit: Unit.usd, defaultActive: false }), + line({ series: sent.inLoss.base.usd, name: "Base", color: colors.loss, unit: Unit.usd }), + line({ series: sent.inLoss.sum._24h.usd, name: "24h", color: colors.time._24h, unit: Unit.usd, defaultActive: false }), + line({ series: sent.inLoss.sum._1w.usd, name: "1w", color: colors.time._1w, unit: Unit.usd, defaultActive: false }), + line({ series: sent.inLoss.sum._1m.usd, name: "1m", color: colors.time._1m, unit: Unit.usd, defaultActive: false }), + line({ series: sent.inLoss.sum._1y.usd, name: "1y", color: colors.time._1y, unit: Unit.usd, defaultActive: false }), ], }, { name: "BTC", title: title("Sent Volume In Loss (BTC)"), bottom: [ - line({ metric: sent.inLoss.base.btc, name: "Base", color: colors.loss, unit: Unit.btc }), - line({ metric: sent.inLoss.sum._24h.btc, name: "24h", color: colors.time._24h, unit: Unit.btc, defaultActive: false }), - line({ metric: sent.inLoss.sum._1w.btc, name: "1w", color: colors.time._1w, unit: Unit.btc, defaultActive: false }), - line({ metric: sent.inLoss.sum._1m.btc, name: "1m", color: colors.time._1m, unit: Unit.btc, defaultActive: false }), - line({ metric: sent.inLoss.sum._1y.btc, name: "1y", color: colors.time._1y, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inLoss.base.btc, name: "Base", color: colors.loss, unit: Unit.btc }), + line({ series: sent.inLoss.sum._24h.btc, name: "24h", color: colors.time._24h, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inLoss.sum._1w.btc, name: "1w", color: colors.time._1w, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inLoss.sum._1m.btc, name: "1m", color: colors.time._1m, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inLoss.sum._1y.btc, name: "1y", color: colors.time._1y, unit: Unit.btc, defaultActive: false }), ], }, { name: "Sats", title: title("Sent Volume In Loss (Sats)"), bottom: [ - line({ metric: sent.inLoss.base.sats, name: "Base", color: colors.loss, unit: Unit.sats }), - line({ metric: sent.inLoss.sum._24h.sats, name: "24h", color: colors.time._24h, unit: Unit.sats, defaultActive: false }), - line({ metric: sent.inLoss.sum._1w.sats, name: "1w", color: colors.time._1w, unit: Unit.sats, defaultActive: false }), - line({ metric: sent.inLoss.sum._1m.sats, name: "1m", color: colors.time._1m, unit: Unit.sats, defaultActive: false }), - line({ metric: sent.inLoss.sum._1y.sats, name: "1y", color: colors.time._1y, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inLoss.base.sats, name: "Base", color: colors.loss, unit: Unit.sats }), + line({ series: sent.inLoss.sum._24h.sats, name: "24h", color: colors.time._24h, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inLoss.sum._1w.sats, name: "1w", color: colors.time._1w, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inLoss.sum._1m.sats, name: "1m", color: colors.time._1m, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inLoss.sum._1y.sats, name: "1y", color: colors.time._1y, unit: Unit.sats, defaultActive: false }), ], }, { name: "Cumulative", title: title("Cumulative Sent In Loss"), bottom: [ - line({ metric: sent.inLoss.cumulative.usd, name: "USD", color: colors.loss, unit: Unit.usd }), - line({ metric: sent.inLoss.cumulative.btc, name: "BTC", color: colors.loss, unit: Unit.btc, defaultActive: false }), - line({ metric: sent.inLoss.cumulative.sats, name: "Sats", color: colors.loss, unit: Unit.sats, defaultActive: false }), + line({ series: sent.inLoss.cumulative.usd, name: "USD", color: colors.loss, unit: Unit.usd }), + line({ series: sent.inLoss.cumulative.btc, name: "BTC", color: colors.loss, unit: Unit.btc, defaultActive: false }), + line({ series: sent.inLoss.cumulative.sats, name: "Sats", color: colors.loss, unit: Unit.sats, defaultActive: false }), ]}, ], }, @@ -178,7 +178,7 @@ function sentProfitLossTree(sent, title) { * Volume and coins tree with coinyears, dormancy, and sent in profit/loss (All/STH/LTH) * @param {Brk.CoindaysCoinyearsDormancySentPattern} activity * @param {Color} color - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function fullVolumeTree(activity, color, title) { @@ -188,12 +188,12 @@ function fullVolumeTree(activity, color, title) { { name: "Coinyears Destroyed", title: title("Coinyears Destroyed"), - bottom: [line({ metric: activity.coinyearsDestroyed, name: "CYD", color, unit: Unit.years })], + bottom: [line({ series: activity.coinyearsDestroyed, name: "CYD", color, unit: Unit.years })], }, { name: "Dormancy", title: title("Dormancy"), - bottom: [line({ metric: activity.dormancy, name: "Dormancy", color, unit: Unit.days })], + bottom: [line({ series: activity.dormancy, name: "Dormancy", color, unit: Unit.days })], }, ]; } @@ -204,7 +204,7 @@ function fullVolumeTree(activity, color, title) { /** * @param {Brk._1m1w1y24hPattern} ratio - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @param {string} [prefix] * @returns {PartialOptionsTree} */ @@ -214,31 +214,31 @@ function singleRollingSoprTree(ratio, title, prefix = "") { name: "Compare", title: title(`Rolling ${prefix}SOPR`), bottom: [ - baseline({ metric: ratio._24h, name: "24h", color: colors.time._24h, unit: Unit.ratio, base: 1 }), - baseline({ metric: ratio._1w, name: "7d", color: colors.time._1w, unit: Unit.ratio, base: 1 }), - baseline({ metric: ratio._1m, name: "30d", color: colors.time._1m, unit: Unit.ratio, base: 1 }), - baseline({ metric: ratio._1y, name: "1y", color: colors.time._1y, unit: Unit.ratio, base: 1 }), + baseline({ series: ratio._24h, name: "24h", color: colors.time._24h, unit: Unit.ratio, base: 1 }), + baseline({ series: ratio._1w, name: "7d", color: colors.time._1w, unit: Unit.ratio, base: 1 }), + baseline({ series: ratio._1m, name: "30d", color: colors.time._1m, unit: Unit.ratio, base: 1 }), + baseline({ series: ratio._1y, name: "1y", color: colors.time._1y, unit: Unit.ratio, base: 1 }), ], }, { name: "24h", title: title(`${prefix}SOPR (24h)`), - bottom: [dotsBaseline({ metric: ratio._24h, name: "24h", unit: Unit.ratio, base: 1 })], + bottom: [dotsBaseline({ series: ratio._24h, name: "24h", unit: Unit.ratio, base: 1 })], }, { name: "7d", title: title(`${prefix}SOPR (7d)`), - bottom: [baseline({ metric: ratio._1w, name: "SOPR", unit: Unit.ratio, base: 1 })], + bottom: [baseline({ series: ratio._1w, name: "SOPR", unit: Unit.ratio, base: 1 })], }, { name: "30d", title: title(`${prefix}SOPR (30d)`), - bottom: [baseline({ metric: ratio._1m, name: "SOPR", unit: Unit.ratio, base: 1 })], + bottom: [baseline({ series: ratio._1m, name: "SOPR", unit: Unit.ratio, base: 1 })], }, { name: "1y", title: title(`${prefix}SOPR (1y)`), - bottom: [baseline({ metric: ratio._1y, name: "SOPR", unit: Unit.ratio, base: 1 })], + bottom: [baseline({ series: ratio._1y, name: "SOPR", unit: Unit.ratio, base: 1 })], }, ]; } @@ -249,7 +249,7 @@ function singleRollingSoprTree(ratio, title, prefix = "") { /** * @param {Brk._1m1w1y24hPattern6} sellSideRisk - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function singleSellSideRiskTree(sellSideRisk, title) { @@ -294,7 +294,7 @@ function singleSellSideRiskTree(sellSideRisk, title) { /** * @param {Brk.BaseCumulativeSumPattern} valueCreated * @param {Brk.BaseCumulativeSumPattern} valueDestroyed - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @param {string} [prefix] * @returns {PartialOptionsTree} */ @@ -307,20 +307,20 @@ function singleRollingValueTree(valueCreated, valueDestroyed, title, prefix = "" name: "Created", title: title(`Rolling ${prefix}Value Created`), bottom: [ - line({ metric: valueCreated.sum._24h, name: "24h", color: colors.time._24h, unit: Unit.usd }), - line({ metric: valueCreated.sum._1w, name: "7d", color: colors.time._1w, unit: Unit.usd }), - line({ metric: valueCreated.sum._1m, name: "30d", color: colors.time._1m, unit: Unit.usd }), - line({ metric: valueCreated.sum._1y, name: "1y", color: colors.time._1y, unit: Unit.usd }), + line({ series: valueCreated.sum._24h, name: "24h", color: colors.time._24h, unit: Unit.usd }), + line({ series: valueCreated.sum._1w, name: "7d", color: colors.time._1w, unit: Unit.usd }), + line({ series: valueCreated.sum._1m, name: "30d", color: colors.time._1m, unit: Unit.usd }), + line({ series: valueCreated.sum._1y, name: "1y", color: colors.time._1y, unit: Unit.usd }), ], }, { name: "Destroyed", title: title(`Rolling ${prefix}Value Destroyed`), bottom: [ - line({ metric: valueDestroyed.sum._24h, name: "24h", color: colors.time._24h, unit: Unit.usd }), - line({ metric: valueDestroyed.sum._1w, name: "7d", color: colors.time._1w, unit: Unit.usd }), - line({ metric: valueDestroyed.sum._1m, name: "30d", color: colors.time._1m, unit: Unit.usd }), - line({ metric: valueDestroyed.sum._1y, name: "1y", color: colors.time._1y, unit: Unit.usd }), + line({ series: valueDestroyed.sum._24h, name: "24h", color: colors.time._24h, unit: Unit.usd }), + line({ series: valueDestroyed.sum._1w, name: "7d", color: colors.time._1w, unit: Unit.usd }), + line({ series: valueDestroyed.sum._1m, name: "30d", color: colors.time._1m, unit: Unit.usd }), + line({ series: valueDestroyed.sum._1y, name: "1y", color: colors.time._1y, unit: Unit.usd }), ], }, ], @@ -329,40 +329,40 @@ function singleRollingValueTree(valueCreated, valueDestroyed, title, prefix = "" name: "24h", title: title(`${prefix}Value Created & Destroyed (24h)`), bottom: [ - line({ metric: valueCreated.sum._24h, name: "Created", color: colors.usd, unit: Unit.usd }), - line({ metric: valueDestroyed.sum._24h, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: valueCreated.sum._24h, name: "Created", color: colors.usd, unit: Unit.usd }), + line({ series: valueDestroyed.sum._24h, name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], }, { name: "7d", title: title(`${prefix}Value Created & Destroyed (7d)`), bottom: [ - line({ metric: valueCreated.sum._1w, name: "Created", color: colors.usd, unit: Unit.usd }), - line({ metric: valueDestroyed.sum._1w, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: valueCreated.sum._1w, name: "Created", color: colors.usd, unit: Unit.usd }), + line({ series: valueDestroyed.sum._1w, name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], }, { name: "30d", title: title(`${prefix}Value Created & Destroyed (30d)`), bottom: [ - line({ metric: valueCreated.sum._1m, name: "Created", color: colors.usd, unit: Unit.usd }), - line({ metric: valueDestroyed.sum._1m, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: valueCreated.sum._1m, name: "Created", color: colors.usd, unit: Unit.usd }), + line({ series: valueDestroyed.sum._1m, name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], }, { name: "1y", title: title(`${prefix}Value Created & Destroyed (1y)`), bottom: [ - line({ metric: valueCreated.sum._1y, name: "Created", color: colors.usd, unit: Unit.usd }), - line({ metric: valueDestroyed.sum._1y, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: valueCreated.sum._1y, name: "Created", color: colors.usd, unit: Unit.usd }), + line({ series: valueDestroyed.sum._1y, name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], }, { name: "Cumulative", title: title(`${prefix}Value Created & Destroyed (Total)`), bottom: [ - line({ metric: valueCreated.cumulative, name: "Created", color: colors.usd, unit: Unit.usd }), - line({ metric: valueDestroyed.cumulative, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: valueCreated.cumulative, name: "Created", color: colors.usd, unit: Unit.usd }), + line({ series: valueDestroyed.cumulative, name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], }, ]; @@ -374,12 +374,12 @@ function singleRollingValueTree(valueCreated, valueDestroyed, title, prefix = "" * @param {Brk.BaseCapitulationCumulativeNegativeRelSumValuePattern} loss * @param {Brk.BaseCumulativeSumPattern} valueCreated * @param {Brk.BaseCumulativeSumPattern} valueDestroyed - * @param {AnyFetchedSeriesBlueprint[]} extraValueMetrics + * @param {AnyFetchedSeriesBlueprint[]} extraValueSeries * @param {PartialOptionsTree} rollingTree - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ -function fullValueSection(profit, loss, valueCreated, valueDestroyed, extraValueMetrics, rollingTree, title) { +function fullValueSection(profit, loss, valueCreated, valueDestroyed, extraValueSeries, rollingTree, title) { return { name: "Value", tree: [ @@ -387,17 +387,17 @@ function fullValueSection(profit, loss, valueCreated, valueDestroyed, extraValue name: "Flows", title: title("Profit & Capitulation Flows"), bottom: [ - line({ metric: profit.distributionFlow, name: "Distribution Flow", color: colors.profit, unit: Unit.usd }), - line({ metric: loss.capitulationFlow, name: "Capitulation Flow", color: colors.loss, unit: Unit.usd }), + line({ series: profit.distributionFlow, name: "Distribution Flow", color: colors.profit, unit: Unit.usd }), + line({ series: loss.capitulationFlow, name: "Capitulation Flow", color: colors.loss, unit: Unit.usd }), ], }, { name: "Created & Destroyed", title: title("Value Created & Destroyed"), bottom: [ - line({ metric: valueCreated.base, name: "Created", color: colors.usd, unit: Unit.usd }), - line({ metric: valueDestroyed.base, name: "Destroyed", color: colors.loss, unit: Unit.usd }), - ...extraValueMetrics, + line({ series: valueCreated.base, name: "Created", color: colors.usd, unit: Unit.usd }), + line({ series: valueDestroyed.base, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + ...extraValueSeries, ], }, { @@ -407,16 +407,16 @@ function fullValueSection(profit, loss, valueCreated, valueDestroyed, extraValue name: "Profit", title: title("Profit Value Created & Destroyed"), bottom: [ - line({ metric: profit.valueCreated.base, name: "Created", color: colors.profit, unit: Unit.usd }), - line({ metric: profit.valueDestroyed.base, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: profit.valueCreated.base, name: "Created", color: colors.profit, unit: Unit.usd }), + line({ series: profit.valueDestroyed.base, name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], }, { name: "Loss", title: title("Loss Value Created & Destroyed"), bottom: [ - line({ metric: loss.valueCreated.base, name: "Created", color: colors.profit, unit: Unit.usd }), - line({ metric: loss.valueDestroyed.base, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: loss.valueCreated.base, name: "Created", color: colors.profit, unit: Unit.usd }), + line({ series: loss.valueDestroyed.base, name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], }, ], @@ -430,7 +430,7 @@ function fullValueSection(profit, loss, valueCreated, valueDestroyed, extraValue * Simple value section (created & destroyed + rolling) * @param {Brk.BaseCumulativeSumPattern} valueCreated * @param {Brk.BaseCumulativeSumPattern} valueDestroyed - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function simpleValueSection(valueCreated, valueDestroyed, title) { @@ -441,8 +441,8 @@ function simpleValueSection(valueCreated, valueDestroyed, title) { name: "Created & Destroyed", title: title("Value Created & Destroyed"), bottom: [ - line({ metric: valueCreated.base, name: "Created", color: colors.usd, unit: Unit.usd }), - line({ metric: valueDestroyed.base, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: valueCreated.base, name: "Created", color: colors.usd, unit: Unit.usd }), + line({ series: valueDestroyed.base, name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], }, { @@ -459,7 +459,7 @@ function simpleValueSection(valueCreated, valueDestroyed, title) { /** * Full activity with adjusted SOPR (All/STH) - * @param {{ cohort: CohortAll | CohortFull, title: (metric: string) => string }} args + * @param {{ cohort: CohortAll | CohortFull, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createActivitySectionWithAdjusted({ cohort, title }) { @@ -489,8 +489,8 @@ export function createActivitySectionWithAdjusted({ cohort, title }) { r.profit, r.loss, sopr.valueCreated, sopr.valueDestroyed, [ - line({ metric: sopr.adjusted.valueCreated.base, name: "Adjusted Created", color: colors.adjustedCreated, unit: Unit.usd, defaultActive: false }), - line({ metric: sopr.adjusted.valueDestroyed.base, name: "Adjusted Destroyed", color: colors.adjustedDestroyed, unit: Unit.usd, defaultActive: false }), + line({ series: sopr.adjusted.valueCreated.base, name: "Adjusted Created", color: colors.adjustedCreated, unit: Unit.usd, defaultActive: false }), + line({ series: sopr.adjusted.valueDestroyed.base, name: "Adjusted Destroyed", color: colors.adjustedDestroyed, unit: Unit.usd, defaultActive: false }), ], [ { @@ -510,7 +510,7 @@ export function createActivitySectionWithAdjusted({ cohort, title }) { /** * Activity section for cohorts with rolling SOPR + sell side risk (LTH, also CohortFull | CohortLongTerm) - * @param {{ cohort: CohortFull | CohortLongTerm, title: (metric: string) => string }} args + * @param {{ cohort: CohortFull | CohortLongTerm, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createActivitySection({ cohort, title }) { @@ -540,7 +540,7 @@ export function createActivitySection({ cohort, title }) { /** * Activity section for cohorts with activity but basic realized (AgeRange/MaxAge — 24h SOPR only) - * @param {{ cohort: CohortAgeRange | CohortWithAdjusted, title: (metric: string) => string }} args + * @param {{ cohort: CohortAgeRange | CohortWithAdjusted, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createActivitySectionWithActivity({ cohort, title }) { @@ -555,7 +555,7 @@ export function createActivitySectionWithActivity({ cohort, title }) { { name: "SOPR", title: title("SOPR (24h)"), - bottom: [dotsBaseline({ metric: sopr.ratio._24h, name: "SOPR", unit: Unit.ratio, base: 1 })], + bottom: [dotsBaseline({ series: sopr.ratio._24h, name: "SOPR", unit: Unit.ratio, base: 1 })], }, simpleValueSection(sopr.valueCreated, sopr.valueDestroyed, title), ], @@ -564,7 +564,7 @@ export function createActivitySectionWithActivity({ cohort, title }) { /** * Minimal activity section for cohorts without activity field (value only) - * @param {{ cohort: CohortBasicWithMarketCap | CohortBasicWithoutMarketCap | CohortWithoutRelative | CohortAddress | AddressCohortObject, title: (metric: string) => string }} args + * @param {{ cohort: CohortBasicWithMarketCap | CohortBasicWithoutMarketCap | CohortWithoutRelative | CohortAddress | AddressCohortObject, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createActivitySectionMinimal({ cohort, title }) { @@ -587,10 +587,10 @@ export function createActivitySectionMinimal({ cohort, title }) { * @template {{ color: Color, name: string }} A * @param {readonly T[]} list * @param {A} all - * @param {(item: T | A) => AnyMetricPattern} getRaw - * @param {(item: T | A) => AnyMetricPattern} get7d - * @param {(item: T | A) => AnyMetricPattern} get30d - * @param {(metric: string) => string} title + * @param {(item: T | A) => AnySeriesPattern} getRaw + * @param {(item: T | A) => AnySeriesPattern} get7d + * @param {(item: T | A) => AnySeriesPattern} get30d + * @param {(name: string) => string} title * @param {string} [prefix] * @returns {PartialOptionsTree} */ @@ -600,21 +600,21 @@ function groupedSoprCharts(list, all, getRaw, get7d, get30d, title, prefix = "") name: "Raw", title: title(`${prefix}SOPR`), bottom: mapCohortsWithAll(list, all, (item) => - baseline({ metric: getRaw(item), name: item.name, color: item.color, unit: Unit.ratio, base: 1 }), + baseline({ series: getRaw(item), name: item.name, color: item.color, unit: Unit.ratio, base: 1 }), ), }, { name: "7d", title: title(`${prefix}SOPR (7d)`), bottom: mapCohortsWithAll(list, all, (item) => - baseline({ metric: get7d(item), name: item.name, color: item.color, unit: Unit.ratio, base: 1 }), + baseline({ series: get7d(item), name: item.name, color: item.color, unit: Unit.ratio, base: 1 }), ), }, { name: "30d", title: title(`${prefix}SOPR (30d)`), bottom: mapCohortsWithAll(list, all, (item) => - baseline({ metric: get30d(item), name: item.name, color: item.color, unit: Unit.ratio, base: 1 }), + baseline({ series: get30d(item), name: item.name, color: item.color, unit: Unit.ratio, base: 1 }), ), }, ]; @@ -625,11 +625,11 @@ function groupedSoprCharts(list, all, getRaw, get7d, get30d, title, prefix = "") * @template {{ color: Color, name: string }} A * @param {readonly T[]} list * @param {A} all - * @param {(item: T | A) => AnyMetricPattern} get24h - * @param {(item: T | A) => AnyMetricPattern} get7d - * @param {(item: T | A) => AnyMetricPattern} get30d - * @param {(item: T | A) => AnyMetricPattern} get1y - * @param {(metric: string) => string} title + * @param {(item: T | A) => AnySeriesPattern} get24h + * @param {(item: T | A) => AnySeriesPattern} get7d + * @param {(item: T | A) => AnySeriesPattern} get30d + * @param {(item: T | A) => AnySeriesPattern} get1y + * @param {(name: string) => string} title * @param {string} [prefix] * @returns {PartialOptionsTree} */ @@ -639,28 +639,28 @@ function groupedRollingSoprCharts(list, all, get24h, get7d, get30d, get1y, title name: "24h", title: title(`${prefix}SOPR (24h)`), bottom: mapCohortsWithAll(list, all, (c) => - baseline({ metric: get24h(c), name: c.name, color: c.color, unit: Unit.ratio, base: 1 }), + baseline({ series: get24h(c), name: c.name, color: c.color, unit: Unit.ratio, base: 1 }), ), }, { name: "7d", title: title(`${prefix}SOPR (7d)`), bottom: mapCohortsWithAll(list, all, (c) => - baseline({ metric: get7d(c), name: c.name, color: c.color, unit: Unit.ratio, base: 1 }), + baseline({ series: get7d(c), name: c.name, color: c.color, unit: Unit.ratio, base: 1 }), ), }, { name: "30d", title: title(`${prefix}SOPR (30d)`), bottom: mapCohortsWithAll(list, all, (c) => - baseline({ metric: get30d(c), name: c.name, color: c.color, unit: Unit.ratio, base: 1 }), + baseline({ series: get30d(c), name: c.name, color: c.color, unit: Unit.ratio, base: 1 }), ), }, { name: "1y", title: title(`${prefix}SOPR (1y)`), bottom: mapCohortsWithAll(list, all, (c) => - baseline({ metric: get1y(c), name: c.name, color: c.color, unit: Unit.ratio, base: 1 }), + baseline({ series: get1y(c), name: c.name, color: c.color, unit: Unit.ratio, base: 1 }), ), }, ]; @@ -675,8 +675,8 @@ function groupedRollingSoprCharts(list, all, get24h, get7d, get30d, get1y, title * @template {{ color: Color, name: string }} A * @param {readonly T[]} list * @param {A} all - * @param {readonly { name: string, getCreated: (item: T | A) => AnyMetricPattern, getDestroyed: (item: T | A) => AnyMetricPattern }[]} windows - * @param {(metric: string) => string} title + * @param {readonly { name: string, getCreated: (item: T | A) => AnySeriesPattern, getDestroyed: (item: T | A) => AnySeriesPattern }[]} windows + * @param {(name: string) => string} title * @param {string} [prefix] * @returns {PartialOptionsTree} */ @@ -688,7 +688,7 @@ function groupedRollingValueCharts(list, all, windows, title, prefix = "") { name: w.name, title: title(`${prefix}Value Created (${w.name})`), bottom: mapCohortsWithAll(list, all, (item) => - line({ metric: w.getCreated(item), name: item.name, color: item.color, unit: Unit.usd }), + line({ series: w.getCreated(item), name: item.name, color: item.color, unit: Unit.usd }), ), })), }, @@ -698,7 +698,7 @@ function groupedRollingValueCharts(list, all, windows, title, prefix = "") { name: w.name, title: title(`${prefix}Value Destroyed (${w.name})`), bottom: mapCohortsWithAll(list, all, (item) => - line({ metric: w.getDestroyed(item), name: item.name, color: item.color, unit: Unit.usd }), + line({ series: w.getDestroyed(item), name: item.name, color: item.color, unit: Unit.usd }), ), })), }, @@ -723,7 +723,7 @@ function valueWindows(list, all) { // ============================================================================ /** - * @param {{ list: readonly CohortFull[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly CohortFull[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedActivitySectionWithAdjusted({ list, all, title }) { @@ -734,7 +734,7 @@ export function createGroupedActivitySectionWithAdjusted({ list, all, title }) { name: "Volume", title: title("Sent Volume"), bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) => [ - line({ metric: tree.activity.sent.sum._24h, name, color, unit: Unit.sats }), + line({ series: tree.activity.sent.sum._24h, name, color, unit: Unit.sats }), ]), }, { @@ -793,10 +793,10 @@ export function createGroupedActivitySectionWithAdjusted({ list, all, title }) { { name: "Sell Side Risk", tree: [ - { name: "24h", title: title("Sell Side Risk (24h)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sellSideRiskRatio._24h.ratio, name, color, unit: Unit.ratio })) }, - { name: "7d", title: title("Sell Side Risk (7d)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sellSideRiskRatio._1w.ratio, name, color, unit: Unit.ratio })) }, - { name: "30d", title: title("Sell Side Risk (30d)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sellSideRiskRatio._1m.ratio, name, color, unit: Unit.ratio })) }, - { name: "1y", title: title("Sell Side Risk (1y)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sellSideRiskRatio._1y.ratio, name, color, unit: Unit.ratio })) }, + { name: "24h", title: title("Sell Side Risk (24h)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sellSideRiskRatio._24h.ratio, name, color, unit: Unit.ratio })) }, + { name: "7d", title: title("Sell Side Risk (7d)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sellSideRiskRatio._1w.ratio, name, color, unit: Unit.ratio })) }, + { name: "30d", title: title("Sell Side Risk (30d)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sellSideRiskRatio._1m.ratio, name, color, unit: Unit.ratio })) }, + { name: "1y", title: title("Sell Side Risk (1y)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sellSideRiskRatio._1y.ratio, name, color, unit: Unit.ratio })) }, ], }, { @@ -805,12 +805,12 @@ export function createGroupedActivitySectionWithAdjusted({ list, all, title }) { { name: "Flows", tree: [ - { name: "Distribution", title: title("Distribution Flow"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.profit.distributionFlow, name, color, unit: Unit.usd })) }, - { name: "Capitulation", title: title("Capitulation Flow"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.loss.capitulationFlow, name, color, unit: Unit.usd })) }, + { name: "Distribution", title: title("Distribution Flow"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.profit.distributionFlow, name, color, unit: Unit.usd })) }, + { name: "Capitulation", title: title("Capitulation Flow"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.loss.capitulationFlow, name, color, unit: Unit.usd })) }, ], }, - { name: "Created", title: title("Value Created"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sopr.valueCreated.base, name, color, unit: Unit.usd })) }, - { name: "Destroyed", title: title("Value Destroyed"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sopr.valueDestroyed.base, name, color, unit: Unit.usd })) }, + { name: "Created", title: title("Value Created"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sopr.valueCreated.base, name, color, unit: Unit.usd })) }, + { name: "Destroyed", title: title("Value Destroyed"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sopr.valueDestroyed.base, name, color, unit: Unit.usd })) }, { name: "Rolling", tree: [ @@ -840,7 +840,7 @@ export function createGroupedActivitySectionWithAdjusted({ list, all, title }) { name: "Coins Destroyed", title: title("Coindays Destroyed"), bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) => [ - line({ metric: tree.activity.coindaysDestroyed.sum._24h, name, color, unit: Unit.coindays }), + line({ series: tree.activity.coindaysDestroyed.sum._24h, name, color, unit: Unit.coindays }), ]), }, ], @@ -849,7 +849,7 @@ export function createGroupedActivitySectionWithAdjusted({ list, all, title }) { /** * Grouped activity for cohorts with rolling SOPR + sell side risk (LTH-like) - * @param {{ list: readonly (CohortFull | CohortLongTerm)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (CohortFull | CohortLongTerm)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedActivitySection({ list, all, title }) { @@ -860,7 +860,7 @@ export function createGroupedActivitySection({ list, all, title }) { name: "Volume", title: title("Sent Volume"), bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) => [ - line({ metric: tree.activity.sent.sum._24h, name, color, unit: Unit.sats }), + line({ series: tree.activity.sent.sum._24h, name, color, unit: Unit.sats }), ]), }, { @@ -889,10 +889,10 @@ export function createGroupedActivitySection({ list, all, title }) { { name: "Sell Side Risk", tree: [ - { name: "24h", title: title("Sell Side Risk (24h)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sellSideRiskRatio._24h.ratio, name, color, unit: Unit.ratio })) }, - { name: "7d", title: title("Sell Side Risk (7d)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sellSideRiskRatio._1w.ratio, name, color, unit: Unit.ratio })) }, - { name: "30d", title: title("Sell Side Risk (30d)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sellSideRiskRatio._1m.ratio, name, color, unit: Unit.ratio })) }, - { name: "1y", title: title("Sell Side Risk (1y)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sellSideRiskRatio._1y.ratio, name, color, unit: Unit.ratio })) }, + { name: "24h", title: title("Sell Side Risk (24h)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sellSideRiskRatio._24h.ratio, name, color, unit: Unit.ratio })) }, + { name: "7d", title: title("Sell Side Risk (7d)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sellSideRiskRatio._1w.ratio, name, color, unit: Unit.ratio })) }, + { name: "30d", title: title("Sell Side Risk (30d)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sellSideRiskRatio._1m.ratio, name, color, unit: Unit.ratio })) }, + { name: "1y", title: title("Sell Side Risk (1y)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sellSideRiskRatio._1y.ratio, name, color, unit: Unit.ratio })) }, ], }, { @@ -901,12 +901,12 @@ export function createGroupedActivitySection({ list, all, title }) { { name: "Flows", tree: [ - { name: "Distribution", title: title("Distribution Flow"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.profit.distributionFlow, name, color, unit: Unit.usd })) }, - { name: "Capitulation", title: title("Capitulation Flow"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.loss.capitulationFlow, name, color, unit: Unit.usd })) }, + { name: "Distribution", title: title("Distribution Flow"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.profit.distributionFlow, name, color, unit: Unit.usd })) }, + { name: "Capitulation", title: title("Capitulation Flow"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.loss.capitulationFlow, name, color, unit: Unit.usd })) }, ], }, - { name: "Created", title: title("Value Created"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sopr.valueCreated.base, name, color, unit: Unit.usd })) }, - { name: "Destroyed", title: title("Value Destroyed"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sopr.valueDestroyed.base, name, color, unit: Unit.usd })) }, + { name: "Created", title: title("Value Created"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sopr.valueCreated.base, name, color, unit: Unit.usd })) }, + { name: "Destroyed", title: title("Value Destroyed"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sopr.valueDestroyed.base, name, color, unit: Unit.usd })) }, { name: "Rolling", tree: groupedRollingValueCharts(list, all, valueWindows(list, all), title), @@ -917,7 +917,7 @@ export function createGroupedActivitySection({ list, all, title }) { name: "Coins Destroyed", title: title("Coindays Destroyed"), bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) => [ - line({ metric: tree.activity.coindaysDestroyed.sum._24h, name, color, unit: Unit.coindays }), + line({ series: tree.activity.coindaysDestroyed.sum._24h, name, color, unit: Unit.coindays }), ]), }, ], @@ -926,7 +926,7 @@ export function createGroupedActivitySection({ list, all, title }) { /** * Grouped activity for cohorts with activity but basic realized (AgeRange/MaxAge) - * @param {{ list: readonly (CohortAgeRange | CohortWithAdjusted)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (CohortAgeRange | CohortWithAdjusted)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedActivitySectionWithActivity({ list, all, title }) { @@ -937,28 +937,28 @@ export function createGroupedActivitySectionWithActivity({ list, all, title }) { name: "Volume", title: title("Sent Volume"), bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) => [ - line({ metric: tree.activity.sent.sum._24h, name, color, unit: Unit.sats }), + line({ series: tree.activity.sent.sum._24h, name, color, unit: Unit.sats }), ]), }, { name: "SOPR", title: title("SOPR (24h)"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.realized.sopr.ratio._24h, name, color, unit: Unit.ratio, base: 1 }), + baseline({ series: tree.realized.sopr.ratio._24h, name, color, unit: Unit.ratio, base: 1 }), ), }, { name: "Value", tree: [ - { name: "Created", title: title("Value Created"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sopr.valueCreated.base, name, color, unit: Unit.usd })) }, - { name: "Destroyed", title: title("Value Destroyed"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sopr.valueDestroyed.base, name, color, unit: Unit.usd })) }, + { name: "Created", title: title("Value Created"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sopr.valueCreated.base, name, color, unit: Unit.usd })) }, + { name: "Destroyed", title: title("Value Destroyed"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sopr.valueDestroyed.base, name, color, unit: Unit.usd })) }, ], }, { name: "Coins Destroyed", title: title("Coindays Destroyed"), bottom: flatMapCohortsWithAll(list, all, ({ name, color, tree }) => [ - line({ metric: tree.activity.coindaysDestroyed.sum._24h, name, color, unit: Unit.coindays }), + line({ series: tree.activity.coindaysDestroyed.sum._24h, name, color, unit: Unit.coindays }), ]), }, ], @@ -967,15 +967,15 @@ export function createGroupedActivitySectionWithActivity({ list, all, title }) { /** * Grouped minimal activity (value only, no activity field) - * @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative | CohortAddress | AddressCohortObject)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative | CohortAddress | AddressCohortObject)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedActivitySectionMinimal({ list, all, title }) { return { name: "Activity", tree: [ - { name: "Value Created", title: title("Value Created"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sopr.valueCreated.base, name, color, unit: Unit.usd })) }, - { name: "Value Destroyed", title: title("Value Destroyed"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.sopr.valueDestroyed.base, name, color, unit: Unit.usd })) }, + { name: "Value Created", title: title("Value Created"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sopr.valueCreated.base, name, color, unit: Unit.usd })) }, + { name: "Value Destroyed", title: title("Value Destroyed"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.sopr.valueDestroyed.base, name, color, unit: Unit.usd })) }, ], }; } diff --git a/website/scripts/options/distribution/cost-basis.js b/website/scripts/options/distribution/cost-basis.js index 30b73d75f..ac575223a 100644 --- a/website/scripts/options/distribution/cost-basis.js +++ b/website/scripts/options/distribution/cost-basis.js @@ -27,9 +27,9 @@ const ACTIVE_PCTS = new Set(["pct75", "pct50", "pct25"]); function createCorePercentileSeries(p, n = (x) => x) { return entries(p) .reverse() - .map(([key, metric], i, arr) => + .map(([key, s], i, arr) => price({ - metric, + series: s, name: n(key.replace("pct", "p")), color: colors.at(i, arr.length), ...(ACTIVE_PCTS.has(key) ? {} : { defaultActive: false }), @@ -45,28 +45,28 @@ function createSingleSummarySeries(cohort) { const { color, tree } = cohort; const p = tree.costBasis.percentiles; return [ - price({ metric: tree.realized.price, name: "Average", color }), + price({ series: tree.realized.price, name: "Average", color }), price({ - metric: tree.costBasis.max, + series: tree.costBasis.max, name: "Max (p100)", color: colors.stat.max, defaultActive: false, }), price({ - metric: p.pct75, + series: p.pct75, name: "Q3 (p75)", color: colors.stat.pct75, defaultActive: false, }), - price({ metric: p.pct50, name: "Median (p50)", color: colors.stat.median }), + price({ series: p.pct50, name: "Median (p50)", color: colors.stat.median }), price({ - metric: p.pct25, + series: p.pct25, name: "Q1 (p25)", color: colors.stat.pct25, defaultActive: false, }), price({ - metric: tree.costBasis.min, + series: tree.costBasis.min, name: "Min (p0)", color: colors.stat.min, defaultActive: false, @@ -81,7 +81,7 @@ function createSingleSummarySeries(cohort) { */ function createGroupedSummarySeries(list, all) { return mapCohortsWithAll(list, all, ({ name, color, tree }) => - price({ metric: tree.realized.price, name, color }), + price({ series: tree.realized.price, name, color }), ); } @@ -93,16 +93,16 @@ function createSingleByCoinSeries(cohort) { const { color, tree } = cohort; const cb = tree.costBasis; return [ - price({ metric: tree.realized.price, name: "Average", color }), + price({ series: tree.realized.price, name: "Average", color }), price({ - metric: cb.max, + series: cb.max, name: "p100", color: colors.stat.max, defaultActive: false, }), ...createCorePercentileSeries(cb.percentiles), price({ - metric: cb.min, + series: cb.min, name: "p0", color: colors.stat.min, defaultActive: false, @@ -117,7 +117,7 @@ function createSingleByCoinSeries(cohort) { function createSingleByCapitalSeries(cohort) { const { color, tree } = cohort; return [ - price({ metric: tree.realized.investor.price, name: "Average", color }), + price({ series: tree.realized.investor.price, name: "Average", color }), ...createCorePercentileSeries(tree.costBasis.investedCapital), ]; } @@ -139,7 +139,7 @@ function createSingleSupplyDensitySeries(cohort) { } /** - * @param {{ cohort: CohortAll | CohortFull | CohortLongTerm, title: (metric: string) => string }} args + * @param {{ cohort: CohortAll | CohortFull | CohortLongTerm, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createCostBasisSectionWithPercentiles({ cohort, title }) { @@ -171,7 +171,7 @@ export function createCostBasisSectionWithPercentiles({ cohort, title }) { } /** - * @param {{ list: readonly (CohortAll | CohortFull | CohortLongTerm)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (CohortAll | CohortFull | CohortLongTerm)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedCostBasisSectionWithPercentiles({ @@ -194,28 +194,28 @@ export function createGroupedCostBasisSectionWithPercentiles({ name: "Average", title: title("Realized Price Comparison"), top: mapCohortsWithAll(list, all, ({ name, color, tree }) => - price({ metric: tree.realized.price, name, color }), + price({ series: tree.realized.price, name, color }), ), }, { name: "Median", title: title("Cost Basis Median (BTC-weighted)"), top: mapCohortsWithAll(list, all, ({ name, color, tree }) => - price({ metric: tree.costBasis.percentiles.pct50, name, color }), + price({ series: tree.costBasis.percentiles.pct50, name, color }), ), }, { name: "Q3", title: title("Cost Basis Q3 (BTC-weighted)"), top: mapCohortsWithAll(list, all, ({ name, color, tree }) => - price({ metric: tree.costBasis.percentiles.pct75, name, color }), + price({ series: tree.costBasis.percentiles.pct75, name, color }), ), }, { name: "Q1", title: title("Cost Basis Q1 (BTC-weighted)"), top: mapCohortsWithAll(list, all, ({ name, color, tree }) => - price({ metric: tree.costBasis.percentiles.pct25, name, color }), + price({ series: tree.costBasis.percentiles.pct25, name, color }), ), }, ], @@ -227,7 +227,7 @@ export function createGroupedCostBasisSectionWithPercentiles({ name: "Average", title: title("Investor Price Comparison"), top: mapCohortsWithAll(list, all, ({ name, color, tree }) => - price({ metric: tree.realized.investor.price, name, color }), + price({ series: tree.realized.investor.price, name, color }), ), }, { @@ -235,7 +235,7 @@ export function createGroupedCostBasisSectionWithPercentiles({ title: title("Cost Basis Median (USD-weighted)"), top: mapCohortsWithAll(list, all, ({ name, color, tree }) => price({ - metric: tree.costBasis.investedCapital.pct50, + series: tree.costBasis.investedCapital.pct50, name, color, }), @@ -246,7 +246,7 @@ export function createGroupedCostBasisSectionWithPercentiles({ title: title("Cost Basis Q3 (USD-weighted)"), top: mapCohortsWithAll(list, all, ({ name, color, tree }) => price({ - metric: tree.costBasis.investedCapital.pct75, + series: tree.costBasis.investedCapital.pct75, name, color, }), @@ -257,7 +257,7 @@ export function createGroupedCostBasisSectionWithPercentiles({ title: title("Cost Basis Q1 (USD-weighted)"), top: mapCohortsWithAll(list, all, ({ name, color, tree }) => price({ - metric: tree.costBasis.investedCapital.pct25, + series: tree.costBasis.investedCapital.pct25, name, color, }), diff --git a/website/scripts/options/distribution/data.js b/website/scripts/options/distribution/data.js index b10cfa1d4..2cc7af3c2 100644 --- a/website/scripts/options/distribution/data.js +++ b/website/scripts/options/distribution/data.js @@ -19,9 +19,9 @@ const isAddressable = (key) => /** @type {readonly string[]} */ (ADDRESSABLE_TYPES).includes(key); export function buildCohortData() { - const utxoCohorts = brk.metrics.cohorts.utxo; - const addressCohorts = brk.metrics.cohorts.address; - const { addresses } = brk.metrics; + const utxoCohorts = brk.series.cohorts.utxo; + const addressCohorts = brk.series.cohorts.address; + const { addresses } = brk.series; const { TERM_NAMES, EPOCH_NAMES, diff --git a/website/scripts/options/distribution/holdings.js b/website/scripts/options/distribution/holdings.js index 536a00e8a..412450221 100644 --- a/website/scripts/options/distribution/holdings.js +++ b/website/scripts/options/distribution/holdings.js @@ -3,7 +3,7 @@ * * Supply pattern capabilities by cohort type: * - DeltaHalfInRelTotalPattern2 (STH/LTH): inProfit + inLoss + relToCirculating + relToOwn - * - MetricsTree_Cohorts_Utxo_All_Supply (All): inProfit + inLoss + relToOwn (no relToCirculating) + * - SeriesTree_Cohorts_Utxo_All_Supply (All): inProfit + inLoss + relToOwn (no relToCirculating) * - DeltaHalfInRelTotalPattern (AgeRange/MaxAge/Epoch): inProfit + inLoss + relToCirculating (no relToOwn) * - DeltaHalfInTotalPattern2 (Type.*): inProfit + inLoss (no rel) * - DeltaHalfTotalPattern (Empty/UtxoAmount/AddrAmount): total + half only @@ -74,40 +74,40 @@ function fullSupplySeries(supply) { /** * % of Own Supply series (profit/loss relative to own supply) - * @param {{ inProfit: { relToOwn: { percent: AnyMetricPattern, ratio: AnyMetricPattern } }, inLoss: { relToOwn: { percent: AnyMetricPattern, ratio: AnyMetricPattern } } }} supply + * @param {{ inProfit: { relToOwn: { percent: AnySeriesPattern, ratio: AnySeriesPattern } }, inLoss: { relToOwn: { percent: AnySeriesPattern, ratio: AnySeriesPattern } } }} supply * @returns {AnyFetchedSeriesBlueprint[]} */ function ownSupplyPctSeries(supply) { return [ - line({ metric: supply.inProfit.relToOwn.percent, name: "In Profit", color: colors.profit, unit: Unit.pctOwn }), - line({ metric: supply.inLoss.relToOwn.percent, name: "In Loss", color: colors.loss, unit: Unit.pctOwn }), - line({ metric: supply.inProfit.relToOwn.ratio, name: "In Profit", color: colors.profit, unit: Unit.ratio }), - line({ metric: supply.inLoss.relToOwn.ratio, name: "In Loss", color: colors.loss, unit: Unit.ratio }), + line({ series: supply.inProfit.relToOwn.percent, name: "In Profit", color: colors.profit, unit: Unit.pctOwn }), + line({ series: supply.inLoss.relToOwn.percent, name: "In Loss", color: colors.loss, unit: Unit.pctOwn }), + line({ series: supply.inProfit.relToOwn.ratio, name: "In Profit", color: colors.profit, unit: Unit.ratio }), + line({ series: supply.inLoss.relToOwn.ratio, name: "In Loss", color: colors.loss, unit: Unit.ratio }), ...priceLines({ numbers: [100, 50, 0], unit: Unit.pctOwn }), ]; } /** * % of Circulating Supply series (total, profit, loss) - * @param {{ relToCirculating: { percent: AnyMetricPattern }, inProfit: { relToCirculating: { percent: AnyMetricPattern } }, inLoss: { relToCirculating: { percent: AnyMetricPattern } } }} supply + * @param {{ relToCirculating: { percent: AnySeriesPattern }, inProfit: { relToCirculating: { percent: AnySeriesPattern } }, inLoss: { relToCirculating: { percent: AnySeriesPattern } } }} supply * @returns {AnyFetchedSeriesBlueprint[]} */ function circulatingSupplyPctSeries(supply) { return [ line({ - metric: supply.relToCirculating.percent, + series: supply.relToCirculating.percent, name: "Total", color: colors.default, unit: Unit.pctSupply, }), line({ - metric: supply.inProfit.relToCirculating.percent, + series: supply.inProfit.relToCirculating.percent, name: "In Profit", color: colors.profit, unit: Unit.pctSupply, }), line({ - metric: supply.inLoss.relToCirculating.percent, + series: supply.inLoss.relToCirculating.percent, name: "In Loss", color: colors.loss, unit: Unit.pctSupply, @@ -117,25 +117,25 @@ function circulatingSupplyPctSeries(supply) { /** * Ratio of Circulating Supply series (total, profit, loss) - * @param {{ relToCirculating: { ratio: AnyMetricPattern }, inProfit: { relToCirculating: { ratio: AnyMetricPattern } }, inLoss: { relToCirculating: { ratio: AnyMetricPattern } } }} supply + * @param {{ relToCirculating: { ratio: AnySeriesPattern }, inProfit: { relToCirculating: { ratio: AnySeriesPattern } }, inLoss: { relToCirculating: { ratio: AnySeriesPattern } } }} supply * @returns {AnyFetchedSeriesBlueprint[]} */ function circulatingSupplyRatioSeries(supply) { return [ line({ - metric: supply.relToCirculating.ratio, + series: supply.relToCirculating.ratio, name: "Total", color: colors.default, unit: Unit.ratio, }), line({ - metric: supply.inProfit.relToCirculating.ratio, + series: supply.inProfit.relToCirculating.ratio, name: "In Profit", color: colors.profit, unit: Unit.ratio, }), line({ - metric: supply.inLoss.relToCirculating.ratio, + series: supply.inLoss.relToCirculating.ratio, name: "In Loss", color: colors.loss, unit: Unit.ratio, @@ -146,7 +146,7 @@ function circulatingSupplyRatioSeries(supply) { /** * @param {readonly (UtxoCohortObject | CohortWithoutRelative)[]} list * @param {CohortAll} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title */ function groupedUtxoCountChart(list, all, title) { return { @@ -154,7 +154,7 @@ function groupedUtxoCountChart(list, all, title) { title: title("UTXO Count"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ - metric: tree.outputs.unspentCount.inner, + series: tree.outputs.unspentCount.inner, name, color, unit: Unit.count, @@ -164,9 +164,9 @@ function groupedUtxoCountChart(list, all, title) { } /** - * @param {{ absolute: { _24h: AnyMetricPattern, _1w: AnyMetricPattern, _1m: AnyMetricPattern, _1y: AnyMetricPattern }, rate: { _24h: { percent: AnyMetricPattern, ratio: AnyMetricPattern }, _1w: { percent: AnyMetricPattern, ratio: AnyMetricPattern }, _1m: { percent: AnyMetricPattern, ratio: AnyMetricPattern }, _1y: { percent: AnyMetricPattern, ratio: AnyMetricPattern } } }} delta + * @param {{ absolute: { _24h: AnySeriesPattern, _1w: AnySeriesPattern, _1m: AnySeriesPattern, _1y: AnySeriesPattern }, rate: { _24h: { percent: AnySeriesPattern, ratio: AnySeriesPattern }, _1w: { percent: AnySeriesPattern, ratio: AnySeriesPattern }, _1m: { percent: AnySeriesPattern, ratio: AnySeriesPattern }, _1y: { percent: AnySeriesPattern, ratio: AnySeriesPattern } } }} delta * @param {Unit} unit - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @param {string} name * @returns {PartialOptionsGroup} */ @@ -187,7 +187,7 @@ function singleDeltaTree(delta, unit, title, name) { * @param {A} all * @param {(c: T | A) => DeltaPattern} getDelta * @param {Unit} unit - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @param {string} name * @returns {PartialOptionsGroup} */ @@ -201,7 +201,7 @@ function groupedDeltaTree(list, all, getDelta, unit, title, name) { name: w.name, title: title(`${name} Change (${w.name})`), bottom: mapCohortsWithAll(list, all, (c) => - baseline({ metric: getDelta(c).absolute[w.key], name: c.name, color: c.color, unit }), + baseline({ series: getDelta(c).absolute[w.key], name: c.name, color: c.color, unit }), ), })), }, @@ -221,7 +221,7 @@ function groupedDeltaTree(list, all, getDelta, unit, title, name) { /** * @param {UtxoCohortObject | CohortWithoutRelative} cohort - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialChartOption} */ function singleUtxoCountChart(cohort, title) { @@ -230,7 +230,7 @@ function singleUtxoCountChart(cohort, title) { title: title("UTXO Count"), bottom: [ line({ - metric: cohort.tree.outputs.unspentCount.inner, + series: cohort.tree.outputs.unspentCount.inner, name: "UTXO Count", color: cohort.color, unit: Unit.count, @@ -242,7 +242,7 @@ function singleUtxoCountChart(cohort, title) { /** * @param {CohortAll | CohortAddress | AddressCohortObject} cohort - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialChartOption} */ function singleAddressCountChart(cohort, title) { @@ -251,7 +251,7 @@ function singleAddressCountChart(cohort, title) { title: title("Address Count"), bottom: [ line({ - metric: cohort.addressCount.inner, + series: cohort.addressCount.inner, name: "Address Count", color: cohort.color, unit: Unit.count, @@ -268,7 +268,7 @@ function singleAddressCountChart(cohort, title) { /** * Basic holdings (total + half only, no supply breakdown) * For: CohortWithoutRelative, CohortBasicWithMarketCap, CohortBasicWithoutMarketCap - * @param {{ cohort: UtxoCohortObject | CohortWithoutRelative, title: (metric: string) => string }} args + * @param {{ cohort: UtxoCohortObject | CohortWithoutRelative, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createHoldingsSection({ cohort, title }) { @@ -294,7 +294,7 @@ export function createHoldingsSection({ cohort, title }) { /** * Holdings for CohortAll (has inProfit/inLoss with relToOwn but no relToCirculating) - * @param {{ cohort: CohortAll, title: (metric: string) => string }} args + * @param {{ cohort: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createHoldingsSectionAll({ cohort, title }) { @@ -325,9 +325,9 @@ export function createHoldingsSectionAll({ cohort, title }) { } /** - * Holdings with full relative metrics (relToCirculating + relToOwn) + * Holdings with full relative series (relToCirculating + relToOwn) * For: CohortFull, CohortLongTerm (have DeltaHalfInRelTotalPattern2) - * @param {{ cohort: CohortFull | CohortLongTerm, title: (metric: string) => string }} args + * @param {{ cohort: CohortFull | CohortLongTerm, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createHoldingsSectionWithRelative({ cohort, title }) { @@ -369,7 +369,7 @@ export function createHoldingsSectionWithRelative({ cohort, title }) { /** * Holdings with inProfit/inLoss + relToCirculating (no relToOwn) * For: CohortWithAdjusted, CohortAgeRange (have DeltaHalfInRelTotalPattern) - * @param {{ cohort: CohortWithAdjusted | CohortAgeRange, title: (metric: string) => string }} args + * @param {{ cohort: CohortWithAdjusted | CohortAgeRange, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createHoldingsSectionWithOwnSupply({ cohort, title }) { @@ -410,7 +410,7 @@ export function createHoldingsSectionWithOwnSupply({ cohort, title }) { /** * Holdings with inProfit/inLoss (no rel, no address count) * For: CohortWithoutRelative (p2ms, unknown, empty) - * @param {{ cohort: CohortWithoutRelative, title: (metric: string) => string }} args + * @param {{ cohort: CohortWithoutRelative, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createHoldingsSectionWithProfitLoss({ cohort, title }) { @@ -436,7 +436,7 @@ export function createHoldingsSectionWithProfitLoss({ cohort, title }) { /** * Holdings for CohortAddress (has inProfit/inLoss but no rel, plus address count) - * @param {{ cohort: CohortAddress, title: (metric: string) => string }} args + * @param {{ cohort: CohortAddress, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createHoldingsSectionAddress({ cohort, title }) { @@ -464,7 +464,7 @@ export function createHoldingsSectionAddress({ cohort, title }) { /** * Holdings for address amount cohorts (no inProfit/inLoss, has address count) - * @param {{ cohort: AddressCohortObject, title: (metric: string) => string }} args + * @param {{ cohort: AddressCohortObject, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createHoldingsSectionAddressAmount({ cohort, title }) { @@ -495,7 +495,7 @@ export function createHoldingsSectionAddressAmount({ cohort, title }) { // ============================================================================ /** - * @param {{ list: readonly CohortAddress[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly CohortAddress[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedHoldingsSectionAddress({ list, all, title }) { @@ -541,7 +541,7 @@ export function createGroupedHoldingsSectionAddress({ list, all, title }) { name: "Address Count", title: title("Address Count"), bottom: mapCohortsWithAll(list, all, ({ name, color, addressCount }) => - line({ metric: addressCount.inner, name, color, unit: Unit.count }), + line({ series: addressCount.inner, name, color, unit: Unit.count }), ), }, { @@ -558,7 +558,7 @@ export function createGroupedHoldingsSectionAddress({ list, all, title }) { /** * Grouped holdings for address amount cohorts (no inProfit/inLoss, has address count) - * @param {{ list: readonly AddressCohortObject[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly AddressCohortObject[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedHoldingsSectionAddressAmount({ @@ -586,7 +586,7 @@ export function createGroupedHoldingsSectionAddressAmount({ name: "Address Count", title: title("Address Count"), bottom: mapCohortsWithAll(list, all, ({ name, color, addressCount }) => - line({ metric: addressCount.inner, name, color, unit: Unit.count }), + line({ series: addressCount.inner, name, color, unit: Unit.count }), ), }, { @@ -603,7 +603,7 @@ export function createGroupedHoldingsSectionAddressAmount({ /** * Basic grouped holdings (total + half only) - * @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedHoldingsSection({ list, all, title }) { @@ -637,7 +637,7 @@ export function createGroupedHoldingsSection({ list, all, title }) { /** * Grouped holdings with inProfit/inLoss (no rel, no address count) * For: CohortWithoutRelative (p2ms, unknown, empty) - * @param {{ list: readonly CohortWithoutRelative[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly CohortWithoutRelative[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedHoldingsSectionWithProfitLoss({ @@ -697,7 +697,7 @@ export function createGroupedHoldingsSectionWithProfitLoss({ /** * Grouped holdings with inProfit/inLoss + relToCirculating (no relToOwn) * For: CohortWithAdjusted, CohortAgeRange - * @param {{ list: readonly (CohortWithAdjusted | CohortAgeRange)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (CohortWithAdjusted | CohortAgeRange)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedHoldingsSectionWithOwnSupply({ @@ -720,7 +720,7 @@ export function createGroupedHoldingsSectionWithOwnSupply({ ), ...mapCohorts(list, ({ name, color, tree }) => line({ - metric: tree.supply.relToCirculating.percent, + series: tree.supply.relToCirculating.percent, name, color, unit: Unit.pctSupply, @@ -741,7 +741,7 @@ export function createGroupedHoldingsSectionWithOwnSupply({ ), ...mapCohorts(list, ({ name, color, tree }) => line({ - metric: tree.supply.inProfit.relToCirculating.percent, + series: tree.supply.inProfit.relToCirculating.percent, name, color, unit: Unit.pctSupply, @@ -762,7 +762,7 @@ export function createGroupedHoldingsSectionWithOwnSupply({ ), ...mapCohorts(list, ({ name, color, tree }) => line({ - metric: tree.supply.inLoss.relToCirculating.percent, + series: tree.supply.inLoss.relToCirculating.percent, name, color, unit: Unit.pctSupply, @@ -785,9 +785,9 @@ export function createGroupedHoldingsSectionWithOwnSupply({ } /** - * Grouped holdings with full relative metrics (relToCirculating + relToOwn) + * Grouped holdings with full relative series (relToCirculating + relToOwn) * For: CohortFull, CohortLongTerm - * @param {{ list: readonly (CohortFull | CohortLongTerm)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (CohortFull | CohortLongTerm)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) { @@ -806,7 +806,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) { ), ...mapCohorts(list, ({ name, color, tree }) => line({ - metric: tree.supply.relToCirculating.percent, + series: tree.supply.relToCirculating.percent, name, color, unit: Unit.pctSupply, @@ -827,7 +827,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) { ), ...mapCohorts(list, ({ name, color, tree }) => line({ - metric: tree.supply.inProfit.relToCirculating.percent, + series: tree.supply.inProfit.relToCirculating.percent, name, color, unit: Unit.pctSupply, @@ -835,7 +835,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) { ), ...mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ - metric: tree.supply.inProfit.relToOwn.percent, + series: tree.supply.inProfit.relToOwn.percent, name, color, unit: Unit.pctOwn, @@ -857,7 +857,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) { ), ...mapCohorts(list, ({ name, color, tree }) => line({ - metric: tree.supply.inLoss.relToCirculating.percent, + series: tree.supply.inLoss.relToCirculating.percent, name, color, unit: Unit.pctSupply, @@ -865,7 +865,7 @@ export function createGroupedHoldingsSectionWithRelative({ list, all, title }) { ), ...mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ - metric: tree.supply.inLoss.relToOwn.percent, + series: tree.supply.inLoss.relToOwn.percent, name, color, unit: Unit.pctOwn, diff --git a/website/scripts/options/distribution/index.js b/website/scripts/options/distribution/index.js index ba7d21bd9..3d9901e42 100644 --- a/website/scripts/options/distribution/index.js +++ b/website/scripts/options/distribution/index.js @@ -13,6 +13,7 @@ import { formatCohortTitle, satsBtcUsd, satsBtcUsdFullTree } from "../shared.js"; import { ROLLING_WINDOWS, line, baseline, percentRatio, rollingWindowsTree, rollingPercentRatioTree } from "../series.js"; import { Unit } from "../../utils/units.js"; +import { colors } from "../../utils/colors.js"; // Section builders import { @@ -602,14 +603,12 @@ function singleBucketFolder({ name, color, pattern }) { name: "Supply", tree: [ { - name: "All", + name: "Value", title: `${name}: Supply`, - bottom: satsBtcUsd({ pattern: pattern.supply.all, name, color }), - }, - { - name: "STH", - title: `${name}: STH Supply`, - bottom: satsBtcUsd({ pattern: pattern.supply.sth, name, color }), + bottom: [ + ...satsBtcUsd({ pattern: pattern.supply.all, name: "Total" }), + ...satsBtcUsd({ pattern: pattern.supply.sth, name: "STH", color: colors.term.short }), + ], }, { name: "Change", @@ -622,23 +621,16 @@ function singleBucketFolder({ name, color, pattern }) { }, { name: "Realized Cap", - tree: [ - { - name: "All", - title: `${name}: Realized Cap`, - bottom: [line({ metric: pattern.realizedCap.all, name, color, unit: Unit.usd })], - }, - { - name: "STH", - title: `${name}: STH Realized Cap`, - bottom: [line({ metric: pattern.realizedCap.sth, name, color, unit: Unit.usd })], - }, + title: `${name}: Realized Cap`, + bottom: [ + line({ series: pattern.realizedCap.all, name: "Total", unit: Unit.usd }), + line({ series: pattern.realizedCap.sth, name: "STH", color: colors.term.short, unit: Unit.usd }), ], }, { name: "NUPL", title: `${name}: NUPL`, - bottom: [line({ metric: pattern.nupl.ratio, name, color, unit: Unit.ratio })], + bottom: [line({ series: pattern.nupl.ratio, name, color, unit: Unit.ratio })], }, ], }; @@ -679,7 +671,7 @@ function groupedBucketCharts(list, titlePrefix) { title: `${titlePrefix}: Supply Change`, bottom: ROLLING_WINDOWS.flatMap((w) => list.map(({ name, color, pattern }) => - baseline({ metric: pattern.supply.all.delta.absolute[w.key], name: `${name} ${w.name}`, color, unit: Unit.sats }), + baseline({ series: pattern.supply.all.delta.absolute[w.key], name: `${name} ${w.name}`, color, unit: Unit.sats }), ), ), }, @@ -687,7 +679,7 @@ function groupedBucketCharts(list, titlePrefix) { name: w.name, title: `${titlePrefix}: Supply Change ${w.name}`, bottom: list.map(({ name, color, pattern }) => - baseline({ metric: pattern.supply.all.delta.absolute[w.key], name, color, unit: Unit.sats }), + baseline({ series: pattern.supply.all.delta.absolute[w.key], name, color, unit: Unit.sats }), ), })), ], @@ -724,14 +716,14 @@ function groupedBucketCharts(list, titlePrefix) { name: "All", title: `${titlePrefix}: Realized Cap`, bottom: list.map(({ name, color, pattern }) => - line({ metric: pattern.realizedCap.all, name, color, unit: Unit.usd }), + line({ series: pattern.realizedCap.all, name, color, unit: Unit.usd }), ), }, { name: "STH", title: `${titlePrefix}: STH Realized Cap`, bottom: list.map(({ name, color, pattern }) => - line({ metric: pattern.realizedCap.sth, name, color, unit: Unit.usd }), + line({ series: pattern.realizedCap.sth, name, color, unit: Unit.usd }), ), }, ], @@ -740,7 +732,7 @@ function groupedBucketCharts(list, titlePrefix) { name: "NUPL", title: `${titlePrefix}: NUPL`, bottom: list.map(({ name, color, pattern }) => - line({ metric: pattern.nupl.ratio, name, color, unit: Unit.ratio }), + line({ series: pattern.nupl.ratio, name, color, unit: Unit.ratio }), ), }, ]; diff --git a/website/scripts/options/distribution/prices.js b/website/scripts/options/distribution/prices.js index 4ff1cb3e2..8cb17dd97 100644 --- a/website/scripts/options/distribution/prices.js +++ b/website/scripts/options/distribution/prices.js @@ -21,7 +21,7 @@ import { Unit } from "../../utils/units.js"; /** * Create prices section for cohorts with full ratio patterns * (CohortAll, CohortFull, CohortLongTerm) - * @param {{ cohort: CohortAll | CohortFull | CohortLongTerm, title: (metric: string) => string }} args + * @param {{ cohort: CohortAll | CohortFull | CohortLongTerm, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createPricesSectionFull({ cohort, title }) { @@ -33,10 +33,10 @@ export function createPricesSectionFull({ cohort, title }) { name: "Compare", title: title("Prices"), top: [ - price({ metric: tree.realized.price, name: "Realized", color: colors.realized }), - price({ metric: tree.realized.investor.price, name: "Investor", color: colors.investor }), - price({ metric: tree.realized.investor.upperPriceBand, name: "I²/R", color: colors.stat.max, style: 2, defaultActive: false }), - price({ metric: tree.realized.investor.lowerPriceBand, name: "R²/I", color: colors.stat.min, style: 2, defaultActive: false }), + price({ series: tree.realized.price, name: "Realized", color: colors.realized }), + price({ series: tree.realized.investor.price, name: "Investor", color: colors.investor }), + price({ series: tree.realized.investor.upperPriceBand, name: "I²/R", color: colors.stat.max, style: 2, defaultActive: false }), + price({ series: tree.realized.investor.lowerPriceBand, name: "R²/I", color: colors.stat.min, style: 2, defaultActive: false }), ], }, { @@ -67,7 +67,7 @@ export function createPricesSectionFull({ cohort, title }) { /** * Create prices section for cohorts with basic ratio patterns only * (CohortWithAdjusted, CohortBasic, CohortAddress, CohortWithoutRelative) - * @param {{ cohort: CohortWithAdjusted | CohortBasic | CohortAddress | CohortWithoutRelative | CohortAgeRange, title: (metric: string) => string }} args + * @param {{ cohort: CohortWithAdjusted | CohortBasic | CohortAddress | CohortWithoutRelative | CohortAgeRange, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createPricesSectionBasic({ cohort, title }) { @@ -81,14 +81,14 @@ export function createPricesSectionBasic({ cohort, title }) { { name: "Price", title: title("Realized Price"), - top: [price({ metric: tree.realized.price, name: "Realized", color })], + top: [price({ series: tree.realized.price, name: "Realized", color })], }, { name: "MVRV", title: title("MVRV"), bottom: [ baseline({ - metric: tree.realized.mvrv, + series: tree.realized.mvrv, name: "MVRV", unit: Unit.ratio, base: 1, @@ -100,7 +100,7 @@ export function createPricesSectionBasic({ cohort, title }) { title: title("Realized Price Ratio"), bottom: [ baseline({ - metric: tree.realized.price.ratio, + series: tree.realized.price.ratio, name: "Price Ratio", unit: Unit.ratio, base: 1, @@ -115,7 +115,7 @@ export function createPricesSectionBasic({ cohort, title }) { /** * Create prices section for grouped cohorts - * @param {{ list: readonly CohortObject[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly CohortObject[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedPricesSection({ list, all, title }) { @@ -129,7 +129,7 @@ export function createGroupedPricesSection({ list, all, title }) { name: "Price", title: title("Realized Price"), top: mapCohortsWithAll(list, all, ({ name, color, tree }) => - price({ metric: tree.realized.price, name, color }), + price({ series: tree.realized.price, name, color }), ), }, { @@ -137,7 +137,7 @@ export function createGroupedPricesSection({ list, all, title }) { title: title("MVRV"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => baseline({ - metric: tree.realized.mvrv, + series: tree.realized.mvrv, name, color, unit: Unit.ratio, diff --git a/website/scripts/options/distribution/profitability.js b/website/scripts/options/distribution/profitability.js index 4aab50b7b..eb5cd0c96 100644 --- a/website/scripts/options/distribution/profitability.js +++ b/website/scripts/options/distribution/profitability.js @@ -2,7 +2,7 @@ * Profitability section builders * * Capability tiers: - * - Full (All/STH/LTH): full unrealized with rel metrics, invested capital, sentiment; + * - Full (All/STH/LTH): full unrealized with rel series, invested capital, sentiment; * full realized with relToRcap, peakRegret, profitToLossRatio, grossPnl * - Mid (AgeRange/MaxAge): unrealized profit/loss/netPnl/nupl (no rel, no invested, no sentiment); * realized with netPnl + delta (no relToRcap, no peakRegret) @@ -26,10 +26,10 @@ import { /** * @typedef {Object} PnlSeriesConfig - * @property {AnyMetricPattern} profit - * @property {AnyMetricPattern} loss - * @property {AnyMetricPattern} negLoss - * @property {AnyMetricPattern} [gross] + * @property {AnySeriesPattern} profit + * @property {AnySeriesPattern} loss + * @property {AnySeriesPattern} negLoss + * @property {AnySeriesPattern} [gross] */ /** @@ -39,23 +39,23 @@ import { */ function pnlLines(m, unit) { const series = [ - line({ metric: m.profit, name: "Profit", color: colors.profit, unit }), - line({ metric: m.loss, name: "Loss", color: colors.loss, unit }), + line({ series: m.profit, name: "Profit", color: colors.profit, unit }), + line({ series: m.loss, name: "Loss", color: colors.loss, unit }), ]; if (m.gross) { - series.push(line({ metric: m.gross, name: "Total", color: colors.default, unit })); + series.push(line({ series: m.gross, name: "Total", color: colors.default, unit })); } - series.push(line({ metric: m.negLoss, name: "Negative Loss", color: colors.loss, unit, defaultActive: false })); + series.push(line({ series: m.negLoss, name: "Negative Loss", color: colors.loss, unit, defaultActive: false })); return series; } /** - * @param {AnyMetricPattern} metric + * @param {AnySeriesPattern} s * @param {Unit} unit * @returns {AnyFetchedSeriesBlueprint} */ -function netBaseline(metric, unit) { - return baseline({ metric, name: "Net P&L", unit }); +function netBaseline(s, unit) { + return baseline({ series: s, name: "Net P&L", unit }); } // ============================================================================ @@ -63,7 +63,7 @@ function netBaseline(metric, unit) { // ============================================================================ /** - * @param {{ profit: { base: { usd: AnyMetricPattern } }, loss: { base: { usd: AnyMetricPattern }, negative: AnyMetricPattern }, grossPnl: { usd: AnyMetricPattern } }} u + * @param {{ profit: { base: { usd: AnySeriesPattern } }, loss: { base: { usd: AnySeriesPattern }, negative: AnySeriesPattern }, grossPnl: { usd: AnySeriesPattern } }} u * @returns {AnyFetchedSeriesBlueprint[]} */ function unrealizedUsdSeries(u) { @@ -77,10 +77,10 @@ function unrealizedUsdSeries(u) { } /** - * @param {{ percent: AnyMetricPattern, ratio: AnyMetricPattern }} profit - * @param {{ percent: AnyMetricPattern, ratio: AnyMetricPattern }} loss + * @param {{ percent: AnySeriesPattern, ratio: AnySeriesPattern }} profit + * @param {{ percent: AnySeriesPattern, ratio: AnySeriesPattern }} loss * @param {string} name - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {AnyPartialOption} */ function relPnlChart(profit, loss, name, title) { @@ -96,8 +96,8 @@ function relPnlChart(profit, loss, name, title) { /** * Unrealized P&L tree for All cohort - * @param {Brk.MetricsTree_Cohorts_Utxo_All_Unrealized} u - * @param {(metric: string) => string} title + * @param {Brk.SeriesTree_Cohorts_Utxo_All_Unrealized} u + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function unrealizedPnlTreeAll(u, title) { @@ -112,7 +112,7 @@ function unrealizedPnlTreeAll(u, title) { /** * Unrealized P&L tree for Full cohorts (STH) * @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2} u - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function unrealizedPnlTreeFull(u, title) { @@ -128,7 +128,7 @@ function unrealizedPnlTreeFull(u, title) { /** * Unrealized P&L tree for LTH (loss relToMcap only) * @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2} u - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function unrealizedPnlTreeLongTerm(u, title) { @@ -148,7 +148,7 @@ function unrealizedPnlTreeLongTerm(u, title) { /** * Unrealized P&L tree for mid-tier cohorts (AgeRange/MaxAge) * @param {Brk.LossNetNuplProfitPattern} u - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function unrealizedPnlTreeMid(u, title) { @@ -170,9 +170,9 @@ function unrealizedPnlTreeMid(u, title) { /** * Unrealized cumulative + rolling P&L tree (profit and loss have cumulative.usd + sum[w].usd) - * @param {{ cumulative: { usd: AnyMetricPattern }, sum: { _24h: { usd: AnyMetricPattern }, _1w: { usd: AnyMetricPattern }, _1m: { usd: AnyMetricPattern }, _1y: { usd: AnyMetricPattern } } }} profit - * @param {{ cumulative: { usd: AnyMetricPattern }, sum: { _24h: { usd: AnyMetricPattern }, _1w: { usd: AnyMetricPattern }, _1m: { usd: AnyMetricPattern }, _1y: { usd: AnyMetricPattern } } }} loss - * @param {(metric: string) => string} title + * @param {{ cumulative: { usd: AnySeriesPattern }, sum: { _24h: { usd: AnySeriesPattern }, _1w: { usd: AnySeriesPattern }, _1m: { usd: AnySeriesPattern }, _1y: { usd: AnySeriesPattern } } }} profit + * @param {{ cumulative: { usd: AnySeriesPattern }, sum: { _24h: { usd: AnySeriesPattern }, _1w: { usd: AnySeriesPattern }, _1m: { usd: AnySeriesPattern }, _1y: { usd: AnySeriesPattern } } }} loss + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function unrealizedCumulativeRollingTree(profit, loss, title) { @@ -181,8 +181,8 @@ function unrealizedCumulativeRollingTree(profit, loss, title) { name: "Cumulative", title: title("Cumulative Unrealized P&L"), bottom: [ - line({ metric: profit.cumulative.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), - line({ metric: loss.cumulative.usd, name: "Loss", color: colors.loss, unit: Unit.usd }), + line({ series: profit.cumulative.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), + line({ series: loss.cumulative.usd, name: "Loss", color: colors.loss, unit: Unit.usd }), ], }, { @@ -195,13 +195,13 @@ function unrealizedCumulativeRollingTree(profit, loss, title) { name: "Compare", title: title("Rolling Unrealized Profit"), bottom: ROLLING_WINDOWS.map((w) => - line({ metric: profit.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), + line({ series: profit.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Unrealized Profit (${w.name})`), - bottom: [line({ metric: profit.sum[w.key].usd, name: "Profit", color: colors.profit, unit: Unit.usd })], + bottom: [line({ series: profit.sum[w.key].usd, name: "Profit", color: colors.profit, unit: Unit.usd })], })), ], }, @@ -212,13 +212,13 @@ function unrealizedCumulativeRollingTree(profit, loss, title) { name: "Compare", title: title("Rolling Unrealized Loss"), bottom: ROLLING_WINDOWS.map((w) => - line({ metric: loss.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), + line({ series: loss.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Unrealized Loss (${w.name})`), - bottom: [line({ metric: loss.sum[w.key].usd, name: "Loss", color: colors.loss, unit: Unit.usd })], + bottom: [line({ series: loss.sum[w.key].usd, name: "Loss", color: colors.loss, unit: Unit.usd })], })), ], }, @@ -232,8 +232,8 @@ function unrealizedCumulativeRollingTree(profit, loss, title) { // ============================================================================ /** - * @param {Brk.MetricsTree_Cohorts_Utxo_All_Unrealized} u - * @param {(metric: string) => string} title + * @param {Brk.SeriesTree_Cohorts_Utxo_All_Unrealized} u + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function netUnrealizedTreeAll(u, title) { @@ -249,7 +249,7 @@ function netUnrealizedTreeAll(u, title) { /** * @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2} u - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function netUnrealizedTreeFull(u, title) { @@ -283,26 +283,26 @@ function netUnrealizedMid(u) { /** * Invested capital (Full unrealized only) - * @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2 | Brk.MetricsTree_Cohorts_Utxo_All_Unrealized} u + * @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2 | Brk.SeriesTree_Cohorts_Utxo_All_Unrealized} u * @returns {AnyFetchedSeriesBlueprint[]} */ function investedCapitalSeries(u) { return [ - line({ metric: u.investedCapital.inProfit.usd, name: "In Profit", color: colors.profit, unit: Unit.usd }), - line({ metric: u.investedCapital.inLoss.usd, name: "In Loss", color: colors.loss, unit: Unit.usd }), + line({ series: u.investedCapital.inProfit.usd, name: "In Profit", color: colors.profit, unit: Unit.usd }), + line({ series: u.investedCapital.inLoss.usd, name: "In Loss", color: colors.loss, unit: Unit.usd }), ]; } /** * Sentiment (Full unrealized only) - * @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2 | Brk.MetricsTree_Cohorts_Utxo_All_Unrealized} u + * @param {Brk.GrossInvestedLossNetNuplProfitSentimentPattern2 | Brk.SeriesTree_Cohorts_Utxo_All_Unrealized} u * @returns {AnyFetchedSeriesBlueprint[]} */ function sentimentSeries(u) { return [ - baseline({ metric: u.sentiment.net.usd, name: "Net Sentiment", unit: Unit.usd }), - line({ metric: u.sentiment.greedIndex.usd, name: "Greed Index", color: colors.profit, unit: Unit.usd, defaultActive: false }), - line({ metric: u.sentiment.painIndex.usd, name: "Pain Index", color: colors.loss, unit: Unit.usd, defaultActive: false }), + baseline({ series: u.sentiment.net.usd, name: "Net Sentiment", unit: Unit.usd }), + line({ series: u.sentiment.greedIndex.usd, name: "Greed Index", color: colors.profit, unit: Unit.usd, defaultActive: false }), + line({ series: u.sentiment.painIndex.usd, name: "Pain Index", color: colors.loss, unit: Unit.usd, defaultActive: false }), ]; } @@ -312,7 +312,7 @@ function sentimentSeries(u) { * @returns {AnyFetchedSeriesBlueprint[]} */ function nuplSeries(nupl) { - return [baseline({ metric: nupl.ratio, name: "NUPL", unit: Unit.ratio })]; + return [baseline({ series: nupl.ratio, name: "NUPL", unit: Unit.ratio })]; } // ============================================================================ @@ -320,8 +320,8 @@ function nuplSeries(nupl) { // ============================================================================ /** - * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.MetricsTree_Cohorts_Utxo_Lth_Realized} r - * @param {(metric: string) => string} title + * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function realizedPnlSumTreeFull(r, title) { @@ -330,9 +330,9 @@ function realizedPnlSumTreeFull(r, title) { name: "USD", title: title("Realized P&L"), bottom: [ - dots({ metric: r.profit.base.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), - dots({ metric: r.loss.negative, name: "Negative Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), - dots({ metric: r.loss.base.usd, name: "Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), + dots({ series: r.profit.base.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), + dots({ series: r.loss.negative, name: "Negative Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), + dots({ series: r.loss.base.usd, name: "Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), ], }, { @@ -347,13 +347,13 @@ function realizedPnlSumTreeFull(r, title) { } /** - * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.MetricsTree_Cohorts_Utxo_Lth_Realized} r - * @param {(metric: string) => string} title + * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function realizedNetPnlSumTreeFull(r, title) { return [ - { name: "USD", title: title("Net Realized P&L"), bottom: [dotsBaseline({ metric: r.netPnl.base.usd, name: "Net", unit: Unit.usd })] }, + { name: "USD", title: title("Net Realized P&L"), bottom: [dotsBaseline({ series: r.netPnl.base.usd, name: "Net", unit: Unit.usd })] }, { name: "% of Rcap", title: title("Net Realized P&L (% of Realized Cap)"), @@ -363,8 +363,8 @@ function realizedNetPnlSumTreeFull(r, title) { } /** - * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.MetricsTree_Cohorts_Utxo_Lth_Realized} r - * @param {(metric: string) => string} title + * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function realizedPnlCumulativeTreeFull(r, title) { @@ -373,9 +373,9 @@ function realizedPnlCumulativeTreeFull(r, title) { name: "USD", title: title("Cumulative Realized P&L"), bottom: [ - line({ metric: r.profit.cumulative.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), - line({ metric: r.loss.cumulative.usd, name: "Loss", color: colors.loss, unit: Unit.usd }), - line({ metric: r.loss.negative, name: "Negative Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), + line({ series: r.profit.cumulative.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), + line({ series: r.loss.cumulative.usd, name: "Loss", color: colors.loss, unit: Unit.usd }), + line({ series: r.loss.negative, name: "Negative Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), ], }, { @@ -392,7 +392,7 @@ function realizedPnlCumulativeTreeFull(r, title) { /** * Net realized P&L delta tree (absolute + rate across all rolling windows) * @param {Brk.BaseChangeCumulativeDeltaRelSumPattern | Brk.BaseCumulativeDeltaSumPattern} netPnl - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function realizedNetPnlDeltaTree(netPnl, title) { @@ -406,13 +406,13 @@ function realizedNetPnlDeltaTree(netPnl, title) { name: "Compare", title: title("Net Realized P&L Change"), bottom: ROLLING_WINDOWS.map((w) => - baseline({ metric: netPnl.delta.absolute[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), + baseline({ series: netPnl.delta.absolute[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Net Realized P&L Change (${w.name})`), - bottom: [baseline({ metric: netPnl.delta.absolute[w.key].usd, name: "Change", unit: Unit.usd })], + bottom: [baseline({ series: netPnl.delta.absolute[w.key].usd, name: "Change", unit: Unit.usd })], })), ], }, @@ -439,8 +439,8 @@ function realizedNetPnlDeltaTree(netPnl, title) { /** * Full realized delta tree (absolute + rate + rel to mcap/rcap) - * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.MetricsTree_Cohorts_Utxo_Lth_Realized} r - * @param {(metric: string) => string} title + * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function realizedNetPnlDeltaTreeFull(r, title) { @@ -465,8 +465,8 @@ function realizedNetPnlDeltaTreeFull(r, title) { /** * Rolling net realized P&L tree (reusable by full and mid realized) - * @param {{ sum: { _24h: { usd: AnyMetricPattern }, _1w: { usd: AnyMetricPattern }, _1m: { usd: AnyMetricPattern }, _1y: { usd: AnyMetricPattern } } }} netPnl - * @param {(metric: string) => string} title + * @param {{ sum: { _24h: { usd: AnySeriesPattern }, _1w: { usd: AnySeriesPattern }, _1m: { usd: AnySeriesPattern }, _1y: { usd: AnySeriesPattern } } }} netPnl + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function rollingNetRealizedTree(netPnl, title) { @@ -477,13 +477,13 @@ function rollingNetRealizedTree(netPnl, title) { name: "Compare", title: title("Rolling Net Realized P&L"), bottom: ROLLING_WINDOWS.map((w) => - baseline({ metric: netPnl.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), + baseline({ series: netPnl.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Net Realized P&L (${w.name})`), - bottom: [baseline({ metric: netPnl.sum[w.key].usd, name: "Net", unit: Unit.usd })], + bottom: [baseline({ series: netPnl.sum[w.key].usd, name: "Net", unit: Unit.usd })], })), ], }; @@ -491,8 +491,8 @@ function rollingNetRealizedTree(netPnl, title) { /** * Rolling realized with P/L and ratio (full realized only) - * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.MetricsTree_Cohorts_Utxo_Lth_Realized} r - * @param {(metric: string) => string} title + * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function singleRollingRealizedTreeFull(r, title) { @@ -504,13 +504,13 @@ function singleRollingRealizedTreeFull(r, title) { name: "Compare", title: title("Rolling Realized Profit"), bottom: ROLLING_WINDOWS.map((w) => - line({ metric: r.profit.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), + line({ series: r.profit.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Realized Profit (${w.name})`), - bottom: [line({ metric: r.profit.sum[w.key].usd, name: "Profit", color: colors.profit, unit: Unit.usd })], + bottom: [line({ series: r.profit.sum[w.key].usd, name: "Profit", color: colors.profit, unit: Unit.usd })], })), ], }, @@ -521,13 +521,13 @@ function singleRollingRealizedTreeFull(r, title) { name: "Compare", title: title("Rolling Realized Loss"), bottom: ROLLING_WINDOWS.map((w) => - line({ metric: r.loss.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), + line({ series: r.loss.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Realized Loss (${w.name})`), - bottom: [line({ metric: r.loss.sum[w.key].usd, name: "Loss", color: colors.loss, unit: Unit.usd })], + bottom: [line({ series: r.loss.sum[w.key].usd, name: "Loss", color: colors.loss, unit: Unit.usd })], })), ], }, @@ -539,13 +539,13 @@ function singleRollingRealizedTreeFull(r, title) { name: "Compare", title: title("Rolling Realized P/L Ratio"), bottom: ROLLING_WINDOWS.map((w) => - baseline({ metric: r.profitToLossRatio[w.key], name: w.name, color: w.color, unit: Unit.ratio, base: 1 }), + baseline({ series: r.profitToLossRatio[w.key], name: w.name, color: w.color, unit: Unit.ratio, base: 1 }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Realized P/L Ratio (${w.name})`), - bottom: [baseline({ metric: r.profitToLossRatio[w.key], name: "P/L Ratio", unit: Unit.ratio, base: 1 })], + bottom: [baseline({ series: r.profitToLossRatio[w.key], name: "P/L Ratio", unit: Unit.ratio, base: 1 })], })), ], }, @@ -556,7 +556,7 @@ function singleRollingRealizedTreeFull(r, title) { * Rolling realized profit/loss sums (basic — no P/L ratio) * @param {Brk.BaseCumulativeSumPattern3} profit * @param {Brk.BaseCumulativeSumPattern3} loss - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function singleRollingRealizedTreeBasic(profit, loss, title) { @@ -566,7 +566,7 @@ function singleRollingRealizedTreeBasic(profit, loss, title) { tree: ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Realized Profit (${w.name})`), - bottom: [line({ metric: profit.sum[w.key].usd, name: "Profit", color: colors.profit, unit: Unit.usd })], + bottom: [line({ series: profit.sum[w.key].usd, name: "Profit", color: colors.profit, unit: Unit.usd })], })), }, { @@ -574,7 +574,7 @@ function singleRollingRealizedTreeBasic(profit, loss, title) { tree: ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Realized Loss (${w.name})`), - bottom: [line({ metric: loss.sum[w.key].usd, name: "Loss", color: colors.loss, unit: Unit.usd })], + bottom: [line({ series: loss.sum[w.key].usd, name: "Loss", color: colors.loss, unit: Unit.usd })], })), }, ]; @@ -589,7 +589,7 @@ function singleRollingRealizedTreeBasic(profit, loss, title) { * @param {CountPattern} valueCreated * @param {CountPattern} valueDestroyed * @param {string} label - "Profit" or "Loss" - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function realizedValueTree(valueCreated, valueDestroyed, label, title) { @@ -603,16 +603,16 @@ function realizedValueTree(valueCreated, valueDestroyed, label, title) { name: "Compare", title: title(`${label} Value Created vs Destroyed`), bottom: ROLLING_WINDOWS.flatMap((w) => [ - line({ metric: valueCreated.sum[w.key], name: `Created (${w.name})`, color: w.color, unit: Unit.usd }), - line({ metric: valueDestroyed.sum[w.key], name: `Destroyed (${w.name})`, color: w.color, unit: Unit.usd, style: 2 }), + line({ series: valueCreated.sum[w.key], name: `Created (${w.name})`, color: w.color, unit: Unit.usd }), + line({ series: valueDestroyed.sum[w.key], name: `Destroyed (${w.name})`, color: w.color, unit: Unit.usd, style: 2 }), ]), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`${label} Value (${w.name})`), bottom: [ - line({ metric: valueCreated.sum[w.key], name: "Created", color: colors.profit, unit: Unit.usd }), - line({ metric: valueDestroyed.sum[w.key], name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: valueCreated.sum[w.key], name: "Created", color: colors.profit, unit: Unit.usd }), + line({ series: valueDestroyed.sum[w.key], name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], })), ], @@ -621,8 +621,8 @@ function realizedValueTree(valueCreated, valueDestroyed, label, title) { name: "Cumulative", title: title(`Cumulative ${label} Value`), bottom: [ - line({ metric: valueCreated.cumulative, name: "Created", color: colors.profit, unit: Unit.usd }), - line({ metric: valueDestroyed.cumulative, name: "Destroyed", color: colors.loss, unit: Unit.usd }), + line({ series: valueCreated.cumulative, name: "Created", color: colors.profit, unit: Unit.usd }), + line({ series: valueDestroyed.cumulative, name: "Destroyed", color: colors.loss, unit: Unit.usd }), ], }, ], @@ -632,7 +632,7 @@ function realizedValueTree(valueCreated, valueDestroyed, label, title) { /** * Investor price percentiles tree (pct1/2/5/95/98/99) * @param {InvestorPercentilesPattern} percentiles - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function investorPricePercentilesTree(percentiles, title) { @@ -653,21 +653,21 @@ function investorPricePercentilesTree(percentiles, title) { name: "USD", title: title("Investor Price Percentiles"), bottom: pcts.map(([p, name, color]) => - line({ metric: p.price.usd, name, color, unit: Unit.usd }), + line({ series: p.price.usd, name, color, unit: Unit.usd }), ), }, { name: "Sats", title: title("Investor Price Percentiles (Sats)"), bottom: pcts.map(([p, name, color]) => - line({ metric: p.price.sats, name, color, unit: Unit.sats }), + line({ series: p.price.sats, name, color, unit: Unit.sats }), ), }, { name: "Ratio", title: title("Investor Price Percentile Ratios"), bottom: pcts.map(([p, name, color]) => - baseline({ metric: p.ratio, name, color, unit: Unit.ratio }), + baseline({ series: p.ratio, name, color, unit: Unit.ratio }), ), }, ], @@ -676,8 +676,8 @@ function investorPricePercentilesTree(percentiles, title) { /** * Full realized subfolder (All/STH/LTH) - * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.MetricsTree_Cohorts_Utxo_Lth_Realized} r - * @param {(metric: string) => string} title + * @param {Brk.CapGrossInvestorLossMvrvNetPeakPriceProfitSellSoprPattern | Brk.SeriesTree_Cohorts_Utxo_Lth_Realized} r + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function realizedSubfolderFull(r, title) { @@ -690,7 +690,7 @@ function realizedSubfolderFull(r, title) { { name: "Gross P&L", tree: [ - { name: "Base", title: title("Gross Realized P&L"), bottom: [dots({ metric: r.grossPnl.base.usd, name: "Gross P&L", color: colors.bitcoin, unit: Unit.usd })] }, + { name: "Base", title: title("Gross Realized P&L"), bottom: [dots({ series: r.grossPnl.base.usd, name: "Gross P&L", color: colors.bitcoin, unit: Unit.usd })] }, { name: "Rolling", tree: [ @@ -698,17 +698,17 @@ function realizedSubfolderFull(r, title) { name: "Compare", title: title("Rolling Gross Realized P&L"), bottom: ROLLING_WINDOWS.map((w) => - line({ metric: r.grossPnl.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), + line({ series: r.grossPnl.sum[w.key].usd, name: w.name, color: w.color, unit: Unit.usd }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Gross Realized P&L (${w.name})`), - bottom: [line({ metric: r.grossPnl.sum[w.key].usd, name: "Gross P&L", color: colors.bitcoin, unit: Unit.usd })], + bottom: [line({ series: r.grossPnl.sum[w.key].usd, name: "Gross P&L", color: colors.bitcoin, unit: Unit.usd })], })), ], }, - { name: "Cumulative", title: title("Total Realized P&L"), bottom: [line({ metric: r.grossPnl.cumulative.usd, name: "Total", unit: Unit.usd, color: colors.bitcoin })] }, + { name: "Cumulative", title: title("Total Realized P&L"), bottom: [line({ series: r.grossPnl.cumulative.usd, name: "Total", unit: Unit.usd, color: colors.bitcoin })] }, ], }, { @@ -721,12 +721,12 @@ function realizedSubfolderFull(r, title) { { name: "P/L Ratio", title: title("Realized Profit/Loss Ratio"), - bottom: [baseline({ metric: r.profitToLossRatio._1y, name: "P/L Ratio", unit: Unit.ratio, base: 1 })], + bottom: [baseline({ series: r.profitToLossRatio._1y, name: "P/L Ratio", unit: Unit.ratio, base: 1 })], }, { name: "Peak Regret", title: title("Realized Peak Regret"), - bottom: [line({ metric: r.peakRegret.base, name: "Peak Regret", unit: Unit.usd })], + bottom: [line({ series: r.peakRegret.base, name: "Peak Regret", unit: Unit.usd })], }, { name: "Investor Price", @@ -742,7 +742,7 @@ function realizedSubfolderFull(r, title) { { name: "Net", tree: [ - { name: "USD", title: title("Cumulative Net Realized P&L"), bottom: [baseline({ metric: r.netPnl.cumulative.usd, name: "Net", unit: Unit.usd })] }, + { name: "USD", title: title("Cumulative Net Realized P&L"), bottom: [baseline({ series: r.netPnl.cumulative.usd, name: "Net", unit: Unit.usd })] }, { name: "% of Rcap", title: title("Cumulative Net P&L (% of Realized Cap)"), @@ -753,7 +753,7 @@ function realizedSubfolderFull(r, title) { { name: "Peak Regret", tree: [ - { name: "USD", title: title("Cumulative Peak Regret"), bottom: [line({ metric: r.peakRegret.cumulative, name: "Peak Regret", unit: Unit.usd })] }, + { name: "USD", title: title("Cumulative Peak Regret"), bottom: [line({ series: r.peakRegret.cumulative, name: "Peak Regret", unit: Unit.usd })] }, { name: "% of Rcap", title: title("Cumulative Peak Regret (% of Realized Cap)"), @@ -770,7 +770,7 @@ function realizedSubfolderFull(r, title) { /** * Mid realized subfolder (AgeRange/MaxAge — has netPnl + delta, no relToRcap/peakRegret) * @param {Brk.CapLossMvrvNetPriceProfitSoprPattern} r - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function realizedSubfolderMid(r, title) { @@ -781,15 +781,15 @@ function realizedSubfolderMid(r, title) { name: "P&L", title: title("Realized P&L"), bottom: [ - dots({ metric: r.profit.base.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), - dots({ metric: r.loss.negative, name: "Negative Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), - dots({ metric: r.loss.base.usd, name: "Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), + dots({ series: r.profit.base.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), + dots({ series: r.loss.negative, name: "Negative Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), + dots({ series: r.loss.base.usd, name: "Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), ], }, { name: "Net", title: title("Net Realized P&L"), - bottom: [dotsBaseline({ metric: r.netPnl.base.usd, name: "Net", unit: Unit.usd })], + bottom: [dotsBaseline({ series: r.netPnl.base.usd, name: "Net", unit: Unit.usd })], }, realizedNetPnlDeltaTree(r.netPnl, title), { @@ -806,14 +806,14 @@ function realizedSubfolderMid(r, title) { name: "P&L", title: title("Cumulative Realized P&L"), bottom: [ - line({ metric: r.profit.cumulative.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), - line({ metric: r.loss.cumulative.usd, name: "Loss", color: colors.loss, unit: Unit.usd }), + line({ series: r.profit.cumulative.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), + line({ series: r.loss.cumulative.usd, name: "Loss", color: colors.loss, unit: Unit.usd }), ], }, { name: "Net", title: title("Cumulative Net Realized P&L"), - bottom: [baseline({ metric: r.netPnl.cumulative.usd, name: "Net", unit: Unit.usd })], + bottom: [baseline({ series: r.netPnl.cumulative.usd, name: "Net", unit: Unit.usd })], }, ], }, @@ -824,7 +824,7 @@ function realizedSubfolderMid(r, title) { /** * Basic realized subfolder (no netPnl, no relToRcap) * @param {Brk.CapLossMvrvPriceProfitSoprPattern} r - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function realizedSubfolderBasic(r, title) { @@ -835,8 +835,8 @@ function realizedSubfolderBasic(r, title) { name: "P&L", title: title("Realized P&L"), bottom: [ - dots({ metric: r.profit.base.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), - dots({ metric: r.loss.base.usd, name: "Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), + dots({ series: r.profit.base.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), + dots({ series: r.loss.base.usd, name: "Loss", color: colors.loss, unit: Unit.usd, defaultActive: false }), ], }, { name: "Rolling", tree: singleRollingRealizedTreeBasic(r.profit, r.loss, title) }, @@ -844,8 +844,8 @@ function realizedSubfolderBasic(r, title) { name: "Cumulative", title: title("Cumulative Realized P&L"), bottom: [ - line({ metric: r.profit.cumulative.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), - line({ metric: r.loss.cumulative.usd, name: "Loss", color: colors.loss, unit: Unit.usd }), + line({ series: r.profit.cumulative.usd, name: "Profit", color: colors.profit, unit: Unit.usd }), + line({ series: r.loss.cumulative.usd, name: "Loss", color: colors.loss, unit: Unit.usd }), ], }, ], @@ -858,7 +858,7 @@ function realizedSubfolderBasic(r, title) { /** * Basic profitability section (NUPL only unrealized, basic realized) - * @param {{ cohort: UtxoCohortObject, title: (metric: string) => string }} args + * @param {{ cohort: UtxoCohortObject, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createProfitabilitySection({ cohort, title }) { @@ -880,7 +880,7 @@ export function createProfitabilitySection({ cohort, title }) { /** * Profitability section with unrealized P&L + NUPL (no netPnl, no rel) * For: CohortWithoutRelative (p2ms, unknown, empty) - * @param {{ cohort: CohortWithoutRelative, title: (metric: string) => string }} args + * @param {{ cohort: CohortWithoutRelative, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createProfitabilitySectionWithProfitLoss({ cohort, title }) { @@ -915,7 +915,7 @@ export function createProfitabilitySectionWithProfitLoss({ cohort, title }) { /** * Section for All cohort - * @param {{ cohort: CohortAll, title: (metric: string) => string }} args + * @param {{ cohort: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createProfitabilitySectionAll({ cohort, title }) { @@ -945,7 +945,7 @@ export function createProfitabilitySectionAll({ cohort, title }) { /** * Section for Full cohorts (STH) - * @param {{ cohort: CohortFull, title: (metric: string) => string }} args + * @param {{ cohort: CohortFull, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createProfitabilitySectionFull({ cohort, title }) { @@ -975,7 +975,7 @@ export function createProfitabilitySectionFull({ cohort, title }) { /** * Section with NUPL (basic cohorts with market cap — NuplPattern unrealized) - * @param {{ cohort: CohortBasicWithMarketCap, title: (metric: string) => string }} args + * @param {{ cohort: CohortBasicWithMarketCap, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createProfitabilitySectionWithNupl({ cohort, title }) { @@ -996,7 +996,7 @@ export function createProfitabilitySectionWithNupl({ cohort, title }) { /** * Section for LongTerm cohort - * @param {{ cohort: CohortLongTerm, title: (metric: string) => string }} args + * @param {{ cohort: CohortLongTerm, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createProfitabilitySectionLongTerm({ cohort, title }) { @@ -1026,7 +1026,7 @@ export function createProfitabilitySectionLongTerm({ cohort, title }) { /** * Section for AgeRange cohorts (mid-tier: has unrealized profit/loss/netPnl, mid realized) - * @param {{ cohort: CohortAgeRange, title: (metric: string) => string }} args + * @param {{ cohort: CohortAgeRange, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createProfitabilitySectionWithInvestedCapitalPct({ cohort, title }) { @@ -1050,7 +1050,7 @@ export function createProfitabilitySectionWithInvestedCapitalPct({ cohort, title /** * Section with invested capital % but no unrealized relative (basic cohorts) - * @param {{ cohort: CohortBasicWithoutMarketCap, title: (metric: string) => string }} args + * @param {{ cohort: CohortBasicWithoutMarketCap, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createProfitabilitySectionBasicWithInvestedCapitalPct({ cohort, title }) { @@ -1071,7 +1071,7 @@ export function createProfitabilitySectionBasicWithInvestedCapitalPct({ cohort, /** * Section for CohortAddress (has unrealized profit/loss + NUPL, basic realized) - * @param {{ cohort: CohortAddress, title: (metric: string) => string }} args + * @param {{ cohort: CohortAddress, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createProfitabilitySectionAddress({ cohort, title }) { @@ -1114,7 +1114,7 @@ export function createProfitabilitySectionAddress({ cohort, title }) { * @template {{ name: string, color: Color, tree: { realized: { profit: Brk.BaseCumulativeSumPattern3, loss: Brk.BaseCumulativeSumPattern3 } } }} A * @param {readonly T[]} list * @param {A} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function groupedRealizedPnlSum(list, all, title) { @@ -1123,14 +1123,14 @@ function groupedRealizedPnlSum(list, all, title) { name: "Profit", title: title("Realized Profit"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.realized.profit.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.realized.profit.base.usd, name, color, unit: Unit.usd }), ), }, { name: "Loss", title: title("Realized Loss"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.realized.loss.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.realized.loss.base.usd, name, color, unit: Unit.usd }), ), }, ]; @@ -1140,7 +1140,7 @@ function groupedRealizedPnlSum(list, all, title) { * Grouped realized P&L sum with extras (full cohorts) * @param {readonly (CohortAll | CohortFull | CohortLongTerm)[]} list * @param {CohortAll} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function groupedRealizedPnlSumFull(list, all, title) { @@ -1150,14 +1150,14 @@ function groupedRealizedPnlSumFull(list, all, title) { name: "Total", title: title("Total Realized P&L"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.realized.grossPnl.cumulative.usd, name, color, unit: Unit.usd }), + line({ series: tree.realized.grossPnl.cumulative.usd, name, color, unit: Unit.usd }), ), }, { name: "P/L Ratio", title: title("Realized Profit/Loss Ratio"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.realized.profitToLossRatio._1y, name, color, unit: Unit.ratio, base: 1 }), + baseline({ series: tree.realized.profitToLossRatio._1y, name, color, unit: Unit.ratio, base: 1 }), ), }, ]; @@ -1169,7 +1169,7 @@ function groupedRealizedPnlSumFull(list, all, title) { * @template {{ name: string, color: Color, tree: { realized: { profit: Brk.BaseCumulativeSumPattern3, loss: Brk.BaseCumulativeSumPattern3 } } }} A * @param {readonly T[]} list * @param {A} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function groupedRollingRealizedCharts(list, all, title) { @@ -1179,7 +1179,7 @@ function groupedRollingRealizedCharts(list, all, title) { tree: ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Realized Profit (${w.name})`), - bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.profit.sum[w.key].usd, name, color, unit: Unit.usd })), + bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.profit.sum[w.key].usd, name, color, unit: Unit.usd })), })), }, { @@ -1187,7 +1187,7 @@ function groupedRollingRealizedCharts(list, all, title) { tree: ROLLING_WINDOWS.map((w) => ({ name: w.name, title: title(`Realized Loss (${w.name})`), - bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ metric: tree.realized.loss.sum[w.key].usd, name, color, unit: Unit.usd })), + bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ series: tree.realized.loss.sum[w.key].usd, name, color, unit: Unit.usd })), })), }, ]; @@ -1197,7 +1197,7 @@ function groupedRollingRealizedCharts(list, all, title) { * Grouped rolling realized with P/L ratio (full cohorts) * @param {readonly (CohortAll | CohortFull | CohortLongTerm)[]} list * @param {CohortAll} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function groupedRollingRealizedChartsFull(list, all, title) { @@ -1209,7 +1209,7 @@ function groupedRollingRealizedChartsFull(list, all, title) { name: w.name, title: title(`Realized P/L Ratio (${w.name})`), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.realized.profitToLossRatio[w.key], name, color, unit: Unit.ratio, base: 1 }), + baseline({ series: tree.realized.profitToLossRatio[w.key], name, color, unit: Unit.ratio, base: 1 }), ), })), }, @@ -1222,7 +1222,7 @@ function groupedRollingRealizedChartsFull(list, all, title) { * @template {{ name: string, color: Color, tree: { realized: { profit: Brk.BaseCumulativeSumPattern3, loss: Brk.BaseCumulativeSumPattern3 } } }} A * @param {readonly T[]} list * @param {A} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function groupedRealizedSubfolder(list, all, title) { @@ -1238,14 +1238,14 @@ function groupedRealizedSubfolder(list, all, title) { name: "Profit", title: title("Cumulative Realized Profit"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.realized.profit.cumulative.usd, name, color, unit: Unit.usd }), + line({ series: tree.realized.profit.cumulative.usd, name, color, unit: Unit.usd }), ), }, { name: "Loss", title: title("Cumulative Realized Loss"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.realized.loss.cumulative.usd, name, color, unit: Unit.usd }), + line({ series: tree.realized.loss.cumulative.usd, name, color, unit: Unit.usd }), ), }, ], @@ -1258,7 +1258,7 @@ function groupedRealizedSubfolder(list, all, title) { * Grouped net realized P&L delta (Absolute + Rate with all rolling windows) * @param {readonly (CohortAll | CohortFull | CohortLongTerm)[]} list * @param {CohortAll} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function groupedRealizedNetPnlDeltaTree(list, all, title) { @@ -1273,7 +1273,7 @@ function groupedRealizedNetPnlDeltaTree(list, all, title) { title: title("Net Realized P&L Change"), bottom: ROLLING_WINDOWS.flatMap((w) => mapCohortsWithAll(list, all, ({ name, tree }) => - baseline({ metric: tree.realized.netPnl.delta.absolute[w.key].usd, name: `${name} (${w.name})`, color: w.color, unit: Unit.usd }), + baseline({ series: tree.realized.netPnl.delta.absolute[w.key].usd, name: `${name} (${w.name})`, color: w.color, unit: Unit.usd }), ), ), }, @@ -1281,7 +1281,7 @@ function groupedRealizedNetPnlDeltaTree(list, all, title) { name: w.name, title: title(`Net Realized P&L Change (${w.name})`), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.realized.netPnl.delta.absolute[w.key].usd, name, color, unit: Unit.usd }), + baseline({ series: tree.realized.netPnl.delta.absolute[w.key].usd, name, color, unit: Unit.usd }), ), })), ], @@ -1315,7 +1315,7 @@ function groupedRealizedNetPnlDeltaTree(list, all, title) { * Grouped realized subfolder for full cohorts * @param {readonly (CohortAll | CohortFull | CohortLongTerm)[]} list * @param {CohortAll} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function groupedRealizedSubfolderFull(list, all, title) { @@ -1327,7 +1327,7 @@ function groupedRealizedSubfolderFull(list, all, title) { name: "Net", title: title("Net Realized P&L"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.realized.netPnl.base.usd, name, color, unit: Unit.usd }), + baseline({ series: tree.realized.netPnl.base.usd, name, color, unit: Unit.usd }), ), }, groupedRealizedNetPnlDeltaTree(list, all, title), @@ -1339,21 +1339,21 @@ function groupedRealizedSubfolderFull(list, all, title) { name: "Profit", title: title("Cumulative Realized Profit"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.realized.profit.cumulative.usd, name, color, unit: Unit.usd }), + line({ series: tree.realized.profit.cumulative.usd, name, color, unit: Unit.usd }), ), }, { name: "Loss", title: title("Cumulative Realized Loss"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.realized.loss.cumulative.usd, name, color, unit: Unit.usd }), + line({ series: tree.realized.loss.cumulative.usd, name, color, unit: Unit.usd }), ), }, { name: "Net", title: title("Cumulative Net Realized P&L"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.realized.netPnl.cumulative.usd, name, color, unit: Unit.usd }), + baseline({ series: tree.realized.netPnl.cumulative.usd, name, color, unit: Unit.usd }), ), }, ], @@ -1368,7 +1368,7 @@ function groupedRealizedSubfolderFull(list, all, title) { * @template {{ name: string, color: Color, tree: { unrealized: { nupl: Brk.BpsRatioPattern } } }} A * @param {readonly T[]} list * @param {A} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function groupedNuplCharts(list, all, title) { @@ -1377,7 +1377,7 @@ function groupedNuplCharts(list, all, title) { name: "NUPL", title: title("NUPL"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.unrealized.nupl.ratio, name, color, unit: Unit.ratio }), + baseline({ series: tree.unrealized.nupl.ratio, name, color, unit: Unit.ratio }), ), }, ]; @@ -1387,7 +1387,7 @@ function groupedNuplCharts(list, all, title) { * Grouped unrealized for full cohorts with relToMcap * @param {readonly (CohortFull | CohortLongTerm)[]} list * @param {CohortAll} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function groupedPnlChartsWithMarketCap(list, all, title) { @@ -1399,7 +1399,7 @@ function groupedPnlChartsWithMarketCap(list, all, title) { name: "USD", title: title("Unrealized Profit"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.profit.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.profit.base.usd, name, color, unit: Unit.usd }), ), }, { @@ -1418,7 +1418,7 @@ function groupedPnlChartsWithMarketCap(list, all, title) { name: "USD", title: title("Unrealized Loss"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.loss.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.loss.base.usd, name, color, unit: Unit.usd }), ), }, { @@ -1434,7 +1434,7 @@ function groupedPnlChartsWithMarketCap(list, all, title) { name: "Net P&L", title: title("Net Unrealized P&L"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.unrealized.netPnl.usd, name, color, unit: Unit.usd }), + baseline({ series: tree.unrealized.netPnl.usd, name, color, unit: Unit.usd }), ), }, ]; @@ -1444,7 +1444,7 @@ function groupedPnlChartsWithMarketCap(list, all, title) { * Grouped unrealized for AgeRange/MaxAge (profit/loss without relToMcap) * @param {readonly (CohortAgeRange | CohortWithAdjusted)[]} list * @param {CohortAll} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function groupedPnlChartsWithOwnMarketCap(list, all, title) { @@ -1453,21 +1453,21 @@ function groupedPnlChartsWithOwnMarketCap(list, all, title) { name: "Profit", title: title("Unrealized Profit"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.profit.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.profit.base.usd, name, color, unit: Unit.usd }), ), }, { name: "Loss", title: title("Unrealized Loss"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.loss.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.loss.base.usd, name, color, unit: Unit.usd }), ), }, { name: "Net P&L", title: title("Net Unrealized P&L"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.unrealized.netPnl.usd, name, color, unit: Unit.usd }), + baseline({ series: tree.unrealized.netPnl.usd, name, color, unit: Unit.usd }), ), }, ]; @@ -1477,7 +1477,7 @@ function groupedPnlChartsWithOwnMarketCap(list, all, title) { * Grouped unrealized for LongTerm (profit/loss with relToOwnMcap + relToOwnGross) * @param {readonly CohortLongTerm[]} list * @param {CohortAll} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsTree} */ function groupedPnlChartsLongTerm(list, all, title) { @@ -1489,7 +1489,7 @@ function groupedPnlChartsLongTerm(list, all, title) { name: "USD", title: title("Unrealized Profit"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.profit.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.profit.base.usd, name, color, unit: Unit.usd }), ), }, { @@ -1515,7 +1515,7 @@ function groupedPnlChartsLongTerm(list, all, title) { name: "USD", title: title("Unrealized Loss"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.loss.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.loss.base.usd, name, color, unit: Unit.usd }), ), }, { @@ -1548,7 +1548,7 @@ function groupedPnlChartsLongTerm(list, all, title) { name: "USD", title: title("Net Unrealized P&L"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.unrealized.netPnl.usd, name, color, unit: Unit.usd }), + baseline({ series: tree.unrealized.netPnl.usd, name, color, unit: Unit.usd }), ), }, { @@ -1574,7 +1574,7 @@ function groupedPnlChartsLongTerm(list, all, title) { * Grouped sentiment (full unrealized only) * @param {readonly (CohortAll | CohortFull | CohortLongTerm)[]} list * @param {CohortAll} all - * @param {(metric: string) => string} title + * @param {(name: string) => string} title * @returns {PartialOptionsGroup} */ function groupedSentiment(list, all, title) { @@ -1585,21 +1585,21 @@ function groupedSentiment(list, all, title) { name: "Net", title: title("Net Sentiment"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.unrealized.sentiment.net.usd, name, color, unit: Unit.usd }), + baseline({ series: tree.unrealized.sentiment.net.usd, name, color, unit: Unit.usd }), ), }, { name: "Greed", title: title("Greed Index"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.sentiment.greedIndex.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.sentiment.greedIndex.usd, name, color, unit: Unit.usd }), ), }, { name: "Pain", title: title("Pain Index"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.sentiment.painIndex.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.sentiment.painIndex.usd, name, color, unit: Unit.usd }), ), }, ], @@ -1612,7 +1612,7 @@ function groupedSentiment(list, all, title) { /** * Grouped profitability section (basic — NUPL only) - * @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedProfitabilitySection({ list, all, title }) { @@ -1628,7 +1628,7 @@ export function createGroupedProfitabilitySection({ list, all, title }) { /** * Grouped profitability with unrealized profit/loss + NUPL * For: CohortWithoutRelative (p2ms, unknown, empty) - * @param {{ list: readonly CohortWithoutRelative[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly CohortWithoutRelative[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedProfitabilitySectionWithProfitLoss({ list, all, title }) { @@ -1642,14 +1642,14 @@ export function createGroupedProfitabilitySectionWithProfitLoss({ list, all, tit name: "Profit", title: title("Unrealized Profit"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.profit.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.profit.base.usd, name, color, unit: Unit.usd }), ), }, { name: "Loss", title: title("Unrealized Loss"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.unrealized.loss.base.usd, name, color, unit: Unit.usd }), + line({ series: tree.unrealized.loss.base.usd, name, color, unit: Unit.usd }), ), }, ...groupedNuplCharts(list, all, title), @@ -1662,7 +1662,7 @@ export function createGroupedProfitabilitySectionWithProfitLoss({ list, all, tit /** * Grouped section with invested capital % (basic cohorts — uses NUPL only) - * @param {{ list: readonly CohortBasicWithoutMarketCap[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly CohortBasicWithoutMarketCap[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedProfitabilitySectionBasicWithInvestedCapitalPct({ list, all, title }) { @@ -1677,7 +1677,7 @@ export function createGroupedProfitabilitySectionBasicWithInvestedCapitalPct({ l /** * Grouped section for ageRange/maxAge cohorts - * @param {{ list: readonly (CohortAgeRange | CohortWithAdjusted)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (CohortAgeRange | CohortWithAdjusted)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedProfitabilitySectionWithInvestedCapitalPct({ list, all, title }) { @@ -1698,7 +1698,7 @@ export function createGroupedProfitabilitySectionWithInvestedCapitalPct({ list, /** * Grouped section with NUPL + relToMcap - * @param {{ list: readonly (CohortFull | CohortLongTerm)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (CohortFull | CohortLongTerm)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedProfitabilitySectionWithNupl({ list, all, title }) { @@ -1719,7 +1719,7 @@ export function createGroupedProfitabilitySectionWithNupl({ list, all, title }) /** * Grouped section for LongTerm cohorts - * @param {{ list: readonly CohortLongTerm[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly CohortLongTerm[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedProfitabilitySectionLongTerm({ list, all, title }) { diff --git a/website/scripts/options/distribution/valuation.js b/website/scripts/options/distribution/valuation.js index 8eef6e24f..d2a68c94e 100644 --- a/website/scripts/options/distribution/valuation.js +++ b/website/scripts/options/distribution/valuation.js @@ -22,7 +22,7 @@ function createSingleRealizedCapSeries(cohort) { const { color, tree } = cohort; return [ line({ - metric: tree.realized.cap.usd, + series: tree.realized.cap.usd, name: "Realized Cap", color, unit: Unit.usd, @@ -33,7 +33,7 @@ function createSingleRealizedCapSeries(cohort) { /** * Create valuation section for cohorts with full ratio patterns * (CohortAll, CohortFull, CohortWithPercentiles) - * @param {{ cohort: CohortAll | CohortFull | CohortLongTerm, title: (metric: string) => string }} args + * @param {{ cohort: CohortAll | CohortFull | CohortLongTerm, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createValuationSectionFull({ cohort, title }) { @@ -77,7 +77,7 @@ export function createValuationSectionFull({ cohort, title }) { /** * Create valuation section for cohorts with basic ratio patterns * (CohortWithAdjusted, CohortBasic, CohortAddress, CohortWithoutRelative) - * @param {{ cohort: CohortWithAdjusted | CohortBasic | CohortAddress | CohortWithoutRelative, title: (metric: string) => string }} args + * @param {{ cohort: CohortWithAdjusted | CohortBasic | CohortAddress | CohortWithoutRelative, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createValuationSection({ cohort, title }) { @@ -102,7 +102,7 @@ export function createValuationSection({ cohort, title }) { title: title("MVRV"), bottom: [ baseline({ - metric: tree.realized.mvrv, + series: tree.realized.mvrv, name: "MVRV", unit: Unit.ratio, base: 1, @@ -114,7 +114,7 @@ export function createValuationSection({ cohort, title }) { } /** - * @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (UtxoCohortObject | CohortWithoutRelative)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedValuationSection({ list, all, title }) { @@ -126,7 +126,7 @@ export function createGroupedValuationSection({ list, all, title }) { title: title("Realized Cap"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => line({ - metric: tree.realized.cap.usd, + series: tree.realized.cap.usd, name, color, unit: Unit.usd, @@ -142,7 +142,7 @@ export function createGroupedValuationSection({ list, all, title }) { name: w.name, title: title(`Realized Cap Change (${w.name})`), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.realized.cap.delta.absolute[w.key].usd, name, color, unit: Unit.usd }), + baseline({ series: tree.realized.cap.delta.absolute[w.key].usd, name, color, unit: Unit.usd }), ), })), }, @@ -163,7 +163,7 @@ export function createGroupedValuationSection({ list, all, title }) { title: title("MVRV"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => baseline({ - metric: tree.realized.mvrv, + series: tree.realized.mvrv, name, color, unit: Unit.ratio, @@ -176,7 +176,7 @@ export function createGroupedValuationSection({ list, all, title }) { } /** - * @param {{ list: readonly (CohortAll | CohortFull | CohortLongTerm)[], all: CohortAll, title: (metric: string) => string }} args + * @param {{ list: readonly (CohortAll | CohortFull | CohortLongTerm)[], all: CohortAll, title: (name: string) => string }} args * @returns {PartialOptionsGroup} */ export function createGroupedValuationSectionWithOwnMarketCap({ @@ -194,7 +194,7 @@ export function createGroupedValuationSectionWithOwnMarketCap({ name: "USD", title: title("Realized Cap"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - line({ metric: tree.realized.cap.usd, name, color, unit: Unit.usd }), + line({ series: tree.realized.cap.usd, name, color, unit: Unit.usd }), ), }, { @@ -215,7 +215,7 @@ export function createGroupedValuationSectionWithOwnMarketCap({ name: w.name, title: title(`Realized Cap Change (${w.name})`), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => - baseline({ metric: tree.realized.cap.delta.absolute[w.key].usd, name, color, unit: Unit.usd }), + baseline({ series: tree.realized.cap.delta.absolute[w.key].usd, name, color, unit: Unit.usd }), ), })), }, @@ -236,7 +236,7 @@ export function createGroupedValuationSectionWithOwnMarketCap({ title: title("MVRV"), bottom: mapCohortsWithAll(list, all, ({ name, color, tree }) => baseline({ - metric: tree.realized.mvrv, + series: tree.realized.mvrv, name, color, unit: Unit.ratio, diff --git a/website/scripts/options/full.js b/website/scripts/options/full.js index ad217e241..f8c2f1509 100644 --- a/website/scripts/options/full.js +++ b/website/scripts/options/full.js @@ -122,32 +122,32 @@ export function initOptions() { for (let i = 0; i < arr.length; i++) { const blueprint = arr[i]; - // Check for undefined metric - if (!blueprint.metric) { - throw new Error(`Blueprint has undefined metric: ${blueprint.title}`); + // Check for undefined series + if (!blueprint.series) { + throw new Error(`Blueprint has undefined series: ${blueprint.title}`); } - // Check for price pattern blueprint (has usd/sats sub-metrics) + // Check for price pattern blueprint (has usd/sats sub-series) // Use unknown cast for safe property access check - const maybePriceMetric = - /** @type {{ usd?: AnyMetricPattern, sats?: AnyMetricPattern }} */ ( - /** @type {unknown} */ (blueprint.metric) + const maybePriceSeries = + /** @type {{ usd?: AnySeriesPattern, sats?: AnySeriesPattern }} */ ( + /** @type {unknown} */ (blueprint.series) ); - if (maybePriceMetric.usd?.by && maybePriceMetric.sats?.by) { - const { usd, sats } = maybePriceMetric; + if (maybePriceSeries.usd?.by && maybePriceSeries.sats?.by) { + const { usd, sats } = maybePriceSeries; if (!usdArr) map.set(Unit.usd, (usdArr = [])); - usdArr.push({ ...blueprint, metric: usd, unit: Unit.usd }); + usdArr.push({ ...blueprint, series: usd, unit: Unit.usd }); if (!satsArr) map.set(Unit.sats, (satsArr = [])); - satsArr.push({ ...blueprint, metric: sats, unit: Unit.sats }); + satsArr.push({ ...blueprint, series: sats, unit: Unit.sats }); continue; } - // After continue, we know this is a regular metric blueprint + // After continue, we know this is a regular series blueprint const regularBlueprint = /** @type {AnyFetchedSeriesBlueprint} */ ( blueprint ); - const metric = regularBlueprint.metric; + const s = regularBlueprint.series; const unit = regularBlueprint.unit; if (!unit) continue; @@ -163,7 +163,7 @@ export function initOptions() { priceSet.add(regularBlueprint.options?.baseValue?.price ?? 0); } else if (!type || type === "Line") { // Check if manual price line - avoid Object.values() array allocation - const by = metric.by; + const by = s.by; for (const k in by) { if (by[/** @type {Index} */ (k)]?.path?.includes("constant_")) { priceLines.get(unit)?.delete(parseFloat(regularBlueprint.title)); @@ -178,9 +178,9 @@ export function initOptions() { const arr = map.get(unit); if (!arr) continue; for (const baseValue of values) { - const metric = getConstant(brk.metrics.constants, baseValue); + const s = getConstant(brk.series.constants, baseValue); arr.push({ - metric, + series: s, title: `${baseValue}`, color: colors.gray, unit, @@ -371,7 +371,7 @@ export function initOptions() { return { nodes, count: totalCount }; } - logUnused(brk.metrics, partialOptions); + logUnused(brk.series, partialOptions); const { nodes: processedTree } = processPartialTree(partialOptions); /** diff --git a/website/scripts/options/investing.js b/website/scripts/options/investing.js index f48ce5030..3fc2428fd 100644 --- a/website/scripts/options/investing.js +++ b/website/scripts/options/investing.js @@ -47,7 +47,7 @@ const YEARS_2010S = /** @type {const} */ ([2019, 2018, 2017, 2016, 2015]); const periodName = (key) => periodIdToName(key.slice(1), true); /** - * @typedef {{ percent: AnyMetricPattern, ratio: AnyMetricPattern }} PercentRatioPattern + * @typedef {{ percent: AnySeriesPattern, ratio: AnySeriesPattern }} PercentRatioPattern */ /** @@ -55,8 +55,8 @@ const periodName = (key) => periodIdToName(key.slice(1), true); * @typedef {Object} BaseEntryItem * @property {string} name - Display name * @property {Color} color - Item color - * @property {AnyPricePattern} costBasis - Cost basis metric - * @property {PercentRatioPattern} returns - Returns metric + * @property {AnyPricePattern} costBasis - Cost basis series + * @property {PercentRatioPattern} returns - Returns series * @property {AnyValuePattern} stack - Stack pattern */ @@ -90,7 +90,7 @@ function buildYearEntry(dca, year, i) { * @returns {PartialOptionsGroup} */ export function createInvestingSection() { - const { market } = brk.metrics; + const { market } = brk.series; const { dca, lookback, returns } = market; return { @@ -111,7 +111,7 @@ export function createInvestingSection() { */ function createCompareFolder(context, items) { const topPane = items.map(({ name, color, costBasis }) => - price({ metric: costBasis, name, color }), + price({ series: costBasis, name, color }), ); return { name: "Compare", @@ -152,7 +152,7 @@ function createCompareFolder(context, items) { */ function createSingleEntryTree(item, returnsBottom) { const { name, titlePrefix = name, color, costBasis, stack } = item; - const top = [price({ metric: costBasis, name: "Cost Basis", color })]; + const top = [price({ series: costBasis, name: "Cost Basis", color })]; return { name, tree: [ @@ -203,11 +203,11 @@ export function createDcaVsLumpSumSection({ dca, lookback, returns }) { /** @param {AllPeriodKey} key */ const topPane = (key) => [ price({ - metric: dca.period.costBasis[key], + series: dca.period.costBasis[key], name: "DCA", color: colors.profit, }), - price({ metric: lookback[key], name: "Lump Sum", color: colors.bitcoin }), + price({ series: lookback[key], name: "Lump Sum", color: colors.bitcoin }), ]; /** @param {string} name @param {AllPeriodKey} key */ diff --git a/website/scripts/options/market.js b/website/scripts/options/market.js index 7f210d36d..dcc549b8d 100644 --- a/website/scripts/options/market.js +++ b/website/scripts/options/market.js @@ -21,13 +21,13 @@ import { periodIdToName } from "./utils.js"; * @typedef {Object} Period * @property {string} id * @property {Color} color - * @property {{ percent: AnyMetricPattern, ratio: AnyMetricPattern }} returns + * @property {{ percent: AnySeriesPattern, ratio: AnySeriesPattern }} returns * @property {AnyPricePattern} lookback * @property {boolean} [defaultActive] */ /** - * @typedef {Period & { cagr: { percent: AnyMetricPattern, ratio: AnyMetricPattern } }} PeriodWithCagr + * @typedef {Period & { cagr: { percent: AnySeriesPattern, ratio: AnySeriesPattern } }} PeriodWithCagr */ /** @@ -39,13 +39,13 @@ import { periodIdToName } from "./utils.js"; /** * Create index (percent) + ratio line pair from a BpsPercentRatioPattern - * @param {{ pattern: { percent: AnyMetricPattern, ratio: AnyMetricPattern }, name: string, color?: Color, defaultActive?: boolean }} args + * @param {{ pattern: { percent: AnySeriesPattern, ratio: AnySeriesPattern }, name: string, color?: Color, defaultActive?: boolean }} args * @returns {AnyFetchedSeriesBlueprint[]} */ function indexRatio({ pattern, name, color, defaultActive }) { return [ - line({ metric: pattern.percent, name, color, defaultActive, unit: Unit.index }), - line({ metric: pattern.ratio, name, color, defaultActive, unit: Unit.ratio }), + line({ series: pattern.percent, name, color, defaultActive, unit: Unit.index }), + line({ series: pattern.ratio, name, color, defaultActive, unit: Unit.ratio }), ]; } @@ -84,7 +84,7 @@ function createMaSubSection(label, averages) { name: "Compare", title: `Price ${label}s`, top: averages.map((a) => - price({ metric: a.ratio, name: a.id, color: a.color }), + price({ series: a.ratio, name: a.id, color: a.color }), ), }, ...common.map(toFolder), @@ -97,16 +97,16 @@ function createMaSubSection(label, averages) { * @param {string} name * @param {string} title * @param {Unit} unit - * @param {{ _1w: AnyMetricPattern, _1m: AnyMetricPattern, _1y: AnyMetricPattern }} metrics + * @param {{ _1w: AnySeriesPattern, _1m: AnySeriesPattern, _1y: AnySeriesPattern }} patterns */ -function volatilityChart(name, title, unit, metrics) { +function volatilityChart(name, title, unit, patterns) { return { name, title, bottom: [ - line({ metric: metrics._1w, name: "1w", color: colors.time._1w, unit }), - line({ metric: metrics._1m, name: "1m", color: colors.time._1m, unit }), - line({ metric: metrics._1y, name: "1y", color: colors.time._1y, unit }), + line({ series: patterns._1w, name: "1w", color: colors.time._1w, unit }), + line({ series: patterns._1m, name: "1m", color: colors.time._1m, unit }), + line({ series: patterns._1y, name: "1y", color: colors.time._1y, unit }), ], }; } @@ -182,13 +182,13 @@ function historicalSubSection(name, periods) { name: "Compare", title: `${name} Historical`, top: periods.map((p) => - price({ metric: p.lookback, name: p.id, color: p.color }), + price({ series: p.lookback, name: p.id, color: p.color }), ), }, ...periods.map((p) => ({ name: periodIdToName(p.id, true), title: `${periodIdToName(p.id, true)} Ago`, - top: [price({ metric: p.lookback, name: "Price" })], + top: [price({ series: p.lookback, name: "Price" })], })), ], }; @@ -199,7 +199,7 @@ function historicalSubSection(name, periods) { * @returns {PartialOptionsGroup} */ export function createMarketSection() { - const { market, supply, cohorts, prices, indicators } = brk.metrics; + const { market, supply, cohorts, prices, indicators } = brk.series; const { movingAverage: ma, ath, @@ -385,7 +385,7 @@ export function createMarketSection() { title: "Sats per Dollar", bottom: [ line({ - metric: prices.spot.sats, + series: prices.spot.sats, name: "Sats/$", unit: Unit.sats, }), @@ -400,7 +400,7 @@ export function createMarketSection() { title: "Market Capitalization", bottom: [ line({ - metric: supply.marketCap.usd, + series: supply.marketCap.usd, name: "Market Cap", unit: Unit.usd, }), @@ -411,7 +411,7 @@ export function createMarketSection() { title: "Realized Capitalization", bottom: [ line({ - metric: cohorts.utxo.all.realized.cap.usd, + series: cohorts.utxo.all.realized.cap.usd, name: "Realized Cap", color: colors.realized, unit: Unit.usd, @@ -428,7 +428,7 @@ export function createMarketSection() { color: colors.bitcoin, }), baseline({ - metric: supply.marketMinusRealizedCapGrowthRate._24h, + series: supply.marketMinusRealizedCapGrowthRate._24h, name: "Market - Realized", unit: Unit.percentage, }), @@ -443,7 +443,7 @@ export function createMarketSection() { { name: "Drawdown", title: "ATH Drawdown", - top: [price({ metric: ath.high, name: "ATH" })], + top: [price({ series: ath.high, name: "ATH" })], bottom: percentRatio({ pattern: ath.drawdown, name: "Drawdown", @@ -453,26 +453,26 @@ export function createMarketSection() { { name: "Time Since", title: "Time Since ATH", - top: [price({ metric: ath.high, name: "ATH" })], + top: [price({ series: ath.high, name: "ATH" })], bottom: [ line({ - metric: ath.daysSince, + series: ath.daysSince, name: "Since", unit: Unit.days, }), line({ - metric: ath.yearsSince, + series: ath.yearsSince, name: "Since", unit: Unit.years, }), line({ - metric: ath.maxDaysBetween, + series: ath.maxDaysBetween, name: "Max", color: colors.loss, unit: Unit.days, }), line({ - metric: ath.maxYearsBetween, + series: ath.maxYearsBetween, name: "Max", color: colors.loss, unit: Unit.years, @@ -515,13 +515,13 @@ export function createMarketSection() { title: "True Range", bottom: [ line({ - metric: range.trueRange, + series: range.trueRange, name: "Daily", color: colors.time._24h, unit: Unit.usd, }), line({ - metric: range.trueRangeSum2w, + series: range.trueRangeSum2w, name: "2w Sum", color: colors.time._1w, unit: Unit.usd, @@ -555,12 +555,12 @@ export function createMarketSection() { title: "SMA vs EMA Comparison", top: smaVsEma.flatMap((p) => [ price({ - metric: p.sma, + series: p.sma, name: `${p.id} SMA`, color: p.color, }), price({ - metric: p.ema, + series: p.ema, name: `${p.id} EMA`, color: p.color, style: 1, @@ -571,9 +571,9 @@ export function createMarketSection() { name: p.name, title: `${p.name} SMA vs EMA`, top: [ - price({ metric: p.sma, name: "SMA", color: p.color }), + price({ series: p.sma, name: "SMA", color: p.color }), price({ - metric: p.ema, + series: p.ema, name: "EMA", color: p.color, style: 1, @@ -622,13 +622,13 @@ export function createMarketSection() { title: `${p.name} MinMax`, top: [ price({ - metric: p.max, + series: p.max, name: "Max", key: "price-max", color: colors.stat.max, }), price({ - metric: p.min, + series: p.min, name: "Min", key: "price-min", color: colors.stat.min, @@ -641,17 +641,17 @@ export function createMarketSection() { title: "Mayer Multiple", top: [ price({ - metric: ma.sma._200d, + series: ma.sma._200d, name: "200d SMA", color: colors.indicator.main, }), price({ - metric: ma.sma._200d.x24, + series: ma.sma._200d.x24, name: "200d SMA x2.4", color: colors.indicator.upper, }), price({ - metric: ma.sma._200d.x08, + series: ma.sma._200d.x08, name: "200d SMA x0.8", color: colors.indicator.lower, }), @@ -698,10 +698,10 @@ export function createMarketSection() { name: "Components", title: `RSI Components (${w.name})`, bottom: [ - line({ metric: rsi.averageGain, name: "Avg Gain", color: colors.profit, unit: Unit.usd }), - line({ metric: rsi.averageLoss, name: "Avg Loss", color: colors.loss, unit: Unit.usd }), - line({ metric: rsi.gains, name: "Gains", color: colors.profit, defaultActive: false, unit: Unit.usd }), - line({ metric: rsi.losses, name: "Losses", color: colors.loss, defaultActive: false, unit: Unit.usd }), + line({ series: rsi.averageGain, name: "Avg Gain", color: colors.profit, unit: Unit.usd }), + line({ series: rsi.averageLoss, name: "Avg Loss", color: colors.loss, unit: Unit.usd }), + line({ series: rsi.gains, name: "Gains", color: colors.profit, defaultActive: false, unit: Unit.usd }), + line({ series: rsi.losses, name: "Losses", color: colors.loss, defaultActive: false, unit: Unit.usd }), ], }, ], @@ -753,16 +753,16 @@ export function createMarketSection() { name: "Compare", title: "MACD Comparison", bottom: ROLLING_WINDOWS.map((w) => - line({ metric: technical.macd[w.key].line, name: w.name, color: w.color, unit: Unit.usd }), + line({ series: technical.macd[w.key].line, name: w.name, color: w.color, unit: Unit.usd }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: `MACD (${w.name})`, bottom: [ - line({ metric: technical.macd[w.key].line, name: "MACD", color: colors.indicator.fast, unit: Unit.usd }), - line({ metric: technical.macd[w.key].signal, name: "Signal", color: colors.indicator.slow, unit: Unit.usd }), - histogram({ metric: technical.macd[w.key].histogram, name: "Histogram", unit: Unit.usd }), + line({ series: technical.macd[w.key].line, name: "MACD", color: colors.indicator.fast, unit: Unit.usd }), + line({ series: technical.macd[w.key].signal, name: "Signal", color: colors.indicator.slow, unit: Unit.usd }), + histogram({ series: technical.macd[w.key].histogram, name: "Histogram", unit: Unit.usd }), ], })), ], @@ -778,7 +778,7 @@ export function createMarketSection() { title: "Historical Comparison", top: [...shortPeriods, ...longPeriods].map((p) => price({ - metric: p.lookback, + series: p.lookback, name: p.id, color: p.color, defaultActive: p.defaultActive, @@ -795,7 +795,7 @@ export function createMarketSection() { title: "Dollar Cost Average Sats/Day", bottom: [ line({ - metric: dca.satsPerDay, + series: dca.satsPerDay, name: "Sats/Day", unit: Unit.sats, }), @@ -810,19 +810,19 @@ export function createMarketSection() { title: "Pi Cycle", top: [ price({ - metric: ma.sma._111d, + series: ma.sma._111d, name: "111d SMA", color: colors.indicator.upper, }), price({ - metric: ma.sma._350d.x2, + series: ma.sma._350d.x2, name: "350d SMA x2", color: colors.indicator.lower, }), ], bottom: [ baseline({ - metric: technical.piCycle.ratio, + series: technical.piCycle.ratio, name: "Pi Cycle", unit: Unit.ratio, base: 1, @@ -834,7 +834,7 @@ export function createMarketSection() { title: "Puell Multiple", bottom: [ line({ - metric: indicators.puellMultiple.ratio, + series: indicators.puellMultiple.ratio, name: "Puell", color: colors.usd, unit: Unit.ratio, @@ -846,7 +846,7 @@ export function createMarketSection() { title: "NVT Ratio", bottom: [ line({ - metric: indicators.nvt.ratio, + series: indicators.nvt.ratio, name: "NVT", color: colors.bitcoin, unit: Unit.ratio, @@ -867,7 +867,7 @@ export function createMarketSection() { title: "RHODL Ratio", bottom: [ line({ - metric: indicators.rhodlRatio.ratio, + series: indicators.rhodlRatio.ratio, name: "RHODL", color: colors.bitcoin, unit: Unit.ratio, @@ -879,7 +879,7 @@ export function createMarketSection() { title: "Thermocap Multiple", bottom: [ line({ - metric: indicators.thermocapMultiple.ratio, + series: indicators.thermocapMultiple.ratio, name: "Thermocap", color: colors.bitcoin, unit: Unit.ratio, @@ -891,7 +891,7 @@ export function createMarketSection() { title: "Stock-to-Flow", bottom: [ line({ - metric: indicators.stockToFlow, + series: indicators.stockToFlow, name: "S2F", color: colors.bitcoin, unit: Unit.ratio, @@ -903,13 +903,13 @@ export function createMarketSection() { title: "Dormancy", bottom: [ line({ - metric: indicators.dormancy.supplyAdjusted, + series: indicators.dormancy.supplyAdjusted, name: "Supply Adjusted", color: colors.bitcoin, unit: Unit.ratio, }), line({ - metric: indicators.dormancy.flow, + series: indicators.dormancy.flow, name: "Flow", color: colors.usd, unit: Unit.ratio, @@ -922,7 +922,7 @@ export function createMarketSection() { title: "Seller Exhaustion Constant", bottom: [ line({ - metric: indicators.sellerExhaustionConstant, + series: indicators.sellerExhaustionConstant, name: "SEC", color: colors.bitcoin, unit: Unit.ratio, @@ -934,7 +934,7 @@ export function createMarketSection() { title: "Coindays Destroyed (Supply Adjusted)", bottom: [ line({ - metric: indicators.coindaysDestroyedSupplyAdjusted, + series: indicators.coindaysDestroyedSupplyAdjusted, name: "CDD SA", color: colors.bitcoin, unit: Unit.ratio, @@ -946,7 +946,7 @@ export function createMarketSection() { title: "Coinyears Destroyed (Supply Adjusted)", bottom: [ line({ - metric: indicators.coinyearsDestroyedSupplyAdjusted, + series: indicators.coinyearsDestroyedSupplyAdjusted, name: "CYD SA", color: colors.bitcoin, unit: Unit.ratio, diff --git a/website/scripts/options/mining.js b/website/scripts/options/mining.js index db22b6b5a..df65190a1 100644 --- a/website/scripts/options/mining.js +++ b/website/scripts/options/mining.js @@ -56,7 +56,7 @@ const ANTPOOL_AND_FRIENDS_IDS = /** @type {const} */ ([ * @returns {PartialOptionsGroup} */ export function createMiningSection() { - const { blocks, pools, mining } = brk.metrics; + const { blocks, pools, mining } = brk.series; // Pre-compute pool entries with resolved names const majorPoolData = entries(pools.major).map(([id, pool]) => ({ @@ -101,7 +101,7 @@ export function createMiningSection() { title: `Blocks Mined: ${name}`, bottom: [ line({ - metric: pool.blocksMined.base, + series: pool.blocksMined.base, name: "base", unit: Unit.count, }), @@ -113,7 +113,7 @@ export function createMiningSection() { title: `Blocks Mined: ${name} (Total)`, bottom: [ line({ - metric: pool.blocksMined.cumulative, + series: pool.blocksMined.cumulative, name: "all-time", unit: Unit.count, }), @@ -180,7 +180,7 @@ export function createMiningSection() { title: `Blocks Mined: ${name}`, bottom: [ line({ - metric: pool.blocksMined.base, + series: pool.blocksMined.base, name: "base", unit: Unit.count, }), @@ -192,7 +192,7 @@ export function createMiningSection() { title: `Blocks Mined: ${name} (Total)`, bottom: [ line({ - metric: pool.blocksMined.cumulative, + series: pool.blocksMined.cumulative, name: "all-time", unit: Unit.count, }), @@ -215,46 +215,46 @@ export function createMiningSection() { title: "Network Hashrate", bottom: [ dots({ - metric: mining.hashrate.rate.base, + series: mining.hashrate.rate.base, name: "Hashrate", unit: Unit.hashRate, }), line({ - metric: mining.hashrate.rate.sma._1w, + series: mining.hashrate.rate.sma._1w, name: "1w SMA", color: colors.time._1w, unit: Unit.hashRate, defaultActive: false, }), line({ - metric: mining.hashrate.rate.sma._1m, + series: mining.hashrate.rate.sma._1m, name: "1m SMA", color: colors.time._1m, unit: Unit.hashRate, defaultActive: false, }), line({ - metric: mining.hashrate.rate.sma._2m, + series: mining.hashrate.rate.sma._2m, name: "2m SMA", color: colors.indicator.main, unit: Unit.hashRate, defaultActive: false, }), line({ - metric: mining.hashrate.rate.sma._1y, + series: mining.hashrate.rate.sma._1y, name: "1y SMA", color: colors.time._1y, unit: Unit.hashRate, defaultActive: false, }), dotted({ - metric: blocks.difficulty.asHash, + series: blocks.difficulty.asHash, name: "Difficulty", color: colors.default, unit: Unit.hashRate, }), line({ - metric: mining.hashrate.rate.ath, + series: mining.hashrate.rate.ath, name: "ATH", color: colors.loss, unit: Unit.hashRate, @@ -267,13 +267,13 @@ export function createMiningSection() { title: "Network Hashrate ATH", bottom: [ line({ - metric: mining.hashrate.rate.ath, + series: mining.hashrate.rate.ath, name: "ATH", color: colors.loss, unit: Unit.hashRate, }), dots({ - metric: mining.hashrate.rate.base, + series: mining.hashrate.rate.base, name: "Hashrate", color: colors.bitcoin, unit: Unit.hashRate, @@ -301,7 +301,7 @@ export function createMiningSection() { title: "Mining Difficulty", bottom: [ line({ - metric: blocks.difficulty.value, + series: blocks.difficulty.value, name: "Difficulty", unit: Unit.difficulty, }), @@ -312,7 +312,7 @@ export function createMiningSection() { title: "Difficulty Epoch", bottom: [ line({ - metric: blocks.difficulty.epoch, + series: blocks.difficulty.epoch, name: "Epoch", unit: Unit.epoch, }), @@ -323,7 +323,7 @@ export function createMiningSection() { title: "Difficulty Adjustment", bottom: [ baseline({ - metric: blocks.difficulty.adjustment.percent, + series: blocks.difficulty.adjustment.percent, name: "Change", unit: Unit.percentage, }), @@ -334,12 +334,12 @@ export function createMiningSection() { title: "Next Difficulty Adjustment", bottom: [ line({ - metric: blocks.difficulty.blocksBeforeNext, + series: blocks.difficulty.blocksBeforeNext, name: "Remaining", unit: Unit.blocks, }), line({ - metric: blocks.difficulty.daysBeforeNext, + series: blocks.difficulty.daysBeforeNext, name: "Remaining", unit: Unit.days, }), @@ -480,7 +480,7 @@ export function createMiningSection() { name: "sum", }), line({ - metric: mining.rewards.subsidy.sma1y.usd, + series: mining.rewards.subsidy.sma1y.usd, name: "1y SMA", color: colors.time._1y, unit: Unit.usd, @@ -650,13 +650,13 @@ export function createMiningSection() { name: "Compare", title: "Fee-to-Subsidy Ratio", bottom: ROLLING_WINDOWS.map((w) => - line({ metric: mining.rewards.fees.ratioMultiple[w.key].ratio, name: w.name, color: w.color, unit: Unit.ratio }), + line({ series: mining.rewards.fees.ratioMultiple[w.key].ratio, name: w.name, color: w.color, unit: Unit.ratio }), ), }, ...ROLLING_WINDOWS.map((w) => ({ name: w.name, title: `Fee-to-Subsidy Ratio (${w.name})`, - bottom: [line({ metric: mining.rewards.fees.ratioMultiple[w.key].ratio, name: w.name, color: w.color, unit: Unit.ratio })], + bottom: [line({ series: mining.rewards.fees.ratioMultiple[w.key].ratio, name: w.name, color: w.color, unit: Unit.ratio })], })), ], }, @@ -712,25 +712,25 @@ export function createMiningSection() { title: "Hash Price", bottom: [ line({ - metric: mining.hashrate.price.ths, + series: mining.hashrate.price.ths, name: "TH/s", color: colors.usd, unit: Unit.usdPerThsPerDay, }), line({ - metric: mining.hashrate.price.phs, + series: mining.hashrate.price.phs, name: "PH/s", color: colors.usd, unit: Unit.usdPerPhsPerDay, }), dotted({ - metric: mining.hashrate.price.thsMin, + series: mining.hashrate.price.thsMin, name: "TH/s Min", color: colors.stat.min, unit: Unit.usdPerThsPerDay, }), dotted({ - metric: mining.hashrate.price.phsMin, + series: mining.hashrate.price.phsMin, name: "PH/s Min", color: colors.stat.min, unit: Unit.usdPerPhsPerDay, @@ -742,25 +742,25 @@ export function createMiningSection() { title: "Hash Value", bottom: [ line({ - metric: mining.hashrate.value.ths, + series: mining.hashrate.value.ths, name: "TH/s", color: colors.bitcoin, unit: Unit.satsPerThsPerDay, }), line({ - metric: mining.hashrate.value.phs, + series: mining.hashrate.value.phs, name: "PH/s", color: colors.bitcoin, unit: Unit.satsPerPhsPerDay, }), dotted({ - metric: mining.hashrate.value.thsMin, + series: mining.hashrate.value.thsMin, name: "TH/s Min", color: colors.stat.min, unit: Unit.satsPerThsPerDay, }), dotted({ - metric: mining.hashrate.value.phsMin, + series: mining.hashrate.value.phsMin, name: "PH/s Min", color: colors.stat.min, unit: Unit.satsPerPhsPerDay, @@ -787,12 +787,12 @@ export function createMiningSection() { title: "Next Halving", bottom: [ line({ - metric: blocks.halving.blocksBeforeNext, + series: blocks.halving.blocksBeforeNext, name: "Remaining", unit: Unit.blocks, }), line({ - metric: blocks.halving.daysBeforeNext, + series: blocks.halving.daysBeforeNext, name: "Remaining", unit: Unit.days, }), @@ -803,7 +803,7 @@ export function createMiningSection() { title: "Halving Epoch", bottom: [ line({ - metric: blocks.halving.epoch, + series: blocks.halving.epoch, name: "Epoch", unit: Unit.epoch, }), @@ -836,7 +836,7 @@ export function createMiningSection() { title: "Blocks Mined: Major Pools (1m)", bottom: featuredPools.map((p, i) => line({ - metric: p.pool.blocksMined.sum._1m, + series: p.pool.blocksMined.sum._1m, name: p.name, color: colors.at(i, featuredPools.length), unit: Unit.count, @@ -877,7 +877,7 @@ export function createMiningSection() { title: "Blocks Mined: AntPool & Friends (1m)", bottom: antpoolFriends.map((p, i) => line({ - metric: p.pool.blocksMined.sum._1m, + series: p.pool.blocksMined.sum._1m, name: p.name, color: colors.at(i, antpoolFriends.length), unit: Unit.count, diff --git a/website/scripts/options/network.js b/website/scripts/options/network.js index 1e2e168c8..a51bc055a 100644 --- a/website/scripts/options/network.js +++ b/website/scripts/options/network.js @@ -38,7 +38,7 @@ export function createNetworkSection() { supply, addresses, cohorts, - } = brk.metrics; + } = brk.series; const st = colors.scriptType; @@ -123,46 +123,46 @@ export function createNetworkSection() { name: "Funded", title: "Address Count by Type", /** @param {AddressableType} t */ - getMetric: (t) => addresses.funded[t], + getSeries: (t) => addresses.funded[t], }, { name: "Empty", title: "Empty Address Count by Type", /** @param {AddressableType} t */ - getMetric: (t) => addresses.empty[t], + getSeries: (t) => addresses.empty[t], }, { name: "Total", title: "Total Address Count by Type", /** @param {AddressableType} t */ - getMetric: (t) => addresses.total[t], + getSeries: (t) => addresses.total[t], }, ]); /** - * Create address metrics tree for a given type key + * Create address series tree for a given type key * @param {AddressableType | "all"} key * @param {string} titlePrefix */ - const createAddressMetricsTree = (key, titlePrefix) => [ + const createAddressSeriesTree = (key, titlePrefix) => [ { name: "Count", title: `${titlePrefix}Address Count`, bottom: [ line({ - metric: addresses.funded[key], + series: addresses.funded[key], name: "Funded", unit: Unit.count, }), line({ - metric: addresses.empty[key], + series: addresses.empty[key], name: "Empty", color: colors.gray, unit: Unit.count, defaultActive: false, }), line({ - metric: addresses.total[key], + series: addresses.total[key], name: "Total", color: colors.default, unit: Unit.count, @@ -189,7 +189,7 @@ export function createNetworkSection() { name: "Sum", title: t, bottom: [ - line({ metric: p.base, name: "base", unit: Unit.count }), + line({ series: p.base, name: "base", unit: Unit.count }), ], }, rollingWindowsTree({ @@ -202,7 +202,7 @@ export function createNetworkSection() { title: `${t} (Total)`, bottom: [ line({ - metric: p.cumulative, + series: p.cumulative, name: "all-time", unit: Unit.count, }), @@ -219,12 +219,12 @@ export function createNetworkSection() { title: `${titlePrefix}Reactivated Addresses per Block`, bottom: [ dots({ - metric: addresses.activity[key].reactivated.height, + series: addresses.activity[key].reactivated.height, name: "base", unit: Unit.count, }), line({ - metric: addresses.activity[key].reactivated._24h, + series: addresses.activity[key].reactivated._24h, name: "24h avg", color: colors.stat.avg, unit: Unit.count, @@ -254,12 +254,12 @@ export function createNetworkSection() { title: `${titlePrefix}${t.title}`, bottom: [ dots({ - metric: addresses.activity[key][t.key].height, + series: addresses.activity[key][t.key].height, name: "base", unit: Unit.count, }), line({ - metric: addresses.activity[key][t.key]._24h, + series: addresses.activity[key][t.key]._24h, name: "24h avg", color: colors.stat.avg, unit: Unit.count, @@ -292,7 +292,7 @@ export function createNetworkSection() { title: `${groupName} ${c.title}`, bottom: types.map((t) => line({ - metric: c.getMetric(t.key), + series: c.getSeries(t.key), name: t.name, color: t.color, unit: Unit.count, @@ -305,13 +305,13 @@ export function createNetworkSection() { title: `${groupName} New Address Count`, bottom: types.flatMap((t) => [ line({ - metric: addresses.new[t.key].base, + series: addresses.new[t.key].base, name: t.name, color: t.color, unit: Unit.count, }), line({ - metric: addresses.new[t.key].sum._24h, + series: addresses.new[t.key].sum._24h, name: t.name, color: t.color, unit: Unit.count, @@ -326,7 +326,7 @@ export function createNetworkSection() { title: `${groupName} Reactivated Addresses per Block`, bottom: types.map((t) => line({ - metric: addresses.activity[t.key].reactivated.height, + series: addresses.activity[t.key].reactivated.height, name: t.name, color: t.color, unit: Unit.count, @@ -338,7 +338,7 @@ export function createNetworkSection() { title: `${groupName} Reactivated Addresses (${w.name})`, bottom: types.map((t) => line({ - metric: addresses.activity[t.key].reactivated[w.key], + series: addresses.activity[t.key].reactivated[w.key], name: t.name, color: t.color, unit: Unit.count, @@ -371,7 +371,7 @@ export function createNetworkSection() { title: `${groupName} ${tr.compareTitle}`, bottom: types.map((t) => line({ - metric: addresses.activity[t.key][tr.key].height, + series: addresses.activity[t.key][tr.key].height, name: t.name, color: t.color, unit: Unit.count, @@ -383,7 +383,7 @@ export function createNetworkSection() { title: `${groupName} ${tr.compareTitle} (${w.name})`, bottom: types.map((t) => line({ - metric: addresses.activity[t.key][tr.key][w.key], + series: addresses.activity[t.key][tr.key][w.key], name: t.name, color: t.color, unit: Unit.count, @@ -423,7 +423,7 @@ export function createNetworkSection() { title: `${groupName} Output Count`, bottom: types.map((t) => line({ - metric: /** @type {CountPattern} */ (scripts.count[t.key]) + series: /** @type {CountPattern} */ (scripts.count[t.key]) .sum._24h, name: t.name, color: t.color, @@ -436,7 +436,7 @@ export function createNetworkSection() { title: `${groupName} Output Count (Total)`, bottom: types.map((t) => line({ - metric: /** @type {CountPattern} */ (scripts.count[t.key]) + series: /** @type {CountPattern} */ (scripts.count[t.key]) .cumulative, name: t.name, color: t.color, @@ -478,7 +478,7 @@ export function createNetworkSection() { title: "Market Cap", bottom: [ line({ - metric: supply.marketCap.usd, + series: supply.marketCap.usd, name: "Market Cap", unit: Unit.usd, }), @@ -758,7 +758,7 @@ export function createNetworkSection() { bottom: entries(transactions.versions).map( ([v, data], i, arr) => line({ - metric: data.base, + series: data.base, name: v, color: colors.at(i, arr.length), unit: Unit.count, @@ -775,7 +775,7 @@ export function createNetworkSection() { ([v, data], i, arr) => ROLLING_WINDOWS.map((w) => line({ - metric: data.sum[w.key], + series: data.sum[w.key], name: `${v} ${w.name}`, color: colors.at(i, arr.length), unit: Unit.count, @@ -789,7 +789,7 @@ export function createNetworkSection() { bottom: entries(transactions.versions).map( ([v, data], i, arr) => line({ - metric: data.sum[w.key], + series: data.sum[w.key], name: v, color: colors.at(i, arr.length), unit: Unit.count, @@ -804,7 +804,7 @@ export function createNetworkSection() { bottom: entries(transactions.versions).map( ([v, data], i, arr) => line({ - metric: data.cumulative, + series: data.cumulative, name: v, color: colors.at(i, arr.length), unit: Unit.count, @@ -818,12 +818,12 @@ export function createNetworkSection() { title: "Transaction Velocity", bottom: [ line({ - metric: supply.velocity.native, + series: supply.velocity.native, name: "BTC", unit: Unit.ratio, }), line({ - metric: supply.velocity.fiat, + series: supply.velocity.fiat, name: "USD", color: colors.usd, unit: Unit.ratio, @@ -845,12 +845,12 @@ export function createNetworkSection() { title: "Block Count", bottom: [ line({ - metric: blocks.count.total.base, + series: blocks.count.total.base, name: "base", unit: Unit.count, }), line({ - metric: blocks.count.target, + series: blocks.count.target, name: "Target", color: colors.gray, unit: Unit.count, @@ -868,7 +868,7 @@ export function createNetworkSection() { title: "Block Count (Total)", bottom: [ line({ - metric: blocks.count.total.cumulative, + series: blocks.count.total.cumulative, name: "all-time", unit: Unit.count, }), @@ -884,12 +884,12 @@ export function createNetworkSection() { title: "Block Interval", bottom: [ dots({ - metric: blocks.interval.height, + series: blocks.interval.height, name: "base", unit: Unit.secs, }), line({ - metric: blocks.interval._24h, + series: blocks.interval._24h, name: "24h avg", color: colors.stat.avg, unit: Unit.secs, @@ -912,7 +912,7 @@ export function createNetworkSection() { title: "Block Size", bottom: [ line({ - metric: blocks.size.total, + series: blocks.size.total, name: "base", unit: Unit.bytes, }), @@ -934,7 +934,7 @@ export function createNetworkSection() { title: "Block Size (Total)", bottom: [ line({ - metric: blocks.size.cumulative, + series: blocks.size.cumulative, name: "all-time", unit: Unit.bytes, }), @@ -950,7 +950,7 @@ export function createNetworkSection() { title: "Block Weight", bottom: [ line({ - metric: blocks.weight.raw, + series: blocks.weight.raw, name: "base", unit: Unit.wu, }), @@ -972,7 +972,7 @@ export function createNetworkSection() { title: "Block Weight (Total)", bottom: [ line({ - metric: blocks.weight.cumulative, + series: blocks.weight.cumulative, name: "all-time", unit: Unit.wu, }), @@ -988,7 +988,7 @@ export function createNetworkSection() { title: "Block vBytes", bottom: [ line({ - metric: blocks.vbytes.base, + series: blocks.vbytes.base, name: "base", unit: Unit.vb, }), @@ -1010,7 +1010,7 @@ export function createNetworkSection() { title: "Block vBytes (Total)", bottom: [ line({ - metric: blocks.vbytes.cumulative, + series: blocks.vbytes.cumulative, name: "all-time", unit: Unit.vb, }), @@ -1034,7 +1034,7 @@ export function createNetworkSection() { title: "Mining Difficulty", bottom: [ line({ - metric: blocks.difficulty.value, + series: blocks.difficulty.value, name: "Difficulty", unit: Unit.count, }), @@ -1062,7 +1062,7 @@ export function createNetworkSection() { title: "UTXO Count", bottom: [ line({ - metric: outputs.count.unspent, + series: outputs.count.unspent, name: "Count", unit: Unit.count, }), @@ -1073,7 +1073,7 @@ export function createNetworkSection() { title: "UTXO Count 30d Change", bottom: [ baseline({ - metric: + series: cohorts.utxo.all.outputs.unspentCount.delta.absolute._1m, name: "30d Change", unit: Unit.count, @@ -1085,13 +1085,13 @@ export function createNetworkSection() { title: "UTXO Flow", bottom: [ line({ - metric: outputs.count.total.sum, + series: outputs.count.total.sum, name: "Created", color: colors.entity.output, unit: Unit.count, }), line({ - metric: inputs.count.sum, + series: inputs.count.sum, name: "Spent", color: colors.entity.input, unit: Unit.count, @@ -1121,19 +1121,19 @@ export function createNetworkSection() { title: "Activity Rate", bottom: [ dots({ - metric: transactions.volume.txPerSec, + series: transactions.volume.txPerSec, name: "TX/sec", color: colors.entity.tx, unit: Unit.perSec, }), dots({ - metric: transactions.volume.inputsPerSec, + series: transactions.volume.inputsPerSec, name: "Inputs/sec", color: colors.entity.input, unit: Unit.perSec, }), dots({ - metric: transactions.volume.outputsPerSec, + series: transactions.volume.outputsPerSec, name: "Outputs/sec", color: colors.entity.output, unit: Unit.perSec, @@ -1145,8 +1145,8 @@ export function createNetworkSection() { { name: "Addresses", tree: [ - // Overview - global metrics for all addresses - { name: "Overview", tree: createAddressMetricsTree("all", "") }, + // Overview - global series for all addresses + { name: "Overview", tree: createAddressSeriesTree("all", "") }, // Top-level Compare - all types { @@ -1159,7 +1159,7 @@ export function createNetworkSection() { title: c.title, bottom: addressTypes.map((t) => line({ - metric: c.getMetric(t.key), + series: c.getSeries(t.key), name: t.name, color: t.color, unit: Unit.count, @@ -1173,14 +1173,14 @@ export function createNetworkSection() { title: "New Address Count by Type", bottom: addressTypes.flatMap((t) => [ line({ - metric: addresses.new[t.key].base, + series: addresses.new[t.key].base, name: t.name, color: t.color, unit: Unit.count, defaultActive: t.defaultActive, }), line({ - metric: addresses.new[t.key].sum._24h, + series: addresses.new[t.key].sum._24h, name: t.name, color: t.color, unit: Unit.count, @@ -1196,7 +1196,7 @@ export function createNetworkSection() { title: "Reactivated Addresses per Block by Type", bottom: addressTypes.map((t) => line({ - metric: addresses.activity[t.key].reactivated.height, + series: addresses.activity[t.key].reactivated.height, name: t.name, color: t.color, unit: Unit.count, @@ -1209,7 +1209,7 @@ export function createNetworkSection() { title: `Reactivated Addresses by Type (${w.name})`, bottom: addressTypes.map((t) => line({ - metric: addresses.activity[t.key].reactivated[w.key], + series: addresses.activity[t.key].reactivated[w.key], name: t.name, color: t.color, unit: Unit.count, @@ -1244,7 +1244,7 @@ export function createNetworkSection() { title: tr.compareTitle, bottom: addressTypes.map((t) => line({ - metric: addresses.activity[t.key][tr.key].height, + series: addresses.activity[t.key][tr.key].height, name: t.name, color: t.color, unit: Unit.count, @@ -1257,7 +1257,7 @@ export function createNetworkSection() { title: `${tr.compareTitle} (${w.name})`, bottom: addressTypes.map((t) => line({ - metric: addresses.activity[t.key][tr.key][w.key], + series: addresses.activity[t.key][tr.key][w.key], name: t.name, color: t.color, unit: Unit.count, @@ -1278,7 +1278,7 @@ export function createNetworkSection() { createAddressCompare("Legacy", legacyAddresses), ...legacyAddresses.map((t) => ({ name: t.name, - tree: createAddressMetricsTree(t.key, `${t.name} `), + tree: createAddressSeriesTree(t.key, `${t.name} `), })), ], }, @@ -1290,7 +1290,7 @@ export function createNetworkSection() { createAddressCompare("SegWit", segwitAddresses), ...segwitAddresses.map((t) => ({ name: t.name, - tree: createAddressMetricsTree(t.key, `${t.name} `), + tree: createAddressSeriesTree(t.key, `${t.name} `), })), ], }, @@ -1302,7 +1302,7 @@ export function createNetworkSection() { createAddressCompare("Taproot", taprootAddresses), ...taprootAddresses.map((t) => ({ name: t.name, - tree: createAddressMetricsTree(t.key, `${t.name} `), + tree: createAddressSeriesTree(t.key, `${t.name} `), })), ], }, @@ -1325,7 +1325,7 @@ export function createNetworkSection() { title: "Output Count by Script Type", bottom: scriptTypes.map((t) => line({ - metric: /** @type {CountPattern} */ ( + series: /** @type {CountPattern} */ ( scripts.count[t.key] ).sum._24h, name: t.name, @@ -1340,7 +1340,7 @@ export function createNetworkSection() { title: "Output Count by Script Type (Total)", bottom: scriptTypes.map((t) => line({ - metric: scripts.count[t.key].cumulative, + series: scripts.count[t.key].cumulative, name: t.name, color: t.color, unit: Unit.count, @@ -1440,25 +1440,25 @@ export function createNetworkSection() { title: "Script Adoption", bottom: [ line({ - metric: scripts.adoption.segwit.percent, + series: scripts.adoption.segwit.percent, name: "SegWit", color: colors.segwit, unit: Unit.percentage, }), line({ - metric: scripts.adoption.segwit.ratio, + series: scripts.adoption.segwit.ratio, name: "SegWit", color: colors.segwit, unit: Unit.ratio, }), line({ - metric: scripts.adoption.taproot.percent, + series: scripts.adoption.taproot.percent, name: "Taproot", color: taprootAddresses[1].color, unit: Unit.percentage, }), line({ - metric: scripts.adoption.taproot.ratio, + series: scripts.adoption.taproot.ratio, name: "Taproot", color: taprootAddresses[1].color, unit: Unit.ratio, @@ -1470,12 +1470,12 @@ export function createNetworkSection() { title: "SegWit Adoption", bottom: [ line({ - metric: scripts.adoption.segwit.percent, + series: scripts.adoption.segwit.percent, name: "Adoption", unit: Unit.percentage, }), line({ - metric: scripts.adoption.segwit.ratio, + series: scripts.adoption.segwit.ratio, name: "Adoption", unit: Unit.ratio, }), @@ -1486,12 +1486,12 @@ export function createNetworkSection() { title: "Taproot Adoption", bottom: [ line({ - metric: scripts.adoption.taproot.percent, + series: scripts.adoption.taproot.percent, name: "Adoption", unit: Unit.percentage, }), line({ - metric: scripts.adoption.taproot.ratio, + series: scripts.adoption.taproot.ratio, name: "Adoption", unit: Unit.ratio, }), diff --git a/website/scripts/options/series.js b/website/scripts/options/series.js index e2ec14125..6f25cc225 100644 --- a/website/scripts/options/series.js +++ b/website/scripts/options/series.js @@ -18,11 +18,11 @@ export const ROLLING_WINDOWS = [ ]; /** - * Extract a metric from each rolling window via a mapping function + * Extract a series from each rolling window via a mapping function * @template T * @param {{ _24h: T, _1w: T, _1m: T, _1y: T }} windows - * @param {(v: T) => AnyMetricPattern} extract - * @returns {{ _24h: AnyMetricPattern, _1w: AnyMetricPattern, _1m: AnyMetricPattern, _1y: AnyMetricPattern }} + * @param {(v: T) => AnySeriesPattern} extract + * @returns {{ _24h: AnySeriesPattern, _1w: AnySeriesPattern, _1m: AnySeriesPattern, _1y: AnySeriesPattern }} */ export function mapWindows(windows, extract) { return { @@ -40,7 +40,7 @@ export function mapWindows(windows, extract) { /** * Create a price series for the top pane (auto-expands to USD + sats versions) * @param {Object} args - * @param {AnyPricePattern} args.metric - Price pattern with usd and sats + * @param {AnyPricePattern} args.series - Price pattern with usd and sats * @param {string} args.name * @param {string} [args.key] * @param {LineStyle} [args.style] @@ -50,7 +50,7 @@ export function mapWindows(windows, extract) { * @returns {FetchedPriceSeriesBlueprint} */ export function price({ - metric, + series, name, key, style, @@ -59,7 +59,7 @@ export function price({ options, }) { return { - metric, + series, title: name, key, color, @@ -86,49 +86,49 @@ function percentileSeries(pattern, unit, title) { const { stat } = colors; return [ dots({ - metric: pattern.max, + series: pattern.max, name: `${title} max`.trim(), color: stat.max, unit, defaultActive: false, }), dots({ - metric: pattern.min, + series: pattern.min, name: `${title} min`.trim(), color: stat.min, unit, defaultActive: false, }), dots({ - metric: pattern.median, + series: pattern.median, name: `${title} median`.trim(), color: stat.median, unit, defaultActive: false, }), dots({ - metric: pattern.pct75, + series: pattern.pct75, name: `${title} pct75`.trim(), color: stat.pct75, unit, defaultActive: false, }), dots({ - metric: pattern.pct25, + series: pattern.pct25, name: `${title} pct25`.trim(), color: stat.pct25, unit, defaultActive: false, }), dots({ - metric: pattern.pct90, + series: pattern.pct90, name: `${title} pct90`.trim(), color: stat.pct90, unit, defaultActive: false, }), dots({ - metric: pattern.pct10, + series: pattern.pct10, name: `${title} pct10`.trim(), color: stat.pct10, unit, @@ -140,7 +140,7 @@ function percentileSeries(pattern, unit, title) { /** * Create a Line series * @param {Object} args - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.series * @param {string} args.name * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) @@ -151,7 +151,7 @@ function percentileSeries(pattern, unit, title) { * @returns {FetchedLineSeriesBlueprint} */ export function line({ - metric, + series, name, key, style, @@ -161,7 +161,7 @@ export function line({ options, }) { return { - metric, + series, title: name, key, color, @@ -195,7 +195,7 @@ export function sparseDotted(args) { /** * Create a Dots series (line with only point markers visible) * @param {Object} args - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.series * @param {string} args.name * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) @@ -205,7 +205,7 @@ export function sparseDotted(args) { * @returns {FetchedDotsSeriesBlueprint} */ export function dots({ - metric, + series, name, key, color, @@ -215,7 +215,7 @@ export function dots({ }) { return { type: /** @type {const} */ ("Dots"), - metric, + series, title: name, key, color, @@ -228,7 +228,7 @@ export function dots({ /** * Create a Candlestick series * @param {Object} args - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.series * @param {string} args.name * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) @@ -238,7 +238,7 @@ export function dots({ * @returns {FetchedCandlestickSeriesBlueprint} */ export function candlestick({ - metric, + series, name, key, defaultActive, @@ -247,7 +247,7 @@ export function candlestick({ }) { return { type: /** @type {const} */ ("Candlestick"), - metric, + series, title: name, key, unit, @@ -259,7 +259,7 @@ export function candlestick({ /** * Create a Baseline series * @param {Object} args - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.series * @param {string} args.name * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) @@ -271,7 +271,7 @@ export function candlestick({ * @returns {FetchedBaselineSeriesBlueprint} */ export function baseline({ - metric, + series, name, key, color, @@ -284,7 +284,7 @@ export function baseline({ const isTuple = Array.isArray(color); return { type: /** @type {const} */ ("Baseline"), - metric, + series, title: name, key, color: isTuple ? undefined : color, @@ -313,7 +313,7 @@ export function dottedBaseline(args) { /** * Baseline series rendered as dots (points only, no line) * @param {Object} args - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.series * @param {string} args.name * @param {Unit} args.unit * @param {string} [args.key] @@ -324,7 +324,7 @@ export function dottedBaseline(args) { * @returns {FetchedDotsBaselineSeriesBlueprint} */ export function dotsBaseline({ - metric, + series, name, key, color, @@ -336,7 +336,7 @@ export function dotsBaseline({ const isTuple = Array.isArray(color); return { type: /** @type {const} */ ("DotsBaseline"), - metric, + series, title: name, key, color: isTuple ? undefined : color, @@ -355,7 +355,7 @@ export function dotsBaseline({ /** * Create a Histogram series * @param {Object} args - * @param {AnyMetricPattern} args.metric + * @param {AnySeriesPattern} args.series * @param {string} args.name * @param {Unit} args.unit * @param {string} [args.key] - Optional key for persistence (derived from name if not provided) @@ -365,7 +365,7 @@ export function dotsBaseline({ * @returns {FetchedHistogramSeriesBlueprint} */ export function histogram({ - metric, + series, name, key, color, @@ -375,7 +375,7 @@ export function histogram({ }) { return { type: /** @type {const} */ ("Histogram"), - metric, + series, title: name, key, color, @@ -388,7 +388,7 @@ export function histogram({ /** * Create series from an AverageHeightMaxMedianMinP10P25P75P90Pattern (height + rolling stats) * @param {Object} args - * @param {{ height: AnyMetricPattern } & Record} args.pattern - Pattern with .height and rolling stats (p10/p25/p75/p90 as _1y24h30d7dPattern) + * @param {{ height: AnySeriesPattern } & Record} args.pattern - Pattern with .height and rolling stats (p10/p25/p75/p90 as _1y24h30d7dPattern) * @param {string} args.window - Rolling window key (e.g., '_24h', '_7d', '_30d', '_1y') * @param {Unit} args.unit * @param {string} [args.title] @@ -408,13 +408,13 @@ export function fromBaseStatsPattern({ const stats = statsAtWindow(pattern, window); return [ dots({ - metric: pattern.height, + series: pattern.height, name: title || "base", color: baseColor, unit, }), dots({ - metric: stats.average, + series: stats.average, name: `${title} avg`.trim(), color: stat.avg, unit, @@ -425,10 +425,10 @@ export function fromBaseStatsPattern({ } /** - * Create series from a flat stats pattern (average + pct percentiles as single metrics) + * Create series from a flat stats pattern (average + pct percentiles as single series) * Use statsAtWindow() to extract from patterns with _1y24h30d7dPattern stats * @param {Object} args - * @param {{ average: AnyMetricPattern, median: AnyMetricPattern, max: AnyMetricPattern, min: AnyMetricPattern, pct75: AnyMetricPattern, pct25: AnyMetricPattern, pct90: AnyMetricPattern, pct10: AnyMetricPattern }} args.pattern + * @param {{ average: AnySeriesPattern, median: AnySeriesPattern, max: AnySeriesPattern, min: AnySeriesPattern, pct75: AnySeriesPattern, pct25: AnySeriesPattern, pct90: AnySeriesPattern, pct10: AnySeriesPattern }} args.pattern * @param {Unit} args.unit * @param {string} [args.title] * @returns {AnyFetchedSeriesBlueprint[]} @@ -437,7 +437,7 @@ export function fromStatsPattern({ pattern, unit, title = "" }) { return [ { type: "Dots", - metric: pattern.average, + series: pattern.average, title: `${title} avg`.trim(), unit, }, @@ -466,10 +466,10 @@ export function statsAtWindow(pattern, window) { /** * Create a Rolling folder tree from a _1m1w1y24hPattern (4 rolling windows) * @param {Object} args - * @param {{ _24h: AnyMetricPattern, _1w: AnyMetricPattern, _1m: AnyMetricPattern, _1y: AnyMetricPattern }} args.windows + * @param {{ _24h: AnySeriesPattern, _1w: AnySeriesPattern, _1m: AnySeriesPattern, _1y: AnySeriesPattern }} args.windows * @param {string} args.title * @param {Unit} args.unit - * @param {(args: {metric: AnyMetricPattern, name: string, color: Color, unit: Unit}) => AnyFetchedSeriesBlueprint} [args.series] + * @param {(args: {series: AnySeriesPattern, name: string, color: Color, unit: Unit}) => AnyFetchedSeriesBlueprint} [args.series] * @returns {PartialOptionsGroup} */ export function rollingWindowsTree({ windows, title, unit, series = line }) { @@ -481,7 +481,7 @@ export function rollingWindowsTree({ windows, title, unit, series = line }) { title: `${title} Rolling`, bottom: ROLLING_WINDOWS.map((w) => series({ - metric: windows[w.key], + series: windows[w.key], name: w.name, color: w.color, unit, @@ -493,7 +493,7 @@ export function rollingWindowsTree({ windows, title, unit, series = line }) { title: `${title} ${w.name}`, bottom: [ series({ - metric: windows[w.key], + series: windows[w.key], name: w.name, color: w.color, unit, @@ -508,7 +508,7 @@ export function rollingWindowsTree({ windows, title, unit, series = line }) { * Create a Distribution folder tree with stats at each rolling window (24h/7d/30d/1y) * @param {Object} args * @param {Record} args.pattern - Pattern with pct10/pct25/... and average/median/... as _1y24h30d7dPattern - * @param {AnyMetricPattern} [args.base] - Optional base metric to show as dots on each chart + * @param {AnySeriesPattern} [args.base] - Optional base series to show as dots on each chart * @param {string} args.title * @param {Unit} args.unit * @returns {PartialOptionsGroup} @@ -520,7 +520,7 @@ export function distributionWindowsTree({ pattern, base, title, unit }) { name: w.name, title: `${title} Distribution (${w.name})`, bottom: [ - ...(base ? [line({ metric: base, name: "base", unit })] : []), + ...(base ? [line({ series: base, name: "base", unit })] : []), ...fromStatsPattern({ pattern: statsAtWindow(pattern, w.key), unit, @@ -579,19 +579,19 @@ export const distributionBtcSatsUsd = (slot) => [ export function fromSupplyPattern({ pattern, title, color }) { return [ { - metric: pattern.btc, + series: pattern.btc, title, color, unit: Unit.btc, }, { - metric: pattern.sats, + series: pattern.sats, title, color, unit: Unit.sats, }, { - metric: pattern.usd, + series: pattern.usd, title, color, unit: Unit.usd, @@ -606,7 +606,7 @@ export function fromSupplyPattern({ pattern, title, color }) { /** * Create percent + ratio series from a BpsPercentRatioPattern * @param {Object} args - * @param {{ percent: AnyMetricPattern, ratio: AnyMetricPattern }} args.pattern + * @param {{ percent: AnySeriesPattern, ratio: AnySeriesPattern }} args.pattern * @param {string} args.name * @param {Color} [args.color] * @param {boolean} [args.defaultActive] @@ -614,15 +614,15 @@ export function fromSupplyPattern({ pattern, title, color }) { */ export function percentRatio({ pattern, name, color, defaultActive }) { return [ - line({ metric: pattern.percent, name, color, defaultActive, unit: Unit.percentage }), - line({ metric: pattern.ratio, name, color, defaultActive, unit: Unit.ratio }), + line({ series: pattern.percent, name, color, defaultActive, unit: Unit.percentage }), + line({ series: pattern.ratio, name, color, defaultActive, unit: Unit.ratio }), ]; } /** * Create percent + ratio dots series from a BpsPercentRatioPattern * @param {Object} args - * @param {{ percent: AnyMetricPattern, ratio: AnyMetricPattern }} args.pattern + * @param {{ percent: AnySeriesPattern, ratio: AnySeriesPattern }} args.pattern * @param {string} args.name * @param {Color} [args.color] * @param {boolean} [args.defaultActive] @@ -630,15 +630,15 @@ export function percentRatio({ pattern, name, color, defaultActive }) { */ export function percentRatioDots({ pattern, name, color, defaultActive }) { return [ - dots({ metric: pattern.percent, name, color, defaultActive, unit: Unit.percentage }), - dots({ metric: pattern.ratio, name, color, defaultActive, unit: Unit.ratio }), + dots({ series: pattern.percent, name, color, defaultActive, unit: Unit.percentage }), + dots({ series: pattern.ratio, name, color, defaultActive, unit: Unit.ratio }), ]; } /** * Create percent + ratio baseline series from a BpsPercentRatioPattern * @param {Object} args - * @param {{ percent: AnyMetricPattern, ratio: AnyMetricPattern }} args.pattern + * @param {{ percent: AnySeriesPattern, ratio: AnySeriesPattern }} args.pattern * @param {string} args.name * @param {Color | [Color, Color]} [args.color] * @param {boolean} [args.defaultActive] @@ -646,17 +646,17 @@ export function percentRatioDots({ pattern, name, color, defaultActive }) { */ export function percentRatioBaseline({ pattern, name, color, defaultActive }) { return [ - baseline({ metric: pattern.percent, name, color, defaultActive, unit: Unit.percentage }), - baseline({ metric: pattern.ratio, name, color, defaultActive, unit: Unit.ratio }), + baseline({ series: pattern.percent, name, color, defaultActive, unit: Unit.percentage }), + baseline({ series: pattern.ratio, name, color, defaultActive, unit: Unit.ratio }), ]; } /** * Create a Rolling folder tree where each window is a BpsPercentRatioPattern (percent + ratio) * @param {Object} args - * @param {{ _24h: { percent: AnyMetricPattern, ratio: AnyMetricPattern }, _1w: { percent: AnyMetricPattern, ratio: AnyMetricPattern }, _1m: { percent: AnyMetricPattern, ratio: AnyMetricPattern }, _1y: { percent: AnyMetricPattern, ratio: AnyMetricPattern } }} args.windows + * @param {{ _24h: { percent: AnySeriesPattern, ratio: AnySeriesPattern }, _1w: { percent: AnySeriesPattern, ratio: AnySeriesPattern }, _1m: { percent: AnySeriesPattern, ratio: AnySeriesPattern }, _1y: { percent: AnySeriesPattern, ratio: AnySeriesPattern } }} args.windows * @param {string} args.title - * @param {(args: {pattern: { percent: AnyMetricPattern, ratio: AnyMetricPattern }, name: string, color: Color}) => AnyFetchedSeriesBlueprint[]} [args.series] + * @param {(args: {pattern: { percent: AnySeriesPattern, ratio: AnySeriesPattern }, name: string, color: Color}) => AnyFetchedSeriesBlueprint[]} [args.series] * @returns {PartialOptionsGroup} */ export function rollingPercentRatioTree({ windows, title, series = percentRatio }) { @@ -693,51 +693,51 @@ export function rollingPercentRatioTree({ windows, title, series = percentRatio function distributionSeries(pattern, unit) { const { stat } = colors; return [ - dots({ metric: pattern.average, name: "avg", color: stat.avg, unit }), + dots({ series: pattern.average, name: "avg", color: stat.avg, unit }), dots({ - metric: pattern.median, + series: pattern.median, name: "median", color: stat.median, unit, defaultActive: false, }), dots({ - metric: pattern.max, + series: pattern.max, name: "max", color: stat.max, unit, defaultActive: false, }), dots({ - metric: pattern.min, + series: pattern.min, name: "min", color: stat.min, unit, defaultActive: false, }), dots({ - metric: pattern.pct75, + series: pattern.pct75, name: "pct75", color: stat.pct75, unit, defaultActive: false, }), dots({ - metric: pattern.pct25, + series: pattern.pct25, name: "pct25", color: stat.pct25, unit, defaultActive: false, }), dots({ - metric: pattern.pct90, + series: pattern.pct90, name: "pct90", color: stat.pct90, unit, defaultActive: false, }), dots({ - metric: pattern.pct10, + series: pattern.pct10, name: "pct10", color: stat.pct10, unit, @@ -747,32 +747,32 @@ function distributionSeries(pattern, unit) { } /** - * Create btc/sats/usd series from metrics + * Create btc/sats/usd series from patterns * @param {Object} args - * @param {{ btc: AnyMetricPattern, sats: AnyMetricPattern, usd: AnyMetricPattern }} args.metrics + * @param {{ btc: AnySeriesPattern, sats: AnySeriesPattern, usd: AnySeriesPattern }} args.patterns * @param {string} args.name * @param {Color} [args.color] * @param {boolean} [args.defaultActive] * @returns {AnyFetchedSeriesBlueprint[]} */ -function btcSatsUsdSeries({ metrics, name, color, defaultActive }) { +function btcSatsUsdSeries({ patterns, name, color, defaultActive }) { return [ { - metric: metrics.btc, + series: patterns.btc, title: name, color, unit: Unit.btc, defaultActive, }, { - metric: metrics.sats, + series: patterns.sats, title: name, color, unit: Unit.sats, defaultActive, }, { - metric: metrics.usd, + series: patterns.usd, title: name, color, unit: Unit.usd, @@ -804,14 +804,14 @@ export function chartsFromFull({ { name: "Sum", title, - bottom: [{ metric: pattern.base, title: "base", unit }], + bottom: [{ series: pattern.base, title: "base", unit }], }, rollingWindowsTree({ windows: pattern.sum, title, unit }), distributionWindowsTree({ pattern, title: distTitle, unit }), { name: "Cumulative", title: `${title} (Total)`, - bottom: [{ metric: pattern.cumulative, title: "all-time", unit }], + bottom: [{ series: pattern.cumulative, title: "all-time", unit }], }, ]; } @@ -850,7 +850,7 @@ export function chartsFromSum({ { name: "Sum", title, - bottom: [{ metric: pattern.sum, title: "sum", color: stat.sum, unit }], + bottom: [{ series: pattern.sum, title: "sum", color: stat.sum, unit }], }, rollingWindowsTree({ windows: pattern.rolling.sum, title, unit }), distributionWindowsTree({ pattern: pattern.rolling, title: distTitle, unit }), @@ -862,7 +862,7 @@ export function chartsFromSum({ { name: "Cumulative", title: `${title} (Total)`, - bottom: [{ metric: pattern.cumulative, title: "all-time", unit }], + bottom: [{ series: pattern.cumulative, title: "all-time", unit }], }, ]; } @@ -915,13 +915,13 @@ export function chartsFromCount({ pattern, title, unit, color }) { { name: "Base", title, - bottom: [{ metric: pattern.base, title: "base", color, unit }], + bottom: [{ series: pattern.base, title: "base", color, unit }], }, rollingWindowsTree({ windows: pattern.sum, title, unit }), { name: "Cumulative", title: `${title} (Total)`, - bottom: [{ metric: pattern.cumulative, title: "all-time", color, unit }], + bottom: [{ series: pattern.cumulative, title: "all-time", color, unit }], }, ]; } @@ -939,9 +939,9 @@ export function chartsFromValueFull({ pattern, title }) { name: "Sum", title, bottom: [ - ...btcSatsUsdSeries({ metrics: pattern.base, name: "sum" }), + ...btcSatsUsdSeries({ patterns: pattern.base, name: "sum" }), ...btcSatsUsdSeries({ - metrics: pattern.sum._24h, + patterns: pattern.sum._24h, name: "24h sum", defaultActive: false, }), @@ -951,7 +951,7 @@ export function chartsFromValueFull({ pattern, title }) { name: "Cumulative", title: `${title} (Total)`, bottom: btcSatsUsdSeries({ - metrics: pattern.cumulative, + patterns: pattern.cumulative, name: "all-time", }), }, diff --git a/website/scripts/options/shared.js b/website/scripts/options/shared.js index 7b36535eb..98bb62567 100644 --- a/website/scripts/options/shared.js +++ b/website/scripts/options/shared.js @@ -72,10 +72,10 @@ export function flatMapCohortsWithAll(list, all, fn) { /** * Create a title formatter for chart titles * @param {string} [cohortTitle] - * @returns {(metric: string) => string} + * @returns {(name: string) => string} */ -export const formatCohortTitle = (cohortTitle) => (metric) => - cohortTitle ? `${metric}: ${cohortTitle}` : metric; +export const formatCohortTitle = (cohortTitle) => (name) => + cohortTitle ? `${name}: ${cohortTitle}` : name; /** * Create sats/btc/usd line series from a pattern with .sats/.btc/.usd @@ -90,7 +90,7 @@ export const formatCohortTitle = (cohortTitle) => (metric) => export function satsBtcUsd({ pattern, name, color, defaultActive, style }) { return [ line({ - metric: pattern.btc, + series: pattern.btc, name, color, unit: Unit.btc, @@ -98,7 +98,7 @@ export function satsBtcUsd({ pattern, name, color, defaultActive, style }) { style, }), line({ - metric: pattern.sats, + series: pattern.sats, name, color, unit: Unit.sats, @@ -106,7 +106,7 @@ export function satsBtcUsd({ pattern, name, color, defaultActive, style }) { style, }), line({ - metric: pattern.usd, + series: pattern.usd, name, color, unit: Unit.usd, @@ -119,7 +119,7 @@ export function satsBtcUsd({ pattern, name, color, defaultActive, style }) { /** * Create sats/btc/usd baseline series from a value pattern * @param {Object} args - * @param {{ btc: AnyMetricPattern, sats: AnyMetricPattern, usd: AnyMetricPattern }} args.pattern + * @param {{ btc: AnySeriesPattern, sats: AnySeriesPattern, usd: AnySeriesPattern }} args.pattern * @param {string} args.name * @param {Color} [args.color] * @param {boolean} [args.defaultActive] @@ -128,21 +128,21 @@ export function satsBtcUsd({ pattern, name, color, defaultActive, style }) { export function satsBtcUsdBaseline({ pattern, name, color, defaultActive }) { return [ baseline({ - metric: pattern.btc, + series: pattern.btc, name, color, unit: Unit.btc, defaultActive, }), baseline({ - metric: pattern.sats, + series: pattern.sats, name, color, unit: Unit.sats, defaultActive, }), baseline({ - metric: pattern.usd, + series: pattern.usd, name, color, unit: Unit.usd, @@ -271,7 +271,7 @@ export function satsBtcUsdFullTree({ pattern, name, title, color }) { /** * Create Price + Ratio charts from a simple price pattern (BpsCentsRatioSatsUsdPattern) * @param {Object} args - * @param {AnyPricePattern & { ratio: AnyMetricPattern }} args.pattern + * @param {AnyPricePattern & { ratio: AnySeriesPattern }} args.pattern * @param {string} args.title * @param {string} args.legend * @param {Color} [args.color] @@ -282,15 +282,15 @@ export function simplePriceRatioTree({ pattern, title, legend, color }) { { name: "Price", title, - top: [price({ metric: pattern, name: legend, color })], + top: [price({ series: pattern, name: legend, color })], }, { name: "Ratio", title: `${title} Ratio`, - top: [price({ metric: pattern, name: legend, color })], + top: [price({ series: pattern, name: legend, color })], bottom: [ baseline({ - metric: pattern.ratio, + series: pattern.ratio, name: "Ratio", unit: Unit.ratio, base: 1, @@ -339,11 +339,11 @@ export function priceRatioPercentilesTree({ name: "Price", title, top: [ - price({ metric: pattern, name: legend, color }), + price({ series: pattern, name: legend, color }), ...(priceReferences ?? []), ...pctUsd.map(({ name, prop, color }) => price({ - metric: prop, + series: prop, name, color, defaultActive: false, @@ -356,10 +356,10 @@ export function priceRatioPercentilesTree({ name: "Ratio", title: `${title} Ratio`, top: [ - price({ metric: pattern, name: legend, color }), + price({ series: pattern, name: legend, color }), ...pctUsd.map(({ name, prop, color }) => price({ - metric: prop, + series: prop, name, color, defaultActive: false, @@ -369,14 +369,14 @@ export function priceRatioPercentilesTree({ ], bottom: [ baseline({ - metric: pattern.ratio, + series: pattern.ratio, name: "Ratio", unit: Unit.ratio, base: 1, }), ...pctRatio.map(({ name, prop, color }) => line({ - metric: prop, + series: prop, name, color, defaultActive: false, @@ -507,7 +507,7 @@ export function sdBandsUsd(sd) { /** * Build SD band mappings (ratio) from an SD pattern * @param {Ratio1ySdPattern} sd - * @param {AnyMetricPattern} smaRatio + * @param {AnySeriesPattern} smaRatio */ export function sdBandsRatio(sd, smaRatio) { return /** @type {const} */ ([ @@ -533,19 +533,19 @@ export function sdBandsRatio(sd, smaRatio) { */ export function ratioSmas(ratio) { return [ - { name: "1w SMA", metric: ratio.sma._1w.ratio }, - { name: "1m SMA", metric: ratio.sma._1m.ratio }, - { name: "1y SMA", metric: ratio.sma._1y.ratio }, - { name: "2y SMA", metric: ratio.sma._2y.ratio }, - { name: "4y SMA", metric: ratio.sma._4y.ratio }, - { name: "All SMA", metric: ratio.sma.all.ratio, color: colors.time.all }, + { name: "1w SMA", series: ratio.sma._1w.ratio }, + { name: "1m SMA", series: ratio.sma._1m.ratio }, + { name: "1y SMA", series: ratio.sma._1y.ratio }, + { name: "2y SMA", series: ratio.sma._2y.ratio }, + { name: "4y SMA", series: ratio.sma._4y.ratio }, + { name: "All SMA", series: ratio.sma.all.ratio, color: colors.time.all }, ].map((s, i, arr) => ({ color: colors.at(i, arr.length), ...s })); } /** * Create ratio chart from ActivePriceRatioPattern * @param {Object} args - * @param {(metric: string) => string} args.title + * @param {(name: string) => string} args.title * @param {AnyPricePattern} args.pricePattern - The price pattern to show in top pane * @param {AnyRatioPattern} args.ratio - The ratio pattern * @param {Color} args.color @@ -557,10 +557,10 @@ export function createRatioChart({ title, pricePattern, ratio, color, name }) { name: name ?? "ratio", title: title(name ?? "Ratio"), top: [ - price({ metric: pricePattern, name: "Price", color }), + price({ series: pricePattern, name: "Price", color }), ...percentileUsdMap(ratio).map(({ name, prop, color }) => price({ - metric: prop, + series: prop, name, color, defaultActive: false, @@ -570,17 +570,17 @@ export function createRatioChart({ title, pricePattern, ratio, color, name }) { ], bottom: [ baseline({ - metric: ratio.ratio, + series: ratio.ratio, name: "Ratio", unit: Unit.ratio, base: 1, }), - ...ratioSmas(ratio).map(({ name, metric, color }) => - line({ metric, name, color, unit: Unit.ratio, defaultActive: false }), + ...ratioSmas(ratio).map(({ name, series, color }) => + line({ series, name, color, unit: Unit.ratio, defaultActive: false }), ), ...percentileMap(ratio).map(({ name, prop, color }) => line({ - metric: prop, + series: prop, name, color, defaultActive: false, @@ -595,7 +595,7 @@ export function createRatioChart({ title, pricePattern, ratio, color, name }) { /** * Create ZScores folder from ActivePriceRatioPattern * @param {Object} args - * @param {(suffix: string) => string} args.formatTitle - Function that takes metric suffix and returns full title + * @param {(suffix: string) => string} args.formatTitle - Function that takes series suffix and returns full title * @param {string} args.legend * @param {AnyPricePattern} args.pricePattern - The price pattern to show in top pane * @param {AnyRatioPattern} args.ratio - The ratio pattern @@ -625,10 +625,10 @@ export function createZScoresFolder({ name: "Compare", title: formatTitle("Z-Scores"), top: [ - price({ metric: pricePattern, name: legend, color }), + price({ series: pricePattern, name: legend, color }), ...zscorePeriods.map((p) => price({ - metric: p.sd._0sd, + series: p.sd._0sd, name: `${p.name} 0σ`, color: p.color, defaultActive: false, @@ -638,7 +638,7 @@ export function createZScoresFolder({ bottom: [ ...zscorePeriods.reverse().map((p) => line({ - metric: p.sd.zscore, + series: p.sd.zscore, name: p.name, color: p.color, unit: Unit.sd, @@ -653,7 +653,7 @@ export function createZScoresFolder({ }, ...sdPats.map(({ nameAddon, titleAddon, sd, smaRatio }) => { const prefix = titleAddon ? `${titleAddon} ` : ""; - const topPrice = price({ metric: pricePattern, name: legend, color }); + const topPrice = price({ series: pricePattern, name: legend, color }); return { name: nameAddon, tree: [ @@ -665,7 +665,7 @@ export function createZScoresFolder({ ...sdBandsUsd(sd).map( ({ name: bandName, prop, color: bandColor }) => price({ - metric: prop, + series: prop, name: bandName, color: bandColor, defaultActive: false, @@ -674,7 +674,7 @@ export function createZScoresFolder({ ], bottom: [ baseline({ - metric: sd.zscore, + series: sd.zscore, name: "Z-Score", unit: Unit.sd, }), @@ -694,7 +694,7 @@ export function createZScoresFolder({ top: [topPrice], bottom: [ baseline({ - metric: ratio.ratio, + series: ratio.ratio, name: "Ratio", unit: Unit.ratio, base: 1, @@ -702,7 +702,7 @@ export function createZScoresFolder({ ...sdBandsRatio(sd, smaRatio).map( ({ name: bandName, prop, color: bandColor }) => line({ - metric: prop, + series: prop, name: bandName, color: bandColor, unit: Unit.ratio, @@ -717,7 +717,7 @@ export function createZScoresFolder({ top: [topPrice], bottom: [ line({ - metric: sd.sd, + series: sd.sd, name: "Volatility", color: colors.gray, unit: Unit.percentage, @@ -733,7 +733,7 @@ export function createZScoresFolder({ /** * Create price + ratio + z-scores charts - flat array - * Unified helper for averages, distribution, and other price-based metrics + * Unified helper for averages, distribution, and other price-based series * @param {Object} args * @param {string} args.context - Context string for ratio/z-scores titles (e.g., "1 Week SMA", "STH") * @param {string} args.legend - Legend name for the price series @@ -761,7 +761,7 @@ export function createPriceRatioCharts({ name: "Price", title: priceTitle ?? context, top: [ - price({ metric: pricePattern, name: legend, color }), + price({ series: pricePattern, name: legend, color }), ...(priceReferences ?? []), ], }, diff --git a/website/scripts/options/types.js b/website/scripts/options/types.js index 93c3a2c0c..d02a4a305 100644 --- a/website/scripts/options/types.js +++ b/website/scripts/options/types.js @@ -44,7 +44,7 @@ * * @typedef {Object} PriceSeriesBlueprintSpecific * @property {"Price"} type - * @property {AnyMetricPattern} ohlcMetric - OHLC metric for candlestick (>= 1h indexes) + * @property {AnySeriesPattern} ohlcSeries - OHLC series for candlestick (>= 1h indexes) * @property {[Color, Color]} [colors] * @property {CandlestickSeriesPartialOptions} [options] * @typedef {BaseSeriesBlueprint & PriceSeriesBlueprintSpecific} PriceSeriesBlueprint @@ -53,7 +53,7 @@ * * @typedef {AnySeriesBlueprint["type"]} SeriesType * - * @typedef {{ metric: AnyMetricPattern, unit?: Unit }} FetchedAnySeriesOptions + * @typedef {{ series: AnySeriesPattern, unit?: Unit }} FetchedAnySeriesOptions * * @typedef {BaselineSeriesBlueprint & FetchedAnySeriesOptions} FetchedBaselineSeriesBlueprint * @typedef {CandlestickSeriesBlueprint & FetchedAnySeriesOptions} FetchedCandlestickSeriesBlueprint @@ -63,14 +63,14 @@ * @typedef {DotsBaselineSeriesBlueprint & FetchedAnySeriesOptions} FetchedDotsBaselineSeriesBlueprint * @typedef {AnySeriesBlueprint & FetchedAnySeriesOptions} AnyFetchedSeriesBlueprint * - * Any pattern with usd and sats sub-metrics (auto-expands to USD + sats) - * @typedef {{ usd: AnyMetricPattern, sats: AnyMetricPattern }} AnyPricePattern + * Any pattern with usd and sats sub-series (auto-expands to USD + sats) + * @typedef {{ usd: AnySeriesPattern, sats: AnySeriesPattern }} AnyPricePattern * - * Any pattern with sats, btc, and usd sub-metrics (value patterns like stack) - * @typedef {{ sats: AnyMetricPattern, btc: AnyMetricPattern, usd: AnyMetricPattern }} AnyValuePattern + * Any pattern with sats, btc, and usd sub-series (value patterns like stack) + * @typedef {{ sats: AnySeriesPattern, btc: AnySeriesPattern, usd: AnySeriesPattern }} AnyValuePattern * * Top pane price series - requires a price pattern with usd/sats, auto-expands to USD + sats - * @typedef {{ metric: AnyPricePattern }} FetchedPriceSeriesOptions + * @typedef {{ series: AnyPricePattern }} FetchedPriceSeriesOptions * @typedef {LineSeriesBlueprint & FetchedPriceSeriesOptions} FetchedPriceSeriesBlueprint * * @typedef {Object} PartialOption diff --git a/website/scripts/options/unused.js b/website/scripts/options/unused.js index bbfd2d839..3242db71b 100644 --- a/website/scripts/options/unused.js +++ b/website/scripts/options/unused.js @@ -2,8 +2,8 @@ import { localhost } from "../utils/env.js"; import { INDEX_LABEL } from "../utils/serde.js"; /** - * Check if a metric pattern has at least one chartable index - * @param {AnyMetricPattern} node + * Check if a series pattern has at least one chartable index + * @param {AnySeriesPattern} node * @returns {boolean} */ function hasChartableIndex(node) { @@ -12,16 +12,16 @@ function hasChartableIndex(node) { } /** - * Walk a metrics tree and collect all chartable metric patterns + * Walk a series tree and collect all chartable series patterns * @param {TreeNode | null | undefined} node - * @param {Map} map + * @param {Map} map * @param {string[]} path */ -function walkMetrics(node, map, path) { +function walkSeries(node, map, path) { if (node && "by" in node) { - const metricNode = /** @type {AnyMetricPattern} */ (node); - if (!hasChartableIndex(metricNode)) return; - map.set(metricNode, path); + const seriesNode = /** @type {AnySeriesPattern} */ (node); + if (!hasChartableIndex(seriesNode)) return; + map.set(seriesNode, path); } else if (node && typeof node === "object") { for (const [key, value] of Object.entries(node)) { const kn = key.toLowerCase(); @@ -56,7 +56,7 @@ function walkMetrics(node, map, path) { kn.endsWith("indexes") ) continue; - walkMetrics(/** @type {TreeNode | null | undefined} */ (value), map, [ + walkSeries(/** @type {TreeNode | null | undefined} */ (value), map, [ ...path, key, ]); @@ -65,9 +65,9 @@ function walkMetrics(node, map, path) { } /** - * Walk partial options tree and delete referenced metrics from the map + * Walk partial options tree and delete referenced series from the map * @param {PartialOptionsTree} options - * @param {Map} map + * @param {Map} map */ function walkOptions(options, map) { for (const node of options) { @@ -82,40 +82,40 @@ function walkOptions(options, map) { } /** - * @param {Map} map + * @param {Map} map * @param {(AnyFetchedSeriesBlueprint | FetchedPriceSeriesBlueprint)[]} [arr] */ function markUsedBlueprints(map, arr) { if (!arr) return; for (let i = 0; i < arr.length; i++) { - const metric = arr[i].metric; - if (!metric) continue; - const maybePriceMetric = - /** @type {{ usd?: AnyMetricPattern, sats?: AnyMetricPattern }} */ ( - /** @type {unknown} */ (metric) + const s = arr[i].series; + if (!s) continue; + const maybePriceSeries = + /** @type {{ usd?: AnySeriesPattern, sats?: AnySeriesPattern }} */ ( + /** @type {unknown} */ (s) ); - if (maybePriceMetric.usd?.by && maybePriceMetric.sats?.by) { - map.delete(maybePriceMetric.usd); - map.delete(maybePriceMetric.sats); + if (maybePriceSeries.usd?.by && maybePriceSeries.sats?.by) { + map.delete(maybePriceSeries.usd); + map.delete(maybePriceSeries.sats); } else { - map.delete(/** @type {AnyMetricPattern} */ (metric)); + map.delete(/** @type {AnySeriesPattern} */ (s)); } } } /** - * Log unused metrics to console (localhost only) - * @param {TreeNode} metricsTree + * Log unused series to console (localhost only) + * @param {TreeNode} seriesTree * @param {PartialOptionsTree} partialOptions */ -export function logUnused(metricsTree, partialOptions) { +export function logUnused(seriesTree, partialOptions) { if (!localhost) return; console.log(extractTreeStructure(partialOptions)); - /** @type {Map} */ + /** @type {Map} */ const all = new Map(); - walkMetrics(metricsTree, all, []); + walkSeries(seriesTree, all, []); walkOptions(partialOptions, all); if (!all.size) return; @@ -135,7 +135,7 @@ export function logUnused(metricsTree, partialOptions) { } } - console.log("Unused metrics:", { count: all.size, tree }); + console.log("Unused series:", { count: all.size, tree }); } /** @@ -154,10 +154,10 @@ export function extractTreeStructure(options) { /** @type {Record} */ const grouped = {}; for (const s of series) { - const metric = /** @type {AnyMetricPattern | AnyPricePattern} */ ( - s.metric + const pattern = /** @type {AnySeriesPattern | AnyPricePattern} */ ( + s.series ); - if (isTop && "usd" in metric && "sats" in metric) { + if (isTop && "usd" in pattern && "sats" in pattern) { const title = s.title || s.key || "unnamed"; (grouped["USD"] ??= []).push(title); (grouped["sats"] ??= []).push(title); diff --git a/website/scripts/panes/_table.js b/website/scripts/panes/_table.js index 558250d01..19ba551d6 100644 --- a/website/scripts/panes/_table.js +++ b/website/scripts/panes/_table.js @@ -3,7 +3,7 @@ // import { randomFromArray } from "../utils/array.js"; // import { createButtonElement, createHeader, createSelect } from "../utils/dom.js"; // import { tableElement } from "../utils/elements.js"; -// import { serdeMetrics, serdeString } from "../utils/serde.js"; +// import { serdeSeries, serdeString } from "../utils/serde.js"; // import { resetParams } from "../utils/url.js"; // export function init() { @@ -45,7 +45,7 @@ // // * @param {Resources} args.resources // // */ // // function createTable({ brk, signals, option, resources }) { -// // const indexToMetrics = createIndexToMetrics(metricToIndexes); +// // const indexToSeries = createIndexToMetrics(seriesToIndexes); // // const serializedIndexes = createSerializedIndexes(); // // /** @type {SerializedIndex} */ @@ -78,17 +78,17 @@ // // resetParams(option); // // } -// // const possibleMetrics = indexToMetrics[index]; +// // const possibleSeries = indexToSeries[index]; // // const columns = signals.createSignal(/** @type {Metric[]} */ ([]), { // // equals: false, // // save: { -// // ...serdeMetrics, +// // ...serdeSeries, // // keyPrefix: `table-${serializedIndex()}`, // // key: `columns`, // // }, // // }); -// // columns.set((l) => l.filter((id) => possibleMetrics.includes(id))); +// // columns.set((l) => l.filter((id) => possibleSeries.includes(id))); // // signals.createEffect(columns, (columns) => { // // console.log(columns); @@ -204,35 +204,35 @@ // // const owner = signals.getOwner(); // // /** -// // * @param {Metric} metric +// // * @param {Series} s // // * @param {number} [_colIndex] // // */ -// // function addCol(metric, _colIndex = columns().length) { +// // function addCol(s, _colIndex = columns().length) { // // signals.runWithOwner(owner, () => { // // /** @type {VoidFunction | undefined} */ // // let dispose; // // signals.createRoot((_dispose) => { // // dispose = _dispose; -// // const metricOption = signals.createSignal({ -// // name: metric, -// // value: metric, +// // const seriesOption = signals.createSignal({ +// // name: s, +// // value: s, // // }); // // const { select } = createSelect({ -// // list: possibleMetrics.map((metric) => ({ -// // name: metric, -// // value: metric, +// // list: possibleSeries.map((s) => ({ +// // name: s, +// // value: s, // // })), -// // signal: metricOption, +// // signal: seriesOption, // // }); -// // signals.createEffect(metricOption, (metricOption) => { -// // select.style.width = `${21 + 7.25 * metricOption.name.length}px`; +// // signals.createEffect(seriesOption, (seriesOption) => { +// // select.style.width = `${21 + 7.25 * seriesOption.name.length}px`; // // }); // // if (_colIndex === columns().length) { // // columns.set((l) => { -// // l.push(metric); +// // l.push(s); // // return l; // // }); // // } @@ -282,7 +282,7 @@ // // const th = addThCol({ // // select, -// // unit: serdeUnit.deserialize(metric), +// // unit: serdeUnit.deserialize(s), // // onLeft: createMoveColumnFunction(false), // // onRight: createMoveColumnFunction(true), // // onRemove: () => { @@ -314,23 +314,23 @@ // // } // // signals.createEffect( -// // () => metricOption().name, -// // (metric, prevMetric) => { -// // const unit = serdeUnit.deserialize(metric); +// // () => seriesOption().name, +// // (s, prevSeries) => { +// // const unit = serdeUnit.deserialize(s); // // th.setUnit(unit); -// // const vec = resources.getOrCreate(index, metric); +// // const vec = resources.getOrCreate(index, s); // // vec.fetch({ from, to }); // // const fetchedKey = resources.genFetchedKey({ from, to }); // // columns.set((l) => { -// // const i = l.indexOf(prevMetric ?? metric); +// // const i = l.indexOf(prevSeries ?? s); // // if (i === -1) { -// // l.push(metric); +// // l.push(s); // // } else { -// // l[i] = metric; +// // l[i] = s; // // } // // return l; // // }); @@ -355,7 +355,7 @@ // // }, // // ); -// // return () => metric; +// // return () => s; // // }, // // ); // // }); @@ -367,10 +367,10 @@ // // }); // // } -// // columns().forEach((metric, colIndex) => addCol(metric, colIndex)); +// // columns().forEach((s, colIndex) => addCol(s, colIndex)); // // obj.addRandomCol = function () { -// // addCol(randomFromArray(possibleMetrics)); +// // addCol(randomFromArray(possibleSeries)); // // }; // // return () => index; @@ -380,24 +380,24 @@ // // } // /** -// * @param {MetricToIndexes} metricToIndexes +// * @param {SeriesToIndexes} seriesToIndexes // */ -// function createIndexToMetrics(metricToIndexes) { -// // const indexToMetrics = Object.entries(metricToIndexes).reduce( +// function createIndexToMetrics(seriesToIndexes) { +// // const indexToSeries = Object.entries(seriesToIndexes).reduce( // // (arr, [_id, indexes]) => { -// // const id = /** @type {Metric} */ (_id); +// // const id = /** @type {Series} */ (_id); // // indexes.forEach((i) => { // // arr[i] ??= []; // // arr[i].push(id); // // }); // // return arr; // // }, -// // /** @type {Metric[][]} */ (Array.from({ length: 24 })), +// // /** @type {Series[][]} */ (Array.from({ length: 24 })), // // ); -// // indexToMetrics.forEach((arr) => { +// // indexToSeries.forEach((arr) => { // // arr.sort(); // // }); -// // return indexToMetrics; +// // return indexToSeries; // } // /** diff --git a/website/scripts/panes/chart.js b/website/scripts/panes/chart.js index 12827fb6f..40f2c3b14 100644 --- a/website/scripts/panes/chart.js +++ b/website/scripts/panes/chart.js @@ -40,14 +40,14 @@ export function init() { /** @type {Map} */ const result = new Map(); - const { ohlc, spot } = brk.metrics.prices; + const { ohlc, spot } = brk.series.prices; result.set(Unit.usd, [ /** @type {AnyFetchedSeriesBlueprint} */ ({ type: "Price", title: "Price", - metric: spot.usd, - ohlcMetric: ohlc.usd, + series: spot.usd, + ohlcSeries: ohlc.usd, }), ...(optionTop.get(Unit.usd) ?? []), ]); @@ -56,8 +56,8 @@ export function init() { /** @type {AnyFetchedSeriesBlueprint} */ ({ type: "Price", title: "Price", - metric: spot.sats, - ohlcMetric: ohlc.sats, + series: spot.sats, + ohlcSeries: ohlc.sats, colors: /** @type {const} */ ([colors.bi.p1[1], colors.bi.p1[0]]), }), ...(optionTop.get(Unit.sats) ?? []), @@ -143,10 +143,10 @@ function computeChoices(opt) { [Array.from(opt.top().values()), Array.from(opt.bottom().values())] .flat(2) .filter((blueprint) => { - const path = Object.values(blueprint.metric.by)[0]?.path ?? ""; + const path = Object.values(blueprint.series.by)[0]?.path ?? ""; return !path.includes("constant_"); }) - .flatMap((blueprint) => blueprint.metric.indexes()), + .flatMap((blueprint) => blueprint.series.indexes()), ); const groups = ALL_GROUPS diff --git a/website/scripts/types.js b/website/scripts/types.js index c7c66cd86..ff516e626 100644 --- a/website/scripts/types.js +++ b/website/scripts/types.js @@ -2,7 +2,7 @@ * @import { IChartApi, ISeriesApi as _ISeriesApi, SeriesDefinition, SingleValueData as _SingleValueData, CandlestickData as _CandlestickData, BaselineData as _BaselineData, HistogramData as _HistogramData, SeriesType as LCSeriesType, IPaneApi, LineSeriesPartialOptions as _LineSeriesPartialOptions, HistogramSeriesPartialOptions as _HistogramSeriesPartialOptions, BaselineSeriesPartialOptions as _BaselineSeriesPartialOptions, CandlestickSeriesPartialOptions as _CandlestickSeriesPartialOptions, WhitespaceData, DeepPartial, ChartOptions, Time, LineData as _LineData, createChart as CreateLCChart, LineStyle, createSeriesMarkers as CreateSeriesMarkers, SeriesMarker, ISeriesMarkersPluginApi } from './modules/lightweight-charts/5.1.0/dist/typings.js' * * @import * as Brk from "./modules/brk-client/index.js" - * @import { BrkClient, Index, Metric, MetricData } from "./modules/brk-client/index.js" + * @import { BrkClient, Index, Series as BrkSeries, SeriesData } from "./modules/brk-client/index.js" * * @import { Options } from './options/full.js' * @@ -30,17 +30,17 @@ * @typedef {SeriesMarker